Skip to content

Commit 0b6ada6

Browse files
committed
ULOG loading speed improvements, Minor enhancements
1 parent 6b64169 commit 0b6ada6

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,21 +240,20 @@ private void requestLog(final int id) {
240240

241241
requestDataPackages(id, 0, total_package_count * LOG_PACKAG_DATA_LENGTH );
242242

243-
worker = wq.addCyclicTask("LP",15,() -> {
243+
worker = wq.addCyclicTask("LP",100,() -> {
244244

245-
if((System.currentTimeMillis() - last_package_tms) < 5 )
245+
if((System.currentTimeMillis() - last_package_tms) < 10 )
246246
return;
247247

248248
if (++retry > 1000) {
249249
cancelLoading();
250250
return;
251251
}
252252

253-
254253
filehandler.setName("loading log "+log_id+" ("+speed+"kb/s)");
255254

256255
int c = 0;
257-
while(searchForNextUnreadPackage() && c++ < 5)
256+
while(searchForNextUnreadPackage() && c++ < 10)
258257
requestDataPackages(id,chunk_offset * LOG_PACKAG_DATA_LENGTH, chunk_size * LOG_PACKAG_DATA_LENGTH);
259258

260259
});

MAVGCL/src/main/java/com/comino/flight/log/ulog/dialog/ULogSelectionDialog.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ public ULogSelectionDialog(Map<Integer,msg_log_entry> list) {
108108
colName.setCellValueFactory( new PropertyValueFactory<TabData, String>("name"));
109109
colName.setSortType(TableColumn.SortType.DESCENDING);
110110

111-
TableColumn<TabData, Integer> colSize= new TableColumn<TabData, Integer>("Size");
111+
TableColumn<TabData, String> colSize= new TableColumn<TabData, String>("Size");
112112
colSize.setMinWidth(25);
113-
colSize.setCellValueFactory( new PropertyValueFactory<TabData, Integer>("size"));
113+
colSize.setCellValueFactory( new PropertyValueFactory<TabData, String>("size"));
114114

115115
table.getColumns().addAll(colId,colName,colSize);
116116

@@ -165,12 +165,20 @@ public class TabData {
165165

166166
private int id;
167167
private String name;
168-
private int size;
168+
private String size;
169169

170170
public TabData(msg_log_entry e) {
171+
171172
id = e.id;
172173
name = date_f.format(e.time_utc*1000);
173-
size = (int)(e.size / 1024);
174+
175+
float s = e.size / 1024f;
176+
if(s < 1024)
177+
size = String.format("%#.0fkb", s);
178+
else
179+
size = String.format("%#.1fMb", s/1024f);
180+
181+
174182
}
175183

176184
public int getId() {
@@ -179,7 +187,7 @@ public int getId() {
179187
public String getName() {
180188
return name;
181189
}
182-
public int getSize() {
190+
public String getSize() {
183191
return size;
184192
}
185193
public void setId(int id) {
@@ -188,7 +196,7 @@ public void setId(int id) {
188196
public void setName(String name) {
189197
this.name = name;
190198
}
191-
public void setSize(int size) {
199+
public void setSize(String size) {
192200
this.size = size;
193201
}
194202

0 commit comments

Comments
 (0)