Browse Source

Version 04.12 "vollständiges Programm mit Fehlern"

master
David Moeckel 2 weeks ago
parent
commit
5f211026e4
4 changed files with 40 additions and 11 deletions
  1. 18
    3
      .idea/workspace.xml
  2. 11
    8
      src/main/java/GameLoop.java
  3. 3
    0
      src/main/java/Main.java
  4. 8
    0
      src/main/java/Tracker.java

+ 18
- 3
.idea/workspace.xml View File

</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="4d75e996-cee4-4ec6-b802-5b56d0c0eac4" name="Changes" comment="Version 27.11 (&quot;fertiger&quot; Tracker)"> <list default="true" id="4d75e996-cee4-4ec6-b802-5b56d0c0eac4" name="Changes" comment="Version 27.11 (&quot;fertiger&quot; Tracker)">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/GameLoop.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/GameLoop.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Main.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/Tracker.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Tracker.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/java/Tracker.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Tracker.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
"keyToString": { "keyToString": {
"Application.GTCar.executor": "Run", "Application.GTCar.executor": "Run",
"Application.GraphicsProgram.executor": "Run", "Application.GraphicsProgram.executor": "Run",
"Application.Main.executor": "Run",
"Application.Tracker.executor": "Run", "Application.Tracker.executor": "Run",
"Downloaded.Files.Path.Enabled": "false", "Downloaded.Files.Path.Enabled": "false",
"Repository.Attach.Annotations": "false", "Repository.Attach.Annotations": "false",
"com.codeium.enabled": "true", "com.codeium.enabled": "true",
"git-widget-placeholder": "master", "git-widget-placeholder": "master",
"kotlin-language-version-configured": "true", "kotlin-language-version-configured": "true",
"last_opened_file_path": "C:/Users/david/Documents/Uni/GTCar/opencv/build/java/opencv-4100.jar",
"last_opened_file_path": "C:/Users/david/Documents/Uni/GTCar/processing-4.3/core/library/core.jar",
"node.js.detected.package.eslint": "true", "node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true", "node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)", "node.js.selected.package.eslint": "(autodetect)",
"vue.rearranger.settings.migration": "true" "vue.rearranger.settings.migration": "true"
} }
}]]></component> }]]></component>
<component name="RunManager">
<component name="RunManager" selected="Application.Main">
<configuration name="GTCar" type="Application" factoryName="Application"> <configuration name="GTCar" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="Tracker" /> <option name="MAIN_CLASS_NAME" value="Tracker" />
<module name="GTCar_V2_maven" /> <module name="GTCar_V2_maven" />
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Main" />
<module name="GTCar_V2_maven" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary>
<list>
<item itemvalue="Application.Main" />
</list>
</recent_temporary>
</component> </component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" /> <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager"> <component name="TaskManager">
<updated>1732108904989</updated> <updated>1732108904989</updated>
<workItem from="1732108906083" duration="758000" /> <workItem from="1732108906083" duration="758000" />
<workItem from="1732113837570" duration="20534000" /> <workItem from="1732113837570" duration="20534000" />
<workItem from="1733327375447" duration="951000" />
</task> </task>
<task id="LOCAL-00001" summary="First Commit Test"> <task id="LOCAL-00001" summary="First Commit Test">
<option name="closed" value="true" /> <option name="closed" value="true" />

+ 11
- 8
src/main/java/GameLoop.java View File

Player player2; Player player2;


public GameLoop(){ public GameLoop(){
player1 = new Player(0, "ip", 9000);
player2 = new Player(1, "ip", 9000);
player1 = new Player(0, "192.168.33.33", 9000);
player2 = new Player(1, "192.168.33.44", 9000);
tracker = new Tracker(); tracker = new Tracker();
graphics = new GraphicsProgram(); graphics = new GraphicsProgram();
String[] args = {"GraphicsProgram"}; String[] args = {"GraphicsProgram"};
} }


private List<Point> track(){ private List<Point> track(){
Point p1 = tracker.getP1();
Point p2 = tracker.getP2();
org.opencv.core.Point p1 = tracker.getP1();
org.opencv.core.Point p2 = tracker.getP2();


player1.setKoords(p1.x, p1.y);
player2.setKoords(p2.x, p2.y);
java.awt.Point p1Java = new java.awt.Point((int) p1.x, (int) p1.y);
java.awt.Point p2Java = new java.awt.Point((int) p2.x, (int) p2.y);

player1.setKoords(p1Java.x, p1Java.y);
player2.setKoords(p2Java.x, p2Java.y);


List<Point> output = new ArrayList<>(); List<Point> output = new ArrayList<>();
output.set(0, p1);
output.add(p2);
output.set(0, p1Java);
output.set(1, p2Java);
return output; return output;
} }



+ 3
- 0
src/main/java/Main.java View File

public class Main { public class Main {
public static void main(String[] args){
GameLoop gl = new GameLoop();
}
} }

+ 8
- 0
src/main/java/Tracker.java View File

return positions; return positions;
} }


public Point getP1(){
return currentPositionP1;
}

public Point getP2(){
return currentPositionP2;
}

private void drawMarkers(Mat frame) { private void drawMarkers(Mat frame) {
// Größe der Quadrate // Größe der Quadrate
int size = 10; int size = 10;

Loading…
Cancel
Save