diff --git a/EDSEditorGUI/Form1.cs b/EDSEditorGUI/Form1.cs
index 3a5f3278..63c45481 100644
--- a/EDSEditorGUI/Form1.cs
+++ b/EDSEditorGUI/Form1.cs
@@ -621,7 +621,7 @@ void dosave(DeviceView dv, string FileName, bool xddfileVersion_1_1, bool stripp
break;
case ".md":
- DocumentationGen docgen = new DocumentationGen();
+ DocumentationGenMarkup docgen = new DocumentationGenMarkup();
docgen.genmddoc(FileName, dv.eds, this.gitVersion);
dv.eds.mdfilename = FileName;
break;
@@ -1028,9 +1028,10 @@ private void documentationToolStripMenuItem_Click(object sender, EventArgs e)
this.UseWaitCursor = true;
- DocumentationGen docgen = new DocumentationGen();
- docgen.genhtmldoc(temp, dv.eds);
- docgen.genmddoc(temp2, dv.eds, this.gitVersion);
+ DocumentationGenHtml docgenHtml = new DocumentationGenHtml();
+ docgenHtml.genhtmldoc(temp, dv.eds);
+ DocumentationGenMarkup docgenMarkup = new DocumentationGenMarkup();
+ docgenMarkup.genmddoc(temp2, dv.eds, this.gitVersion);
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo("cmd", $"/c start {temp2}"));
@@ -1092,7 +1093,7 @@ private void saveExportAllToolStripMenuItem_Click(object sender, EventArgs e)
if (dv.eds.mdfilename != null && dv.eds.mdfilename != "")
{
- DocumentationGen docgen = new DocumentationGen();
+ DocumentationGenMarkup docgen = new DocumentationGenMarkup();
docgen.genmddoc(dv.eds.mdfilename, dv.eds, this.gitVersion);
cnt++;
}
diff --git a/libEDSsharp/DocumentationGenHtml.cs b/libEDSsharp/DocumentationGenHtml.cs
new file mode 100644
index 00000000..a2717025
--- /dev/null
+++ b/libEDSsharp/DocumentationGenHtml.cs
@@ -0,0 +1,193 @@
+/*
+ This file is part of libEDSsharp.
+
+ libEDSsharp is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ libEDSsharp is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with libEDSsharp. If not, see .
+
+ Copyright(c) 2016 - 2019 Robin Cornelius
+ Copyright(c) 2020 Janez Paternoster
+*/
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+
+namespace libEDSsharp
+{
+ ///
+ /// Documentation generator
+ ///
+ public class DocumentationGenHtml
+ {
+ StreamWriter file = null;
+
+ ///
+ /// Generate html documentation
+ ///
+ /// where the documentation should be saved
+ /// data to generate the documentation from
+ public void genhtmldoc(string filepath, EDSsharp eds)
+ {
+
+ file = new StreamWriter(filepath, false);
+ file.NewLine = "\n";
+
+ file.Write("");
+
+ file.Write(string.Format("
", description));
+
+ foreach (KeyValuePair sub in od.subobjects)
+ {
+ ODentry subod = sub.Value;
+ writeODentryhtml(subod);
+ }
+
+ }
+ ///
+ /// Write a html table row with 2 elements to file
+ ///
+ /// element a
+ /// element b
+ void write2linetablerow(string a,object b)
+ {
+ if (b == null)
+ b = "";
+ file.Write("
{0}
{1}
", a, b.ToString());
+ }
+ ///
+ /// Write a html table header with 2 elements to file
+ ///
+ ///
+ ///
+ void write2linetableheader(string a, object b)
+ {
+ file.Write("
{0}
{1}
",a,b.ToString());
+ }
+ ///
+ /// Returns the datatype of a object dictionary
+ ///
+ /// the object dictionary entry
+ /// datatype of the OD entry
+ string PrintDataType(ODentry od)
+ {
+ string dt = od.datatype.ToString();
+ if ((od.datatype == DataType.VISIBLE_STRING || od.datatype == DataType.UNICODE_STRING)
+ && od.prop.CO_stringLengthMin > od.defaultvalue.Length)
+ {
+ dt += $" (len={od.prop.CO_stringLengthMin})";
+ }
+
+ return dt;
+ }
+ }
+}
diff --git a/libEDSsharp/DocumentationGen.cs b/libEDSsharp/DocumentationGenMarkup.cs
similarity index 71%
rename from libEDSsharp/DocumentationGen.cs
rename to libEDSsharp/DocumentationGenMarkup.cs
index b5aef6a1..798dbf39 100644
--- a/libEDSsharp/DocumentationGen.cs
+++ b/libEDSsharp/DocumentationGenMarkup.cs
@@ -27,152 +27,10 @@ namespace libEDSsharp
///
/// Documentation generator
///
- public class DocumentationGen
+ public class DocumentationGenMarkup
{
StreamWriter file = null;
- ///
- /// Generate html documentation
- ///
- /// where the documentation should be saved
- /// data to generate the documentation from
- public void genhtmldoc(string filepath, EDSsharp eds)
- {
-
- file = new StreamWriter(filepath, false);
- file.NewLine = "\n";
-
- file.Write("");
-
- file.Write(string.Format("
", description));
-
- foreach (KeyValuePair sub in od.subobjects)
- {
- ODentry subod = sub.Value;
- writeODentryhtml(subod);
- }
-
- }
- ///
- /// Write a html table row with 2 elements to file
- ///
- /// element a
- /// element b
- void write2linetablerow(string a,object b)
- {
- if (b == null)
- b = "";
- file.Write("
{0}
{1}
", a, b.ToString());
- }
- ///
- /// Write a html table header with 2 elements to file
- ///
- ///
- ///
- void write2linetableheader(string a, object b)
- {
- file.Write("