Skip to content

Commit f357804

Browse files
committed
- update different spelling to "CANopen" in comments and strings
- missing """ at <include "CO_OD.h"> in CO_OD.c file - corrected typo "comparability Entry" to "compatibility entry"
1 parent 5a8b9e2 commit f357804

File tree

8 files changed

+46
-46
lines changed

8 files changed

+46
-46
lines changed

‎EDSTest/DeviceInfoView.Designer.cs‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎EDSTest/DeviceODView.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ private void button_save_changes_Click(object sender, EventArgs e)
220220
// Propagate changes through sub objects
221221
// We only really need to do this for PDOMapping to fix bug #13 see report
222222
// on git hub for discussion why other parameters are not propagated here
223-
// tl;dr; Limitations of CanOpenNode object dictionary perms for sub array objects
223+
// tl;dr; Limitations of CANopenNode object dictionary perms for sub array objects
224224

225225
foreach (KeyValuePair<UInt16,ODentry>kvp in selectedobject.subobjects)
226226
{
@@ -1112,7 +1112,7 @@ private void changeMaxSubIndexToolStripMenuItem_Click(object sender, EventArgs e
11121112
{
11131113
//Change the max subindex, it is allowed to have a different max subindex to the physical array size
11141114
//as depending on implementation it might not be a simple array behind the scenes. Even 0x1010,0x1011
1115-
//do this on their implementation in CanopenNode
1115+
//do this on their implementation in CANopenNode
11161116

11171117
if (selecteditemsub.Tag != null)
11181118
{

‎EDSTest/Form1.cs‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ private void openCanOpenNodeXMLToolStripMenuItem_Click(object sender, EventArgs
236236
{
237237

238238
OpenFileDialog odf = new OpenFileDialog();
239-
odf.Filter = "All supported files (*.eds;*.xml;*.xdd;*.dcf)|*.eds;*.xml;*.xdd;*.dcf|Electronic Data Sheets (*.eds)|*.eds|Device Configuration Files (*.dcf)|*.dcf|CanOpen Xml Data sheet (*.xdd)|*.xdd|CanOpenNode XML (*.xml)|*.xml";
239+
odf.Filter = "All supported files (*.eds;*.xml;*.xdd;*.dcf)|*.eds;*.xml;*.xdd;*.dcf|Electronic Data Sheets (*.eds)|*.eds|Device Configuration Files (*.dcf)|*.dcf|CANopen Xml Data sheet (*.xdd)|*.xdd|CANopenNode XML (*.xml)|*.xml";
240240
if (odf.ShowDialog() == DialogResult.OK)
241241
{
242242

@@ -484,7 +484,7 @@ private void exportDeviceFileToolStripMenuItem_Click(object sender, EventArgs e)
484484
DeviceView dv = (DeviceView)tabControl1.SelectedTab.Controls[0];
485485
SaveFileDialog sfd = new SaveFileDialog();
486486

487-
sfd.Filter = "Canopen Node XML (*.xml)|*.xml|Electronic Data Sheets (*.eds)|*.eds|Device Configuration Files (*.dcf)|*.dcf";
487+
sfd.Filter = "CANopen Node XML (*.xml)|*.xml|Electronic Data Sheets (*.eds)|*.eds|Device Configuration Files (*.dcf)|*.dcf";
488488

489489
sfd.InitialDirectory = Path.GetDirectoryName(dv.eds.xmlfilename);
490490
sfd.RestoreDirectory = true;
@@ -522,7 +522,7 @@ private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
522522
DeviceView dv = (DeviceView)tabControl1.SelectedTab.Controls[0];
523523
SaveFileDialog sfd = new SaveFileDialog();
524524

525-
sfd.Filter = "CanOpen XDD (*.xdd)|*.xdd";
525+
sfd.Filter = "CANopen XDD (*.xdd)|*.xdd";
526526

527527
sfd.InitialDirectory = Path.GetDirectoryName(dv.eds.xmlfilename);
528528
sfd.RestoreDirectory = true;
@@ -733,7 +733,7 @@ private void saveNetworkXmlToolStripMenuItem_Click(object sender, EventArgs e)
733733
{
734734
SaveFileDialog sfd = new SaveFileDialog();
735735

736-
sfd.Filter = "CanOpen Network XDD (*.nxdd)|*.nxdd|CanOpen network XML (*.nxml)|*.nxml";
736+
sfd.Filter = "CANopen Network XDD (*.nxdd)|*.nxdd|CANopen network XML (*.nxml)|*.nxml";
737737

738738
sfd.InitialDirectory = Path.GetDirectoryName(networkfilename);
739739
sfd.RestoreDirectory = true;
@@ -765,7 +765,7 @@ private void loadNetworkXmlToolStripMenuItem_Click(object sender, EventArgs e)
765765
{
766766

767767
OpenFileDialog odf = new OpenFileDialog();
768-
odf.Filter = "CanOpen Network XDD (*.nxdd)|*.nxdd|CanOpen network XML (*.nxml)|*.nxml";
768+
odf.Filter = "CANopen Network XDD (*.nxdd)|*.nxdd|CANopen network XML (*.nxml)|*.nxml";
769769
if (odf.ShowDialog() == DialogResult.OK)
770770
{
771771
switch (Path.GetExtension(odf.FileName).ToLower())
@@ -967,7 +967,7 @@ private void documentationToolStripMenuItem_Click(object sender, EventArgs e)
967967
private void saveExportAllToolStripMenuItem_Click(object sender, EventArgs e)
968968
{
969969
string temp;
970-
//Attempt to save EDS,XML and export the CanOpen dictionary
970+
//Attempt to save EDS,XML and export the CANopen dictionary
971971

972972
if (tabControl1.SelectedTab != null)
973973
{

‎libEDSsharp/Bridge.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ You should have received a copy of the GNU General Public License
2727
/* I know I'm going to regret this
2828
*
2929
* I quite like my eds class as it trys to validate the EDS using typing and enums etc
30-
* but i also want the XML wrappers for the CanOpenXML
30+
* but i also want the XML wrappers for the CANOpenXML
3131
* so I'm going to make a converter outside of both classes hence this bridge
3232
* which is more code to manage ;-(
3333
* */
@@ -286,7 +286,7 @@ public EDSsharp convert(Device dev)
286286
}
287287
else
288288
{
289-
//CanOpenNode Project XML did not correctly set DataTypes for record sets
289+
//CANopenNode Project XML did not correctly set DataTypes for record sets
290290

291291
if (entry.Index == 0x1018)
292292
entry.datatype = DataType.IDENTITY;
@@ -542,7 +542,7 @@ public EDSsharp convert(Device dev)
542542
{
543543
if (dev.Other.File != null)
544544
{
545-
// CanOpenNode default project.xml contains - for fileversion, its suppose to be a byte field according to DS306
545+
// CANopenNode default project.xml contains - for fileversion, its suppose to be a byte field according to DS306
546546
if (dev.Other.File.FileVersion == "-")
547547
{
548548
dev.Other.File.FileVersion = "0";

‎libEDSsharp/CanOpenNodeExporter.cs‎

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License
1515
along with libEDSsharp. If not, see <http://www.gnu.org/licenses/>.
1616
1717
Copyright(c) 2016 - 2019 Robin Cornelius <robin.cornelius@gmail.com>
18-
based heavily on the files CO_OD.h and CO_OD.c from CanOpenNode which are
18+
based heavily on the files CO_OD.h and CO_OD.c from CANopenNode which are
1919
Copyright(c) 2010 - 2016 Janez Paternoster
2020
*/
2121

@@ -69,26 +69,26 @@ public void export(string folderpath, string filename, string gitVersion, EDSsha
6969

7070
//private bool compatfixed = false;
7171
private void fixcompatentry()
72-
{
73-
// compatfixed = false;
74-
75-
76-
// Handle the TPDO communication parameters in a special way, because of
77-
// sizeof(OD_TPDOCommunicationParameter_t) != sizeof(CO_TPDOCommPar_t) in CanOpen.c
78-
// the existing CO_TPDOCommPar_t has a compatibility entry so we must export one regardless
79-
// of if its in the OD or not
80-
72+
{
73+
// compatfixed = false;
74+
75+
76+
// Handle the TPDO communication parameters in a special way, because of
77+
// sizeof(OD_TPDOCommunicationParameter_t) != sizeof(CO_TPDOCommPar_t) in CANopen.c
78+
// the existing CO_TPDOCommPar_t has a compatibility entry so we must export one regardless
79+
// of if its in the OD or not
80+
8181
for (UInt16 idx = 0x1800; idx < 0x1900; idx++)
8282
{
8383
if (eds.ods.ContainsKey(idx))
8484
{
8585
ODentry od = eds.ods[idx];
8686

8787
if (!od.Containssubindex(0x04))
88-
{
89-
//compatfixed = true;
90-
ODentry compatability = new ODentry("comparability Entry", 0x05, DataType.UNSIGNED8, "0", EDSsharp.AccessType.ro, PDOMappingType.no);
91-
od.subobjects.Add(0x04, compatability);
88+
{
89+
//compatfixed = true;
90+
ODentry compatibility = new ODentry("compatibility entry", idx, DataType.UNSIGNED8, "0", EDSsharp.AccessType.ro, PDOMappingType.no, od);
91+
od.subobjects.Add(0x04, compatibility);
9292
}
9393
}
9494
}
@@ -379,9 +379,9 @@ not derived from or based on this library. If you modify this
379379
private void export_h(string filename)
380380
{
381381
if (filename == "")
382-
filename = "CO_OD.c";
382+
filename = "CO_OD";
383383

384-
StreamWriter file = new StreamWriter(folderpath + Path.DirectorySeparatorChar + filename);
384+
StreamWriter file = new StreamWriter(folderpath + Path.DirectorySeparatorChar + filename + ".h");
385385

386386

387387
addGPLheader(file);
@@ -509,7 +509,7 @@ TYPE DEFINITIONS FOR RECORDS
509509
*******************************************************************************/");
510510

511511
//We need to identify all the record types used and generate a struct for each one
512-
//FIXME the original CanOpenNode exporter said how many items used this struct in the comments
512+
//FIXME the original CANopenNode exporter said how many items used this struct in the comments
513513

514514
List<string> structnamelist = new List<string>();
515515

@@ -776,13 +776,13 @@ ALIASES FOR OBJECT DICTIONARY VARIABLES
776776
private void export_c(string filename)
777777
{
778778
if (filename == "")
779-
filename = "CO_OD.c";
779+
filename = "CO_OD";
780780
StreamWriter file = new StreamWriter(folderpath + Path.DirectorySeparatorChar + filename + ".c");
781781

782782
addGPLheader(file);
783783

784784
file.WriteLine(@"#include ""CO_driver.h""
785-
#include " + filename + @".h""
785+
#include """ + filename + @".h""
786786
#include ""CO_SDO.h""
787787
788788
/*******************************************************************************
@@ -929,14 +929,14 @@ protected string write_od_line(ODentry od)
929929
{
930930
if ((od.Getmaxsubindex() != nosubindexs))
931931
{
932-
if (od.Index != 0x1003 && od.Index != 0x1011)//ignore 0x1003, it is a special case as per canopen specs, and ignore 0x1011 canopennode uses special sub indexes for eeprom resets
932+
if (od.Index != 0x1003 && od.Index != 0x1011)//ignore 0x1003, it is a special case as per CANopen specs, and ignore 0x1011 CANopenNode uses special sub indexes for eeprom resets
933933
{
934934
Warnings.warning_list.Add(String.Format("Subindex discrepancy on object 0x{0:x4} arraysize: {1} vs max sub-index: {2}", od.Index, nosubindexs, od.Getmaxsubindex()));
935935
}
936936

937-
//0x1003 is a special case for CanOpenNode
937+
//0x1003 is a special case for CANopenNode
938938
//SubIndex 0 will probably be 0 for no errors
939-
//so we cannot read that to determine max subindex size, which is required to set up CanOpenNode so we leave it alone here
939+
//so we cannot read that to determine max subindex size, which is required to set up CANopenNode so we leave it alone here
940940
//as its already set to subod.count
941941
if (od.Index != 0x1003)
942942
{
@@ -977,7 +977,7 @@ protected string write_od_line(ODentry od)
977977
}
978978

979979
/// <summary>
980-
/// Get the CanOpenNode specific flags, these flags are used internally in CanOpenNode to determine details about the object variable
980+
/// Get the CANopenNode specific flags, these flags are used internally in CanOpenNode to determine details about the object variable
981981
/// </summary>
982982
/// <param name="od">An odentry to access</param>
983983
/// <returns>byte containing the flag value</returns>
@@ -1326,7 +1326,7 @@ protected string export_record_types()
13261326

13271327
if(od.Index>=0x1400 && od.Index<0x1600)
13281328
{
1329-
count = 3; //CanOpenNode Fudging. Its only 3 parameters for RX PDOS in the c code despite being a PDO_COMMUNICATION_PARAMETER
1329+
count = 3; //CANopenNode Fudging. Its only 3 parameters for RX PDOS in the c code despite being a PDO_COMMUNICATION_PARAMETER
13301330
}
13311331

13321332
returndata.AppendLine($"/*0x{od.Index:x4}*/ const CO_OD_entryRecord_t OD_record{od.Index:x4}[{count}] = {{");
@@ -1382,7 +1382,7 @@ protected string export_one_record_type(ODentry sub,string arrayaccess)
13821382
}
13831383
else
13841384
{
1385-
//Domain type MUST have its data pointer set to 0 for CanOpenNode
1385+
//Domain type MUST have its data pointer set to 0 for CANopenNode
13861386
sb.AppendLine($" {{(void*)0, 0x{getflags(sub):x2}, 0x{datasize:x} }},");
13871387
}
13881388

‎libEDSsharp/CanOpenXDD.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License
1515
along with libEDSsharp. If not, see <http://www.gnu.org/licenses/>.
1616
1717
Copyright(c) 2016 - 2019 Robin Cornelius <robin.cornelius@gmail.com>
18-
based heavily on the files CO_OD.h and CO_OD.c from CanOpenNode which are
18+
based heavily on the files CO_OD.h and CO_OD.c from CANopenNode which are
1919
Copyright(c) 2010 - 2016 Janez Paternoster
2020
*/
2121

@@ -206,7 +206,7 @@ public ISO15745ProfileContainer convert(EDSsharp eds)
206206
dev.ISO15745Profile[0].ProfileHeader.ISO15745Reference = new ISO15745Reference_DataType();
207207
dev.ISO15745Profile[0].ProfileHeader.ISO15745Reference.ISO15745Part = "1";
208208
dev.ISO15745Profile[0].ProfileHeader.ISO15745Reference.ISO15745Edition = "1";
209-
dev.ISO15745Profile[0].ProfileHeader.ISO15745Reference.ProfileTechnology = "Canopen";
209+
dev.ISO15745Profile[0].ProfileHeader.ISO15745Reference.ProfileTechnology = "CANopen";
210210

211211
dev.ISO15745Profile[0].ProfileBody = new ProfileBody_Device_CANopen();
212212

@@ -363,7 +363,7 @@ public ISO15745ProfileContainer convert(EDSsharp eds)
363363
dev.ISO15745Profile[1].ProfileHeader.ISO15745Reference = new ISO15745Reference_DataType();
364364
dev.ISO15745Profile[1].ProfileHeader.ISO15745Reference.ISO15745Part = "1";
365365
dev.ISO15745Profile[1].ProfileHeader.ISO15745Reference.ISO15745Edition = "1";
366-
dev.ISO15745Profile[1].ProfileHeader.ISO15745Reference.ProfileTechnology = "Canopen";
366+
dev.ISO15745Profile[1].ProfileHeader.ISO15745Reference.ProfileTechnology = "CANopen";
367367

368368
dev.ISO15745Profile[1].ProfileBody = new ProfileBody_CommunicationNetwork_CANopen();
369369
ProfileBody_CommunicationNetwork_CANopen comnet = (ProfileBody_CommunicationNetwork_CANopen)dev.ISO15745Profile[1].ProfileBody;

‎libEDSsharp/docs/libEDSsharp.xml‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎libEDSsharp/eds.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ public bool PDOMapping
992992

993993
public PDOMappingType PDOtype;
994994

995-
//CanOpenNode specific extra storage
995+
//CANopenNode specific extra storage
996996
public string Label = "";
997997
public string Description = "";
998998

@@ -1036,7 +1036,7 @@ public ODentry()
10361036
/// <param name="index">Index of object in object dictionary</param>
10371037
/// <param name="datatype">Type of this objects data</param>
10381038
/// <param name="defaultvalue">Default value (always set as a string)</param>
1039-
/// <param name="accesstype">Allowed CanOpen access permissions</param>
1039+
/// <param name="accesstype">Allowed CANopen access permissions</param>
10401040
/// <param name="PDOMapping">Allowed PDO mapping options</param>
10411041
public ODentry(string parameter_name,UInt16 index, DataType datatype, string defaultvalue, EDSsharp.AccessType accesstype, PDOMappingType PDOMapping)
10421042
{
@@ -1252,7 +1252,7 @@ public string Paramater_cname()
12521252
}
12531253

12541254
/// <summary>
1255-
/// Return the size in bytes for the given CanOpen datatype of this object, eg the size of what ever the datatype field is set to
1255+
/// Return the size in bytes for the given CANopen datatype of this object, eg the size of what ever the datatype field is set to
12561256
/// </summary>
12571257
/// <returns>no of bytes</returns>
12581258
public int Sizeofdatatype()

0 commit comments

Comments
 (0)