Browse Source

小炒调试

样式分支
taoye 2 years ago
parent
commit
e2cf0a0161
7 changed files with 592 additions and 369 deletions
  1. +440
    -353
      BPASmartClient.MorkF/Control_MorkF.cs
  2. +1
    -1
      BPASmartClient.MorkF/OrderLocInfo.cs
  3. +53
    -0
      BPASmartClient.ViewModel/DebugViewModel.cs
  4. +45
    -0
      BPASmartClient/Control/DebugView.xaml
  5. +30
    -0
      BPASmartClient/Control/DebugView.xaml.cs
  6. +16
    -14
      BPASmartClient/DeviceInfo.xml
  7. +7
    -1
      BPASmartClient/MainWindow.xaml

+ 440
- 353
BPASmartClient.MorkF/Control_MorkF.cs
File diff suppressed because it is too large
View File


+ 1
- 1
BPASmartClient.MorkF/OrderLocInfo.cs View File

@@ -9,7 +9,7 @@ namespace BPASmartClient.MorkF
internal class OrderLocInfo
{
public string SuborderId { get; set; }
public ushort MaterialLoc { get; set; }
public ushort MaterialLoc { get; set; }//物料位置
public ushort RecipeNumber { get; set; }
public int BatchingId { get; set; }
}

+ 53
- 0
BPASmartClient.ViewModel/DebugViewModel.cs View File

@@ -0,0 +1,53 @@
using BPASmartClient.Helper;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.ViewModel
{
public class DebugViewModel : ObservableObject
{
public RelayCommand PlcInite { get; set; }
public RelayCommand SimulateOrder { get; set; }
public RelayCommand TakePot { get; set; }
public RelayCommand TakePotReset { get; set; }
public RelayCommand TempTurnOff { get; set; }
public RelayCommand OneBlock { get; set; }
public RelayCommand TwoBlock { get; set; }
public RelayCommand ThreeBlock { get; set; }

public RelayCommand OverTurnOff { get; set; }
public RelayCommand OverOneBlock { get; set; }
public RelayCommand OverTwoBlock { get; set; }
public RelayCommand OverThreeBlock { get; set; }
public RelayCommand OverGoOn { get; set; }
public RelayCommand OverGoDown { get; set; }
public RelayCommand ShreddCabbage { get; set; }
public RelayCommand FryPork { get; set; }
public RelayCommand XingBaoGu { get; set; }
public DebugViewModel()
{
PlcInite = new RelayCommand(() => { ActionManage.GetInstance.Send("InitCommand"); });
SimulateOrder = new RelayCommand(() => { ActionManage.GetInstance.Send("SimultaorOrder"); });
TakePot = new RelayCommand(() => { ActionManage.GetInstance.Send("TakePot"); });
TakePotReset = new RelayCommand(() => { ActionManage.GetInstance.Send("TakePotReset"); });
TempTurnOff = new RelayCommand(() => { ActionManage.GetInstance.Send("TakeOff"); });
OneBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OneBlock"); });
TwoBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("TwoBlock"); });
ThreeBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("ThreeBlock"); });
OverTurnOff = new RelayCommand(() => { ActionManage.GetInstance.Send("OverTurnOff"); });
OverOneBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverOneBlock"); });
OverTwoBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverTwoBlock"); });
OverThreeBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverThreeBlock"); });
OverGoOn = new RelayCommand(() => { ActionManage.GetInstance.Send("OverGoOn"); });
OverGoDown = new RelayCommand(() => { ActionManage.GetInstance.Send("OverGoDown"); });
ShreddCabbage = new RelayCommand(() => { ActionManage.GetInstance.Send("ShreddCabbage"); });
FryPork = new RelayCommand(() => { ActionManage.GetInstance.Send("FryPork"); });
XingBaoGu = new RelayCommand(() => { ActionManage.GetInstance.Send("XingBaoGu"); });
}
}
}

+ 45
- 0
BPASmartClient/Control/DebugView.xaml View File

@@ -0,0 +1,45 @@
<UserControl x:Class="BPASmartClient.Control.DebugView"
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:BPASmartClient.Control"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<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>
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>

<StackPanel Orientation="Horizontal" Grid.Row="0">
<Button Content="初始化" Command="{Binding PlcInite}" Margin="10,0,10,0"></Button>
<Button Content="模拟订单" Command="{Binding SimulateOrder}" Margin="10,0,10,0"></Button>
<Button Content="手撕包菜" Command="{Binding ShreddCabbage}" Margin="10,0,10,0"></Button>
<Button Content="盐煎肉" Command="{Binding FryPork}" Margin="10,0,10,0"></Button>
<Button Content="酱烧杏鲍菇" Command="{Binding XingBaoGu}" Margin="10,0,10,0"></Button>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="1">
<Button Content="取锅" Command="{Binding TakePot}" Margin="10,0,10,0"></Button>
<Button Content="取锅复位" Command="{Binding TakePotReset}" Margin="10,0,10,0"></Button>
<Button Content="加热关闭" Command="{Binding TempTurnOff}" Margin="10,0,10,0"></Button>
<Button Content="加热1挡" Command="{Binding OneBlock}" Margin="10,0,10,0"></Button>
<Button Content="加热2挡" Command="{Binding TwoBlock}" Margin="10,0,10,0"></Button>
<Button Content="加热3挡" Command="{Binding ThreeBlock}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机关闭" Command="{Binding OverTurnOff}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机上升" Command="{Binding OverGoOn}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机下降" Command="{Binding OverGoDown}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机1挡" Command="{Binding OverOneBlock}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机2挡" Command="{Binding OverTwoBlock}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机3挡" Command="{Binding OverThreeBlock}" Margin="10,0,10,0"></Button>
</StackPanel>
</Grid>
</UserControl>

+ 30
- 0
BPASmartClient/Control/DebugView.xaml.cs View File

@@ -0,0 +1,30 @@
using BPASmartClient.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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>
/// DebugView.xaml 的交互逻辑
/// </summary>
public partial class DebugView : UserControl
{
public DebugView()
{
InitializeComponent();
this.DataContext = new DebugViewModel();
}
}
}

+ 16
- 14
BPASmartClient/DeviceInfo.xml View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<BPADevices>
<!--<Device Name="MorkT" Module="BPASmartClient.MorkT.Device_MorkT" DeviceId="1">
<!--<Device Name="MorkT" Module="BPASmartClient.MorkT.Device_MorkT" DeviceId="1">
<Peripherals>
<Peripheral Module="BPASmartClient.Lebai.LebaiRobot">
<Parameters>
@@ -26,28 +26,30 @@
</Peripherals>
</Device>-->

<!--<Device Name="MorkF" Module="BPASmartClient.MorkF.Control_MorkF" DeviceId="2">
<Device Name="MorkF" Module="BPASmartClient.MorkF.Control_MorkF" DeviceId="2">
<Peripherals>
<Peripheral Module="BPASmartClient.PLC.MorksMachine">
<Parameters>
<IpAddress>192.168.6.1</IpAddress>
<Port>502</Port>
<PLCReadAddress>M,M0.1,1;M,M1.0,8;M,M2.0,9;M,M8.0,4;M,M13.5,1;M,M16.0,7;</PLCReadAddress>
</Parameters>
</Peripheral>
</Peripherals>
</Device>

<!--<Device Name="Morks" Module="BPASmartClient.MorkS.Control" DeviceId="2">
<Peripherals>
<Peripheral Module="BPASmartClient.PLC.MorksMachine">
<Parameters>
<IpAddress>127.0.0.1</IpAddress>
<Port>502</Port>
<PLCReadAddress>M,M0.1,1;M,M1.0,8;M,M2.0,9;M,M8.0,4;M,M13.5,1;M,M16.0,7;</PLCReadAddress>
<PLCReadAddress>M,M550.0,16;M,M0.1,1;M,M1.0,8;M,M2.0,9;M,M8.0,4;M,M13.5,1;M,M16.0,7;</PLCReadAddress>
</Parameters>
</Peripheral>
</Peripherals>
</Device>-->

<Device Name="Morks" Module="BPASmartClient.MorkS.Control" DeviceId="28">
<Peripherals>
<Peripheral Module="BPASmartClient.PLC.MorksMachine">
<Parameters>
<IpAddress>192.168.1.11</IpAddress>
<Port>508</Port>
<PLCReadAddress>M,M550.0,16;M,M0.3,3;M,M100.0,16;M,M235.0,1;M,M102.0,7;M,M103.0,6;VW,VW372,1</PLCReadAddress>
</Parameters>
</Peripheral>
</Peripherals>
</Device>


</BPADevices>

+ 7
- 1
BPASmartClient/MainWindow.xaml View File

@@ -13,7 +13,7 @@
Height="800"
AllowsTransparency="True"
Background="{x:Null}"
Topmost="True"
Topmost="False"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
mc:Ignorable="d">
@@ -82,6 +82,12 @@
FontSize="12"
Header="阿里连接维护"
Tag="DataVView" />
<Separator />
<MenuItem
Click="MenuItem_Click"
FontSize="12"
Header="调试界面"
Tag="DebugView" />
</MenuItem>
<MenuItem Header="状态监视">
<MenuItem


Loading…
Cancel
Save