diff --git a/EDSEditorGUI2/Mapper/ProtobufferViewModelMapper.cs b/EDSEditorGUI2/Mapper/ProtobufferViewModelMapper.cs index 9fff16ce..33e56929 100644 --- a/EDSEditorGUI2/Mapper/ProtobufferViewModelMapper.cs +++ b/EDSEditorGUI2/Mapper/ProtobufferViewModelMapper.cs @@ -19,22 +19,58 @@ public static ViewModels.Device MapFromProtobuffer(CanOpenDevice source) .ForMember(dest => dest.CreatedBy, opt => opt.MapFrom(src => src.CreatedBy)) .ForMember(dest => dest.ModificationTime, opt => opt.MapFrom(src => src.ModificationTime)) .ForMember(dest => dest.ModifiedBy, opt => opt.MapFrom(src => src.ModifiedBy)); + cfg.CreateMap, ViewModels.ObjectDictionary>().ConvertUsing(); cfg.CreateMap() .ForMember(dest => dest.FileInfo, opt => opt.MapFrom(src => src.FileInfo)) .ForMember(dest => dest.DeviceInfo, opt => opt.MapFrom(src => src.DeviceInfo)) .ForMember(dest => dest.DeviceCommissioning, opt => opt.MapFrom(src => src.DeviceCommissioning)) - .ForPath(dest => dest.Objects.Data, opt => opt.MapFrom(src => src.Objects)); - + .ForMember(dest => dest.Objects, opt => opt.MapFrom(src => src.Objects)); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); - }); config.AssertConfigurationIsValid(); var mapper = config.CreateMapper(); var result = mapper.Map(source); return result; } + public class ODConverter : ITypeConverter, ViewModels.ObjectDictionary>, + ITypeConverter< ViewModels.ObjectDictionary, Google.Protobuf.Collections.MapField> + { + public ViewModels.ObjectDictionary Convert(Google.Protobuf.Collections.MapField source, ViewModels.ObjectDictionary destination, ResolutionContext context) + { + var config = new MapperConfiguration(cfg => + { + cfg.CreateMap(); + cfg.CreateMap(); + }); + config.AssertConfigurationIsValid(); + var mapper = config.CreateMapper(); + + destination = []; + foreach (var item in source) + { + destination.Add(item.Key, mapper.Map(item.Value)); + } + return destination; + } + public Google.Protobuf.Collections.MapField Convert(ViewModels.ObjectDictionary source, Google.Protobuf.Collections.MapField destination, ResolutionContext context) + { + var config = new MapperConfiguration(cfg => + { + cfg.CreateMap(); + cfg.CreateMap(); + }); + config.AssertConfigurationIsValid(); + var mapper = config.CreateMapper(); + + destination = []; + foreach (var item in source) + { + destination.Add(item.Key, mapper.Map(item.Value)); + } + return destination; + } + } public static CanOpenDevice MapToProtobuffer(ViewModels.Device source) { diff --git a/EDSEditorGUI2/ViewModels/Device.cs b/EDSEditorGUI2/ViewModels/Device.cs index 82868a44..c5f1ca85 100644 --- a/EDSEditorGUI2/ViewModels/Device.cs +++ b/EDSEditorGUI2/ViewModels/Device.cs @@ -18,7 +18,7 @@ public Device() private DeviceCommissioning _deviceCommissioning = new(); [ObservableProperty] - private DeviceOD _objects = new(); + private ObjectDictionary _objects = new(); public void OnClickCommand() { diff --git a/EDSEditorGUI2/ViewModels/DeviceOD.cs b/EDSEditorGUI2/ViewModels/DeviceOD.cs deleted file mode 100644 index 78684cad..00000000 --- a/EDSEditorGUI2/ViewModels/DeviceOD.cs +++ /dev/null @@ -1,91 +0,0 @@ -using CommunityToolkit.Mvvm.ComponentModel; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; - -namespace EDSEditorGUI2.ViewModels; -public partial class DeviceOD : ObservableObject -{ - public ObservableCollection> Data { get; } = []; - - [ObservableProperty] - KeyValuePair _selectedObject; - - [ObservableProperty] - KeyValuePair _selectedSubObject; - - [ObservableProperty] - ObservableCollection> _selectedSubObjects = []; - - public DeviceOD() - { - } - - private static int IndexStringToInt(string str) - { - if (str.StartsWith("0x")) - { - var hex = str[2..]; - return Convert.ToUInt16(hex, 16); - } - else - { - return Convert.ToUInt16(str); - } - } - - public void AddIndex(int index, string name, LibCanOpen.OdObject.Types.ObjectType type) - { - var strIndex = index.ToString("X4"); - var newObj = new OdObject - { - Name = name, - ObjectType = type - }; - - // create OD entry - if (type == LibCanOpen.OdObject.Types.ObjectType.Var) - { - var newSub = new OdSubObject() - { - Name = name, - Type = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, - Sdo = LibCanOpen.OdSubObject.Types.AccessSDO.Rw, - Pdo = LibCanOpen.OdSubObject.Types.AccessPDO.No, - Srdo = LibCanOpen.OdSubObject.Types.AccessSRDO.No, - DefaultValue = "0" - }; - newObj.SubObjects.Add(new KeyValuePair("0x0", newSub)); - } - else - { - var CountSub = new OdSubObject() - { - Name = "Highest sub-index supported", - Type = LibCanOpen.OdSubObject.Types.DataType.Unsigned8, - Sdo = LibCanOpen.OdSubObject.Types.AccessSDO.Ro, - Pdo = LibCanOpen.OdSubObject.Types.AccessPDO.No, - Srdo = LibCanOpen.OdSubObject.Types.AccessSRDO.No, - DefaultValue = "0x01" - }; - var Sub1 = new OdSubObject() - { - Name = "Sub Object 1", - Type = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, - Sdo = LibCanOpen.OdSubObject.Types.AccessSDO.Rw, - Pdo = LibCanOpen.OdSubObject.Types.AccessPDO.No, - Srdo = LibCanOpen.OdSubObject.Types.AccessSRDO.No, - DefaultValue = "0" - }; - - newObj.SubObjects.Add(new KeyValuePair("0x0", CountSub)); - newObj.SubObjects.Add(new KeyValuePair("0x1", Sub1)); - } - Data.Add(new KeyValuePair(strIndex, newObj)); - } - - public void RemoveIndex(object sender) - { - - } -} diff --git a/EDSEditorGUI2/ViewModels/ObjectDictionary.cs b/EDSEditorGUI2/ViewModels/ObjectDictionary.cs new file mode 100644 index 00000000..560af730 --- /dev/null +++ b/EDSEditorGUI2/ViewModels/ObjectDictionary.cs @@ -0,0 +1,334 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; + + +//based on https://raw.githubusercontent.com/Cysharp/ObservableCollections/refs/heads/master/src/ObservableCollections/ObservableDictionary.cs + +namespace EDSEditorGUI2.ViewModels; +public class ObjectDictionary : IDictionary, INotifyCollectionChanged, INotifyPropertyChanged +{ + #region ObservableDictionary + private IDictionary _Dictionary; + protected IDictionary Dictionary + { + get + { + return _Dictionary; + } + } + + public ObjectDictionary() + { + _Dictionary = new Dictionary(); + } + + public void Add(string key, OdObject value) + { + Insert(key, value, true); + } + + public bool ContainsKey(string key) + { + return Dictionary.ContainsKey(key); + } + + public ICollection Keys + { + get { return Dictionary.Keys; } + } + + public bool Remove(string key) + { + if (key == null) throw new ArgumentNullException(nameof(key)); + + var removed = Dictionary.Remove(key); + if (removed) + { OnCollectionChanged(); } + return removed; + } + + public bool TryGetValue(string key, out OdObject value) + { + return Dictionary.TryGetValue(key, out value); + } + + public ICollection Values + { + get { return Dictionary.Values; } + } + + public OdObject this[string key] + { + get + { + return Dictionary[key]; + } + set + { + Insert(key, value, false); + } + } + + public void Add(KeyValuePair item) + { + Insert(item.Key, item.Value, true); + } + + public void Clear() + { + if (Dictionary.Count > 0) + { + Dictionary.Clear(); + OnCollectionChanged(); + } + } + + public bool Contains(KeyValuePair item) + { + return Dictionary.Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int arrayIndex) + { + Dictionary.CopyTo(array, arrayIndex); + } + + public int Count + { + get { return Dictionary.Count; } + } + + public bool IsReadOnly + { + get { return Dictionary.IsReadOnly; } + } + + public bool Remove(KeyValuePair item) + { + return Remove(item.Key); + } + + public IEnumerator> GetEnumerator() + { + return Dictionary.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return ((IEnumerable)Dictionary).GetEnumerator(); + } + + public event NotifyCollectionChangedEventHandler? CollectionChanged; + + public event PropertyChangedEventHandler? PropertyChanged; + + public void AddRange(IDictionary items) + { + ArgumentNullException.ThrowIfNull(items); + + if (items.Count > 0) + { + if (Dictionary.Count > 0) + { + if (items.Keys.Any((k) => Dictionary.ContainsKey(k))) + { + throw new ArgumentException("An item with the same key has already been added."); + } + else + { + foreach (var item in items) + { + Dictionary.Add(item); + } + } + } + else + { + _Dictionary = new Dictionary(items); + } + OnCollectionChanged(NotifyCollectionChangedAction.Add, items.ToArray()); + } + } + + private void Insert(string key, OdObject value, bool add) + { + ArgumentNullException.ThrowIfNull(key); + + if (Dictionary.TryGetValue(key, out var item)) + { + if (add) + { + throw new ArgumentException("An item with the same key has already been added."); + } + if (Equals(item, value)) + { + return; + } + Dictionary[key] = value; + + OnCollectionChanged(NotifyCollectionChangedAction.Replace, new KeyValuePair(key, value), new KeyValuePair(key, item)); + } + else + { + Dictionary[key] = value; + OnCollectionChanged(NotifyCollectionChangedAction.Add, new KeyValuePair(key, value)); + } + } + + private void OnPropertyChanged() + { + OnPropertyChanged(nameof(Count)); + OnPropertyChanged("Item[]"); + OnPropertyChanged(nameof(Keys)); + OnPropertyChanged(nameof(Values)); + } + + protected virtual void OnPropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + private void OnCollectionChanged() + { + OnPropertyChanged(); + CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); + } + + private void OnCollectionChanged(NotifyCollectionChangedAction action, KeyValuePair changedItem) + { + OnPropertyChanged(); + CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(action, changedItem)); + } + + private void OnCollectionChanged(NotifyCollectionChangedAction action, KeyValuePair newItem, KeyValuePair oldItem) + { + OnPropertyChanged(); + CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(action, newItem, oldItem)); + } + + private void OnCollectionChanged(NotifyCollectionChangedAction action, IList newItems) + { + OnPropertyChanged(); + CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(action, newItems)); + } + #endregion ObservableDictionary + + KeyValuePair _selectedObject; + KeyValuePair _selectedSubObject; + ObservableCollection> _selectedSubObjects = []; + + public void AddIndex(int index, string name, LibCanOpen.OdObject.Types.ObjectType type) + { + var strIndex = index.ToString("X4"); + var newObj = new OdObject + { + Name = name, + ObjectType = type + }; + + // create OD entry + if (type == LibCanOpen.OdObject.Types.ObjectType.Var) + { + var newSub = new OdSubObject() + { + Name = name, + DataType = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, + Sdo = LibCanOpen.OdSubObject.Types.AccessSDO.Rw, + Pdo = LibCanOpen.OdSubObject.Types.AccessPDO.No, + Srdo = LibCanOpen.OdSubObject.Types.AccessSRDO.No, + DefaultValue = "0" + }; + newObj.SubObjects.Add(new KeyValuePair("0x0", newSub)); + } + else + { + var CountSub = new OdSubObject() + { + Name = "Highest sub-index supported", + DataType = LibCanOpen.OdSubObject.Types.DataType.Unsigned8, + Sdo = LibCanOpen.OdSubObject.Types.AccessSDO.Ro, + Pdo = LibCanOpen.OdSubObject.Types.AccessPDO.No, + Srdo = LibCanOpen.OdSubObject.Types.AccessSRDO.No, + DefaultValue = "0x01" + }; + var Sub1 = new OdSubObject() + { + Name = "Sub Object 1", + DataType = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, + Sdo = LibCanOpen.OdSubObject.Types.AccessSDO.Rw, + Pdo = LibCanOpen.OdSubObject.Types.AccessPDO.No, + Srdo = LibCanOpen.OdSubObject.Types.AccessSRDO.No, + DefaultValue = "0" + }; + + newObj.SubObjects.Add(new KeyValuePair("0x0", CountSub)); + newObj.SubObjects.Add(new KeyValuePair("0x1", Sub1)); + } + Add(new KeyValuePair(strIndex, newObj)); + } + + // This method is called by the Set accessor of each property. + // The CallerMemberName attribute that is applied to the optional propertyName + // parameter causes the property name of the caller to be substituted as an argument. + private void NotifyPropertyChanged([CallerMemberName] string propertyName = "") + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + public KeyValuePair SelectedObject + { + get + { + return _selectedObject; + } + + set + { + if (value.Key != _selectedObject.Key || value.Value != _selectedObject.Value) + { + this._selectedObject = value; + NotifyPropertyChanged(); + } + } + } + + public KeyValuePair SelectedSubObject + { + get + { + return _selectedSubObject; + } + + set + { + if (value.Key != _selectedSubObject.Key || value.Value != _selectedSubObject.Value) + { + _selectedSubObject = value; + NotifyPropertyChanged(); + } + } + } + + public ObservableCollection> SelectedSubObjects + { + get + { + return _selectedSubObjects; + } + + set + { + if (value != _selectedSubObjects) + { + _selectedSubObjects = value; + NotifyPropertyChanged(); + } + } + } +} diff --git a/EDSEditorGUI2/ViewModels/OdObject.cs b/EDSEditorGUI2/ViewModels/OdObject.cs index e27277bf..01c83e8a 100644 --- a/EDSEditorGUI2/ViewModels/OdObject.cs +++ b/EDSEditorGUI2/ViewModels/OdObject.cs @@ -52,7 +52,7 @@ public partial class OdObject : ObservableObject SubObjects.Add(new KeyValuePair("0", new OdSubObject { Name = "Highest sub-index supported", - Type = LibCanOpen.OdSubObject.Types.DataType.Unsigned8, + DataType = LibCanOpen.OdSubObject.Types.DataType.Unsigned8, Sdo = LibCanOpen.OdSubObject.Types.AccessSDO.Ro, Pdo = LibCanOpen.OdSubObject.Types.AccessPDO.No, Srdo = LibCanOpen.OdSubObject.Types.AccessSRDO.No, @@ -70,7 +70,7 @@ public partial class OdObject : ObservableObject newOd = new OdSubObject { Name = "item", - Type = LibCanOpen.OdSubObject.Types.DataType.Unsigned32 + DataType = LibCanOpen.OdSubObject.Types.DataType.Unsigned32 }; } else @@ -80,7 +80,7 @@ public partial class OdObject : ObservableObject //TODO: make a clone function with reflection to keep it up-to-date Name = selected.Value.Name, Alias = selected.Value.Alias, - Type = selected.Value.Type, + DataType = selected.Value.DataType, Sdo = selected.Value.Sdo, Pdo = selected.Value.Pdo, Srdo = selected.Value.Srdo, diff --git a/EDSEditorGUI2/ViewModels/OdSubObject.cs b/EDSEditorGUI2/ViewModels/OdSubObject.cs index 99d0b946..1256593c 100644 --- a/EDSEditorGUI2/ViewModels/OdSubObject.cs +++ b/EDSEditorGUI2/ViewModels/OdSubObject.cs @@ -12,7 +12,7 @@ public partial class OdSubObject : ObservableObject private string _alias = string.Empty; [ObservableProperty] - private DataType _type; + private DataType _dataType; [ObservableProperty] private AccessSDO _sdo; diff --git a/EDSEditorGUI2/Views/DeviceODView.axaml b/EDSEditorGUI2/Views/DeviceODView.axaml index 0b5453f1..e8a8ac54 100644 --- a/EDSEditorGUI2/Views/DeviceODView.axaml +++ b/EDSEditorGUI2/Views/DeviceODView.axaml @@ -8,7 +8,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="800" x:Class="EDSEditorGUI2.Views.DeviceODView" - x:DataType="vm:DeviceOD"> + x:DataType="vm:ObjectDictionary"> @@ -41,7 +41,7 @@ - + @@ -97,7 +97,7 @@ - + diff --git a/EDSEditorGUI2/Views/DeviceODView.axaml.cs b/EDSEditorGUI2/Views/DeviceODView.axaml.cs index 74cc6e93..491110cc 100644 --- a/EDSEditorGUI2/Views/DeviceODView.axaml.cs +++ b/EDSEditorGUI2/Views/DeviceODView.axaml.cs @@ -47,7 +47,7 @@ public DeviceODView() private void IndexGridSelectionChanged(object? sender, SelectionChangedEventArgs e) { - if (sender is DataGrid s && DataContext is ViewModels.DeviceOD dc) + if (sender is DataGrid s && DataContext is ViewModels.ObjectDictionary dc) { if (s.SelectedItem is KeyValuePair selected) { @@ -65,7 +65,7 @@ private void IndexGridSelectionChanged(object? sender, SelectionChangedEventArgs } private void subindexGridSelectionChanged(object? sender, SelectionChangedEventArgs e) { - if (sender is DataGrid s && DataContext is ViewModels.DeviceOD dc) + if (sender is DataGrid s && DataContext is ViewModels.ObjectDictionary dc) { if (s.SelectedItem is KeyValuePair selected) { @@ -83,7 +83,7 @@ private void subindexGridSelectionChanged(object? sender, SelectionChangedEventA } private void ContextMenuSubObjectAddClick(object? sender, RoutedEventArgs e) { - if (DataContext is ViewModels.DeviceOD dc) + if (DataContext is ViewModels.ObjectDictionary dc) { var selectedObj = dc.SelectedObject.Value; ObservableCollection> selection = []; @@ -98,7 +98,7 @@ private void ContextMenuSubObjectRemoveClick(object? sender, RoutedEventArgs e) { bool renumber = sender == contextMenu_subObject_removeSubItemToolStripMenuItem; - if (DataContext is ViewModels.DeviceOD dc) + if (DataContext is ViewModels.ObjectDictionary dc) { var selectedObject = dc.SelectedObject.Value; diff --git a/EDSEditorGUI2/Views/DevicePDOView.axaml b/EDSEditorGUI2/Views/DevicePDOView.axaml index 0fe71fc2..6a45cafe 100644 --- a/EDSEditorGUI2/Views/DevicePDOView.axaml +++ b/EDSEditorGUI2/Views/DevicePDOView.axaml @@ -7,7 +7,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="450" x:Class="EDSEditorGUI2.Views.DevicePDOView" - x:DataType="vm:DeviceOD"> + x:DataType="vm:ObjectDictionary"> diff --git a/EDSEditorGUI2/Views/ODIndexRangeView.axaml b/EDSEditorGUI2/Views/ODIndexRangeView.axaml index 08b0d548..fa1d4714 100644 --- a/EDSEditorGUI2/Views/ODIndexRangeView.axaml +++ b/EDSEditorGUI2/Views/ODIndexRangeView.axaml @@ -8,11 +8,11 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="EDSEditorGUI2.Views.ODIndexRangeView" - x:DataType="vm:DeviceOD"> + x:DataType="vm:ObjectDictionary"> - ("0", new OdSubObject { Name = "Highest sub-index supported", - Type = LibCanOpen.OdSubObject.Types.DataType.Unsigned8, + DataType = LibCanOpen.OdSubObject.Types.DataType.Unsigned8, Sdo = LibCanOpen.OdSubObject.Types.AccessSDO.Ro, Pdo = LibCanOpen.OdSubObject.Types.AccessPDO.No, Srdo = LibCanOpen.OdSubObject.Types.AccessSRDO.No, @@ -20,7 +20,7 @@ public ViewModels_OdObjects() sut.SubObjects.Add(new KeyValuePair("1", new OdSubObject() { Name = "Sub Object 1", - Type = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, + DataType = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, Sdo = LibCanOpen.OdSubObject.Types.AccessSDO.Rw, Pdo = LibCanOpen.OdSubObject.Types.AccessPDO.No, Srdo = LibCanOpen.OdSubObject.Types.AccessSRDO.No, @@ -29,7 +29,7 @@ public ViewModels_OdObjects() sut.SubObjects.Add(new KeyValuePair("2", new OdSubObject() { Name = "Sub Object 2", - Type = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, + DataType = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, Sdo = LibCanOpen.OdSubObject.Types.AccessSDO.Rw, Pdo = LibCanOpen.OdSubObject.Types.AccessPDO.No, Srdo = LibCanOpen.OdSubObject.Types.AccessSRDO.No, @@ -45,7 +45,7 @@ public void AddSubEntry_VarType() sut.SubObjects.Add(new KeyValuePair("0", new OdSubObject { Name = "variableTest", - Type = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, + DataType = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, Sdo = LibCanOpen.OdSubObject.Types.AccessSDO.Rw, Pdo = LibCanOpen.OdSubObject.Types.AccessPDO.No, Srdo = LibCanOpen.OdSubObject.Types.AccessSRDO.No, @@ -74,7 +74,7 @@ public void RemoveSubEntry_VarType(bool renumber) sut.SubObjects.Add(new KeyValuePair("0x01", new OdSubObject { Name = "variableTest", - Type = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, + DataType = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, Sdo = LibCanOpen.OdSubObject.Types.AccessSDO.Rw, Pdo = LibCanOpen.OdSubObject.Types.AccessPDO.No, Srdo = LibCanOpen.OdSubObject.Types.AccessSRDO.No, @@ -92,7 +92,7 @@ public void RemoveSubEntry_RecordType() sut.SubObjects.Add(new KeyValuePair("0x00", new OdSubObject { Name = "variableTest0", - Type = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, + DataType = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, Sdo = LibCanOpen.OdSubObject.Types.AccessSDO.Rw, Pdo = LibCanOpen.OdSubObject.Types.AccessPDO.No, Srdo = LibCanOpen.OdSubObject.Types.AccessSRDO.No, @@ -101,7 +101,7 @@ public void RemoveSubEntry_RecordType() sut.SubObjects.Add(new KeyValuePair("0x01", new OdSubObject { Name = "variableTest1", - Type = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, + DataType = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, Sdo = LibCanOpen.OdSubObject.Types.AccessSDO.Rw, Pdo = LibCanOpen.OdSubObject.Types.AccessPDO.No, Srdo = LibCanOpen.OdSubObject.Types.AccessSRDO.No, @@ -110,7 +110,7 @@ public void RemoveSubEntry_RecordType() sut.SubObjects.Add(new KeyValuePair("0x02", new OdSubObject { Name = "variableTest2", - Type = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, + DataType = LibCanOpen.OdSubObject.Types.DataType.Unsigned32, Sdo = LibCanOpen.OdSubObject.Types.AccessSDO.Rw, Pdo = LibCanOpen.OdSubObject.Types.AccessPDO.No, Srdo = LibCanOpen.OdSubObject.Types.AccessSRDO.No,