aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2019-12-11 15:35:18 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2019-12-11 15:35:18 +0200
commitf8fc1e8e52e9758c23607b5e9e2dd1c379a37117 (patch)
treef905bcb8bd1ff42182cc3c4f8c1f163ad5b628c1 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner
parent31ece903df45b0ab8ffb61fdd290d9fbea2a6836 (diff)
downloadTango-f8fc1e8e52e9758c23607b5e9e2dd1c379a37117.tar.gz
Tango-f8fc1e8e52e9758c23607b5e9e2dd1c379a37117.zip
Implement alphanumeric sorting on hw comparison and hw configuration in MachineStudio.
Related Work Items: #1619
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/HardwareConfigurationViewVM.cs10
1 files changed, 9 insertions, 1 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 f7ae88f68..42984a82d 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
@@ -124,6 +124,7 @@ 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)
@@ -146,6 +147,7 @@ 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)
@@ -168,6 +170,7 @@ 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)
@@ -190,6 +193,7 @@ 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)
@@ -212,6 +216,7 @@ 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)
@@ -234,6 +239,7 @@ 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)
@@ -256,6 +262,7 @@ 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)
@@ -265,7 +272,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
Description = description,
ComponentName = name
};
-
+
foreach (var prop in properties)
{
var hProp = new HardwareParameter();
@@ -279,6 +286,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
hProp.ActualValue = configParam != null ? configParam.Value : null;
hwComponent.Properties.Add(hProp);
}
+ hwComponent.Properties = hwComponent.Properties.OrderByAlphaNumeric(x => x.PropertyName).ToSynchronizedObservableCollection();
return hwComponent;
}