@@ -16,6 +16,8 @@ namespace BPASmartClient.PLC | |||||
{ | { | ||||
Task.Run(new Action(() => { modbusTcp.ModbusTcpConnect(communicationPar.IPAddress, communicationPar.IPPort); })); //PLC 设备连接 | Task.Run(new Action(() => { modbusTcp.ModbusTcpConnect(communicationPar.IPAddress, communicationPar.IPPort); })); //PLC 设备连接 | ||||
Thread.Sleep(1000); | |||||
ThreadManage.GetInstance().StartLong(new Action(() => | ThreadManage.GetInstance().StartLong(new Action(() => | ||||
{ | { | ||||
IsConnected = modbusTcp.Connected; | IsConnected = modbusTcp.Connected; | ||||
@@ -41,7 +43,7 @@ namespace BPASmartClient.PLC | |||||
Thread.Sleep(500); | Thread.Sleep(500); | ||||
} | } | ||||
Thread.Sleep(1000); | Thread.Sleep(1000); | ||||
}), $"设备[{DeviceId}]PLC读取线程", true); | |||||
}), $"设备[{DeviceId}][{modbusTcp.IPAdress}]PLC读取线程", true); | |||||
//写入数据 | //写入数据 | ||||
EventBus.EventBus.GetInstance().Subscribe<WriteModel>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) | EventBus.EventBus.GetInstance().Subscribe<WriteModel>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) | ||||
@@ -1,4 +1,5 @@ | |||||
using BPA.Models; | using BPA.Models; | ||||
using BPASmartClient.Device; | |||||
using System; | using System; | ||||
using System.Collections.Concurrent; | using System.Collections.Concurrent; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
@@ -25,6 +26,7 @@ namespace BPASmartClient.MorkF | |||||
/// <summary> | /// <summary> | ||||
/// 炒锅自动模式 | /// 炒锅自动模式 | ||||
/// </summary> | /// </summary> | ||||
[VariableMonitor("炒锅1锅低温度", "VW120", "160")] | |||||
public bool AutoMode { get; set; } | public bool AutoMode { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 炒锅1初始化完成 | /// 炒锅1初始化完成 | ||||
@@ -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 | |||||
} | |||||
} |
@@ -97,9 +97,9 @@ | |||||
<WrapPanel Grid.Row="2" Orientation="Horizontal" > | <WrapPanel Grid.Row="2" Orientation="Horizontal" > | ||||
<Button Content="夹爪正转" Command="{Binding PawTurnFront}" Margin="5,0" Cursor="Hand"/> | <Button Content="夹爪正转" Command="{Binding PawTurnFront}" Margin="5,0" Cursor="Hand"/> | ||||
<Button Content="夹爪反转" Command="{Binding PawTurnBack}" 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> | </WrapPanel> | ||||
</Grid> | </Grid> | ||||
@@ -183,8 +183,8 @@ namespace BPASmartClient.MorkF.ViewModel | |||||
#region 菜品控制 | #region 菜品控制 | ||||
FoodLibInit = new RelayCommand(() => { ActionManage.GetInstance.Send("FoodLibInit"); });//菜品库初始化 | 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(() => | SetSpeed = new RelayCommand(() => | ||||
{ | { | ||||
ActionManage.GetInstance.Send("SetSpeed", new List<int> { MoveSpeed }); | ActionManage.GetInstance.Send("SetSpeed", new List<int> { MoveSpeed }); | ||||
@@ -12,14 +12,14 @@ | |||||
<add key ="Namespaces" value="DEV.test1.Config"/>--> | <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="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="appid" value="hostcomputer"/> | ||||
<add key ="namespaces" value="test1.config"/>--> | |||||
<add key ="namespaces" value="test1.config"/> | |||||
<!--阿里云上报启动方式:API 或者 LOCAL--> | <!--阿里云上报启动方式:API 或者 LOCAL--> | ||||
<!--API :通过客户端ID,调用接口查询“设备连接信息”--> | <!--API :通过客户端ID,调用接口查询“设备连接信息”--> | ||||