diff options
Diffstat (limited to 'Software/Visual_Studio')
5 files changed, 181 insertions, 13 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index fae3fe3d8..25841cb94 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -730,26 +730,38 @@ <Image Source="../Images/Job Issues/job_length.png" Stretch="UniformToFill" VerticalAlignment="Top" HorizontalAlignment="Left" Width="32" Height="32"/> <TextBlock Margin="12 0 0 0 " VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoComboBoxItemFontSize}">Sensors</TextBlock> </StackPanel> - <UniformGrid Columns="5" Rows="1" Height="150"> + <UniformGrid Columns="5" Rows="1" Height="120" Margin="20 12 20 0"> + <StackPanel Orientation="Vertical"> <Grid> - <shapes:Arc Stroke="Red" StrokeThickness="10" StartAngle="40" EndAngle="320" Width="110" Height="110" OriginRotationDegrees="90" Direction="Clockwise"/> - <shapes:Arc Stroke="Green" StrokeThickness="10" StartAngle="40" EndAngle="140" Width="110" Height="110" OriginRotationDegrees="90" Direction="Clockwise"/> + <touch:TouchArcProgress Foreground="Green" RingThickness="10" Value="75" Maximum="100" Minimum="0" Width="100" Height="100"></touch:TouchArcProgress> + <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="Bold" Foreground="Green">10</TextBlock> + <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 10" FontSize="{StaticResource TangoComboBoxItemFontSize}" >Bar</TextBlock> + </Grid> + <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">Pressure</TextBlock> + </StackPanel> <Grid> - <shapes:Arc Stroke="Red" StrokeThickness="10" StartAngle="40" EndAngle="320" Width="110" Height="110" OriginRotationDegrees="90" Direction="Clockwise"/> - <shapes:Arc Stroke="Green" StrokeThickness="10" StartAngle="40" EndAngle="220" Width="110" Height="110" OriginRotationDegrees="90" Direction="Clockwise"/> + <touch:TouchArcProgress Foreground="Green" RingThickness="10" Value="75" Maximum="100" Minimum="0" Width="100" Height="100"></touch:TouchArcProgress> + <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" Foreground="Green">10</TextBlock> + <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 20" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" Text="ºC" ></TextBlock> </Grid> <Grid> - <shapes:Arc Stroke="Red" StrokeThickness="10" StartAngle="40" EndAngle="320" Width="110" Height="110" OriginRotationDegrees="90" Direction="Clockwise"/> - <shapes:Arc Stroke="Green" StrokeThickness="10" StartAngle="40" EndAngle="100" Width="110" Height="110" OriginRotationDegrees="90" Direction="Clockwise"/> + <touch:TouchArcProgress Foreground="Green" RingThickness="10" Value="75" Maximum="100" Minimum="0" Width="100" Height="100"></touch:TouchArcProgress> + <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" Foreground="Green">10</TextBlock> + <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 20" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" Text="ºC"></TextBlock> + </Grid> <Grid> - <shapes:Arc Stroke="Red" StrokeThickness="10" StartAngle="40" EndAngle="320" Width="110" Height="110" OriginRotationDegrees="90" Direction="Clockwise"/> - <shapes:Arc Stroke="Green" StrokeThickness="10" StartAngle="40" EndAngle="260" Width="110" Height="110" OriginRotationDegrees="90" Direction="Clockwise"/> + <touch:TouchArcProgress Foreground="red" RingThickness="10" Value="75" Maximum="100" Minimum="0" Width="100" Height="100"></touch:TouchArcProgress> + <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" Foreground="Green">75</TextBlock> + <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 20" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" Text="ºC"></TextBlock> + </Grid> <Grid> - <shapes:Arc Stroke="Red" StrokeThickness="10" StartAngle="40" EndAngle="320" Width="110" Height="110" OriginRotationDegrees="90" Direction="Clockwise"/> - <shapes:Arc Stroke="Green" StrokeThickness="10" StartAngle="40" EndAngle="300" Width="110" Height="110" OriginRotationDegrees="90" Direction="Clockwise"/> + <touch:TouchArcProgress Foreground="red" RingThickness="10" Value="75" Maximum="100" Minimum="0" Width="100" Height="100"></touch:TouchArcProgress> + <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" Foreground="Red">200</TextBlock> + <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 20" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" Text="ºC"></TextBlock> + </Grid> </UniformGrid> <Grid > @@ -759,6 +771,7 @@ </StackPanel> </Grid> <Grid Grid.Row="2" x:Name="IncLevels" Margin="0 20 0 0"> + <StackPanel Orientation="Vertical"> <DockPanel> <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" > <Image Source="../Images/Job Issues/job_length.png" Stretch="UniformToFill" VerticalAlignment="Top" HorizontalAlignment="Left" Width="32" Height="32"/> @@ -769,7 +782,30 @@ <TextBlock Margin="12 0 0 0 " VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoComboBoxItemFontSize}">Ink Levels</TextBlock> </StackPanel> </DockPanel> - + <UniformGrid Columns="12" Rows="1" Margin="0 20 0 0"> + <Border Height="88" Width="32" CornerRadius="16" BorderThickness="2" BorderBrush="RosyBrown"> + <Grid> + <Canvas Width="30" > + <Rectangle Canvas.Top="30" Fill="Cyan" Height="88" Width="32" > + <Rectangle.Clip> + <RectangleGeometry RadiusX="1" RadiusY="15" > + <RectangleGeometry.Rect> + <Rect Width="30" Height="20"></Rect> + </RectangleGeometry.Rect> + </RectangleGeometry> + </Rectangle.Clip> + </Rectangle> + </Canvas> + <UniformGrid Rows="4" Columns="1" Margin="1 15 1 15"> + <Rectangle Width="10" Height="2" Fill="Black"></Rectangle> + <Rectangle Width="10" Height="2" Fill="Black"></Rectangle> + <Rectangle Width="10" Height="2" Fill="Black"></Rectangle> + <Rectangle Width="10" Height="2" Fill="Black"></Rectangle> + </UniformGrid> + </Grid> + </Border> + </UniformGrid> + </StackPanel> </Grid> </Grid> </Grid> diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchArcProgress.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchArcProgress.cs new file mode 100644 index 000000000..510fd500d --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchArcProgress.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; + +namespace Tango.Touch.Controls +{ + public class TouchArcProgress : ProgressBar + { + private SharedUI.Shapes.Arc _arc; + private SharedUI.Shapes.Arc _arc_base; + + public double RingThickness + { + get { return (double)GetValue(RingThicknessProperty); } + set { SetValue(RingThicknessProperty, value); } + } + public static readonly DependencyProperty RingThicknessProperty = + DependencyProperty.Register("RingThickness", typeof(double), typeof(TouchArcProgress), new PropertyMetadata(3.0)); + + + + public int MinArcAngle + { + get { return (int)GetValue(MinArcAngleProperty); } + set { SetValue(MinArcAngleProperty, value); } + } + + // Using a DependencyProperty as the backing store for MinArcAngle. This enables animation, styling, binding, etc... + public static readonly DependencyProperty MinArcAngleProperty = + DependencyProperty.Register("MinArcAngle", typeof(int), typeof(TouchArcProgress), new PropertyMetadata(40)); + + + + public int MaxArcAngle + { + get { return (int)GetValue(MaxArcAngleProperty); } + set { SetValue(MaxArcAngleProperty, value); } + } + + // Using a DependencyProperty as the backing store for MaxArcAngle. This enables animation, styling, binding, etc... + public static readonly DependencyProperty MaxArcAngleProperty = + DependencyProperty.Register("MaxArcAngle", typeof(int), typeof(TouchArcProgress), new PropertyMetadata(320)); + + + + static TouchArcProgress() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchArcProgress), new FrameworkPropertyMetadata(typeof(TouchArcProgress))); + } + + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + _arc = GetTemplateChild("PART_ArcValue") as SharedUI.Shapes.Arc; + _arc_base = GetTemplateChild("PART_ArcBase") as SharedUI.Shapes.Arc; + SetArcBase(); + SetArc(); + } + + protected override void OnValueChanged(double oldValue, double newValue) + { + base.OnValueChanged(oldValue, newValue); + SetArc(); + } + + protected override void OnMinimumChanged(double oldMinimum, double newMinimum) + { + base.OnMinimumChanged(oldMinimum, newMinimum); + SetArcBase(); + SetArc(); + } + + protected override void OnMaximumChanged(double oldMaximum, double newMaximum) + { + base.OnMaximumChanged(oldMaximum, newMaximum); + SetArcBase(); + SetArc(); + } + + private void SetArcBase() + { + if (_arc_base != null) + { + _arc_base.StartAngle = ((MaxArcAngle - MinArcAngle) * (Minimum / (Maximum - Minimum))) + MinArcAngle; + _arc_base.EndAngle = ((MaxArcAngle - MinArcAngle) * (Maximum / (Maximum - Minimum))) + MinArcAngle; + } + } + + private void SetArc() + { + if (_arc != null) + { + _arc.StartAngle = ((MaxArcAngle - MinArcAngle) * (Minimum / (Maximum - Minimum))) + MinArcAngle; + _arc.EndAngle = ((MaxArcAngle - MinArcAngle) * (Value / (Maximum - Minimum))) + MinArcAngle; + } + } + } +} diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchArcProgress.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchArcProgress.xaml new file mode 100644 index 000000000..518b3632c --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchArcProgress.xaml @@ -0,0 +1,24 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI" + xmlns:local="clr-namespace:Tango.Touch.Controls"> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="../Resources/Colors.xaml" /> + </ResourceDictionary.MergedDictionaries> + + <Style TargetType="{x:Type local:TouchArcProgress}"> + <Setter Property="Background" Value="{StaticResource TangoDividerBrush}"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type local:TouchArcProgress}"> + <Grid> + <shapes:Arc x:Name="PART_ArcBase" Stroke="{TemplateBinding Background}" StrokeThickness="{TemplateBinding RingThickness}" OriginRotationDegrees="90" Direction="Clockwise"/> + <shapes:Arc x:Name="PART_ArcValue" Stroke="{TemplateBinding Foreground}" StrokeThickness="{TemplateBinding RingThickness}" OriginRotationDegrees="90" Direction="Clockwise"/> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj index 2e2370584..1096ec112 100644 --- a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj +++ b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj @@ -67,6 +67,7 @@ <Compile Include="Controls\FocusSelectionMode.cs" /> <Compile Include="Controls\IValueControl.cs" /> <Compile Include="Controls\MessageBoxVM.cs" /> + <Compile Include="Controls\TouchArcProgress.cs" /> <Compile Include="Controls\TouchAutoComplete.cs" /> <Compile Include="Controls\TouchCalendar.cs" /> <Compile Include="Controls\TouchCheckBox.cs" /> @@ -132,6 +133,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Controls\TouchArcProgress.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Controls\TouchAutoComplete.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -497,7 +502,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml index a623203cf..8b49ccc6b 100644 --- a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml +++ b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml @@ -39,6 +39,7 @@ <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchSlider.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchStaticListBox.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchRingProgress.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchArcProgress.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchNativeListBox.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchGifAnimation.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchFlatListBox.xaml" /> |
