diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-11-25 18:41:28 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-11-25 18:41:28 +0200 |
| commit | ab4d7232c388a10224a642fe210b30670f91e574 (patch) | |
| tree | 75b7349a23f5db0c682dcce2ba87a85a18409b42 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner | |
| parent | 80ed2914882d82dce0f60c09185da6a500f78d8b (diff) | |
| parent | 03180d26af65c24822cf5ffd44a347db7394d3b2 (diff) | |
| download | Tango-ab4d7232c388a10224a642fe210b30670f91e574.tar.gz Tango-ab4d7232c388a10224a642fe210b30670f91e574.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner')
2 files changed, 49 insertions, 2 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs index c46b1dec1..73ba02435 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs @@ -43,6 +43,46 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels { _selectedHardwareObject = value; RaisePropertyChangedAuto(); + RaisePropertyChanged(nameof(SelectedHardwareObjectTypeName)); + } + } + + public String SelectedHardwareObjectTypeName + { + get + { + String name = String.Empty; + + if (SelectedHardwareObject is HardwareMotor) + { + name = (SelectedHardwareObject as HardwareMotor).HardwareMotorType.Description; + } + else if (SelectedHardwareObject is HardwareDancer) + { + name = (SelectedHardwareObject as HardwareDancer).HardwareDancerType.Description; + } + else if (SelectedHardwareObject is HardwareBlower) + { + name = (SelectedHardwareObject as HardwareBlower).HardwareBlowerType.Description; + } + else if (SelectedHardwareObject is HardwareBreakSensor) + { + name = (SelectedHardwareObject as HardwareBreakSensor).HardwareBreakSensorType.Description; + } + else if (SelectedHardwareObject is HardwarePidControl) + { + name = (SelectedHardwareObject as HardwarePidControl).HardwarePidControlType.Description; + } + else if (SelectedHardwareObject is HardwareSpeedSensor) + { + name = (SelectedHardwareObject as HardwareSpeedSensor).HardwareSpeedSensorType.Description; + } + else if (SelectedHardwareObject is HardwareWinder) + { + name = (SelectedHardwareObject as HardwareWinder).HardwareWinderType.Description; + } + + return name; } } @@ -94,7 +134,9 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels (prop) => !prop.PropertyType.IsEnum && - !prop.Name.ToLower().Contains("guid")); + prop.Name.ToLower() != "guid" + && + prop.Name.ToLower() != "id"); } private void CreateDefaultView() diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml index 293b947f0..121e6e45c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml @@ -371,7 +371,12 @@ <materialDesign:Card Margin="5,10,5,0" Background="{DynamicResource MaterialDesignBackground}"> <StackPanel> <Grid> - <Expander HorizontalAlignment="Stretch" Header="Component Properties" IsExpanded="True"> + <Expander HorizontalAlignment="Stretch" IsExpanded="True"> + <Expander.Header> + <TextBlock FontSize="18" Foreground="#595959" FontWeight="Bold" FontStyle="Italic"> + <Run Text="{Binding SelectedHardwareObjectTypeName,Mode=OneWay}"></Run> + </TextBlock> + </Expander.Header> <StackPanel> <editors:ParameterizedEditor ParameterizedObject="{Binding SelectedHardwareObject}" Padding="10"> <editors:ParameterizedEditor.ItemsPanel> |
