static void Main(string[] args) { //tabKlein.csv oder KinectDaten_Pascal.csv //String path = "C:/Users/Asus/Documents/VS Code/Softwareprojekt/data/tabKlein.csv"; String path; if (false) { path = "C:/Users/Asus/Documents/VS Code/Softwareprojekt/data/tabKlein.csv"; } else { path = "C:/Users/Asus/Documents/VS Code/Softwareprojekt/data/KinectDaten_Pascal.csv"; } trainDataReader TDReader = new trainDataReader(path); gestureData.trainingData trainData = TDReader.readData(); //nur der Test, ob alle Punkte eingelesen wurde //unwichtig, kann man löschen /*Console.WriteLine("Daten eingelesen, beginne checken"); * Boolean correct = true; //checkTD(trainData); * //Boolean correct = false; * if(correct) Console.WriteLine("Daten korrekt"); * else Console.WriteLine("Nöp");*/ }
static private Boolean checkTD(gestureData.trainingData td) { Boolean isCorrect = true; String _path = "C:/Users/Asus/Documents/VS Code/Softwareprojekt/data/tabKlein.csv"; using (var reader = new StreamReader(@_path)) { String head = reader.ReadLine(); int currentPointID; float currentPointX; float currentPointY; float currentPointZ; int currentGestureID; int currentShapeID; //count points int q = 0; for (int k = 0; k < 23; k++) { if (td.getShape(k) != null) { List <gD.trainingData.Shape.Gesture> a = td.getShape(k).getGestures(); foreach (gD.trainingData.Shape.Gesture l in a) { List <gD.trainingData.Shape.Gesture.Point> b = l.getPoints(); foreach (gD.trainingData.Shape.Gesture.Point p in b) { //Console.WriteLine(p.ToString()); q++; } } } } Console.WriteLine(q + " Punkte"); while (!reader.EndOfStream) { String line = reader.ReadLine(); string[] lineArray = line.Split(';'); currentPointID = Int32.Parse(lineArray[0]); currentPointX = float.Parse(lineArray[1]); currentPointY = float.Parse(lineArray[2]); currentPointZ = float.Parse(lineArray[3]); currentGestureID = Int32.Parse(lineArray[4]); currentShapeID = Int32.Parse(lineArray[9]); gD.trainingData.Shape s = td.getShape(currentShapeID); List <gD.trainingData.Shape.Gesture> gestures = s.getGestures(); for (int i = 0; i < gestures.Count; i++) { gD.trainingData.Shape.Gesture g = gestures[i]; if (g.getGestureID() == currentGestureID) { //punkt checken List <gD.trainingData.Shape.Gesture.Point> points = g.getPoints(); for (int j = 0; j < points.Count; j++) { gD.trainingData.Shape.Gesture.Point p = points[j]; if (p.ID == currentPointID) { break; } if (j == points.Count - 1) { isCorrect = false; } } break; } } } return(isCorrect); } }