Quellcode durchsuchen

手动控制调整

master
pry vor 2 Jahren
Ursprung
Commit
1d249a46c2
5 geänderte Dateien mit 80 neuen und 24 gelöschten Zeilen
  1. +28
    -0
      BPASmartClient.CustomResource/Converters/BoolToFillColorConverter.cs
  2. +1
    -0
      DosingSystem/App.xaml
  3. +7
    -0
      DosingSystem/Model/DeviceCurrentStatus.cs
  4. +42
    -22
      DosingSystem/View/HardwareStatusView.xaml
  5. +2
    -2
      DosingSystem/View/ManualControlView.xaml

+ 28
- 0
BPASmartClient.CustomResource/Converters/BoolToFillColorConverter.cs Datei anzeigen

@@ -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();
}
}
}

+ 1
- 0
DosingSystem/App.xaml Datei anzeigen

@@ -27,6 +27,7 @@
<con:StringToIconConverter x:Key="StringToIconConverter" />
<con:BoolToVisibilityConvert x:Key="BoolToVisibilityConvert" />
<con:CountIsVisiableConvert x:Key="CountIsVisiableConvert" />
<con:BoolToFillColorConverter x:Key="BoolToFillColorConverter" />
</ResourceDictionary>

<ResourceDictionary>


+ 7
- 0
DosingSystem/Model/DeviceCurrentStatus.cs Datei anzeigen

@@ -52,6 +52,13 @@ namespace BPASmartClient.DosingSystem
public bool IsFault { get { return _mIsFault; } set { _mIsFault = value; OnPropertyChanged(); } }
private bool _mIsFault;

/// <summary>
/// 桶到位检测
/// </summary>
public bool BucketFlagbit { get { return _mBucketFlagbit; } set { _mBucketFlagbit = value; OnPropertyChanged(); } }
private bool _mBucketFlagbit;




}


+ 42
- 22
DosingSystem/View/HardwareStatusView.xaml Datei anzeigen

@@ -97,28 +97,40 @@

</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"
Margin="5,0,5,0"
HorizontalAlignment="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
Margin="0,5,0,0"
HorizontalAlignment="Center"
FontSize="16"
Foreground="#00c2f4"
Text="仓盖控制" />
Text="到位检测" />
</StackPanel>


<StackPanel>
<StackPanel Grid.Column="1">
<ToggleButton
Width="80"
Height="30"
@@ -137,7 +149,7 @@
Text="出料控制" />
</StackPanel>

</StackPanel>
</Grid>

<Image
Margin="20,30,20,0"
@@ -311,23 +323,31 @@
</StackPanel>

<StackPanel Grid.Row="2" Orientation="Horizontal">
<StackPanel>
<ToggleButton
Width="80"
<StackPanel Background="Transparent">
<Ellipse
Width="30"
Height="30"
Margin="5,0,5,0"
HorizontalAlignment="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
Margin="0,5,0,0"
HorizontalAlignment="Center"
FontSize="16"
Foreground="#00c2f4"
Text="仓盖控制" />
Text="到位检测" />
</StackPanel>




+ 2
- 2
DosingSystem/View/ManualControlView.xaml Datei anzeigen

@@ -52,7 +52,7 @@
<UserControl.DataContext>
<vm:ManualControlViewModel />
</UserControl.DataContext>
<ScrollViewer VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Disabled">
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden">
<StackPanel Margin="8">

<!--#region 升降气缸-->
@@ -91,7 +91,7 @@
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel ScrollViewer.HorizontalScrollBarVisibility="Disabled" Orientation="Horizontal" />
<WrapPanel Orientation="Horizontal" ScrollViewer.HorizontalScrollBarVisibility="Disabled" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>



Laden…
Abbrechen
Speichern