private static void ParseInDirectory_WithoutKAndRFiles(string dir, string file_csv, string tab2File, int NZones, string kadrDefault = "") { TobiiCsvReader tobiiCsvReader = new TobiiCsvReader(); List <TobiiRecord> tobiiRecords = new List <TobiiRecord>(); tobiiCsvReader.TobiiCSCRead(file_csv, tobiiRecords, NZones); List <TobiiRecord> FiltredTobiiList = tobiiCsvReader.CompactTobiiRecords(tobiiRecords); TabOfKeys tabOfKeys = ExcelReader.ReadTabOfKeys(tab2File, "B"); Regex regex = new Regex(@"id\d{3}"); MatchCollection matches = regex.Matches(Path.GetFileName(file_csv)); if (matches.Count > 1 || matches.Count == 0) { MessageBox.Show("В имени файла " + file_csv + " найдено неверное кол-во id (0 или более 1)"); return; } string FileId = matches[0].Value.Replace("id", ""); FZoneTab fZoneTab = new FZoneTab(); List <TobiiRecord> FZoneList = fZoneTab.Calculate(FiltredTobiiList, tabOfKeys); FZoneList = tobiiCsvReader.ClearFromGarbageZone(FZoneList, -1, FixationAddition); FZoneList = tobiiCsvReader.CompactTobiiRecords(FZoneList, "FZones"); fZoneTab.WriteResult(file_csv.Replace(".csv", ".txt"), FZoneList); }
public static void ParseInDirectory(string dir, string file_csv, string tab2File, int NZones) { TobiiCsvReader tobiiCsvReader = new TobiiCsvReader(); List <TobiiRecord> tobiiRecords = new List <TobiiRecord>(); tobiiCsvReader.TobiiCSCRead(file_csv, tobiiRecords, NZones); List <TobiiRecord> FiltredTobiiList = tobiiCsvReader.CompactTobiiRecords(tobiiRecords); TabOfKeys tabOfKeys = ExcelReader.ReadTabOfKeys(tab2File, "T"); FZoneTab fZoneTab = new FZoneTab(); List <TobiiRecord> FZoneList = fZoneTab.Calculate(FiltredTobiiList, tabOfKeys); FZoneList = tobiiCsvReader.ClearFromGarbageZone(FZoneList, -1, 500); FZoneList = tobiiCsvReader.CompactTobiiRecords(FZoneList, "FZones"); fZoneTab.WriteResult(file_csv.Replace(".csv", ".txt"), FZoneList); }
private void Button_Click_2(object sender, RoutedEventArgs e) { TobiiCsvReader tobiiCsvReader = new TobiiCsvReader(); List <TobiiRecord> tobiiRecords = new List <TobiiRecord>(); tobiiCsvReader.TobiiCSCRead(@"C:\_\1\1.csv", tobiiRecords); List <TobiiRecord> FiltredTobiiList = tobiiCsvReader.CompactTobiiRecords(tobiiRecords); TabOfKeys tabOfKeys = ExcelReader.ReadTabOfKeys(@"C:\_\Tab2new.xlsx"); List <KadrInTime> kadrInTimes = ExcelReader.ReadKadrSets(@"C:\_\1\1_k.xls"); FZoneTab fZoneTab = new FZoneTab(); fZoneTab.Calculate(FiltredTobiiList, kadrInTimes, tabOfKeys); fZoneTab.FZoneList = tobiiCsvReader.ClearFromGarbageZone(fZoneTab.FZoneList, -1, 500); fZoneTab.WriteResult(@"C:\tmp\1\1.txt"); List <Interval> intervals = ExcelReader.SeparatorIntervalsReadFromExcel(@"C:\_\1\1_reg.xls"); ResultSeparator resultSeparator = new ResultSeparator(@"C:\_\1\reg\", intervals, fZoneTab.FZoneList, "1"); resultSeparator.Separate(); }
public static void ParseInDirectory(string dir, string file_csv, string file_k, string file_reg, string tab2File) { TobiiCsvReader tobiiCsvReader = new TobiiCsvReader(); List <TobiiRecord> tobiiRecords = new List <TobiiRecord>(); tobiiCsvReader.TobiiCSCRead(file_csv, tobiiRecords); List <TobiiRecord> FiltredTobiiList = tobiiCsvReader.CompactTobiiRecords(tobiiRecords); TabOfKeys tabOfKeys = ExcelReader.ReadTabOfKeys(tab2File); List <KadrInTime> kadrInTimes = ExcelReader.ReadKadrSets(file_k); FZoneTab fZoneTab = new FZoneTab(); fZoneTab.Calculate(FiltredTobiiList, kadrInTimes, tabOfKeys); fZoneTab.FZoneList = tobiiCsvReader.ClearFromGarbageZone(fZoneTab.FZoneList, -1, 500); fZoneTab.FZoneList = tobiiCsvReader.CompactTobiiRecords(fZoneTab.FZoneList); fZoneTab.WriteResult(file_csv.Replace(".csv", ".txt")); List <Interval> intervals = ExcelReader.SeparatorIntervalsReadFromExcel(file_reg); ResultSeparator resultSeparator = new ResultSeparator(dir + @"\reg\", intervals, fZoneTab.FZoneList, Path.GetFileName(file_csv).Replace(".csv", "_")); resultSeparator.Separate(); }
private static void ParseInDirectory_OneRegFile(string dir, string file_csv, string file_k, string file_r, string tab2File, int NZones, string kadrDefault = "", string tab2FileLastColumn = "T") { TobiiCsvReader tobiiCsvReader = new TobiiCsvReader(); List <TobiiRecord> tobiiRecords = new List <TobiiRecord>(); tobiiCsvReader.TobiiCSCRead(file_csv, tobiiRecords, NZones); List <TobiiRecord> FiltredTobiiList = tobiiCsvReader.CompactTobiiRecords(tobiiRecords); TabOfKeys tabOfKeys = ExcelReader.ReadTabOfKeys(tab2File, tab2FileLastColumn); Regex regex = new Regex(@"id\d{3}"); MatchCollection matches = regex.Matches(Path.GetFileName(file_csv)); if (matches.Count > 1 || matches.Count == 0) { MessageBox.Show("В имени файла " + file_csv + " найдено неверное кол-во id (0 или более 1)"); return; } string FileId = matches[0].Value.Replace("id", ""); KadrIntervals kadrIntervals; kadrIntervals = SpecialFor9_41_SCENARY2.GetKadrIntervalsInXmlKFile(file_k, FileId); FZoneTab fZoneTab = new FZoneTab(); List <TobiiRecord> FZoneList = fZoneTab.Calculate(FiltredTobiiList, kadrIntervals, tabOfKeys); FZoneList = tobiiCsvReader.ClearFromGarbageZone(FZoneList, -1, FixationAddition); FZoneList = tobiiCsvReader.CompactTobiiRecords(FZoneList, "FZones"); fZoneTab.WriteResult(file_csv.Replace(".csv", ".txt"), FZoneList); SeparatorIntervals separatorIntervals = SpecialFor9_41_SCENARY2.GetSeparatorIntervalsInXmlKFile(file_r, FileId); ResultSeparator resultSeparator = new ResultSeparator(dir + @"\reg\", separatorIntervals.Intervals, FZoneList, Path.GetFileName(file_csv).Replace(".csv", "_")); resultSeparator.Separate(); }