Browse Source

删除morkT监视

样式分支
pengliangyang 2 years ago
parent
commit
9b7871e682
6 changed files with 31 additions and 216 deletions
  1. +2
    -1
      BPASmartClient.MorkTSingle/Control_MORKJC.cs
  2. +0
    -94
      BPASmartClient.MorkT_BarCounter/ViewModel/MonitorViewModel.cs
  3. +0
    -92
      BPASmartClient.MorkT_Container/ViewModel/MonitorViewModel.cs
  4. +3
    -3
      BPASmartClient.SerialPort/SerialPortClient.cs
  5. +4
    -4
      BPASmartClient/App.config
  6. +22
    -22
      SmartClient.sln

+ 2
- 1
BPASmartClient.MorkTSingle/Control_MORKJC.cs View File

@@ -279,7 +279,8 @@ namespace BPASmartClient.MorkTSingle
});
/*
string aa = calLrcCommon("01" + "05" + "0000000D");
string bb = ":01010001" + aa + "\r\n";*/
string bb = ":01010001" + aa + "\r\n";
*/
}
public static string calLrcCommon(string data)
{


+ 0
- 94
BPASmartClient.MorkT_BarCounter/ViewModel/MonitorViewModel.cs View File

@@ -1,94 +0,0 @@
using BPASmartClient.Business;
using BPASmartClient.Helper;
using BPASmartClient.Model.乐白机器人;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace BPASmartClient.MorkT_BarCounter.ViewModel
{

public class MonitorViewModel: ObservableObject
{
#region 传感器
/// <summary>
/// 机器人夹爪传感器
/// </summary>
public bool RobotSenser { get { return _robotSenser; } set { _robotSenser = value; OnPropertyChanged(); } }
private bool _robotSenser;
/// <summary>
/// 冰淇淋出口传感器
/// </summary>
public bool IceCreamSenser { get { return _iceCreamSenser; } set { _iceCreamSenser = value; OnPropertyChanged(); } }
private bool _iceCreamSenser;
/// <summary>
/// 取餐口检测传感器
/// </summary>
public bool TakeMealSenser { get { return _takeMealSenser; } set { _takeMealSenser = value; OnPropertyChanged(); } }
private bool _takeMealSenser;

#endregion


/// <summary>
/// 设备ID
/// </summary>
int DeviceId;
public MonitorViewModel()
{
Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices().ForEach(device =>
{
if (device.Name == "MorkT") DeviceId = device.DeviceId;

});
ThreadManage.GetInstance().StartLong(new Action(() =>
{
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 1 },(res)=>
{
if(res != null&& res.Length>0&& res[0] is bool b)
{
RobotSenser = b;
}
});

EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent() { DeviceId = DeviceId, Pin = 0 }, (res) =>
{
if (res != null && res.Length > 0 && res[0] is bool b)
{
TakeMealSenser = b;
}
});

EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 3 }, (res) =>
{
if (res != null && res.Length > 0 && res[0] is bool b)
{
IceCreamSenser = b;
}
});
Thread.Sleep(500);
}), "MorkT-传感器监视");
}
}

public class BoolToColorConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (bool) value? new SolidColorBrush(Color.FromRgb(144, 238, 144)) : new SolidColorBrush(Color.FromRgb(178, 34, 34));
}

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

}

+ 0
- 92
BPASmartClient.MorkT_Container/ViewModel/MonitorViewModel.cs View File

@@ -1,92 +0,0 @@
using BPASmartClient.Business;
using BPASmartClient.Helper;
using BPASmartClient.Model.乐白机器人;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace BPASmartClient.MorkT_Container.ViewModel
{

public class MonitorViewModel: ObservableObject
{
#region 传感器
/// <summary>
/// 机器人夹爪传感器
/// </summary>
public bool RobotSenser { get { return _robotSenser; } set { _robotSenser = value; OnPropertyChanged(); } }
private bool _robotSenser;
/// <summary>
/// 冰淇淋出口传感器
/// </summary>
public bool IceCreamSenser { get { return _iceCreamSenser; } set { _iceCreamSenser = value; OnPropertyChanged(); } }
private bool _iceCreamSenser;
/// <summary>
/// 取餐口检测传感器
/// </summary>
public bool TakeMealSenser { get { return _takeMealSenser; } set { _takeMealSenser = value; OnPropertyChanged(); } }
private bool _takeMealSenser;

#endregion
/// <summary>
/// 设备ID
/// </summary>
int DeviceId;
public MonitorViewModel()
{
Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices().ForEach(device =>
{
if (device.Name == "MorkT") DeviceId = device.DeviceId;

});
ThreadManage.GetInstance().StartLong(new Action(() =>
{
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 1 },(res)=>
{
if(res != null&& res.Length>0&& res[0] is bool b)
{
RobotSenser = b;
}
});

EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent() { DeviceId = DeviceId, Pin = 0 }, (res) =>
{
if (res != null && res.Length > 0 && res[0] is bool b)
{
TakeMealSenser = b;
}
});

EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 3 }, (res) =>
{
if (res != null && res.Length > 0 && res[0] is bool b)
{
IceCreamSenser = b;
}
});
Thread.Sleep(500);
}), "MorkT-传感器监视");
}
}

public class BoolToColorConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (bool) value? new SolidColorBrush(Color.FromRgb(144, 238, 144)) : new SolidColorBrush(Color.FromRgb(178, 34, 34));
}

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

}

+ 3
- 3
BPASmartClient.SerialPort/SerialPortClient.cs View File

@@ -143,7 +143,7 @@ namespace BPASmartClient.SerialPort
/// 判断是否有这个串口
/// </summary>
public bool IsHavePort => System.IO.Ports.SerialPort.GetPortNames().Contains(PortName);
/// <summary>
/// 打开端口
/// </summary>
@@ -154,7 +154,7 @@ namespace BPASmartClient.SerialPort
{
if (!IsHavePort)
{
MessageLog.GetInstance.Show("咖乐美咖啡机连接失败");
MessageLog.GetInstance.Show($"{portName}连接失败");
return;
}
if (comPort.IsOpen) comPort.Close();
@@ -164,7 +164,7 @@ namespace BPASmartClient.SerialPort
comPort.DataBits = (int)dataBits;
comPort.StopBits = stopBits;
comPort.Open();
MessageLog.GetInstance.Show("咖乐美咖啡机连接成功");
MessageLog.GetInstance.Show($"{portName}连接成功");
}
}



+ 4
- 4
BPASmartClient/App.config View File

@@ -7,9 +7,9 @@
<add key="IsEnableTest" value="false"/>

<!--测试环境-->
<add key="apollouri" value="http://10.2.1.21:28080/"/>
<!--<add key="apollouri" value="http://10.2.1.21:28080/"/>
<add key="AppId" value="test1_HostComputer"/>
<add key ="Namespaces" value="DEV.test1.Config"/>
<add key ="Namespaces" value="DEV.test1.Config"/>-->

<!--开发环境-->
<!--<add key="apollouri" value="http://10.2.1.21:28080/"/>
@@ -17,9 +17,9 @@
<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,调用接口查询“设备连接信息”-->


+ 22
- 22
SmartClient.sln View File

@@ -114,7 +114,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestDemo", "TestDemo\TestDe
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.HubHelper", "BPASmartClient.HubHelper\BPASmartClient.HubHelper.csproj", "{099E047C-F40E-47A3-A5BA-81FC1500D5E8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkTM", "BPASmartClient.MorkTM\BPASmartClient.MorkTM.csproj", "{76B6B333-0109-4EE8-A9B2-3E53A7421D92}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkTSingle", "BPASmartClient.MorkTSingle\BPASmartClient.MorkTSingle.csproj", "{2366AC9B-B662-4550-9486-AF848B4D2961}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -1070,26 +1070,26 @@ Global
{099E047C-F40E-47A3-A5BA-81FC1500D5E8}.Release|x64.Build.0 = Release|Any CPU
{099E047C-F40E-47A3-A5BA-81FC1500D5E8}.Release|x86.ActiveCfg = Release|Any CPU
{099E047C-F40E-47A3-A5BA-81FC1500D5E8}.Release|x86.Build.0 = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|ARM.ActiveCfg = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|ARM.Build.0 = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|ARM64.Build.0 = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|x64.ActiveCfg = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|x64.Build.0 = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|x86.ActiveCfg = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|x86.Build.0 = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|Any CPU.Build.0 = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|ARM.ActiveCfg = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|ARM.Build.0 = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|ARM64.ActiveCfg = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|ARM64.Build.0 = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|x64.ActiveCfg = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|x64.Build.0 = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|x86.ActiveCfg = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|x86.Build.0 = Release|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Debug|ARM.ActiveCfg = Debug|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Debug|ARM.Build.0 = Debug|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Debug|ARM64.Build.0 = Debug|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Debug|x64.ActiveCfg = Debug|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Debug|x64.Build.0 = Debug|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Debug|x86.ActiveCfg = Debug|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Debug|x86.Build.0 = Debug|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Release|Any CPU.Build.0 = Release|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Release|ARM.ActiveCfg = Release|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Release|ARM.Build.0 = Release|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Release|ARM64.ActiveCfg = Release|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Release|ARM64.Build.0 = Release|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Release|x64.ActiveCfg = Release|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Release|x64.Build.0 = Release|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Release|x86.ActiveCfg = Release|Any CPU
{2366AC9B-B662-4550-9486-AF848B4D2961}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1142,7 +1142,7 @@ Global
{E7168B03-68E5-4285-BB95-5660F877577A} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{A49E1C5A-9489-451C-9CE6-CEA586234B84} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{099E047C-F40E-47A3-A5BA-81FC1500D5E8} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625}
{76B6B333-0109-4EE8-A9B2-3E53A7421D92} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
{2366AC9B-B662-4550-9486-AF848B4D2961} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC}


Loading…
Cancel
Save