source: trunk/CrypPlugins/QuadraticSieve/PeerToPeerStatusUpdater.cs @ 1773

Last change on this file since 1773 was 1773, checked in by Sven Rech, 11 years ago

quadratic sieve fixes and button for status key

File size: 967 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using Cryptool.P2PEditor.Helper;
6using Cryptool.P2PEditor.Distributed;
7using Cryptool.P2P;
8
9namespace Cryptool.Plugins.QuadraticSieve
10{
11    class PeerToPeerStatusUpdater
12    {
13        private PeerToPeer peerToPeer;
14
15        public PeerToPeerStatusUpdater(PeerToPeer peerToPeer)
16        {
17            this.peerToPeer = peerToPeer;
18        }
19
20        public void UpdateStatus(double progress)
21        {
22            if (!P2PManager.IsConnected)
23                return;
24
25            DistributedJobStatus.Status status;
26            if (progress == 1)
27                status = DistributedJobStatus.Status.Finished;
28            else
29                status = DistributedJobStatus.Status.Active;
30
31            DistributedStatusUpdater.UpdateStatus(peerToPeer.StatusKey(), status, peerToPeer.getActivePeers(), progress, new DateTime());
32        }
33    }
34}
Note: See TracBrowser for help on using the repository browser.