Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ebc961a
Merge branch 'pr/n22_fix-workflow' into feature
trojanobelix Dec 6, 2022
bd65db6
Merge branch 'pr/n19_bugfix-array-of-strings-export' into feature
trojanobelix Dec 6, 2022
7b8ceba
Extend dirty-notification with an option to save instantly rather tha…
uniederer Dec 15, 2022
5ef3e83
Make message more explicit
uniederer Dec 15, 2022
813788a
Add autosave option
uniederer Dec 15, 2022
6e83ea2
Merge branch 'pr/n44_feature/allow_instant_save' into feature
trojanobelix Dec 15, 2022
bb60e06
Merge branch 'feature' of https://github.com/CANopenNode/CANopenEdito…
trojanobelix Dec 15, 2022
9f5048d
Merge branch 'bugfix' into feature
trojanobelix Jan 10, 2023
44860c7
Merge branch 'bugfix' into feature
trojanobelix Jan 30, 2023
2326320
Merge branch 'bugfix' into feature
trojanobelix Jul 6, 2023
226383f
Bugfix file filter when opening Network XML
trojanobelix Jul 2, 2024
1608e9c
added it back
nimrof Jul 16, 2024
ba45e03
Add/extend some exception catches to provide more information what wa…
trojanobelix Dec 1, 2024
e6472ec
Merge remote-tracking branch 'Github_origin/main' into feature
trojanobelix Jan 14, 2025
0c97545
Merge remote-tracking branch 'Github_origin/ExeptionCatch' into feature
trojanobelix Jan 14, 2025
5cb1bda
Unified header for Exporter legacy/V4
trojanobelix Jan 14, 2025
f959354
Merge remote-tracking branch 'trojanobelix/feature' into ExeptionCatch
trojanobelix Jan 14, 2025
b3baa5d
Merge remote-tracking branch 'Github_origin/main' into feature
trojanobelix Feb 7, 2025
d0b0969
Merge branch 'trojanobelix_main' into feature
trojanobelix Feb 7, 2025
e7e71c2
Merge branch 'added-moduleInfo-tab-back-to-DeviceView' into feature
trojanobelix Feb 7, 2025
b995b39
Update EDSEditorGUI/Form1.cs
trojanobelix Mar 10, 2025
760a177
Update EDSEditorGUI/Form1.cs
trojanobelix Mar 10, 2025
4045605
delete old code fragments
trojanobelix Mar 10, 2025
d7f774b
Merge remote-tracking branch 'trojanobelix/feature' into feature
trojanobelix Mar 25, 2025
bd326c5
Merge remote-tracking branch 'origin/main' into feature
trojanobelix Mar 25, 2025
7937b10
edssharp: add another extension for the EDS file for CountLabel
ckhardin Mar 25, 2025
5a6f7b6
Bugfix for #181
trojanobelix Apr 23, 2025
561b43d
Merge branch 'pr/n181_clonig_crash' into feature
trojanobelix Apr 23, 2025
e0fc09c
Merge remote-tracking branch 'CanopenEditor/feature' into feature
trojanobelix May 12, 2025
55f3d18
Merge remote-tracking branch 'Github_origin/main' into feature
trojanobelix May 12, 2025
5738aa5
Merge branch 'pr/n180_ckhardin/add-countlabel-eds-extension' into fea…
trojanobelix Sep 5, 2025
b4aaa21
Merge remote-tracking branch 'Github_origin/main' into feature
trojanobelix Sep 5, 2025
5be27ef
Increment number in object name when adding new objects
trojanobelix Nov 17, 2025
f50327c
Merge branch 'pr/198' into feature
trojanobelix Nov 21, 2025
062ffcc
Add IncrementNumberAtEnd
trojanobelix Nov 25, 2025
c23a2e4
Merge branch 'IncObjectName' into feature
trojanobelix Nov 25, 2025
e29e2a1
Updates nuget extensions
trojanobelix Nov 27, 2025
7a2de63
Update sourcegrid for .net 8/9
trojanobelix Nov 28, 2025
4017078
Check if the sub index for PDO mapping is still valid (might be deleted)
trojanobelix Nov 28, 2025
4cbf9a3
Merge branch 'updt_sourcegrid' into feature
trojanobelix Nov 28, 2025
8505320
Merge branch 'feat-chkPDOMappingSubValid' into feature
trojanobelix Nov 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions EDSEditorGUI/DeviceInfoView.Designer.cs

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

3 changes: 3 additions & 0 deletions EDSEditorGUI/DeviceInfoView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ You should have received a copy of the GNU General Public License
using System.IO;
using System.Runtime.CompilerServices;
using System.Drawing;
using System.Linq;

namespace ODEditor
{
Expand All @@ -44,6 +45,7 @@ public void populatedeviceinfo()
textBox_productnumber.Text = eds.di.ProductNumber;
textBox_vendorname.Text = eds.di.VendorName;
textBox_vendornumber.Text = eds.di.VendorNumber;
textBox_revisionnumber.Text = eds.di.RevisionNumber.ToString();

textBox_fileversion.Text = eds.fi.FileVersion;
textBox_di_description.Text = eds.fi.Description;
Expand Down Expand Up @@ -140,6 +142,7 @@ private void update_devfile_info()
eds.di.ProductNumber = textBox_productnumber.Text;
eds.di.VendorName = textBox_vendorname.Text;
eds.di.VendorNumber = textBox_vendornumber.Text;
uint.TryParse(textBox_revisionnumber.Text, out eds.di.RevisionNumber);

eds.fi.FileVersion = textBox_fileversion.Text;
eds.fi.Description = textBox_di_description.Text;
Expand Down
6 changes: 4 additions & 2 deletions EDSEditorGUI/DeviceODView.Designer.cs

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

4 changes: 4 additions & 0 deletions EDSEditorGUI/DeviceODView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ public void PopulateObjectLists(EDSsharp eds_target)
});

lvi.Tag = od;
if ((index == 0x100C) || (index == 0x100D))
{
od.prop.CO_disabled = !eds.di.NG_Slave;
}
if (selectedObject != null && index == selectedObject.Index)
lvi.Selected = true;
if (od.prop.CO_disabled == true)
Expand Down
6 changes: 3 additions & 3 deletions EDSEditorGUI/EDSEditorGUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="SourceGrid" Version="4.4.0" Condition="'$(TargetFramework)' == 'net481'"/>
<PackageReference Include="SourceGrid-huanlin" Version="6.0.10" Condition="'$(TargetFramework)' == 'net8.0-windows'"/>
<PackageReference Include="System.Resources.Extensions" Version="8.0.0" Condition="'$(TargetFramework)' == 'net8.0-windows'"/>
<PackageReference Include="SourceGrid" Version="4.4.0" Condition="'$(TargetFramework)' == 'net481'" />
<PackageReference Include="SourceGrid-huanlin" Version="6.1.1" Condition="'$(TargetFramework)' == 'net8.0-windows'" />
<PackageReference Include="System.Resources.Extensions" Version="10.0.0" Condition="'$(TargetFramework)' == 'net8.0-windows'" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
</ItemGroup>
<PropertyGroup>
Expand Down
5 changes: 4 additions & 1 deletion EDSEditorGUI/Form1.Designer.cs

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

60 changes: 44 additions & 16 deletions EDSEditorGUI/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ You should have received a copy of the GNU General Public License
using System.Windows.Forms;
using System.IO;
using libEDSsharp;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace ODEditor
{
Expand Down Expand Up @@ -189,6 +188,12 @@ private void openEDSfile(string path,InfoSection.Filetype ft)
{
EDSsharp eds = new EDSsharp();

if (!File.Exists(path))
{
MessageBox.Show("File " +path + "\ndoes not exist.");
return;
}

eds.Loadfile(path);

DeviceView device = new DeviceView(eds, network);
Expand Down Expand Up @@ -327,6 +332,11 @@ private void openToolStripMenuItem_Click(object sender, EventArgs e)

private void openXDDfile(string path)
{
if (!File.Exists(path))
{
MessageBox.Show("File " + path + "\ndoes not exist.");
return;
}
try
{
EDSsharp eds;
Expand Down Expand Up @@ -1329,34 +1339,52 @@ private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)

private void tabControl1_MouseClick(object sender, MouseEventArgs e)
{
TabPage tp;
if (e.Button == MouseButtons.Right)
{
for (int i = 0; i <= tabControl1.TabCount - 1; i++)
{
if (tabControl1.GetTabRect(i).Contains(e.Location))
{
tp = tabControl1.TabPages[i];

DialogResult dialogResult = MessageBox.Show(tabControl1.TabPages[i].Text, "Close file?", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
{

DeviceView device = (DeviceView)tabControl1.TabPages[i].Controls[0];

if (device.eds.Dirty == true)
{
if (MessageBox.Show("All unsaved changes will be lost\n continue?", "Unsaved changes", MessageBoxButtons.YesNo) == DialogResult.No)
return;
}

network.Remove(device.eds);

tabControl1.TabPages.Remove(tabControl1.TabPages[i]);
DeviceView device = (DeviceView)tabControl1.TabPages[i].Controls[0];
if (device.eds.Dirty == true)
{
if (MessageBox.Show("All unsaved changes will be lost\n continue?", "Unsaved changes", MessageBoxButtons.YesNo) == DialogResult.No)
return;
}
network.Remove(device.eds);
tabControl1.TabPages.Remove(tabControl1.TabPages[i]);
}
}
}
}
}
private void tabControl1_MouseHover(object sender, EventArgs e)
{

TabControl tabControl = sender as TabControl;
Point mousePosition = tabControl.PointToClient(Cursor.Position);
for (int i = 0; i < tabControl.TabCount; i++)
{
Rectangle tabRect = tabControl.GetTabRect(i);
if (tabRect.Contains(mousePosition))
{
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.

toolTip.AutoPopDelay = 5000;
toolTip.InitialDelay = 1000;
toolTip.ReshowDelay = 500;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
DeviceView device = (DeviceView)tabControl1.TabPages[i].Controls[0];
toolTip.SetToolTip(tabControl, device.eds.projectFilename);
break;
}
}
}

}
}
47 changes: 29 additions & 18 deletions EDSEditorGUI/InsertObjects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,24 +159,29 @@ private bool Verify(bool InitiallyDisableIfError = false)
int j = 1;
foreach (ODentry od in srcObjects.Values)
{
String numpattern = @"(\w*\d+\Z)";
string newname;
string numpattern = @"^(.*?)(\d+)$";
Regex regex = new Regex(numpattern);
Match match = regex.Match(od.parameter_name);

string[] words = Regex.Split(od.parameter_name, numpattern);
// MatchCollection nummatches = System.Text.RegularExpressions.Regex.Matches(od.parameter_name, numpattern);
if (words.Length > 1)
if (match.Success)
{
// Extract the string part and the number part
string stringPart = match.Groups[1].Value;
int numberPart = int.Parse(match.Groups[2].Value);

// value1 = Int32.Parse(m.Groups[1].Value);
int nameidx = Int32.Parse(words[1]) + j++;

newname = words[0] + nameidx;// nameidx.ToString ;
// Increment the number by 1
numberPart++;

// Reassemble the string with the incremented number
newname = stringPart + numberPart.ToString();
}
else {
newname = od.parameter_name;
else
{
newname = od.parameter_name;
}
int rowIdx = dataGridView.Rows.Add(enabled[odIdx], $"0x{od.Index:X4} - {newname}");

int rowIdx = dataGridView.Rows.Add(enabled[odIdx], $"0x{od.Index:X4} - {newname}");
int cellIdx = dataGridView_InitialColumnCount;

foreach (int o in offsets)
Expand Down Expand Up @@ -235,17 +240,23 @@ private void Button_create_Click(object sender, EventArgs e)
UInt16 newIndex = (UInt16)(od.Index + o);
ODentry newObject = od.Clone();

String pattern = @"(\w*\d+\Z)";
string pattern = @"^(.*?)(\d+)$";

string[] words = Regex.Split(od.parameter_name, pattern);
// MatchCollection nummatches = System.Text.RegularExpressions.Regex.Matches(od.parameter_name, numpattern);
if (words.Length > 1)
Regex regex = new Regex(pattern);
Match match = regex.Match(od.parameter_name);

if (match.Success)
{
int nameidx = Int32.Parse(words[1]) + i++;
newObject.parameter_name = words[0] + nameidx;// nameidx.ToString ;
// Extract the string part and the number part
string stringPart = match.Groups[1].Value;
int numberPart = int.Parse(match.Groups[2].Value);

}
// Increment the number by 1
numberPart++;

// Reassemble the string with the incremented number
newObject.parameter_name = stringPart + numberPart.ToString();
}
newObject.Index = newIndex;

eds.ods.Add(newIndex, newObject);
Expand Down
16 changes: 8 additions & 8 deletions EDSEditorGUI2/EDSEditorGUI2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.1.5" />
<PackageReference Include="Avalonia.Desktop" Version="11.1.5" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.1.5" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.1.5" />
<PackageReference Include="Avalonia" Version="11.3.9" />
<PackageReference Include="Avalonia.Desktop" Version="11.3.9" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.9" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.9" />
<PackageReference Include="Avalonia.Controls.ItemsRepeater" Version="11.1.5" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.1.5" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.3.9" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.5" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
<PackageReference Include="DialogHost.Avalonia" Version="0.8.1" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.3.9" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="DialogHost.Avalonia" Version="0.10.0" />
<PackageReference Include="AutoMapper" Version="13.0.1" />
</ItemGroup>
</Project>
Loading
Loading