diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-25 14:12:56 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-25 14:12:56 +0200 |
| commit | dc11398ba5728af943256ca99eba8c9d66e1b6e2 (patch) | |
| tree | 5ff3d0f64f2361d254511810258d7824eeab98d3 /Software/Visual_Studio/MachineStudio/Modules | |
| parent | d36a5ab7115ec53405622e4437cd3f8f615d515d (diff) | |
| download | Tango-dc11398ba5728af943256ca99eba8c9d66e1b6e2.tar.gz Tango-dc11398ba5728af943256ca99eba8c9d66e1b6e2.zip | |
Refactored ObservableEntity:
Observables comparison is now done by GUID.
Implemented != == Equals overrides.
Save and load are now done only on decorated properties so properties on partial class are allowed!
Implemented dynamic graph sizes on developer module.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
5 files changed, 178 insertions, 96 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs index a3d3e2486..ae4fa8a07 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs @@ -140,7 +140,7 @@ namespace Tango.MachineStudio.DB.ViewModels base.OnValidating(); ValidationErrors.Clear(); - foreach (var prop in typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => !x.PropertyType.IsGenericType && x.PropertyType.IsClass && !x.Name.Contains("Guid"))) + foreach (var prop in typeof(T).GetPropertiesWithAttribute<EntityFieldNameAttribute>(BindingFlags.Public | BindingFlags.Instance).Where(x => !x.PropertyType.IsGenericType && x.PropertyType.IsClass && !x.Name.Contains("Guid"))) { if (prop.GetValue(EditEntity) == null) { @@ -298,13 +298,13 @@ namespace Tango.MachineStudio.DB.ViewModels private bool FilterEntity(T entity, String filter) { - foreach (var prop in entity.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsClass && x.PropertyType != typeof(String) && x.PropertyType != typeof(byte[]) && !x.PropertyType.IsGenericType)) + foreach (var prop in entity.GetType().GetPropertiesWithAttribute<EntityFieldNameAttribute>(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsClass && x.PropertyType != typeof(String) && x.PropertyType != typeof(byte[]) && !x.PropertyType.IsGenericType)) { object obj = prop.GetValue(entity); if (obj != null) { - foreach (var innerProp in obj.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.Name != "Deleted" && x.Name != "ID" && x.Name != "LastUpdated").Where(x => !x.PropertyType.IsGenericType && (x.PropertyType.IsClass || x.PropertyType == typeof(String)))) + foreach (var innerProp in obj.GetType().GetPropertiesWithAttribute<EntityFieldNameAttribute>(BindingFlags.Public | BindingFlags.Instance).Where(x => x.Name != "Deleted" && x.Name != "ID" && x.Name != "LastUpdated").Where(x => !x.PropertyType.IsGenericType && (x.PropertyType.IsClass || x.PropertyType == typeof(String)))) { object value = innerProp.GetValue(obj); @@ -322,7 +322,7 @@ namespace Tango.MachineStudio.DB.ViewModels return entity. GetType(). - GetProperties(BindingFlags.Public | BindingFlags.Instance). + GetPropertiesWithAttribute<EntityFieldNameAttribute>(BindingFlags.Public | BindingFlags.Instance). Where(x => x.Name != "Deleted" && x.Name != "ID" && x.Name != "LastUpdated"). Where(x => !x.PropertyType.IsGenericType && (x.PropertyType.IsClass || x.PropertyType == typeof(String))). Select(prop => prop.GetValue(entity).ToString()). diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/video-frame.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/video-frame.png Binary files differnew file mode 100644 index 000000000..a052b62cf --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/video-frame.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj index 276dd6c54..970556986 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj @@ -185,5 +185,8 @@ <ItemGroup> <Resource Include="Images\camera.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\video-frame.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index dc3ba0ec5..0742ca752 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -239,13 +239,8 @@ namespace Tango.MachineStudio.Developer.ViewModels { using (_notification.PushTaskItem("Saving Liquid Factors...")) { - String machineGuid = SelectedMachine.Guid; - String rmlGuid = SelectedRML.Guid; - await SelectedRML.SaveAsync(); - - SelectedMachine = Adapter.Machines.SingleOrDefault(x => x.Guid == machineGuid); - SelectedRML = Adapter.Rmls.SingleOrDefault(x => x.Guid == rmlGuid); + InvalidateLiquidFactorsAndProcessTables(); } } } @@ -298,14 +293,16 @@ namespace Tango.MachineStudio.Developer.ViewModels g.Active = false; } - String machineGuid = SelectedMachine.Guid; - String rmlGuid = SelectedRML.Guid; + //String machineGuid = SelectedMachine.Guid; + //String rmlGuid = SelectedRML.Guid; SelectedRML.ProcessParametersTablesGroups.Add(group); await SelectedRML.SaveAsync(); - SelectedMachine = Adapter.Machines.SingleOrDefault(x => x.Guid == machineGuid); - SelectedRML = Adapter.Rmls.SingleOrDefault(x => x.Guid == rmlGuid); + //SelectedMachine = Adapter.Machines.SingleOrDefault(x => x.Guid == machineGuid); + //SelectedRML = Adapter.Rmls.SingleOrDefault(x => x.Guid == rmlGuid); + + InvalidateLiquidFactorsAndProcessTables(); } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index 40babfc74..a18e4145e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -28,6 +28,8 @@ <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> <localConverters:DbRmlViewToEntityConverter x:Key="DbRmlViewToEntityConverter"></localConverters:DbRmlViewToEntityConverter> <converters:NullObjectToBooleanConverter x:Key="NullObjectToBooleanConverter"></converters:NullObjectToBooleanConverter> + <converters:GreaterThanToBooleanConverter x:Key="GreaterThanToBooleanConverter"></converters:GreaterThanToBooleanConverter> + <converters:SmallerThanToBooleanConverter x:Key="SmallerThanToBooleanConverter"></converters:SmallerThanToBooleanConverter> <SolidColorBrush x:Key="SideBarBackground" Color="#F9F9F9"> @@ -77,6 +79,24 @@ <Setter Property="dragAndDrop:DragAndDropService.Draggable" Value="True"></Setter> <Setter Property="dragAndDrop:DragAndDropService.DraggingSurface" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"></Setter> </Style> + + <Style TargetType="Border" x:Key="JobFieldBorder"> + <Setter Property="BorderBrush" Value="{StaticResource SideBarBackground}"></Setter> + <Setter Property="BorderThickness" Value="1"></Setter> + <Setter Property="CornerRadius" Value="10"></Setter> + <Setter Property="Padding" Value="10 5"></Setter> + <Setter Property="Margin" Value="0 0 10 0"></Setter> + <Setter Property="Background"> + <Setter.Value> + <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5"> + <GradientStop Color="#FFE4E4E4"/> + <GradientStop Offset="0.2"/> + <GradientStop Offset="0.5"/> + <GradientStop Color="#FFEEEEEE" Offset="1"/> + </LinearGradientBrush> + </Setter.Value> + </Setter> + </Style> </UserControl.Resources> <Grid> @@ -171,127 +191,149 @@ <WrapPanel.Resources> <Style TargetType="TextBlock" BasedOn="{StaticResource {x:Type TextBlock}}"> <Setter Property="FontSize" Value="10"></Setter> - <Setter Property="Foreground" Value="Gray"></Setter> + <Setter Property="Foreground" Value="#7A7A7A"></Setter> <Setter Property="Margin" Value="0 5 0 5"></Setter> <Setter Property="MinWidth" Value="80"></Setter> </Style> - <Style TargetType="Border"> - <Setter Property="BorderBrush" Value="Gainsboro"></Setter> - <Setter Property="BorderThickness" Value="1"></Setter> - <Setter Property="Padding" Value="2"></Setter> - <Setter Property="Margin" Value="5"></Setter> - <Setter Property="CornerRadius" Value="3"></Setter> + <Style TargetType="mahapps:NumericUpDown"> + <Setter Property="FontFamily" Value="digital-7"></Setter> + </Style> + + <Style TargetType="ContentControl"> + <Setter Property="FontFamily" Value="digital-7"></Setter> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="ContentControl"> + <Grid> + <Border> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="BorderBrush" Value="Gainsboro"></Setter> + <Setter Property="BorderThickness" Value="1"></Setter> + <Setter Property="Padding" Value="2"></Setter> + <Setter Property="Margin" Value="5"></Setter> + <Setter Property="CornerRadius" Value="3"></Setter> + </Style> + </Border.Style> + <ContentPresenter Content="{TemplateBinding Content}"></ContentPresenter> + </Border> + + <materialDesign:PackIcon HorizontalAlignment="Left" VerticalAlignment="Top" Margin="-2 -2 0 0" Width="12" Height="12" Kind="Settings"></materialDesign:PackIcon> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> </Style> </WrapPanel.Resources> - <Border> + <ContentControl> <StackPanel> <TextBlock>Dyeing Speed:</TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding DyeingSpeed,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> - </Border> + </ContentControl> - <Border> + <ContentControl> <StackPanel> <TextBlock>Min Ink Uptake:</TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding MinInkUptake,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> - </Border> + </ContentControl> - <Border> + <ContentControl> <StackPanel> <TextBlock>Mixer Temp:</TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding MixerTemp,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> - </Border> + </ContentControl> - <Border> + <ContentControl> <StackPanel> <TextBlock>Head Zone1 Temp:</TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding HeadZone1Temp,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> - </Border> + </ContentControl> - <Border> + <ContentControl> <StackPanel> <TextBlock>Head Zone2 Temp:</TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding HeadZone2Temp,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> - </Border> + </ContentControl> - <Border> + <ContentControl> <StackPanel> <TextBlock>Head Zone3 Temp:</TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding HeadZone3Temp,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> - </Border> + </ContentControl> - <Border> + <ContentControl> <StackPanel> <TextBlock>Head Air Flow:</TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding HeadAirFlow,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> - </Border> + </ContentControl> - <Border> + <ContentControl> <StackPanel> <TextBlock>Feeder Tension:</TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding FeederTension,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> - </Border> + </ContentControl> - <Border> + <ContentControl> <StackPanel> <TextBlock>Puller Tension:</TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding PullerTension,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> - </Border> + </ContentControl> - <Border> + <ContentControl> <StackPanel> <TextBlock>Dryer Buffer Length:</TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding DryerBufferLength,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> - </Border> + </ContentControl> - <Border> + <ContentControl> <StackPanel> <TextBlock>Dryer Zone1 Temp:</TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding DryerZone1Temp,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> - </Border> + </ContentControl> - <Border> + <ContentControl> <StackPanel> <TextBlock>Dryer Zone2 Temp:</TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding DryerZone2Temp,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> - </Border> + </ContentControl> - <Border> + <ContentControl> <StackPanel> <TextBlock>Dryer Zone3 Temp:</TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding DryerZone3Temp,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> - </Border> + </ContentControl> - <Border> + <ContentControl> <StackPanel> <TextBlock>Dryer Air Flow:</TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding DryerAirFlow,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> - </Border> + </ContentControl> - <Border> + <ContentControl> <StackPanel> <TextBlock>Winder Tension:</TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding WinderTension,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> - </Border> + </ContentControl> </WrapPanel> </DockPanel> </Border> @@ -351,7 +393,7 @@ <StackPanel DockPanel.Dock="Top" > <StackPanel Orientation="Horizontal"> <Image Source="../Images/machine-trans.png" RenderOptions.BitmapScalingMode="Fant" Width="70"></Image> - <TextBlock VerticalAlignment="Top" FontWeight="SemiBold" Margin="10 10 0 0" FontSize="14">MACHINE JOBS</TextBlock> + <TextBlock VerticalAlignment="Center" FontWeight="SemiBold" Margin="10 0 0 0" FontSize="30">MACHINE JOBS</TextBlock> </StackPanel> <Rectangle VerticalAlignment="Bottom" StrokeDashArray="7" StrokeThickness="1" Stroke="Silver" Margin="0 8 0 0"></Rectangle> @@ -397,43 +439,50 @@ </Grid> <StackPanel Orientation="Horizontal" Margin="0 20 0 0" MaxWidth="800" HorizontalAlignment="Left"> - <StackPanel Margin="5" Width="140"> - <StackPanel Orientation="Horizontal"> - <Image Source="../Images/name.png" Width="32"></Image> - <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Name</TextBlock> + <Border Style="{StaticResource JobFieldBorder}"> + <StackPanel Margin="5" Width="140"> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/name.png" Width="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Name</TextBlock> + </StackPanel> + <TextBox Margin="0 3 0 0" Text="{Binding SelectedJob.Name,UpdateSourceTrigger=PropertyChanged}"></TextBox> </StackPanel> - <TextBox Margin="0 3 0 0" Text="{Binding SelectedJob.Name,UpdateSourceTrigger=PropertyChanged}" materialDesign:HintAssist.Hint="Name"></TextBox> - </StackPanel> + </Border> - <StackPanel Margin="20 5 5 5" Width="140"> - <StackPanel Orientation="Horizontal"> - <Image Source="../Images/wind.png" Width="32"></Image> - <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Winding Method</TextBlock> + <Border Style="{StaticResource JobFieldBorder}"> + <StackPanel Margin="10 5 5 5" Width="140"> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/wind.png" Width="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Winding Method</TextBlock> + </StackPanel> + <ComboBox ItemsSource="{Binding Adapter.WindingMethods}" SelectedItem="{Binding SelectedJob.WindingMethods}" DisplayMemberPath="Name" ></ComboBox> </StackPanel> - <ComboBox ItemsSource="{Binding Adapter.WindingMethods}" SelectedItem="{Binding SelectedJob.WindingMethods}" DisplayMemberPath="Name" materialDesign:HintAssist.Hint="Winding Method"></ComboBox> - </StackPanel> + </Border> - <StackPanel Margin="20 5 5 5" Width="140"> - <StackPanel Orientation="Horizontal"> - <Image Source="../Images/inter-segment.png" Width="32"></Image> - <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Inter Segment</TextBlock> + <Border Style="{StaticResource JobFieldBorder}"> + <StackPanel Margin="20 5 5 5" Width="140"> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/inter-segment.png" Width="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Inter Segment</TextBlock> + </StackPanel> + <DockPanel LastChildFill="True"> + <ToggleButton Margin="10 0 0 0" DockPanel.Dock="Right" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsChecked="{Binding SelectedJob.EnableInterSegment}"></ToggleButton> + <mahapps:NumericUpDown IsEnabled="{Binding SelectedJob.EnableInterSegment}" Margin="0 2 0 0" HideUpDownButtons="True" Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedJob.InterSegmentLength,Mode=TwoWay}"></mahapps:NumericUpDown> + </DockPanel> </StackPanel> - <DockPanel LastChildFill="True"> - <ToggleButton DockPanel.Dock="Right" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsChecked="{Binding SelectedJob.EnableInterSegment}"></ToggleButton> - <mahapps:NumericUpDown IsEnabled="{Binding SelectedJob.EnableInterSegment}" Margin="0 2 0 0" HideUpDownButtons="True" Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedJob.InterSegmentLength,Mode=TwoWay}"></mahapps:NumericUpDown> - </DockPanel> - </StackPanel> + </Border> - <StackPanel Margin="20 5 5 5" Width="140"> - <StackPanel Orientation="Horizontal"> - <Image Source="../Images/lubrication.png" Width="32"></Image> - <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Lubrication</TextBlock> + <Border Style="{StaticResource JobFieldBorder}"> + <StackPanel Margin="20 5 5 5" Width="140"> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/lubrication.png" Width="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Lubrication</TextBlock> + </StackPanel> + <DockPanel LastChildFill="True" Margin="0 10 0 0"> + <ToggleButton DockPanel.Dock="Right" VerticalAlignment="Center" HorizontalAlignment="Center" IsChecked="{Binding SelectedJob.EnableLubrication}"></ToggleButton> + </DockPanel> </StackPanel> - <DockPanel LastChildFill="True" Margin="0 10 0 0"> - <ToggleButton DockPanel.Dock="Right" VerticalAlignment="Center" HorizontalAlignment="Right" IsChecked="{Binding SelectedJob.EnableLubrication}"></ToggleButton> - <TextBlock HorizontalAlignment="Left">Enable</TextBlock> - </DockPanel> - </StackPanel> + </Border> </StackPanel> @@ -484,36 +533,36 @@ <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">USB CAMERAS</TextBlock> </StackPanel> <UniformGrid Rows="3"> - <Border BorderBrush="Gray" BorderThickness="1" Margin="0 0 0 5" CornerRadius="5"> + <Border RenderOptions.BitmapScalingMode="Fant"> <Border.Background> - <ImageBrush ImageSource="../Images/no-signal.jpg" Stretch="Fill"></ImageBrush> + <ImageBrush ImageSource="../Images/video-frame.png" Stretch="Fill"></ImageBrush> </Border.Background> <Grid> - <Label Style="{StaticResource graphLabel}"> - <TextBlock VerticalAlignment="Center" FontSize="10" Margin="0 0 30 0">CAMERA 1</TextBlock> + <Label Margin="22 17 0 0" Style="{StaticResource graphLabel}"> + <TextBlock FontFamily="digital-7" VerticalAlignment="Center" FontSize="10" Margin="0 0 30 0">CAMERA 1</TextBlock> </Label> </Grid> </Border> - <Border BorderBrush="Gray" BorderThickness="1" Margin="0 0 0 5" CornerRadius="5"> + <Border RenderOptions.BitmapScalingMode="Fant"> <Border.Background> - <ImageBrush ImageSource="../Images/no-signal.jpg" Stretch="Fill"></ImageBrush> + <ImageBrush ImageSource="../Images/video-frame.png" Stretch="Fill"></ImageBrush> </Border.Background> <Grid> - <Label Style="{StaticResource graphLabel}"> - <TextBlock VerticalAlignment="Center" FontSize="10" Margin="0 0 30 0">CAMERA 2</TextBlock> + <Label Margin="22 17 0 0" Style="{StaticResource graphLabel}"> + <TextBlock FontFamily="digital-7" VerticalAlignment="Center" FontSize="10" Margin="0 0 30 0">CAMERA 2</TextBlock> </Label> </Grid> </Border> - <Border BorderBrush="Gray" BorderThickness="1" Margin="0 0 0 5" CornerRadius="5"> + <Border RenderOptions.BitmapScalingMode="Fant"> <Border.Background> - <ImageBrush ImageSource="../Images/no-signal.jpg" Stretch="Fill"></ImageBrush> + <ImageBrush ImageSource="../Images/video-frame.png" Stretch="Fill"></ImageBrush> </Border.Background> <Grid> - <Label Style="{StaticResource graphLabel}"> - <TextBlock VerticalAlignment="Center" FontSize="10" Margin="0 0 30 0">CAMERA 3</TextBlock> + <Label Margin="22 17 0 0" Style="{StaticResource graphLabel}"> + <TextBlock FontFamily="digital-7" VerticalAlignment="Center" FontSize="10" Margin="0 0 30 0">CAMERA 3</TextBlock> </Label> </Grid> </Border> @@ -569,7 +618,40 @@ <ItemsControl ItemsSource="{Binding Graphs}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> - <UniformGrid Columns="4" Rows="2" IsItemsHost="True"></UniformGrid> + <UniformGrid IsItemsHost="True"> + <UniformGrid.Style> + <Style TargetType="UniformGrid"> + <Setter Property="Columns" Value="1"></Setter> + <Setter Property="Rows" Value="1"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Graphs.Count,Converter={StaticResource SmallerThanToBooleanConverter},ConverterParameter=3}" Value="True"> + <Setter Property="Columns" Value="{Binding Graphs.Count}"></Setter> + <Setter Property="Rows" Value="1"></Setter> + </DataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding Graphs.Count,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=2}" Value="True"></Condition> + <Condition Binding="{Binding Graphs.Count,Converter={StaticResource SmallerThanToBooleanConverter},ConverterParameter=5}" Value="True"></Condition> + </MultiDataTrigger.Conditions> + <Setter Property="Columns" Value="2"></Setter> + <Setter Property="Rows" Value="2"></Setter> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding Graphs.Count,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=4}" Value="True"></Condition> + <Condition Binding="{Binding Graphs.Count,Converter={StaticResource SmallerThanToBooleanConverter},ConverterParameter=7}" Value="True"></Condition> + </MultiDataTrigger.Conditions> + <Setter Property="Columns" Value="3"></Setter> + <Setter Property="Rows" Value="2"></Setter> + </MultiDataTrigger> + <DataTrigger Binding="{Binding Graphs.Count,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=6}" Value="True"> + <Setter Property="Columns" Value="4"></Setter> + <Setter Property="Rows" Value="2"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </UniformGrid.Style> + </UniformGrid> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> </ItemsControl> @@ -766,7 +848,7 @@ <Button Background="{StaticResource SideBarBackground}" Command="{Binding ToggleSideBarCommand}" Padding="0" Style="{StaticResource MaterialDesignFlatButton}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalAlignment="Right" VerticalAlignment="Center" Height="200" Width="50" Margin="0 0 -50 0"> <Border CornerRadius="0 10 10 0" BorderThickness="0 1 1 1" BorderBrush="#C6C0C0"> <Grid> - <TextBlock Text="CONFIGURATION" FontSize="16" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" HorizontalAlignment="Center"> + <TextBlock Foreground="#FF7272" Text="CONFIGURATION" FontSize="16" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" HorizontalAlignment="Center"> <TextBlock.LayoutTransform> <RotateTransform Angle="270"></RotateTransform> </TextBlock.LayoutTransform> |
