Browse Source

更新agv 界面

样式分支
fyf 2 years ago
parent
commit
eaf72529e2
6 changed files with 192 additions and 18 deletions
  1. +2
    -0
      BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
  2. BIN
     
  3. +13
    -0
      BPASmartClient.CustomResource/Themes/MyStyle.xaml
  4. +88
    -18
      FryPot_DosingSystem/View/AgvView.xaml
  5. +24
    -0
      FryPot_DosingSystem/View/AgvView.xaml.cs
  6. +65
    -0
      FryPot_DosingSystem/ViewModel/AgvViewModel.cs

+ 2
- 0
BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj View File

@@ -30,6 +30,7 @@
<None Remove="Image\AGV\墙.png" />
<None Remove="Image\AGV\汤碗.png" />
<None Remove="Image\AGV\炒锅.png" />
<None Remove="Image\AGV\炒锅2.png" />
<None Remove="Image\AGV\物流车.png" />
<None Remove="Image\AGV\砖块.png" />
<None Remove="Image\AGV\蔬菜.png" />
@@ -234,6 +235,7 @@
<Resource Include="Image\AGV\墙.png" />
<Resource Include="Image\AGV\汤碗.png" />
<Resource Include="Image\AGV\炒锅.png" />
<Resource Include="Image\AGV\炒锅2.png" />
<Resource Include="Image\AGV\物流车.png" />
<Resource Include="Image\AGV\砖块.png" />
<Resource Include="Image\AGV\蔬菜.png" />


BIN
View File


+ 13
- 0
BPASmartClient.CustomResource/Themes/MyStyle.xaml View File

@@ -456,6 +456,19 @@
</Style.Setters>
</Style>

<Style x:Key="border炒锅2" TargetType="Border">
<Style.Setters>
<Setter Property="Height" Value="100"/>
<Setter Property="Width" Value="100"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/AGV/炒锅2.png" />
</Setter.Value>
</Setter>
</Style.Setters>
</Style>

<Style x:Key="border碗" TargetType="Border">
<Style.Setters>
<Setter Property="Height" Value="80"/>


+ 88
- 18
FryPot_DosingSystem/View/AgvView.xaml View File

@@ -1158,6 +1158,71 @@
</Setter.Value>
</Setter>
</Style>

<Style x:Key="炒锅" BasedOn="{x:Null}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#FF1F4D69"/>
<Setter Property="Text" Value="Start"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<ControlTemplate.Resources>
<Storyboard RepeatBehavior="Forever" x:Key="csd_dh1">
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
<EasingDoubleKeyFrame KeyTime="00:00:0.5" Value="90"/>
<EasingDoubleKeyFrame KeyTime="00:00:1" Value="180"/>
<EasingDoubleKeyFrame KeyTime="00:00:1.5" Value="270"/>
<EasingDoubleKeyFrame KeyTime="00:00:2" Value="360"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>

</ControlTemplate.Resources>
<Grid Width="100" Height="100">
<Border Style="{DynamicResource border炒锅2}">
<Border x:Name="cai" VerticalAlignment="Top" Width="30" Height="25" Margin="0,10,0,0" Style="{DynamicResource border菜}">
</Border>
</Border>
<Ellipse x:Name="ellipse" StrokeThickness="5" Width="50" Height="50" RenderTransformOrigin="0.5,0.5" Margin="5,-3,0,0" VerticalAlignment="Top">
<Ellipse.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform AngleY="-0"/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Ellipse.RenderTransform>
<Ellipse.Stroke>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#CCA48E42"/>
<GradientStop Color="#CC2D48DA" Offset="1"/>
<GradientStop Color="#FF3FD256" Offset="0.305"/>
<GradientStop Color="#FFB12C87" Offset="0.67"/>
</LinearGradientBrush>
</Ellipse.Stroke>
</Ellipse>

</Grid>
<ControlTemplate.Triggers>
<Trigger Property="Text" Value="Start">
<Setter TargetName="ellipse" Property="Visibility" Value="Visible" />
<Setter TargetName="cai" Property="Visibility" Value="Visible" />
<Trigger.EnterActions>
<BeginStoryboard x:Name="begin_name" Storyboard="{StaticResource csd_dh1}"/>
</Trigger.EnterActions>
</Trigger>
<Trigger Property="Text" Value="Stop">
<Trigger.EnterActions>
<StopStoryboard BeginStoryboardName="begin_name"/>
</Trigger.EnterActions>
<Setter TargetName="ellipse" Property="Visibility" Value="Collapsed" />
<Setter TargetName="cai" Property="Visibility" Value="Collapsed" />
</Trigger>

</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
@@ -1202,11 +1267,16 @@
<TextBox x:Name="xiaochewuping_text" Margin="5">1</TextBox>
<Button Margin="5" Click="Button_Click" Tag="有菜和碗" Cursor="Hand">有菜和碗</Button>
<Button Margin="5" Click="Button_Click" Tag="只有碗" Cursor="Hand">只有碗</Button>

<Button Margin="5" Click="Button_Click" Tag="无物品" Cursor="Hand">无物品</Button>


</StackPanel>
<StackPanel>
<TextBlock Margin="5">滚筒炒锅</TextBlock>
<TextBox x:Name="guntongchaoguo_text" Margin="5">1</TextBox>
<Button Margin="5" Click="Button_Click" Tag="启动炒锅" Cursor="Hand">启动炒锅</Button>
<Button Margin="5" Click="Button_Click" Tag="停止炒锅" Cursor="Hand">停止炒锅</Button>
</StackPanel>

</StackPanel>
</Grid>

@@ -1319,22 +1389,26 @@
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Style="{DynamicResource border炒锅}" HorizontalAlignment="Left">
<Grid Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="45,0,0,20">
<TextBox Style="{StaticResource 炒锅}" Text="{Binding wokModel_1.Text,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBox>
<TextBlock Style="{DynamicResource 80号字体样式}" FontSize="16" Width="18" Margin="-10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">炒锅(1)号</TextBlock>
</Border>
<Border Style="{DynamicResource border炒锅}" Grid.Column="1" HorizontalAlignment="Left">
</Grid>
<Grid Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="45,0,0,20">
<TextBox Style="{StaticResource 炒锅}" Text="{Binding wokModel_2.Text,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBox>
<TextBlock Style="{DynamicResource 80号字体样式}" FontSize="16" Width="18" Margin="-10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">炒锅(2)号</TextBlock>
</Border>
<Border Style="{DynamicResource border炒锅}" Grid.Column="2" HorizontalAlignment="Left">
</Grid>
<Grid Grid.Column="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="45,0,0,20">
<TextBox Style="{StaticResource 炒锅}" Text="{Binding wokModel_3.Text,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBox>
<TextBlock Style="{DynamicResource 80号字体样式}" FontSize="16" Width="18" Margin="-10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">炒锅(3)号</TextBlock>
</Border>
<Border Style="{DynamicResource border炒锅}" Grid.Column="3" HorizontalAlignment="Left">
</Grid>
<Grid Grid.Column="3" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="45,0,0,20">
<TextBox Style="{StaticResource 炒锅}" Text="{Binding wokModel_4.Text,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBox>
<TextBlock Style="{DynamicResource 80号字体样式}" FontSize="16" Width="18" Margin="-10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">炒锅(4)号</TextBlock>
</Border>
<Border Style="{DynamicResource border炒锅}" Grid.Column="4" HorizontalAlignment="Left">
</Grid>
<Grid Grid.Column="4" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="45,0,0,20">
<TextBox Style="{StaticResource 炒锅}" Text="{Binding wokModel_5.Text,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBox>
<TextBlock Style="{DynamicResource 80号字体样式}" FontSize="16" Width="18" Margin="-10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">炒锅(5)号</TextBlock>
</Border>

</Grid>
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="0">
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10"/>
<StackPanel>
@@ -1361,7 +1435,6 @@
</ListBox>
</StackPanel>
</Grid>

<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="1">
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10"/>
<StackPanel>
@@ -1388,7 +1461,6 @@
</ListBox>
</StackPanel>
</Grid>

<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="2">
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10"/>
<StackPanel>
@@ -1415,7 +1487,6 @@
</ListBox>
</StackPanel>
</Grid>

<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="3">
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10"/>
<StackPanel>
@@ -1442,7 +1513,6 @@
</ListBox>
</StackPanel>
</Grid>

<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="4">
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10"/>
<StackPanel>


+ 24
- 0
FryPot_DosingSystem/View/AgvView.xaml.cs View File

@@ -163,6 +163,30 @@ namespace FryPot_DosingSystem.View
}
AgvViewModel.GetInstance().Set小车是否承载物品(id, IsBool.No);
break;
case "启动炒锅":
try
{
id = int.Parse(guntongchaoguo_text.Text.ToString());
}
catch (Exception ex)
{
MessageBox.Show("只能输入 1-4 的数字!");
return;
}
AgvViewModel.GetInstance().Set启动或停止炒锅(id, IsRun.Start);
break;
case "停止炒锅":
try
{
id = int.Parse(guntongchaoguo_text.Text.ToString());
}
catch (Exception ex)
{
MessageBox.Show("只能输入 1-4 的数字!");
return;
}
AgvViewModel.GetInstance().Set启动或停止炒锅(id, IsRun.Stop);
break;

}
}


+ 65
- 0
FryPot_DosingSystem/ViewModel/AgvViewModel.cs View File

@@ -300,6 +300,40 @@ namespace FryPot_DosingSystem.ViewModel

}
}
/// <summary>
/// 启动或停止炒锅
/// </summary>
/// <param name="id">默认:1 2 3 4 5,代表五个炒锅</param>
/// <param name="mode"></param>
public void Set启动或停止炒锅(int id, IsRun mode)
{
try
{
switch (id)
{
case 1:
wokModel_1.isRun= mode;
break;
case 2:
wokModel_2.isRun = mode;
break;
case 3:
wokModel_3.isRun = mode;
break;
case 4:
wokModel_4.isRun = mode;
break;
case 5:
wokModel_5.isRun = mode;
break;
}

}
catch (Exception ex)
{

}
}
#endregion

#region 其他函数
@@ -932,6 +966,37 @@ namespace FryPot_DosingSystem.ViewModel
OnPropertyChanged("other");
}
}
/// <summary>
/// 是否运行
/// </summary>
private IsRun _isRun = IsRun.Stop;
public IsRun isRun
{
get
{
return _isRun;
}
set
{
_isRun = value;
Text = _isRun.ToString();
OnPropertyChanged("isBool");
}
}
private string _Text = IsRun.Stop.ToString();
public string Text
{
get
{
return _Text;
}
set
{
_Text = value;
OnPropertyChanged("Text");
}
}

/// <summary>
/// 工作流程
/// </summary>


Loading…
Cancel
Save