Skip to content

Commit 2655465

Browse files
committed
ULOG import fix
1 parent cd03782 commit 2655465

File tree

1 file changed

+35
-28
lines changed

1 file changed

+35
-28
lines changed

MAVGCL/src/main/java/com/comino/flight/log/ulog/MavLinkULOGHandler.java

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -101,37 +101,43 @@ private MavLinkULOGHandler(IMAVController control) {
101101
this.modelService = AnalysisModelService.getInstance();
102102

103103
is_directory_loaded.addListener((b,o,n) -> {
104-
if(n.booleanValue()) {
105-
props.getProgressProperty().set(StateProperties.NO_PROGRESS);
106-
System.out.println(directory.size()+" log entries found");
107-
switch(mode) {
108-
case MODE_SELECT:
109-
110-
if(directory.size() < 1) {
111-
cancelLoading();
112-
return;
113-
}
114-
115-
filehandler.setName("select log");
116-
ULogSelectionDialog d = new ULogSelectionDialog(directory);
117-
int id = d.selectLogId();
118-
if(id <0) {
119-
cancelLoading();
120-
return;
121-
}
122-
requestLog(id);
123-
124-
break;
125-
case MODE_LAST:
126-
requestLog(directory.get(directory.size()-1).id);
127-
break;
128-
}
129-
props.getLogLoadedProperty().set(false);
130-
}
104+
105+
if(!n.booleanValue())
106+
return;
107+
108+
props.getProgressProperty().set(StateProperties.NO_PROGRESS);
109+
System.out.println(directory.size()+" log entries found");
110+
switch(mode) {
111+
case MODE_SELECT:
112+
113+
if(directory.size() < 1) {
114+
cancelLoading();
115+
return;
116+
}
117+
118+
filehandler.setName("select log");
119+
ULogSelectionDialog d = new ULogSelectionDialog(directory);
120+
int id = d.selectLogId();
121+
if(id <0) {
122+
cancelLoading();
123+
return;
124+
}
125+
requestLog(id);
126+
127+
break;
128+
case MODE_LAST:
129+
requestLog(directory.get(directory.size()-1).id);
130+
break;
131+
}
132+
props.getLogLoadedProperty().set(false);
133+
131134
});
132135

133136
is_log_loaded.addListener((b,o,n) -> {
134137

138+
if(!n.booleanValue())
139+
return;
140+
135141
System.out.println("Log loaded");
136142
is_loading.set(false);
137143
props.getProgressProperty().set(StateProperties.NO_PROGRESS);
@@ -260,7 +266,7 @@ private void requestLog(final int id) {
260266

261267

262268
private void handleLogEntry(msg_log_entry entry) {
263-
269+
264270
if(entry.size == 0)
265271
return;
266272

@@ -342,6 +348,7 @@ private void sendDirectoryRequest() {
342348

343349
directory.clear();
344350
is_directory_loaded.set(false);
351+
is_log_loaded.set(false);
345352
log_count = 0;
346353

347354
msg_log_request_list msg = new msg_log_request_list(255, 1);

0 commit comments

Comments
 (0)