Skip to content

Commit

Permalink
Stop mavlink based logging only in ULOG mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ecmnet committed Jan 31, 2022
1 parent c3f20aa commit 9dcdf49
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MAVGCL/src/main/java/com/comino/flight/MainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public class MainApp extends Application {

private final WorkQueue wq = WorkQueue.getInstance();

private AnalysisModelService analysisModelService;
private SimpleNTPServer ntp_server;

public MainApp() {
Expand Down Expand Up @@ -314,7 +315,7 @@ else if(args.get("ip")!=null)
MAVGCLMap.getInstance(control);
MAVGCLPX4Parameters.getInstance(control);

AnalysisModelService analysisModelService = AnalysisModelService.getInstance(control);
analysisModelService = AnalysisModelService.getInstance(control);
analysisModelService.startConverter();

state.getConnectedProperty().addListener((e,o,n) -> {
Expand Down Expand Up @@ -437,7 +438,7 @@ public void start(Stage primaryStage) {
@Override
public void stop() throws Exception {
System.out.println("[mgc] Closing...");
control.sendMAVLinkCmd(MAV_CMD.MAV_CMD_LOGGING_STOP);
analysisModelService.close();
control.shutdown();
MAVPreferences.getInstance().putDouble("stage.x", primaryStage.getX());
MAVPreferences.getInstance().putDouble("stage.y", primaryStage.getY());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ public void startConverter() {
c.setPriority(Thread.NORM_PRIORITY+2);
c.start();
}

public void close() {
stop();
if(ulogger.isLogging())
control.sendMAVLinkCmd(MAV_CMD.MAV_CMD_LOGGING_STOP);
}

public void registerListener(ICollectorRecordingListener l) {
listener.add(l);
Expand Down

0 comments on commit 9dcdf49

Please sign in to comment.