diff --git a/EDSEditorGUI/Form1.cs b/EDSEditorGUI/Form1.cs index 1e9d0ca..0c1b10c 100644 --- a/EDSEditorGUI/Form1.cs +++ b/EDSEditorGUI/Form1.cs @@ -27,6 +27,7 @@ You should have received a copy of the GNU General Public License using System.IO; using libEDSsharp; using static System.Windows.Forms.VisualStyles.VisualStyleElement; +using System.Diagnostics; namespace ODEditor { @@ -1038,7 +1039,14 @@ private void documentationToolStripMenuItem_Click(object sender, EventArgs e) docgenMarkup.genmddoc(temp2, dv.eds); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo("cmd", $"/c start {temp2}")); + // By using "cmd /c start" you avoid the child process to be attached to the current + // process so the report viewer does not close when leaving the EDS editor. + // {temp2} is quoted too, so spaces in the path do not cause problems. + Process.Start(new ProcessStartInfo { + FileName = "cmd", + Arguments = $"/c start \"\" \"{temp2}\"", + WindowStyle= ProcessWindowStyle.Hidden + }); } if (IsRunningOnMono()) { diff --git a/EDSEditorGUI/style.css b/EDSEditorGUI/style.css index 934abd0..73c6e99 100644 --- a/EDSEditorGUI/style.css +++ b/EDSEditorGUI/style.css @@ -111,4 +111,9 @@ table tr:hover td { .receivers { width: 90%; -} \ No newline at end of file +} + +.error +{ + color: red; +} diff --git a/libEDSsharp/NetworkPDOreport.cs b/libEDSsharp/NetworkPDOreport.cs index d610834..998d1c8 100644 --- a/libEDSsharp/NetworkPDOreport.cs +++ b/libEDSsharp/NetworkPDOreport.cs @@ -179,7 +179,15 @@ public void gennetpdodoc(string filepath, List network) } else { - name = eds.ods[index].Getsubobject(subindex).parameter_name; + ODentry current_sdo = eds.ods[index].Getsubobject(subindex); + if (current_sdo != null) + { + name = current_sdo.parameter_name; + } + else + { + name = string.Format("

Error: subindex is missing in SDO!

"); + } }