├── EDSEditorGUI ├── .gitignore ├── Index_8287_16x.ico ├── Microsoft.mshtml.dll ├── Resources │ ├── Save.png │ ├── Close_6519.png │ ├── Compile_191.png │ ├── GenerateAll.png │ ├── ListBox_686.png │ ├── Open_6529.png │ ├── Print_11009.png │ ├── Save_6530.png │ ├── move_to_top.png │ ├── EventLog_5735.png │ ├── NewFile_6276.png │ ├── Remove_16xLG.png │ ├── Index_8287_16x.png │ ├── PrintSetup_11011.png │ ├── action_add_16xLG.png │ ├── move_to_bottom.png │ ├── notebook_16xLG.png │ ├── 305_Close_16x16_72.png │ ├── DriverTemplate_32x.png │ ├── InsertColumn_5626.png │ ├── ExporttoScript_9881.png │ ├── GenericVSEditor_9905.png │ └── PrintPreviewControl_698.png ├── packages.config ├── EDSEditorGUI.csproj.user ├── Properties │ ├── Settings.settings │ ├── AssemblyInfo.cs │ └── Settings.Designer.cs ├── Warnings.cs ├── TableLayoutDB.cs ├── App.config ├── Program.cs ├── ReportView.cs ├── NewItem.cs ├── MyTabUserControl.cs ├── Preferences.cs ├── style.css ├── DeviceView.cs ├── app.manifest ├── NewItem.Designer.cs ├── NewIndex.cs ├── ModuleInfo.cs ├── Warnings.Designer.cs ├── NewItem.resx ├── DeviceInfoView.resx ├── ModuleInfo.resx ├── Preferences.resx ├── MyTabUserControl.resx ├── ReportView.resx ├── DevicePDOView2.resx ├── DeviceODView.resx ├── InsertObjects.Designer.cs ├── DeviceInfoView.cs ├── ReportView.Designer.cs ├── Preferences.Designer.cs ├── InsertObjects.cs └── NewIndex.Designer.cs ├── pic1.jpg ├── pic2.jpg ├── pic3.jpg ├── pic4.jpg ├── Images ├── ODList.png ├── newod.png ├── ODDetails.png └── ODDetailsEdit.png ├── Index_8287_16x.ico ├── EDSSharp ├── App.config ├── EDSSharp.csproj.user ├── Properties │ └── AssemblyInfo.cs ├── EDSSharp.csproj └── Program.cs ├── Makefile ├── libEDSsharp ├── IExporter.cs ├── extensions.cs ├── ExporterFactory.cs ├── Warnings.cs ├── Properties │ └── AssemblyInfo.cs ├── StringUnescape.cs └── libEDSsharp.csproj ├── .gitignore ├── Tests ├── packages.config ├── Properties │ └── AssemblyInfo.cs ├── PDOHelperTests.cs ├── ImportExportTest.cs ├── XDDImportExportTest.cs ├── Tests.csproj └── ExporterTests.cs ├── .travis.yml ├── EDSEditor.sln ├── setup.nsi └── README.md /EDSEditorGUI/.gitignore: -------------------------------------------------------------------------------- 1 | version.txt -------------------------------------------------------------------------------- /pic1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/pic1.jpg -------------------------------------------------------------------------------- /pic2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/pic2.jpg -------------------------------------------------------------------------------- /pic3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/pic3.jpg -------------------------------------------------------------------------------- /pic4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/pic4.jpg -------------------------------------------------------------------------------- /Images/ODList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/Images/ODList.png -------------------------------------------------------------------------------- /Images/newod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/Images/newod.png -------------------------------------------------------------------------------- /Index_8287_16x.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/Index_8287_16x.ico -------------------------------------------------------------------------------- /Images/ODDetails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/Images/ODDetails.png -------------------------------------------------------------------------------- /Images/ODDetailsEdit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/Images/ODDetailsEdit.png -------------------------------------------------------------------------------- /EDSEditorGUI/Index_8287_16x.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Index_8287_16x.ico -------------------------------------------------------------------------------- /EDSEditorGUI/Microsoft.mshtml.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Microsoft.mshtml.dll -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/Save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/Save.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/Close_6519.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/Close_6519.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/Compile_191.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/Compile_191.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/GenerateAll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/GenerateAll.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/ListBox_686.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/ListBox_686.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/Open_6529.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/Open_6529.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/Print_11009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/Print_11009.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/Save_6530.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/Save_6530.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/move_to_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/move_to_top.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/EventLog_5735.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/EventLog_5735.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/NewFile_6276.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/NewFile_6276.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/Remove_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/Remove_16xLG.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/Index_8287_16x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/Index_8287_16x.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/PrintSetup_11011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/PrintSetup_11011.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/action_add_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/action_add_16xLG.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/move_to_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/move_to_bottom.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/notebook_16xLG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/notebook_16xLG.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/305_Close_16x16_72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/305_Close_16x16_72.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/DriverTemplate_32x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/DriverTemplate_32x.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/InsertColumn_5626.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/InsertColumn_5626.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/ExporttoScript_9881.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/ExporttoScript_9881.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/GenericVSEditor_9905.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/GenericVSEditor_9905.png -------------------------------------------------------------------------------- /EDSEditorGUI/Resources/PrintPreviewControl_698.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robincornelius/libedssharp/HEAD/EDSEditorGUI/Resources/PrintPreviewControl_698.png -------------------------------------------------------------------------------- /EDSEditorGUI/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /EDSSharp/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Requires mono-devel and msbuild: 2 | # https://www.mono-project.com/download/stable/ 3 | 4 | APP := EDSEditorGUI 5 | 6 | all: 7 | msbuild $(APP) 8 | 9 | clean: 10 | $(RM) -r $(APP)/bin 11 | 12 | install: 13 | cp -Tr $(APP)/bin/Debug /opt/EDSEditor 14 | -------------------------------------------------------------------------------- /EDSSharp/EDSSharp.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /libEDSsharp/IExporter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace libEDSsharp 8 | { 9 | public interface IExporter 10 | { 11 | void export(string folderpath, string filename, string gitVersion, EDSsharp eds , string odname="OD"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /libEDSsharp/obj 2 | /libEDSsharp/bin 3 | /EDSEditorGUI/obj 4 | /EDSEditorGUI/bin 5 | /Cia306Tester/obj 6 | /libEDSsharp/bin 7 | /*.suo 8 | /libEDSsharp/obj 9 | /EDSEditorGUI/obj/Release 10 | /EDSEditorGUI/bin/Release 11 | /.vs/EDSEditorGUI/v14/*.suo 12 | /.vs/EDSEditor/v14/*.suo 13 | edseditor-Setup.exe 14 | /Tests/bin 15 | /Tests/obj 16 | *.exe 17 | /.vs 18 | *.suo 19 | /EDSSharp/bin/Debug 20 | /EDSSharp/obj 21 | /EDSSharp/bin/Release 22 | /EDSEditorGUI/bin/*.zip 23 | /Backup 24 | /SourceGrid_4.21 25 | /packages/ 26 | -------------------------------------------------------------------------------- /EDSEditorGUI/EDSEditorGUI.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | publish\ 5 | 6 | 7 | 8 | 9 | 10 | en-US 11 | false 12 | 13 | -------------------------------------------------------------------------------- /EDSEditorGUI/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 0 7 | 8 | 9 | 65535 10 | 11 | 12 | -------------------------------------------------------------------------------- /libEDSsharp/extensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace libEDSsharp 8 | { 9 | public static class extensions 10 | { 11 | public static string ToHexString(this byte val) 12 | { 13 | return String.Format("0x{0:x}", val); 14 | } 15 | 16 | public static string ToHexString(this UInt16 val) 17 | { 18 | return String.Format("0x{0:x}",val); 19 | } 20 | 21 | public static string ToHexString(this UInt32 val) 22 | { 23 | return String.Format("0x{0:x}", val); 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /EDSEditorGUI/Warnings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using libEDSsharp; 11 | 12 | namespace ODEditor 13 | { 14 | public partial class WarningsFrm : Form 15 | { 16 | public WarningsFrm() 17 | { 18 | InitializeComponent(); 19 | 20 | foreach(string s in Warnings.warning_list) 21 | { 22 | textBox1.AppendText(s+"\r\n"); 23 | } 24 | } 25 | 26 | private void button_close_Click(object sender, EventArgs e) 27 | { 28 | this.Close(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Tests/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /libEDSsharp/ExporterFactory.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace libEDSsharp 3 | { 4 | public static class ExporterFactory 5 | { 6 | public enum Exporter 7 | { 8 | CANOPENNODE_V4 = 0, 9 | CANOPENNODE_LEGACY = 1 10 | } 11 | 12 | public static IExporter getExporter(Exporter ex = Exporter.CANOPENNODE_LEGACY) 13 | { 14 | IExporter exporter; 15 | 16 | switch (ex) 17 | { 18 | default: 19 | case Exporter.CANOPENNODE_V4: 20 | exporter = new CanOpenNodeExporter_V4(); 21 | break; 22 | 23 | case Exporter.CANOPENNODE_LEGACY: 24 | exporter = new CanOpenNodeExporter(); 25 | break; 26 | } 27 | 28 | 29 | return exporter; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /EDSEditorGUI/TableLayoutDB.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows.Forms; 3 | 4 | namespace ODEditor 5 | { 6 | /// 7 | /// Double Buffered layout panel - removes flicker during resize operations. 8 | /// 9 | public partial class DBLayoutPanel : TableLayoutPanel 10 | { 11 | public DBLayoutPanel() 12 | { 13 | //InitializeComponent(); 14 | SetStyle(ControlStyles.AllPaintingInWmPaint | 15 | ControlStyles.OptimizedDoubleBuffer | 16 | ControlStyles.UserPaint, true); 17 | } 18 | 19 | public DBLayoutPanel(IContainer container) 20 | { 21 | container.Add(this); 22 | //InitializeComponent(); 23 | SetStyle(ControlStyles.AllPaintingInWmPaint | 24 | ControlStyles.OptimizedDoubleBuffer | 25 | ControlStyles.UserPaint, true); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /libEDSsharp/Warnings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace libEDSsharp 8 | { 9 | public static class Warnings 10 | { 11 | public enum warning_class 12 | { 13 | WARNING_GENERIC = 0x01, 14 | WARNING_RENAME = 0x02, 15 | WARNING_BUILD = 0x04, 16 | WARNING_STRING = 0x08, 17 | WARNING_STRUCT = 0x10, 18 | } 19 | 20 | public static List warning_list = new List(); 21 | 22 | public static UInt32 warning_mask = 0xffff; 23 | 24 | public static void AddWarning(string warning,warning_class c = warning_class.WARNING_GENERIC) 25 | { 26 | if (((UInt32)c & warning_mask) != 0) 27 | { 28 | warning_list.Add(warning); 29 | } 30 | } 31 | } 32 | 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /EDSEditorGUI/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 0 15 | 16 | 17 | 65535 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: csharp 2 | solution: EDSEditor.sln 3 | mono: 4 | - 6.10.0 5 | 6 | notifications: 7 | slack: 8 | rooms: 9 | - secure: "FId7MhkC2Fq8T9ETn5XrWw1STQusuhR7MbOz/YaCPLAvxvo4pPMyGKVu+1urrbvS9eW+o15xqL0dZow2/JG+6vxPgQIyHBcJT0LYfLROrHC22DhR2oydPO0Y4wejxWwcj4LzAXrI/09zynbX6tWphMM0MVbLRKL+WpJRVhAsCHB2FXHZxF2uT6774J+7dEpY2gtW676ShO4gU7DmD/bEOgasyvDqtpGtM4bxEQJubJr4iaUlxvGlQ8CJyBXfBxcviL5ufMjJxGmuDYHzKu2pxN1v6adfRA53CrgSlb2JIx+ubNx/xGJQN+XeGrnA6aRU15CE/6iC8qZ6CW5FBfcCESp6/JPpVeom3WHbYoXZBQbAOXDuLg+zHxF5N4kwSuZLapOcfIm7wppVlrSbY6cUZ5cNUnbVCfml+1BGC6R1++80wOaBG6g/IkHsbo3ZMtqibutg2BDEYoJeFq0GORySYPp5MTt2+iuKngLjtY4z9q2RWF+0e9/5rcYkUysUT7M0pP9SmKnI3Xvyxl853KY4xH7IiN+hZ4qoAGw4yQKJggPtUka9zihCxnxDyDOKnf6XVcZrPFucW2k2qwwZI9BMX5thNi2sB/3pAcA0kRC7yOGwLWLY21sTObB5QpDKJKeDYK1n9iss+xyIV2OoD7vwTw+sIeFFTTxyWA50AIdtmYU=" 10 | 11 | before_deploy: 12 | - cp $TRAVIS_BUILD_DIR/EDSSharp/bin/Release/EDSSharp.* $TRAVIS_BUILD_DIR/EDSEditorGUI/bin/Release/ 13 | - cd $TRAVIS_BUILD_DIR/EDSEditorGUI/bin/Release/ 14 | - zip -r $TRAVIS_BUILD_DIR/build/OpenEDSEditor-latest.zip * 15 | - cd $TRAVIS_BUILD_DIR 16 | 17 | deploy: 18 | provider: pages 19 | skip_cleanup: true 20 | github_token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable 21 | keep_history: false 22 | target_branch: gh-pages 23 | directory: $TRAVIS_BUILD_DIR/build/ 24 | 25 | on: 26 | branch: xdd 27 | 28 | 29 | -------------------------------------------------------------------------------- /EDSEditorGUI/Program.cs: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of libEDSsharp. 3 | 4 | libEDSsharp is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | libEDSsharp is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with libEDSsharp. If not, see . 16 | 17 | Copyright(c) 2016 - 2019 Robin Cornelius 18 | */ 19 | 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Threading.Tasks; 24 | using System.Windows.Forms; 25 | 26 | namespace ODEditor 27 | { 28 | static class Program 29 | { 30 | /// 31 | /// The main entry point for the application. 32 | /// 33 | [STAThread] 34 | static void Main() 35 | { 36 | Application.EnableVisualStyles(); 37 | Application.SetCompatibleTextRenderingDefault(false); 38 | Application.Run(new ODEditor_MainForm()); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Tests")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2a479bf3-7628-409b-8a29-9314c308445e")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /EDSSharp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("EDSSharp")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("EDSSharp")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("8b7a7545-6257-44bf-8868-f429e1b72c77")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /libEDSsharp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("libEDSsharp")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("libEDSsharp")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("01bcd5d8-58a1-419d-8fd4-5f0bfbac9105")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /EDSEditorGUI/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("EDSEditorGUI")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("EDSEditorGUI")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7fc05717-0248-41a8-9cb8-34f6fc499471")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /EDSEditorGUI/ReportView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using System.IO; 4 | using mshtml; 5 | 6 | namespace ODEditor 7 | { 8 | public partial class ReportView : Form 9 | { 10 | public ReportView(string pathtohtml) 11 | { 12 | InitializeComponent(); 13 | 14 | 15 | 16 | webBrowser1.Url = new Uri(pathtohtml); 17 | 18 | webBrowser1.Navigated += WebBrowser1_Navigated; 19 | 20 | 21 | } 22 | 23 | private void WebBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e) 24 | { 25 | 26 | //Try to load a css override from ~/.edseditor/style.css first then fallback to installed default 27 | 28 | string csspath = Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.Personal), ".edseditor"); 29 | csspath = Path.Combine(csspath, "style.css"); 30 | 31 | if(!File.Exists(csspath)) 32 | { 33 | csspath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "style.css"); 34 | } 35 | 36 | if (!File.Exists(csspath)) 37 | return; 38 | 39 | string text = System.IO.File.ReadAllText(csspath); 40 | 41 | mshtml.HTMLDocument CurrentDocument = (HTMLDocument)webBrowser1.Document.DomDocument; 42 | mshtml.IHTMLStyleSheet styleSheet = CurrentDocument.createStyleSheet("", 0); 43 | styleSheet.cssText = text; 44 | } 45 | 46 | private void toolStripButton_print_Click(object sender, EventArgs e) 47 | { 48 | webBrowser1.ShowPrintDialog(); 49 | } 50 | 51 | private void toolStripButton_preview_Click(object sender, EventArgs e) 52 | { 53 | webBrowser1.ShowPrintPreviewDialog(); 54 | } 55 | 56 | private void toolStripButton_save_Click(object sender, EventArgs e) 57 | { 58 | webBrowser1.ShowSaveAsDialog(); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /EDSEditorGUI/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ODEditor.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("0")] 29 | public int ExporterType { 30 | get { 31 | return ((int)(this["ExporterType"])); 32 | } 33 | set { 34 | this["ExporterType"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("65535")] 41 | public uint WarningMask { 42 | get { 43 | return ((uint)(this["WarningMask"])); 44 | } 45 | set { 46 | this["WarningMask"] = value; 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /EDSEditorGUI/NewItem.cs: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of libEDSsharp. 3 | 4 | libEDSsharp is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | libEDSsharp is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with libEDSsharp. If not, see . 16 | 17 | Copyright(c) 2016 - 2019 Robin Cornelius 18 | Copyright(c) 2017 Neuberger Gebäudeautomation martin.wagner@neuberger.net> 19 | */ 20 | 21 | using System; 22 | using System.Windows.Forms; 23 | 24 | namespace ODEditor 25 | { 26 | public partial class NewItem : Form 27 | { 28 | public string name; 29 | 30 | public NewItem(string title) 31 | { 32 | InitializeComponent(); 33 | Text = title; 34 | 35 | DialogResult = DialogResult.Cancel; 36 | } 37 | 38 | private void Create() 39 | { 40 | name = textBox_name.Text; 41 | 42 | if (name == "") 43 | { 44 | MessageBox.Show("Please specify a name"); 45 | } 46 | else 47 | { 48 | DialogResult = DialogResult.OK; 49 | Close(); 50 | } 51 | } 52 | 53 | private void button_cancel_Click(object sender, EventArgs e) 54 | { 55 | Close(); 56 | } 57 | 58 | private void button_create_Click(object sender, EventArgs e) 59 | { 60 | Create(); 61 | } 62 | 63 | private void textBox_name_KeyPress(object sender, KeyPressEventArgs e) 64 | { 65 | if (e.KeyChar == 0x1B) 66 | { 67 | Close(); 68 | } 69 | else if (e.KeyChar == '\r') 70 | { 71 | Create(); 72 | } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /EDSEditorGUI/MyTabUserControl.cs: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of libEDSsharp. 3 | 4 | libEDSsharp is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | libEDSsharp is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with libEDSsharp. If not, see . 16 | 17 | Copyright(c) 2016 - 2019 Robin Cornelius 18 | */ 19 | 20 | using System; 21 | using System.Collections.Generic; 22 | using System.ComponentModel; 23 | using System.Drawing; 24 | using System.Data; 25 | using System.Linq; 26 | using System.Text; 27 | using System.Threading.Tasks; 28 | using System.Windows.Forms; 29 | using System.Globalization; 30 | 31 | 32 | namespace ODEditor 33 | { 34 | public class MyTabUserControl : UserControl 35 | { 36 | #region events 37 | 38 | public delegate void UpdatePDOs_Handler(); 39 | public event UpdatePDOs_Handler UpdatePDOs; 40 | 41 | public void doUpdatePDOs() 42 | { 43 | if (UpdatePDOs != null) 44 | UpdatePDOs(); 45 | } 46 | 47 | public delegate void UpdateDeviceInfo_Handler(); 48 | public event UpdateDeviceInfo_Handler UpdateDeviceInfo; 49 | 50 | public void doUpdateDeviceInfo() 51 | { 52 | if (UpdateDeviceInfo != null) 53 | UpdateDeviceInfo(); 54 | } 55 | 56 | public delegate void UpdateOD_Handler(); 57 | public event UpdateOD_Handler UpdateOD; 58 | 59 | public void doUpdateOD() 60 | { 61 | if (UpdateOD != null) 62 | UpdateOD(); 63 | } 64 | 65 | #endregion 66 | 67 | private void InitializeComponent() 68 | { 69 | 70 | 71 | this.SuspendLayout(); 72 | // 73 | // MyTabUserControl 74 | // 75 | this.Name = "MyTabUserControl"; 76 | this.Size = new System.Drawing.Size(357, 262); 77 | this.ResumeLayout(false); 78 | 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /libEDSsharp/StringUnescape.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace libEDSsharp 8 | { 9 | public static class StringUnescape 10 | { 11 | public static string Escape(char c) 12 | { 13 | switch (c) 14 | { 15 | case '\0': 16 | return @"\0"; 17 | case '\n': 18 | return @"\n"; 19 | case '\r': 20 | return @"\r"; 21 | case '\t': 22 | return @"\t"; 23 | case '\a': 24 | return @"\a"; 25 | case '\b': 26 | return @"\b"; 27 | case '\f': 28 | return @"\f"; 29 | case '\v': 30 | return @"\v"; 31 | 32 | default: 33 | return c.ToString(); 34 | } 35 | } 36 | 37 | public static string Unescape(this string txt) 38 | { 39 | if (string.IsNullOrEmpty(txt)) { return txt; } 40 | StringBuilder retval = new StringBuilder(txt.Length); 41 | for (int ix = 0; ix < txt.Length;) 42 | { 43 | int jx = txt.IndexOf('\\', ix); 44 | if (jx < 0 || jx == txt.Length - 1) jx = txt.Length; 45 | retval.Append(txt, ix, jx - ix); 46 | if (jx >= txt.Length) break; 47 | switch (txt[jx + 1]) 48 | { 49 | case 'n': retval.Append('\n'); break; // Line feed 50 | case 'r': retval.Append('\r'); break; // Carriage return 51 | case 't': retval.Append('\t'); break; // Tab 52 | case '0': retval.Append('\0'); break; // Null 53 | case 'a': retval.Append('\a'); break; // Bell 54 | case 'b': retval.Append('\b'); break; // Backspace 55 | case 'f': retval.Append('\f'); break; // Form feed 56 | case 'v': retval.Append('\v'); break; // Vertical tab 57 | case '\\': retval.Append('\\'); break; // Don't escape 58 | default: // Unrecognized, copy as-is 59 | retval.Append('\\').Append(txt[jx + 1]); break; 60 | } 61 | ix = jx + 2; 62 | } 63 | return retval.ToString(); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /EDSEditorGUI/Preferences.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using libEDSsharp; 11 | 12 | namespace ODEditor 13 | { 14 | public partial class Preferences : Form 15 | { 16 | public Preferences() 17 | { 18 | InitializeComponent(); 19 | 20 | comboBox_exporter.DataSource = Enum.GetValues(typeof(ExporterFactory.Exporter)); 21 | 22 | comboBox_exporter.SelectedItem = (ExporterFactory.Exporter)Properties.Settings.Default.ExporterType; 23 | 24 | UInt32 mask = Properties.Settings.Default.WarningMask; 25 | 26 | if ((mask & 0x01) == 0x01) 27 | checkBox_genericwarning.Checked = true; 28 | if ((mask & 0x02) == 0x02) 29 | checkBox_renamewarning.Checked = true; 30 | if ((mask & 0x04) == 0x04) 31 | checkBox_buildwarning.Checked = true; 32 | if ((mask & 0x08) == 0x08) 33 | checkBox_stringwarning.Checked = true; 34 | if ((mask & 0x10) == 0x10) 35 | checkBox_structwarning.Checked = true; 36 | 37 | 38 | } 39 | 40 | private void button_close_Click(object sender, EventArgs e) 41 | { 42 | this.Close(); 43 | } 44 | 45 | private void button_save_Click(object sender, EventArgs e) 46 | { 47 | 48 | ExporterFactory.Exporter exporter; 49 | Enum.TryParse(comboBox_exporter.SelectedValue.ToString(), out exporter); 50 | Properties.Settings.Default.ExporterType = (int)exporter; 51 | 52 | UInt32 mask = 0xFFE0; 53 | 54 | if (checkBox_genericwarning.Checked) 55 | mask |= 0x01; 56 | if (checkBox_renamewarning.Checked) 57 | mask |= 0x02; 58 | if (checkBox_buildwarning.Checked) 59 | mask |= 0x04; 60 | if (checkBox_stringwarning.Checked) 61 | mask |= 0x08; 62 | if (checkBox_structwarning.Checked) 63 | mask |= 0x10; 64 | 65 | Properties.Settings.Default.WarningMask = mask; 66 | 67 | Warnings.warning_mask = mask; 68 | 69 | 70 | Properties.Settings.Default.Save(); 71 | this.Close(); 72 | } 73 | 74 | private void checkBox1_CheckedChanged(object sender, EventArgs e) 75 | { 76 | 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /EDSEditor.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.329 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EDSEditorGUI", "EDSEditorGUI\EDSEditorGUI.csproj", "{13D2D8ED-242B-4283-BF14-AA79FE875F7C}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "libEDSsharp", "libEDSsharp\libEDSsharp.csproj", "{CC0FA4B1-2BFC-43B3-8C56-B428DF2D24E7}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{2A479BF3-7628-409B-8A29-9314C308445E}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EDSSharp", "EDSSharp\EDSSharp.csproj", "{8B7A7545-6257-44BF-8868-F429E1B72C77}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Release|Any CPU = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {13D2D8ED-242B-4283-BF14-AA79FE875F7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {13D2D8ED-242B-4283-BF14-AA79FE875F7C}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {13D2D8ED-242B-4283-BF14-AA79FE875F7C}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {13D2D8ED-242B-4283-BF14-AA79FE875F7C}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {CC0FA4B1-2BFC-43B3-8C56-B428DF2D24E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {CC0FA4B1-2BFC-43B3-8C56-B428DF2D24E7}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {CC0FA4B1-2BFC-43B3-8C56-B428DF2D24E7}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {CC0FA4B1-2BFC-43B3-8C56-B428DF2D24E7}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {2A479BF3-7628-409B-8A29-9314C308445E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {2A479BF3-7628-409B-8A29-9314C308445E}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {2A479BF3-7628-409B-8A29-9314C308445E}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {2A479BF3-7628-409B-8A29-9314C308445E}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {8B7A7545-6257-44BF-8868-F429E1B72C77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {8B7A7545-6257-44BF-8868-F429E1B72C77}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {8B7A7545-6257-44BF-8868-F429E1B72C77}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {8B7A7545-6257-44BF-8868-F429E1B72C77}.Release|Any CPU.Build.0 = Release|Any CPU 36 | EndGlobalSection 37 | GlobalSection(SolutionProperties) = preSolution 38 | HideSolutionNode = FALSE 39 | EndGlobalSection 40 | GlobalSection(ExtensibilityGlobals) = postSolution 41 | SolutionGuid = {E8D4F345-888A-449F-A933-E6B3B4743FE5} 42 | EndGlobalSection 43 | EndGlobal 44 | -------------------------------------------------------------------------------- /EDSSharp/EDSSharp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {8B7A7545-6257-44BF-8868-F429E1B72C77} 8 | Exe 9 | EDSSharp 10 | EDSSharp 11 | v4.6.1 12 | 512 13 | true 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | {cc0fa4b1-2bfc-43b3-8c56-b428df2d24e7} 54 | libEDSsharp 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /EDSEditorGUI/style.css: -------------------------------------------------------------------------------- 1 | body 2 | { 3 | width: 670px; 4 | } 5 | 6 | 7 | H1,H2,H3,p { 8 | color: #333333; 9 | font-family: Tahoma, Geneva, sans-serif; 10 | } 11 | 12 | 13 | table a:link { 14 | color: #666; 15 | font-weight: bold; 16 | text-decoration:none; 17 | } 18 | table a:visited { 19 | color: #999999; 20 | font-weight:bold; 21 | text-decoration:none; 22 | } 23 | table a:active, 24 | table a:hover { 25 | color: #bd5a35; 26 | text-decoration:underline; 27 | } 28 | table { 29 | font-family:Arial, Helvetica, sans-serif; 30 | color:#666; 31 | font-size:12px; 32 | text-shadow: 1px 1px 0px #fff; 33 | background:#eaebec; 34 | margin:20px; 35 | border:#ccc 1px solid; 36 | 37 | -moz-border-radius:3px; 38 | -webkit-border-radius:3px; 39 | border-radius:3px; 40 | 41 | -moz-box-shadow: 0 1px 2px #d1d1d1; 42 | -webkit-box-shadow: 0 1px 2px #d1d1d1; 43 | box-shadow: 0 1px 2px #d1d1d1; 44 | } 45 | table th { 46 | padding:5px 5px 5px 5px; 47 | border-top:1px solid #fafafa; 48 | border-bottom:1px solid #e0e0e0; 49 | 50 | background: #ededed; 51 | background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#ebebeb)); 52 | background: -moz-linear-gradient(top, #ededed, #ebebeb); 53 | } 54 | table th:first-child { 55 | text-align: left; 56 | padding-left:20px; 57 | } 58 | table tr:first-child th:first-child { 59 | -moz-border-radius-topleft:3px; 60 | -webkit-border-top-left-radius:3px; 61 | border-top-left-radius:3px; 62 | } 63 | table tr:first-child th:last-child { 64 | -moz-border-radius-topright:3px; 65 | -webkit-border-top-right-radius:3px; 66 | border-top-right-radius:3px; 67 | } 68 | table tr { 69 | text-align: center; 70 | padding-left:20px; 71 | } 72 | table td:first-child { 73 | text-align: left; 74 | padding-left:20px; 75 | border-left: 0; 76 | } 77 | table td { 78 | padding:5px; 79 | border-top: 1px solid #ffffff; 80 | border-bottom:1px solid #e0e0e0; 81 | border-left: 1px solid #e0e0e0; 82 | 83 | background: #fafafa; 84 | background: -webkit-gradient(linear, left top, left bottom, from(#fbfbfb), to(#fafafa)); 85 | background: -moz-linear-gradient(top, #fbfbfb, #fafafa); 86 | } 87 | table tr.even td { 88 | background: #f6f6f6; 89 | background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f6f6f6)); 90 | background: -moz-linear-gradient(top, #f8f8f8, #f6f6f6); 91 | } 92 | table tr:last-child td { 93 | border-bottom:0; 94 | } 95 | table tr:last-child td:first-child { 96 | -moz-border-radius-bottomleft:3px; 97 | -webkit-border-bottom-left-radius:3px; 98 | border-bottom-left-radius:3px; 99 | } 100 | table tr:last-child td:last-child { 101 | -moz-border-radius-bottomright:3px; 102 | -webkit-border-bottom-right-radius:3px; 103 | border-bottom-right-radius:3px; 104 | } 105 | table tr:hover td { 106 | background: #f2f2f2; 107 | background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#f0f0f0)); 108 | background: -moz-linear-gradient(top, #f2f2f2, #f0f0f0); 109 | } 110 | 111 | .receivers 112 | { 113 | width: 90%; 114 | } -------------------------------------------------------------------------------- /EDSEditorGUI/DeviceView.cs: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of libEDSsharp. 3 | 4 | libEDSsharp is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | libEDSsharp is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with libEDSsharp. If not, see . 16 | 17 | Copyright(c) 2016 - 2019 Robin Cornelius 18 | */ 19 | 20 | using System; 21 | using System.Windows.Forms; 22 | using libEDSsharp; 23 | 24 | namespace ODEditor 25 | { 26 | public partial class DeviceView : MyTabUserControl 27 | { 28 | 29 | readonly public EDSsharp eds; 30 | 31 | public DeviceView(EDSsharp eds_target) 32 | { 33 | eds = eds_target; 34 | 35 | InitializeComponent(); 36 | 37 | foreach (TabPage tp in tabControl1.TabPages) 38 | { 39 | foreach(Object o in tp.Controls) 40 | { 41 | if (o is MyTabUserControl) 42 | { 43 | MyTabUserControl t = (MyTabUserControl)o; 44 | 45 | t.UpdateDeviceInfo += dispatch_updatedevice; 46 | t.UpdateOD += dispatch_updateOD; 47 | t.UpdatePDOs += dispatch_updatePDOinfo; 48 | } 49 | } 50 | } 51 | 52 | devicePDOView1.Init(true); 53 | devicePDOView2.Init(false); 54 | 55 | } 56 | 57 | #region UpdateDispatchEvents 58 | 59 | // This region handles update requests that are dispatched to the various user controls on the tabs 60 | 61 | public void dispatch_updatedevice() 62 | { 63 | if (eds == null) 64 | return; 65 | 66 | deviceInfoView.eds = eds; 67 | deviceInfoView.populatedeviceinfo(); 68 | 69 | 70 | moduleInfo1.eds = eds; 71 | moduleInfo1.populatemoduleinfo(); 72 | } 73 | 74 | public void dispatch_updatePDOinfo() 75 | { 76 | if (eds == null) 77 | return; 78 | 79 | devicePDOView1.eds = eds; 80 | devicePDOView1.UpdatePDOinfo(); 81 | 82 | devicePDOView2.eds = eds; 83 | devicePDOView2.UpdatePDOinfo(); 84 | 85 | } 86 | 87 | public void dispatch_updateOD() 88 | { 89 | if (eds == null) 90 | return; 91 | 92 | deviceODView1.PopulateObjectLists(eds); 93 | deviceODView1.PopulateSubList(); 94 | deviceODView1.PopulateObject(); 95 | } 96 | 97 | #endregion 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /libEDSsharp/libEDSsharp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {CC0FA4B1-2BFC-43B3-8C56-B428DF2D24E7} 8 | Library 9 | Properties 10 | libEDSsharp 11 | libEDSsharp 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | docs\libEDSsharp.xml 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 69 | -------------------------------------------------------------------------------- /setup.nsi: -------------------------------------------------------------------------------- 1 | ; example1.nsi 2 | ; 3 | ; This script is perhaps one of the simplest NSIs you can make. All of the 4 | ; optional settings are left to their default settings. The installer simply 5 | ; prompts the user asking them where to install, and drops a copy of example1.nsi 6 | ; there. 7 | 8 | ;-------------------------------- 9 | 10 | 11 | !include "MUI2.nsh" 12 | !include "x64.nsh" ; Macros for x64 machines 13 | 14 | ; The name of the installer 15 | Name "OpenEdsEditor" 16 | 17 | ; The file to write 18 | OutFile "edseditor-Setup.exe" 19 | 20 | ; Show install details 21 | ShowInstDetails show 22 | 23 | ; The default installation directory 24 | InstallDir "$PROGRAMFILES\OpenEdsEditor\" 25 | 26 | ; Request application privileges for Windows Vista 27 | ;RequestExecutionLevel Admin 28 | 29 | SetOverwrite on 30 | 31 | 32 | !define MUI_HEADERIMAGE 33 | !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp" ; optional 34 | !define MUI_ABORTWARNING 35 | 36 | ;-------------------------------- 37 | 38 | ; Pages 39 | 40 | 41 | !insertmacro MUI_PAGE_LICENSE "License-GPLv3.txt" 42 | !insertmacro MUI_PAGE_COMPONENTS 43 | !insertmacro MUI_PAGE_DIRECTORY 44 | !insertmacro MUI_PAGE_INSTFILES 45 | 46 | !insertmacro MUI_UNPAGE_CONFIRM 47 | !insertmacro MUI_UNPAGE_INSTFILES 48 | 49 | 50 | 51 | ;Page instfiles 52 | 53 | ; The stuff to install 54 | Section "OpenEdsEditor" Secopeneds ;No components page, name is not important 55 | 56 | ; Set output path to the installation directory. 57 | SetOutPath $INSTDIR 58 | 59 | ; Put file there 60 | File EDSEditorGUI\bin\Release\EDSEditor.exe 61 | File EDSEditorGUI\bin\Release\EDSEditor.exe.config 62 | File EDSEditorGUI\bin\Release\libEDSsharp.dll 63 | File EDSEditorGUI\bin\Release\style.css 64 | File Index_8287_16x.ico 65 | File License-GPLv3.txt 66 | 67 | SetOutPath $INSTDIR\Profiles 68 | File EDSEditorGUI\Profiles\* 69 | 70 | SetShellVarContext all 71 | CreateDirectory "$SMPROGRAMS\OpenEDSEditor" 72 | CreateShortCut "$SMPROGRAMS\OpenEDSEditor\OpenEDSEditor.lnk" $INSTDIR\EDSEditor.exe "" $INSTDIR\Index_8287_16x.ico 0 73 | 74 | ;Create uninstaller 75 | WriteUninstaller "$INSTDIR\Uninstall.exe" 76 | 77 | CreateShortCut "$SMPROGRAMS\OpenEDSEditor\Uninstall.lnk" $INSTDIR\Uninstall.exe 78 | 79 | SectionEnd ; end the section 80 | 81 | ;Language strings 82 | LangString DESC_Secopeneds ${LANG_ENGLISH} "The Open EDS editor" 83 | 84 | 85 | !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN 86 | !insertmacro MUI_DESCRIPTION_TEXT ${Secopeneds} $(DESC_Secopeneds) 87 | !insertmacro MUI_FUNCTION_DESCRIPTION_END 88 | 89 | 90 | Function .onInit 91 | 92 | ;Extract InstallOptions files 93 | ;$PLUGINSDIR will automatically be removed when the installer closes 94 | 95 | InitPluginsDir 96 | 97 | Push $0 98 | Pop $0 99 | 100 | FunctionEnd 101 | 102 | 103 | Section "Uninstall" 104 | 105 | ;ADD YOUR OWN FILES HERE... 106 | 107 | Delete "$INSTDIR\*" 108 | Delete "$INSTDIR\Profiles\*" 109 | RMDir "$INSTDIR\Profiles" 110 | RMDir "$INSTDIR" 111 | 112 | SetShellVarContext all 113 | 114 | Delete "$SMPROGRAMS\OpenEDSEditor\OpenEDSEditor.lnk" 115 | RMDir "$SMPROGRAMS\OpenEDSEditor" 116 | 117 | SectionEnd 118 | 119 | 120 | -------------------------------------------------------------------------------- /EDSEditorGUI/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 52 | 53 | 54 | 55 | true 56 | 57 | 58 | 59 | 60 | 61 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /EDSEditorGUI/NewItem.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ODEditor 2 | { 3 | partial class NewItem 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.button_create = new System.Windows.Forms.Button(); 32 | this.button_cancel = new System.Windows.Forms.Button(); 33 | this.label2 = new System.Windows.Forms.Label(); 34 | this.textBox_name = new System.Windows.Forms.TextBox(); 35 | this.SuspendLayout(); 36 | // 37 | // button_create 38 | // 39 | this.button_create.Location = new System.Drawing.Point(15, 86); 40 | this.button_create.Name = "button_create"; 41 | this.button_create.Size = new System.Drawing.Size(108, 37); 42 | this.button_create.TabIndex = 2; 43 | this.button_create.Text = "Create"; 44 | this.button_create.UseVisualStyleBackColor = true; 45 | this.button_create.Click += new System.EventHandler(this.button_create_Click); 46 | // 47 | // button_cancel 48 | // 49 | this.button_cancel.Location = new System.Drawing.Point(153, 86); 50 | this.button_cancel.Name = "button_cancel"; 51 | this.button_cancel.Size = new System.Drawing.Size(108, 37); 52 | this.button_cancel.TabIndex = 3; 53 | this.button_cancel.Text = "Cancel"; 54 | this.button_cancel.UseVisualStyleBackColor = true; 55 | this.button_cancel.Click += new System.EventHandler(this.button_cancel_Click); 56 | // 57 | // label2 58 | // 59 | this.label2.AutoSize = true; 60 | this.label2.Location = new System.Drawing.Point(12, 38); 61 | this.label2.Name = "label2"; 62 | this.label2.Size = new System.Drawing.Size(35, 13); 63 | this.label2.TabIndex = 9; 64 | this.label2.Text = "Name"; 65 | // 66 | // textBox_name 67 | // 68 | this.textBox_name.Location = new System.Drawing.Point(53, 35); 69 | this.textBox_name.Name = "textBox_name"; 70 | this.textBox_name.Size = new System.Drawing.Size(208, 20); 71 | this.textBox_name.TabIndex = 1; 72 | this.textBox_name.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox_name_KeyPress); 73 | // 74 | // NewItem 75 | // 76 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 77 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 78 | this.ClientSize = new System.Drawing.Size(285, 139); 79 | this.Controls.Add(this.textBox_name); 80 | this.Controls.Add(this.label2); 81 | this.Controls.Add(this.button_cancel); 82 | this.Controls.Add(this.button_create); 83 | this.Name = "NewItem"; 84 | this.Text = "Add item"; 85 | this.ResumeLayout(false); 86 | this.PerformLayout(); 87 | 88 | } 89 | 90 | #endregion 91 | 92 | private System.Windows.Forms.Button button_create; 93 | private System.Windows.Forms.Button button_cancel; 94 | private System.Windows.Forms.Label label2; 95 | private System.Windows.Forms.TextBox textBox_name; 96 | } 97 | } -------------------------------------------------------------------------------- /EDSEditorGUI/NewIndex.cs: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of libEDSsharp. 3 | 4 | libEDSsharp is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | libEDSsharp is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with libEDSsharp. If not, see . 16 | 17 | Copyright(c) 2016 - 2019 Robin Cornelius 18 | */ 19 | 20 | using System; 21 | using System.Windows.Forms; 22 | using libEDSsharp; 23 | 24 | namespace ODEditor 25 | { 26 | public partial class NewIndex : Form 27 | { 28 | readonly EDSsharp eds; 29 | public ODentry od = null; 30 | 31 | public NewIndex(EDSsharp eds, UInt16 index) 32 | { 33 | this.eds = eds; 34 | 35 | InitializeComponent(); 36 | 37 | numericUpDown_index.Value = index; 38 | 39 | DialogResult = DialogResult.Cancel; 40 | } 41 | 42 | private void Button_cancel_Click(object sender, EventArgs e) 43 | { 44 | Close(); 45 | } 46 | 47 | private void Button_create_Click(object sender, EventArgs e) 48 | { 49 | UInt16 index = (UInt16) numericUpDown_index.Value; 50 | if (eds.ods.ContainsKey(index)) 51 | { 52 | MessageBox.Show(String.Format("Index 0x{0:X4} already exists in OD", index)); 53 | return; 54 | } 55 | 56 | string name = textBox_name.Text; 57 | if (name == "") 58 | { 59 | MessageBox.Show("Please specify a name"); 60 | return; 61 | } 62 | 63 | ObjectType objectType; 64 | if (radioButton_var.Checked) 65 | objectType = ObjectType.VAR; 66 | else if (radioButton_array.Checked) 67 | objectType = ObjectType.ARRAY; 68 | else if (radioButton_record.Checked) 69 | objectType = ObjectType.REC; 70 | else 71 | { 72 | MessageBox.Show("Please specify the Object Type"); 73 | return; 74 | } 75 | 76 | // create OD entry 77 | if (objectType == ObjectType.VAR) 78 | { 79 | od = new ODentry 80 | { 81 | parameter_name = name, 82 | Index = index, 83 | objecttype = objectType, 84 | datatype = DataType.UNSIGNED32, 85 | accesstype = EDSsharp.AccessType.rw, 86 | defaultvalue = "0" 87 | }; 88 | } 89 | else 90 | { 91 | od = new ODentry 92 | { 93 | parameter_name = name, 94 | Index = index, 95 | objecttype = objectType, 96 | }; 97 | 98 | od.subobjects.Add(0, new ODentry 99 | { 100 | parent = od, 101 | parameter_name = "Highest sub-index supported", 102 | objecttype = ObjectType.VAR, 103 | datatype = DataType.UNSIGNED8, 104 | accesstype = EDSsharp.AccessType.ro, 105 | defaultvalue = "0x01" 106 | }); 107 | 108 | od.subobjects.Add(1, new ODentry 109 | { 110 | parent = od, 111 | parameter_name = "Sub Object 1", 112 | objecttype = ObjectType.VAR, 113 | datatype = DataType.UNSIGNED32, 114 | accesstype = EDSsharp.AccessType.rw, 115 | defaultvalue = "0" 116 | }); 117 | } 118 | 119 | eds.ods.Add(od.Index, od); 120 | 121 | DialogResult = DialogResult.OK; 122 | Close(); 123 | } 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /EDSEditorGUI/ModuleInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using libEDSsharp; 11 | 12 | namespace ODEditor 13 | { 14 | public partial class ModuleInfo : MyTabUserControl 15 | { 16 | public EDSsharp eds = null; 17 | 18 | public ModuleInfo() 19 | { 20 | InitializeComponent(); 21 | 22 | if (System.ComponentModel.LicenseManager.UsageMode == System.ComponentModel.LicenseUsageMode.Designtime) 23 | { 24 | // Design time logic 25 | return; 26 | } 27 | 28 | Invalidated += ModuleInfo_Invalidated; 29 | 30 | } 31 | 32 | private void ModuleInfo_Invalidated(object sender, InvalidateEventArgs e) 33 | { 34 | 35 | 36 | 37 | } 38 | 39 | public void populatemoduleinfo() 40 | { 41 | if (eds == null) 42 | return; 43 | 44 | textBox_nrsupportedmodules.Text = eds.sm.NrOfEntries.ToString(); 45 | 46 | this.listView_modules.Items.Clear(); 47 | 48 | 49 | foreach(KeyValuePair kvp in eds.modules) 50 | { 51 | Module m = kvp.Value; 52 | UInt16 modindex = kvp.Key; 53 | 54 | libEDSsharp.ModuleInfo mi = m.mi; 55 | ListViewItem lvi2 = new ListViewItem(String.Format("{0}", kvp.Key)); 56 | lvi2.SubItems.Add(string.Format("{0}", mi.ProductName)); 57 | lvi2.SubItems.Add(string.Format("{0}", mi.ProductVersion)); 58 | lvi2.SubItems.Add(string.Format("{0}", mi.ProductRevision)); 59 | lvi2.SubItems.Add(string.Format("{0}", mi.OrderCode)); 60 | 61 | 62 | if (eds.cm.connectedmodulelist.Count > 0) 63 | { 64 | if (eds.cm.connectedmodulelist.ContainsKey(kvp.Key)) 65 | { 66 | lvi2.BackColor = Color.Green; 67 | } 68 | else 69 | { 70 | lvi2.BackColor = Color.Red; 71 | } 72 | } 73 | 74 | 75 | listView_modules.Items.Add(lvi2); 76 | 77 | } 78 | 79 | } 80 | 81 | private void listView_modules_MouseClick(object sender, MouseEventArgs e) 82 | { 83 | if (listView_modules.SelectedItems.Count != 1) 84 | return; 85 | 86 | listView_extends.Items.Clear(); 87 | 88 | UInt16 index = Convert.ToUInt16(listView_modules.SelectedItems[0].Text, 10); 89 | 90 | ModuleSubExtends mse = eds.modules[index].mse; 91 | 92 | foreach (UInt16 sindex in mse.objectlist.Values) 93 | { 94 | ListViewItem lvi = null; 95 | 96 | if (eds.ods.ContainsKey(sindex)) 97 | { 98 | lvi = new ListViewItem(string.Format("0x{0:x4}",sindex)); 99 | lvi.SubItems.Add(eds.ods[sindex].parameter_name); 100 | } 101 | else 102 | { 103 | if (eds.modules[index].modulesubext.ContainsKey(sindex)) 104 | { 105 | lvi = new ListViewItem(string.Format("0x{0:x4}", sindex)); 106 | lvi.SubItems.Add(eds.modules[index].modulesubext[sindex].parameter_name); 107 | 108 | } 109 | else 110 | { 111 | lvi = new ListViewItem(string.Format("0x{0:x4}", sindex)); 112 | lvi.SubItems.Add("** FAULT OD NOT FOUND **"); 113 | } 114 | } 115 | 116 | listView_extends.Items.Add(lvi); 117 | 118 | 119 | } 120 | 121 | 122 | textBox_modulecomments.Clear(); 123 | 124 | if (eds.modules.ContainsKey(index)) 125 | { 126 | ModuleComments mc = eds.modules[index].mc; 127 | 128 | foreach (string s in mc.comments) 129 | { 130 | textBox_modulecomments.AppendText(s + "\r\n"); 131 | } 132 | } 133 | 134 | } 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /EDSEditorGUI/Warnings.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ODEditor 2 | { 3 | partial class WarningsFrm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WarningsFrm)); 32 | this.textBox1 = new System.Windows.Forms.TextBox(); 33 | this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 34 | this.button_close = new System.Windows.Forms.Button(); 35 | ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); 36 | this.splitContainer1.Panel1.SuspendLayout(); 37 | this.splitContainer1.Panel2.SuspendLayout(); 38 | this.splitContainer1.SuspendLayout(); 39 | this.SuspendLayout(); 40 | // 41 | // textBox1 42 | // 43 | this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill; 44 | this.textBox1.Location = new System.Drawing.Point(0, 0); 45 | this.textBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); 46 | this.textBox1.Multiline = true; 47 | this.textBox1.Name = "textBox1"; 48 | this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; 49 | this.textBox1.Size = new System.Drawing.Size(1580, 589); 50 | this.textBox1.TabIndex = 0; 51 | // 52 | // splitContainer1 53 | // 54 | this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; 55 | this.splitContainer1.Location = new System.Drawing.Point(0, 0); 56 | this.splitContainer1.Name = "splitContainer1"; 57 | this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; 58 | // 59 | // splitContainer1.Panel1 60 | // 61 | this.splitContainer1.Panel1.Controls.Add(this.textBox1); 62 | // 63 | // splitContainer1.Panel2 64 | // 65 | this.splitContainer1.Panel2.Controls.Add(this.button_close); 66 | this.splitContainer1.Size = new System.Drawing.Size(1580, 667); 67 | this.splitContainer1.SplitterDistance = 589; 68 | this.splitContainer1.TabIndex = 1; 69 | // 70 | // button_close 71 | // 72 | this.button_close.Location = new System.Drawing.Point(29, 21); 73 | this.button_close.Name = "button_close"; 74 | this.button_close.Size = new System.Drawing.Size(119, 41); 75 | this.button_close.TabIndex = 0; 76 | this.button_close.Text = "Close"; 77 | this.button_close.UseVisualStyleBackColor = true; 78 | this.button_close.Click += new System.EventHandler(this.button_close_Click); 79 | // 80 | // WarningsFrm 81 | // 82 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); 83 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 84 | this.ClientSize = new System.Drawing.Size(1580, 667); 85 | this.Controls.Add(this.splitContainer1); 86 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 87 | this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); 88 | this.Name = "WarningsFrm"; 89 | this.Text = "Warnings"; 90 | this.splitContainer1.Panel1.ResumeLayout(false); 91 | this.splitContainer1.Panel1.PerformLayout(); 92 | this.splitContainer1.Panel2.ResumeLayout(false); 93 | ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); 94 | this.splitContainer1.ResumeLayout(false); 95 | this.ResumeLayout(false); 96 | 97 | } 98 | 99 | #endregion 100 | 101 | private System.Windows.Forms.TextBox textBox1; 102 | private System.Windows.Forms.SplitContainer splitContainer1; 103 | private System.Windows.Forms.Button button_close; 104 | } 105 | } -------------------------------------------------------------------------------- /EDSSharp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using libEDSsharp; 8 | 9 | namespace EDSSharp 10 | { 11 | class Program 12 | { 13 | 14 | static libEDSsharp.EDSsharp eds = new EDSsharp(); 15 | static string gitversion = ""; 16 | 17 | static void Main(string[] args) 18 | { 19 | try 20 | { 21 | 22 | Dictionary argskvp = new Dictionary(); 23 | 24 | int argv = 0; 25 | 26 | for (argv = 0; argv < (args.Length - 1); argv++) 27 | { 28 | if (args[argv] == "--infile") 29 | { 30 | argskvp.Add("--infile", args[argv + 1]); 31 | } 32 | 33 | if (args[argv] == "--outfile") 34 | { 35 | argskvp.Add("--outfile", args[argv + 1]); 36 | } 37 | 38 | if (args[argv] == "--type") 39 | { 40 | argskvp.Add("--type", args[argv + 1]); 41 | } 42 | 43 | argv++; 44 | } 45 | 46 | 47 | if (argskvp.ContainsKey("--type") && argskvp.ContainsKey("--infile") && argskvp.ContainsKey("--outfile")) 48 | { 49 | string infile = argskvp["--infile"]; 50 | string outfile = argskvp["--outfile"]; 51 | 52 | ExporterFactory.Exporter type = ExporterFactory.Exporter.CANOPENNODE_LEGACY; //sensible default 53 | 54 | if (argskvp["--type"].IndexOf("4") > 0) 55 | type = ExporterFactory.Exporter.CANOPENNODE_V4; 56 | 57 | switch (Path.GetExtension(infile).ToLower()) 58 | { 59 | case ".xdd": 60 | openXDDfile(infile, outfile,type); 61 | break; 62 | 63 | case ".xml": 64 | openXMLfile(infile,outfile,type); 65 | break; 66 | 67 | case ".eds": 68 | openEDSfile(infile, outfile,InfoSection.Filetype.File_EDS,type); 69 | break; 70 | 71 | 72 | default: 73 | return; 74 | 75 | } 76 | } 77 | else 78 | { 79 | Console.WriteLine("Usage EDSEditor --type [CanOpenNode|CanOpenNodeV4] --infile file.[xdd|eds|xml] --outfile [CO_OD.c|OD]"); 80 | } 81 | } 82 | catch(Exception e) 83 | { 84 | Console.WriteLine(e.ToString()); 85 | } 86 | } 87 | 88 | private static void openEDSfile(string infile, string outfile, InfoSection.Filetype ft, ExporterFactory.Exporter exporttype) 89 | { 90 | 91 | eds.Loadfile(infile); 92 | 93 | exportCOOD(outfile,exporttype); 94 | 95 | } 96 | 97 | private static void exportCOOD(string outpath,ExporterFactory.Exporter type) 98 | { 99 | string odname = outpath; 100 | 101 | outpath = Path.GetFullPath(outpath); 102 | 103 | string savePath = Path.GetDirectoryName(outpath); 104 | 105 | eds.fi.exportFolder = savePath; 106 | 107 | Warnings.warning_list.Clear(); 108 | 109 | IExporter exporter = ExporterFactory.getExporter(type); 110 | 111 | exporter.export(savePath, Path.GetFileNameWithoutExtension(outpath), gitversion, eds, odname); 112 | 113 | foreach(string warning in Warnings.warning_list) 114 | { 115 | Console.WriteLine("WARNING :" + warning); 116 | } 117 | 118 | } 119 | 120 | private static void openXMLfile(string path,string outpath,ExporterFactory.Exporter exportertype) 121 | { 122 | 123 | CanOpenXML coxml = new CanOpenXML(); 124 | coxml.readXML(path); 125 | 126 | Bridge b = new Bridge(); 127 | 128 | eds = b.convert(coxml.dev); 129 | 130 | eds.projectFilename = path; 131 | exportCOOD(outpath,exportertype); 132 | 133 | } 134 | 135 | private static void openXDDfile(string path, string outpath,ExporterFactory.Exporter exportertype) 136 | { 137 | CanOpenXDD_1_1 coxml_1_1 = new CanOpenXDD_1_1(); 138 | eds = coxml_1_1.ReadXML(path); 139 | 140 | if (eds == null) 141 | { 142 | CanOpenXDD coxml = new CanOpenXDD(); 143 | eds = coxml.readXML(path); 144 | 145 | if (eds == null) 146 | return; 147 | } 148 | 149 | eds.projectFilename = path; 150 | exportCOOD(outpath,exportertype); 151 | } 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | This project went upstream and became a part of CanOpenNode! 3 | 4 | please see https://github.com/CANopenNode/CANopenEditor for the latest version 5 | 6 | 7 | 8 | 9 | EDSSharp 10 | -------- 11 | 12 | A C# CanOpen EDS (Electronic Data Sheet) library and GUI editor 13 | 14 | This application is designed to load/save/edit and create EDS/DCF/XDC file for 15 | CanOpen and also to generate the object dictionary for CanOpenNode 16 | CO_OD.c and CO_OD.h) to aid development of CanOpenNode devices. 17 | 18 | EDS (Electronic Data Sheet) files are text files that define CanOpen Devices. 19 | DCF (Device Configuration File) files are text files that define configured 20 | CanOpenDevices XDD files are an XML version of EDS files 21 | 22 | EDS/DCF are fully defined in the DSP306 standard by the can open standards 23 | body CiA. 24 | 25 | The EDS editor on its own is useful without the CanOpenNode specific export and 26 | as of the 0.6-XDD-alpha version the editor can also load/save XDD files. 27 | The GUI also shows PDO mappings and can generate reports 28 | of multiple devices that are loaded into the software. 29 | 30 | The core library can be used without the GUI to implement eds/xdd loading/saving 31 | and parsing etc in other projects. 32 | 33 | Please consider this code experimental and beta quality. 34 | It is a work in progress and is rapidly changing. 35 | 36 | Every attempt has been made to comply with the revelant DSP306 and other 37 | standards and esd files from multile sources have been tested for loading and 38 | saving as been (at times) validated for errors using EDS conformance tools. 39 | 40 | With many thanks to the following contributors for spotting my mistakes and 41 | improving the code 42 | * s-fuchs 43 | * martinwag 44 | * trojanobelix 45 | * many others... 46 | 47 | Releases 48 | -------- 49 | 50 | If you would like to try a pre compiled version, then head over to the 51 | [releases page!](https://github.com/robincornelius/libedssharp/releases) 52 | 53 | If you want to try the latest and greatest version from the development tip then it can be found here 54 | [latest auto build!](https://github.com/robincornelius/libedssharp/raw/gh-pages/build/OpenEDSEditor-latest.zip) this version is auto built on travis-ci using mono 6.10.0 for the last build log please see [build log](https://travis-ci.org/github/robincornelius/libedssharp) 55 | 56 | Current Features 57 | 58 | Library 59 | ------- 60 | 61 | * Read EDS/DCF/XDC file and parse contents to approprate classes 62 | * Dump EDS/DCF classes via ToString() 63 | * Save EDS/DCF classes back to EDS file 64 | * Read CanOpenNode xml project file 65 | * Write CanOpenNode xmlproject file 66 | * Switch formats between EDS/DCF and CanOpenNode XML (note to EDS will result in 67 | data loss as the format supports less information). 68 | * Export C and H files in CanOpenNode format CO_OD.c and CO_OD.h 69 | * EDS/DCF supports modules 70 | * EDS/DCF supports compactPDO (read only) 1* 71 | * EDS/DCF supports implict PDO (read only) 1* 72 | * EDS/DCF supports CompactSubOb (read only) 1* 73 | * Supports loading/saving of all EDS/DCF module information 74 | 75 | 1* read only in this context means the EDS/DCF is fully expanded but the compact 76 | forms is not written back, only the expanded form will be saved. 77 | 78 | GUI 79 | --- 80 | * Open multiple devices 81 | * Open EDS/DCF/XDC files 82 | * Save EDS/DCF/XDC files 83 | * Open CanOpenNode XML Project file 84 | * Save CanOpenNode XML File 85 | * View OD Entries and explore the Object Dictionary 86 | * Add new OD entries 87 | * Delete exisiting OD entries 88 | * Create new Devices 89 | * Add default profiles 90 | * Create profiles that can be added to any project (just save the device xml file to the profiles/ 91 | directory, only include the minimum number of objects that you want to auto insert) This will auto add to insert menu 92 | * Edit Device and File Info sections 93 | * Set RX/TX PDO mappings easily from dropdown lists of avaiable objects 94 | * Add and remove new PDO entries (communication paramaters and mapping) in a single button push 95 | * Save groups of EDS/XML files as a network objects with abality to set concrete node IDs 96 | * View report of all configured PDO across the network 97 | * View modules and module details present within EDS files 98 | * View/edit actual object values for device configuring/DCF files 99 | * Support for loading XDD files (CanOpen offical XML) 100 | * Support for saving XDD files (CanOpen offical XML) 101 | * Some module info is displayed in GUI showing avaiable modules (eds) and 102 | configured modules (dcf) and what OD entries they reference. Full details such 103 | as subobj extension and fixed subobj are not currently displayed and unless 104 | there is demand probably will not ever be. 105 | 106 | TODO 107 | ---- 108 | 109 | * Ensure and validate all XDD is loading/save correctly (Looking good so far) 110 | * Add extra Gui fields for accessing extra XDD paramaters not in EDS 111 | (all common ones are done, a few special/edge cases remain) 112 | * Look at XDC files and see if we can save config changes and allow editing and 113 | network setup here in the app, partial support is implemented by supporting 114 | DCF files 115 | 116 | 117 | BUGS 118 | ---- 119 | 120 | If you find any, please open a bug report on github and attach any files you 121 | have created/opened etc. 122 | 123 | Pictures 124 | -------- 125 | 126 | ![alt tag](pic1.jpg) 127 | ![alt tag](pic2.jpg) 128 | ![alt tag](pic3.jpg) 129 | ![alt tag](pic4.jpg) -------------------------------------------------------------------------------- /Tests/PDOHelperTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Xunit; 3 | using libEDSsharp; 4 | 5 | namespace Tests 6 | { 7 | public class PDOHelperTests : libEDSsharp.EDSsharp 8 | { 9 | 10 | [Fact] 11 | public void Test_TPDO() 12 | { 13 | 14 | PDOHelper pdo = new PDOHelper(this); 15 | 16 | //configure a new slot 17 | PDOSlot slot = new PDOSlot(); 18 | pdo.pdoslots.Add(slot); 19 | 20 | slot.COB = 0x180; 21 | slot.ConfigurationIndex = 0x1800; 22 | slot.transmissiontype = 254; 23 | slot.inhibit = 10; 24 | slot.eventtimer = 20; 25 | slot.syncstart = 30; 26 | 27 | 28 | //fill it with some dummy entries 29 | ODentry od; 30 | tryGetODEntry(0x0002, out od); 31 | slot.Mapping.Add(od); 32 | 33 | tryGetODEntry(0x0003, out od); 34 | slot.Mapping.Add(od); 35 | 36 | tryGetODEntry(0x0004, out od); 37 | slot.Mapping.Add(od); 38 | 39 | pdo.buildmappingsfromlists(); 40 | 41 | //check configuration object exists 42 | ODentry comparamOD; 43 | 44 | if (!tryGetODEntry(0x1800, out comparamOD)) 45 | { 46 | throw new Exception("Communication paramaters not generated"); 47 | } 48 | 49 | ODentry mappingOD; 50 | 51 | if (!tryGetODEntry(0x1a00, out mappingOD)) 52 | { 53 | throw new Exception("Mapping paramaters not generated"); 54 | } 55 | 56 | if (comparamOD.subobjects.Count != 7) 57 | throw new Exception("Wrong number of sub objects generated"); 58 | 59 | if(comparamOD.Nosubindexes!=7) 60 | throw new Exception("Wrong number of sub objects generated"); 61 | 62 | if (comparamOD.subobjects[1].datatype != DataType.UNSIGNED32) 63 | throw new Exception("Wrong data type for COB"); 64 | if (comparamOD.subobjects[2].datatype != DataType.UNSIGNED8) 65 | throw new Exception("Wrong data type for Transmission type"); 66 | if (comparamOD.subobjects[3].datatype != DataType.UNSIGNED16) 67 | throw new Exception("Wrong data type for Inhibit time"); 68 | if (comparamOD.subobjects[4].datatype != DataType.UNSIGNED8) 69 | throw new Exception("Wrong data type for Compatibility Entry"); 70 | if (comparamOD.subobjects[5].datatype != DataType.UNSIGNED16) 71 | throw new Exception("Wrong data type for Event timer"); 72 | if (comparamOD.subobjects[6].datatype != DataType.UNSIGNED8) 73 | throw new Exception("Wrong data type for Sync Start"); 74 | 75 | if (comparamOD.subobjects[1].defaultvalue != "0x180") //180 hex 76 | throw new Exception("TPDO COB wrong"); 77 | if (comparamOD.subobjects[2].defaultvalue != "254") 78 | throw new Exception("TPDO transmission type wrong"); 79 | if (comparamOD.subobjects[3].defaultvalue != "10") 80 | throw new Exception("TPDO inhibit wrong"); 81 | if (comparamOD.subobjects[5].defaultvalue != "20") 82 | throw new Exception("TPDO event timer wrong"); 83 | if (comparamOD.subobjects[6].defaultvalue != "30") 84 | throw new Exception("TPDO sync start wrong"); 85 | 86 | } 87 | 88 | [Fact] 89 | public void Test_RPDO() 90 | { 91 | 92 | PDOHelper pdo = new PDOHelper(this); 93 | 94 | //configure a new slot 95 | PDOSlot slot = new PDOSlot(); 96 | pdo.pdoslots.Add(slot); 97 | 98 | slot.COB = 0x401; 99 | slot.ConfigurationIndex = 0x1400; 100 | 101 | slot.transmissiontype = 254; 102 | slot.inhibit = 10; 103 | slot.eventtimer = 20; 104 | slot.syncstart = 30; 105 | 106 | 107 | //fill it with some dummy entries 108 | ODentry od; 109 | tryGetODEntry(0x0002, out od); 110 | slot.Mapping.Add(od); 111 | 112 | tryGetODEntry(0x0003, out od); 113 | slot.Mapping.Add(od); 114 | 115 | tryGetODEntry(0x0004, out od); 116 | slot.Mapping.Add(od); 117 | 118 | pdo.buildmappingsfromlists(); 119 | 120 | //check configuration object exists 121 | ODentry comparamOD; 122 | 123 | if (!tryGetODEntry(0x1400, out comparamOD)) 124 | { 125 | throw new Exception("Communication paramaters not generated"); 126 | } 127 | 128 | ODentry mappingOD; 129 | 130 | if (!tryGetODEntry(0x1600, out mappingOD)) 131 | { 132 | throw new Exception("Mapping paramaters not generated"); 133 | } 134 | 135 | if (comparamOD.subobjects.Count != 3) 136 | throw new Exception("Wrong number of sub objects generated"); 137 | 138 | if (comparamOD.Nosubindexes != 3) 139 | throw new Exception("Wrong number of sub objects generated"); 140 | 141 | if (comparamOD.subobjects[1].datatype != DataType.UNSIGNED32) 142 | throw new Exception("Wrong data type for COB"); 143 | if (comparamOD.subobjects[2].datatype != DataType.UNSIGNED8) 144 | throw new Exception("Wrong data type for Transmission type"); 145 | 146 | if (comparamOD.subobjects[1].defaultvalue != "0x401") //481 hex 147 | throw new Exception("TPDO COB wrong"); 148 | if (comparamOD.subobjects[2].defaultvalue != "254") 149 | throw new Exception("TPDO transmission type wrong"); 150 | 151 | } 152 | 153 | 154 | 155 | 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /EDSEditorGUI/NewItem.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /EDSEditorGUI/DeviceInfoView.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /EDSEditorGUI/ModuleInfo.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /EDSEditorGUI/Preferences.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /EDSEditorGUI/MyTabUserControl.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /EDSEditorGUI/ReportView.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | -------------------------------------------------------------------------------- /EDSEditorGUI/DevicePDOView2.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | -------------------------------------------------------------------------------- /Tests/ImportExportTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | using libEDSsharp; 4 | 5 | namespace Tests 6 | { 7 | [TestClass] 8 | public class EdsImportExportTest : CanOpenNodeExporter 9 | { 10 | /// 11 | [TestMethod] 12 | public void TestImportExportVar() 13 | { 14 | 15 | eds = new EDSsharp 16 | { 17 | ods = new System.Collections.Generic.SortedDictionary() 18 | }; 19 | 20 | ODentry od = new ODentry 21 | { 22 | objecttype = ObjectType.VAR, 23 | datatype = DataType.UNSIGNED8, 24 | parameter_name = "Test VAR", 25 | accesstype = EDSsharp.AccessType.ro, 26 | TPDODetectCos = true, 27 | PDOtype = PDOMappingType.optional, 28 | Index = 0x2000 29 | }; 30 | 31 | eds.ods.Add(0x2000, od); 32 | 33 | string tempfile = System.IO.Path.GetTempFileName(); 34 | eds.Savefile(tempfile,InfoSection.Filetype.File_EDS); 35 | 36 | eds = new EDSsharp(); 37 | eds.Loadfile(tempfile); 38 | 39 | od = eds.ods[0x2000]; 40 | 41 | if (od.TPDODetectCos == false) 42 | throw new Exception("TPDODetect not set in EDS for VAR"); 43 | 44 | if (od.PDOtype != PDOMappingType.optional) 45 | throw new Exception("TPDOMappingType.optional not set in EDS for VAR"); 46 | 47 | } 48 | 49 | /// 50 | [TestMethod] 51 | public void TestImportExportRecord() 52 | { 53 | 54 | eds = new EDSsharp 55 | { 56 | ods = new System.Collections.Generic.SortedDictionary() 57 | }; 58 | 59 | ODentry od = new ODentry 60 | { 61 | objecttype = ObjectType.REC, 62 | parameter_name = "Test REC", 63 | Index = 0x2000 64 | }; 65 | 66 | ODentry sub = new ODentry(); 67 | sub.parameter_name = "max sub-index"; 68 | sub.datatype = DataType.UNSIGNED8; 69 | sub.parent = od; 70 | sub.accesstype = EDSsharp.AccessType.ro; 71 | sub.defaultvalue = "1"; 72 | sub.PDOtype = PDOMappingType.no; 73 | sub.objecttype = ObjectType.VAR; 74 | 75 | od.subobjects.Add(0x00, sub); 76 | 77 | sub = new ODentry(); 78 | sub.parameter_name = "entry 1"; 79 | sub.datatype = DataType.UNSIGNED8; 80 | sub.parent = od; 81 | sub.accesstype = EDSsharp.AccessType.rw; 82 | sub.defaultvalue = "0"; 83 | sub.PDOtype = PDOMappingType.optional; 84 | sub.objecttype = ObjectType.VAR; 85 | sub.TPDODetectCos = true; 86 | 87 | od.subobjects.Add(0x01, sub); 88 | 89 | eds.ods.Add(0x2000, od); 90 | 91 | string tempfile = System.IO.Path.GetTempFileName(); 92 | eds.Savefile(tempfile, InfoSection.Filetype.File_EDS); 93 | 94 | eds = new EDSsharp(); 95 | eds.Loadfile(tempfile); 96 | 97 | od = eds.ods[0x2000]; 98 | 99 | if (od.subobjects[1].TPDODetectCos == false) 100 | throw new Exception("TPDODetect not set in EDS for REC"); 101 | 102 | if (od.subobjects[1].PDOtype != PDOMappingType.optional) 103 | throw new Exception("TPDOMappingType.optional not set in EDS for REC"); 104 | 105 | } 106 | 107 | [TestMethod] 108 | public void TestImportExportArray() 109 | { 110 | 111 | // NOTE although can opennode does not support per array entry flags, they are supported in EDS 112 | // so the PDOtype and TPDODetectCos flags are set per array entry (every VAR sub object) but 113 | // they all must be the same 114 | // and they should not exist on the parent object. 115 | 116 | eds = new EDSsharp 117 | { 118 | ods = new System.Collections.Generic.SortedDictionary() 119 | }; 120 | 121 | ODentry od = new ODentry 122 | { 123 | objecttype = ObjectType.ARRAY, 124 | datatype = DataType.UNSIGNED32, 125 | parameter_name = "Test Array", 126 | accesstype = EDSsharp.AccessType.rw, 127 | Index = 0x2000 128 | }; 129 | 130 | ODentry sub = new ODentry(); 131 | sub.parameter_name = "max sub-index"; 132 | sub.datatype = DataType.UNSIGNED8; 133 | sub.parent = od; 134 | sub.accesstype = EDSsharp.AccessType.ro; 135 | sub.PDOtype = PDOMappingType.no; 136 | 137 | 138 | sub.defaultvalue = "2"; 139 | sub.objecttype = ObjectType.VAR; 140 | 141 | od.subobjects.Add(0x00, sub); 142 | 143 | sub = new ODentry(); 144 | sub.parameter_name = "entry 1"; 145 | sub.datatype = DataType.UNSIGNED32; 146 | sub.parent = od; 147 | sub.accesstype = EDSsharp.AccessType.rw; 148 | sub.defaultvalue = "0"; 149 | sub.objecttype = ObjectType.VAR; 150 | sub.PDOtype = PDOMappingType.optional; 151 | sub.TPDODetectCos = true; 152 | 153 | od.subobjects.Add(0x01, sub); 154 | 155 | sub = new ODentry(); 156 | sub.parameter_name = "entry 2"; 157 | sub.datatype = DataType.UNSIGNED32; 158 | sub.parent = od; 159 | sub.accesstype = EDSsharp.AccessType.rw; 160 | sub.defaultvalue = "0"; 161 | sub.objecttype = ObjectType.VAR; 162 | sub.PDOtype = PDOMappingType.optional; 163 | sub.TPDODetectCos = true; 164 | 165 | od.subobjects.Add(0x02, sub); 166 | 167 | eds.ods.Add(0x2000, od); 168 | 169 | string tempfile = System.IO.Path.GetTempFileName(); 170 | eds.Savefile(tempfile, InfoSection.Filetype.File_EDS); 171 | 172 | eds = new EDSsharp(); 173 | eds.Loadfile(tempfile); 174 | 175 | od = eds.ods[0x2000]; 176 | 177 | if (od.subobjects[1].TPDODetectCos == false) 178 | throw new Exception("TPDODetect not set in EDS for ARRAY"); 179 | 180 | if (od.subobjects[1].PDOtype != PDOMappingType.optional) 181 | throw new Exception("TPDOMappingType.optional not set in EDS for ARRAY"); 182 | 183 | 184 | 185 | } 186 | 187 | 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /Tests/XDDImportExportTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Xunit; 3 | using libEDSsharp; 4 | 5 | namespace Tests 6 | { 7 | public class XddImportExportTest : CanOpenNodeExporter 8 | { 9 | /// 10 | [Fact] 11 | public void TestImportExportVar() 12 | { 13 | 14 | eds = new EDSsharp 15 | { 16 | ods = new System.Collections.Generic.SortedDictionary() 17 | }; 18 | 19 | ODentry od = new ODentry 20 | { 21 | objecttype = ObjectType.VAR, 22 | datatype = DataType.UNSIGNED8, 23 | parameter_name = "Test VAR", 24 | accesstype = EDSsharp.AccessType.ro, 25 | PDOtype = PDOMappingType.optional, 26 | Index = 0x2000 27 | }; 28 | od.prop.CO_flagsPDO = true; 29 | 30 | eds.ods.Add(0x2000, od); 31 | 32 | string tempfile = System.IO.Path.GetTempFileName(); 33 | CanOpenXDD coxdd = new CanOpenXDD(); 34 | coxdd.writeXML(tempfile, eds); 35 | CanOpenXDD coxml = new CanOpenXDD(); 36 | eds = coxml.readXML(tempfile); 37 | 38 | od = eds.ods[0x2000]; 39 | 40 | if (od.prop.CO_flagsPDO == false) 41 | throw new Exception("TPDODetect not set in EDS for VAR"); 42 | 43 | if (od.PDOtype != PDOMappingType.optional) 44 | throw new Exception("TPDOMappingType.optional not set in EDS for VAR"); 45 | 46 | } 47 | 48 | /// 49 | [Fact] 50 | public void TestImportExportRecord() 51 | { 52 | 53 | eds = new EDSsharp 54 | { 55 | ods = new System.Collections.Generic.SortedDictionary() 56 | }; 57 | 58 | ODentry od = new ODentry 59 | { 60 | objecttype = ObjectType.REC, 61 | parameter_name = "Test REC", 62 | Index = 0x2000 63 | }; 64 | 65 | ODentry sub = new ODentry(); 66 | sub.parameter_name = "max sub-index"; 67 | sub.datatype = DataType.UNSIGNED8; 68 | sub.parent = od; 69 | sub.accesstype = EDSsharp.AccessType.ro; 70 | sub.defaultvalue = "1"; 71 | sub.PDOtype = PDOMappingType.no; 72 | sub.objecttype = ObjectType.VAR; 73 | 74 | od.subobjects.Add(0x00, sub); 75 | 76 | sub = new ODentry(); 77 | sub.parameter_name = "entry 1"; 78 | sub.datatype = DataType.UNSIGNED8; 79 | sub.parent = od; 80 | sub.accesstype = EDSsharp.AccessType.rw; 81 | sub.defaultvalue = "0"; 82 | sub.PDOtype = PDOMappingType.optional; 83 | sub.objecttype = ObjectType.VAR; 84 | sub.prop.CO_flagsPDO = true; 85 | 86 | od.subobjects.Add(0x01, sub); 87 | 88 | eds.ods.Add(0x2000, od); 89 | 90 | string tempfile = System.IO.Path.GetTempFileName(); 91 | CanOpenXDD coxdd = new CanOpenXDD(); 92 | coxdd.writeXML(tempfile, eds); 93 | CanOpenXDD coxml = new CanOpenXDD(); 94 | eds = coxml.readXML(tempfile); 95 | 96 | od = eds.ods[0x2000]; 97 | 98 | if (od.subobjects[1].prop.CO_flagsPDO == false) 99 | throw new Exception("TPDODetect not set in EDS for REC"); 100 | 101 | if (od.subobjects[1].PDOtype != PDOMappingType.optional) 102 | throw new Exception("TPDOMappingType.optional not set in EDS for REC"); 103 | 104 | } 105 | 106 | [Fact] 107 | public void TestImportExportArray() 108 | { 109 | 110 | // NOTE although can opennode does not support per array entry flags, they are supported in EDS 111 | // so the PDOtype and TPDODetectCos flags are set per array entry (every VAR sub object) but 112 | // they all must be the same 113 | // and they should not exist on the parent object. 114 | 115 | eds = new EDSsharp 116 | { 117 | ods = new System.Collections.Generic.SortedDictionary() 118 | }; 119 | 120 | ODentry od = new ODentry 121 | { 122 | objecttype = ObjectType.ARRAY, 123 | datatype = DataType.UNSIGNED32, 124 | parameter_name = "Test Array", 125 | accesstype = EDSsharp.AccessType.rw, 126 | Index = 0x2000 127 | }; 128 | 129 | ODentry sub = new ODentry(); 130 | sub.parameter_name = "max sub-index"; 131 | sub.datatype = DataType.UNSIGNED8; 132 | sub.parent = od; 133 | sub.accesstype = EDSsharp.AccessType.ro; 134 | sub.PDOtype = PDOMappingType.no; 135 | 136 | 137 | sub.defaultvalue = "2"; 138 | sub.objecttype = ObjectType.VAR; 139 | 140 | od.subobjects.Add(0x00, sub); 141 | 142 | sub = new ODentry(); 143 | sub.parameter_name = "entry 1"; 144 | sub.datatype = DataType.UNSIGNED32; 145 | sub.parent = od; 146 | sub.accesstype = EDSsharp.AccessType.rw; 147 | sub.defaultvalue = "0"; 148 | sub.objecttype = ObjectType.VAR; 149 | sub.PDOtype = PDOMappingType.optional; 150 | sub.prop.CO_flagsPDO = true; 151 | 152 | od.subobjects.Add(0x01, sub); 153 | 154 | sub = new ODentry(); 155 | sub.parameter_name = "entry 2"; 156 | sub.datatype = DataType.UNSIGNED32; 157 | sub.parent = od; 158 | sub.accesstype = EDSsharp.AccessType.rw; 159 | sub.defaultvalue = "0"; 160 | sub.objecttype = ObjectType.VAR; 161 | sub.PDOtype = PDOMappingType.optional; 162 | sub.prop.CO_flagsPDO = true; 163 | 164 | od.subobjects.Add(0x02, sub); 165 | 166 | eds.ods.Add(0x2000, od); 167 | 168 | string tempfile = System.IO.Path.GetTempFileName(); 169 | CanOpenXDD coxdd = new CanOpenXDD(); 170 | coxdd.writeXML(tempfile, eds); 171 | CanOpenXDD coxml = new CanOpenXDD(); 172 | eds = coxml.readXML(tempfile); 173 | 174 | od = eds.ods[0x2000]; 175 | 176 | if (od.subobjects[1].prop.CO_flagsPDO == false) 177 | throw new Exception("TPDODetect not set in EDS for ARRAY"); 178 | 179 | if (od.subobjects[1].PDOtype != PDOMappingType.optional) 180 | throw new Exception("TPDOMappingType.optional not set in EDS for ARRAY"); 181 | 182 | 183 | 184 | } 185 | 186 | 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /EDSEditorGUI/DeviceODView.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 268, 2 122 | 123 | 124 | 441, 2 125 | 126 | 127 | 25 128 | 129 | -------------------------------------------------------------------------------- /EDSEditorGUI/InsertObjects.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ODEditor 2 | { 3 | partial class InsertObjects 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InsertObjects)); 32 | this.label2 = new System.Windows.Forms.Label(); 33 | this.textBox_offsets = new System.Windows.Forms.TextBox(); 34 | this.button_insert = new System.Windows.Forms.Button(); 35 | this.button_cancel = new System.Windows.Forms.Button(); 36 | this.dataGridView = new System.Windows.Forms.DataGridView(); 37 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); 38 | this.SuspendLayout(); 39 | // 40 | // label2 41 | // 42 | this.label2.AutoSize = true; 43 | this.label2.Location = new System.Drawing.Point(12, 9); 44 | this.label2.Name = "label2"; 45 | this.label2.Size = new System.Drawing.Size(290, 13); 46 | this.label2.TabIndex = 4; 47 | this.label2.Text = "Index Offset (single or space separated list for multiple insert)"; 48 | // 49 | // textBox_offsets 50 | // 51 | this.textBox_offsets.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 52 | | System.Windows.Forms.AnchorStyles.Right))); 53 | this.textBox_offsets.Location = new System.Drawing.Point(12, 25); 54 | this.textBox_offsets.Name = "textBox_offsets"; 55 | this.textBox_offsets.Size = new System.Drawing.Size(432, 20); 56 | this.textBox_offsets.TabIndex = 2; 57 | this.textBox_offsets.Text = "1"; 58 | this.textBox_offsets.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBox_offsets_KeyPress); 59 | this.textBox_offsets.Leave += new System.EventHandler(this.TextBox_offsets_Leave); 60 | // 61 | // button_insert 62 | // 63 | this.button_insert.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 64 | this.button_insert.Location = new System.Drawing.Point(154, 345); 65 | this.button_insert.Name = "button_insert"; 66 | this.button_insert.Size = new System.Drawing.Size(130, 37); 67 | this.button_insert.TabIndex = 6; 68 | this.button_insert.Text = "Insert"; 69 | this.button_insert.UseVisualStyleBackColor = true; 70 | this.button_insert.Click += new System.EventHandler(this.Button_create_Click); 71 | // 72 | // button_cancel 73 | // 74 | this.button_cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 75 | this.button_cancel.Location = new System.Drawing.Point(314, 345); 76 | this.button_cancel.Name = "button_cancel"; 77 | this.button_cancel.Size = new System.Drawing.Size(130, 37); 78 | this.button_cancel.TabIndex = 7; 79 | this.button_cancel.Text = "Cancel"; 80 | this.button_cancel.UseVisualStyleBackColor = true; 81 | this.button_cancel.Click += new System.EventHandler(this.Button_cancel_Click); 82 | // 83 | // dataGridView 84 | // 85 | this.dataGridView.AllowUserToAddRows = false; 86 | this.dataGridView.AllowUserToDeleteRows = false; 87 | this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 88 | | System.Windows.Forms.AnchorStyles.Left) 89 | | System.Windows.Forms.AnchorStyles.Right))); 90 | this.dataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells; 91 | this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 92 | this.dataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnKeystroke; 93 | this.dataGridView.Location = new System.Drawing.Point(12, 51); 94 | this.dataGridView.Name = "dataGridView"; 95 | this.dataGridView.Size = new System.Drawing.Size(432, 283); 96 | this.dataGridView.TabIndex = 10; 97 | this.dataGridView.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.DataGridView_ColumnHeaderMouseClick); 98 | this.dataGridView.Leave += new System.EventHandler(this.DataGridView_Leave); 99 | // 100 | // InsertObjects 101 | // 102 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 103 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 104 | this.ClientSize = new System.Drawing.Size(456, 394); 105 | this.Controls.Add(this.dataGridView); 106 | this.Controls.Add(this.button_cancel); 107 | this.Controls.Add(this.button_insert); 108 | this.Controls.Add(this.textBox_offsets); 109 | this.Controls.Add(this.label2); 110 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 111 | this.Name = "InsertObjects"; 112 | this.Text = "Insert OD Objects"; 113 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); 114 | this.ResumeLayout(false); 115 | this.PerformLayout(); 116 | 117 | } 118 | 119 | #endregion 120 | private System.Windows.Forms.Label label2; 121 | private System.Windows.Forms.TextBox textBox_offsets; 122 | private System.Windows.Forms.Button button_insert; 123 | private System.Windows.Forms.Button button_cancel; 124 | private System.Windows.Forms.DataGridView dataGridView; 125 | } 126 | } -------------------------------------------------------------------------------- /EDSEditorGUI/DeviceInfoView.cs: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of libEDSsharp. 3 | 4 | libEDSsharp is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | libEDSsharp is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with libEDSsharp. If not, see . 16 | 17 | Copyright(c) 2016 - 2019 Robin Cornelius 18 | */ 19 | 20 | using System; 21 | using System.Windows.Forms; 22 | using libEDSsharp; 23 | using System.IO; 24 | 25 | namespace ODEditor 26 | { 27 | public partial class DeviceInfoView : MyTabUserControl 28 | { 29 | public EDSsharp eds = null; 30 | 31 | public DeviceInfoView() 32 | { 33 | InitializeComponent(); 34 | } 35 | 36 | public void populatedeviceinfo() 37 | { 38 | if (eds == null) 39 | return; 40 | 41 | textBox_productname.Text = eds.di.ProductName; 42 | textBox_productnumber.Text = eds.di.ProductNumber; 43 | textBox_vendorname.Text = eds.di.VendorName; 44 | textBox_vendornumber.Text = eds.di.VendorNumber; 45 | 46 | textBox_fileversion.Text = eds.fi.FileVersion; 47 | textBox_di_description.Text = eds.fi.Description; 48 | textBox_create_datetime.Text = eds.fi.CreationDateTime.ToString(); 49 | textBox_createdby.Text = eds.fi.CreatedBy; 50 | textBox_modified_datetime.Text = eds.fi.ModificationDateTime.ToString(); 51 | textBox_modifiedby.Text = eds.fi.ModifiedBy; 52 | 53 | checkBox_baud_10.Checked = eds.di.BaudRate_10; 54 | heckBox_baud_20.Checked = eds.di.BaudRate_20; 55 | heckBox_baud_50.Checked = eds.di.BaudRate_50; 56 | heckBox_baud_125.Checked = eds.di.BaudRate_125; 57 | heckBox_baud_250.Checked = eds.di.BaudRate_250; 58 | heckBox_baud_500.Checked = eds.di.BaudRate_500; 59 | heckBox_baud_800.Checked = eds.di.BaudRate_800; 60 | heckBox_baud_1000.Checked = eds.di.BaudRate_1000; 61 | checkBox_baud_auto.Checked = eds.di.BaudRate_auto; 62 | 63 | textBox_granularity.Text = eds.di.Granularity.ToString(); 64 | textBox_rxpdos.Text = eds.di.NrOfRXPDO.ToString(); 65 | textBox_txpdos.Text = eds.di.NrOfTXPDO.ToString(); 66 | checkBox_lss.Checked = eds.di.LSS_Supported; 67 | checkBox_lssMaster.Checked = eds.di.LSS_Master; 68 | 69 | textBox_projectFileName.Text = Path.GetFileName(eds.projectFilename); 70 | if (eds.xddfilename_1_1 != "") 71 | textBox_projectFileVersion.Text = "v1.1"; 72 | else if (eds.xddfilename_1_0 != "" && eds.xddfilename_1_0 == eds.projectFilename) 73 | textBox_projectFileVersion.Text = "v1.0"; 74 | else 75 | textBox_projectFileVersion.Text = ""; 76 | textBox_deviceedsname.Text = Path.GetFileName(eds.edsfilename); 77 | textBox_xddfilenameStripped.Text = Path.GetFileName(eds.xddfilenameStripped); 78 | textBox_devicedcfname.Text = Path.GetFileName(eds.dcffilename); 79 | textBox_canopennodeFileName.Text = Path.GetFileNameWithoutExtension(eds.ODfilename); 80 | textBox_canopennodeFileVersion.Text = eds.ODfileVersion; 81 | textBox_mdFileName.Text = Path.GetFileName(eds.mdfilename); 82 | 83 | //DCF support 84 | if (eds.dc!=null) 85 | { 86 | textBox_concretenodeid.Text = eds.dc.NodeId.ToString(); 87 | textBox_nodename.Text = eds.dc.NodeName; 88 | textBox_baudrate.Text = eds.dc.BaudRate.ToString(); 89 | textBox_netnum.Text = eds.dc.NetNumber.ToString(); 90 | checkBox_canopenmanager.Checked = eds.dc.CANopenManager; 91 | textBox_lssserial.Text = eds.dc.LSS_SerialNumber.ToString(); 92 | } 93 | } 94 | 95 | private void button_update_devfile_info_Click(object sender, EventArgs e) 96 | { 97 | if (eds == null) 98 | return; 99 | 100 | try 101 | { 102 | eds.di.ProductName = textBox_productname.Text; 103 | eds.di.ProductNumber = textBox_productnumber.Text; 104 | eds.di.VendorName = textBox_vendorname.Text; 105 | eds.di.VendorNumber = textBox_vendornumber.Text; 106 | 107 | eds.fi.FileVersion = textBox_fileversion.Text; 108 | eds.fi.Description = textBox_di_description.Text; 109 | eds.fi.CreationDateTime = DateTime.Parse(textBox_create_datetime.Text); 110 | eds.fi.CreatedBy = textBox_createdby.Text; 111 | eds.fi.ModifiedBy = textBox_modifiedby.Text; 112 | 113 | eds.di.BaudRate_10 = checkBox_baud_10.Checked; 114 | eds.di.BaudRate_20 = heckBox_baud_20.Checked; 115 | eds.di.BaudRate_50 = heckBox_baud_50.Checked; 116 | eds.di.BaudRate_125 = heckBox_baud_125.Checked; 117 | eds.di.BaudRate_250 = heckBox_baud_250.Checked; 118 | eds.di.BaudRate_500 = heckBox_baud_500.Checked; 119 | eds.di.BaudRate_800 = heckBox_baud_800.Checked; 120 | eds.di.BaudRate_1000 = heckBox_baud_1000.Checked; 121 | eds.di.BaudRate_auto = checkBox_baud_auto.Checked; 122 | 123 | eds.di.Granularity = Convert.ToByte(textBox_granularity.Text); 124 | eds.di.LSS_Supported = checkBox_lss.Checked; 125 | eds.di.LSS_Master = checkBox_lssMaster.Checked; 126 | 127 | doUpdatePDOs(); 128 | 129 | //These are read only and auto calculated 130 | //textBox_rxpdos.Text = eds.di.NrOfRXPDO.ToString(); 131 | //textBox_txpdos.Text = eds.di.NrOfTXPDO.ToString(); 132 | 133 | //DCF support 134 | eds.dc.NodeId = Convert.ToByte(textBox_concretenodeid.Text); 135 | eds.dc.NodeName = textBox_nodename.Text; 136 | eds.dc.BaudRate = Convert.ToUInt16(textBox_baudrate.Text); 137 | eds.dc.NetNumber = Convert.ToUInt32(textBox_netnum.Text); 138 | eds.dc.CANopenManager = checkBox_canopenmanager.Checked; 139 | eds.dc.LSS_SerialNumber = Convert.ToUInt32(textBox_lssserial.Text); 140 | 141 | eds.Dirty = true; 142 | } 143 | catch (Exception ex) 144 | { 145 | MessageBox.Show("Update failed, reason :-\n" + ex.ToString()); 146 | } 147 | } 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /EDSEditorGUI/ReportView.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ODEditor 2 | { 3 | partial class ReportView 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer(); 32 | this.toolStrip1 = new System.Windows.Forms.ToolStrip(); 33 | this.webBrowser1 = new System.Windows.Forms.WebBrowser(); 34 | this.toolStripButton_print = new System.Windows.Forms.ToolStripButton(); 35 | this.toolStripButton_preview = new System.Windows.Forms.ToolStripButton(); 36 | this.toolStripButton_save = new System.Windows.Forms.ToolStripButton(); 37 | this.toolStripContainer1.ContentPanel.SuspendLayout(); 38 | this.toolStripContainer1.TopToolStripPanel.SuspendLayout(); 39 | this.toolStripContainer1.SuspendLayout(); 40 | this.toolStrip1.SuspendLayout(); 41 | this.SuspendLayout(); 42 | // 43 | // toolStripContainer1 44 | // 45 | // 46 | // toolStripContainer1.ContentPanel 47 | // 48 | this.toolStripContainer1.ContentPanel.Controls.Add(this.webBrowser1); 49 | this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(952, 541); 50 | this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill; 51 | this.toolStripContainer1.Location = new System.Drawing.Point(0, 0); 52 | this.toolStripContainer1.Name = "toolStripContainer1"; 53 | this.toolStripContainer1.Size = new System.Drawing.Size(952, 566); 54 | this.toolStripContainer1.TabIndex = 0; 55 | this.toolStripContainer1.Text = "toolStripContainer1"; 56 | // 57 | // toolStripContainer1.TopToolStripPanel 58 | // 59 | this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip1); 60 | // 61 | // toolStrip1 62 | // 63 | this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None; 64 | this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 65 | this.toolStripButton_print, 66 | this.toolStripButton_preview, 67 | this.toolStripButton_save}); 68 | this.toolStrip1.Location = new System.Drawing.Point(3, 0); 69 | this.toolStrip1.Name = "toolStrip1"; 70 | this.toolStrip1.Size = new System.Drawing.Size(81, 25); 71 | this.toolStrip1.TabIndex = 0; 72 | this.toolStrip1.Text = "Print"; 73 | // 74 | // webBrowser1 75 | // 76 | this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill; 77 | this.webBrowser1.Location = new System.Drawing.Point(0, 0); 78 | this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); 79 | this.webBrowser1.Name = "webBrowser1"; 80 | this.webBrowser1.Size = new System.Drawing.Size(952, 541); 81 | this.webBrowser1.TabIndex = 0; 82 | // 83 | // toolStripButton_print 84 | // 85 | this.toolStripButton_print.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; 86 | this.toolStripButton_print.Image = global::ODEditor.Properties.Resources.Print_11009; 87 | this.toolStripButton_print.ImageTransparentColor = System.Drawing.Color.Magenta; 88 | this.toolStripButton_print.Name = "toolStripButton_print"; 89 | this.toolStripButton_print.Size = new System.Drawing.Size(23, 22); 90 | this.toolStripButton_print.Text = "Print"; 91 | this.toolStripButton_print.Click += new System.EventHandler(this.toolStripButton_print_Click); 92 | // 93 | // toolStripButton_preview 94 | // 95 | this.toolStripButton_preview.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; 96 | this.toolStripButton_preview.Image = global::ODEditor.Properties.Resources.PrintPreviewControl_698; 97 | this.toolStripButton_preview.ImageTransparentColor = System.Drawing.Color.Magenta; 98 | this.toolStripButton_preview.Name = "toolStripButton_preview"; 99 | this.toolStripButton_preview.Size = new System.Drawing.Size(23, 22); 100 | this.toolStripButton_preview.Text = "Print preview"; 101 | this.toolStripButton_preview.Click += new System.EventHandler(this.toolStripButton_preview_Click); 102 | // 103 | // toolStripButton_save 104 | // 105 | this.toolStripButton_save.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; 106 | this.toolStripButton_save.Image = global::ODEditor.Properties.Resources.Save_6530; 107 | this.toolStripButton_save.ImageTransparentColor = System.Drawing.Color.Magenta; 108 | this.toolStripButton_save.Name = "toolStripButton_save"; 109 | this.toolStripButton_save.Size = new System.Drawing.Size(23, 22); 110 | this.toolStripButton_save.Text = "Save"; 111 | this.toolStripButton_save.Click += new System.EventHandler(this.toolStripButton_save_Click); 112 | // 113 | // ReportView 114 | // 115 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 116 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 117 | this.ClientSize = new System.Drawing.Size(952, 566); 118 | this.Controls.Add(this.toolStripContainer1); 119 | this.Name = "ReportView"; 120 | this.Text = "ReportView"; 121 | this.toolStripContainer1.ContentPanel.ResumeLayout(false); 122 | this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false); 123 | this.toolStripContainer1.TopToolStripPanel.PerformLayout(); 124 | this.toolStripContainer1.ResumeLayout(false); 125 | this.toolStripContainer1.PerformLayout(); 126 | this.toolStrip1.ResumeLayout(false); 127 | this.toolStrip1.PerformLayout(); 128 | this.ResumeLayout(false); 129 | 130 | } 131 | 132 | #endregion 133 | 134 | private System.Windows.Forms.ToolStripContainer toolStripContainer1; 135 | private System.Windows.Forms.WebBrowser webBrowser1; 136 | private System.Windows.Forms.ToolStrip toolStrip1; 137 | private System.Windows.Forms.ToolStripButton toolStripButton_print; 138 | private System.Windows.Forms.ToolStripButton toolStripButton_preview; 139 | private System.Windows.Forms.ToolStripButton toolStripButton_save; 140 | } 141 | } -------------------------------------------------------------------------------- /Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Debug 8 | AnyCPU 9 | {2A479BF3-7628-409B-8A29-9314C308445E} 10 | Library 11 | Properties 12 | Tests 13 | Tests 14 | v4.5.2 15 | 512 16 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 17 | 10.0 18 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 19 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages 20 | False 21 | UnitTest 22 | 23 | 24 | 25 | 26 | true 27 | full 28 | false 29 | bin\Debug\ 30 | DEBUG;TRACE 31 | prompt 32 | 4 33 | 34 | 35 | pdbonly 36 | true 37 | bin\Release\ 38 | TRACE 39 | prompt 40 | 4 41 | 42 | 43 | 44 | 45 | ..\packages\xunit.abstractions.2.0.3\lib\net35\xunit.abstractions.dll 46 | 47 | 48 | ..\packages\xunit.assert.2.4.1\lib\netstandard1.1\xunit.assert.dll 49 | 50 | 51 | ..\packages\xunit.extensibility.core.2.4.1\lib\net452\xunit.core.dll 52 | 53 | 54 | ..\packages\xunit.extensibility.execution.2.4.1\lib\net452\xunit.execution.desktop.dll 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | {cc0fa4b1-2bfc-43b3-8c56-b428df2d24e7} 75 | libEDSsharp 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | False 89 | 90 | 91 | False 92 | 93 | 94 | False 95 | 96 | 97 | False 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 121 | -------------------------------------------------------------------------------- /EDSEditorGUI/Preferences.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ODEditor 2 | { 3 | partial class Preferences 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.label1 = new System.Windows.Forms.Label(); 32 | this.comboBox_exporter = new System.Windows.Forms.ComboBox(); 33 | this.button_save = new System.Windows.Forms.Button(); 34 | this.button_close = new System.Windows.Forms.Button(); 35 | this.checkBox_genericwarning = new System.Windows.Forms.CheckBox(); 36 | this.checkBox_renamewarning = new System.Windows.Forms.CheckBox(); 37 | this.checkBox_buildwarning = new System.Windows.Forms.CheckBox(); 38 | this.checkBox_stringwarning = new System.Windows.Forms.CheckBox(); 39 | this.checkBox_structwarning = new System.Windows.Forms.CheckBox(); 40 | this.SuspendLayout(); 41 | // 42 | // label1 43 | // 44 | this.label1.AutoSize = true; 45 | this.label1.Location = new System.Drawing.Point(32, 33); 46 | this.label1.Name = "label1"; 47 | this.label1.Size = new System.Drawing.Size(119, 17); 48 | this.label1.TabIndex = 0; 49 | this.label1.Text = "Selected exporter"; 50 | // 51 | // comboBox_exporter 52 | // 53 | this.comboBox_exporter.FormattingEnabled = true; 54 | this.comboBox_exporter.Location = new System.Drawing.Point(157, 26); 55 | this.comboBox_exporter.Name = "comboBox_exporter"; 56 | this.comboBox_exporter.Size = new System.Drawing.Size(228, 24); 57 | this.comboBox_exporter.TabIndex = 1; 58 | // 59 | // button_save 60 | // 61 | this.button_save.Location = new System.Drawing.Point(100, 358); 62 | this.button_save.Name = "button_save"; 63 | this.button_save.Size = new System.Drawing.Size(122, 44); 64 | this.button_save.TabIndex = 2; 65 | this.button_save.Text = "Save and close"; 66 | this.button_save.UseVisualStyleBackColor = true; 67 | this.button_save.Click += new System.EventHandler(this.button_save_Click); 68 | // 69 | // button_close 70 | // 71 | this.button_close.Location = new System.Drawing.Point(513, 358); 72 | this.button_close.Name = "button_close"; 73 | this.button_close.Size = new System.Drawing.Size(122, 44); 74 | this.button_close.TabIndex = 3; 75 | this.button_close.Text = "Close"; 76 | this.button_close.UseVisualStyleBackColor = true; 77 | this.button_close.Click += new System.EventHandler(this.button_close_Click); 78 | // 79 | // checkBox_genericwarning 80 | // 81 | this.checkBox_genericwarning.AutoSize = true; 82 | this.checkBox_genericwarning.Location = new System.Drawing.Point(98, 104); 83 | this.checkBox_genericwarning.Name = "checkBox_genericwarning"; 84 | this.checkBox_genericwarning.Size = new System.Drawing.Size(182, 21); 85 | this.checkBox_genericwarning.TabIndex = 4; 86 | this.checkBox_genericwarning.Text = "Show Generic Warnings"; 87 | this.checkBox_genericwarning.UseVisualStyleBackColor = true; 88 | this.checkBox_genericwarning.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged); 89 | // 90 | // checkBox_renamewarning 91 | // 92 | this.checkBox_renamewarning.AutoSize = true; 93 | this.checkBox_renamewarning.Location = new System.Drawing.Point(98, 131); 94 | this.checkBox_renamewarning.Name = "checkBox_renamewarning"; 95 | this.checkBox_renamewarning.Size = new System.Drawing.Size(185, 21); 96 | this.checkBox_renamewarning.TabIndex = 5; 97 | this.checkBox_renamewarning.Text = "Show Rename Warnings"; 98 | this.checkBox_renamewarning.UseVisualStyleBackColor = true; 99 | // 100 | // checkBox_buildwarning 101 | // 102 | this.checkBox_buildwarning.AutoSize = true; 103 | this.checkBox_buildwarning.Location = new System.Drawing.Point(98, 158); 104 | this.checkBox_buildwarning.Name = "checkBox_buildwarning"; 105 | this.checkBox_buildwarning.Size = new System.Drawing.Size(163, 21); 106 | this.checkBox_buildwarning.TabIndex = 6; 107 | this.checkBox_buildwarning.Text = "Show Build Warnings"; 108 | this.checkBox_buildwarning.UseVisualStyleBackColor = true; 109 | // 110 | // checkBox_stringwarning 111 | // 112 | this.checkBox_stringwarning.AutoSize = true; 113 | this.checkBox_stringwarning.Location = new System.Drawing.Point(98, 185); 114 | this.checkBox_stringwarning.Name = "checkBox_stringwarning"; 115 | this.checkBox_stringwarning.Size = new System.Drawing.Size(169, 21); 116 | this.checkBox_stringwarning.TabIndex = 7; 117 | this.checkBox_stringwarning.Text = "Show String Warnings"; 118 | this.checkBox_stringwarning.UseVisualStyleBackColor = true; 119 | // 120 | // checkBox_structwarning 121 | // 122 | this.checkBox_structwarning.AutoSize = true; 123 | this.checkBox_structwarning.Location = new System.Drawing.Point(98, 212); 124 | this.checkBox_structwarning.Name = "checkBox_structwarning"; 125 | this.checkBox_structwarning.Size = new System.Drawing.Size(169, 21); 126 | this.checkBox_structwarning.TabIndex = 8; 127 | this.checkBox_structwarning.Text = "Show Struct Warnings"; 128 | this.checkBox_structwarning.UseVisualStyleBackColor = true; 129 | // 130 | // Preferences 131 | // 132 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); 133 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 134 | this.ClientSize = new System.Drawing.Size(800, 450); 135 | this.Controls.Add(this.checkBox_structwarning); 136 | this.Controls.Add(this.checkBox_stringwarning); 137 | this.Controls.Add(this.checkBox_buildwarning); 138 | this.Controls.Add(this.checkBox_renamewarning); 139 | this.Controls.Add(this.checkBox_genericwarning); 140 | this.Controls.Add(this.button_close); 141 | this.Controls.Add(this.button_save); 142 | this.Controls.Add(this.comboBox_exporter); 143 | this.Controls.Add(this.label1); 144 | this.Name = "Preferences"; 145 | this.Text = "Preferences"; 146 | this.ResumeLayout(false); 147 | this.PerformLayout(); 148 | 149 | } 150 | 151 | #endregion 152 | 153 | private System.Windows.Forms.Label label1; 154 | private System.Windows.Forms.ComboBox comboBox_exporter; 155 | private System.Windows.Forms.Button button_save; 156 | private System.Windows.Forms.Button button_close; 157 | private System.Windows.Forms.CheckBox checkBox_genericwarning; 158 | private System.Windows.Forms.CheckBox checkBox_renamewarning; 159 | private System.Windows.Forms.CheckBox checkBox_buildwarning; 160 | private System.Windows.Forms.CheckBox checkBox_stringwarning; 161 | private System.Windows.Forms.CheckBox checkBox_structwarning; 162 | } 163 | } -------------------------------------------------------------------------------- /EDSEditorGUI/InsertObjects.cs: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of libEDSsharp. 3 | 4 | libEDSsharp is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | libEDSsharp is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with libEDSsharp. If not, see . 16 | 17 | Copyright(c) 2016 - 2019 Robin Cornelius 18 | Copyright(c) 2020 Janez Paternoster 19 | */ 20 | 21 | using System; 22 | using System.Collections.Generic; 23 | using System.Drawing; 24 | using System.Windows.Forms; 25 | using libEDSsharp; 26 | 27 | namespace ODEditor 28 | { 29 | public partial class InsertObjects : Form 30 | { 31 | readonly EDSsharp eds; 32 | readonly SortedDictionary srcObjects; 33 | readonly bool[] enabled; 34 | readonly int dataGridView_InitialColumnCount; 35 | List offsets; 36 | 37 | /// 38 | /// Display form to: specify offset(s), insert clone of selected srcObjects into existing eds 39 | /// 40 | /// 41 | /// 42 | public InsertObjects(EDSsharp eds, SortedDictionary srcObjects, string initialOffset) 43 | { 44 | this.eds = eds; 45 | this.srcObjects = srcObjects; 46 | 47 | InitializeComponent(); 48 | textBox_offsets.Text = initialOffset; 49 | 50 | dataGridView.Columns.Add(new DataGridViewCheckBoxColumn() 51 | { 52 | Name = "Insert", 53 | FalseValue = false, 54 | TrueValue = true, 55 | Visible = true 56 | }); 57 | int idx = dataGridView.Columns.Add("Original Object", "Original Object"); 58 | dataGridView.Columns[idx].ReadOnly = true; 59 | dataGridView_InitialColumnCount = dataGridView.ColumnCount; 60 | 61 | enabled = new bool[srcObjects.Count]; 62 | for(int i = 0; i < enabled.Length; i++) 63 | enabled[i] = true; 64 | 65 | Verify(initialOffset == "0"); 66 | 67 | DialogResult = DialogResult.Cancel; 68 | } 69 | 70 | private void Button_cancel_Click(object sender, EventArgs e) 71 | { 72 | Close(); 73 | } 74 | 75 | private bool Verify(bool InitiallyDisableIfError = false) 76 | { 77 | /* get offests */ 78 | offsets = new List(); 79 | string[] str = textBox_offsets.Text.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); 80 | foreach (string s in str) 81 | { 82 | try 83 | { 84 | int value = (int)new System.ComponentModel.Int32Converter().ConvertFromString(s); 85 | offsets.Add(value); 86 | } 87 | catch (Exception) 88 | { 89 | MessageBox.Show("Syntax error in Index Offset!\n\nValid value is single signed number or space separated list of multiple signed numbers."); 90 | return false; 91 | } 92 | } 93 | 94 | // write column headers 95 | int colIdx = dataGridView_InitialColumnCount; 96 | dataGridView.ColumnCount = colIdx + offsets.Count; 97 | foreach (int o in offsets) 98 | { 99 | dataGridView.Columns[colIdx].Name = $"Offset {o}"; 100 | dataGridView.Columns[colIdx++].ReadOnly = true; 101 | } 102 | 103 | // write rows and verify errors 104 | bool newIndexesValid = true; 105 | var newIndexes = new List(); 106 | DataGridViewCellStyle styleErr = new DataGridViewCellStyle 107 | { 108 | Font = new Font(dataGridView.Font, FontStyle.Bold), 109 | ForeColor = Color.Red 110 | }; 111 | 112 | dataGridView.Rows.Clear(); 113 | 114 | int odIdx = 0; 115 | foreach (ODentry od in srcObjects.Values) 116 | { 117 | int rowIdx = dataGridView.Rows.Add(enabled[odIdx], $"0x{od.Index:X4} - {od.parameter_name}"); 118 | int cellIdx = dataGridView_InitialColumnCount; 119 | 120 | foreach (int o in offsets) 121 | { 122 | int newIndex = (int)od.Index + o; 123 | bool err = newIndex <= 0 || newIndex > 0xFFFF; 124 | 125 | dataGridView.Rows[rowIdx].Cells[cellIdx].Value = err ? $"{newIndex}" : $"0x{newIndex:X4}"; 126 | 127 | if (!err) 128 | err = newIndexes.Contains(newIndex); 129 | 130 | if (!err) 131 | { 132 | newIndexes.Add(newIndex); 133 | err = eds.ods.ContainsKey((UInt16)newIndex); 134 | } 135 | 136 | if (err) 137 | { 138 | if (enabled[odIdx] && InitiallyDisableIfError) 139 | { 140 | dataGridView.Rows[rowIdx].Cells[0].Value = false; 141 | enabled[odIdx] = false; 142 | } 143 | else if (enabled[odIdx]) 144 | { 145 | newIndexesValid = false; 146 | } 147 | dataGridView.Rows[rowIdx].Cells[cellIdx].Style = styleErr; 148 | } 149 | cellIdx++; 150 | } 151 | odIdx++; 152 | } 153 | 154 | dataGridView.ClearSelection(); 155 | 156 | return newIndexesValid; 157 | } 158 | 159 | private void Button_create_Click(object sender, EventArgs e) 160 | { 161 | if (Verify()) 162 | { 163 | // clone OD objects 164 | int odIdx = 0; 165 | foreach (ODentry od in srcObjects.Values) 166 | { 167 | if (enabled[odIdx]) 168 | { 169 | foreach (int o in offsets) 170 | { 171 | UInt16 newIndex = (UInt16)(od.Index + o); 172 | ODentry newObject = od.Clone(); 173 | newObject.Index = newIndex; 174 | 175 | eds.ods.Add(newIndex, newObject); 176 | } 177 | } 178 | odIdx++; 179 | } 180 | 181 | DialogResult = DialogResult.OK; 182 | Close(); 183 | } 184 | } 185 | 186 | private void TextBox_offsets_KeyPress(object sender, KeyPressEventArgs e) 187 | { 188 | if (e.KeyChar == ' ' || e.KeyChar == '\r') 189 | { 190 | Verify(); 191 | } 192 | } 193 | 194 | private void TextBox_offsets_Leave(object sender, EventArgs e) 195 | { 196 | Verify(); 197 | } 198 | 199 | private void DataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) 200 | { 201 | // toggle selection on click on first column 202 | if (e.ColumnIndex == 0) 203 | { 204 | dataGridView.ClearSelection(); 205 | dataGridView.CurrentCell = null; 206 | foreach (DataGridViewRow row in dataGridView.Rows) 207 | { 208 | row.Cells[0].Value = !((bool)row.Cells[0].Value); 209 | } 210 | } 211 | } 212 | 213 | private void DataGridView_Leave(object sender, EventArgs e) 214 | { 215 | // recalculate enabled[] 216 | dataGridView.ClearSelection(); 217 | dataGridView.CurrentCell = null; 218 | int odIdx = 0; 219 | foreach (DataGridViewRow row in dataGridView.Rows) 220 | { 221 | enabled[odIdx++] = (bool)row.Cells[0].Value; 222 | } 223 | } 224 | } 225 | } 226 | -------------------------------------------------------------------------------- /Tests/ExporterTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Xunit; 3 | using libEDSsharp; 4 | 5 | namespace Tests 6 | { 7 | 8 | public class ExporterTests : CanOpenNodeExporter 9 | { 10 | [Fact] 11 | public void Test_cname_conversion() 12 | { 13 | ODentry od = new ODentry(); 14 | 15 | if (make_cname("axle 0 wheel right controlword",od) != "axle0WheelRightControlword") 16 | throw (new Exception("make_cname Conversion error")); 17 | 18 | if (make_cname("mapped object 4",od) != "mappedObject4") 19 | throw (new Exception("make_cname Conversion error")); 20 | 21 | if (make_cname("COB ID used by RPDO",od) != "COB_IDUsedByRPDO") 22 | throw (new Exception("make_cname Conversion error")); 23 | } 24 | 25 | [Fact] 26 | public void Test_record_objects() 27 | { 28 | 29 | ODentry od = new ODentry 30 | { 31 | objecttype = ObjectType.REC, 32 | parameter_name = "Test Record", 33 | accesstype = EDSsharp.AccessType.ro, 34 | Index = 0x2000 35 | }; 36 | 37 | ODentry subod = new ODentry("Test String 1", 0x2000, DataType.VISIBLE_STRING, "abcdefg", EDSsharp.AccessType.rw, PDOMappingType.optional, od); 38 | 39 | string test = export_one_record_type(subod, ""); 40 | 41 | if (test != " {(void*)&CO_OD_RAM.testRecord.testString1, 0x3E, 0x7 }," + Environment.NewLine) 42 | throw (new Exception("export_one_record_type() error test 1")); 43 | 44 | subod = new ODentry("Test String 2", 0x01, DataType.VISIBLE_STRING, new string('*', 255), EDSsharp.AccessType.ro, PDOMappingType.optional, od); 45 | test = export_one_record_type(subod, ""); 46 | 47 | if (test != " {(void*)&CO_OD_RAM.testRecord.testString2, 0x26, 0xFF }," + Environment.NewLine) 48 | throw (new Exception("export_one_record_type() error test 2")); 49 | 50 | } 51 | 52 | [Fact] 53 | public void TestArrays() 54 | { 55 | 56 | ODentry od = new ODentry 57 | { 58 | objecttype = ObjectType.ARRAY, 59 | datatype = DataType.VISIBLE_STRING, 60 | parameter_name = "Test Array", 61 | accesstype = EDSsharp.AccessType.ro, 62 | Index = 0x2000 63 | }; 64 | 65 | eds = new EDSsharp 66 | { 67 | ods = new System.Collections.Generic.SortedDictionary() 68 | }; 69 | 70 | eds.ods.Add(0x2000, od); 71 | 72 | prewalkArrays(); 73 | od.subobjects.Add(0x00, new ODentry("No Entries", 0x00, DataType.UNSIGNED8, "4", EDSsharp.AccessType.ro, PDOMappingType.no)); 74 | od.subobjects.Add(0x01, new ODentry("LINE1", 0x01, DataType.VISIBLE_STRING, new string('*', 1), EDSsharp.AccessType.ro, PDOMappingType.optional)); 75 | od.subobjects.Add(0x02, new ODentry("LINE1", 0x02, DataType.VISIBLE_STRING, new string('*', 10), EDSsharp.AccessType.ro, PDOMappingType.optional)); 76 | od.subobjects.Add(0x03, new ODentry("LINE1", 0x03, DataType.VISIBLE_STRING, new string('*', 16), EDSsharp.AccessType.ro, PDOMappingType.optional)); 77 | od.subobjects.Add(0x04, new ODentry("LINE1", 0x04, DataType.VISIBLE_STRING, new string('*', 32), EDSsharp.AccessType.ro, PDOMappingType.optional)); 78 | 79 | string test = print_h_entry(od); 80 | 81 | if (test != "/*2000 */ VISIBLE_STRING testArray[32][4];" + Environment.NewLine) 82 | throw (new Exception("TestArrays() test 1 failed")); 83 | 84 | 85 | } 86 | 87 | 88 | /// 89 | /// Check we can override maxsub index correctly 90 | /// 91 | [Fact] 92 | public void TestArrayNoEntries() 93 | { 94 | eds = new EDSsharp 95 | { 96 | ods = new System.Collections.Generic.SortedDictionary() 97 | }; 98 | 99 | ODentry od = new ODentry 100 | { 101 | objecttype = ObjectType.ARRAY, 102 | datatype = DataType.VISIBLE_STRING, 103 | parameter_name = "Test Array", 104 | accesstype = EDSsharp.AccessType.ro, 105 | Index = 0x1011 106 | }; 107 | 108 | eds.ods.Add(0x1011, od); 109 | 110 | od.subobjects.Add(0x00, new ODentry("No Entries", 0x00, DataType.UNSIGNED8, "0x7f", EDSsharp.AccessType.ro, PDOMappingType.no)); 111 | od.subobjects.Add(0x01, new ODentry("LINE1", 0x01, DataType.UNSIGNED32, "0x01", EDSsharp.AccessType.ro, PDOMappingType.optional)); 112 | 113 | string test = write_od_line(od); 114 | if(test != "{0x1011, 0x7F, 0x06, 0, (void*)&CO_OD_RAM.testArray[0]}," + Environment.NewLine) 115 | throw (new Exception("TestArrayNoEntries() failed")); 116 | 117 | 118 | od = new ODentry 119 | { 120 | objecttype = ObjectType.ARRAY, 121 | datatype = DataType.VISIBLE_STRING, 122 | parameter_name = "Test Array", 123 | accesstype = EDSsharp.AccessType.ro, 124 | Index = 0x2000 125 | }; 126 | 127 | eds.ods.Add(0x2000, od); 128 | 129 | od.subobjects.Add(0x00, new ODentry("No Entries", 0x00, DataType.UNSIGNED8, "0x7f", EDSsharp.AccessType.ro, PDOMappingType.no)); 130 | od.subobjects.Add(0x01, new ODentry("LINE1", 0x01, DataType.UNSIGNED32, "0x01", EDSsharp.AccessType.ro, PDOMappingType.optional)); 131 | 132 | test = write_od_line(od); 133 | if (test != "{0x2000, 0x7F, 0x06, 0, (void*)&CO_OD_RAM.testArray[0]}," + Environment.NewLine) 134 | throw (new Exception("TestArrayNoEntries() failed")); 135 | 136 | 137 | od = new ODentry 138 | { 139 | objecttype = ObjectType.ARRAY, 140 | datatype = DataType.VISIBLE_STRING, 141 | parameter_name = "Test Array", 142 | accesstype = EDSsharp.AccessType.ro, 143 | Index = 0x1003 144 | }; 145 | 146 | eds.ods.Add(0x1003, od); 147 | 148 | od.subobjects.Add(0x00, new ODentry("No Entries", 0x00, DataType.UNSIGNED8, "0x00", EDSsharp.AccessType.ro, PDOMappingType.no)); 149 | od.subobjects.Add(0x01, new ODentry("LINE1", 0x01, DataType.UNSIGNED32, "0x01", EDSsharp.AccessType.ro, PDOMappingType.optional)); 150 | od.subobjects.Add(0x02, new ODentry("LINE1", 0x02, DataType.UNSIGNED32, "0x01", EDSsharp.AccessType.ro, PDOMappingType.optional)); 151 | od.subobjects.Add(0x03, new ODentry("LINE1", 0x03, DataType.UNSIGNED32, "0x01", EDSsharp.AccessType.ro, PDOMappingType.optional)); 152 | 153 | test = write_od_line(od); 154 | if (test != "{0x1003, 0x03, 0x06, 0, (void*)&CO_OD_RAM.testArray[0]}," + Environment.NewLine) 155 | throw (new Exception("TestArrayNoEntries() failed")); 156 | 157 | 158 | 159 | } 160 | 161 | /// 162 | /// Check size of objects is correct 163 | /// 164 | [Fact] 165 | public void TestExportSizes() 166 | { 167 | 168 | ODentry od = new ODentry 169 | { 170 | objecttype = ObjectType.VAR, 171 | datatype = DataType.INTEGER32, 172 | parameter_name = "Test INT32", 173 | accesstype = EDSsharp.AccessType.ro, 174 | Index = 0x2000 175 | }; 176 | 177 | 178 | ODentry od2 = new ODentry 179 | { 180 | objecttype = ObjectType.VAR, 181 | datatype = DataType.UNSIGNED8, 182 | parameter_name = "Test UINT8", 183 | accesstype = EDSsharp.AccessType.ro, 184 | Index = 0x2001 185 | }; 186 | 187 | eds = new EDSsharp 188 | { 189 | ods = new System.Collections.Generic.SortedDictionary() 190 | }; 191 | 192 | eds.ods.Add(0x2000, od); 193 | eds.ods.Add(0x2001, od2); 194 | 195 | prewalkArrays(); 196 | 197 | string test = write_od_line(od); 198 | if (test != "{0x2000, 0x00, 0x86, 4, (void*)&CO_OD_RAM.testINT32}," + Environment.NewLine) 199 | throw (new Exception("write_od_line() returning wrong data length")); 200 | 201 | if((getflags(od2) & 0x80) == 0x80) 202 | { 203 | throw (new Exception("Multi byte flag set for single byte")); 204 | } 205 | 206 | } 207 | 208 | } 209 | } 210 | -------------------------------------------------------------------------------- /EDSEditorGUI/NewIndex.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ODEditor 2 | { 3 | partial class NewIndex 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewIndex)); 32 | this.radioButton_var = new System.Windows.Forms.RadioButton(); 33 | this.groupBox1 = new System.Windows.Forms.GroupBox(); 34 | this.radioButton_record = new System.Windows.Forms.RadioButton(); 35 | this.radioButton_array = new System.Windows.Forms.RadioButton(); 36 | this.numericUpDown_index = new System.Windows.Forms.NumericUpDown(); 37 | this.label1 = new System.Windows.Forms.Label(); 38 | this.label2 = new System.Windows.Forms.Label(); 39 | this.textBox_name = new System.Windows.Forms.TextBox(); 40 | this.button_create = new System.Windows.Forms.Button(); 41 | this.button_cancel = new System.Windows.Forms.Button(); 42 | this.groupBox1.SuspendLayout(); 43 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_index)).BeginInit(); 44 | this.SuspendLayout(); 45 | // 46 | // radioButton_var 47 | // 48 | this.radioButton_var.AutoSize = true; 49 | this.radioButton_var.Checked = true; 50 | this.radioButton_var.Location = new System.Drawing.Point(6, 19); 51 | this.radioButton_var.Name = "radioButton_var"; 52 | this.radioButton_var.Size = new System.Drawing.Size(47, 17); 53 | this.radioButton_var.TabIndex = 0; 54 | this.radioButton_var.TabStop = true; 55 | this.radioButton_var.Text = "VAR"; 56 | this.radioButton_var.UseVisualStyleBackColor = true; 57 | // 58 | // groupBox1 59 | // 60 | this.groupBox1.Controls.Add(this.radioButton_record); 61 | this.groupBox1.Controls.Add(this.radioButton_array); 62 | this.groupBox1.Controls.Add(this.radioButton_var); 63 | this.groupBox1.Location = new System.Drawing.Point(23, 91); 64 | this.groupBox1.Name = "groupBox1"; 65 | this.groupBox1.Size = new System.Drawing.Size(146, 92); 66 | this.groupBox1.TabIndex = 3; 67 | this.groupBox1.TabStop = false; 68 | this.groupBox1.Text = "Object Type"; 69 | // 70 | // radioButton_record 71 | // 72 | this.radioButton_record.AutoSize = true; 73 | this.radioButton_record.Location = new System.Drawing.Point(6, 65); 74 | this.radioButton_record.Name = "radioButton_record"; 75 | this.radioButton_record.Size = new System.Drawing.Size(71, 17); 76 | this.radioButton_record.TabIndex = 2; 77 | this.radioButton_record.Text = "RECORD"; 78 | this.radioButton_record.UseVisualStyleBackColor = true; 79 | // 80 | // radioButton_array 81 | // 82 | this.radioButton_array.AutoSize = true; 83 | this.radioButton_array.Location = new System.Drawing.Point(6, 42); 84 | this.radioButton_array.Name = "radioButton_array"; 85 | this.radioButton_array.Size = new System.Drawing.Size(62, 17); 86 | this.radioButton_array.TabIndex = 1; 87 | this.radioButton_array.Text = "ARRAY"; 88 | this.radioButton_array.UseVisualStyleBackColor = true; 89 | // 90 | // numericUpDown_index 91 | // 92 | this.numericUpDown_index.Hexadecimal = true; 93 | this.numericUpDown_index.Location = new System.Drawing.Point(85, 21); 94 | this.numericUpDown_index.Maximum = new decimal(new int[] { 95 | 65535, 96 | 0, 97 | 0, 98 | 0}); 99 | this.numericUpDown_index.Minimum = new decimal(new int[] { 100 | 1, 101 | 0, 102 | 0, 103 | 0}); 104 | this.numericUpDown_index.Name = "numericUpDown_index"; 105 | this.numericUpDown_index.Size = new System.Drawing.Size(101, 20); 106 | this.numericUpDown_index.TabIndex = 1; 107 | this.numericUpDown_index.Value = new decimal(new int[] { 108 | 8192, 109 | 0, 110 | 0, 111 | 0}); 112 | // 113 | // label1 114 | // 115 | this.label1.AutoSize = true; 116 | this.label1.Location = new System.Drawing.Point(20, 23); 117 | this.label1.Name = "label1"; 118 | this.label1.Size = new System.Drawing.Size(59, 13); 119 | this.label1.TabIndex = 3; 120 | this.label1.Text = "Index (hex)"; 121 | // 122 | // label2 123 | // 124 | this.label2.AutoSize = true; 125 | this.label2.Location = new System.Drawing.Point(20, 57); 126 | this.label2.Name = "label2"; 127 | this.label2.Size = new System.Drawing.Size(35, 13); 128 | this.label2.TabIndex = 4; 129 | this.label2.Text = "Name"; 130 | // 131 | // textBox_name 132 | // 133 | this.textBox_name.Location = new System.Drawing.Point(85, 54); 134 | this.textBox_name.Name = "textBox_name"; 135 | this.textBox_name.Size = new System.Drawing.Size(241, 20); 136 | this.textBox_name.TabIndex = 2; 137 | this.textBox_name.Text = "New Object"; 138 | // 139 | // button_create 140 | // 141 | this.button_create.Location = new System.Drawing.Point(23, 204); 142 | this.button_create.Name = "button_create"; 143 | this.button_create.Size = new System.Drawing.Size(108, 37); 144 | this.button_create.TabIndex = 6; 145 | this.button_create.Text = "Create"; 146 | this.button_create.UseVisualStyleBackColor = true; 147 | this.button_create.Click += new System.EventHandler(this.Button_create_Click); 148 | // 149 | // button_cancel 150 | // 151 | this.button_cancel.Location = new System.Drawing.Point(180, 204); 152 | this.button_cancel.Name = "button_cancel"; 153 | this.button_cancel.Size = new System.Drawing.Size(108, 37); 154 | this.button_cancel.TabIndex = 7; 155 | this.button_cancel.Text = "Cancel"; 156 | this.button_cancel.UseVisualStyleBackColor = true; 157 | this.button_cancel.Click += new System.EventHandler(this.Button_cancel_Click); 158 | // 159 | // NewIndex 160 | // 161 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 162 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 163 | this.ClientSize = new System.Drawing.Size(345, 267); 164 | this.Controls.Add(this.button_cancel); 165 | this.Controls.Add(this.button_create); 166 | this.Controls.Add(this.textBox_name); 167 | this.Controls.Add(this.label2); 168 | this.Controls.Add(this.label1); 169 | this.Controls.Add(this.numericUpDown_index); 170 | this.Controls.Add(this.groupBox1); 171 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 172 | this.Name = "NewIndex"; 173 | this.Text = "Create new OD Index"; 174 | this.groupBox1.ResumeLayout(false); 175 | this.groupBox1.PerformLayout(); 176 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_index)).EndInit(); 177 | this.ResumeLayout(false); 178 | this.PerformLayout(); 179 | 180 | } 181 | 182 | #endregion 183 | 184 | private System.Windows.Forms.RadioButton radioButton_var; 185 | private System.Windows.Forms.GroupBox groupBox1; 186 | private System.Windows.Forms.RadioButton radioButton_record; 187 | private System.Windows.Forms.RadioButton radioButton_array; 188 | private System.Windows.Forms.NumericUpDown numericUpDown_index; 189 | private System.Windows.Forms.Label label1; 190 | private System.Windows.Forms.Label label2; 191 | private System.Windows.Forms.TextBox textBox_name; 192 | private System.Windows.Forms.Button button_create; 193 | private System.Windows.Forms.Button button_cancel; 194 | } 195 | } --------------------------------------------------------------------------------