aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-08-22 14:21:23 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-08-22 14:21:23 +0300
commit10692d6af49f30f6a4eb5054945a6368dd181022 (patch)
tree9c68c1ba303aeed3be03f18ed01f72563bed644a /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views
parent24149160c17fabe143f143de2796f9485d64410b (diff)
downloadTango-10692d6af49f30f6a4eb5054945a6368dd181022.tar.gz
Tango-10692d6af49f30f6a4eb5054945a6368dd181022.zip
Refactored Machine Versions Module !!!!
Embedded sqlexaminer.msi to repo. Implemented precompiled views ? Fixed an issue with RemoteDB DAL. Added Active field to hardware components.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml74
1 files changed, 37 insertions, 37 deletions
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 86e0da5b5..8df9e465d 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
@@ -14,7 +14,7 @@
xmlns:observables="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
xmlns:global="clr-namespace:Tango.MachineStudio.HardwareDesigner"
mc:Ignorable="d"
- d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
+ d:DesignHeight="2000" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
<UserControl.Resources>
<converters:DoubleToIntConverter x:Key="DoubleToIntConverter" />
@@ -57,7 +57,7 @@
<TextBlock FontSize="30" FontStyle="Italic" VerticalAlignment="Center" Margin="50 10 10 0" Foreground="Silver" FontWeight="Bold">HARDWARE DESIGNER</TextBlock>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="10 10 0 0">
<materialDesign:PackIcon Kind="Pencil" Width="32" Height="32" Foreground="Silver" />
- <ComboBox ItemsSource="{Binding Adapter.HardwareVersions}" SelectedItem="{Binding SelectedVersion}" Width="300" FontSize="16" FontWeight="Bold" Margin="5 0 0 0" materialDesign:HintAssist.Hint="Hardware Version">
+ <ComboBox ItemsSource="{Binding HardwareVersions}" SelectedItem="{Binding SelectedVersion}" Width="300" FontSize="16" FontWeight="Bold" Margin="5 0 0 0" materialDesign:HintAssist.Hint="Hardware Version">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock><Run Text="{Binding Name}"></Run> <Run></Run> <Run Foreground="Gray" FontSize="14">v</Run><Run Foreground="Gray" FontSize="14" Text="{Binding Version}"></Run></TextBlock>
@@ -78,16 +78,16 @@
<Image VerticalAlignment="Center" Source="../Images/engine.png" Width="32"></Image>
<TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold">MOTORS</TextBlock>
</StackPanel>
- <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding MotorTypes}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObjectType}">
+ <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding CurrentVersion.HardwareMotors}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObject}">
<ListBox.ItemTemplate>
- <DataTemplate DataType="{x:Type entities:HardwareMotorType}">
+ <DataTemplate DataType="{x:Type entities:HardwareMotor}">
<DockPanel>
<Button DockPanel.Dock="Right" Cursor="Hand" Foreground="DimGray" Height="20" FontSize="10" ToolTip="Copy this item parameters to the selected item" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CopyParametersCommand}" CommandParameter="{Binding}">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
<Setter Property="Visibility" Value="Collapsed"></Setter>
<Style.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObjectType.Data.ObjectType.BaseType}" Value="{x:Type entities:HardwareMotorType}">
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObject.ObjectType.BaseType}" Value="{x:Type entities:HardwareMotor}">
<Setter Property="Visibility" Value="Visible"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
@@ -104,8 +104,8 @@
</Button.Content>
</Button>
<StackPanel Orientation="Horizontal">
- <CheckBox VerticalAlignment="Center" IsChecked="{Binding IsSelected}"></CheckBox>
- <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding Data.Description}"></TextBlock>
+ <CheckBox VerticalAlignment="Center" IsChecked="{Binding Active}"></CheckBox>
+ <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding HardwareMotorType.Description}"></TextBlock>
</StackPanel>
</DockPanel>
</DataTemplate>
@@ -116,16 +116,16 @@
<Image VerticalAlignment="Center" Source="../Images/compass.png" Width="32"></Image>
<TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold">DANCERS</TextBlock>
</StackPanel>
- <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding DancerTypes}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObjectType}">
+ <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding CurrentVersion.HardwareDancers}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObject}">
<ListBox.ItemTemplate>
- <DataTemplate DataType="{x:Type entities:HardwareDancerType}">
+ <DataTemplate DataType="{x:Type entities:HardwareDancer}">
<DockPanel>
<Button DockPanel.Dock="Right" Cursor="Hand" Foreground="DimGray" Height="20" FontSize="10" ToolTip="Copy this item parameters to the selected item" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CopyParametersCommand}" CommandParameter="{Binding}">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
<Setter Property="Visibility" Value="Collapsed"></Setter>
<Style.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObjectType.Data.ObjectType.BaseType}" Value="{x:Type entities:HardwareDancerType}">
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObject.ObjectType.BaseType}" Value="{x:Type entities:HardwareDancer}">
<Setter Property="Visibility" Value="Visible"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
@@ -142,8 +142,8 @@
</Button.Content>
</Button>
<StackPanel Orientation="Horizontal">
- <CheckBox VerticalAlignment="Center" IsChecked="{Binding IsSelected}"></CheckBox>
- <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding Data.Description}"></TextBlock>
+ <CheckBox VerticalAlignment="Center" IsChecked="{Binding Active}"></CheckBox>
+ <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding HardwareDancerType.Description}"></TextBlock>
</StackPanel>
</DockPanel>
</DataTemplate>
@@ -154,16 +154,16 @@
<Image VerticalAlignment="Center" Source="../Images/balance.png" Width="32"></Image>
<TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold">PID CONTROLS</TextBlock>
</StackPanel>
- <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding PidControlTypes}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObjectType}">
+ <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding CurrentVersion.HardwarePidControls}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObject}">
<ListBox.ItemTemplate>
- <DataTemplate DataType="{x:Type entities:HardwarePidControlType}">
+ <DataTemplate DataType="{x:Type entities:HardwarePidControl}">
<DockPanel>
<Button DockPanel.Dock="Right" Cursor="Hand" Foreground="DimGray" Height="20" FontSize="10" ToolTip="Copy this item parameters to the selected item" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CopyParametersCommand}" CommandParameter="{Binding}">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
<Setter Property="Visibility" Value="Collapsed"></Setter>
<Style.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObjectType.Data.ObjectType.BaseType}" Value="{x:Type entities:HardwarePidControlType}">
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObject.ObjectType.BaseType}" Value="{x:Type entities:HardwarePidControl}">
<Setter Property="Visibility" Value="Visible"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
@@ -180,8 +180,8 @@
</Button.Content>
</Button>
<StackPanel Orientation="Horizontal">
- <CheckBox VerticalAlignment="Center" IsChecked="{Binding IsSelected}"></CheckBox>
- <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding Data.Description}"></TextBlock>
+ <CheckBox VerticalAlignment="Center" IsChecked="{Binding Active}"></CheckBox>
+ <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding HardwarePidControlType.Description}"></TextBlock>
</StackPanel>
</DockPanel>
</DataTemplate>
@@ -192,16 +192,16 @@
<Image VerticalAlignment="Center" Source="../Images/thread.png" Width="32"></Image>
<TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold">WINDERS</TextBlock>
</StackPanel>
- <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding WinderTypes}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObjectType}">
+ <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding CurrentVersion.HardwareWinders}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObject}">
<ListBox.ItemTemplate>
- <DataTemplate DataType="{x:Type entities:HardwareWinderType}">
+ <DataTemplate DataType="{x:Type entities:HardwareWinder}">
<DockPanel>
<Button DockPanel.Dock="Right" Cursor="Hand" Foreground="DimGray" Height="20" FontSize="10" ToolTip="Copy this item parameters to the selected item" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CopyParametersCommand}" CommandParameter="{Binding}">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
<Setter Property="Visibility" Value="Collapsed"></Setter>
<Style.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObjectType.Data.ObjectType.BaseType}" Value="{x:Type entities:HardwareWinderType}">
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObject.ObjectType.BaseType}" Value="{x:Type entities:HardwareWinder}">
<Setter Property="Visibility" Value="Visible"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
@@ -218,8 +218,8 @@
</Button.Content>
</Button>
<StackPanel Orientation="Horizontal">
- <CheckBox VerticalAlignment="Center" IsChecked="{Binding IsSelected}"></CheckBox>
- <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding Data.Description}"></TextBlock>
+ <CheckBox VerticalAlignment="Center" IsChecked="{Binding Active}"></CheckBox>
+ <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding HardwareWinderType.Description}"></TextBlock>
</StackPanel>
</DockPanel>
</DataTemplate>
@@ -230,16 +230,16 @@
<Image VerticalAlignment="Center" Source="../Images/speed.png" Width="32"></Image>
<TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold">SPEED SENSORS</TextBlock>
</StackPanel>
- <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding SpeedSensorTypes}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObjectType}">
+ <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding CurrentVersion.HardwareSpeedSensors}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObject}">
<ListBox.ItemTemplate>
- <DataTemplate DataType="{x:Type entities:HardwareSpeedSensorType}">
+ <DataTemplate DataType="{x:Type entities:HardwareSpeedSensor}">
<DockPanel>
<Button DockPanel.Dock="Right" Cursor="Hand" Foreground="DimGray" Height="20" FontSize="10" ToolTip="Copy this item parameters to the selected item" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CopyParametersCommand}" CommandParameter="{Binding}">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
<Setter Property="Visibility" Value="Collapsed"></Setter>
<Style.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObjectType.Data.ObjectType.BaseType}" Value="{x:Type entities:HardwareSpeedSensorType}">
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObject.ObjectType.BaseType}" Value="{x:Type entities:HardwareSpeedSensor}">
<Setter Property="Visibility" Value="Visible"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
@@ -256,8 +256,8 @@
</Button.Content>
</Button>
<StackPanel Orientation="Horizontal">
- <CheckBox VerticalAlignment="Center" IsChecked="{Binding IsSelected}"></CheckBox>
- <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding Data.Description}"></TextBlock>
+ <CheckBox VerticalAlignment="Center" IsChecked="{Binding Active}"></CheckBox>
+ <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding HardwareSpeedSensorType.Description}"></TextBlock>
</StackPanel>
</DockPanel>
</DataTemplate>
@@ -268,16 +268,16 @@
<Image VerticalAlignment="Center" Source="../Images/blower.png" Width="32"></Image>
<TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold">BLOWERS</TextBlock>
</StackPanel>
- <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding BlowerTypes}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObjectType}">
+ <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding CurrentVersion.HardwareBlowers}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObject}">
<ListBox.ItemTemplate>
- <DataTemplate DataType="{x:Type entities:HardwareBlowerType}">
+ <DataTemplate DataType="{x:Type entities:HardwareBlower}">
<DockPanel>
<Button DockPanel.Dock="Right" Cursor="Hand" Foreground="DimGray" Height="20" FontSize="10" ToolTip="Copy this item parameters to the selected item" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CopyParametersCommand}" CommandParameter="{Binding}">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
<Setter Property="Visibility" Value="Collapsed"></Setter>
<Style.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObjectType.Data.ObjectType.BaseType}" Value="{x:Type entities:HardwareBlowerType}">
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObject.ObjectType.BaseType}" Value="{x:Type entities:HardwareBlower}">
<Setter Property="Visibility" Value="Visible"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
@@ -294,8 +294,8 @@
</Button.Content>
</Button>
<StackPanel Orientation="Horizontal">
- <CheckBox VerticalAlignment="Center" IsChecked="{Binding IsSelected}"></CheckBox>
- <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding Data.Description}"></TextBlock>
+ <CheckBox VerticalAlignment="Center" IsChecked="{Binding Active}"></CheckBox>
+ <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding HardwareBlowerType.Description}"></TextBlock>
</StackPanel>
</DockPanel>
</DataTemplate>
@@ -306,16 +306,16 @@
<Image VerticalAlignment="Center" Source="../Images/break.png" Width="32"></Image>
<TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold">BREAK SENSORS</TextBlock>
</StackPanel>
- <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding BreakSensorTypes}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObjectType}">
+ <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding CurrentVersion.HardwareBreakSensors}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObject}">
<ListBox.ItemTemplate>
- <DataTemplate DataType="{x:Type entities:HardwareBreakSensorType}">
+ <DataTemplate DataType="{x:Type entities:HardwareBreakSensor}">
<DockPanel>
<Button DockPanel.Dock="Right" Cursor="Hand" Foreground="DimGray" Height="20" FontSize="10" ToolTip="Copy this item parameters to the selected item" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CopyParametersCommand}" CommandParameter="{Binding}">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
<Setter Property="Visibility" Value="Collapsed"></Setter>
<Style.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObjectType.Data.ObjectType.BaseType}" Value="{x:Type entities:HardwareBreakSensorType}">
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObject.ObjectType.BaseType}" Value="{x:Type entities:HardwareBreakSensor}">
<Setter Property="Visibility" Value="Visible"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
@@ -332,8 +332,8 @@
</Button.Content>
</Button>
<StackPanel Orientation="Horizontal">
- <CheckBox VerticalAlignment="Center" IsChecked="{Binding IsSelected}"></CheckBox>
- <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding Data.Description}"></TextBlock>
+ <CheckBox VerticalAlignment="Center" IsChecked="{Binding Active}"></CheckBox>
+ <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding HardwareBreakSensorType.Description}"></TextBlock>
</StackPanel>
</DockPanel>
</DataTemplate>