aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/HardwareConfigurationViewVM.cs
diff options
context:
space:
mode:
authorMirta <mirta@twine-s.com>2020-12-30 16:39:52 +0200
committerMirta <mirta@twine-s.com>2020-12-30 16:39:52 +0200
commit00a491d93733d4625ad329b2ba8237f445364b3f (patch)
tree4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/HardwareConfigurationViewVM.cs
parent124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff)
downloadTango-00a491d9.tar.gz
Tango-00a491d9.zip
merge
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.cs30
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();