private string formatMapItemRobot(MapItem2 mapItem) { StringBuilder map = new StringBuilder(); string sTemp = string.Empty; bool apendUperSand = false; map.Append(@"\multirow{"); map.Append(mapItem.MapRows.ToString()); map.Append(@"}{*}{"); map.Append(mapItem.Name); map.Append(@"} & "); if (mapItem.ExistsR) { sTemp = formatAlgorytmRobot("R", mapItem.R); map.Append(sTemp); apendUperSand = true; } if (mapItem.ExistsPF) { if (apendUperSand) { map.Append(" & "); } sTemp = formatAlgorytmRobot("PF", mapItem.PF); map.Append(sTemp); } if (mapItem.ExistsRVO) { if (apendUperSand) { map.Append(" & "); } sTemp = formatAlgorytmRobot("RVO", mapItem.RVO); map.Append(sTemp); } if (mapItem.ExistsPR) { if (apendUperSand) { map.Append(" & "); } sTemp = formatAlgorytmRobot("PR", mapItem.PR); map.Append(sTemp); } if (mapItem.ExistsRplus) { if (apendUperSand) { map.Append(" & "); } sTemp = formatAlgorytmRobot("R+", mapItem.Rplus); map.Append(sTemp); } if (mapItem.ExistsPFplus) { if (apendUperSand) { map.Append(" & "); } sTemp = formatAlgorytmRobot("PF+", mapItem.PFplus); map.Append(sTemp); } return(map.ToString()); }
private List <MapItem2> loadFileDataRobot(string sDirectory) { List <MapItem2> result = new List <MapItem2>(); MapItem2 currentMap; var directories = Directory.GetDirectories(sDirectory); foreach (var mainItem in directories) { currentMap = new MapItem2(); DirectoryInfo mapName = new DirectoryInfo(mainItem); currentMap.Name = mapName.Name; result.Add(currentMap); var mapsDirectory = Directory.GetDirectories(mainItem); foreach (var algoDirectory in mapsDirectory) { var caseDirectory = Directory.GetDirectories(algoDirectory); foreach (var fileItem in caseDirectory) { string[] files = Directory.GetFiles(fileItem, "*.avi"); if (files.Length != 1) { throw new Exception("W katalogu jest wiecje niz jeden plik lub brak pliku katalog: " + fileItem); } DirectoryInfo algName = new DirectoryInfo(algoDirectory); FileItem2 file; switch (algName.Name) { case "R": file = new FileItem2(); file.FilePath = files[0]; currentMap.R.Add(file); break; case "PF": file = new FileItem2(); file.FilePath = files[0]; currentMap.PF.Add(file); break; case "RVO": file = new FileItem2(); file.FilePath = files[0]; currentMap.RVO.Add(file); break; case "PR": file = new FileItem2(); file.FilePath = files[0]; currentMap.PR.Add(file); break; case "R+": file = new FileItem2(); file.FilePath = files[0]; currentMap.Rplus.Add(file); break; case "PF+": file = new FileItem2(); file.FilePath = files[0]; currentMap.PFplus.Add(file); break; default: break; } } } } return(result); }