Skip to content

Commit 45e1d41

Browse files
author
Michael Menzi
committed
Handling EDS target when inserting a profile from the main menu bar.
1 parent 292d620 commit 45e1d41

1 file changed

Lines changed: 25 additions & 5 deletions

File tree

EDSEditorGUI/Form1.cs

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,32 @@ void ProfileAddClick(object sender, EventArgs e)
159159

160160
if (insObjForm.ShowDialog() == DialogResult.OK)
161161
{
162-
dv.eds.Dirty = true;
163-
dv.dispatch_updateOD();
164-
dv.dispatch_updatePDOinfo();
162+
EDSsharp modifiedEds = insObjForm.GetModifiedEDS();
163+
modifiedEds.Dirty = true;
165164

166-
dv.eds.UpdatePDOcount();
167-
dv.dispatch_updatedevice();
165+
if(modifiedEds == dv.eds)
166+
{
167+
dv.dispatch_updateOD();
168+
dv.dispatch_updatePDOinfo();
169+
170+
dv.eds.UpdatePDOcount();
171+
dv.dispatch_updatedevice();
172+
}
173+
else
174+
{
175+
foreach(TabPage page in tabControl1.TabPages)
176+
{
177+
DeviceView devView = (DeviceView)page.Controls[0];
178+
if(devView.eds == modifiedEds)
179+
{
180+
devView.dispatch_updateOD();
181+
devView.dispatch_updatePDOinfo();
182+
183+
devView.eds.UpdatePDOcount();
184+
devView.dispatch_updatedevice();
185+
}
186+
}
187+
}
168188
}
169189
}
170190
}

0 commit comments

Comments
 (0)