Browse Source

菜品库更新

样式分支
yahaha 2 years ago
parent
commit
81f7097f52
7 changed files with 728 additions and 209 deletions
  1. +3
    -1
      BPASmartClient.MORKSM.BK.PLC/PLCMachine.cs
  2. +587
    -199
      BPASmartClient.MorkF/Control_MorkF.cs
  3. +2
    -0
      BPASmartClient.MorkF/GVL_MorkF.cs
  4. +127
    -0
      BPASmartClient.MorkF/ML_MorkF.cs
  5. +3
    -3
      BPASmartClient.MorkF/View/DebugView.xaml
  6. +2
    -2
      BPASmartClient.MorkF/ViewModel/DebugViewModel.cs
  7. +4
    -4
      BPASmartClient/App.config

+ 3
- 1
BPASmartClient.MORKSM.BK.PLC/PLCMachine.cs View File

@@ -16,6 +16,8 @@ namespace BPASmartClient.PLC
{
Task.Run(new Action(() => { modbusTcp.ModbusTcpConnect(communicationPar.IPAddress, communicationPar.IPPort); })); //PLC 设备连接

Thread.Sleep(1000);

ThreadManage.GetInstance().StartLong(new Action(() =>
{
IsConnected = modbusTcp.Connected;
@@ -41,7 +43,7 @@ namespace BPASmartClient.PLC
Thread.Sleep(500);
}
Thread.Sleep(1000);
}), $"设备[{DeviceId}]PLC读取线程", true);
}), $"设备[{DeviceId}][{modbusTcp.IPAdress}]PLC读取线程", true);

//写入数据
EventBus.EventBus.GetInstance().Subscribe<WriteModel>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)


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


+ 2
- 0
BPASmartClient.MorkF/GVL_MorkF.cs View File

@@ -1,4 +1,5 @@
using BPA.Models;
using BPASmartClient.Device;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -25,6 +26,7 @@ namespace BPASmartClient.MorkF
/// <summary>
/// 炒锅自动模式
/// </summary>
[VariableMonitor("炒锅1锅低温度", "VW120", "160")]
public bool AutoMode { get; set; }
/// <summary>
/// 炒锅1初始化完成


+ 127
- 0
BPASmartClient.MorkF/ML_MorkF.cs View File

@@ -0,0 +1,127 @@
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.MorkF
{
internal class ML_MorkF
{
#region 菜品库的操作状态
/// <summary>
/// 激光距离
/// </summary>
public int LaserDistance { get; set; }

/// <summary>
/// 菜品库当前X轴坐标
/// </summary>
public int ArmPositionX { get; set; }

/// <summary>
/// 菜品库当前Y轴坐标
/// </summary>
public int ArmPositionY { get; set; }

/// <summary>
/// 菜品库是否在工作中
/// </summary>
public bool MaterailIsWorking { get; set; }

/// <summary>
/// 初始化是否完成
/// </summary>
public bool InitialComplete { get; set; }

private bool _ArriveComplete = false;
/// <summary>
/// 定位到达,上升沿捕获需要特殊处理
/// </summary>
public bool ArriveComplete
{
get
{
var ret = _ArriveComplete;
_ArriveComplete = false;
if(ret)
{
MessageLog.GetInstance.Show("到达上升沿为true");
}
else
{
MessageLog.GetInstance.Show("到达上升沿为false");
}
return ret;
}
set
{
_ArriveComplete = value;
}
}

/// <summary>
/// 爪子初始化完成
/// </summary>
public bool PawInitialComplete { get; set; }

private bool _PawArrivePortOne = false;
/// <summary>
/// 爪子到达一号位,上升沿捕获需要特殊处理
/// </summary>
public bool PawArrivePortOne
{
get
{
var ret = _PawArrivePortOne;
_PawArrivePortOne = false;
return ret;
}
set
{
_PawArrivePortOne = value;
}
}

private bool _PawArrivePortTwo = false;
/// <summary>
/// 爪子到达二号位,上升沿捕获需要特殊处理
/// </summary>
public bool PawArrivePortTwo
{
get
{
var ret = _PawArrivePortTwo;
_PawArrivePortTwo = false;
return ret;
}
set
{
_PawArrivePortTwo = value;
}
}

private bool _PawArrivePortThree = false;
/// <summary>
/// 爪子到达三号位
/// </summary>
public bool PawArrivePortThree
{
get
{
var ret = _PawArrivePortThree;
_PawArrivePortThree = false;
return ret;
}
set
{
_PawArrivePortThree = value;
}
}
#endregion

#region
#endregion
}
}

+ 3
- 3
BPASmartClient.MorkF/View/DebugView.xaml View File

@@ -97,9 +97,9 @@
<WrapPanel Grid.Row="2" Orientation="Horizontal" >
<Button Content="夹爪正转" Command="{Binding PawTurnFront}" Margin="5,0" Cursor="Hand"/>
<Button Content="夹爪反转" Command="{Binding PawTurnBack}" Margin="5,0" Cursor="Hand"/>
<RadioButton Content="位置2" Margin="5,0" IsEnabled="False" IsChecked="{Binding PawPositon1}" GroupName="a"/>
<RadioButton Content="位置1" Margin="5,0" IsEnabled="False" IsChecked="{Binding PawPositon2}" GroupName="b"/>
<RadioButton Content="位置3" Margin="5,0 " IsEnabled="False" IsChecked="{Binding PawPositon3}" GroupName="c"/>
<RadioButton Content="位置1" Margin="5,0" IsEnabled="True" IsChecked="{Binding PawPositon1}" Command="{Binding GetDistance_1}" GroupName="PawTurn"/>
<RadioButton Content="位置2" Margin="5,0" IsEnabled="True" IsChecked="{Binding PawPositon2}" Command="{Binding GetDistance_2}" GroupName="PawTurn"/>
<RadioButton Content="位置3" Margin="5,0 " IsEnabled="True" IsChecked="{Binding PawPositon3}" Command="{Binding GetDistance_3}" GroupName="PawTurn"/>
</WrapPanel>
</Grid>



+ 2
- 2
BPASmartClient.MorkF/ViewModel/DebugViewModel.cs View File

@@ -183,8 +183,8 @@ namespace BPASmartClient.MorkF.ViewModel
#region 菜品控制

FoodLibInit = new RelayCommand(() => { ActionManage.GetInstance.Send("FoodLibInit"); });//菜品库初始化
StartElectromagnetism = new RelayCommand(() => { ActionManage.GetInstance.Send("Electromagnetism", new List<bool> { true }); });//电磁阀启动
StopElectromagnetism = new RelayCommand(() => { ActionManage.GetInstance.Send("Electromagnetism", new List<bool> { false });});//电磁阀关闭
StartElectromagnetism = new RelayCommand(() => { ActionManage.GetInstance.Send("Electromagnetism", new List<bool> { false }); });//电磁阀启动
StopElectromagnetism = new RelayCommand(() => { ActionManage.GetInstance.Send("Electromagnetism", new List<bool> { true });});//电磁阀关闭
SetSpeed = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("SetSpeed", new List<int> { MoveSpeed });


+ 4
- 4
BPASmartClient/App.config View File

@@ -12,14 +12,14 @@
<add key ="Namespaces" value="DEV.test1.Config"/>-->

<!--开发环境-->
<add key="apollouri" value="http://10.2.1.21:28080/"/>
<!--<add key="apollouri" value="http://10.2.1.21:28080/"/>
<add key="AppId" value="HostComputer"/>
<add key ="Namespaces" value="DEV.Config"/>
<add key ="Namespaces" value="DEV.Config"/>-->

<!--正式环境-->
<!--<add key="apollouri" value="http://47.108.65.220:28080/"/>
<add key="apollouri" value="http://47.108.65.220:28080/"/>
<add key="appid" value="hostcomputer"/>
<add key ="namespaces" value="test1.config"/>-->
<add key ="namespaces" value="test1.config"/>

<!--阿里云上报启动方式:API 或者 LOCAL-->
<!--API :通过客户端ID,调用接口查询“设备连接信息”-->


Loading…
Cancel
Save