aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/HardwareConfigurationViewVM.cs
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-12-30 13:01:58 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-12-30 13:01:58 +0200
commit624d19b9b7e540e16f605dce4e1c82af60372099 (patch)
tree07889b00717d3a30bb0281ed0233543fabfc9aaf /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/HardwareConfigurationViewVM.cs
parentc4aa1735efed2c87e5056dde442211c08d3f66ff (diff)
parent7c56f0ff6a9ceb7148b6cab01bbac5ddf592acb2 (diff)
downloadTango-624d19b9b7e540e16f605dce4e1c82af60372099.tar.gz
Tango-624d19b9b7e540e16f605dce4e1c82af60372099.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();