Ignore:
Timestamp:
Dec 17, 2010, 7:38:52 PM (11 years ago)
Author:
nolte
Message:

User Statistics Added. The CSV Data will be saved under C\Users\ct2\Local\CrypTool2...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher/P2P/Storage/StorageHelper.cs

    r2199 r2217  
    1818
    1919        //VERSIONNUMBER: Important. Set it +1 manually everytime the length of the MemoryStream Changes
    20         private const int version = 1;
     20        private const int version = 2;
    2121
    2222        public StorageHelper(KeySearcher keySearcher, StatisticsGenerator statisticsGenerator, StatusContainer statusContainer)
     
    5050            }                       
    5151           
    52             //TODO: Dictionary write;
    53 //----------------------------------------------------------------------------------
    54 /* 
     52 
    5553            //Creating a copy of the activity dictionary
    5654            Dictionary<String, Dictionary<long, int>> copyAct = nodeToUpdate.Activity;
     
    7371                }
    7472            }
    75 */
    76 //----------------------------------------------------------------------------------)
    7773
    7874            return StoreWithStatistic(KeyInDht(nodeToUpdate), memoryStream.ToArray());
     
    134130            }
    135131           
    136             //-------------------------------------------------------------------------------------------
    137             //AFTER CHANGING THE FOLLOWING PART INCREASE THE VERSION-NUMBER AT THE TOP OF THIS CLASS!
    138             //-------------------------------------------------------------------------------------------
    139 //----------------------------------------------------------------------------------------
    140 /*
    141             //TODO: Dictionary read
    142             if (binaryReader.BaseStream.Length != (binaryReader.BaseStream.Position+1))
     132
     133
     134            if (binaryReader.BaseStream.Length != binaryReader.BaseStream.Position)
    143135            { 
    144136                //Reading the number of avatarnames
     
    158150                        readMaschcount.Add(maschID,count);
    159151                    }
    160                     nodeToUpdate.Activity.Add(avatarname,readMaschcount);                   
     152                    if (nodeToUpdate.Activity.ContainsKey(avatarname))
     153                    {
     154                        nodeToUpdate.Activity[avatarname] = readMaschcount;
     155                    }
     156                    else
     157                    {
     158                        nodeToUpdate.Activity.Add(avatarname, readMaschcount);                     
     159                    }
    161160                }               
    162161            }
    163 */
    164 //---------------------------------------------------------------------------------------------                       
     162
     163//-------------------------------------------------------------------------------------------
     164//AFTER CHANGING THE FOLLOWING PART INCREASE THE VERSION-NUMBER AT THE TOP OF THIS CLASS!
     165//-------------------------------------------------------------------------------------------
     166                       
    165167            if (resultCount > 0)
    166168            {
    167                 keySearcher.IntegrateNewResults(nodeToUpdate.Result);
     169                keySearcher.IntegrateNewResults(nodeToUpdate.Result,nodeToUpdate.Activity, nodeToUpdate.DistributedJobIdentifier);
    168170                statisticsGenerator.ProcessPatternResults(nodeToUpdate.Result);
    169171            }
Note: See TracChangeset for help on using the changeset viewer.