diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/HardwareConfigurationViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/HardwareConfigurationViewVM.cs | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/HardwareConfigurationViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/HardwareConfigurationViewVM.cs index e29ba3b6f..f7ae88f68 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/HardwareConfigurationViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/HardwareConfigurationViewVM.cs @@ -92,19 +92,16 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { HardwareVersion hardwareVersion = configuration.HardwareVersion; - if (hardwareVersion != null) - { - _hwConfig = configuration.GetHardwareConfiguration(); + _hwConfig = configuration.GetHardwareConfiguration(); - Collections.Clear(); - Collections.Add(CreateMotorsCollection(hardwareVersion)); - Collections.Add(CreateDancerCollection(hardwareVersion)); - Collections.Add(CreatePidCollection(hardwareVersion)); - Collections.Add(CreateWindersCollection(hardwareVersion)); - Collections.Add(CreateSpeedSensorsCollection(hardwareVersion)); - Collections.Add(CreateBlowersCollection(hardwareVersion)); - Collections.Add(CreateBreakSensorCollection(hardwareVersion)); - } + Collections.Clear(); + Collections.Add(CreateMotorsCollection(hardwareVersion)); + Collections.Add(CreateDancerCollection(hardwareVersion)); + Collections.Add(CreatePidCollection(hardwareVersion)); + Collections.Add(CreateWindersCollection(hardwareVersion)); + Collections.Add(CreateSpeedSensorsCollection(hardwareVersion)); + Collections.Add(CreateBlowersCollection(hardwareVersion)); + Collections.Add(CreateBreakSensorCollection(hardwareVersion)); } private HardwareCollection CreateMotorsCollection(HardwareVersion hardwareVersion) @@ -127,7 +124,6 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels collection.Components.Add(componentResult); } } - collection.Components = collection.Components.OrderByAlphaNumeric(x => x.Description).ToSynchronizedObservableCollection(); return collection; } private HardwareCollection CreateDancerCollection(HardwareVersion hardwareVersion) @@ -150,7 +146,6 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels collection.Components.Add(componentResult); } } - collection.Components = collection.Components.OrderByAlphaNumeric(x => x.Description).ToSynchronizedObservableCollection(); return collection; } private HardwareCollection CreatePidCollection(HardwareVersion hardwareVersion) @@ -173,7 +168,6 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels collection.Components.Add(componentResult); } } - collection.Components = collection.Components.OrderByAlphaNumeric(x => x.Description).ToSynchronizedObservableCollection(); return collection; } private HardwareCollection CreateWindersCollection(HardwareVersion hardwareVersion) @@ -196,7 +190,6 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels collection.Components.Add(componentResult); } } - collection.Components = collection.Components.OrderByAlphaNumeric(x => x.Description).ToSynchronizedObservableCollection(); return collection; } private HardwareCollection CreateSpeedSensorsCollection(HardwareVersion hardwareVersion) @@ -219,7 +212,6 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels collection.Components.Add(componentResult); } } - collection.Components = collection.Components.OrderByAlphaNumeric(x => x.Description).ToSynchronizedObservableCollection(); return collection; } private HardwareCollection CreateBlowersCollection(HardwareVersion hardwareVersion) @@ -242,7 +234,6 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels collection.Components.Add(componentResult); } } - collection.Components= collection.Components.OrderByAlphaNumeric(x => x.Description).ToSynchronizedObservableCollection(); return collection; } private HardwareCollection CreateBreakSensorCollection(HardwareVersion hardwareVersion) @@ -265,7 +256,6 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels collection.Components.Add(componentResult); } } - collection.Components = collection.Components.OrderByAlphaNumeric(x => x.Description).ToSynchronizedObservableCollection(); return collection; } private HardwareComponent CreateComponent(String name, String description, List<PropertyInfo> properties, Object component) @@ -275,7 +265,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels Description = description, ComponentName = name }; - + foreach (var prop in properties) { var hProp = new HardwareParameter(); |
