public void QueueEntry_GetUserID_Test() { byte[] b = QueueEntry.HexToData("99D3CF222E1FA00"); Array.Reverse(b); string userID = QueueEntry.GetUserID(b, 16, false); Assert.AreEqual("99D3CF222E1F9F0", userID); b = QueueEntry.HexToData("00FAE122F23C9D09"); userID = QueueEntry.GetUserID(b, 16, false); Assert.AreEqual("99D3CF222E1F9F0", userID); b = QueueEntry.HexToData("99D3CF222E1FA00"); userID = QueueEntry.GetUserID(b, 16, true); Assert.AreEqual("99D3CF222E1F9F0", userID); }
public void QueueReader_ReadQueue_Standard_4_queue() // Standard x86 v6.xx { QueueData queue = QueueReader.ReadQueue("..\\..\\..\\TestFiles\\Standard_4\\queue.dat"); Assert.AreEqual(600, queue.Version); Assert.AreEqual(1, queue.CurrentIndex); Assert.AreEqual(0.0f, queue.PerformanceFraction); Assert.AreEqual(0, queue.PerformanceFractionUnitWeight); Assert.AreEqual(424.698f, queue.DownloadRateAverage); Assert.AreEqual(1, queue.DownloadRateUnitWeight); Assert.AreEqual(0.0f, queue.UploadRateAverage); Assert.AreEqual(0, queue.UploadRateUnitWeight); Assert.AreEqual(QueueData.Epoch2000, queue.ResultsSentUtc); QueueEntry entry0 = queue.GetQueueEntry(0); Assert.AreEqual(0, entry0.Index); Assert.AreEqual(1, entry0.EntryStatus); QueueEntry entry1 = queue.GetQueueEntry(1); Assert.AreEqual(1, entry1.Index); Assert.AreEqual(5, entry1.EntryStatus); Assert.AreEqual("Folding Now", entry1.EntryStatusLiteral); Assert.AreEqual(0.0, entry1.SpeedFactor); Assert.AreEqual("171.65.103.162", entry1.ServerIP); Assert.AreEqual(8080, entry1.ServerPort); Assert.AreEqual(2498, entry1.ProjectID); Assert.AreEqual(204, entry1.ProjectRun); Assert.AreEqual(8, entry1.ProjectClone); Assert.AreEqual(16, entry1.ProjectGen); Assert.AreEqual(0, entry1.Benchmark); Assert.AreEqual(500, entry1.Misc1a); Assert.AreEqual(400, entry1.Misc1b); Assert.AreEqual(2, entry1.Misc4a); Assert.AreEqual(new DateTime(2009, 10, 25, 22, 20, 57, DateTimeKind.Utc), entry1.ProjectIssuedUtc); Assert.AreEqual(new DateTime(2009, 10, 25, 16, 47, 16, DateTimeKind.Utc), entry1.BeginTimeUtc); Assert.AreEqual(QueueData.Epoch2000, entry1.EndTimeUtc); Assert.AreEqual(new DateTime(2010, 1, 26, 16, 47, 16, DateTimeKind.Utc), entry1.DueTimeUtc); Assert.AreEqual(93, entry1.ExpirationInDays); Assert.AreEqual("http://www.stanford.edu/~pande/Win32/x86/Core_78.fah", entry1.CoreDownloadUrl.AbsoluteUri); Assert.AreEqual("78", entry1.CoreNumberHex); Assert.AreEqual("GROMACS", entry1.CoreName); Assert.AreEqual(1, entry1.CpuType); Assert.AreEqual(2000, entry1.CpuSpecies); Assert.AreEqual("AMD x86", entry1.CpuString); Assert.AreEqual(1, entry1.OsType); Assert.AreEqual(8, entry1.OsSpecies); Assert.AreEqual("WinXP", entry1.OsString); Assert.AreEqual(0, entry1.NumberOfSmpCores); Assert.AreEqual(0, entry1.UseCores); Assert.AreEqual("P2498R204C8G16", entry1.WorkUnitTag); Assert.AreEqual(0, entry1.Flops); Assert.AreEqual(0, entry1.MegaFlops); Assert.AreEqual("0", entry1.MegaFlops.ToString(CultureInfo.InvariantCulture)); Assert.AreEqual(1022, entry1.Memory); Assert.AreEqual(0, entry1.GpuMemory); Assert.AreEqual(3, entry1.RequiredClientType); Assert.AreEqual("Advmethods", entry1.RequiredClientTypeLiteral); Assert.AreEqual(true, entry1.AssignmentInfoPresent); Assert.AreEqual(new DateTime(2009, 10, 25, 16, 46, 56, DateTimeKind.Utc), entry1.AssignmentTimeStampUtc); Assert.AreEqual("B92F1DDD", entry1.AssignmentInfoChecksum); Assert.AreEqual("171.65.103.100", entry1.CollectionServerIP); Assert.AreEqual(0, entry1.NumberOfUploadFailures); Assert.AreEqual(524286976, entry1.PacketSizeLimit); Assert.AreEqual("harlam357", entry1.FoldingID); Assert.AreEqual("32", entry1.Team); Assert.AreEqual(32, entry1.TeamNumber); Assert.AreEqual("3F6B3F0625B7E6CA", entry1.ID); Assert.AreEqual("3F6B3F0625B7E6BA", entry1.UserID); Assert.AreEqual(16, entry1.MachineID); Assert.AreEqual(2972889, entry1.WuDataFileSize); Assert.AreEqual("Folding@Home", entry1.WorkUnitType); }
public void QueueReader_ReadQueue_Standard_2_queue() // Standard PPC v6.xx { QueueData queue = QueueReader.ReadQueue("..\\..\\..\\TestFiles\\Standard_2\\queue.dat"); Assert.AreEqual(600, queue.Version); Assert.AreEqual(2, queue.CurrentIndex); Assert.AreEqual(0.907946765f, queue.PerformanceFraction); Assert.AreEqual(1, queue.PerformanceFractionUnitWeight); Assert.AreEqual(998.251f, queue.DownloadRateAverage); Assert.AreEqual(2, queue.DownloadRateUnitWeight); Assert.AreEqual(3375.984f, queue.UploadRateAverage); Assert.AreEqual(1, queue.UploadRateUnitWeight); Assert.AreEqual(QueueData.Epoch2000, queue.ResultsSentUtc); QueueEntry entry0 = queue.GetQueueEntry(0); Assert.AreEqual(0, entry0.Index); Assert.AreEqual(1, entry0.EntryStatus); QueueEntry entry1 = queue.GetQueueEntry(1); Assert.AreEqual(1, entry1.Index); Assert.AreEqual(3, entry1.EntryStatus); Assert.AreEqual("Finished", entry1.EntryStatusLiteral); Assert.AreEqual(10.86, entry1.SpeedFactor); Assert.AreEqual("171.64.65.65", entry1.ServerIP); Assert.AreEqual(8080, entry1.ServerPort); Assert.AreEqual(2611, entry1.ProjectID); Assert.AreEqual(1, entry1.ProjectRun); Assert.AreEqual(518, entry1.ProjectClone); Assert.AreEqual(185, entry1.ProjectGen); Assert.AreEqual(0, entry1.Benchmark); Assert.AreEqual(500, entry1.Misc1a); Assert.AreEqual(400, entry1.Misc1b); Assert.AreEqual(7, entry1.Misc4a); Assert.AreEqual(new DateTime(2009, 9, 25, 20, 20, 04, DateTimeKind.Utc), entry1.ProjectIssuedUtc); Assert.AreEqual(new DateTime(2009, 9, 25, 20, 20, 12, DateTimeKind.Utc), entry1.BeginTimeUtc); Assert.AreEqual(new DateTime(2009, 9, 29, 12, 42, 28, DateTimeKind.Utc), entry1.EndTimeUtc); Assert.AreEqual(new DateTime(2009, 11, 4, 20, 20, 12, DateTimeKind.Utc), entry1.DueTimeUtc); Assert.AreEqual(40, entry1.ExpirationInDays); Assert.AreEqual("http://www.stanford.edu/~pande/OSX/PowerPC/Core_78.fah", entry1.CoreDownloadUrl.AbsoluteUri); Assert.AreEqual("78", entry1.CoreNumberHex); Assert.AreEqual("GROMACS", entry1.CoreName); Assert.AreEqual(2, entry1.CpuType); Assert.AreEqual(0, entry1.CpuSpecies); Assert.AreEqual("PowerPC", entry1.CpuString); Assert.AreEqual(3, entry1.OsType); Assert.AreEqual(0, entry1.OsSpecies); Assert.AreEqual("OSX", entry1.OsString); Assert.AreEqual(0, entry1.NumberOfSmpCores); Assert.AreEqual(0, entry1.UseCores); Assert.AreEqual("P2611R1C518G185", entry1.WorkUnitTag); Assert.AreEqual(0, entry1.Flops); Assert.AreEqual(0, entry1.MegaFlops); Assert.AreEqual("0", entry1.MegaFlops.ToString(CultureInfo.InvariantCulture)); Assert.AreEqual(2048, entry1.Memory); Assert.AreEqual(0, entry1.GpuMemory); Assert.AreEqual(0, entry1.RequiredClientType); Assert.AreEqual(String.Empty, entry1.RequiredClientTypeLiteral); Assert.AreEqual(true, entry1.AssignmentInfoPresent); Assert.AreEqual(new DateTime(2009, 9, 25, 20, 20, 00, DateTimeKind.Utc), entry1.AssignmentTimeStampUtc); Assert.AreEqual("B916E4CE", entry1.AssignmentInfoChecksum); Assert.AreEqual("171.67.108.25", entry1.CollectionServerIP); Assert.AreEqual(0, entry1.NumberOfUploadFailures); Assert.AreEqual(524286976, entry1.PacketSizeLimit); Assert.AreEqual("surferseth", entry1.FoldingID); Assert.AreEqual("32", entry1.Team); Assert.AreEqual(32, entry1.TeamNumber); Assert.AreEqual("5C35923707490D99", entry1.ID); Assert.AreEqual("5C35923707490D98", entry1.UserID); Assert.AreEqual(1, entry1.MachineID); Assert.AreEqual(3872181, entry1.WuDataFileSize); Assert.AreEqual("Folding@Home", entry1.WorkUnitType); QueueEntry entry2 = queue.GetQueueEntry(2); Assert.AreEqual(2, entry2.Index); Assert.AreEqual(5, entry2.EntryStatus); Assert.AreEqual("Folding Now", entry2.EntryStatusLiteral); Assert.AreEqual(0, entry2.SpeedFactor); Assert.AreEqual("171.64.65.65", entry2.ServerIP); Assert.AreEqual(8080, entry2.ServerPort); Assert.AreEqual(2613, entry2.ProjectID); Assert.AreEqual(32, entry2.ProjectRun); Assert.AreEqual(0, entry2.ProjectClone); Assert.AreEqual(169, entry2.ProjectGen); Assert.AreEqual(0, entry2.Benchmark); Assert.AreEqual(500, entry2.Misc1a); Assert.AreEqual(400, entry2.Misc1b); Assert.AreEqual(7, entry2.Misc4a); Assert.AreEqual(new DateTime(2009, 9, 29, 12, 45, 57, DateTimeKind.Utc), entry2.ProjectIssuedUtc); Assert.AreEqual(new DateTime(2009, 9, 29, 12, 46, 15, DateTimeKind.Utc), entry2.BeginTimeUtc); Assert.AreEqual(QueueData.Epoch2000, entry2.EndTimeUtc); Assert.AreEqual(new DateTime(2009, 11, 8, 12, 46, 15, DateTimeKind.Utc), entry2.DueTimeUtc); Assert.AreEqual(40, entry2.ExpirationInDays); Assert.AreEqual("http://www.stanford.edu/~pande/OSX/PowerPC/Core_78.fah", entry2.CoreDownloadUrl.AbsoluteUri); Assert.AreEqual("78", entry2.CoreNumberHex); Assert.AreEqual("GROMACS", entry2.CoreName); Assert.AreEqual(2, entry2.CpuType); Assert.AreEqual(0, entry2.CpuSpecies); Assert.AreEqual("PowerPC", entry2.CpuString); Assert.AreEqual(3, entry2.OsType); Assert.AreEqual(0, entry2.OsSpecies); Assert.AreEqual("OSX", entry2.OsString); Assert.AreEqual(0, entry2.NumberOfSmpCores); Assert.AreEqual(0, entry2.UseCores); Assert.AreEqual("P2613R32C0G169", entry2.WorkUnitTag); Assert.AreEqual(1063808819, entry2.Flops); Assert.AreEqual(1063.808819, entry2.MegaFlops); Assert.AreEqual("1063.808819", entry2.MegaFlops.ToString(CultureInfo.InvariantCulture)); Assert.AreEqual(2048, entry2.Memory); Assert.AreEqual(0, entry2.GpuMemory); Assert.AreEqual(0, entry2.RequiredClientType); Assert.AreEqual(String.Empty, entry2.RequiredClientTypeLiteral); Assert.AreEqual(true, entry2.AssignmentInfoPresent); Assert.AreEqual(new DateTime(2009, 9, 29, 12, 45, 53, DateTimeKind.Utc), entry2.AssignmentTimeStampUtc); Assert.AreEqual("B90DB8BF", entry2.AssignmentInfoChecksum); Assert.AreEqual("171.67.108.25", entry2.CollectionServerIP); Assert.AreEqual(0, entry2.NumberOfUploadFailures); Assert.AreEqual(524286976, entry2.PacketSizeLimit); Assert.AreEqual("surferseth", entry2.FoldingID); Assert.AreEqual("32", entry2.Team); Assert.AreEqual(32, entry2.TeamNumber); Assert.AreEqual("5C35923707490D99", entry2.ID); Assert.AreEqual("5C35923707490D98", entry2.UserID); Assert.AreEqual(1, entry2.MachineID); Assert.AreEqual(9256122, entry2.WuDataFileSize); Assert.AreEqual("Folding@Home", entry2.WorkUnitType); }
public void QueueReader_ReadQueue_Standard_3_queue() // Standard PPC v5.01 { QueueData queue = QueueReader.ReadQueue("..\\..\\..\\TestFiles\\Standard_3\\queue.dat"); Assert.AreEqual(501, queue.Version); Assert.AreEqual(2, queue.CurrentIndex); Assert.AreEqual(0.823216438f, queue.PerformanceFraction); Assert.AreEqual(4, queue.PerformanceFractionUnitWeight); Assert.AreEqual(200.309f, queue.DownloadRateAverage); Assert.AreEqual(4, queue.DownloadRateUnitWeight); Assert.AreEqual(97.206f, queue.UploadRateAverage); Assert.AreEqual(4, queue.UploadRateUnitWeight); Assert.AreEqual(QueueData.Epoch2000, queue.ResultsSentUtc); QueueEntry entry1 = queue.GetQueueEntry(1); Assert.AreEqual(1, entry1.Index); Assert.AreEqual(3, entry1.EntryStatus); Assert.AreEqual("Finished", entry1.EntryStatusLiteral); Assert.AreEqual(8.44, entry1.SpeedFactor); Assert.AreEqual("171.64.65.58", entry1.ServerIP); Assert.AreEqual(8080, entry1.ServerPort); Assert.AreEqual(3046, entry1.ProjectID); Assert.AreEqual(0, entry1.ProjectRun); Assert.AreEqual(505, entry1.ProjectClone); Assert.AreEqual(74, entry1.ProjectGen); Assert.AreEqual(357, entry1.Benchmark); Assert.AreEqual(500, entry1.Misc1a); Assert.AreEqual(200, entry1.Misc1b); Assert.AreEqual(0, entry1.Misc4a); Assert.AreEqual(new DateTime(2009, 08, 31, 15, 07, 52, DateTimeKind.Utc), entry1.ProjectIssuedUtc); Assert.AreEqual(new DateTime(2009, 08, 31, 15, 06, 31, DateTimeKind.Utc), entry1.BeginTimeUtc); Assert.AreEqual(new DateTime(2009, 09, 08, 10, 52, 45, DateTimeKind.Utc), entry1.EndTimeUtc); Assert.AreEqual(new DateTime(2009, 11, 05, 15, 06, 31, DateTimeKind.Utc), entry1.DueTimeUtc); Assert.AreEqual(66, entry1.ExpirationInDays); Assert.AreEqual("http://www.stanford.edu/~pande/OSX/PowerPC/Core_78.fah", entry1.CoreDownloadUrl.AbsoluteUri); Assert.AreEqual("78", entry1.CoreNumberHex); Assert.AreEqual("GROMACS", entry1.CoreName); Assert.AreEqual(2, entry1.CpuType); Assert.AreEqual(0, entry1.CpuSpecies); Assert.AreEqual("PowerPC", entry1.CpuString); Assert.AreEqual(3, entry1.OsType); Assert.AreEqual(0, entry1.OsSpecies); Assert.AreEqual("OSX", entry1.OsString); Assert.AreEqual(0, entry1.NumberOfSmpCores); Assert.AreEqual(0, entry1.UseCores); Assert.AreEqual("P3046R0C505G74", entry1.WorkUnitTag); Assert.AreEqual(0, entry1.Flops); Assert.AreEqual(0, entry1.MegaFlops); Assert.AreEqual("0", entry1.MegaFlops.ToString(CultureInfo.InvariantCulture)); Assert.AreEqual(0, entry1.Memory); Assert.AreEqual(0, entry1.GpuMemory); Assert.AreEqual(3, entry1.RequiredClientType); Assert.AreEqual("Advmethods", entry1.RequiredClientTypeLiteral); Assert.AreEqual(true, entry1.AssignmentInfoPresent); Assert.AreEqual(new DateTime(2009, 08, 31, 15, 07, 49, DateTimeKind.Utc), entry1.AssignmentTimeStampUtc); Assert.AreEqual("B977A500", entry1.AssignmentInfoChecksum); Assert.AreEqual("171.67.108.17", entry1.CollectionServerIP); Assert.AreEqual(0, entry1.NumberOfUploadFailures); Assert.AreEqual(5241856, entry1.PacketSizeLimit); Assert.AreEqual("susato", entry1.FoldingID); Assert.AreEqual("1971", entry1.Team); Assert.AreEqual(1971, entry1.TeamNumber); Assert.AreEqual("33B4219B415837A4", entry1.ID); Assert.AreEqual("33B4219B415837A3", entry1.UserID); Assert.AreEqual(1, entry1.MachineID); Assert.AreEqual(283826, entry1.WuDataFileSize); Assert.AreEqual("Folding@Home", entry1.WorkUnitType); }
public void QueueReader_ReadQueue_GPU2_5_queue() // GPU2 v6.23 - ID value for p10xxx Projects is written Big Endian { QueueData queue = QueueReader.ReadQueue("..\\..\\..\\TestFiles\\GPU2_5\\queue.dat"); Assert.AreEqual(600, queue.Version); Assert.AreEqual(9, queue.CurrentIndex); Assert.AreEqual(0.974022746f, queue.PerformanceFraction); Assert.AreEqual(4, queue.PerformanceFractionUnitWeight); Assert.AreEqual(89.939f, queue.DownloadRateAverage); Assert.AreEqual(4, queue.DownloadRateUnitWeight); Assert.AreEqual(109.226f, queue.UploadRateAverage); Assert.AreEqual(4, queue.UploadRateUnitWeight); Assert.AreEqual(new DateTime(2009, 12, 31, 13, 41, 57, DateTimeKind.Utc), queue.ResultsSentUtc); QueueEntry entry9 = queue.GetQueueEntry(9); Assert.AreEqual(9, entry9.Index); Assert.AreEqual(5, entry9.EntryStatus); Assert.AreEqual("Folding Now", entry9.EntryStatusLiteral); Assert.AreEqual(0.0, entry9.SpeedFactor); Assert.AreEqual("171.64.65.71", entry9.ServerIP); Assert.AreEqual(8080, entry9.ServerPort); Assert.AreEqual(10101, entry9.ProjectID); Assert.AreEqual(266, entry9.ProjectRun); Assert.AreEqual(9, entry9.ProjectClone); Assert.AreEqual(11, entry9.ProjectGen); Assert.AreEqual(0, entry9.Benchmark); Assert.AreEqual(500, entry9.Misc1a); Assert.AreEqual(119, entry9.Misc1b); Assert.AreEqual(11, entry9.Misc4a); Assert.AreEqual(new DateTime(1970, 1, 1, 00, 00, 00, DateTimeKind.Utc), entry9.ProjectIssuedUtc); Assert.AreEqual(new DateTime(2010, 1, 2, 20, 35, 41, DateTimeKind.Utc), entry9.BeginTimeUtc); Assert.AreEqual(QueueData.Epoch2000, entry9.EndTimeUtc); Assert.AreEqual(new DateTime(2010, 1, 5, 20, 35, 41, DateTimeKind.Utc), entry9.DueTimeUtc); Assert.AreEqual(3, entry9.ExpirationInDays); Assert.AreEqual("http://www.stanford.edu/~pande/Win32/x86/NVIDIA/G80/Core_11.fah", entry9.CoreDownloadUrl.AbsoluteUri); Assert.AreEqual("11", entry9.CoreNumberHex); Assert.AreEqual("GROGPU2", entry9.CoreName); Assert.AreEqual(1, entry9.CpuType); Assert.AreEqual(687, entry9.CpuSpecies); Assert.AreEqual("Pentium II/III", entry9.CpuString); Assert.AreEqual(1, entry9.OsType); Assert.AreEqual(0, entry9.OsSpecies); Assert.AreEqual("Windows", entry9.OsString); Assert.AreEqual(0, entry9.NumberOfSmpCores); Assert.AreEqual(0, entry9.UseCores); Assert.AreEqual("", entry9.WorkUnitTag); Assert.AreEqual(1064917390, entry9.Flops); Assert.AreEqual(1064.91739, entry9.MegaFlops); Assert.AreEqual("1064.91739", entry9.MegaFlops.ToString(CultureInfo.InvariantCulture)); Assert.AreEqual(6141, entry9.Memory); Assert.AreEqual(258, entry9.GpuMemory); Assert.AreEqual(0, entry9.RequiredClientType); Assert.AreEqual(String.Empty, entry9.RequiredClientTypeLiteral); Assert.AreEqual(true, entry9.AssignmentInfoPresent); Assert.AreEqual(new DateTime(2010, 1, 2, 20, 35, 35, DateTimeKind.Utc), entry9.AssignmentTimeStampUtc); Assert.AreEqual("B98B6C2F", entry9.AssignmentInfoChecksum); Assert.AreEqual("171.67.108.26", entry9.CollectionServerIP); Assert.AreEqual(0, entry9.NumberOfUploadFailures); Assert.AreEqual(524286976, entry9.PacketSizeLimit); Assert.AreEqual("harlam357", entry9.FoldingID); Assert.AreEqual("32", entry9.Team); Assert.AreEqual(32, entry9.TeamNumber); Assert.AreEqual("524BA6317A0D763D", entry9.ID); Assert.AreEqual("524BA6317A0D763A", entry9.UserID); Assert.AreEqual(3, entry9.MachineID); Assert.AreEqual(89249, entry9.WuDataFileSize); Assert.AreEqual("Folding@Home", entry9.WorkUnitType); }
public void QueueReader_ReadQueue_SMP_4_queue() // WinSMP v6.24R3 { QueueData queue = QueueReader.ReadQueue("..\\..\\..\\TestFiles\\SMP_4\\queue.dat"); Assert.AreEqual(600, queue.Version); Assert.AreEqual(9, queue.CurrentIndex); Assert.AreEqual(0.7884074f, queue.PerformanceFraction); Assert.AreEqual(4, queue.PerformanceFractionUnitWeight); Assert.AreEqual(232.941f, queue.DownloadRateAverage); Assert.AreEqual(4, queue.DownloadRateUnitWeight); Assert.AreEqual(179.357f, queue.UploadRateAverage); Assert.AreEqual(4, queue.UploadRateUnitWeight); Assert.AreEqual(QueueData.Epoch2000, queue.ResultsSentUtc); QueueEntry entry8 = queue.GetQueueEntry(8); Assert.AreEqual(8, entry8.Index); Assert.AreEqual(3, entry8.EntryStatus); Assert.AreEqual("Finished", entry8.EntryStatusLiteral); Assert.AreEqual(4.46, entry8.SpeedFactor); Assert.AreEqual("171.64.65.64", entry8.ServerIP); Assert.AreEqual(8080, entry8.ServerPort); Assert.AreEqual(2653, entry8.ProjectID); Assert.AreEqual(3, entry8.ProjectRun); Assert.AreEqual(71, entry8.ProjectClone); Assert.AreEqual(119, entry8.ProjectGen); Assert.AreEqual(0, entry8.Benchmark); Assert.AreEqual(500, entry8.Misc1a); Assert.AreEqual(200, entry8.Misc1b); Assert.AreEqual(12, entry8.Misc4a); Assert.AreEqual(new DateTime(2009, 9, 11, 18, 34, 24, DateTimeKind.Utc), entry8.ProjectIssuedUtc); Assert.AreEqual(new DateTime(2009, 9, 11, 18, 34, 56, DateTimeKind.Utc), entry8.BeginTimeUtc); Assert.AreEqual(new DateTime(2009, 9, 12, 16, 7, 37, DateTimeKind.Utc), entry8.EndTimeUtc); Assert.AreEqual(new DateTime(2009, 9, 15, 18, 34, 56, DateTimeKind.Utc), entry8.DueTimeUtc); Assert.AreEqual(4, entry8.ExpirationInDays); Assert.AreEqual("http://www.stanford.edu/~pande/Win32/x86/Core_a1.fah", entry8.CoreDownloadUrl.AbsoluteUri); Assert.AreEqual("a1", entry8.CoreNumberHex); Assert.AreEqual("GRO-SMP", entry8.CoreName); Assert.AreEqual(1, entry8.CpuType); Assert.AreEqual(687, entry8.CpuSpecies); Assert.AreEqual("Pentium II/III", entry8.CpuString); Assert.AreEqual(1, entry8.OsType); Assert.AreEqual(8, entry8.OsSpecies); Assert.AreEqual("WinXP", entry8.OsString); Assert.AreEqual(2, entry8.NumberOfSmpCores); Assert.AreEqual(2, entry8.UseCores); Assert.AreEqual("P2653R3C71G119", entry8.WorkUnitTag); Assert.AreEqual(1061857101, entry8.Flops); Assert.AreEqual(1061.857101, entry8.MegaFlops); Assert.AreEqual("1061.857101", entry8.MegaFlops.ToString(CultureInfo.InvariantCulture)); Assert.AreEqual(1534, entry8.Memory); Assert.AreEqual(0, entry8.GpuMemory); Assert.AreEqual(0, entry8.RequiredClientType); Assert.AreEqual(String.Empty, entry8.RequiredClientTypeLiteral); Assert.AreEqual(true, entry8.AssignmentInfoPresent); Assert.AreEqual(new DateTime(2009, 9, 11, 18, 34, 20, DateTimeKind.Utc), entry8.AssignmentTimeStampUtc); Assert.AreEqual("B9645213", entry8.AssignmentInfoChecksum); Assert.AreEqual("171.67.108.25", entry8.CollectionServerIP); Assert.AreEqual(0, entry8.NumberOfUploadFailures); Assert.AreEqual(524286976, entry8.PacketSizeLimit); Assert.AreEqual("harlam357", entry8.FoldingID); Assert.AreEqual("32", entry8.Team); Assert.AreEqual(32, entry8.TeamNumber); Assert.AreEqual("7AFAD2B923A9732A", entry8.ID); Assert.AreEqual("7AFAD2B923A97329", entry8.UserID); Assert.AreEqual(1, entry8.MachineID); Assert.AreEqual(2432236, entry8.WuDataFileSize); Assert.AreEqual("Folding@Home", entry8.WorkUnitType); }
public void QueueReader_ReadQueue_SMP_16_queue() // WinSMP v6.30 { QueueData queue = QueueReader.ReadQueue("..\\..\\..\\TestFiles\\SMP_16\\queue.dat"); Assert.AreEqual(600, queue.Version); Assert.AreEqual(5, queue.CurrentIndex); Assert.AreEqual(0.5787003f, queue.PerformanceFraction); Assert.AreEqual(4, queue.PerformanceFractionUnitWeight); Assert.AreEqual(449.548f, queue.DownloadRateAverage); Assert.AreEqual(4, queue.DownloadRateUnitWeight); Assert.AreEqual(235.043f, queue.UploadRateAverage); Assert.AreEqual(4, queue.UploadRateUnitWeight); Assert.AreEqual(QueueData.Epoch2000, queue.ResultsSentUtc); QueueEntry entry5 = queue.GetQueueEntry(5); Assert.AreEqual(5, entry5.Index); Assert.AreEqual(5, entry5.EntryStatus); Assert.AreEqual("Folding Now", entry5.EntryStatusLiteral); Assert.AreEqual(0.0, entry5.SpeedFactor); Assert.AreEqual("130.237.232.141", entry5.ServerIP); Assert.AreEqual(8080, entry5.ServerPort); Assert.AreEqual(6900, entry5.ProjectID); Assert.AreEqual(6, entry5.ProjectRun); Assert.AreEqual(0, entry5.ProjectClone); Assert.AreEqual(31, entry5.ProjectGen); Assert.AreEqual(0, entry5.Benchmark); Assert.AreEqual(500, entry5.Misc1a); Assert.AreEqual(600, entry5.Misc1b); Assert.AreEqual(12, entry5.Misc4a); Assert.AreEqual(new DateTime(2011, 2, 20, 22, 29, 58, DateTimeKind.Utc), entry5.ProjectIssuedUtc); Assert.AreEqual(new DateTime(2011, 2, 20, 22, 32, 30, DateTimeKind.Utc), entry5.BeginTimeUtc); Assert.AreEqual(QueueData.Epoch2000, entry5.EndTimeUtc); Assert.AreEqual(new DateTime(2011, 2, 26, 22, 32, 30, DateTimeKind.Utc), entry5.DueTimeUtc); Assert.AreEqual(6, entry5.ExpirationInDays); Assert.AreEqual("http://www.stanford.edu/~pande/Win32/x86/beta/Core_a3.fah", entry5.CoreDownloadUrl.AbsoluteUri); Assert.AreEqual("a3", entry5.CoreNumberHex); Assert.AreEqual("GRO-A3", entry5.CoreName); Assert.AreEqual(1, entry5.CpuType); Assert.AreEqual(687, entry5.CpuSpecies); Assert.AreEqual("Pentium II/III", entry5.CpuString); Assert.AreEqual(1, entry5.OsType); Assert.AreEqual(0, entry5.OsSpecies); Assert.AreEqual("Windows", entry5.OsString); Assert.AreEqual(8, entry5.NumberOfSmpCores); Assert.AreEqual(7, entry5.UseCores); Assert.AreEqual("P6900R6C0G31", entry5.WorkUnitTag); Assert.AreEqual(1058284980, entry5.Flops); Assert.AreEqual(1058.28498, entry5.MegaFlops); Assert.AreEqual("1058.28498", entry5.MegaFlops.ToString(CultureInfo.InvariantCulture)); Assert.AreEqual(6142, entry5.Memory); Assert.AreEqual(0, entry5.GpuMemory); Assert.AreEqual(6, entry5.RequiredClientType); Assert.AreEqual("Big Beta", entry5.RequiredClientTypeLiteral); Assert.AreEqual(true, entry5.AssignmentInfoPresent); Assert.AreEqual(new DateTime(2011, 2, 20, 22, 29, 04, DateTimeKind.Utc), entry5.AssignmentTimeStampUtc); Assert.AreEqual("9600FD42", entry5.AssignmentInfoChecksum); Assert.AreEqual("130.237.165.141", entry5.CollectionServerIP); Assert.AreEqual(0, entry5.NumberOfUploadFailures); Assert.AreEqual(524286976, entry5.PacketSizeLimit); Assert.AreEqual("harlam357", entry5.FoldingID); Assert.AreEqual("32", entry5.Team); Assert.AreEqual(32, entry5.TeamNumber); Assert.AreEqual("131CC8ED11647153", entry5.ID); Assert.AreEqual("131CC8ED11647152", entry5.UserID); Assert.AreEqual(1, entry5.MachineID); Assert.AreEqual(24868915, entry5.WuDataFileSize); Assert.AreEqual("Folding@Home", entry5.WorkUnitType); }
public void QueueReader_ReadQueue_GPU2_4_queue() // GPU2 v6.23 { QueueData queue = QueueReader.ReadQueue("..\\..\\..\\TestFiles\\GPU2_4\\queue.dat"); Assert.AreEqual(600, queue.Version); Assert.AreEqual(8, queue.CurrentIndex); Assert.AreEqual(0.990233958f, queue.PerformanceFraction); Assert.AreEqual(4, queue.PerformanceFractionUnitWeight); Assert.AreEqual(64.48f, queue.DownloadRateAverage); Assert.AreEqual(4, queue.DownloadRateUnitWeight); Assert.AreEqual(99.712f, queue.UploadRateAverage); Assert.AreEqual(4, queue.UploadRateUnitWeight); Assert.AreEqual(new DateTime(2009, 9, 6, 15, 57, 14, DateTimeKind.Utc), queue.ResultsSentUtc); QueueEntry entry7 = queue.GetQueueEntry(7); Assert.AreEqual(7, entry7.Index); Assert.AreEqual(3, entry7.EntryStatus); Assert.AreEqual("Finished", entry7.EntryStatusLiteral); Assert.AreEqual(178.51, entry7.SpeedFactor); Assert.AreEqual("171.64.65.106", entry7.ServerIP); Assert.AreEqual(8080, entry7.ServerPort); Assert.AreEqual(5790, entry7.ProjectID); Assert.AreEqual(5, entry7.ProjectRun); Assert.AreEqual(360, entry7.ProjectClone); Assert.AreEqual(1, entry7.ProjectGen); Assert.AreEqual(0, entry7.Benchmark); Assert.AreEqual(500, entry7.Misc1a); Assert.AreEqual(200, entry7.Misc1b); Assert.AreEqual(11, entry7.Misc4a); Assert.AreEqual(new DateTime(2009, 9, 14, 0, 45, 30, DateTimeKind.Utc), entry7.ProjectIssuedUtc); Assert.AreEqual(new DateTime(2009, 9, 14, 0, 45, 30, DateTimeKind.Utc), entry7.BeginTimeUtc); Assert.AreEqual(new DateTime(2009, 9, 14, 2, 46, 30, DateTimeKind.Utc), entry7.EndTimeUtc); Assert.AreEqual(new DateTime(2009, 9, 29, 0, 45, 30, DateTimeKind.Utc), entry7.DueTimeUtc); Assert.AreEqual(15, entry7.ExpirationInDays); Assert.AreEqual("http://www.stanford.edu/~pande/Win32/x86/NVIDIA/G80/Core_11.fah", entry7.CoreDownloadUrl.AbsoluteUri); Assert.AreEqual("11", entry7.CoreNumberHex); Assert.AreEqual("GROGPU2", entry7.CoreName); Assert.AreEqual(1, entry7.CpuType); Assert.AreEqual(687, entry7.CpuSpecies); Assert.AreEqual("Pentium II/III", entry7.CpuString); Assert.AreEqual(1, entry7.OsType); Assert.AreEqual(0, entry7.OsSpecies); Assert.AreEqual("Windows", entry7.OsString); Assert.AreEqual(0, entry7.NumberOfSmpCores); Assert.AreEqual(0, entry7.UseCores); Assert.AreEqual("P5790R5C360G1", entry7.WorkUnitTag); Assert.AreEqual(1065171903, entry7.Flops); Assert.AreEqual(1065.171903, entry7.MegaFlops); Assert.AreEqual("1065.171903", entry7.MegaFlops.ToString(CultureInfo.InvariantCulture)); Assert.AreEqual(4094, entry7.Memory); Assert.AreEqual(258, entry7.GpuMemory); Assert.AreEqual(0, entry7.RequiredClientType); Assert.AreEqual(true, entry7.AssignmentInfoPresent); Assert.AreEqual(String.Empty, entry7.RequiredClientTypeLiteral); Assert.AreEqual(new DateTime(2009, 9, 14, 0, 45, 26, DateTimeKind.Utc), entry7.AssignmentTimeStampUtc); Assert.AreEqual("B9194833", entry7.AssignmentInfoChecksum); Assert.AreEqual("171.67.108.25", entry7.CollectionServerIP); Assert.AreEqual(0, entry7.NumberOfUploadFailures); Assert.AreEqual(524286976, entry7.PacketSizeLimit); Assert.AreEqual("harlam357", entry7.FoldingID); Assert.AreEqual("32", entry7.Team); Assert.AreEqual(32, entry7.TeamNumber); Assert.AreEqual("0CF185086C102A49", entry7.ID); Assert.AreEqual("CF185086C102A47", entry7.UserID); Assert.AreEqual(2, entry7.MachineID); Assert.AreEqual(67869, entry7.WuDataFileSize); Assert.AreEqual("Folding@Home", entry7.WorkUnitType); }
public void QueueReader_ReadQueue_SMP_5_queue() // Linux SMP v6.24 { QueueData queue = QueueReader.ReadQueue("..\\..\\..\\TestFiles\\SMP_5\\queue.dat"); Assert.AreEqual(600, queue.Version); Assert.AreEqual(4, queue.CurrentIndex); Assert.AreEqual(0.724012256f, queue.PerformanceFraction); Assert.AreEqual(4, queue.PerformanceFractionUnitWeight); Assert.AreEqual(300.335f, queue.DownloadRateAverage); Assert.AreEqual(4, queue.DownloadRateUnitWeight); Assert.AreEqual(184.095f, queue.UploadRateAverage); Assert.AreEqual(4, queue.UploadRateUnitWeight); Assert.AreEqual(QueueData.Epoch2000, queue.ResultsSentUtc); QueueEntry entry4 = queue.GetQueueEntry(4); Assert.AreEqual(4, entry4.Index); Assert.AreEqual(5, entry4.EntryStatus); Assert.AreEqual("Folding Now", entry4.EntryStatusLiteral); Assert.AreEqual(0, entry4.SpeedFactor); Assert.AreEqual("171.64.65.56", entry4.ServerIP); Assert.AreEqual(8080, entry4.ServerPort); Assert.AreEqual(2677, entry4.ProjectID); Assert.AreEqual(33, entry4.ProjectRun); Assert.AreEqual(19, entry4.ProjectClone); Assert.AreEqual(44, entry4.ProjectGen); Assert.AreEqual(0, entry4.Benchmark); Assert.AreEqual(500, entry4.Misc1a); Assert.AreEqual(200, entry4.Misc1b); Assert.AreEqual(12, entry4.Misc4a); Assert.AreEqual(new DateTime(2009, 9, 14, 02, 36, 34, DateTimeKind.Utc), entry4.ProjectIssuedUtc); Assert.AreEqual(new DateTime(2009, 9, 14, 02, 38, 21, DateTimeKind.Utc), entry4.BeginTimeUtc); Assert.AreEqual(QueueData.Epoch2000, entry4.EndTimeUtc); Assert.AreEqual(new DateTime(2009, 9, 17, 02, 38, 21, DateTimeKind.Utc), entry4.DueTimeUtc); Assert.AreEqual(3, entry4.ExpirationInDays); Assert.AreEqual("http://www.stanford.edu/~pande/Linux/AMD64/Core_a2.fah", entry4.CoreDownloadUrl.AbsoluteUri); Assert.AreEqual("a2", entry4.CoreNumberHex); Assert.AreEqual("GROCVS", entry4.CoreName); Assert.AreEqual(16, entry4.CpuType); Assert.AreEqual(0, entry4.CpuSpecies); Assert.AreEqual("AMD64", entry4.CpuString); Assert.AreEqual(4, entry4.OsType); Assert.AreEqual(0, entry4.OsSpecies); Assert.AreEqual("Linux", entry4.OsString); Assert.AreEqual(2, entry4.NumberOfSmpCores); Assert.AreEqual(2, entry4.UseCores); Assert.AreEqual("P2677R33C19G44", entry4.WorkUnitTag); Assert.AreEqual(1060722910, entry4.Flops); Assert.AreEqual(1060.722910, entry4.MegaFlops); Assert.AreEqual("1060.72291", entry4.MegaFlops.ToString(CultureInfo.InvariantCulture)); Assert.AreEqual(685, entry4.Memory); Assert.AreEqual(0, entry4.GpuMemory); Assert.AreEqual(0, entry4.RequiredClientType); Assert.AreEqual(String.Empty, entry4.RequiredClientTypeLiteral); Assert.AreEqual(true, entry4.AssignmentInfoPresent); Assert.AreEqual(new DateTime(2009, 9, 14, 02, 36, 31, DateTimeKind.Utc), entry4.AssignmentTimeStampUtc); Assert.AreEqual("B9196E68", entry4.AssignmentInfoChecksum); Assert.AreEqual("171.67.108.25", entry4.CollectionServerIP); Assert.AreEqual(0, entry4.NumberOfUploadFailures); Assert.AreEqual(524286976, entry4.PacketSizeLimit); Assert.AreEqual("harlam357", entry4.FoldingID); Assert.AreEqual("32", entry4.Team); Assert.AreEqual(32, entry4.TeamNumber); Assert.AreEqual("3D9D4D633BD91E9B", entry4.ID); Assert.AreEqual("3D9D4D633BD91E9A", entry4.UserID); Assert.AreEqual(1, entry4.MachineID); Assert.AreEqual(4838584, entry4.WuDataFileSize); Assert.AreEqual("Folding@Home", entry4.WorkUnitType); }
public void QueueReader_ReadQueue_SMP_6_queue() // Linux SMP v6.24 - Waiting Upload { QueueData queue = QueueReader.ReadQueue("..\\..\\..\\TestFiles\\SMP_6\\queue.dat"); Assert.AreEqual(600, queue.Version); Assert.AreEqual(7, queue.CurrentIndex); Assert.AreEqual(0.7182704f, queue.PerformanceFraction); Assert.AreEqual(4, queue.PerformanceFractionUnitWeight); Assert.AreEqual(273.766f, queue.DownloadRateAverage); Assert.AreEqual(4, queue.DownloadRateUnitWeight); Assert.AreEqual(183.91f, queue.UploadRateAverage); Assert.AreEqual(4, queue.UploadRateUnitWeight); Assert.AreEqual(QueueData.Epoch2000, queue.ResultsSentUtc); QueueEntry entry6 = queue.GetQueueEntry(6); Assert.AreEqual(6, entry6.Index); Assert.AreEqual(7, entry6.EntryStatus); Assert.AreEqual("Ready For Upload", entry6.EntryStatusLiteral); Assert.AreEqual(3.97, entry6.SpeedFactor); Assert.AreEqual("171.64.65.56", entry6.ServerIP); Assert.AreEqual(8080, entry6.ServerPort); Assert.AreEqual(2669, entry6.ProjectID); Assert.AreEqual(2, entry6.ProjectRun); Assert.AreEqual(112, entry6.ProjectClone); Assert.AreEqual(164, entry6.ProjectGen); Assert.AreEqual(0, entry6.Benchmark); Assert.AreEqual(500, entry6.Misc1a); Assert.AreEqual(200, entry6.Misc1b); Assert.AreEqual(12, entry6.Misc4a); Assert.AreEqual(new DateTime(2009, 9, 25, 15, 29, 46, DateTimeKind.Utc), entry6.ProjectIssuedUtc); Assert.AreEqual(new DateTime(2009, 9, 25, 15, 30, 32, DateTimeKind.Utc), entry6.BeginTimeUtc); Assert.AreEqual(new DateTime(2009, 9, 26, 09, 38, 06, DateTimeKind.Utc), entry6.EndTimeUtc); Assert.AreEqual(new DateTime(2009, 9, 28, 15, 30, 32, DateTimeKind.Utc), entry6.DueTimeUtc); Assert.AreEqual(3, entry6.ExpirationInDays); Assert.AreEqual("http://www.stanford.edu/~pande/Linux/AMD64/Core_a2.fah", entry6.CoreDownloadUrl.AbsoluteUri); Assert.AreEqual("a2", entry6.CoreNumberHex); Assert.AreEqual("GROCVS", entry6.CoreName); Assert.AreEqual(16, entry6.CpuType); Assert.AreEqual(0, entry6.CpuSpecies); Assert.AreEqual("AMD64", entry6.CpuString); Assert.AreEqual(4, entry6.OsType); Assert.AreEqual(0, entry6.OsSpecies); Assert.AreEqual("Linux", entry6.OsString); Assert.AreEqual(2, entry6.NumberOfSmpCores); Assert.AreEqual(2, entry6.UseCores); Assert.AreEqual("P2669R2C112G164", entry6.WorkUnitTag); Assert.AreEqual(1060500841, entry6.Flops); Assert.AreEqual(1060.500841, entry6.MegaFlops); Assert.AreEqual("1060.500841", entry6.MegaFlops.ToString(CultureInfo.InvariantCulture)); Assert.AreEqual(685, entry6.Memory); Assert.AreEqual(0, entry6.GpuMemory); Assert.AreEqual(0, entry6.RequiredClientType); Assert.AreEqual(String.Empty, entry6.RequiredClientTypeLiteral); Assert.AreEqual(true, entry6.AssignmentInfoPresent); Assert.AreEqual(new DateTime(2009, 9, 25, 15, 29, 42, DateTimeKind.Utc), entry6.AssignmentTimeStampUtc); Assert.AreEqual("B91698A1", entry6.AssignmentInfoChecksum); Assert.AreEqual("171.67.108.25", entry6.CollectionServerIP); Assert.AreEqual(4, entry6.NumberOfUploadFailures); Assert.AreEqual(524286976, entry6.PacketSizeLimit); Assert.AreEqual("harlam357", entry6.FoldingID); Assert.AreEqual("32", entry6.Team); Assert.AreEqual(32, entry6.TeamNumber); Assert.AreEqual("030686B3436DEE21", entry6.ID); Assert.AreEqual("30686B3436DEE20", entry6.UserID); Assert.AreEqual(1, entry6.MachineID); Assert.AreEqual(4836605, entry6.WuDataFileSize); Assert.AreEqual("Folding@Home", entry6.WorkUnitType); }
private UnitInfo BuildUnitInfo(QueueEntry queueEntry, FahLogUnitData fahLogUnitData, UnitInfoLogData unitInfoLogData, bool matchOverride) { // queueEntry can be null Debug.Assert(fahLogUnitData != null); // unitInfoLogData can be null var unit = new UnitInfo(); unit.UnitStartTimeStamp = fahLogUnitData.UnitStartTimeStamp; unit.FramesObserved = fahLogUnitData.FramesObserved; unit.CoreVersion = fahLogUnitData.CoreVersion; unit.UnitResult = fahLogUnitData.UnitResult; if (queueEntry != null) { PopulateUnitInfoFromQueueEntry(queueEntry, unit); SearchFahLogUnitDataProjects(unit, fahLogUnitData); PopulateUnitInfoFromLogs(CurrentClientRun, fahLogUnitData, unitInfoLogData, unit); if (ProjectsMatch(unit, fahLogUnitData) || ProjectsMatch(unit, unitInfoLogData) || matchOverride) { // continue parsing the frame data ParseFrameData(fahLogUnitData.FrameDataList, unit); } else { return null; } } else { PopulateUnitInfoFromLogs(CurrentClientRun, fahLogUnitData, unitInfoLogData, unit); ParseFrameData(fahLogUnitData.FrameDataList, unit); } return unit; }
private UnitInfo BuildUnitInfo(QueueEntry queueEntry, FahLogUnitData fahLogUnitData, UnitInfoLogData unitInfoLogData) { return BuildUnitInfo(queueEntry, fahLogUnitData, unitInfoLogData, false); }
private static void PopulateUnitInfoFromQueueEntry(QueueEntry entry, UnitInfo unit) { Debug.Assert(entry != null); Debug.Assert(unit != null); // convert to enum var queueEntryStatus = (QueueEntryStatus)entry.EntryStatus; if ((queueEntryStatus.Equals(QueueEntryStatus.Unknown) || queueEntryStatus.Equals(QueueEntryStatus.Empty) || queueEntryStatus.Equals(QueueEntryStatus.Garbage) || queueEntryStatus.Equals(QueueEntryStatus.Abandonded)) == false) { /* Tag (Could be read here or through the unitinfo.txt file) */ unit.ProteinTag = entry.WorkUnitTag; /* DownloadTime (Could be read here or through the unitinfo.txt file) */ unit.DownloadTime = entry.BeginTimeUtc; /* DueTime (Could be read here or through the unitinfo.txt file) */ unit.DueTime = entry.DueTimeUtc; /* FinishedTime */ if (queueEntryStatus.Equals(QueueEntryStatus.Finished) || queueEntryStatus.Equals(QueueEntryStatus.ReadyForUpload)) { unit.FinishedTime = entry.EndTimeUtc; } /* Project (R/C/G) */ unit.ProjectID = entry.ProjectID; unit.ProjectRun = entry.ProjectRun; unit.ProjectClone = entry.ProjectClone; unit.ProjectGen = entry.ProjectGen; /* FoldingID and Team from Queue Entry */ unit.FoldingID = entry.FoldingID; unit.Team = (int) entry.TeamNumber; /* Core ID */ unit.CoreID = entry.CoreNumberHex.ToUpperInvariant(); } }
private static void UpdateUnitInfoFromQueueData(UnitInfo unitInfo, QueueEntry queueEntry) { Debug.Assert(unitInfo != null); Debug.Assert(queueEntry != null); // convert to enum var queueEntryStatus = (QueueEntryStatus)queueEntry.EntryStatus; if ((queueEntryStatus == QueueEntryStatus.Unknown || queueEntryStatus == QueueEntryStatus.Empty || queueEntryStatus == QueueEntryStatus.Garbage || queueEntryStatus == QueueEntryStatus.Abandonded) == false) { /* Tag (Could be read here or through the unitinfo.txt file) */ unitInfo.ProteinTag = queueEntry.WorkUnitTag; /* DownloadTime (Could be read here or through the unitinfo.txt file) */ unitInfo.DownloadTime = queueEntry.BeginTimeUtc; /* DueTime (Could be read here or through the unitinfo.txt file) */ unitInfo.DueTime = queueEntry.DueTimeUtc; /* FinishedTime */ if (queueEntryStatus == QueueEntryStatus.Finished || queueEntryStatus == QueueEntryStatus.ReadyForUpload) { unitInfo.FinishedTime = queueEntry.EndTimeUtc; } /* Project (R/C/G) */ unitInfo.ProjectID = queueEntry.ProjectID; unitInfo.ProjectRun = queueEntry.ProjectRun; unitInfo.ProjectClone = queueEntry.ProjectClone; unitInfo.ProjectGen = queueEntry.ProjectGen; /* FoldingID and Team from Queue Entry */ unitInfo.FoldingID = queueEntry.FoldingID; unitInfo.Team = (int)queueEntry.TeamNumber; /* Core ID */ unitInfo.CoreID = queueEntry.CoreNumberHex.ToUpperInvariant(); } }
private static UnitInfo BuildUnitInfo(QueueEntry queueEntry, ClientRun clientRun, UnitRun unitRun, UnitInfoLogData unitInfoLogData, bool matchOverride = false) { // queueEntry can be null Debug.Assert(clientRun != null); // unitInfoLogData can be null var unit = new UnitInfo(); UnitRunData unitRunData; if (unitRun == null) { if (matchOverride) { unitRunData = new UnitRunData(); } else { return null; } } else { unit.LogLines = unitRun.ToList(); unitRunData = unitRun.Data; } unit.UnitStartTimeStamp = unitRunData.UnitStartTimeStamp ?? TimeSpan.MinValue; unit.FramesObserved = unitRunData.FramesObserved; unit.CoreVersion = unitRunData.CoreVersion; unit.UnitResult = unitRunData.WorkUnitResult; if (queueEntry != null) { UpdateUnitInfoFromQueueData(unit, queueEntry); SearchFahLogUnitDataProjects(unit, unitRunData); UpdateUnitInfoFromLogData(unit, clientRun.Data, unitRunData, unitInfoLogData); if (!ProjectsMatch(unit, unitRunData) && !ProjectsMatch(unit, unitInfoLogData) && !matchOverride) { return null; } } else { UpdateUnitInfoFromLogData(unit, clientRun.Data, unitRunData, unitInfoLogData); } return unit; }