Changeset 1130


Ignore:
Timestamp:
Feb 3, 2010, 5:07:51 PM (12 years ago)
Author:
arnold
Message:

Added references to some P2PProjects, so the global SLN compiles correctly again

Location:
trunk
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher_IControl/KeySearcher_IControl.csproj

    r971 r1130  
    6969      <Name>KeySearcher</Name>
    7070    </ProjectReference>
     71    <ProjectReference Include="..\PeerToPeerJobs\PeerToPeerJobs.csproj">
     72      <Project>{F1258427-AFDF-4DF7-ABF1-758A2325F505}</Project>
     73      <Name>PeerToPeerJobs</Name>
     74    </ProjectReference>
    7175  </ItemGroup>
    7276  <ItemGroup>
  • trunk/CrypPlugins/PeerToPeerJobs/JobResult.cs

    r1129 r1130  
    88namespace Cryptool.Plugins.PeerToPeer.Jobs
    99{
    10     public class JobResult<JobType, JobResultType>
    11         where JobType : IJobPart<JobType>
     10    public class JobResult<JobResultType> : IJobResult<JobResultType>
    1211    {
    1312        #region Variables
    1413
    15         private JobType job;
    16         public JobType Job
    17         {
    18             get { return this.job; }
    19             private set{this.job = value;}
     14        private int jobId;
     15        public int JobId
     16        {
     17            get {  return this.jobId; }
     18            set { this.jobId = value; }
    2019        }
    2120        private bool isIntermediateJobResult;
     
    2322        {
    2423            get { return this.isIntermediateJobResult;}
    25             private set { this.isIntermediateJobResult = value; }
     24            set { this.isIntermediateJobResult = value; }
    2625        }
    2726        private TimeSpan processingTime;
     
    2928        {
    3029            get { return this.processingTime;}
    31             private set { this.processingTime = value; }
     30            set { this.processingTime = value; }
    3231        }
    3332        private JobResultType result;
     
    3534        {
    3635            get{return this.result;}
    37             private set { this.result = value; }
     36            set { this.result = value; }
    3837        }
    3938
     
    4342        /// Creates a new JobResult (this is an endresul!)
    4443        /// </summary>
    45         /// <param name="job">job for which you have a result</param>
     44        /// <param name="jobId">jobId for which you have a result</param>
    4645        /// <param name="result">result of the job (e.g. simple conclusion, list, complex data structure)</param>
    4746        /// <param name="processingTime">Timespan between begin and end of processing the job</param>
    48         public JobResult(JobType job, JobResultType result, TimeSpan processingTime)
    49             :this(job,result,processingTime,false)
     47        public JobResult(int jobId, JobResultType result, TimeSpan processingTime)
     48            :this(jobId,result,processingTime,false)
    5049        { }
    5150
     
    5352        /// Creates a new JobResult (you can choose if this is only an intermediate result or the endresult)
    5453        /// </summary>
    55         /// <param name="job">job for which you have a result</param>
     54        /// <param name="jobId">jobId for which you have a result</param>
    5655        /// <param name="result">result of the job (e.g. simple conclusion, list, complex data structure)</param>
    5756        /// <param name="processingTime">Timespan between begin and end of processing the job</param>
    5857        /// <param name="isIntermediateResult">Is this is only an intermediate result, set this parameter to true, otherwise choose false</param>
    59         public JobResult(JobType job, JobResultType result, TimeSpan processingTime, bool isIntermediateResult)
    60         {
    61             this.Job = job;
     58        public JobResult(int jobId, JobResultType result, TimeSpan processingTime, bool isIntermediateResult)
     59        {
     60            this.JobId = jobId;
    6261            this.Result = result;
    6362            this.ProcessingTime = processingTime;
     
    6766        #region Serialization methods
    6867
    69         /* 1 Byte:  serialized Job length
    70          * x Bytes: serialized Job data
    71          * 1 Byte:  serialized Job Result length
     68        /* 4 Bytes: serialized JobId
     69         * 4 Bytes: serialized Job Result length
    7270         * y Bytes: serialized Job Result data
    7371         * 4 Bytes: isIntermedResult
     
    7674         * 4 Bytes: procTime.Minutes
    7775         * 4 Bytes: procTime.Seconds
    78          * 4 Byte:s procTime.Milliseconds */
     76         * 4 Bytes: procTime.Milliseconds */
    7977        /// <summary>
    8078        /// Serializes the whole class, so you can recreate this instance elsewhere by dint of this byte[]
     
    8785            try
    8886            {
    89                 /* Serialize job via Reflection */
    90                 //byte[] serializedJob = GetSerializationViaReflection(this.Job);
    91                 byte[] serializedJob = this.Job.Serialize();
    92                 byte[] serializedJobLen = BitConverter.GetBytes(serializedJob.Length);
    93                 memStream.Write(serializedJobLen, 0, serializedJobLen.Length);
    94                 memStream.Write(serializedJob, 0, serializedJob.Length);
     87                /* Serialize jobId */
     88                byte[] intJobId = BitConverter.GetBytes(this.JobId);
     89                memStream.Write(intJobId, 0, intJobId.Length);
    9590
    9691                /* Serialize job result via Reflection */
     
    140135            try
    141136            {
    142                 /* Deserialize Job data */
     137                /* Deserialize JobId */
    143138                byte[] readInt = new byte[4];
    144139                memStream.Read(readInt, 0, readInt.Length);
    145                 int serializedDataLen = BitConverter.ToInt32(readInt,0);
    146                 byte[] serializedJob = new byte[serializedDataLen];
    147                 memStream.Read(serializedJob,0,serializedJob.Length);
    148                 //this.Job = (JobType)GetDeserializationViaReflection(serializedJob, this.Job);
    149                 this.Job = this.Job.Deserialize(serializedJob);
     140                this.JobId = BitConverter.ToInt32(readInt,0);
    150141
    151142                /* Deserialize Job result data */
    152143                memStream.Read(readInt,0,readInt.Length);
    153                 serializedDataLen = BitConverter.ToInt32(readInt,0);
     144                int serializedDataLen = BitConverter.ToInt32(readInt,0);
    154145                byte[] serializedJobResultByte = new byte[serializedDataLen];
    155146                memStream.Read(serializedJobResultByte, 0, serializedJobResultByte.Length);
  • trunk/CrypPlugins/PeerToPeerJobs/PeerToPeerJobs.csproj

    r1129 r1130  
    4848  </ItemGroup>
    4949  <ItemGroup>
     50    <Compile Include="IJobResult.cs" />
    5051    <Compile Include="JobResult.cs" />
    5152    <Compile Include="IJobStack.cs" />
  • trunk/CrypPlugins/PeerToPeerManager/P2PManagerBase.cs

    r1125 r1130  
    226226        {
    227227            int iCycle = 0;
    228             int iFreePatternAmount = (int)this.leftKeyPatterns.Count().LongValue();
     228            int iFreePatternAmount = (int)this.leftKeyPatterns.Count();
    229229
    230230            // gets only the free workers, which had register at this manager
     
    267267            GetProgressInformation();
    268268
    269             GuiLogging(iCycle.ToString() + " pattern(s) dispersed. Patterns left: " + this.leftKeyPatterns.Count().LongValue().ToString(), NotificationLevel.Info);
     269            GuiLogging(iCycle.ToString() + " pattern(s) dispersed. Patterns left: " + this.leftKeyPatterns.Count().ToString(), NotificationLevel.Info);
    270270            return iCycle;
    271271        }
     
    277277        private double GetProgressInformation()
    278278        {
    279             double leftPatterns = (double)this.leftKeyPatterns.Count().LongValue();
     279            double leftPatterns = (double)this.leftKeyPatterns.Count();
    280280            double finishedPatterns = this.patternResults.Count;
    281281            double patternsInProcess = this.allocatedPatterns.Count;
     
    342342            /* BEGIN: Use new KeyPatternPool */
    343343            this.leftKeyPatterns = new KeyPatternPool(keyPattern, this.KeyPatternPartSize);
    344             GuiLogging("Enqueue " + this.leftKeyPatterns.Count().LongValue().ToString() + " KeyPattern-Parts to the JobList.", NotificationLevel.Debug);
     344            GuiLogging("Enqueue " + this.leftKeyPatterns.Count().ToString() + " KeyPattern-Parts to the JobList.", NotificationLevel.Debug);
    345345            /* END: Use new KeyPatternPool */
    346346
     
    451451        public int LeftPatterns
    452452        {
    453             get { return (int)this.leftKeyPatterns.Count().LongValue(); }
     453            get { return (int)this.leftKeyPatterns.Count(); }
    454454        }
    455455        public int FinishedPatterns
  • trunk/CrypPlugins/PeerToPeerManager/PeerToPeerManager.csproj

    r1090 r1130  
    8080      <Name>PeerToPeerBase</Name>
    8181    </ProjectReference>
     82    <ProjectReference Include="..\PeerToPeerJobs\PeerToPeerJobs.csproj">
     83      <Project>{F1258427-AFDF-4DF7-ABF1-758A2325F505}</Project>
     84      <Name>PeerToPeerJobs</Name>
     85    </ProjectReference>
    8286    <ProjectReference Include="..\PeerToPeerPublisher\PeerToPeerPublisher.csproj">
    8387      <Project>{A1E7F287-DFC1-44C2-A681-C62DF46B43C5}</Project>
  • trunk/CrypPlugins/PeerToPeerSubscriber/P2PSubscriberBase.cs

    r1129 r1130  
    306306                GuiLogging("First time received publishers ID.", NotificationLevel.Debug);
    307307            }
     308            //else if (actualPublisher != pid)
     309            //{
     310            //    GuiLogging("Publisher has been changed from ID '" + actualPublisher + "' to '" + pubId + "'", NotificationLevel.Debug);
     311            //    SendMessage(pubId, PubSubMessageType.Register);
     312            //    actualPublisher = pid;
     313            //}
    308314
    309315            GuiLogging("RECEIVED: Publishers' peer ID '" + pid + "', Alive-Msg-Interval: " + sendAliveMessageInterval / 1000 + " sec!", NotificationLevel.Debug);
  • trunk/CrypPlugins/PeerToPeerWorker/PeerToPeerWorker.csproj

    r971 r1130  
    7777      <Name>PeerToPeerBase</Name>
    7878    </ProjectReference>
     79    <ProjectReference Include="..\PeerToPeerJobs\PeerToPeerJobs.csproj">
     80      <Project>{F1258427-AFDF-4DF7-ABF1-758A2325F505}</Project>
     81      <Name>PeerToPeerJobs</Name>
     82    </ProjectReference>
    7983    <ProjectReference Include="..\PeerToPeerSubscriber\PeerToPeerSubscriber.csproj">
    8084      <Project>{612FEE87-F51F-4BE6-81D1-F91EA4A5DD43}</Project>
  • trunk/CrypTool 2.0.sln

    r1115 r1130  
    208208EndProject
    209209Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PeerToPeerSubscriber", "CrypPlugins\PeerToPeerSubscriber\PeerToPeerSubscriber.csproj", "{612FEE87-F51F-4BE6-81D1-F91EA4A5DD43}"
     210EndProject
     211Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PeerToPeerJobs", "CrypPlugins\PeerToPeerJobs\PeerToPeerJobs.csproj", "{F1258427-AFDF-4DF7-ABF1-758A2325F505}"
    210212EndProject
    211213Global
     
    11851187                {612FEE87-F51F-4BE6-81D1-F91EA4A5DD43}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
    11861188                {612FEE87-F51F-4BE6-81D1-F91EA4A5DD43}.Release|Mixed Platforms.Build.0 = Release|Any CPU
     1189                {F1258427-AFDF-4DF7-ABF1-758A2325F505}.Debug|.NET.ActiveCfg = Debug|Any CPU
     1190                {F1258427-AFDF-4DF7-ABF1-758A2325F505}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     1191                {F1258427-AFDF-4DF7-ABF1-758A2325F505}.Debug|Any CPU.Build.0 = Debug|Any CPU
     1192                {F1258427-AFDF-4DF7-ABF1-758A2325F505}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
     1193                {F1258427-AFDF-4DF7-ABF1-758A2325F505}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
     1194                {F1258427-AFDF-4DF7-ABF1-758A2325F505}.Release|.NET.ActiveCfg = Release|Any CPU
     1195                {F1258427-AFDF-4DF7-ABF1-758A2325F505}.Release|Any CPU.ActiveCfg = Release|Any CPU
     1196                {F1258427-AFDF-4DF7-ABF1-758A2325F505}.Release|Any CPU.Build.0 = Release|Any CPU
     1197                {F1258427-AFDF-4DF7-ABF1-758A2325F505}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
     1198                {F1258427-AFDF-4DF7-ABF1-758A2325F505}.Release|Mixed Platforms.Build.0 = Release|Any CPU
    11871199        EndGlobalSection
    11881200        GlobalSection(SolutionProperties) = preSolution
     
    11991211                {A1E7F287-DFC1-44C2-A681-C62DF46B43C5} = {775BB529-52BD-4B18-A092-E4EA70E53838}
    12001212                {612FEE87-F51F-4BE6-81D1-F91EA4A5DD43} = {775BB529-52BD-4B18-A092-E4EA70E53838}
     1213                {F1258427-AFDF-4DF7-ABF1-758A2325F505} = {775BB529-52BD-4B18-A092-E4EA70E53838}
    12011214        EndGlobalSection
    12021215EndGlobal
Note: See TracChangeset for help on using the changeset viewer.