Browse Source

保存

煮面机(新)
lyw 5 months ago
parent
commit
7cf4a5a69b
14 changed files with 589 additions and 19 deletions
  1. +52
    -6
      BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs
  2. +0
    -1
      BPASmartClient.MorkSUpgradedVer/GVL_MorkSUpgradedVer.cs
  3. +78
    -0
      BPASmartClient.ViewModel/DeviceCtrlViewModel.cs
  4. +46
    -3
      BPASmartClient.ViewModel/NoodOrderCtrl.cs
  5. +78
    -1
      BPASmartClient/App.xaml
  6. +2
    -0
      BPASmartClient/App.xaml.cs
  7. +3
    -0
      BPASmartClient/BPASmartClient.csproj
  8. +213
    -0
      BPASmartClient/Control/DeviceCtrlView.xaml
  9. +78
    -0
      BPASmartClient/Control/DeviceCtrlView.xaml.cs
  10. +2
    -2
      BPASmartClient/Control/EditRecipeView.xaml
  11. +2
    -2
      BPASmartClient/Control/OrderStatusView.xaml
  12. BIN
     
  13. +1
    -1
      BPASmartClient/LoginOrderView.xaml
  14. +34
    -3
      BPASmartClient/MyConvert/TextConvert.cs

+ 52
- 6
BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs View File

@@ -118,6 +118,47 @@ namespace BPASmartClient.MorkSUpgradedVer
WriteData(writePar.Address, writePar.Value);
}), "WriteBools");
ActionManage.GetInstance.Register(new Action(() => { DeviceInit(); }), "InitDevice");

#region 单步控制
ActionManage.GetInstance.Register(new Action<object>((o) =>
{
if (o!=null&& o is int BowLoc)
{
if (!mORKS.DropBowlMechanismStatus&& BowLoc!=0)
{
TakeBowlControl((ushort)BowLoc);
}
else
NoodOrderCtrl.GetInstance.Show("等待取碗未完成,请稍候重试!");
}
}),"BowCtrl");
ActionManage.GetInstance.Register(new Action<object>((o) =>
{
if (o != null && o is int turn)
{
if (mORKS.SiloInPlace && !mORKS.FixedFlag && mORKS.InitComplete&&turn !=0)
{
TurntableStart((ushort)turn);
var res = DeviceCtrlViewModel.CtrlTurns.FirstOrDefault(o => o.Set == $"{turn} 号位");
res.UnderSet = true;
}
else
{
NoodOrderCtrl.GetInstance.Show("转台工作中,请稍候重试!");
var res = DeviceCtrlViewModel.CtrlTurns.FirstOrDefault(o => o.Set == $"{turn} 号位");
res.UnderSet = false;
}
}
}), "TurnableCtrl");
ActionManage.GetInstance.Register(new Action<object>((o) =>
{
if (o != null && o is DoNoodle doN)
{
List<ushort> values = new List<ushort>() { (ushort)doN.Min,(ushort)doN.Senc};
WriteData($"VW{324 + (doN.Reset * 4)}", values.ToArray());
}
}), "Startset");
#endregion
}

public override void ResetProgram()
@@ -678,7 +719,7 @@ namespace BPASmartClient.MorkSUpgradedVer
if (Global.EnableLocalSimOrder)
{
//不做轮询,直接取面,本地订单使用
if (mORKS.SiloInPlace && !mORKS.Feeding && mORKS.InitComplete && !mORKS.AllowTakeNoodle && mORKS.RBTakeNoodleTask.Count > 0)
if (mORKS.SiloInPlace && !mORKS.FixedFlag && mORKS.InitComplete && !mORKS.AllowTakeNoodle && mORKS.RBTakeNoodleTask.Count > 0)
{
if (!mORKS.TurntableLowPosition)
{
@@ -769,13 +810,17 @@ namespace BPASmartClient.MorkSUpgradedVer
}
}

//补料中检测
//补料中检测 新版未用
if (RTrig.GetInstance("mORKS.Feeding").Start(mORKS.Feeding))
{
mORKS.AllowTakeNoodle = false;
mORKS.TakeNoodleInterlock = false;
}

if (RTrig.GetInstance("mORKS.FixedFlag").Start(mORKS.FixedFlag))
{
mORKS.AllowTakeNoodle = false;
mORKS.TakeNoodleInterlock = false;
}
//转台到位检测
if (RTrig.GetInstance("TurntableInPlace").Start(mORKS.SiloInPlace && mORKS.CurrentLoc == mORKS.CurrentFeedbackLoc))
{
@@ -783,7 +828,7 @@ namespace BPASmartClient.MorkSUpgradedVer
DeviceProcessLogShow("转台到位检测");
}

//补料完成检测
//补料完成检测 新版未用
if (RTrig.GetInstance("FeedComplete").Start(mORKS.FeedComplete))
{
if (!mORKS.AllowTakeNoodle && mORKS.TurntableLocLists.Count > 0)
@@ -799,11 +844,11 @@ namespace BPASmartClient.MorkSUpgradedVer
private void TakeNoodleTask()
{
//取面控制
if (mORKS.AllowRun && mORKS.RobotStatus && !mORKS.Feeding && !mORKS.RobotTaskInterlock && mORKS.AllowTakeNoodle && mORKS.SiloInPlace && !mORKS.TakeNoodleInterlock && mORKS.RBTakeNoodleTask.Count > 0)
if (mORKS.AllowRun && mORKS.RobotStatus && !mORKS.FixedFlag && !mORKS.RobotTaskInterlock && mORKS.AllowTakeNoodle && mORKS.SiloInPlace && !mORKS.TakeNoodleInterlock && mORKS.RBTakeNoodleTask.Count > 0)
{
if (mORKS.CurrentLoc == mORKS.CurrentFeedbackLoc)
{
//int loc = Array.FindIndex(mORKS.NoodleCookerStatus, p => p == false);//查找煮面炉空闲位置
//int loc = Array.FindIndex(mORKS.NoodleCookerStatus, p => p == false);//查找煮面炉空闲位置r
int loc = mORKS.nsm.ToList().FindIndex(p => p.NoodleCookerStatus == false && p.IsShield == false);//查找煮面炉空闲位置
if (loc >= 0 && loc <= 5)
{
@@ -869,6 +914,7 @@ namespace BPASmartClient.MorkSUpgradedVer
/// <summary>出餐控制</summary>
private void OutNoodleTask()
{
if (mORKS.AllowInvertedFace && mORKS.RobotTaskInterlock && !mORKS.RobotOutDinnigLock && !mORKS.TakeNoodleInterlock && mORKS.RobotStatus)
{
#region 修改之前的代码


+ 0
- 1
BPASmartClient.MorkSUpgradedVer/GVL_MorkSUpgradedVer.cs View File

@@ -268,7 +268,6 @@ namespace BPASmartClient.MorkSUpgradedVer
/// </summary>
[VariableMonitor("定位标志,1:忙碌 0:空闲", "M12.2", "418")]
public bool FixedFlag { get; set; }

/// <summary>
/// 定位启动
/// </summary>


+ 78
- 0
BPASmartClient.ViewModel/DeviceCtrlViewModel.cs View File

@@ -0,0 +1,78 @@
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace BPASmartClient.ViewModel
{
public class DeviceCtrlViewModel : NotifyBase
{
public BPARelayCommand<object> ChooseSet { get; set; }

public BPARelayCommand Startset { get; set; }
public DeviceCtrlViewModel()
{
NoodOrderCtrl.GetInstance.doaction = o =>
{
DoN = o;
};

ChooseSet = new BPARelayCommand<object>(o =>
{
if (o is string @do)
{
var res = doNoodles.FirstOrDefault(o => o.Reset == Convert.ToInt32(@do));
if (res.Docook == false)
{
DoN = res;
}
else
{
NoodOrderCtrl.GetInstance.Show($"{res.Reset}号位置正在煮面测试中,请更换位置!");
}
}
});
Startset = new BPARelayCommand(() =>
{
var res = doNoodles.FirstOrDefault(o => o.Reset == DoN.Reset);
if (res != null)
{
res.Docook = true;
DoN = res;
ActionManage.GetInstance.Send("Startset", res);
}
});
}
private DoNoodle _doN;
public DoNoodle DoN { get { return _doN; } set { _doN = value; OnPropertyChanged(); } }
public ObservableCollection<DoNoodle> doNoodles { get; set; } = NoodOrderCtrl.GetInstance.doNoodles;
public static ObservableCollection<CtrlTurn> CtrlTurns { get; set; } = new ObservableCollection<CtrlTurn>();
}
public class DoNoodle : NotifyBase
{
public int Reset { get { return _reset; } set { _reset = value; OnPropertyChanged(); } }
private int _reset;

public bool Docook { get { return _docook; } set { _docook = value; OnPropertyChanged(); } }
private bool _docook;

public int Min { get { return _min; } set { _min = value; OnPropertyChanged(); } }
private int _min;

public int Senc { get { return _senc; } set { _senc = value; OnPropertyChanged(); } }
private int _senc;
}
public class CtrlTurn : NotifyBase
{
public string Set { get { return _mset; } set { _mset = value; OnPropertyChanged(); } }
private string _mset;

public bool UnderSet { get { return _underSet; } set { _underSet = value; OnPropertyChanged(); } }
private bool _underSet;
}
}

+ 46
- 3
BPASmartClient.ViewModel/NoodOrderCtrl.cs View File

@@ -26,6 +26,9 @@ namespace BPASmartClient
public Action<FoodMenuModel>? editRecipeAction;
public ConcurrentDictionary<string, FrameworkElement> allViews = new ConcurrentDictionary<string, FrameworkElement>();
public Action<string>? showInfo;
public ObservableCollection<DoNoodle> doNoodles = new ObservableCollection<DoNoodle>();

public Action<DoNoodle>? doaction;
public FoodMenuModel LocalOrder { get; set; } = new FoodMenuModel();
//public void CheckOrder(object o)
//{
@@ -40,9 +43,29 @@ namespace BPASmartClient
{
showInfo?.Invoke(info);
}

public void TestReflush(int Loc)
{
var res = doNoodles.FirstOrDefault(o => o.Reset == Loc);
if (res!=null && res.Docook)
{
res.Docook = false;
doaction.Invoke(new DoNoodle() { Reset = Loc, Docook = false });
}
}
/// <summary>
/// 初始化
/// </summary>
public void Init()
{

for (int i = 0; i < 6; i++)
{
doNoodles.Add(new DoNoodle() { Reset = i + 1, Docook = false });
}
for (int i = 0; i < 5; i++)
{
DeviceCtrlViewModel.CtrlTurns.Add(new CtrlTurn() { Set = $"{i + 1} 号位", UnderSet = false });
}
FoodMenuViewModel.FoodMenus.Clear();
Json<NoodOrder>.Data.localOrder?.Keys?.ToList().ForEach(key => FoodMenuViewModel.FoodMenus.Add(new FoodMenuModel { GoodName = key, BowLoc = Json<NoodOrder>.Data.localOrder[key].Bowloc, NoodleLoc = Json<NoodOrder>.Data.localOrder[key].NoodleLoc, FrytimeMin = Json<NoodOrder>.Data.localOrder[key].FryTimeMin, FrytimeS = Json<NoodOrder>.Data.localOrder[key].FryTimeS }));
Json<NoodOrder>.Data.localOrder.addItem = ((key, value) =>
@@ -67,6 +90,11 @@ namespace BPASmartClient
// OrderStatusViewModel.orderMenus.Remove(res);
// }
//}
/// <summary>
/// 开始制作
/// </summary>
/// <param name="localOrder"></param>
/// <param name="amount"></param>
public void StartOrder(FoodMenuModel localOrder, int amount)
{
if (amount > 0 && !string.IsNullOrEmpty(localOrder.GoodName))
@@ -108,6 +136,10 @@ namespace BPASmartClient
Show($"请选择后下单");
}
}
/// <summary>
/// 选择配方
/// </summary>
/// <param name="o"></param>
public void EditOrder(object o)
{
if (o is string re)
@@ -125,7 +157,10 @@ namespace BPASmartClient

}
}
/// <summary>
/// 取消订单
/// </summary>
/// <param name="o"></param>
public void ExitOrder(object o)
{

@@ -154,7 +189,11 @@ namespace BPASmartClient
}
}
}

/// <summary>
/// 订单状态展示
/// </summary>
/// <param name="sTATUS"></param>
/// <returns></returns>
public string StatusConvert(ORDER_STATUS sTATUS)
{
switch (sTATUS)
@@ -171,6 +210,10 @@ namespace BPASmartClient
return "异常";
}
}
/// <summary>
/// 保存配方
/// </summary>
/// <param name="order"></param>
public void SaveRecipe(FoodMenuModel order)
{
if (Json<NoodOrder>.Data.localOrder.ContainsKey(order.GoodName))


+ 78
- 1
BPASmartClient/App.xaml View File

@@ -157,6 +157,50 @@
</Setter.Value>
</Setter>
</Style>
<Style x:Key="Dotoggle" TargetType="{x:Type CheckBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<Grid x:Name="tGrid" Height="40" Width="40" >
<Ellipse x:Name="circle" Height="40" Width="40" Fill="#333333"/>
<ContentControl x:Name="content" FontWeight="Black" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="25" Background="Transparent" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Fill" TargetName="circle">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1" >
<GradientStop Offset="0.0" Color="#E41B18" />
<GradientStop Offset="1" Color="#E19C17" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Trigger.EnterActions>
<BeginStoryboard x:Name="test">
<Storyboard AutoReverse="True" RepeatBehavior="Forever">
<DoubleAnimation Storyboard.TargetName="circle" Storyboard.TargetProperty="Height" From="40" To="35" Duration="0:0:0.3"/>
<DoubleAnimation Storyboard.TargetName="circle" Storyboard.TargetProperty="Width" From="40" To="35" Duration="0:0:0.3"/>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
</Trigger>
<Trigger Property="IsChecked" Value="False">
<Setter Property="Fill" Value="#333333" TargetName="circle"/>
<Setter Property="Height" Value="40" TargetName="circle"/>
<Setter Property="Width" Value="40" TargetName="circle"/>
<Setter Property="FontSize" Value="25" TargetName="content"/>
<Trigger.EnterActions>
<StopStoryboard BeginStoryboardName="test"/>
</Trigger.EnterActions>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" Value="0.8" TargetName="tGrid"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="godbtn" TargetType="{x:Type Button}">
<Setter Property="Template">
@@ -189,7 +233,7 @@
<Setter Property="Opacity" Value="0.8" TargetName="con"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Opacity" Value="0.6" TargetName="btnBorder"/>
<Setter Property="Opacity" Value="0.5" TargetName="btnBorder"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
@@ -302,8 +346,41 @@
</Style>



<Style x:Key="MenuCheck" TargetType="{x:Type RadioButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RadioButton}">
<Border x:Name="Cborder" Height="{TemplateBinding Height}" Background="#dddddd" CornerRadius="20" BorderThickness="2" BorderBrush="#555555" Width="{TemplateBinding Width}" >
<Grid>
<ContentControl HorizontalAlignment="Center" VerticalAlignment="Center" Background="Transparent" />
<TextBlock Margin="20,5" x:Name="content" Text="{TemplateBinding ContentStringFormat}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="{TemplateBinding FontSize}" Foreground="White"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="BorderBrush" TargetName="Cborder" Value="black "/>
<Setter Property="Background" TargetName="Cborder" Value="{Binding Background,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
<Setter Property="Foreground" TargetName="content" Value="{Binding Foreground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
</Trigger>
<Trigger Property="IsChecked" Value="False">
<Setter Property="BorderBrush" TargetName="Cborder" Value="#777777"/>
<Setter Property="BorderBrush" TargetName="Cborder" Value="#999999"/>
<Setter Property="Foreground" TargetName="content" Value="White"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" TargetName="Cborder" Value="0.8"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<myConvert:NoodleConvert x:Key="noodleConvert"/>
<myConvert:BowConvert x:Key="BowConvert"/>
<myConvert:ResetConvert x:Key="resetConvert"/>
</ResourceDictionary>
</Application.Resources>
</Application>

+ 2
- 0
BPASmartClient/App.xaml.cs View File

@@ -113,6 +113,8 @@ namespace BPASmartClient
protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
ActionManage.GetInstance.Send("InitDevice");
ActionManage.GetInstance.Send("初始化设定煮面时间");
DataSave();
//IotReport.Close();
//SqlHelper.GetInstance.Save();


+ 3
- 0
BPASmartClient/BPASmartClient.csproj View File

@@ -26,6 +26,7 @@
<None Remove="Image\noodle_1.jpg" />
<None Remove="Image\主页.png" />
<None Remove="Image\表头.jpg" />
<None Remove="Image\设备.png" />
</ItemGroup>

<ItemGroup>
@@ -35,6 +36,7 @@
<ItemGroup>
<PackageReference Include="BPA.Message" Version="1.0.86" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1264.42" />
<PackageReference Include="System.Windows.Interactivity.WPF" Version="2.0.20525" />
</ItemGroup>

<ItemGroup>
@@ -68,6 +70,7 @@
<Resource Include="Image\noodle_1.jpg" />
<Resource Include="Image\主页.png" />
<Resource Include="Image\表头.jpg" />
<Resource Include="Image\设备.png" />
</ItemGroup>

<ItemGroup>


+ 213
- 0
BPASmartClient/Control/DeviceCtrlView.xaml View File

@@ -0,0 +1,213 @@
<UserControl x:Class="BPASmartClient.Control.DeviceCtrlView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Control"
Background="{x:Null}"
mc:Ignorable="d"
xmlns:vm="clr-namespace:BPASmartClient.ViewModel;assembly=BPASmartClient.ViewModel"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.DataContext>
<vm:DeviceCtrlViewModel x:Name="device"/>
</UserControl.DataContext>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid Background="White">
<Image Source="../../Image/设备.png" Stretch="Fill"/>
<!--#region 转台控制按钮 -->
<Border Margin="0,30,200,0" Width="800" VerticalAlignment="Top" HorizontalAlignment="Center" Height="500">
<ItemsControl ItemsSource="{Binding CtrlTurns}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Width="450"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<RadioButton x:Name="ad" Grid.Row="2" FontSize="24" FontWeight="Black" Width="120" Height="100" Margin="10,5" GroupName="name" ContentStringFormat="{Binding Set}" IsChecked="{Binding UnderSet}" Click="Turn_Click" Background="#ECBB52" Foreground="Black" Style="{StaticResource MenuCheck}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Border>
<!--#endregion-->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<!--#region 大小碗控制 -->
<Grid>
<Grid Height="60" Width="60" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,240,0">
<Ellipse Width="20" Height="20" Fill="Red" HorizontalAlignment="Center" VerticalAlignment="Center">
<Ellipse.RenderTransform>
<ScaleTransform ScaleX="1" ScaleY="1"/>
</Ellipse.RenderTransform>
<Ellipse.Triggers>
<EventTrigger RoutedEvent="Ellipse.Loaded">
<BeginStoryboard>
<Storyboard RepeatBehavior="Forever">
<DoubleAnimation Storyboard.TargetProperty="Height" From="15" To="20" Duration="0:0:1" AutoReverse="True"/>
<DoubleAnimation Storyboard.TargetProperty="Width" From="15" To="20" Duration="0:0:1" AutoReverse="True"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Ellipse.Triggers>
</Ellipse>
</Grid>

<Path Stroke="Red" >
<Path.Data>
<PathGeometry>
<PathFigure StartPoint="690,500" IsClosed="False" IsFilled="False">
<LineSegment Point="600,420"/>
<LineSegment Point="450,420"/>
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>

<TextBlock Text="大小碗控制" FontSize="20" Foreground="Red" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="100,0,0,200"/>
<Border Height="800" Width="400" Margin="0,0,300,160" >
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
<Border CornerRadius="20" Margin="0,0,0,30" Background="#ECBB52" HorizontalAlignment="Center" VerticalAlignment="Center" Height="50" Width="150" BorderBrush="Black" BorderThickness="2">
<Button Background="Transparent" Style="{StaticResource adbtn}" Click="BowCtrl_Click" Content="大 碗" BorderThickness="0" FontSize="25" FontWeight="Black"/>
</Border>
<Border CornerRadius="20" Background="#ECBB52" HorizontalAlignment="Center" VerticalAlignment="Center" Height="50" Width="150" BorderBrush="Black" BorderThickness="2">
<Button Background="Transparent" Style="{StaticResource adbtn}" Click="BowCtrl_Click" Content="小 碗" BorderThickness="0" FontSize="25" FontWeight="Black"/>
</Border>
</StackPanel>
</Border>
</Grid>
<!--#endregion-->
<!--#region 转台控制 -->
<Grid Grid.Column="1">
<Grid Height="60" Width="60" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="300,0,0,500">
<Ellipse Width="20" Height="20" Fill="Red" HorizontalAlignment="Center" VerticalAlignment="Center">
<Ellipse.RenderTransform>
<ScaleTransform ScaleX="1" ScaleY="1"/>
</Ellipse.RenderTransform>
<Ellipse.Triggers>
<EventTrigger RoutedEvent="Ellipse.Loaded">
<BeginStoryboard>
<Storyboard RepeatBehavior="Forever">
<DoubleAnimation Storyboard.TargetProperty="Height" From="15" To="20" Duration="0:0:1" AutoReverse="True"/>
<DoubleAnimation Storyboard.TargetProperty="Width" From="15" To="20" Duration="0:0:1" AutoReverse="True"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Ellipse.Triggers>
</Ellipse>
</Grid>

<Path Stroke="Red" >
<Path.Data>
<PathGeometry>
<PathFigure StartPoint="330,250" IsClosed="False" IsFilled="False">
<LineSegment Point="230,200"/>
<LineSegment Point="70,200"/>
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>

<TextBlock Text="转台控制" FontSize="20" Foreground="Red" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,680,640"/>

</Grid>
<!--#endregion-->

<!--#region 煮面时间设定 -->
<Grid Grid.Column="1">
<Grid Height="60" Width="60" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="200,0,0,380">
<Ellipse Width="20" Height="20" Fill="Red" HorizontalAlignment="Center" VerticalAlignment="Center">
<Ellipse.RenderTransform>
<ScaleTransform ScaleX="1" ScaleY="1"/>
</Ellipse.RenderTransform>
<Ellipse.Triggers>
<EventTrigger RoutedEvent="Ellipse.Loaded">
<BeginStoryboard>
<Storyboard RepeatBehavior="Forever">
<DoubleAnimation Storyboard.TargetProperty="Height" From="15" To="20" Duration="0:0:1" AutoReverse="True"/>
<DoubleAnimation Storyboard.TargetProperty="Width" From="15" To="20" Duration="0:0:1" AutoReverse="True"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Ellipse.Triggers>
</Ellipse>
</Grid>

<Path Stroke="Red" HorizontalAlignment="Left" VerticalAlignment="Center">
<Path.Data>
<PathGeometry>
<PathFigure StartPoint="230,210" IsClosed="False" IsFilled="False">
<LineSegment Point="330,240"/>
<LineSegment Point="600,240"/>
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>

<TextBlock Text="煮面时间设定" FontSize="20" Foreground="red" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,200,0,0"/>
<Border Margin="0,280,0,0" Width="400" VerticalAlignment="Center" HorizontalAlignment="Right" Height="400">
<StackPanel Orientation="Vertical" Width="400">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" Margin="0,0,0,20" Text="选择煮面位置" FontWeight="Black" Foreground="Black"/>
<ItemsControl HorizontalAlignment="Center" ItemsSource="{Binding doNoodles}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Width="280"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<RadioButton x:Name="ad" Grid.Row="2" FontSize="25" FontWeight="Black" Width="120" Height="50" Margin="10,5" GroupName="name" ContentStringFormat="{Binding Reset}" Command="{Binding ChooseSet,ElementName=device}" CommandParameter="{Binding ElementName=ad,Path=ContentStringFormat}" Background="#ECBB52" Foreground="Black" Style="{StaticResource MenuCheck}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<StackPanel Margin="0,20,0,0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="设定时间:" Foreground="#ECBB52"/>
<Border BorderBrush="#ECBB52" Height="30" BorderThickness="0,0,0,1">
<StackPanel Orientation="Horizontal" >
<TextBox Width="60" Text="{Binding DoN.Min}" HorizontalContentAlignment="Left" FontSize="21" Style="{StaticResource ComboBoxEditableTextBox}" Foreground="#ECBB52" Background="Transparent" />
<TextBlock Text="分" Foreground="#ECBB52" Background="Transparent" />
<TextBox Width="60" Text="{Binding DoN.Senc}" FontSize="21" HorizontalContentAlignment="Left" Style="{StaticResource ComboBoxEditableTextBox}" Foreground="#ECBB52" Background="Transparent" />
<TextBlock Text="秒" Foreground="#ECBB52" Background="Transparent" />
</StackPanel>
</Border>
</StackPanel>
<Border Margin="0,40,0,0" CornerRadius="20" Background="#ECBB52" HorizontalAlignment="Center" VerticalAlignment="Center" Height="50" Width="180" BorderBrush="Black" BorderThickness="2">
<Button Background="Transparent" Style="{StaticResource adbtn}" Command="{Binding Startset}" Content="确认设置" BorderThickness="0" FontSize="25" FontWeight="Black" />
</Border>
</StackPanel>
</Border>

</Grid>
<!--#endregion-->

<CheckBox Grid.Column="2" Margin="115,80,0,0" HorizontalAlignment="Left" IsEnabled="False" IsChecked="{Binding DoN,Converter={StaticResource resetConvert},ConverterParameter=1}" VerticalAlignment="Center" Content="1" Style="{StaticResource Dotoggle}" Foreground="White" />
<CheckBox Grid.Column="2" Margin="193,80,0,0" HorizontalAlignment="Left" IsEnabled="False" IsChecked="{Binding DoN,Converter={StaticResource resetConvert},ConverterParameter=2}" VerticalAlignment="Center" Content="2" Style="{StaticResource Dotoggle}" Foreground="White" />
<CheckBox Grid.Column="2" Margin="272,80,0,0" HorizontalAlignment="Left" IsEnabled="False" IsChecked="{Binding DoN,Converter={StaticResource resetConvert},ConverterParameter=3}" VerticalAlignment="Center" Content="3" Style="{StaticResource Dotoggle}" Foreground="White" />
<CheckBox Grid.Column="2" Margin="210,0,0,40" HorizontalAlignment="Left" IsEnabled="False" IsChecked="{Binding DoN,Converter={StaticResource resetConvert},ConverterParameter=4}" VerticalAlignment="Center" Content="4" Style="{StaticResource Dotoggle}" Foreground="White" />
<CheckBox Grid.Column="2" Margin="280,0,0,40" HorizontalAlignment="Left" IsEnabled="False" IsChecked="{Binding DoN,Converter={StaticResource resetConvert},ConverterParameter=5}" VerticalAlignment="Center" Content="5" Style="{StaticResource Dotoggle}" Foreground="White" />
<CheckBox Grid.Column="2" Margin="370,0,0,40" HorizontalAlignment="Left" IsEnabled="False" IsChecked="{Binding DoN,Converter={StaticResource resetConvert},ConverterParameter=6}" VerticalAlignment="Center" Content="6" Style="{StaticResource Dotoggle}" Foreground="White" />


</Grid>

</Grid>
</UserControl>

+ 78
- 0
BPASmartClient/Control/DeviceCtrlView.xaml.cs View File

@@ -0,0 +1,78 @@
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace BPASmartClient.Control
{
/// <summary>
/// DeviceCtrlView.xaml 的交互逻辑
/// </summary>
public partial class DeviceCtrlView : UserControl
{
public DeviceCtrlView()
{
InitializeComponent();
}


private void BowCtrl_Click(object sender, RoutedEventArgs e)
{
if (sender is Button btn)
{
int bowloc = 0;
switch (btn.Content.ToString())
{
case "小 碗":
bowloc = 10;
break;
case "大 碗":
bowloc = 11;
break;
default:
break;
}
ActionManage.GetInstance.Send("BowCtrl", bowloc);
}
}

private void Turn_Click(object sender, RoutedEventArgs e)
{
if (sender is RadioButton btn)
{
int turn = 0;
switch (btn.ContentStringFormat.ToString())
{
case "1 号位":
turn = 1;
break;
case "2 号位":
turn = 2;
break;
case "3 号位":
turn = 3;
break;
case "4 号位":
turn = 4;
break;
case "5 号位":
turn = 5;
break;
default:
break;
}
ActionManage.GetInstance.Send("TurnableCtrl", turn);
}
}
}
}

+ 2
- 2
BPASmartClient/Control/EditRecipeView.xaml View File

@@ -59,9 +59,9 @@
<TextBlock Margin="20,0,0,0" Text="煮面时间 :" Foreground="#ECBB52" FontSize="30" FontWeight="Black"/>
<Border BorderBrush="#ECBB52" BorderThickness="0,0,0,2" Width="200">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBox Margin="0,0,0,2" Width="60" Text="{Binding LocalOrder.FrytimeMin}" Style="{StaticResource ComboBoxEditableTextBox}" Foreground="#ECBB52" FontSize="28" Background="Transparent" Height="40" />
<TextBox Margin="0,0,0,2" Width="60" Text="{Binding LocalOrder.FrytimeMin}" HorizontalContentAlignment="Right" Style="{StaticResource ComboBoxEditableTextBox}" Foreground="#ECBB52" FontSize="28" Background="Transparent" Height="40" />
<TextBlock Margin="0,0,10,2" Text="分" Foreground="#ECBB52" FontSize="28" Background="Transparent" Height="40" />
<TextBox Margin="0,0,0,2" Width="60" Text="{Binding LocalOrder.FrytimeS}" Style="{StaticResource ComboBoxEditableTextBox}" Foreground="#ECBB52" FontSize="28" Background="Transparent" Height="40" />
<TextBox Margin="0,0,0,2" Width="60" Text="{Binding LocalOrder.FrytimeS}" HorizontalContentAlignment="Right" Style="{StaticResource ComboBoxEditableTextBox}" Foreground="#ECBB52" FontSize="28" Background="Transparent" Height="40" />
<TextBlock Margin="0,0,0,2" Text="秒" Foreground="#ECBB52" FontSize="28" Background="Transparent" Height="40" />
</StackPanel>


+ 2
- 2
BPASmartClient/Control/OrderStatusView.xaml View File

@@ -229,7 +229,7 @@
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger SourceName="Exit" RoutedEvent="Button.Click">
<!--<EventTrigger SourceName="Exit" RoutedEvent="Button.Click">
<BeginStoryboard>
<Storyboard AutoReverse="False">
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="MyGrid" Storyboard.TargetProperty="Height">
@@ -242,7 +242,7 @@
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</EventTrigger>-->
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>


BIN
View File


+ 1
- 1
BPASmartClient/LoginOrderView.xaml View File

@@ -112,7 +112,7 @@
</LinearGradientBrush>
</Border.Background>
</Border>
<Button Content="系统设置" Style="{DynamicResource viewBtn_1}" FontSize="50" Foreground="White">
<Button Content="设备调试" Tag="DeviceCtrlView" Click="btnClick" Style="{DynamicResource viewBtn_1}" FontSize="50" Foreground="White">
<Button.Background>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/Settings.png"/>
</Button.Background>


+ 34
- 3
BPASmartClient/MyConvert/TextConvert.cs View File

@@ -1,6 +1,9 @@
using System;
using BPASmartClient;
using BPASmartClient.ViewModel;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Media;
@@ -100,7 +103,7 @@ namespace MyConvert
switch (sizeName)
{
case "大碗":
return 10;
return 11;
case "小碗":
return 10;
default:
@@ -109,8 +112,36 @@ namespace MyConvert
}
else
{
return 11;
return 10;
}
}
}


public class ResetConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (parameter is string num)
{
var res = NoodOrderCtrl.GetInstance.doNoodles.FirstOrDefault(o => o.Reset == System.Convert.ToInt32(num));
if (res != null)
{
return res.Docook;
}
else
{
return null;
}
}
else
return null;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

Loading…
Cancel
Save