Skip to content

Commit

Permalink
added total time
Browse files Browse the repository at this point in the history
  • Loading branch information
marinakiweler committed Oct 6, 2020
1 parent c9963f1 commit c016d37
Show file tree
Hide file tree
Showing 39 changed files with 11,199 additions and 12 deletions.
11 changes: 10 additions & 1 deletion MARMoSET_C/MARMoSET/FileGroup.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;

namespace MARMoSET
{
Expand All @@ -8,18 +9,26 @@ class FileGroup
public Dictionary<string, InstrumentMethod> Instruments { get; set; }
public Dictionary<string, File> Files { get; set; }

public TimeSpan MSTotalTime { get; set; }

/// <summary>
/// FileGroup is a class to store the list of names, the list of instruments and the list of files.
/// </summary>
/// <param name="names"> List containing the file names belonging to this group.</param>
/// <param name="files"> Dictionary with names as key and additional data for each file as value.</param>
/// <param name="instrument"> Dictionary containing the instrument as key and method/tune data as value.</param>
///
public FileGroup(List<string> names, Dictionary<string, File> files , Dictionary<string, InstrumentMethod> instrument)
public FileGroup(List<string> names, Dictionary<string, File> files, double MSTime, Dictionary<string, InstrumentMethod> instrument)
{
this.Names = names;
this.Files = files;
this.Instruments = instrument;
this.MSTotalTime = TimeSpan.FromMinutes(MSTime);
}
public void AddToTotalTime(double addTime)
{
TimeSpan addSpan = TimeSpan.FromMinutes(addTime);
this.MSTotalTime = this.MSTotalTime.Add(addSpan);
}
}
}
8 changes: 7 additions & 1 deletion MARMoSET_C/MARMoSET/FileSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,22 @@ public Dictionary<int, FileGroup> doGroups(string[] rawFiles, string path, bool
{
hashGroup[code].Files.Add(filename.Replace(path + "\\", ""), oneFile);
hashGroup[code].Names.Add(filename.Replace(path + "\\", ""));
double oneTime = oneFile.FileInformation.EndTime - oneFile.FileInformation.StartTime;
hashGroup[code].AddToTotalTime(oneTime);
}
else
{ // first entry for this hashcode:
var nameList = new List<string>();
var groupDic = new Dictionary<string, File>();
var msTime = new Double();
nameList.Add(filename.Replace(path + "\\", ""));
groupDic.Add(filename.Replace(path + "\\", ""), oneFile);
msTime = oneFile.FileInformation.EndTime - oneFile.FileInformation.StartTime;

// create new FileGroup
hashGroup[code] = new FileGroup(nameList, groupDic, instruments);
hashGroup[code] = new FileGroup(nameList, groupDic, msTime, instruments);
}

}

var groupList = new Dictionary<int, FileGroup>();
Expand Down
8 changes: 4 additions & 4 deletions MARMoSET_C/MARMoSET/MARMoSET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,19 @@
<Reference Include="System.Data" />
<Reference Include="ThermoFisher.CommonCore.BackgroundSubtraction, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\MARMoSET_C-for_R\MARMoSET\bin\x64\Debug\ThermoFisher.CommonCore.BackgroundSubtraction.dll</HintPath>
<HintPath>..\..\..\..\source\repos\MARMoSET_C\MARMoSET_C\packages\ThermoFisher.CommonCore.RawFileReader.4.0.26\lib\Windows\ThermoFisher.CommonCore.BackgroundSubtraction.dll</HintPath>
</Reference>
<Reference Include="ThermoFisher.CommonCore.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\MARMoSET_C-for_R\MARMoSET\bin\x64\Debug\ThermoFisher.CommonCore.Data.dll</HintPath>
<HintPath>..\..\..\..\source\repos\MARMoSET_C\MARMoSET_C\packages\ThermoFisher.CommonCore.RawFileReader.4.0.26\lib\Windows\ThermoFisher.CommonCore.Data.dll</HintPath>
</Reference>
<Reference Include="ThermoFisher.CommonCore.MassPrecisionEstimator, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\MARMoSET_C-for_R\MARMoSET\bin\x64\Debug\ThermoFisher.CommonCore.MassPrecisionEstimator.dll</HintPath>
<HintPath>..\..\..\..\source\repos\MARMoSET_C\MARMoSET_C\packages\ThermoFisher.CommonCore.RawFileReader.4.0.26\lib\Windows\ThermoFisher.CommonCore.MassPrecisionEstimator.dll</HintPath>
</Reference>
<Reference Include="ThermoFisher.CommonCore.RawFileReader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\MARMoSET_C-for_R\MARMoSET\bin\x64\Debug\ThermoFisher.CommonCore.RawFileReader.dll</HintPath>
<HintPath>..\..\..\..\source\repos\MARMoSET_C\MARMoSET_C\packages\ThermoFisher.CommonCore.RawFileReader.4.0.26\lib\Windows\ThermoFisher.CommonCore.RawFileReader.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions MARMoSET_C/MARMoSET/MARMoSET.csproj.user
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartArguments>E:\bspdaten</StartArguments>
<StartArguments>\\mpg-nki-winfs.kerckhoff.mpg.de\mkiwele%24\allMARMoSET\marmoset_tests/coll_raw test.json</StartArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<StartArguments>E:\bspdaten</StartArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<StartArguments>C:\Users\mkiwele\Desktop\RAW_07\ afile.json</StartArguments>
<StartArguments>\\mpg-nki-winfs.kerckhoff.mpg.de\mkiwele%24\allMARMoSET\marmoset_tests\RAW_07 test.json</StartArguments>
<StartWorkingDirectory>
</StartWorkingDirectory>
</PropertyGroup>
Expand Down
Binary file added MARMoSET_C/MARMoSET/bin/Debug/MARMoSET.exe
Binary file not shown.
6 changes: 6 additions & 0 deletions MARMoSET_C/MARMoSET/bin/Debug/MARMoSET.exe.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/>
</startup>
</configuration>
Binary file added MARMoSET_C/MARMoSET/bin/Debug/MARMoSET.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit c016d37

Please sign in to comment.