@@ -0,0 +1,28 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Globalization; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using System.Windows.Data; | |||||
using System.Windows.Media; | |||||
namespace BPASmartClient.CustomResource.Converters | |||||
{ | |||||
public class BoolToFillColorConverter : IValueConverter | |||||
{ | |||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | |||||
{ | |||||
if (value != null && value is bool tempBool) | |||||
{ | |||||
return tempBool ? Brushes.Green : Brushes.Gray; | |||||
} | |||||
return Brushes.Gray; | |||||
} | |||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | |||||
{ | |||||
throw new NotImplementedException(); | |||||
} | |||||
} | |||||
} |
@@ -27,6 +27,7 @@ | |||||
<con:StringToIconConverter x:Key="StringToIconConverter" /> | <con:StringToIconConverter x:Key="StringToIconConverter" /> | ||||
<con:BoolToVisibilityConvert x:Key="BoolToVisibilityConvert" /> | <con:BoolToVisibilityConvert x:Key="BoolToVisibilityConvert" /> | ||||
<con:CountIsVisiableConvert x:Key="CountIsVisiableConvert" /> | <con:CountIsVisiableConvert x:Key="CountIsVisiableConvert" /> | ||||
<con:BoolToFillColorConverter x:Key="BoolToFillColorConverter" /> | |||||
</ResourceDictionary> | </ResourceDictionary> | ||||
<ResourceDictionary> | <ResourceDictionary> | ||||
@@ -52,6 +52,13 @@ namespace BPASmartClient.DosingSystem | |||||
public bool IsFault { get { return _mIsFault; } set { _mIsFault = value; OnPropertyChanged(); } } | public bool IsFault { get { return _mIsFault; } set { _mIsFault = value; OnPropertyChanged(); } } | ||||
private bool _mIsFault; | private bool _mIsFault; | ||||
/// <summary> | |||||
/// 桶到位检测 | |||||
/// </summary> | |||||
public bool BucketFlagbit { get { return _mBucketFlagbit; } set { _mBucketFlagbit = value; OnPropertyChanged(); } } | |||||
private bool _mBucketFlagbit; | |||||
} | } | ||||
@@ -97,28 +97,40 @@ | |||||
</StackPanel> | </StackPanel> | ||||
<StackPanel Grid.Row="2" Orientation="Horizontal"> | |||||
<StackPanel> | |||||
<ToggleButton | |||||
Width="80" | |||||
<Grid Grid.Row="2"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
</Grid.ColumnDefinitions> | |||||
<StackPanel Background="Transparent"> | |||||
<Ellipse | |||||
Width="30" | |||||
Height="30" | Height="30" | ||||
Margin="5,0,5,0" | |||||
HorizontalAlignment="Center" | HorizontalAlignment="Center" | ||||
VerticalAlignment="Center" | VerticalAlignment="Center" | ||||
Background="Transparent" | |||||
FontSize="20" | |||||
IsChecked="{Binding IsOpen}" | |||||
Style="{StaticResource SwitchToggleButtonStyle}" /> | |||||
Fill="{Binding BucketFlagbit, Converter={StaticResource BoolToFillColorConverter}}" | |||||
RenderTransformOrigin="0.5,0.5"> | |||||
<Ellipse.OpacityMask> | |||||
<RadialGradientBrush> | |||||
<GradientStop Offset="0" Color="Transparent" /> | |||||
<GradientStop Offset="1" Color="#00c2f4" /> | |||||
</RadialGradientBrush> | |||||
</Ellipse.OpacityMask> | |||||
<Ellipse.RenderTransform> | |||||
<ScaleTransform x:Name="Scale" /> | |||||
</Ellipse.RenderTransform> | |||||
</Ellipse> | |||||
<TextBlock | <TextBlock | ||||
Margin="0,5,0,0" | Margin="0,5,0,0" | ||||
HorizontalAlignment="Center" | HorizontalAlignment="Center" | ||||
FontSize="16" | FontSize="16" | ||||
Foreground="#00c2f4" | Foreground="#00c2f4" | ||||
Text="仓盖控制" /> | |||||
Text="到位检测" /> | |||||
</StackPanel> | </StackPanel> | ||||
<StackPanel> | |||||
<StackPanel Grid.Column="1"> | |||||
<ToggleButton | <ToggleButton | ||||
Width="80" | Width="80" | ||||
Height="30" | Height="30" | ||||
@@ -137,7 +149,7 @@ | |||||
Text="出料控制" /> | Text="出料控制" /> | ||||
</StackPanel> | </StackPanel> | ||||
</StackPanel> | |||||
</Grid> | |||||
<Image | <Image | ||||
Margin="20,30,20,0" | Margin="20,30,20,0" | ||||
@@ -311,23 +323,31 @@ | |||||
</StackPanel> | </StackPanel> | ||||
<StackPanel Grid.Row="2" Orientation="Horizontal"> | <StackPanel Grid.Row="2" Orientation="Horizontal"> | ||||
<StackPanel> | |||||
<ToggleButton | |||||
Width="80" | |||||
<StackPanel Background="Transparent"> | |||||
<Ellipse | |||||
Width="30" | |||||
Height="30" | Height="30" | ||||
Margin="5,0,5,0" | |||||
HorizontalAlignment="Center" | HorizontalAlignment="Center" | ||||
VerticalAlignment="Center" | VerticalAlignment="Center" | ||||
Background="Transparent" | |||||
FontSize="20" | |||||
IsChecked="{Binding IsOpen}" | |||||
Style="{StaticResource SwitchToggleButtonStyle}" /> | |||||
Fill="{Binding BucketFlagbit, Converter={StaticResource BoolToFillColorConverter}}" | |||||
RenderTransformOrigin="0.5,0.5"> | |||||
<Ellipse.OpacityMask> | |||||
<RadialGradientBrush> | |||||
<GradientStop Offset="0" Color="Transparent" /> | |||||
<GradientStop Offset="1" Color="#00c2f4" /> | |||||
</RadialGradientBrush> | |||||
</Ellipse.OpacityMask> | |||||
<Ellipse.RenderTransform> | |||||
<ScaleTransform x:Name="Scale" /> | |||||
</Ellipse.RenderTransform> | |||||
</Ellipse> | |||||
<TextBlock | <TextBlock | ||||
Margin="0,5,0,0" | Margin="0,5,0,0" | ||||
HorizontalAlignment="Center" | HorizontalAlignment="Center" | ||||
FontSize="16" | FontSize="16" | ||||
Foreground="#00c2f4" | Foreground="#00c2f4" | ||||
Text="仓盖控制" /> | |||||
Text="到位检测" /> | |||||
</StackPanel> | </StackPanel> | ||||
@@ -52,7 +52,7 @@ | |||||
<UserControl.DataContext> | <UserControl.DataContext> | ||||
<vm:ManualControlViewModel /> | <vm:ManualControlViewModel /> | ||||
</UserControl.DataContext> | </UserControl.DataContext> | ||||
<ScrollViewer VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Disabled"> | |||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden"> | |||||
<StackPanel Margin="8"> | <StackPanel Margin="8"> | ||||
<!--#region 升降气缸--> | <!--#region 升降气缸--> | ||||
@@ -91,7 +91,7 @@ | |||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"> | ScrollViewer.HorizontalScrollBarVisibility="Disabled"> | ||||
<ListView.ItemsPanel> | <ListView.ItemsPanel> | ||||
<ItemsPanelTemplate> | <ItemsPanelTemplate> | ||||
<WrapPanel ScrollViewer.HorizontalScrollBarVisibility="Disabled" Orientation="Horizontal" /> | |||||
<WrapPanel Orientation="Horizontal" ScrollViewer.HorizontalScrollBarVisibility="Disabled" /> | |||||
</ItemsPanelTemplate> | </ItemsPanelTemplate> | ||||
</ListView.ItemsPanel> | </ListView.ItemsPanel> | ||||