Skip to content

Commit 07844a9

Browse files
committed
Simulation handling
1 parent daedad9 commit 07844a9

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

MAVGCL/src/main/java/com/comino/flight/MainApp.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,10 @@ else if(args.get("ip")!=null)
327327

328328
state.getConnectedProperty().addListener((e,o,n) -> {
329329
if(n.booleanValue()) {
330+
330331
//control.getStatusManager().reset();
331-
wq.addSingleTask("LP",300, () -> {
332+
wq.addSingleTask("LP",300, () -> {
333+
System.out.println("Is simulation: "+control.isSimulation());
332334
// control.getStatusManager().reset();
333335
control.sendMAVLinkCmd(MAV_CMD.MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES, 1);
334336
if(!control.getCurrentModel().sys.isStatus(Status.MSP_INAIR) && control.getCurrentModel().sys.isStatus(Status.MSP_ACTIVE)) {
@@ -352,8 +354,6 @@ else if(args.get("ip")!=null)
352354
}
353355

354356

355-
356-
357357
state.getLPOSAvailableProperty().addListener((v,o,n) -> {
358358

359359
// should check for homepos

MAVGCL/src/main/java/com/comino/flight/observables/StateProperties.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ public static StateProperties getInstance(IMAVController control) {
121121
private StateProperties(IMAVController control) {
122122
this.control = control;
123123
this.logger = MSPLogger.getInstance();
124-
125-
simulationProperty.set(control.isSimulation());
126124

127125
wq.addSingleTask("LP", 2000, () -> isInitializedProperty.set(true) );
128126

MAVGCL/src/main/java/com/comino/flight/ui/widgets/camera/CameraWidget.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private void initialize() {
194194
// });
195195

196196
state.getRecordingProperty().addListener((o,ov,nv) -> {
197-
if(!userPrefs.getBoolean(MAVPreferences.VIDREC, false) || !state.isAutoRecording().get() || state.getSimulationProperty().get())
197+
if(!userPrefs.getBoolean(MAVPreferences.VIDREC, false) || !state.isAutoRecording().get() || control.isSimulation())
198198
return;
199199

200200
if(nv.intValue()==AnalysisModelService.COLLECTING) {
@@ -264,7 +264,7 @@ protected void perform_action() {
264264
private boolean connect() {
265265
String url_string = null;
266266

267-
if(isConnected || state.getSimulationProperty().get())
267+
if(isConnected)
268268
return true;
269269

270270

MAVGCL/src/main/java/com/comino/video/src/impl/rtps/RTSPMjpegVideoSource.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public void start() {
149149
try {
150150

151151
RTSPsocket = new Socket(ServerIPAddr, ServerPort);
152+
RTSPsocket.setSoTimeout(200);
152153

153154
try {
154155
//construct a new DatagramSocket to receive RTP packets from the server, on port RTP_RCV_PORT

MAVGCL/src/main/java/com/comino/video/src/mp4/MP4Recorder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public MP4Recorder(String path, int width, int height) {
5959
return;
6060
try {
6161
if(n.booleanValue()) {
62-
System.out.println("MP4 recording started");
62+
System.out.println("MP4 recording started - MP4");
6363
encoder = new MSPSequenceEncoder(new File(path+"/video.mp4"));
6464
}
6565
else {

0 commit comments

Comments
 (0)