Skip to content

UAVCAN parameters with a text value can now be saved to file and load… #2648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 84 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
edb3614
Dowding: plugin
meee1 May 7, 2021
610e574
UAVCan: fix packet generator
meee1 May 12, 2021
f952941
Xamarin: disable requestLegacyExternalStorage
meee1 May 12, 2021
e23811e
Xamarin: prepare SAF
meee1 May 12, 2021
6851fea
LogDownload: remove .log conversion by default
meee1 May 13, 2021
6eac7da
Cot: change to xmlserializer
meee1 May 13, 2021
2f0376d
SerialOutputCoT: fix invalid first char
meee1 May 13, 2021
08c37e4
LogDownloadMavLink: use filename vs stream
meee1 May 13, 2021
ffafd76
Dowding: add event click target
meee1 May 13, 2021
52f7d01
LogDownloadMavLink: add more user feedback
meee1 May 14, 2021
7bed571
UAVCan: fix bad trim
meee1 May 17, 2021
1583c32
SikRadio: invariant culture fix
meee1 May 20, 2021
e5b81ff
Dowding: add AT output
meee1 May 20, 2021
d47a282
Flasher: add
meee1 May 20, 2021
0686d4c
inf2cat: update ts server
meee1 May 21, 2021
e94ca20
Flasher: update
meee1 May 24, 2021
69290f7
MavlinkInterface: add getParamListMavftp
meee1 May 25, 2021
8556c5b
Flasher: improve old compile compat
meee1 May 25, 2021
96ee104
MAVLinkInterface: add banner
meee1 May 25, 2021
a7517f1
MainV2: update port structs
meee1 May 25, 2021
f2bc2ed
Flasher: null check
meee1 May 25, 2021
0052d3c
MissionPlannerLib: remove flasher
meee1 May 26, 2021
c93fe5f
Config-multiple: expand fields
meee1 May 26, 2021
f41451e
MainV2: add baud is number check
meee1 May 26, 2021
872803d
CurrentState: add uid2
meee1 May 26, 2021
6bd9073
Xamarin: fix android compile
meee1 May 26, 2021
a0a9059
APFirmware: make case insensitive
meee1 May 26, 2021
8325630
Mavlink param cache
meee1 May 26, 2021
8c30e78
GridUI: add decimal to speed
meee1 May 26, 2021
36d6159
CameraProtocol: await cleanup
meee1 May 26, 2021
f7fe947
AirMarket: await cleanup
meee1 May 26, 2021
6bc674c
Xamarin: add GPS
meee1 May 26, 2021
d273428
GridUI: change speed to float
meee1 May 26, 2021
9d5276b
Maps: change max zoom level
meee1 May 27, 2021
e7852e5
Dowding: fix ws parsing
meee1 May 28, 2021
a017fc7
Plugins: load self
meee1 May 28, 2021
e972f14
MAVLinkInterface: mavftp param exception fallback
meee1 May 31, 2021
4398913
MAVState: exception checks
meee1 May 31, 2021
c2313bb
Control: Status exception fix
meee1 May 31, 2021
93ef2bd
MAVState: cleanup params
meee1 May 31, 2021
5455ef3
MAVFtp: add file not found exception
meee1 May 31, 2021
d2eed74
MainV2: fix possible param issue
meee1 Jun 1, 2021
0142847
MainV2: disable paramcache
meee1 Jun 1, 2021
515d7f2
Crypto: fix buffer size
meee1 Jun 2, 2021
46b1559
Dowding: fix hiding
meee1 Jun 2, 2021
cbfc330
CurrentState: add more MAVLink2 BATTERY STATUS information display
mxiaogit Jun 2, 2021
4887d0e
FlightData: fix the incomplete display of string information
mxiaogit Jun 2, 2021
916ad89
CurrentState: Optimize string sorting
mxiaogit Jun 2, 2021
b9239a2
FlightData: Optimize string sorting
mxiaogit Jun 2, 2021
d769607
ConfigBattery: add QiotekZealotF427
QioTek May 15, 2021
6634399
GCSViews: Set the WP radius value in the repository value
muramura May 8, 2021
96ed913
Controls: Show the full link status string
muramura May 7, 2021
1765c9c
Properties: Change to WINDOWS newline
muramura May 6, 2021
4d31cda
Properties: Make the format match the others
muramura May 6, 2021
47075c0
GCSViews: Add RC inputs 15 and 16
muramura May 5, 2021
4d30774
Build: Fix file typo
stephendade May 25, 2021
4f8672d
Dowding: add onvif
meee1 Jun 3, 2021
47c82cc
Xamarin: remove extractNativeLibs
meee1 Jun 3, 2021
e8c7f74
Mavlink: add adsb messages
meee1 Jun 4, 2021
59e2b0d
Dowding: add simple test server
meee1 Jun 4, 2021
cb15562
FlightData: add adsb ident
meee1 Jun 4, 2021
f6cbaba
Xamarin: disable profiled aot
meee1 Jun 7, 2021
ab34e23
Dowding: fix altitude, UI tweaks
meee1 Jun 8, 2021
f036143
ConfigSerialInjectGPS: add ublox to labels
meee1 Jun 9, 2021
13355d8
ConfigADSB: add flid and reg
meee1 Jun 9, 2021
e86e0c4
ThemeManager: null check
meee1 Jun 9, 2021
8552b0a
Dowding: test server - add more
meee1 Jun 10, 2021
6f9be2b
MainV2: limit param poll at connect for 60 seconds
meee1 Jun 10, 2021
49c64e4
Xamarin: draw tweak
meee1 Jun 10, 2021
0977d1d
MAVState: fix paramcache file sync issues
meee1 Jun 10, 2021
bc47d59
CurrentState: ensure no unprintable characters in messagehigh
meee1 Jun 10, 2021
2098ccd
ZeroConf: rename Hosts
meee1 Jun 10, 2021
85b9e4a
Propagation: change to async
meee1 Jun 10, 2021
dba08dd
WarningEngine: change to async
meee1 Jun 10, 2021
fba3a2d
TestPlugin: deactivate
meee1 Jun 10, 2021
273bd41
MainV2: async joystick & serial
meee1 Jun 10, 2021
2028b4a
Submodule update
meee1 Jun 10, 2021
98c59d0
Xamarin: fix draw
meee1 Jun 10, 2021
46686f3
MainV2: Connection size fix
meee1 Jun 10, 2021
7fa0e04
Xamarin: fix speech crash
meee1 Jun 11, 2021
881969e
Xamarin: prevent toast crash
meee1 Jun 11, 2021
e576557
Update: remove paramgen
meee1 Jun 11, 2021
a40d9a0
Update: fix mono updater
meee1 Jun 11, 2021
bb97e90
UAVCAN parameters with a text value can now be saved to file and load…
StevenHAtRFDesign Jun 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@ dotnet_diagnostic.CS1522.severity = suggestion

dotnet_diagnostic.CS3021.severity = silent
dotnet_diagnostic.CS0618.severity = silent

# AsyncVoidAnalyzer: Async Void methods should catch exceptions
dotnet_diagnostic.AsyncVoidAnalyzer.severity = error

dotnet_diagnostic.ASYNC0003.severity = error
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ docs/
*.Test/
*.jar
*.cache
/Plugins/Dowding/server/node_modules
/Plugins/Dowding/server/package-lock.json
6 changes: 3 additions & 3 deletions Controls/ConnectionControl.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 6 additions & 9 deletions Controls/ConnectionControl.resx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
<value>15</value>
</data>
<data name="cmb_Baud.Size" type="System.Drawing.Size, System.Drawing">
<value>70, 28</value>
<value>111, 28</value>
</data>
<data name="cmb_Baud.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
Expand Down Expand Up @@ -228,7 +228,7 @@
<value>True</value>
</data>
<data name="linkLabel1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 37</value>
<value>3, 32</value>
</data>
<data name="linkLabel1.Size" type="System.Drawing.Size, System.Drawing">
<value>40, 13</value>
Expand All @@ -254,14 +254,11 @@
<data name="&gt;&gt;linkLabel1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="cmb_sysid.Font" type="System.Drawing.Font, System.Drawing">
<value>Microsoft Sans Serif, 12pt</value>
</data>
<data name="cmb_sysid.Location" type="System.Drawing.Point, System.Drawing">
<value>49, 30</value>
<value>102, 27</value>
</data>
<data name="cmb_sysid.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 28</value>
<value>136, 21</value>
</data>
<data name="cmb_sysid.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
Expand All @@ -282,10 +279,10 @@
<value>True</value>
</metadata>
<data name="$this.MinimumSize" type="System.Drawing.Size, System.Drawing">
<value>200, 60</value>
<value>200, 47</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>200, 60</value>
<value>238, 47</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>ConnectionControl</value>
Expand Down
161 changes: 111 additions & 50 deletions Controls/MavFTPUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,25 @@ private async void PopulateTreeView()
{
rootNode = new TreeNode(info.Name, 0, 0);
rootNode.Tag = info;
await GetDirectories(await info.GetDirectories().ConfigureAwait(true), rootNode).ConfigureAwait(true);
await PopulateDirectories(await info.GetDirectories().ConfigureAwait(true), rootNode).ConfigureAwait(true);
treeView1.Nodes.Add(rootNode);
}

/*
info = new DirectoryInfo(@"@ROMFS/", _mavftp);
if (info.Exists)
{
rootNode = new TreeNode("@ROMFS", 0, 0);
rootNode.Tag = info;
await GetDirectories(await info.GetDirectories().ConfigureAwait(true), rootNode).ConfigureAwait(true);
await PopulateDirectories(await info.GetDirectories().ConfigureAwait(true), rootNode).ConfigureAwait(true);
treeView1.Nodes.Add(rootNode);
}

*/
info = new DirectoryInfo(@"@SYS/", _mavftp);
if (info.Exists)
{
rootNode = new TreeNode("@SYS", 0, 0);
rootNode.Tag = info;
await GetDirectories(await info.GetDirectories().ConfigureAwait(true), rootNode).ConfigureAwait(true);
await PopulateDirectories(await info.GetDirectories().ConfigureAwait(true), rootNode).ConfigureAwait(true);
treeView1.Nodes.Add(rootNode);
}

Expand All @@ -122,7 +122,7 @@ private async void PopulateTreeView()
TreeView1_NodeMouseClick(this, new TreeNodeMouseClickEventArgs(rootNode, MouseButtons.Left, 1, 1, 1));
}

private async Task GetDirectories(DirectoryInfo[] subDirs,
private async Task PopulateDirectories(DirectoryInfo[] subDirs,
TreeNode nodeToAddTo)
{
List<TreeNode> info = new List<TreeNode>();
Expand Down Expand Up @@ -152,7 +152,7 @@ private async void TreeView1_NodeMouseClick(object sender, TreeNodeMouseClickEve

newSelected.Nodes.Clear();

await GetDirectories(dirs, newSelected).ConfigureAwait(true);
await PopulateDirectories(dirs, newSelected).ConfigureAwait(true);

foreach (DirectoryInfo dir in dirs)
{
Expand Down Expand Up @@ -217,25 +217,44 @@ public override void Delete()

public async Task<DirectoryInfo[]> GetDirectories()
{
// rerequest every time
await Task.Run(() =>
try
{
lock (_mavftp)
// rerequest every time
await Task.Run(() =>
{
cache = _mavftp.kCmdListDirectory(FullPath, new CancellationTokenSource());
}
}).ConfigureAwait(true);
return cache.Where(a => a.isDirectory && a.Name != "." && a.Name != "..")
.Select(a => new DirectoryInfo(a.FullName, _mavftp)).ToArray();
lock (_mavftp)
{
cache = _mavftp.kCmdListDirectory(FullPath, new CancellationTokenSource());
}
}).ConfigureAwait(true);
return cache.Where(a => a.isDirectory && a.Name != "." && a.Name != "..")
.Select(a => new DirectoryInfo(a.FullName, _mavftp)).ToArray();

}
catch (Exception e)
{
log.Error(e);
}

return new DirectoryInfo[] { };
}

public async Task<IEnumerable<MAVFtp.FtpFileInfo>> GetFiles()
{
if (cache == null)
await GetDirectories().ConfigureAwait(true);
try
{
if (cache == null)
await GetDirectories().ConfigureAwait(true);

// rerequest every time
return cache.Where(a => !a.isDirectory);
}
catch (Exception e)
{
log.Error(e);
}

// rerequest every time
return cache.Where(a => !a.isDirectory);
return new List<MAVFtp.FtpFileInfo>();
}
}

Expand All @@ -245,7 +264,15 @@ private async void ListView1_DragDrop(object sender, DragEventArgs e)

foreach (var file in files)
{
await UploadFile(file).ConfigureAwait(true);
try
{
await UploadFile(file).ConfigureAwait(true);
}
catch (Exception exception)
{
log.Error(exception);
CustomMessageBox.Show(exception.Message);
}
}

TreeView1_NodeMouseClick(null,
Expand Down Expand Up @@ -315,15 +342,6 @@ private async void DownloadToolStripMenuItem_Click(object sender, EventArgs e)
}

File.WriteAllBytes(sfd.FileName, ms.ToArray());

prd.UpdateProgressAndStatus(-1, "Calc CRC");
uint crc = 0;
_mavftp.kCmdCalcFileCRC32(path, ref crc, cancel);
var crc32a = MAVFtp.crc_crc32(0, File.ReadAllBytes(sfd.FileName));
if (crc32a != crc)
{
throw new BadCrcException();
}
};
prd.RunBackgroundOperationAsync();
_mavftp.Progress -= progress;
Expand All @@ -346,7 +364,15 @@ private async void UploadToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (var ofdFileName in ofd.FileNames)
{
await UploadFile(ofdFileName).ConfigureAwait(true);
try
{
await UploadFile(ofdFileName).ConfigureAwait(true);
}
catch (Exception exception)
{
log.Error(exception);
CustomMessageBox.Show(exception.Message);
}
}
}

Expand Down Expand Up @@ -403,10 +429,24 @@ private void DeleteToolStripMenuItem_Click(object sender, EventArgs e)
foreach (ListViewItem listView1SelectedItem in listView1.SelectedItems)
{
toolStripStatusLabel1.Text = "Delete " + listView1SelectedItem.Text;
var success = _mavftp.kCmdRemoveFile(((DirectoryInfo)listView1SelectedItem.Tag).FullName + "/" +
listView1SelectedItem.Text, new CancellationTokenSource());
if (!success)
CustomMessageBox.Show("Failed to delete file", listView1SelectedItem.Text);
ProgressReporterDialogue prd = new ProgressReporterDialogue();
CancellationTokenSource cancel = new CancellationTokenSource();
prd.doWorkArgs.CancelRequestChanged += (o, args) =>
{
prd.doWorkArgs.ErrorMessage = "User Cancel";
cancel.Cancel();
_mavftp.kCmdResetSessions();
};
prd.doWorkArgs.ForceExit = false;
prd.DoWork += (iprd) =>
{
var success = _mavftp.kCmdRemoveFile(((DirectoryInfo) listView1SelectedItem.Tag).FullName + "/" +
listView1SelectedItem.Text, cancel);
if (!success)
CustomMessageBox.Show("Failed to delete file", listView1SelectedItem.Text);
};

prd.RunBackgroundOperationAsync();
}

TreeView1_NodeMouseClick(null,
Expand All @@ -423,10 +463,24 @@ private void ListView1_AfterLabelEdit(object sender, LabelEditEventArgs e)
{
if (e.Label == null)
return;
ProgressReporterDialogue prd = new ProgressReporterDialogue();
CancellationTokenSource cancel = new CancellationTokenSource();
prd.doWorkArgs.CancelRequestChanged += (o, args) =>
{
prd.doWorkArgs.ErrorMessage = "User Cancel";
cancel.Cancel();
_mavftp.kCmdResetSessions();
};
prd.doWorkArgs.ForceExit = false;
var selectedNodeFullPath = treeView1.SelectedNode.FullPath;
var text = listView1.SelectedItems[0].Text;
prd.DoWork += (iprd) =>
{
_mavftp.kCmdRename(selectedNodeFullPath + "/" + text,
selectedNodeFullPath + "/" + e.Label, cancel);
};

_mavftp.kCmdRename(treeView1.SelectedNode.FullPath + "/" + listView1.SelectedItems[0].Text,
treeView1.SelectedNode.FullPath + "/" + e.Label, new CancellationTokenSource());

prd.RunBackgroundOperationAsync();
TreeView1_NodeMouseClick(null,
new TreeNodeMouseClickEventArgs(treeView1.SelectedNode, MouseButtons.Left, 1, 1, 1));
toolStripStatusLabel1.Text = "Ready";
Expand All @@ -437,11 +491,27 @@ private void NewFolderToolStripMenuItem_Click(object sender, EventArgs e)
string folder = "";
var dr = InputBox.Show("Folder Name", "Enter folder name", ref folder);
if (dr == DialogResult.OK)
if (!_mavftp.kCmdCreateDirectory(treeView1.SelectedNode.FullPath + "/" + folder,
new CancellationTokenSource()))
{
ProgressReporterDialogue prd = new ProgressReporterDialogue();
CancellationTokenSource cancel = new CancellationTokenSource();
prd.doWorkArgs.CancelRequestChanged += (o, args) =>
{
CustomMessageBox.Show("Failed to create directory", Strings.ERROR);
}
prd.doWorkArgs.ErrorMessage = "User Cancel";
cancel.Cancel();
_mavftp.kCmdResetSessions();
};
prd.doWorkArgs.ForceExit = false;
prd.DoWork += (iprd) =>
{
if (!_mavftp.kCmdCreateDirectory(treeView1.SelectedNode.FullPath + "/" + folder,
cancel))
{
CustomMessageBox.Show("Failed to create directory", Strings.ERROR);
}
};

prd.RunBackgroundOperationAsync();
}

TreeView1_NodeMouseClick(null,
new TreeNodeMouseClickEventArgs(treeView1.SelectedNode, MouseButtons.Left, 1, 1, 1));
Expand Down Expand Up @@ -544,15 +614,6 @@ private void DownloadBurstToolStripMenuItem_Click(object sender, EventArgs e)
}

File.WriteAllBytes(sfd.FileName, ms.ToArray());

prd.UpdateProgressAndStatus(-1, "Calc CRC");
uint crc = 0;
_mavftp.kCmdCalcFileCRC32(path, ref crc, cancel);
var crc32a = MAVFtp.crc_crc32(0, File.ReadAllBytes(sfd.FileName));
if (crc32a != crc)
{
throw new BadCrcException();
}
};
prd.RunBackgroundOperationAsync();
_mavftp.Progress -= progress;
Expand Down
7 changes: 5 additions & 2 deletions Controls/SerialOutputCoT.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading