@@ -0,0 +1,37 @@ | |||||
<Application | |||||
x:Class="BPASmartClient.DosingSystem.App" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters;assembly=BPASmartClient.CustomResource" | |||||
xmlns:local="clr-namespace:BPASmartClient.DosingSystem"> | |||||
<Application.Resources> | |||||
<ResourceDictionary> | |||||
<ResourceDictionary.MergedDictionaries> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecCheckBox.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecTitleBarButton.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/GlobalStyle.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecComboBox.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecIcoButtonStyle.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecToggleButton.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/BeveledRadioButtonStyle.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/DatePickeerDictionary.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecButtonStyle.xaml" /> | |||||
<ResourceDictionary> | |||||
<con:ColorConverter x:Key="ColorConverter" /> | |||||
<con:TextConverter x:Key="TextConverter" /> | |||||
<con:VisibleTypeConverter x:Key="VisibleTypeConverter" /> | |||||
<con:StatusConverter x:Key="StatusConverter" /> | |||||
<con:StringToIconConverter x:Key="StringToIconConverter" /> | |||||
</ResourceDictionary> | |||||
<ResourceDictionary> | |||||
<ImageBrush x:Key="hbl" ImageSource="/BPASmartClient.CustomResource;component/Image/HBL.png" /> | |||||
<ImageBrush x:Key="dbxt" ImageSource="/BPASmartClient.CustomResource;component/Image/顶部线条.png" /> | |||||
</ResourceDictionary> | |||||
</ResourceDictionary.MergedDictionaries> | |||||
</ResourceDictionary> | |||||
</Application.Resources> | |||||
</Application> |
@@ -0,0 +1,188 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Collections.ObjectModel; | |||||
using System.Configuration; | |||||
using System.Data; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
using System.Windows; | |||||
using BPASmartClient.CustomResource.Pages.Enums; | |||||
using BPASmartClient.CustomResource.Pages.Model; | |||||
using BPASmartClient.CustomResource.Pages.View; | |||||
using BPASmartClient.DosingSystem.Model; | |||||
using BPASmartClient.DosingSystem.View; | |||||
using BPASmartClient.Helper; | |||||
namespace BPASmartClient.DosingSystem | |||||
{ | |||||
/// <summary> | |||||
/// Interaction logic for App.xaml | |||||
/// </summary> | |||||
public partial class App : Application | |||||
{ | |||||
protected override void OnStartup(StartupEventArgs e) | |||||
{ | |||||
base.OnStartup(e); | |||||
MenuInit(); | |||||
DataInit(); | |||||
MainView mv = new MainView(); | |||||
LoginView lv = new LoginView(); | |||||
var res = lv.ShowDialog(); | |||||
if (res != null && res == true) | |||||
mv.Show(); | |||||
else | |||||
mv.Close(); | |||||
//MainWindow mw = new MainWindow(); | |||||
//LoginView lv = new LoginView(); | |||||
//var res = lv.ShowDialog(); | |||||
//if (res != null && res == true) | |||||
// mw.Show(); | |||||
//else | |||||
// mw.Close(); | |||||
} | |||||
protected override void OnExit(ExitEventArgs e) | |||||
{ | |||||
base.OnExit(e); | |||||
Json<LocaPar>.Save(); | |||||
MessageLog.GetInstance.LogSave(); | |||||
} | |||||
private void MenuInit() | |||||
{ | |||||
#region 配方管理菜单 | |||||
ObservableCollection<SubMenumodel> RecipeManage = new ObservableCollection<SubMenumodel>(); | |||||
RecipeManage.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "配方管理", | |||||
SubMenuPermission = new Permission[] { Permission.管理员 }, | |||||
AssemblyName = "BPASmartClient.DosingSystem", | |||||
ToggleWindowPath = "View.RecipeSettingsView" | |||||
}); | |||||
RecipeManage.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "配方下发", | |||||
SubMenuPermission = new Permission[] { Permission.操作员 }, | |||||
AssemblyName = "BPASmartClient.DosingSystem", | |||||
ToggleWindowPath = "View.RecipeControlView" | |||||
}); | |||||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||||
{ | |||||
MainMenuIcon = "", | |||||
MainMenuName = "配方管理", | |||||
Alias = "Recipe Management", | |||||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员 }, | |||||
subMenumodels = RecipeManage, | |||||
}); | |||||
#endregion | |||||
#region 消息日志 | |||||
ObservableCollection<SubMenumodel> InfoLog = new ObservableCollection<SubMenumodel>(); | |||||
InfoLog.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "操作日志", | |||||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | |||||
ToggleWindowPath = "Pages.View.UserLogView" | |||||
}); | |||||
InfoLog.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "运行日志", | |||||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | |||||
ToggleWindowPath = "Pages.View.RunLogView" | |||||
}); | |||||
InfoLog.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "报警记录", | |||||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | |||||
ToggleWindowPath = "Pages.View.AlarmView" | |||||
}); | |||||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||||
{ | |||||
MainMenuIcon = "", | |||||
MainMenuName = "消息日志", | |||||
Alias = "Message Log", | |||||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||||
subMenumodels = InfoLog, | |||||
}); | |||||
#endregion | |||||
#region 硬件设备监控 | |||||
ObservableCollection<SubMenumodel> DeviceMonitor = new ObservableCollection<SubMenumodel>(); | |||||
DeviceMonitor.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "原料设备列表", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.DosingSystem", | |||||
ToggleWindowPath = "View.DeviceListView" | |||||
}); | |||||
DeviceMonitor.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "设备状态", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.DosingSystem", | |||||
ToggleWindowPath = "View.HardwareStatusView" | |||||
}); | |||||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||||
{ | |||||
MainMenuIcon = "", | |||||
MainMenuName = "设备监控", | |||||
Alias = "Device Monitor", | |||||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||||
subMenumodels = DeviceMonitor, | |||||
}); | |||||
#endregion | |||||
#region 用户管理 | |||||
ObservableCollection<SubMenumodel> UserManager = new ObservableCollection<SubMenumodel>(); | |||||
UserManager.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "用户登录", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | |||||
ToggleWindowPath = "Pages.View.LoginView" | |||||
}); | |||||
UserManager.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "密码修改", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | |||||
ToggleWindowPath = "Pages.View.PasswordChangeView" | |||||
}); | |||||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||||
{ | |||||
MainMenuIcon = "", | |||||
MainMenuName = "用户管理", | |||||
Alias = "User Management", | |||||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||||
subMenumodels = UserManager, | |||||
}); | |||||
#endregion | |||||
} | |||||
private void DataInit() | |||||
{ | |||||
Config.GetInstance.Init(); | |||||
Json<LocaPar>.Read(); | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,10 @@ | |||||
using System.Windows; | |||||
[assembly: ThemeInfo( | |||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located | |||||
//(used if a resource is not found in the page, | |||||
// or application resource dictionaries) | |||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located | |||||
//(used if a resource is not found in the page, | |||||
// app, or any theme specific resource dictionaries) | |||||
)] |
@@ -0,0 +1,28 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | |||||
<PropertyGroup> | |||||
<OutputType>WinExe</OutputType> | |||||
<TargetFramework>net6.0-windows</TargetFramework> | |||||
<Nullable>enable</Nullable> | |||||
<UseWPF>true</UseWPF> | |||||
<ApplicationManifest>app.manifest</ApplicationManifest> | |||||
<ApplicationIcon>hbl.ico</ApplicationIcon> | |||||
<PlatformTarget>AnyCPU</PlatformTarget> | |||||
</PropertyGroup> | |||||
<ItemGroup> | |||||
<Content Include="hbl.ico" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<PackageReference Include="BPA.Message" Version="1.0.46" /> | |||||
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" /> | |||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<ProjectReference Include="..\BPASmartClient.CustomResource\BPASmartClient.CustomResource.csproj" /> | |||||
<ProjectReference Include="..\BPASmartClient.Modbus\BPASmartClient.Modbus.csproj" /> | |||||
</ItemGroup> | |||||
</Project> |
@@ -0,0 +1,28 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
using Microsoft.Toolkit.Mvvm.Input; | |||||
namespace BPASmartClient.DosingSystem.Model | |||||
{ | |||||
public class ActionMenu : ObservableObject | |||||
{ | |||||
public string CommandParameter { get { return _mCommandParameter; } set { _mCommandParameter = value; OnPropertyChanged(); } } | |||||
private string _mCommandParameter; | |||||
//public Permission[] permission { get { return _mpermission; } set { _mpermission = value; OnPropertyChanged(); } } | |||||
//private Permission[] _mpermission; | |||||
public string MenuName { get { return _mMenuName; } set { _mMenuName = value; OnPropertyChanged(); } } | |||||
private string _mMenuName; | |||||
//public string NameSpace { get { return _mNameSpace; } set { _mNameSpace = value; OnPropertyChanged(); } } | |||||
//private string _mNameSpace; | |||||
} | |||||
} |
@@ -0,0 +1,44 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.DosingSystem.Model | |||||
{ | |||||
public class DeviceAddress | |||||
{ | |||||
/// <summary> | |||||
/// 设备名称起始地址 | |||||
/// </summary> | |||||
public static string DeviceName { get; set; } = "LW0"; | |||||
/// <summary> | |||||
/// 料仓重量反馈起始地址 | |||||
/// </summary> | |||||
public static string WeightFeedback { get; set; } = "LW204"; | |||||
/// <summary> | |||||
/// 重量设置地址 | |||||
/// </summary> | |||||
public static string WeightSet { get; set; } = "LW200"; | |||||
/// <summary> | |||||
/// 启动信号地址 | |||||
/// </summary> | |||||
public static string Start { get; set; } = "LW210"; | |||||
/// <summary> | |||||
/// 下料重量反馈地址 | |||||
/// </summary> | |||||
public static string CutWeightFeedback { get; set; } = "LW202"; | |||||
/// <summary> | |||||
/// 设备运行状态地址 | |||||
/// </summary> | |||||
public static string RunStatus { get; set; } = "LW206"; | |||||
} | |||||
} |
@@ -0,0 +1,221 @@ | |||||
using BPASmartClient.Helper; | |||||
using BPASmartClient.Message; | |||||
using BPASmartClient.Modbus; | |||||
using BPASmartClient.DosingSystem.ViewModel; | |||||
using System; | |||||
using System.Collections.Concurrent; | |||||
using System.Collections.Generic; | |||||
using System.Diagnostics; | |||||
using System.Linq; | |||||
using System.Net.NetworkInformation; | |||||
using System.Text; | |||||
using System.Threading; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.DosingSystem.Model | |||||
{ | |||||
public class DeviceInquire | |||||
{ | |||||
private volatile static DeviceInquire _Instance; | |||||
public static DeviceInquire GetInstance => _Instance ?? (_Instance = new DeviceInquire()); | |||||
private DeviceInquire() { } | |||||
string IPSegment = "192.168.0."; | |||||
ConcurrentDictionary<string, DeviceStatus> DeviceLists = new ConcurrentDictionary<string, DeviceStatus>(); | |||||
List<string> InvalidIP = new List<string>();//无效 IP 集合 | |||||
List<string> IPLists = new List<string>();//启动 Ping 任务IP集合 | |||||
ConcurrentQueue<string> IPQueues = new ConcurrentQueue<string>();//pincomplete 完成队列 | |||||
public void Init() | |||||
{ | |||||
IpAddressLines(); | |||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
{ | |||||
if (IPQueues.Count >= IPLists.Count) | |||||
IpAddressLines(); | |||||
Thread.Sleep(5000); | |||||
}), "配料机设备上线监听", true); | |||||
} | |||||
public void Rescan() | |||||
{ | |||||
InvalidIP.Clear(); | |||||
} | |||||
public DeviceStatus GetDevice(string ip) | |||||
{ | |||||
if (ip != null) | |||||
{ | |||||
var res = DeviceLists.Values.FirstOrDefault(p => p.IpAddress == ip); | |||||
if (res != null) return res; | |||||
} | |||||
return new DeviceStatus(); | |||||
} | |||||
private void IpAddressLines() | |||||
{ | |||||
IPLists.Clear(); | |||||
IPQueues.Clear(); | |||||
for (int i = 1; i <= 255; i++) | |||||
{ | |||||
if (!InvalidIP.Contains($"{IPSegment}{i}") && !DeviceLists.ContainsKey($"{IPSegment}{i}")) | |||||
{ | |||||
IPLists.Add($"{IPSegment}{i}"); | |||||
} | |||||
} | |||||
IPLists.ForEach((item) => | |||||
{ | |||||
Ping myPing = new Ping(); | |||||
myPing.PingCompleted += new PingCompletedEventHandler(_myPing_PingCompleted); | |||||
myPing.SendAsync(item, 1000, null); | |||||
}); | |||||
} | |||||
private void _myPing_PingCompleted(object sender, PingCompletedEventArgs e) | |||||
{ | |||||
if (e.Reply.Status == IPStatus.Success) | |||||
{ | |||||
string ip = e.Reply.Address.ToString(); | |||||
if (!DeviceLists.ContainsKey(ip)) | |||||
{ | |||||
DeviceStatus DS = new DeviceStatus(); | |||||
DS.modbusTcp.IsReconnect = false; | |||||
DS.modbusTcp.ConnectOk = new Action(() => | |||||
{ | |||||
string DeviceName = DS.modbusTcp.GetString(DeviceAddress.DeviceName, 20); | |||||
if (DeviceName.Length > 0) | |||||
{ | |||||
DeviceLists.TryAdd(ip, DS); | |||||
DeviceLists[ip].Init(DeviceName); | |||||
DeviceLists[ip].modbusTcp.IsReconnect = false; | |||||
App.Current.Dispatcher.Invoke(new Action(() => | |||||
{ | |||||
DeviceListViewModel.devices.Add(new Devices() | |||||
{ | |||||
DeviceName = DeviceName, | |||||
IpAddress = ip | |||||
}); | |||||
for (int i = 0; i < Json<LocaPar>.Data.Recipes.Count; i++) | |||||
{ | |||||
for (int m = 0; m < Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.Count; m++) | |||||
{ | |||||
if (Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp == ip) | |||||
{ | |||||
Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName; | |||||
} | |||||
} | |||||
} | |||||
if (!NewRecipeViewModel.RawMaterialNames.Contains(DeviceName)) | |||||
NewRecipeViewModel.RawMaterialNames.Add(DeviceName); | |||||
})); | |||||
} | |||||
else | |||||
{ | |||||
if (!InvalidIP.Contains(ip)) InvalidIP.Add(ip); | |||||
} | |||||
}); | |||||
DS.modbusTcp.ConnectFail = new Action(() => | |||||
{ | |||||
if (!InvalidIP.Contains(ip)) InvalidIP.Add(ip); | |||||
MessageLog.GetInstance.Show($"{ip}连接失败"); | |||||
}); | |||||
DS.modbusTcp.Disconnect = new Action(() => | |||||
{ | |||||
if (InvalidIP.Contains(ip)) InvalidIP.Remove(ip); | |||||
var res = DeviceListViewModel.devices.FirstOrDefault(P => P.IpAddress == ip); | |||||
if (res != null && DeviceListViewModel.devices.Contains(res)) | |||||
App.Current.Dispatcher.Invoke(new Action(() => | |||||
{ | |||||
DeviceListViewModel.devices.Remove(res); | |||||
if (!NewRecipeViewModel.RawMaterialNames.Contains(res.DeviceName)) | |||||
NewRecipeViewModel.RawMaterialNames.Remove(res.DeviceName); | |||||
})); | |||||
if (DeviceLists.ContainsKey(ip)) DeviceLists[ip].Dispose(); | |||||
}); | |||||
Task.Run(new Action(() => | |||||
{ | |||||
DS.modbusTcp.ModbusTcpConnect(ip, 502); | |||||
IPQueues.Enqueue(e.Reply.Address.ToString()); | |||||
})); | |||||
} | |||||
else IPQueues.Enqueue(e.Reply.Address.ToString()); | |||||
} | |||||
else IPQueues.Enqueue(e.Reply.Address.ToString()); | |||||
} | |||||
} | |||||
public class DeviceStatus | |||||
{ | |||||
#region 对象属性声明 | |||||
public string DeviceName = String.Empty; | |||||
public string IpAddress => modbusTcp.IPAdress; | |||||
/// <summary> | |||||
/// 设备状态 | |||||
/// </summary> | |||||
public RawMaterialDeviceStatus deviceStatus { get; set; } = new RawMaterialDeviceStatus(); | |||||
public ModbusTcp modbusTcp = new ModbusTcp(); | |||||
public bool IsConnected => modbusTcp.Connected; | |||||
#endregion | |||||
public void Init(string DeviceName) | |||||
{ | |||||
this.DeviceName = DeviceName; | |||||
if (modbusTcp.Connected) | |||||
{ | |||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
{ | |||||
//获取设备运行状态 | |||||
var res = this.modbusTcp.Read(DeviceAddress.RunStatus); | |||||
if (res != null && res is ushort[] ushortValue) | |||||
{ | |||||
if (ushortValue.Length >= 1) deviceStatus.RunStatus = ushortValue[0]; | |||||
} | |||||
//获取设备料仓剩余重量 | |||||
deviceStatus.WeightFeedback = this.modbusTcp.GetUint(DeviceAddress.WeightFeedback) * 10; | |||||
Thread.Sleep(100); | |||||
}), $"{DeviceName} 开始监听", true); | |||||
} | |||||
} | |||||
public void SetDeviceName(string name) | |||||
{ | |||||
this.modbusTcp.Write(DeviceAddress.DeviceName, new ushort[20]); | |||||
this.modbusTcp.SetString(DeviceAddress.DeviceName, name); | |||||
} | |||||
public void StatusReset() | |||||
{ | |||||
this.modbusTcp.Write(DeviceAddress.RunStatus, (ushort)0); | |||||
} | |||||
public void Dispose() | |||||
{ | |||||
ThreadManage.GetInstance().StopTask($"{DeviceName} 开始监听"); | |||||
} | |||||
public void Start(uint Value) | |||||
{ | |||||
if (modbusTcp.Connected) | |||||
{ | |||||
modbusTcp.SetUint(DeviceAddress.WeightSet, Value);//写入配方量 | |||||
modbusTcp.Write(DeviceAddress.Start, (ushort)1);//设备启动写入 | |||||
} | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,15 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using System.Collections.ObjectModel; | |||||
using BPASmartClient.DosingSystem.ViewModel; | |||||
namespace BPASmartClient.DosingSystem.Model | |||||
{ | |||||
public class LocaPar | |||||
{ | |||||
public ObservableCollection<RecipeModel> Recipes { get; set; } = new ObservableCollection<RecipeModel>(); | |||||
} | |||||
} |
@@ -0,0 +1,45 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.DosingSystem.Model | |||||
{ | |||||
public class RawMaterialDeviceStatus | |||||
{ | |||||
/// <summary> | |||||
/// 原料类型 | |||||
/// 1:液体 | |||||
/// 2:膏体 | |||||
/// 3:粉体 | |||||
/// </summary> | |||||
public ushort RawMaterialType { get; set; } | |||||
/// <summary> | |||||
/// 料仓重量反馈 | |||||
/// </summary> | |||||
public float WeightFeedback { get; set; } | |||||
/// <summary> | |||||
/// 上限反馈 | |||||
/// </summary> | |||||
public bool UpLimitFeedback { get; set; } | |||||
/// <summary> | |||||
/// 下限反馈 | |||||
/// </summary> | |||||
public bool DownLimitFeedback { get; set; } | |||||
/// <summary> | |||||
/// 下料重量反馈 | |||||
/// </summary> | |||||
public float CutWeightFeedback { get; set; } | |||||
/// <summary> | |||||
/// 设备运行状态 | |||||
/// </summary> | |||||
public ushort RunStatus { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,88 @@ | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.DosingSystem.Model | |||||
{ | |||||
/// <summary> | |||||
/// 原料模块 | |||||
/// </summary> | |||||
public class RawMaterialModel : ObservableObject | |||||
{ | |||||
/// <summary> | |||||
/// 原料名称 | |||||
/// </summary> | |||||
public string RawMaterialName { get { return _mRawMaterialName; } set { _mRawMaterialName = value; OnPropertyChanged(); } } | |||||
private string _mRawMaterialName; | |||||
/// <summary> | |||||
/// 原料设备IP | |||||
/// </summary> | |||||
public string DeviceIp { get; set; } | |||||
/// <summary> | |||||
/// 原料重量设置 | |||||
/// </summary> | |||||
public uint RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; OnPropertyChanged(); } } | |||||
private uint _mRawMaterialWeight; | |||||
/// <summary> | |||||
/// 原料类型 MW18 | |||||
/// 1:液体 | |||||
/// 2:膏体 | |||||
/// 3:粉体 | |||||
/// </summary> | |||||
[Newtonsoft.Json.JsonIgnore] | |||||
public ushort RawMaterialType { get { return _mRawMaterialType; } set { _mRawMaterialType = value; OnPropertyChanged(); } } | |||||
private ushort _mRawMaterialType; | |||||
/// <summary> | |||||
/// 料仓重量反馈 MD40 | |||||
/// </summary> | |||||
[Newtonsoft.Json.JsonIgnore] | |||||
public float WeightFeedback { get { return _mWeightFeedback; } set { _mWeightFeedback = value; OnPropertyChanged(); } } | |||||
private float _mWeightFeedback; | |||||
/// <summary> | |||||
/// 上限反馈 | |||||
/// </summary> | |||||
[Newtonsoft.Json.JsonIgnore] | |||||
public bool UpLimtFeedback { get { return _mUpLimtFeedback; } set { _mUpLimtFeedback = value; OnPropertyChanged(); } } | |||||
private bool _mUpLimtFeedback; | |||||
/// <summary> | |||||
/// 下限反馈 | |||||
/// </summary> | |||||
[Newtonsoft.Json.JsonIgnore] | |||||
public bool DownLimtFeedback { get { return _mDownLimtFeedback; } set { _mDownLimtFeedback = value; OnPropertyChanged(); } } | |||||
private bool _mDownLimtFeedback; | |||||
/// <summary> | |||||
/// 下料重量反馈 MD52 | |||||
/// </summary> | |||||
[Newtonsoft.Json.JsonIgnore] | |||||
public float UpLimtWeightFeedback { get { return _mUpLimtWeightFeedback; } set { _mUpLimtWeightFeedback = value; OnPropertyChanged(); } } | |||||
private float _mUpLimtWeightFeedback; | |||||
/// <summary> | |||||
/// 原料ID | |||||
/// </summary> | |||||
public string RawMaterialId { get { return _mRawMaterialId; } set { _mRawMaterialId = value; OnPropertyChanged(); } } | |||||
private string _mRawMaterialId; | |||||
/// <summary> | |||||
/// 原料设备执行状态 | |||||
/// 1:空闲状态 | |||||
/// 2:下料中 | |||||
/// 3:下料完成 | |||||
/// </summary> | |||||
[Newtonsoft.Json.JsonIgnore] | |||||
public ushort RecipeStatus { get { return _mRecipeStatus; } set { _mRecipeStatus = value; OnPropertyChanged(); } } | |||||
private ushort _mRecipeStatus = 1; | |||||
} | |||||
} |
@@ -0,0 +1,51 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Collections.ObjectModel; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading; | |||||
using System.Threading.Tasks; | |||||
using BPASmartClient.DosingSystem.ViewModel; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
namespace BPASmartClient.DosingSystem.Model | |||||
{ | |||||
/// <summary> | |||||
/// 配方模块 | |||||
/// </summary> | |||||
public class RecipeModel : ObservableObject | |||||
{ | |||||
[Newtonsoft.Json.JsonIgnore] | |||||
public bool IsEnable { get { return _mIsEnable; } set { _mIsEnable = value; OnPropertyChanged(); } } | |||||
private bool _mIsEnable = true; | |||||
/// <summary> | |||||
/// 序号 | |||||
/// </summary> | |||||
public int SerialNum { get { return _mSerialNum; } set { _mSerialNum = value; OnPropertyChanged(); } } | |||||
private int _mSerialNum; | |||||
/// <summary> | |||||
/// 配方名称 | |||||
/// </summary> | |||||
public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; OnPropertyChanged(); } } | |||||
private string _mRecipeName; | |||||
/// <summary> | |||||
/// 配方编码 | |||||
/// </summary> | |||||
public string RecipCode { get { return _mRecipCode; } set { _mRecipCode = value; OnPropertyChanged(); } } | |||||
private string _mRecipCode; | |||||
[Newtonsoft.Json.JsonIgnore] | |||||
public AutoResetEvent Are { get; set; } = new AutoResetEvent(false); | |||||
/// <summary> | |||||
/// 原料集合 | |||||
/// </summary> | |||||
public ObservableCollection<RawMaterialModel> RawMaterials { get; set; } = new ObservableCollection<RawMaterialModel>(); | |||||
} | |||||
} |
@@ -0,0 +1,380 @@ | |||||
<UserControl | |||||
x:Class="BPASmartClient.DosingSystem.View.AlarmRecordView" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||||
xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel" | |||||
d:DesignHeight="450" | |||||
d:DesignWidth="800" | |||||
mc:Ignorable="d"> | |||||
<UserControl.DataContext> | |||||
<vm:AlarmRecordViewModel /> | |||||
</UserControl.DataContext> | |||||
<UserControl.Resources> | |||||
<ResourceDictionary> | |||||
<ResourceDictionary.MergedDictionaries> | |||||
<ResourceDictionary> | |||||
<!--<convert:TextDisplayConvert x:Key="textDisplayConvert" /> | |||||
<convert:IsEnableConvert x:Key="isEnableConvert" /> | |||||
<convert:AnalogAlarmConvert x:Key="analogAlarmConvert" /> | |||||
<convert:DiscreteAlarmConvert x:Key="discreteAlarmConvert" /> | |||||
<convert:AlarmTypeTextConvert x:Key="alarmTypeTextConvert" />--> | |||||
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" /> | |||||
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" /> | |||||
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" /> | |||||
<SolidColorBrush x:Key="CursorColor" Color="Aqua" /> | |||||
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" /> | |||||
<Style x:Key="TextBlockStyle" TargetType="TextBlock"> | |||||
<Setter Property="FontFamily" Value="楷体" /> | |||||
<Setter Property="FontSize" Value="18" /> | |||||
<Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" /> | |||||
<Setter Property="VerticalAlignment" Value="Center" /> | |||||
<Setter Property="HorizontalAlignment" Value="Center" /> | |||||
</Style> | |||||
<Style x:Key="TextBoxStyle" TargetType="TextBox"> | |||||
<Setter Property="FontFamily" Value="楷体" /> | |||||
<Setter Property="FontSize" Value="22" /> | |||||
<Setter Property="Background" Value="Transparent" /> | |||||
<Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" /> | |||||
<Setter Property="BorderBrush" Value="#FF23CACA" /> | |||||
<Setter Property="CaretBrush" Value="Aqua" /> | |||||
<Setter Property="VerticalAlignment" Value="Center" /> | |||||
</Style> | |||||
<Style x:Key="DataTextBlockStyle" TargetType="TextBlock"> | |||||
<Setter Property="HorizontalAlignment" Value="Center" /> | |||||
<Setter Property="VerticalAlignment" Value="Center" /> | |||||
<Setter Property="Background" Value="Transparent" /> | |||||
<Setter Property="Foreground" Value="Red" /> | |||||
<Setter Property="FontSize" Value="14" /> | |||||
</Style> | |||||
<ControlTemplate x:Key="ButTemplate" TargetType="Button"> | |||||
<Border | |||||
x:Name="br" | |||||
Background="Transparent" | |||||
BorderBrush="#FF19B7EC" | |||||
BorderThickness="2"> | |||||
<StackPanel | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
Orientation="Horizontal"> | |||||
<ContentControl | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
Content="{TemplateBinding Content}" | |||||
Foreground="{TemplateBinding Foreground}" /> | |||||
</StackPanel> | |||||
</Border> | |||||
<ControlTemplate.Triggers> | |||||
<Trigger Property="IsMouseOver" Value="True"> | |||||
<Setter TargetName="br" Property="Background" Value="#2219B7EC" /> | |||||
</Trigger> | |||||
<Trigger Property="IsPressed" Value="true"> | |||||
<Setter TargetName="br" Property="Background" Value="#2219B7EC" /> | |||||
</Trigger> | |||||
</ControlTemplate.Triggers> | |||||
</ControlTemplate> | |||||
</ResourceDictionary> | |||||
</ResourceDictionary.MergedDictionaries> | |||||
</ResourceDictionary> | |||||
</UserControl.Resources> | |||||
<Grid Margin="10"> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="50" /> | |||||
<RowDefinition Height="30" /> | |||||
<RowDefinition /> | |||||
</Grid.RowDefinitions> | |||||
<StackPanel | |||||
Margin="0,8" | |||||
HorizontalAlignment="Right" | |||||
Orientation="Horizontal"> | |||||
<DatePicker | |||||
Background="Transparent" | |||||
BorderBrush="#aa3aa7f3" | |||||
BorderThickness="2" | |||||
SelectedDate="{Binding StartDateTime}" | |||||
Style="{StaticResource PickerStyle}" | |||||
Text="请输入开始时间" | |||||
Visibility="{Binding IsVisibility}" /> | |||||
<DatePicker | |||||
Margin="20,0,20,0" | |||||
Background="Transparent" | |||||
BorderBrush="#aa3aa7f3" | |||||
BorderThickness="2" | |||||
SelectedDate="{Binding EndDateTime}" | |||||
Style="{StaticResource PickerStyle}" | |||||
Text="请输入结束时间" | |||||
Visibility="{Binding IsVisibility}" /> | |||||
<Button | |||||
Width="140" | |||||
Height="30" | |||||
Background="#FF19B7EC" | |||||
Command="{Binding ControlCommand}" | |||||
Content="{Binding ControlButText}" | |||||
FontFamily="楷体" | |||||
FontSize="18" | |||||
Template="{StaticResource ButTemplate}"> | |||||
<Button.Foreground> | |||||
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> | |||||
<GradientStop Color="#FFBB662A" /> | |||||
<GradientStop Offset="1" Color="White" /> | |||||
</LinearGradientBrush> | |||||
</Button.Foreground> | |||||
</Button> | |||||
<Button | |||||
Width="140" | |||||
Height="30" | |||||
Margin="20,0,0,0" | |||||
Background="#FF19B7EC" | |||||
Command="{Binding SwitchCommand}" | |||||
Content="{Binding ButContent}" | |||||
FontFamily="楷体" | |||||
FontSize="18" | |||||
Template="{StaticResource ButTemplate}"> | |||||
<Button.Foreground> | |||||
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> | |||||
<GradientStop Color="#FFBB662A" /> | |||||
<GradientStop Offset="1" Color="White" /> | |||||
</LinearGradientBrush> | |||||
</Button.Foreground> | |||||
</Button> | |||||
</StackPanel> | |||||
<!--#region 表格标题栏设置--> | |||||
<Grid Grid.Row="1" Background="#dd2AB2E7"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition Width="0.3*" /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition Width="0.5*" /> | |||||
</Grid.ColumnDefinitions> | |||||
<TextBlock | |||||
Grid.Column="0" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="ID" /> | |||||
<Grid Grid.Column="1"> | |||||
<TextBlock | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="报警日期" /> | |||||
<Border | |||||
BorderBrush="{StaticResource TitleBorderColor}" | |||||
BorderThickness="1,0,1,0" | |||||
Cursor="SizeWE" /> | |||||
</Grid> | |||||
<TextBlock | |||||
Grid.Column="2" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="报警时间" /> | |||||
<Grid Grid.Column="3"> | |||||
<TextBlock | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="报警信息" /> | |||||
<Border | |||||
BorderBrush="{StaticResource TitleBorderColor}" | |||||
BorderThickness="1,0,1,0" | |||||
Cursor="SizeWE" /> | |||||
</Grid> | |||||
<TextBlock | |||||
Grid.Column="4" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="报警值" /> | |||||
<Grid Grid.Column="5"> | |||||
<TextBlock | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="报警等级" /> | |||||
<Border | |||||
BorderBrush="{StaticResource TitleBorderColor}" | |||||
BorderThickness="1,0,1,0" | |||||
Cursor="SizeWE" /> | |||||
</Grid> | |||||
</Grid> | |||||
<!--#endregion--> | |||||
<!--#region 表格数据显示--> | |||||
<ScrollViewer | |||||
Grid.Row="2" | |||||
HorizontalScrollBarVisibility="Hidden" | |||||
VerticalScrollBarVisibility="Hidden"> | |||||
<Grid> | |||||
<!--#region 实时报警信息--> | |||||
<ItemsControl ItemsSource="{Binding AlarmInfos}" Visibility="{Binding CurrentDataVis}"> | |||||
<ItemsControl.ItemTemplate> | |||||
<DataTemplate> | |||||
<Grid x:Name="gr" Height="30"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition Width="0.3*" /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition Width="0.5*" /> | |||||
</Grid.ColumnDefinitions> | |||||
<TextBlock | |||||
Grid.Column="0" | |||||
Style="{StaticResource DataTextBlockStyle}" | |||||
Text="{Binding NumId}" /> | |||||
<Grid Grid.Column="1"> | |||||
<TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Date}" /> | |||||
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" /> | |||||
</Grid> | |||||
<TextBlock | |||||
Grid.Column="2" | |||||
Style="{StaticResource DataTextBlockStyle}" | |||||
Text="{Binding Time}" /> | |||||
<Grid Grid.Column="3"> | |||||
<TextBlock | |||||
Margin="10,0,0,0" | |||||
HorizontalAlignment="Left" | |||||
Style="{StaticResource DataTextBlockStyle}" | |||||
Text="{Binding Info}" /> | |||||
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" /> | |||||
</Grid> | |||||
<TextBlock | |||||
Grid.Column="4" | |||||
Style="{StaticResource DataTextBlockStyle}" | |||||
Text="{Binding Value}" /> | |||||
<Grid Grid.Column="5"> | |||||
<TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Grade}" /> | |||||
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" /> | |||||
</Grid> | |||||
<Border | |||||
Grid.ColumnSpan="6" | |||||
BorderBrush="{StaticResource BorderSolid}" | |||||
BorderThickness="1" /> | |||||
</Grid> | |||||
<DataTemplate.Triggers> | |||||
<Trigger Property="IsMouseOver" Value="true"> | |||||
<Setter TargetName="gr" Property="Background" Value="#112AB2E7" /> | |||||
</Trigger> | |||||
</DataTemplate.Triggers> | |||||
</DataTemplate> | |||||
</ItemsControl.ItemTemplate> | |||||
</ItemsControl> | |||||
<!--#endregion--> | |||||
<!--#region 历史报警信息--> | |||||
<ItemsControl ItemsSource="{Binding HistoryAlarm}" Visibility="{Binding HistoryDataVis}"> | |||||
<ItemsControl.ItemTemplate> | |||||
<DataTemplate> | |||||
<Grid x:Name="gr" Height="30"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition Width="0.3*" /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition Width="0.5*" /> | |||||
</Grid.ColumnDefinitions> | |||||
<TextBlock | |||||
Grid.Column="0" | |||||
Style="{StaticResource DataTextBlockStyle}" | |||||
Text="{Binding Id}" /> | |||||
<Grid Grid.Column="1"> | |||||
<TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Date}" /> | |||||
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" /> | |||||
</Grid> | |||||
<TextBlock | |||||
Grid.Column="2" | |||||
Style="{StaticResource DataTextBlockStyle}" | |||||
Text="{Binding Time}" /> | |||||
<Grid Grid.Column="3"> | |||||
<TextBlock | |||||
Margin="10,0,0,0" | |||||
HorizontalAlignment="Left" | |||||
Style="{StaticResource DataTextBlockStyle}" | |||||
Text="{Binding Info}" /> | |||||
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" /> | |||||
</Grid> | |||||
<TextBlock | |||||
Grid.Column="4" | |||||
Style="{StaticResource DataTextBlockStyle}" | |||||
Text="{Binding Value}" /> | |||||
<Grid Grid.Column="5"> | |||||
<TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Grade}" /> | |||||
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" /> | |||||
</Grid> | |||||
<Border | |||||
Grid.ColumnSpan="6" | |||||
BorderBrush="{StaticResource BorderSolid}" | |||||
BorderThickness="1" /> | |||||
</Grid> | |||||
<DataTemplate.Triggers> | |||||
<Trigger Property="IsMouseOver" Value="true"> | |||||
<Setter TargetName="gr" Property="Background" Value="#112AB2E7" /> | |||||
</Trigger> | |||||
</DataTemplate.Triggers> | |||||
</DataTemplate> | |||||
</ItemsControl.ItemTemplate> | |||||
</ItemsControl> | |||||
<!--#endregion--> | |||||
</Grid> | |||||
</ScrollViewer> | |||||
<!--#endregion--> | |||||
</Grid> | |||||
</UserControl> |
@@ -0,0 +1,28 @@ | |||||
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.DosingSystem.View | |||||
{ | |||||
/// <summary> | |||||
/// AlarmRecordView.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class AlarmRecordView : UserControl | |||||
{ | |||||
public AlarmRecordView() | |||||
{ | |||||
InitializeComponent(); | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,122 @@ | |||||
<Window | |||||
x:Class="BPASmartClient.DosingSystem.View.ChangeDeviceNameView" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel" | |||||
Title="ChangeDeviceNameView" | |||||
Width="400" | |||||
Height="200" | |||||
AllowsTransparency="True" | |||||
Background="{x:Null}" | |||||
Topmost="True" | |||||
WindowStartupLocation="CenterScreen" | |||||
WindowStyle="None" | |||||
mc:Ignorable="d"> | |||||
<Window.DataContext> | |||||
<vm:ChangeDeviceNameViewModel /> | |||||
</Window.DataContext> | |||||
<Window.Resources> | |||||
<ResourceDictionary> | |||||
<ResourceDictionary.MergedDictionaries> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" /> | |||||
<ResourceDictionary> | |||||
<!--#region ListBox样式--> | |||||
<Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}"> | |||||
<Setter Property="OverridesDefaultStyle" Value="True" /> | |||||
<Setter Property="SnapsToDevicePixels" Value="True" /> | |||||
<Setter Property="BorderBrush" Value="{x:Null}" /> | |||||
<Setter Property="Foreground" Value="White" /> | |||||
<Setter Property="FontSize" Value="20" /> | |||||
<Setter Property="HorizontalContentAlignment" Value="Center" /> | |||||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||||
<Setter Property="Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate TargetType="{x:Type ListBoxItem}"> | |||||
<Border x:Name="border" CornerRadius="8"> | |||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> | |||||
</Border> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style> | |||||
<!--#endregion--> | |||||
</ResourceDictionary> | |||||
</ResourceDictionary.MergedDictionaries> | |||||
</ResourceDictionary> | |||||
</Window.Resources> | |||||
<Border | |||||
Name="br" | |||||
Background="#FF0B2F5F" | |||||
BorderThickness="1"> | |||||
<Grid> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition /> | |||||
<RowDefinition Height="0.5*" /> | |||||
<RowDefinition /> | |||||
</Grid.RowDefinitions> | |||||
<StackPanel | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
Orientation="Horizontal"> | |||||
<TextBlock | |||||
Margin="10,0,0,0" | |||||
Background="Transparent" | |||||
FontSize="20" | |||||
Foreground="#FF2AB2E7" | |||||
Text="请输入新设备名称:" /> | |||||
<TextBox | |||||
Grid.Column="1" | |||||
Width="200" | |||||
Height="30" | |||||
Margin="0,0,7,0" | |||||
FontSize="16" | |||||
Text="{Binding DeviceName}" /> | |||||
</StackPanel> | |||||
<TextBlock | |||||
Grid.Row="1" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
Background="Transparent" | |||||
FontSize="16" | |||||
Foreground="Red" | |||||
Text="{Binding ErrorInfo}" /> | |||||
<Grid Grid.Row="2"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
</Grid.ColumnDefinitions> | |||||
<Button | |||||
Grid.Column="1" | |||||
Width="148" | |||||
Height="30" | |||||
Margin="0,0,7,0" | |||||
Command="{Binding ConfirmCommand}" | |||||
Content="确认" /> | |||||
<Button | |||||
Name="btClose" | |||||
Width="148" | |||||
Height="30" | |||||
Command="{Binding CancleCommand}" | |||||
Content="取消" /> | |||||
</Grid> | |||||
</Grid> | |||||
</Border> | |||||
</Window> |
@@ -0,0 +1,31 @@ | |||||
using BPASmartClient.Helper; | |||||
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.Shapes; | |||||
namespace BPASmartClient.DosingSystem.View | |||||
{ | |||||
/// <summary> | |||||
/// ChangeDeviceNameView.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class ChangeDeviceNameView : Window | |||||
{ | |||||
public ChangeDeviceNameView() | |||||
{ | |||||
InitializeComponent(); | |||||
ActionManage.GetInstance.CancelRegister("ChangeDeviceNameViewClose"); | |||||
ActionManage.GetInstance.Register(new Action(() => { this.Close(); }), "ChangeDeviceNameViewClose"); | |||||
this.br.MouseLeftButtonDown += (o, e) => { if (e.LeftButton == MouseButtonState.Pressed) this.DragMove(); }; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,143 @@ | |||||
<UserControl | |||||
x:Class="BPASmartClient.DosingSystem.View.DeviceListView" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||||
xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel" | |||||
d:DesignHeight="450" | |||||
d:DesignWidth="800" | |||||
mc:Ignorable="d"> | |||||
<UserControl.DataContext> | |||||
<vm:DeviceListViewModel /> | |||||
</UserControl.DataContext> | |||||
<UserControl.Resources> | |||||
<Style x:Key="UserItemContainerStyle" TargetType="ListBoxItem"> | |||||
<Style.Resources> | |||||
<!-- SelectedItem with focus --> | |||||
<SolidColorBrush | |||||
x:Key="{x:Static SystemColors.HighlightBrushKey}" | |||||
Opacity=".4" | |||||
Color="White" /> | |||||
<!-- SelectedItem without focus --> | |||||
<SolidColorBrush | |||||
x:Key="{x:Static SystemColors.ControlBrushKey}" | |||||
Opacity=".4" | |||||
Color="White" /> | |||||
</Style.Resources> | |||||
<!-- 设置触发器 --> | |||||
<Style.Triggers> | |||||
<Trigger Property="IsMouseOver" Value="true"> | |||||
<Setter Property="Background" Value="White" /> | |||||
<Setter Property="Foreground" Value="White" /> | |||||
</Trigger> | |||||
<Trigger Property="IsFocused" Value="true"> | |||||
<Setter Property="Background" Value="White" /> | |||||
<Setter Property="Foreground" Value="White" /> | |||||
</Trigger> | |||||
</Style.Triggers> | |||||
</Style> | |||||
</UserControl.Resources> | |||||
<Grid> | |||||
<Grid> | |||||
<ListView | |||||
Grid.Column="1" | |||||
Margin="10" | |||||
Background="Transparent" | |||||
BorderBrush="#00BEFA" | |||||
BorderThickness="0" | |||||
ItemsSource="{Binding devices}" | |||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"> | |||||
<ListView.ItemsPanel> | |||||
<ItemsPanelTemplate> | |||||
<UniformGrid | |||||
HorizontalAlignment="Left" | |||||
VerticalAlignment="Top" | |||||
Columns="4" /> | |||||
</ItemsPanelTemplate> | |||||
</ListView.ItemsPanel> | |||||
<ListView.ItemTemplate> | |||||
<DataTemplate> | |||||
<Border | |||||
Name="ShadowElement" | |||||
Height="150" | |||||
VerticalAlignment="Top" | |||||
BorderBrush="#00BEFA" | |||||
BorderThickness="2" | |||||
ClipToBounds="True" | |||||
CornerRadius="8"> | |||||
<Border.Effect> | |||||
<DropShadowEffect | |||||
BlurRadius="18" | |||||
ShadowDepth="0" | |||||
Color="#00BEFA" /> | |||||
</Border.Effect> | |||||
<Grid Margin="20,0,20,0"> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition /> | |||||
<RowDefinition /> | |||||
</Grid.RowDefinitions> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
</Grid.ColumnDefinitions> | |||||
<TextBlock | |||||
Grid.Row="0" | |||||
Grid.ColumnSpan="2" | |||||
VerticalAlignment="Bottom" | |||||
FontSize="40" | |||||
Foreground="#00BEFA" | |||||
Text="{Binding DeviceName}" /> | |||||
<StackPanel | |||||
Grid.Row="1" | |||||
Grid.ColumnSpan="2" | |||||
Orientation="Horizontal"> | |||||
<TextBlock | |||||
Grid.Row="1" | |||||
FontSize="14" | |||||
Foreground="Aqua" | |||||
Text="设备IP:" /> | |||||
<TextBlock | |||||
Grid.Row="1" | |||||
FontSize="14" | |||||
Foreground="Aqua" | |||||
Text="{Binding IpAddress}" /> | |||||
</StackPanel> | |||||
<Button | |||||
Grid.Row="1" | |||||
Grid.Column="0" | |||||
Grid.ColumnSpan="2" | |||||
Width="130" | |||||
Height="30" | |||||
Margin="0,0,0,10" | |||||
HorizontalAlignment="Left" | |||||
VerticalAlignment="Bottom" | |||||
Command="{Binding DataContext.ChangeNameCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}" | |||||
CommandParameter="{Binding IpAddress}" | |||||
Content="修改设备名称" | |||||
IsEnabled="{Binding IsEnable}" /> | |||||
</Grid> | |||||
</Border> | |||||
</DataTemplate> | |||||
</ListView.ItemTemplate> | |||||
</ListView> | |||||
</Grid> | |||||
</Grid> | |||||
</UserControl> |
@@ -0,0 +1,28 @@ | |||||
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.DosingSystem.View | |||||
{ | |||||
/// <summary> | |||||
/// DeviceListView.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class DeviceListView : UserControl | |||||
{ | |||||
public DeviceListView() | |||||
{ | |||||
InitializeComponent(); | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,27 @@ | |||||
<UserControl | |||||
x:Class="BPASmartClient.DosingSystem.View.HardwareStatusView" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||||
xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel" | |||||
d:DesignHeight="450" | |||||
d:DesignWidth="800" | |||||
mc:Ignorable="d"> | |||||
<UserControl.DataContext> | |||||
<vm:HardwareStatusViewModel /> | |||||
</UserControl.DataContext> | |||||
<Grid> | |||||
<TextBlock | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="40" | |||||
Foreground="Wheat" | |||||
Text="硬件状态" /> | |||||
</Grid> | |||||
</UserControl> |
@@ -0,0 +1,28 @@ | |||||
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.DosingSystem.View | |||||
{ | |||||
/// <summary> | |||||
/// HardwareStatusView.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class HardwareStatusView : UserControl | |||||
{ | |||||
public HardwareStatusView() | |||||
{ | |||||
InitializeComponent(); | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,251 @@ | |||||
<Window | |||||
x:Class="BPASmartClient.DosingSystem.View.MainWindow" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:local="clr-namespace:BPASmartClient.DosingSystem" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||||
xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel" | |||||
Title="MainWindow" | |||||
Width="1300" | |||||
Height="800" | |||||
AllowsTransparency="True" | |||||
Background="{x:Null}" | |||||
Topmost="False" | |||||
WindowStartupLocation="CenterScreen" | |||||
WindowStyle="None" | |||||
mc:Ignorable="d"> | |||||
<Window.Resources> | |||||
<ResourceDictionary> | |||||
<ResourceDictionary.MergedDictionaries> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" /> | |||||
<ResourceDictionary> | |||||
<!--#region ListBox样式--> | |||||
<Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}"> | |||||
<Setter Property="OverridesDefaultStyle" Value="True" /> | |||||
<Setter Property="SnapsToDevicePixels" Value="True" /> | |||||
<Setter Property="BorderBrush" Value="{x:Null}" /> | |||||
<Setter Property="Foreground" Value="White" /> | |||||
<Setter Property="FontSize" Value="20" /> | |||||
<Setter Property="HorizontalContentAlignment" Value="Center" /> | |||||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||||
<Setter Property="Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate TargetType="{x:Type ListBoxItem}"> | |||||
<Border x:Name="border" CornerRadius="8"> | |||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> | |||||
</Border> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style> | |||||
<!--#endregion--> | |||||
</ResourceDictionary> | |||||
</ResourceDictionary.MergedDictionaries> | |||||
</ResourceDictionary> | |||||
</Window.Resources> | |||||
<Window.DataContext> | |||||
<vm:MainViewModel /> | |||||
</Window.DataContext> | |||||
<Border x:Name="br" Style="{DynamicResource border主窗体背景}"> | |||||
<Grid> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="60" /> | |||||
<RowDefinition /> | |||||
</Grid.RowDefinitions> | |||||
<!-- 标题 --> | |||||
<Grid Grid.Row="0"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition Width="300" /> | |||||
<ColumnDefinition /> | |||||
</Grid.ColumnDefinitions> | |||||
<Border | |||||
Grid.ColumnSpan="2" | |||||
Height="52" | |||||
VerticalAlignment="Top" | |||||
Style="{DynamicResource bordertop矩形}" /> | |||||
<Border Style="{DynamicResource bordertopL}" /> | |||||
<Image | |||||
Margin="20,0,0,0" | |||||
VerticalAlignment="Center" | |||||
Style="{DynamicResource imagetop_Title}" /> | |||||
<Grid Grid.Column="1"> | |||||
<ListBox | |||||
x:Name="lstEnt" | |||||
Background="{x:Null}" | |||||
BorderBrush="{x:Null}" | |||||
BorderThickness="0" | |||||
ItemContainerStyle="{StaticResource ResourceKey=ListBoxItemStyle1}" | |||||
ItemsSource="{Binding Menus}"> | |||||
<ListBox.ItemsPanel> | |||||
<ItemsPanelTemplate> | |||||
<StackPanel Orientation="Horizontal" /> | |||||
</ItemsPanelTemplate> | |||||
</ListBox.ItemsPanel> | |||||
<ListBox.ItemTemplate> | |||||
<DataTemplate> | |||||
<RadioButton | |||||
Command="{Binding DataContext.TogglePag, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}" | |||||
CommandParameter="{Binding CommandParameter}" | |||||
Content="{Binding MenuName}" | |||||
GroupName="all" | |||||
Style="{StaticResource MenuRadioButtonStyle}" /> | |||||
</DataTemplate> | |||||
</ListBox.ItemTemplate> | |||||
</ListBox> | |||||
</Grid> | |||||
<StackPanel | |||||
Grid.Column="4" | |||||
Height="50" | |||||
HorizontalAlignment="Right" | |||||
VerticalAlignment="Top" | |||||
Orientation="Horizontal"> | |||||
<Border Style="{DynamicResource border竖线}" /> | |||||
<Grid> | |||||
<ToggleButton | |||||
Name="tb" | |||||
Margin="5" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
Cursor="Hand" | |||||
IsChecked="{Binding UserManagement}" | |||||
Style="{DynamicResource StatusBtnStyle网络连接状态}" | |||||
ToolTip="用户管理" /> | |||||
<!-- 当 StaysOpen 设置为 True 时 popup失去焦点的时候不会自动关闭 --> | |||||
<Popup | |||||
AllowsTransparency="True" | |||||
Focusable="False" | |||||
IsOpen="{Binding IsChecked, ElementName=tb}" | |||||
Placement="Bottom" | |||||
PlacementTarget="{Binding ElementName=tb}" | |||||
StaysOpen="False"> | |||||
<Border Background="#081424" ClipToBounds="True"> | |||||
<Grid Width="100" Margin="0"> | |||||
<StackPanel Width="{Binding RelativeSource={RelativeSource AncestorLevel=1, AncestorType=Grid}, Path=ActualWidth}"> | |||||
<Button | |||||
Width="{Binding RelativeSource={RelativeSource AncestorLevel=1, AncestorType=Grid}, Path=ActualWidth}" | |||||
Margin="0,5,0,1" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
Command="{Binding PasswordChange}" | |||||
Content="密码修改" | |||||
Cursor="Hand" /> | |||||
<Button | |||||
Width="{Binding RelativeSource={RelativeSource AncestorLevel=1, AncestorType=Grid}, Path=ActualWidth}" | |||||
Margin="0,5,0,1" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
Command="{Binding Login}" | |||||
Content="登录账号" | |||||
Cursor="Hand" /> | |||||
<Button | |||||
Width="{Binding RelativeSource={RelativeSource AncestorLevel=1, AncestorType=Grid}, Path=ActualWidth}" | |||||
Margin="0,5,0,1" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
Command="{Binding ExitLogin}" | |||||
Content="退出登录" | |||||
Cursor="Hand" /> | |||||
</StackPanel> | |||||
</Grid> | |||||
</Border> | |||||
</Popup> | |||||
</Grid> | |||||
<Border Style="{DynamicResource border竖线}" /> | |||||
<ToggleButton | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
Cursor="Hand" | |||||
DataContext="{Binding IsAlarm}" | |||||
Style="{DynamicResource StatusBtnStyle告警}" | |||||
ToolTip="告警消息" /> | |||||
<Border Style="{DynamicResource border竖线}" /> | |||||
<control:DateTimeUI Margin="10,0,10,0" VerticalAlignment="Center" /> | |||||
<Border Style="{DynamicResource border竖线}" /> | |||||
<Button | |||||
x:Name="ButClose" | |||||
Grid.Column="4" | |||||
Margin="10,0,20,0" | |||||
VerticalAlignment="Center" | |||||
Content="退出" | |||||
Cursor="Hand" | |||||
Style="{DynamicResource CommonBtn_返回}" | |||||
ToolTip="退出程序" /> | |||||
</StackPanel> | |||||
</Grid> | |||||
<!-- 底部窗体 --> | |||||
<Grid Grid.Row="1" Margin="10"> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="45" /> | |||||
<RowDefinition /> | |||||
</Grid.RowDefinitions> | |||||
<!-- 顶部装饰 --> | |||||
<Border | |||||
Grid.Row="0" | |||||
Grid.RowSpan="2" | |||||
Style="{DynamicResource border右下}" /> | |||||
<Border | |||||
Grid.Row="0" | |||||
Grid.RowSpan="2" | |||||
Style="{DynamicResource border左下}" /> | |||||
<Border | |||||
Grid.Row="0" | |||||
Grid.RowSpan="2" | |||||
Style="{DynamicResource border右上}" /> | |||||
<Border | |||||
Grid.Row="0" | |||||
Grid.RowSpan="2" | |||||
Style="{DynamicResource border左上}" /> | |||||
<Grid Margin="10"> | |||||
<Border Width="600" Style="{DynamicResource borderFromTitle}" /> | |||||
<StackPanel Orientation="Horizontal"> | |||||
<CheckBox | |||||
Margin="5,0,5,0" | |||||
Content="开机启动" | |||||
IsChecked="{Binding AutoStart}" /> | |||||
</StackPanel> | |||||
<TextBlock | |||||
x:Name="Title" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Top" | |||||
FontSize="16" | |||||
Foreground="#feffff" | |||||
Text="{Binding WindowTitleName}" /> | |||||
</Grid> | |||||
<!--#region 底部窗体栏--> | |||||
<ContentControl | |||||
x:Name="contentRegion" | |||||
Grid.Row="1" | |||||
Content="{Binding MyWindow}" /> | |||||
<!--#endregion--> | |||||
</Grid> | |||||
</Grid> | |||||
</Border> | |||||
</Window> |
@@ -0,0 +1,48 @@ | |||||
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.DosingSystem.View | |||||
{ | |||||
/// <summary> | |||||
/// Interaction logic for MainWindow.xaml | |||||
/// </summary> | |||||
public partial class MainWindow : Window | |||||
{ | |||||
public MainWindow() | |||||
{ | |||||
InitializeComponent(); | |||||
this.ButClose.Click += (o, e) => { this.Close(); }; | |||||
this.MaxWidth = SystemParameters.WorkArea.Width; | |||||
this.MaxHeight = SystemParameters.WorkArea.Height; | |||||
this.br.MouseLeftButtonDown += (o, e) => | |||||
{ | |||||
if (e.ClickCount > 1) | |||||
{ | |||||
if (this.WindowState == WindowState.Maximized) | |||||
this.WindowState = WindowState.Normal; | |||||
else if (this.WindowState == WindowState.Normal) | |||||
this.WindowState = WindowState.Maximized; | |||||
} | |||||
if (e.LeftButton == MouseButtonState.Pressed) this.DragMove(); | |||||
}; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,222 @@ | |||||
<Window | |||||
x:Class="BPASmartClient.DosingSystem.View.NewRecipeView" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel" | |||||
Title="NewRecipeView" | |||||
Width="550" | |||||
Height="450" | |||||
AllowsTransparency="True" | |||||
Background="{x:Null}" | |||||
Topmost="True" | |||||
WindowStartupLocation="CenterScreen" | |||||
WindowStyle="None" | |||||
mc:Ignorable="d"> | |||||
<Window.DataContext> | |||||
<vm:NewRecipeViewModel /> | |||||
</Window.DataContext> | |||||
<Window.Resources> | |||||
<ResourceDictionary> | |||||
<ResourceDictionary.MergedDictionaries> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" /> | |||||
<ResourceDictionary> | |||||
<!--#region ListBox样式--> | |||||
<Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}"> | |||||
<Setter Property="OverridesDefaultStyle" Value="True" /> | |||||
<Setter Property="SnapsToDevicePixels" Value="True" /> | |||||
<Setter Property="BorderBrush" Value="{x:Null}" /> | |||||
<Setter Property="Foreground" Value="White" /> | |||||
<Setter Property="FontSize" Value="20" /> | |||||
<Setter Property="HorizontalContentAlignment" Value="Center" /> | |||||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||||
<Setter Property="Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate TargetType="{x:Type ListBoxItem}"> | |||||
<Border x:Name="border" CornerRadius="8"> | |||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> | |||||
</Border> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style> | |||||
<!--#endregion--> | |||||
</ResourceDictionary> | |||||
</ResourceDictionary.MergedDictionaries> | |||||
</ResourceDictionary> | |||||
</Window.Resources> | |||||
<Border Name="br" BorderThickness="1"> | |||||
<Border.Background> | |||||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/bg.png" /> | |||||
</Border.Background> | |||||
<Grid> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="5" /> | |||||
<RowDefinition /> | |||||
</Grid.RowDefinitions> | |||||
<!--<Button | |||||
Name="btClose" | |||||
Margin="0,0,5,0" | |||||
Padding="10,5" | |||||
HorizontalAlignment="Right" | |||||
VerticalAlignment="Center" | |||||
Background="Transparent" | |||||
BorderThickness="0" | |||||
Content="X" | |||||
FontSize="18" | |||||
Foreground="White" /> | |||||
<Border BorderBrush="#88DDDDDD" BorderThickness="0,0,0,1" />--> | |||||
<Grid Grid.Row="1"> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="40" /> | |||||
<RowDefinition Height="40" /> | |||||
<RowDefinition /> | |||||
</Grid.RowDefinitions> | |||||
<TextBlock | |||||
Margin="10,0,0,0" | |||||
Background="Transparent" | |||||
FontSize="20" | |||||
Foreground="#FF2AB2E7" | |||||
Text="请输入配方名称:" /> | |||||
<TextBlock | |||||
Margin="0,0,10,0" | |||||
HorizontalAlignment="Right" | |||||
Background="Transparent" | |||||
FontSize="16" | |||||
Foreground="Red" | |||||
Text="{Binding ErrorInfo}" /> | |||||
<StackPanel | |||||
Grid.Row="1" | |||||
Margin="10,0,0,0" | |||||
Orientation="Horizontal"> | |||||
<TextBox | |||||
Grid.Column="1" | |||||
Width="200" | |||||
Height="30" | |||||
Margin="0,0,7,0" | |||||
FontSize="16" | |||||
Text="{Binding RecipeName}" /> | |||||
<Button | |||||
Width="148" | |||||
Height="30" | |||||
Margin="0,0,7,0" | |||||
Command="{Binding AddCommand}" | |||||
Content="添加原料" Cursor="Hand" /> | |||||
<Button | |||||
Width="80" | |||||
Height="30" | |||||
Command="{Binding SaveCommand}" | |||||
Content="确认" /> | |||||
<Button | |||||
Name="btClose" | |||||
Width="80" | |||||
Height="30" | |||||
Margin="7,0,0,0" | |||||
Content="取消" /> | |||||
</StackPanel> | |||||
<ScrollViewer Grid.Row="2" Margin="5"> | |||||
<ItemsControl ItemsSource="{Binding RawMaterials}"> | |||||
<ItemsControl.ItemTemplate> | |||||
<DataTemplate> | |||||
<RadioButton GroupName="all"> | |||||
<RadioButton.Template> | |||||
<ControlTemplate TargetType="RadioButton"> | |||||
<Grid Name="gr" Height="40"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition Width="0.5*" /> | |||||
</Grid.ColumnDefinitions> | |||||
<ComboBox | |||||
Name="cb" | |||||
Grid.Column="0" | |||||
Margin="3,1" | |||||
VerticalAlignment="Center" | |||||
BorderBrush="#FF074B92" | |||||
BorderThickness="1" | |||||
FontFamily="楷体" | |||||
FontSize="20" | |||||
Foreground="#FF2AB2E7" | |||||
IsEditable="False" | |||||
ItemsSource="{Binding DataContext.RawMaterialNames, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||||
SelectedIndex="0" | |||||
Style="{StaticResource ComboBoxStyle}" | |||||
Text="{Binding RawMaterialName}" /> | |||||
<!--<TextBox | |||||
Name="cb" | |||||
Grid.Column="0" | |||||
Margin="3,1" | |||||
VerticalAlignment="Center" | |||||
BorderBrush="#FF074B92" | |||||
BorderThickness="1" | |||||
FontFamily="楷体" | |||||
FontSize="20" | |||||
Foreground="#FF2AB2E7" | |||||
Text="{Binding RawMaterialName}" />--> | |||||
<StackPanel | |||||
Grid.Column="1" | |||||
VerticalAlignment="Center" | |||||
Orientation="Horizontal"> | |||||
<TextBox | |||||
Name="tb" | |||||
Grid.Column="1" | |||||
Width="150" | |||||
Height="29" | |||||
Margin="3,1" | |||||
VerticalAlignment="Center" | |||||
FontSize="20" | |||||
Text="{Binding RawMaterialWeight}" /> | |||||
<TextBlock | |||||
Grid.Column="1" | |||||
Margin="0,0,8,4" | |||||
HorizontalAlignment="Right" | |||||
VerticalAlignment="Center" | |||||
Text="mg" /> | |||||
</StackPanel> | |||||
<Button | |||||
Grid.Column="2" | |||||
Margin="10,0,10,0" | |||||
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||||
CommandParameter="{Binding RawMaterialId}" | |||||
Content="删除" /> | |||||
</Grid> | |||||
</ControlTemplate> | |||||
</RadioButton.Template> | |||||
</RadioButton> | |||||
</DataTemplate> | |||||
</ItemsControl.ItemTemplate> | |||||
</ItemsControl> | |||||
</ScrollViewer> | |||||
</Grid> | |||||
</Grid> | |||||
</Border> | |||||
</Window> |
@@ -0,0 +1,32 @@ | |||||
using BPASmartClient.Helper; | |||||
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.Shapes; | |||||
namespace BPASmartClient.DosingSystem.View | |||||
{ | |||||
/// <summary> | |||||
/// NewRecipeView.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class NewRecipeView : Window | |||||
{ | |||||
public NewRecipeView() | |||||
{ | |||||
InitializeComponent(); | |||||
this.btClose.Click += (o, e) => { this.Close(); }; | |||||
this.br.MouseLeftButtonDown += (o, e) => { if (e.LeftButton == MouseButtonState.Pressed) this.DragMove(); }; | |||||
ActionManage.GetInstance.CancelRegister("CloseNewRecipeView"); | |||||
ActionManage.GetInstance.Register(new Action(() => { this.Close(); }), "CloseNewRecipeView"); | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,188 @@ | |||||
<UserControl | |||||
x:Class="BPASmartClient.DosingSystem.View.RecipeControlView" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||||
xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel" | |||||
d:DesignHeight="450" | |||||
d:DesignWidth="800" | |||||
mc:Ignorable="d"> | |||||
<UserControl.DataContext> | |||||
<vm:RecipeControlViewModel /> | |||||
</UserControl.DataContext> | |||||
<UserControl.Resources> | |||||
<Style x:Key="UserItemContainerStyle" TargetType="ListBoxItem"> | |||||
<Style.Resources> | |||||
<!-- SelectedItem with focus --> | |||||
<SolidColorBrush | |||||
x:Key="{x:Static SystemColors.HighlightBrushKey}" | |||||
Opacity=".4" | |||||
Color="White" /> | |||||
<!-- SelectedItem without focus --> | |||||
<SolidColorBrush | |||||
x:Key="{x:Static SystemColors.ControlBrushKey}" | |||||
Opacity=".4" | |||||
Color="White" /> | |||||
</Style.Resources> | |||||
<!-- 设置触发器 --> | |||||
<Style.Triggers> | |||||
<Trigger Property="IsMouseOver" Value="true"> | |||||
<Setter Property="Background" Value="White" /> | |||||
<Setter Property="Foreground" Value="White" /> | |||||
</Trigger> | |||||
<Trigger Property="IsFocused" Value="true"> | |||||
<Setter Property="Background" Value="White" /> | |||||
<Setter Property="Foreground" Value="White" /> | |||||
</Trigger> | |||||
</Style.Triggers> | |||||
</Style> | |||||
</UserControl.Resources> | |||||
<Grid> | |||||
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"> | |||||
<ItemsControl ItemsSource="{Binding Recipes}"> | |||||
<ItemsControl.ItemTemplate> | |||||
<DataTemplate> | |||||
<Grid Height="150" VerticalAlignment="Top"> | |||||
<Border | |||||
Name="ShadowElement" | |||||
Height="150" | |||||
VerticalAlignment="Top" | |||||
BorderBrush="#00BEFA" | |||||
BorderThickness="2" | |||||
ClipToBounds="True" | |||||
CornerRadius="8"> | |||||
<Border.Effect> | |||||
<DropShadowEffect | |||||
BlurRadius="18" | |||||
ShadowDepth="0" | |||||
Color="#00BEFA" /> | |||||
</Border.Effect> | |||||
</Border> | |||||
<Grid> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition Width="auto" /> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition Width="auto" /> | |||||
</Grid.ColumnDefinitions> | |||||
<Grid Margin="20,0,0,0"> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition /> | |||||
<RowDefinition /> | |||||
</Grid.RowDefinitions> | |||||
<TextBlock | |||||
FontSize="40" | |||||
Foreground="White" | |||||
Text="{Binding RecipeName}" /> | |||||
<Button | |||||
Grid.Row="1" | |||||
Width="80" | |||||
Height="30" | |||||
HorizontalAlignment="Left" | |||||
Command="{Binding DataContext.StartCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||||
CommandParameter="{Binding RecipeName}" | |||||
Content="配方下发" | |||||
IsEnabled="{Binding IsEnable}" /> | |||||
</Grid> | |||||
<ListView | |||||
Grid.Column="1" | |||||
Margin="10" | |||||
Background="Transparent" | |||||
BorderBrush="#00BEFA" | |||||
BorderThickness="2,0,2,0" | |||||
ItemsSource="{Binding RawMaterials}" | |||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"> | |||||
<ListView.ItemsPanel> | |||||
<ItemsPanelTemplate> | |||||
<UniformGrid | |||||
HorizontalAlignment="Left" | |||||
VerticalAlignment="Top" | |||||
Columns="4" /> | |||||
</ItemsPanelTemplate> | |||||
</ListView.ItemsPanel> | |||||
<ListView.ItemTemplate> | |||||
<DataTemplate> | |||||
<StackPanel | |||||
Grid.Column="1" | |||||
Height="20" | |||||
Margin="20,0,0,0" | |||||
VerticalAlignment="Top" | |||||
Orientation="Horizontal"> | |||||
<Ellipse | |||||
Width="{Binding ElementName=n, Path=ActualHeight}" | |||||
Margin="0,0,5,0" | |||||
Fill="{Binding RecipeStatus, Converter={StaticResource StatusConverter}}" /> | |||||
<TextBlock | |||||
Name="n" | |||||
FontSize="16" | |||||
Foreground="White" | |||||
Text="{Binding RawMaterialName}" /> | |||||
</StackPanel> | |||||
</DataTemplate> | |||||
</ListView.ItemTemplate> | |||||
</ListView> | |||||
<StackPanel | |||||
Grid.Column="2" | |||||
Margin="5,0" | |||||
VerticalAlignment="Center"> | |||||
<StackPanel Margin="0,0,0,5" Orientation="Horizontal"> | |||||
<Ellipse | |||||
Width="{Binding ElementName=tb, Path=ActualHeight}" | |||||
Margin="0,0,5,0" | |||||
Fill="Green" /> | |||||
<TextBlock | |||||
Name="tb" | |||||
Foreground="#ddd" | |||||
Text="准备就绪" /> | |||||
</StackPanel> | |||||
<StackPanel Margin="0,0,0,5" Orientation="Horizontal"> | |||||
<Ellipse | |||||
Width="{Binding ElementName=tb, Path=ActualHeight}" | |||||
Margin="0,0,5,0" | |||||
Fill="Yellow" /> | |||||
<TextBlock | |||||
Name="tb1" | |||||
Foreground="#ddd" | |||||
Text="等待接料" /> | |||||
</StackPanel> | |||||
<StackPanel Margin="0,0,0,5" Orientation="Horizontal"> | |||||
<Ellipse | |||||
Width="{Binding ElementName=tb, Path=ActualHeight}" | |||||
Margin="0,0,5,0" | |||||
Fill="Aqua" /> | |||||
<TextBlock | |||||
Name="tb2" | |||||
Foreground="#ddd" | |||||
Text="接料完成" /> | |||||
</StackPanel> | |||||
<StackPanel Margin="0,0,0,5" Orientation="Horizontal"> | |||||
<Ellipse | |||||
Width="{Binding ElementName=tb, Path=ActualHeight}" | |||||
Margin="0,0,5,0" | |||||
Fill="Red" /> | |||||
<TextBlock | |||||
Name="tb3" | |||||
Foreground="#ddd" | |||||
Text="设备异常" /> | |||||
</StackPanel> | |||||
</StackPanel> | |||||
</Grid> | |||||
</Grid> | |||||
</DataTemplate> | |||||
</ItemsControl.ItemTemplate> | |||||
</ItemsControl> | |||||
</ScrollViewer> | |||||
</Grid> | |||||
</UserControl> |
@@ -0,0 +1,28 @@ | |||||
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.DosingSystem.View | |||||
{ | |||||
/// <summary> | |||||
/// RecipeControlView.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class RecipeControlView : UserControl | |||||
{ | |||||
public RecipeControlView() | |||||
{ | |||||
InitializeComponent(); | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,246 @@ | |||||
<UserControl | |||||
x:Class="BPASmartClient.DosingSystem.View.RecipeSettingsView" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||||
xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel" | |||||
d:DesignHeight="450" | |||||
d:DesignWidth="800" | |||||
mc:Ignorable="d"> | |||||
<UserControl.Resources> | |||||
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" /> | |||||
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" /> | |||||
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" /> | |||||
<SolidColorBrush x:Key="CursorColor" Color="Aqua" /> | |||||
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" /> | |||||
<SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" /> | |||||
<Style x:Key="TextBlockStyle" TargetType="TextBlock"> | |||||
<Setter Property="FontFamily" Value="楷体" /> | |||||
<Setter Property="FontSize" Value="16" /> | |||||
<Setter Property="Background" Value="Transparent" /> | |||||
<!--<Setter Property="Foreground" Value="{StaticResource FontColor}" />--> | |||||
<Setter Property="VerticalAlignment" Value="Center" /> | |||||
<Setter Property="HorizontalAlignment" Value="Center" /> | |||||
</Style> | |||||
<Style x:Key="buttonStyle" TargetType="Button"> | |||||
<Setter Property="Background" Value="Transparent" /> | |||||
<Setter Property="FontSize" Value="16" /> | |||||
<Setter Property="Foreground" Value="Aqua" /> | |||||
<Setter Property="HorizontalAlignment" Value="Center" /> | |||||
<Setter Property="BorderThickness" Value="0" /> | |||||
</Style> | |||||
</UserControl.Resources> | |||||
<UserControl.DataContext> | |||||
<vm:RecipeSettingsViewModel /> | |||||
</UserControl.DataContext> | |||||
<Grid> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="50" /> | |||||
<RowDefinition Height="30" /> | |||||
<RowDefinition /> | |||||
</Grid.RowDefinitions> | |||||
<!--#region 操作按钮--> | |||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal"> | |||||
<pry:IcoButton | |||||
Grid.Column="3" | |||||
Width="140" | |||||
Margin="10" | |||||
HorizontalAlignment="Left" | |||||
Command="{Binding NewRecipe}" | |||||
Content="新建配方" | |||||
FontSize="16" | |||||
Foreground="Aqua" | |||||
IcoText="" | |||||
Style="{StaticResource NewButtonStyle}" /> | |||||
<pry:IcoButton | |||||
Grid.Column="3" | |||||
Width="140" | |||||
Margin="10" | |||||
HorizontalAlignment="Left" | |||||
Command="{Binding SaveRecipe}" | |||||
Content="保存配方" | |||||
EnableColor="#FFB7B7B7" | |||||
FontSize="17" | |||||
Foreground="Aqua" | |||||
IcoText="" | |||||
IsEnabled="True" | |||||
Style="{StaticResource NewButtonStyle}" /> | |||||
</StackPanel> | |||||
<!--#endregion--> | |||||
<!--#region 表格标题栏设置--> | |||||
<!--<Grid Grid.Row="1" Background="#dd2AB2E7"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition Width="0.3*" /> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition Width="0" /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition Width="0.5*" /> | |||||
</Grid.ColumnDefinitions> | |||||
<TextBlock | |||||
Grid.Column="0" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="序号" /> | |||||
<Grid Grid.Column="1"> | |||||
<TextBlock | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="配方名称" /> | |||||
<Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="1,0,1,0" /> | |||||
</Grid> | |||||
<TextBlock | |||||
Grid.Column="2" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="编码" /> | |||||
<Grid Grid.Column="3"> | |||||
<TextBlock | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="结束时间" /> | |||||
<Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="1,0,1,0" /> | |||||
</Grid> | |||||
<Grid Grid.Column="5"> | |||||
<TextBlock | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="制作状态" /> | |||||
<Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="0,0,1,0" /> | |||||
</Grid> | |||||
<TextBlock | |||||
Grid.Column="6" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="完成时间" /> | |||||
</Grid>--> | |||||
<!--#endregion--> | |||||
<!--#region 表格数据显示--> | |||||
<ScrollViewer | |||||
Grid.Row="2" | |||||
HorizontalScrollBarVisibility="Hidden" | |||||
VerticalScrollBarVisibility="Hidden"> | |||||
<ItemsControl ItemsSource="{Binding Recipes}"> | |||||
<ItemsControl.ItemTemplate> | |||||
<DataTemplate> | |||||
<RadioButton Background="Transparent" GroupName="all"> | |||||
<RadioButton.Template> | |||||
<ControlTemplate TargetType="RadioButton"> | |||||
<Grid Name="gr" Height="30"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition Width="0.3*" /> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition Width="0" /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition Width="0.5*" /> | |||||
</Grid.ColumnDefinitions> | |||||
<TextBlock | |||||
Grid.Column="0" | |||||
Foreground="#ff00ccff" | |||||
Style="{StaticResource TextBlockStyle}" | |||||
Text="{Binding SerialNum}" /> | |||||
<Grid Grid.Column="1"> | |||||
<TextBlock | |||||
Margin="5,0,0,0" | |||||
HorizontalAlignment="Left" | |||||
Foreground="#ff00ccff" | |||||
Style="{StaticResource TextBlockStyle}" | |||||
Text="{Binding RecipeName}" /> | |||||
</Grid> | |||||
<TextBlock | |||||
Grid.Column="2" | |||||
Foreground="#ff00ccff" | |||||
Style="{StaticResource TextBlockStyle}" | |||||
Text="{Binding RecipCode}" /> | |||||
<!--<Grid Grid.Column="3"> | |||||
<Button | |||||
Command="{Binding DataContext.EditCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||||
CommandParameter="{Binding RecipCode}" | |||||
Content="编辑" | |||||
Style="{StaticResource buttonStyle}" /> | |||||
</Grid>--> | |||||
<Grid Grid.Column="5"> | |||||
<Button | |||||
Command="{Binding DataContext.DetailsCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||||
CommandParameter="{Binding RecipCode}" | |||||
Content="详情" | |||||
Style="{StaticResource buttonStyle}" /> | |||||
</Grid> | |||||
<Grid Grid.Column="6"> | |||||
<Button | |||||
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||||
CommandParameter="{Binding RecipCode}" | |||||
Content="删除" | |||||
Style="{StaticResource buttonStyle}" /> | |||||
</Grid> | |||||
</Grid> | |||||
<ControlTemplate.Triggers> | |||||
<Trigger Property="IsChecked" Value="True"> | |||||
<Setter TargetName="gr" Property="Background" Value="#3300ccff" /> | |||||
</Trigger> | |||||
<Trigger Property="IsMouseOver" Value="true"> | |||||
<Setter TargetName="gr" Property="Background" Value="#3300ccff" /> | |||||
</Trigger> | |||||
</ControlTemplate.Triggers> | |||||
</ControlTemplate> | |||||
</RadioButton.Template> | |||||
</RadioButton> | |||||
</DataTemplate> | |||||
</ItemsControl.ItemTemplate> | |||||
</ItemsControl> | |||||
</ScrollViewer> | |||||
<!--#endregion--> | |||||
</Grid> | |||||
</UserControl> |
@@ -0,0 +1,28 @@ | |||||
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.DosingSystem.View | |||||
{ | |||||
/// <summary> | |||||
/// RecipeSettingsView.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class RecipeSettingsView : UserControl | |||||
{ | |||||
public RecipeSettingsView() | |||||
{ | |||||
InitializeComponent(); | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,18 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
using System.Collections.Concurrent; | |||||
using System.Collections.ObjectModel; | |||||
using System.Windows; | |||||
using BPASmartClient.Helper; | |||||
using Microsoft.Toolkit.Mvvm.Input; | |||||
namespace BPASmartClient.DosingSystem.ViewModel | |||||
{ | |||||
public class AlarmRecordViewModel : ObservableObject | |||||
{ | |||||
} | |||||
} |
@@ -0,0 +1,71 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using BPASmartClient.Helper; | |||||
using BPASmartClient.DosingSystem.Model; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
using Microsoft.Toolkit.Mvvm.Input; | |||||
namespace BPASmartClient.DosingSystem.ViewModel | |||||
{ | |||||
public class ChangeDeviceNameViewModel : ObservableObject | |||||
{ | |||||
public ChangeDeviceNameViewModel() | |||||
{ | |||||
ActionManage.GetInstance.Register(new Action<object>((o) => | |||||
{ | |||||
if (o != null && o is string str) IpAddress = str; | |||||
}), "ChangeDeviceNameViewOpen"); | |||||
CancleCommand = new RelayCommand(() => { ActionManage.GetInstance.Send("ChangeDeviceNameViewClose"); }); | |||||
ConfirmCommand = new RelayCommand(() => | |||||
{ | |||||
if (string.IsNullOrEmpty(DeviceName)) | |||||
{ | |||||
ErrorInfo = "设备名称不能为空"; | |||||
return; | |||||
} | |||||
int index = Array.FindIndex(DeviceListViewModel.devices.ToArray(), p => p.IpAddress == IpAddress); | |||||
if (index >= 0 && index < DeviceListViewModel.devices.Count) | |||||
{ | |||||
if (DeviceListViewModel.devices.FirstOrDefault(p => p.DeviceName == DeviceName) != null) | |||||
ErrorInfo = "设备名称已存在"; | |||||
else | |||||
{ | |||||
NewRecipeViewModel.RawMaterialNames.Remove(DeviceListViewModel.devices.ElementAt(index).DeviceName); | |||||
NewRecipeViewModel.RawMaterialNames.Add(DeviceName); | |||||
DeviceListViewModel.devices.ElementAt(index).DeviceName = DeviceName; | |||||
DeviceInquire.GetInstance.GetDevice(IpAddress).SetDeviceName(DeviceName);//设置PLC名称 | |||||
for (int i = 0; i < Json<LocaPar>.Data.Recipes.Count; i++) | |||||
{ | |||||
for (int m = 0; m < Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.Count; m++) | |||||
{ | |||||
Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName; | |||||
} | |||||
} | |||||
ActionManage.GetInstance.Send("ChangeDeviceNameViewClose"); | |||||
} | |||||
} | |||||
}); | |||||
} | |||||
private static string IpAddress = string.Empty; | |||||
public RelayCommand ConfirmCommand { get; set; } | |||||
public RelayCommand CancleCommand { get; set; } | |||||
public string ErrorInfo { get { return _mErrorInfo; } set { _mErrorInfo = value; OnPropertyChanged(); } } | |||||
private string _mErrorInfo; | |||||
public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; OnPropertyChanged(); } } | |||||
private string _mDeviceName; | |||||
} | |||||
} |
@@ -0,0 +1,45 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
using System.Collections.Concurrent; | |||||
using System.Collections.ObjectModel; | |||||
using System.Windows; | |||||
using BPASmartClient.Helper; | |||||
using Microsoft.Toolkit.Mvvm.Input; | |||||
using BPASmartClient.DosingSystem.View; | |||||
namespace BPASmartClient.DosingSystem.ViewModel | |||||
{ | |||||
public class DeviceListViewModel : ObservableObject | |||||
{ | |||||
public DeviceListViewModel() | |||||
{ | |||||
ChangeNameCommand = new RelayCommand<object>((o) => | |||||
{ | |||||
if (o != null && o is string str) | |||||
{ | |||||
ChangeDeviceNameView cdn = new ChangeDeviceNameView(); | |||||
ActionManage.GetInstance.Send("ChangeDeviceNameViewOpen", str); | |||||
cdn.ShowDialog(); | |||||
} | |||||
}); | |||||
} | |||||
public RelayCommand<object> ChangeNameCommand { get; set; } | |||||
public static ObservableCollection<Devices> devices { get; set; } = new ObservableCollection<Devices>(); | |||||
} | |||||
public class Devices : ObservableObject | |||||
{ | |||||
public string IpAddress { get { return _mIpAddress; } set { _mIpAddress = value; OnPropertyChanged(); } } | |||||
private string _mIpAddress; | |||||
public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; OnPropertyChanged(); } } | |||||
private string _mDeviceName; | |||||
} | |||||
} |
@@ -0,0 +1,18 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
using System.Collections.Concurrent; | |||||
using System.Collections.ObjectModel; | |||||
using System.Windows; | |||||
using BPASmartClient.Helper; | |||||
using Microsoft.Toolkit.Mvvm.Input; | |||||
namespace BPASmartClient.DosingSystem.ViewModel | |||||
{ | |||||
public class HardwareStatusViewModel : ObservableObject | |||||
{ | |||||
} | |||||
} |
@@ -0,0 +1,161 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
using System.Collections.Concurrent; | |||||
using System.Collections.ObjectModel; | |||||
using System.Windows; | |||||
using BPASmartClient.Helper; | |||||
using Microsoft.Toolkit.Mvvm.Input; | |||||
using BPASmartClient.DosingSystem.Model; | |||||
using Newtonsoft.Json; | |||||
using System.IO; | |||||
using System.Reflection; | |||||
namespace BPASmartClient.DosingSystem.ViewModel | |||||
{ | |||||
public class MainViewModel : ObservableObject | |||||
{ | |||||
//ObservableCollection<ActionMenu> menus = new ObservableCollection<ActionMenu>(); | |||||
//private Permission _permission; | |||||
//public Permission permission | |||||
//{ | |||||
// get { return _permission; } | |||||
// set | |||||
// { | |||||
// var res = menus.Where(p => Array.FindIndex(p.permission, s => s == value) >= 0).ToList(); | |||||
// if (res != null && res.Count > 0) | |||||
// { | |||||
// Menus.Clear(); | |||||
// res.ForEach((item) => { Menus.Add(item); }); | |||||
// } | |||||
// _permission = value; | |||||
// } | |||||
//} | |||||
public MainViewModel() | |||||
{ | |||||
//Json<LocaPar>.Read(); | |||||
TogglePag = new RelayCommand<object>(DoNavChanged); | |||||
Login = new RelayCommand(() => { DoNavChanged("BPASmartClient.DosingSystem.View.AdminstratorsView_用户登录"); UserManagement = false; }); | |||||
PasswordChange = new RelayCommand(() => | |||||
{ | |||||
//DoNavChanged("PasswordChangeView.密码修改"); | |||||
UserManagement = false; | |||||
}); | |||||
ExitLogin = new RelayCommand(() => | |||||
{ | |||||
//SystemUtils.ShowScreenKeyboard(); | |||||
//DoNavChanged("LoginView.退出登录"); | |||||
UserManagement = false; | |||||
}); | |||||
//Config.GetInstance.Init(); | |||||
LoginRegister(); | |||||
MenuInit(); | |||||
//permission = Permission.管理员; | |||||
//if (Menus.Count > 0) DoNavChanged(Menus.ElementAt(0).CommandParameter); | |||||
DeviceInquire.GetInstance.Init(); | |||||
} | |||||
private void LoginRegister() | |||||
{ | |||||
ActionManage.GetInstance.Register(new Func<object, object>((o) => | |||||
{ | |||||
//if (o != null && o is string str) | |||||
//{ | |||||
// var strs = str.Split("-="); | |||||
// if (strs != null && strs.Length == 3) | |||||
// { | |||||
// var us = Global.userManager.userInfos.FirstOrDefault(p => p.UserName == strs[0]); | |||||
// if (us != null && strs[1] == us.Password && strs[2] == us.permission.ToString()) | |||||
// { | |||||
// permission = us.permission; | |||||
// return string.Empty; | |||||
// } | |||||
// } | |||||
//} | |||||
return "用户名或密码错误"; | |||||
}), "LoginBPASmartClient.DosingSystem"); | |||||
} | |||||
private void MenuInit() | |||||
{ | |||||
//menus.Add(new ActionMenu() | |||||
//{ | |||||
// MenuName = "配方设置", | |||||
// CommandParameter = "BPASmartClient.DosingSystem.View.RecipeSettingsView_配方设置", | |||||
// permission = new Permission[] { Permission.管理员, Permission.技术员 }, | |||||
//}); | |||||
//menus.Add(new ActionMenu() | |||||
//{ | |||||
// MenuName = "设备列表", | |||||
// CommandParameter = "BPASmartClient.DosingSystem.View.DeviceListView_设备列表", | |||||
// permission = new Permission[] { Permission.管理员, Permission.技术员 }, | |||||
//}); | |||||
//menus.Add(new ActionMenu() | |||||
//{ | |||||
// MenuName = "硬件状态", | |||||
// CommandParameter = "BPASmartClient.DosingSystem.View.HardwareStatusView_硬件状态", | |||||
// permission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
//}); | |||||
//menus.Add(new ActionMenu() | |||||
//{ | |||||
// MenuName = "报警记录", | |||||
// CommandParameter = "BPASmartClient.CustomResource.Pages.View.AlarmView_报警记录", | |||||
// permission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
//}); | |||||
//menus.Add(new ActionMenu() | |||||
//{ | |||||
// MenuName = "配方下发", | |||||
// CommandParameter = "BPASmartClient.DosingSystem.View.RecipeControlView_配方控制", | |||||
// permission = new Permission[] { Permission.管理员, Permission.操作员 }, | |||||
//}); | |||||
} | |||||
public void DoNavChanged(object obj) | |||||
{ | |||||
if (obj != null && obj is string stobj) | |||||
{ | |||||
var strs = stobj.Split('_'); | |||||
if (strs != null && strs.Length == 2) | |||||
{ | |||||
Type type; | |||||
if (!stobj.Contains("BPASmartClient.DosingSystem")) | |||||
{ | |||||
type = Assembly.Load("BPASmartClient.CustomResource").GetType(strs[0]); | |||||
} | |||||
else type = Type.GetType(strs[0]); | |||||
var res = type?.GetConstructor(System.Type.EmptyTypes)?.Invoke(null); | |||||
if (res != null && res is FrameworkElement fe) MyWindow = fe; | |||||
WindowTitleName = strs[1]; | |||||
} | |||||
} | |||||
} | |||||
public RelayCommand<object> TogglePag { get; set; } | |||||
public RelayCommand Login { get; set; } | |||||
public RelayCommand PasswordChange { get; set; } | |||||
public RelayCommand ExitLogin { get; set; } | |||||
public ObservableCollection<ActionMenu> Menus { get; set; } = new ObservableCollection<ActionMenu>(); | |||||
public FrameworkElement MyWindow { get { return _mMyWindow; } set { _mMyWindow = value; OnPropertyChanged(); } } | |||||
private FrameworkElement _mMyWindow; | |||||
public string WindowTitleName { get { return _mWindowTitleName; } set { _mWindowTitleName = value; OnPropertyChanged(); } } | |||||
private string _mWindowTitleName; | |||||
public bool UserManagement { get { return _mUserManagement; } set { _mUserManagement = value; OnPropertyChanged(); } } | |||||
private bool _mUserManagement; | |||||
public bool AutoStart { get { return SystemHelper.GetInstance.IsAutoStart(); } set { SystemHelper.GetInstance.AutoStart(value); OnPropertyChanged(); } } | |||||
} | |||||
} |
@@ -0,0 +1,131 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
using System.Collections.ObjectModel; | |||||
using Microsoft.Toolkit.Mvvm.Input; | |||||
using BPASmartClient.Helper; | |||||
using BPASmartClient.DosingSystem.Model; | |||||
namespace BPASmartClient.DosingSystem.ViewModel | |||||
{ | |||||
public class NewRecipeViewModel : ObservableObject | |||||
{ | |||||
public NewRecipeViewModel() | |||||
{ | |||||
ActionManage.GetInstance.Register(new Action<object>((o) => | |||||
{ | |||||
if (o != null && o is RecipeModel rm) | |||||
{ | |||||
RecipeName = rm.RecipeName; | |||||
foreach (var item in rm.RawMaterials) | |||||
{ | |||||
RawMaterials.Add(item); | |||||
} | |||||
RecipCode = rm.RecipCode; | |||||
} | |||||
}), "Details"); | |||||
AddCommand = new RelayCommand(() => | |||||
{ | |||||
p: | |||||
string guid = Guid.NewGuid().ToString(); | |||||
if (RawMaterials.FirstOrDefault(p => p.RawMaterialId == guid) == null) | |||||
{ | |||||
RawMaterials.Add(new RawMaterialModel() | |||||
{ | |||||
RawMaterialId = guid | |||||
}); | |||||
} | |||||
else goto p; | |||||
}); | |||||
RemoveCommand = new RelayCommand<object>((obj) => | |||||
{ | |||||
if (obj is string rm) | |||||
{ | |||||
var res = RawMaterials.FirstOrDefault(p => p.RawMaterialId == rm); | |||||
if (res != null) RawMaterials.Remove(res); | |||||
} | |||||
}); | |||||
SaveCommand = new RelayCommand(() => | |||||
{ | |||||
for (int i = 0; i < RawMaterials.Count; i++) | |||||
{ | |||||
var res = DeviceListViewModel.devices.FirstOrDefault(p => p.DeviceName == RawMaterials.ElementAt(i).RawMaterialName); | |||||
if (res != null) RawMaterials.ElementAt(i).DeviceIp = res.IpAddress; | |||||
} | |||||
if (RecipCode.Length <= 0) | |||||
{ | |||||
var res = Array.FindIndex(Json<LocaPar>.Data.Recipes.ToArray(), p => p.RecipeName == RecipeName); | |||||
if (res >= 0 && res < Json<LocaPar>.Data.Recipes.Count) | |||||
{ | |||||
ErrorInfo = "该配方已存在,请重新输入"; | |||||
} | |||||
else | |||||
{ | |||||
AddRecipes(); | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
var res = Array.FindIndex(Json<LocaPar>.Data.Recipes.ToArray(), p => p.RecipCode == RecipCode); | |||||
if (res >= 0 && res < Json<LocaPar>.Data.Recipes.Count) | |||||
{ | |||||
Json<LocaPar>.Data.Recipes.ElementAt(res).RecipeName = RecipeName; | |||||
Json<LocaPar>.Data.Recipes.ElementAt(res).RawMaterials.Clear(); | |||||
foreach (var item in RawMaterials) | |||||
{ | |||||
Json<LocaPar>.Data.Recipes.ElementAt(res).RawMaterials.Add(item); | |||||
} | |||||
} | |||||
} | |||||
ActionManage.GetInstance.Send("CloseNewRecipeView"); | |||||
}); | |||||
} | |||||
private void AddRecipes() | |||||
{ | |||||
string date = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss"); | |||||
var dates = date.Split("-").ToList(); | |||||
StringBuilder sb = new StringBuilder(); | |||||
dates?.ForEach((item) => { sb.Append(item); }); | |||||
Json<LocaPar>.Data.Recipes.Add(new RecipeModel() | |||||
{ | |||||
SerialNum = Json<LocaPar>.Data.Recipes.Count + 1, | |||||
RawMaterials = RawMaterials, | |||||
RecipCode = sb.ToString(), | |||||
RecipeName = RecipeName, | |||||
}); | |||||
} | |||||
static NewRecipeViewModel() | |||||
{ | |||||
RawMaterialNames.Clear(); | |||||
} | |||||
private string RecipCode = string.Empty; | |||||
public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; OnPropertyChanged(); } } | |||||
private string _mRecipeName; | |||||
public string ErrorInfo { get { return _mErrorInfo; } set { _mErrorInfo = value; OnPropertyChanged(); } } | |||||
private string _mErrorInfo; | |||||
public RelayCommand AddCommand { get; set; } | |||||
public RelayCommand<object> RemoveCommand { get; set; } | |||||
public RelayCommand SaveCommand { get; set; } | |||||
public ObservableCollection<RawMaterialModel> RawMaterials { get; set; } = new ObservableCollection<RawMaterialModel>(); | |||||
public static ObservableCollection<string> RawMaterialNames { get; set; } = new ObservableCollection<string>(); | |||||
} | |||||
} |
@@ -0,0 +1,92 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
using System.Collections.Concurrent; | |||||
using System.Collections.ObjectModel; | |||||
using System.Windows; | |||||
using BPASmartClient.Helper; | |||||
using Microsoft.Toolkit.Mvvm.Input; | |||||
using BPASmartClient.DosingSystem.Model; | |||||
using System.Threading; | |||||
using BPASmartClient.CustomResource.Pages.Model; | |||||
namespace BPASmartClient.DosingSystem.ViewModel | |||||
{ | |||||
public class RecipeControlViewModel : ObservableObject | |||||
{ | |||||
ConcurrentQueue<string> devices = new ConcurrentQueue<string>(); | |||||
public RecipeControlViewModel() | |||||
{ | |||||
Recipes = Json<LocaPar>.Data.Recipes; | |||||
StartCommand = new RelayCommand<object>((o) => | |||||
{ | |||||
//if (o != null && o is string deviceName) | |||||
//{ | |||||
// int index = Array.FindIndex(Recipes.ToArray(), p => p.RecipeName == deviceName); | |||||
// if (index >= 0 && index < Recipes.Count) | |||||
// { | |||||
// Recipes.ElementAt(index).IsEnable = false; | |||||
// } | |||||
// MessageLog.GetInstance.ShowUserLog($"下发工单 { Recipes.ElementAt(index).RecipeName}"); | |||||
// devices.Enqueue(deviceName); | |||||
//} | |||||
MessageLog.GetInstance.ShowUserLog($"下发工单 { Guid.NewGuid().ToString()}"); | |||||
}); | |||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
{ | |||||
if (devices.Count > 0) | |||||
{ | |||||
int index = Array.FindIndex(Recipes.ToArray(), p => p.RecipeName == devices.ElementAt(0)); | |||||
if (index >= 0 && index < Recipes.Count) | |||||
{ | |||||
Recipes.ElementAt(index).Are.Reset(); | |||||
Recipes.ElementAt(index).IsEnable = false; | |||||
foreach (var item in Recipes.ElementAt(index).RawMaterials) | |||||
{ | |||||
DeviceInquire.GetInstance.GetDevice(item.DeviceIp)?.Start(item.RawMaterialWeight);//启动写入 | |||||
} | |||||
Recipes.ElementAt(index).Are.WaitOne(); | |||||
devices.TryDequeue(out string deviceName); | |||||
} | |||||
} | |||||
Thread.Sleep(100); | |||||
}), "启动配发下发"); | |||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
{ | |||||
for (int i = 0; i < Recipes.Count; i++) | |||||
{ | |||||
for (int m = 0; m < Recipes.ElementAt(i).RawMaterials.Count; m++) | |||||
{ | |||||
var RunStatus = DeviceInquire.GetInstance.GetDevice(Recipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp).deviceStatus.RunStatus; | |||||
Recipes.ElementAt(i).RawMaterials.ElementAt(m).RecipeStatus = RunStatus; | |||||
var res = Recipes.ElementAt(i).RawMaterials.Where(p => p.RecipeStatus == 3).ToList(); | |||||
if (res != null && res.Count == Recipes.ElementAt(i).RawMaterials.Count) | |||||
{ | |||||
for (int r = 0; r < Recipes.ElementAt(i).RawMaterials.Count; r++) | |||||
{ | |||||
DeviceInquire.GetInstance.GetDevice(Recipes.ElementAt(i).RawMaterials.ElementAt(r).DeviceIp).StatusReset(); | |||||
} | |||||
Recipes.ElementAt(i).IsEnable = true; | |||||
Recipes.ElementAt(i).Are.Set(); | |||||
} | |||||
} | |||||
} | |||||
Thread.Sleep(100); | |||||
}), "RecipeControlViewModelStatusInquire"); | |||||
} | |||||
public RelayCommand<object> StartCommand { get; set; } | |||||
public ObservableCollection<RecipeModel> Recipes { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,63 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
using System.Collections.Concurrent; | |||||
using System.Collections.ObjectModel; | |||||
using System.Windows; | |||||
using BPASmartClient.Helper; | |||||
using Microsoft.Toolkit.Mvvm.Input; | |||||
using BPASmartClient.DosingSystem.Model; | |||||
using BPASmartClient.DosingSystem.View; | |||||
namespace BPASmartClient.DosingSystem.ViewModel | |||||
{ | |||||
public class RecipeSettingsViewModel : ObservableObject | |||||
{ | |||||
public RecipeSettingsViewModel() | |||||
{ | |||||
//Json<LocaPar>.Read(); | |||||
Recipes = Json<LocaPar>.Data.Recipes; | |||||
NewRecipe = new Action(() => | |||||
{ | |||||
NewRecipeView nrv = new NewRecipeView(); | |||||
nrv.ShowDialog(); | |||||
}); | |||||
SaveRecipe = new Action(() => { Json<LocaPar>.Save(); }); | |||||
RemoveCommand = new RelayCommand<object>((o) => | |||||
{ | |||||
if (o is string str) | |||||
{ | |||||
var res = Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipCode == str); | |||||
if (res != null) Json<LocaPar>.Data.Recipes.Remove(res); | |||||
} | |||||
}); | |||||
DetailsCommand = new RelayCommand<object>((o) => | |||||
{ | |||||
if (o != null && o is string str) | |||||
{ | |||||
ActionManage.GetInstance.CancelRegister("Details"); | |||||
NewRecipeView nrv = new NewRecipeView(); | |||||
ActionManage.GetInstance.Send("Details", Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipCode == str)); | |||||
nrv.ShowDialog(); | |||||
} | |||||
}); | |||||
} | |||||
public Action NewRecipe { get; set; } | |||||
public Action SaveRecipe { get; set; } | |||||
public RelayCommand<object> EditCommand { get; set; } | |||||
public RelayCommand<object> DetailsCommand { get; set; } | |||||
public RelayCommand<object> RemoveCommand { get; set; } | |||||
public ObservableCollection<RecipeModel> Recipes { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,79 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"> | |||||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/> | |||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> | |||||
<security> | |||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> | |||||
<!-- UAC 清单选项 | |||||
如果想要更改 Windows 用户帐户控制级别,请使用 | |||||
以下节点之一替换 requestedExecutionLevel 节点。 | |||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" /> | |||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> | |||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" /> | |||||
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。 | |||||
如果你的应用程序需要此虚拟化来实现向后兼容性,则移除此 | |||||
元素。 | |||||
--> | |||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> | |||||
</requestedPrivileges> | |||||
</security> | |||||
</trustInfo> | |||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> | |||||
<application> | |||||
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的 | |||||
Windows 版本的列表。取消评论适当的元素, | |||||
Windows 将自动选择最兼容的环境。 --> | |||||
<!-- Windows Vista --> | |||||
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />--> | |||||
<!-- Windows 7 --> | |||||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />--> | |||||
<!-- Windows 8 --> | |||||
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />--> | |||||
<!-- Windows 8.1 --> | |||||
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />--> | |||||
<!-- Windows 10 --> | |||||
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />--> | |||||
</application> | |||||
</compatibility> | |||||
<!-- 指示该应用程序可感知 DPI 且 Windows 在 DPI 较高时将不会对其进行 | |||||
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需 | |||||
选择加入。选择加入此设置的 Windows 窗体应用程序(面向 .NET Framework 4.6)还应 | |||||
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。 | |||||
将应用程序设为感知长路径。请参阅 https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation --> | |||||
<!-- | |||||
<application xmlns="urn:schemas-microsoft-com:asm.v3"> | |||||
<windowsSettings> | |||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware> | |||||
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware> | |||||
</windowsSettings> | |||||
</application> | |||||
--> | |||||
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) --> | |||||
<!-- | |||||
<dependency> | |||||
<dependentAssembly> | |||||
<assemblyIdentity | |||||
type="win32" | |||||
name="Microsoft.Windows.Common-Controls" | |||||
version="6.0.0.0" | |||||
processorArchitecture="*" | |||||
publicKeyToken="6595b64144ccf1df" | |||||
language="*" | |||||
/> | |||||
</dependentAssembly> | |||||
</dependency> | |||||
--> | |||||
</assembly> |
@@ -0,0 +1,13 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | |||||
<PropertyGroup> | |||||
<TargetFramework>net6.0</TargetFramework> | |||||
<ImplicitUsings>enable</ImplicitUsings> | |||||
<Nullable>enable</Nullable> | |||||
</PropertyGroup> | |||||
<ItemGroup> | |||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="6.0.6" /> | |||||
</ItemGroup> | |||||
</Project> |
@@ -1,11 +1,6 @@ | |||||
using Microsoft.AspNetCore.SignalR.Client; | using Microsoft.AspNetCore.SignalR.Client; | ||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace FryPot_DosingSystem.Helper | |||||
namespace BPASmartClient.HubHelper | |||||
{ | { | ||||
public class HubHelper | public class HubHelper | ||||
{ | { | ||||
@@ -13,6 +8,9 @@ namespace FryPot_DosingSystem.Helper | |||||
public static HubHelper GetInstance => _Instance ?? (_Instance = new HubHelper()); | public static HubHelper GetInstance => _Instance ?? (_Instance = new HubHelper()); | ||||
private HubHelper() { } | private HubHelper() { } | ||||
public Action<object> Report { get; set; } | |||||
public Action<object> Upstreamrequest { get; set; } | |||||
HubConnection hubConnection; | HubConnection hubConnection; | ||||
public void Connect() | public void Connect() | ||||
@@ -22,11 +20,13 @@ namespace FryPot_DosingSystem.Helper | |||||
hubConnection.On<object>("Report", (s) => | hubConnection.On<object>("Report", (s) => | ||||
{ | { | ||||
Report?.Invoke(s); | |||||
//注册接收消息的委托 | //注册接收消息的委托 | ||||
}); | }); | ||||
hubConnection.On<object>("Upstreamrequest", (s) => | hubConnection.On<object>("Upstreamrequest", (s) => | ||||
{ | { | ||||
Upstreamrequest?.Invoke(s); | |||||
//注册接收消息的委托 | //注册接收消息的委托 | ||||
}); | }); | ||||
@@ -45,7 +45,5 @@ namespace FryPot_DosingSystem.Helper | |||||
hubConnection.SendAsync("Send", info); | hubConnection.SendAsync("Send", info); | ||||
} | } | ||||
} | } | ||||
} | |||||
} |
@@ -1,25 +0,0 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | |||||
<PropertyGroup> | |||||
<TargetFramework>net6.0</TargetFramework> | |||||
<BaseOutputPath>bin\</BaseOutputPath> | |||||
<DebugType>portable</DebugType> | |||||
</PropertyGroup> | |||||
<ItemGroup> | |||||
<PackageReference Include="BPA.Message" Version="1.0.26" /> | |||||
<PackageReference Include="BPA.Models" Version="1.0.10" /> | |||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<ProjectReference Include="..\BPASmartClient.Device\BPASmartClient.Device.csproj" /> | |||||
<ProjectReference Include="..\BPASmartClient.DRCoffee\BPASmartClient.DRCoffee.csproj" /> | |||||
<ProjectReference Include="..\BPASmartClient.GSIceCream\BPASmartClient.GSIceCream.csproj" /> | |||||
<ProjectReference Include="..\BPASmartClient.Lebai\BPASmartClient.Lebai.csproj" /> | |||||
<ProjectReference Include="..\BPASmartClient.SCChip\BPASmartClient.SCChip.csproj" /> | |||||
<ProjectReference Include="..\BPASmartClient.SCChip\BPASmartClient.SCChip.csproj" /> | |||||
<ProjectReference Include="..\Lebai.SDK\Lebai.SDK.csproj" /> | |||||
</ItemGroup> | |||||
</Project> |
@@ -1,644 +0,0 @@ | |||||
using BPA.Message; | |||||
using BPA.Message.Enum; | |||||
using BPA.Message.IOT; | |||||
using BPASmartClient.Device; | |||||
using BPASmartClient.DRCoffee; | |||||
using BPASmartClient.EventBus; | |||||
using BPASmartClient.GSIceCream; | |||||
using BPASmartClient.Helper; | |||||
using BPASmartClient.Lebai; | |||||
using BPASmartClient.Message; | |||||
using BPASmartClient.Model; | |||||
using BPASmartClient.Model.冰淇淋.Enum; | |||||
using BPASmartClient.Model.单片机; | |||||
using BPASmartClient.Model.单片机.Enum; | |||||
using BPASmartClient.Model.咖啡机.Enum; | |||||
using BPASmartClient.SCChip; | |||||
using Robotc; | |||||
using System; | |||||
using System.Collections.Concurrent; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading; | |||||
using static BPASmartClient.EventBus.EventBus; | |||||
namespace BPASmartClient.MORKIC | |||||
{ | |||||
/* | |||||
* 冰淇淋咖啡机组合套装 | |||||
* 物料位置: | |||||
* 1:冰淇料 | |||||
* 2:冰淇淋杯 | |||||
* 5:咖啡 | |||||
* 6:咖啡杯 | |||||
*/ | |||||
public class Control_MORKIC : BaseDevice | |||||
{ | |||||
//咖啡机主控程序 | |||||
private CoffeeMachine coffeeMachine; | |||||
//单片机主控程序 | |||||
private ICChipMachine icchipMachine; | |||||
//广绅单口冰淇淋机 | |||||
private IceCreamMachine iceCreamMachine; | |||||
//物料存放位置 | |||||
private Dictionary<string, PolymerBatching> batchings = new Dictionary<string, PolymerBatching>(); | |||||
/// <summary> | |||||
/// 获取乐百机器人的数据 | |||||
/// </summary> | |||||
SignalResult lebai = new SignalResult(); | |||||
/// <summary> | |||||
/// 咖啡位置是否有东西 | |||||
/// </summary> | |||||
private bool IsCoffeeMake = false; | |||||
private bool enableFunny = false; | |||||
private DateTime lastRecvdOrder = DateTime.Now; | |||||
private bool working = false; | |||||
private bool IceIsOK = true; | |||||
public void ConnectOk() | |||||
{ | |||||
} | |||||
/// <summary> | |||||
/// 当前正在制作咖啡 | |||||
/// </summary> | |||||
SimOrderData MakeCoffeeOrder = new SimOrderData(); | |||||
/// <summary> | |||||
/// 咖啡订单队列 | |||||
/// </summary> | |||||
ConcurrentQueue<SimOrderData> morkOrderPushesCoffee = new ConcurrentQueue<SimOrderData>(); | |||||
/// <summary> | |||||
/// 冰淇淋订单队列 | |||||
/// </summary> | |||||
ConcurrentQueue<SimOrderData> morkOrderPushesIceCream = new ConcurrentQueue<SimOrderData>(); | |||||
/// <summary> | |||||
/// 等待取餐的订单,只有一个 | |||||
/// </summary> | |||||
ConcurrentQueue<SimOrderData> WaitTakeMealOrder = new ConcurrentQueue<SimOrderData>(); | |||||
public void Init() | |||||
{ | |||||
ActionManage.GetInstance.Register(new Action<object>((s) => | |||||
{ | |||||
if (s is DrCoffeeDrinksCode cf) | |||||
{ | |||||
DoCoffee(new SimOrderData { Loc = ((int)cf).ToString() }); | |||||
} | |||||
else if (s is Dictionary<string, string> ms) | |||||
{ | |||||
if (ms.ContainsKey("Button")) | |||||
{ | |||||
switch (ms["Button"]) | |||||
{ | |||||
case "启动示教": | |||||
LebaiRobot.GetInstance.StartTeachMode(); | |||||
break; | |||||
case "停止示教": | |||||
LebaiRobot.GetInstance.EndtTeachMode(); | |||||
break; | |||||
case "启动机器人": | |||||
LebaiRobot.GetInstance.StartRobot(); | |||||
break; | |||||
case "急停": | |||||
LebaiRobot.GetInstance.EStopRobot(); | |||||
break; | |||||
default: | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
}), "SimCoffee"); | |||||
//构建所有商品物料信息 | |||||
batchings = PolymerBatching.BuildAll(); | |||||
EventBus.EventBus.GetInstance().Subscribe<DRCoffee_CoffeEndCookEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) | |||||
{ | |||||
if (MakeCoffeeOrder != null) | |||||
MakeCoffeeOrder.OrderStatus = 1; | |||||
}); | |||||
System.Configuration.Configuration config = System.Configuration.ConfigurationManager.OpenExeConfiguration(System.Configuration.ConfigurationUserLevel.None); | |||||
//一系列外围基础配置 | |||||
var com_Coffee = config.AppSettings.Settings["COM_Coffee"].Value; | |||||
var baud_Coffee = config.AppSettings.Settings["BAUD_Coffee"].Value; | |||||
var com_IceCream = config.AppSettings.Settings["COM_IceCream"].Value; | |||||
var baud_IceCream = config.AppSettings.Settings["BAUD_IceCream"].Value; | |||||
var iceCreamCXBThreshold = int.Parse(config.AppSettings.Settings["IceCream_CXB_Threshold"].Value); | |||||
var com_ICChip = config.AppSettings.Settings["COM_ICChip"].Value; | |||||
var baud_ICChip = config.AppSettings.Settings["BAUD_IChip"].Value; | |||||
if (iceCreamCXBThreshold > 0) | |||||
{ | |||||
//设置冰淇淋成型比 | |||||
MorkIStatus.GetInstance().CXB_Threshold = (byte)iceCreamCXBThreshold; | |||||
} | |||||
//咖啡机创建 | |||||
coffeeMachine = new CoffeeMachine(); | |||||
//单片机机创建 | |||||
icchipMachine = new ICChipMachine(); | |||||
//冰淇淋机创建 | |||||
iceCreamMachine = new IceCreamMachine(); | |||||
Main(); | |||||
ReadRobotData(); | |||||
OrderMake(); | |||||
} | |||||
private int NoOrderTime = 0; | |||||
public override DeviceClientType DeviceType => DeviceClientType.MORKT; | |||||
//订单制作 | |||||
public void OrderMake() | |||||
{ | |||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
{ | |||||
while (IsHealth && (morkOrderPushesCoffee.Count > 0 || morkOrderPushesIceCream.Count > 0 || IsCoffeeMake)) | |||||
{ | |||||
working = true; NoOrderTime = 0; | |||||
//1.有咖啡订单 取杯去制作 | |||||
if (!IsCoffeeMake)//位置无杯子 | |||||
{ | |||||
if (morkOrderPushesCoffee.Count > 0 && morkOrderPushesCoffee.TryDequeue(out SimOrderData simOrder)) | |||||
{ | |||||
IsCoffeeMake = true; MakeCoffeeOrder = simOrder; | |||||
MessageLog.GetInstance.Show($"开始制作 [咖啡] 订单[{simOrder.morkOrder.SortNum}]"); | |||||
DoCoffee(simOrder); | |||||
} | |||||
} | |||||
if (!LebaiRobot.GetInstance.GetInput())//取餐口是否有餐饮 | |||||
{ | |||||
//取餐位的订单完成 | |||||
if (WaitTakeMealOrder.TryDequeue(out SimOrderData waitOrder)) OrderChange(waitOrder.morkOrder.SuborderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); | |||||
//1.制作冰淇淋 | |||||
if (morkOrderPushesIceCream.Count > 0 && MorkIStatus.GetInstance().CurrentMode != MORKI_MODE.制冷模式) new GSIceCream_ModeSetEvent() { Mode = MORKI_MODE.制冷模式 }.Publish(); | |||||
if (MorkIStatus.GetInstance().CXB >= 86 && morkOrderPushesIceCream.Count > 0)//成型比大于80 我才会制作 | |||||
{ | |||||
if (LebaiRobot.GetInstance.GetInput(3)) | |||||
{ | |||||
if (IceIsOK) MessageLog.GetInstance.Show("请擦拭冰淇淋机出口"); | |||||
IceIsOK = false; | |||||
} | |||||
else if (morkOrderPushesIceCream.TryDequeue(out SimOrderData order)) | |||||
{ | |||||
IceIsOK = true; | |||||
MessageLog.GetInstance.Show($"开始制作 [冰淇淋] 订单[{order.morkOrder.SortNum}]"); | |||||
DoIceCream(order); | |||||
} | |||||
} | |||||
//2.取咖啡到取餐口 | |||||
if (IsCoffeeMake) | |||||
{ | |||||
if (MakeCoffeeOrder != null && MakeCoffeeOrder.OrderStatus == 1) | |||||
{ | |||||
MessageLog.GetInstance.Show($"将咖啡移动到取餐位 [咖啡] 订单[{MakeCoffeeOrder.morkOrder.SortNum}]"); | |||||
DoCoffeeQC(MakeCoffeeOrder); | |||||
MakeCoffeeOrder = null; | |||||
IsCoffeeMake = false; | |||||
} | |||||
} | |||||
} | |||||
working = false; | |||||
lastRecvdOrder = DateTime.Now; | |||||
} | |||||
if (IsHealth == false && (morkOrderPushesCoffee.Count > 0 || morkOrderPushesIceCream.Count > 0 || IsCoffeeMake)) | |||||
{ | |||||
MessageLog.GetInstance.Show($"机器连接问题 订单,不允许制作,请检查设备连接后尝试," + | |||||
$"乐白:{LebaiRobot.GetInstance.IsConnected}咖啡机:{MorkIStatus.GetInstance().CanDo}单片机:{ChipStatus.GetInstance().CanDo}"); | |||||
if (LebaiRobot.GetInstance.IsConnected && IsCoffeeMake && !LebaiRobot.GetInstance.GetInput())//乐白有订单 | |||||
{ | |||||
MessageLog.GetInstance.Show($"将咖啡移动到取餐位 [咖啡] 订单[{MakeCoffeeOrder.morkOrder.SortNum}]"); | |||||
DoCoffeeQC(MakeCoffeeOrder); | |||||
MakeCoffeeOrder = null; | |||||
IsCoffeeMake = false; | |||||
} | |||||
} | |||||
if (!LebaiRobot.GetInstance.GetInput()) | |||||
{ | |||||
if (WaitTakeMealOrder.TryDequeue(out SimOrderData waitOrder)) OrderChange(waitOrder.morkOrder.SuborderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); | |||||
} | |||||
Thread.Sleep(1000); | |||||
}), "订单制作"); | |||||
} | |||||
private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) | |||||
{ | |||||
EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); | |||||
} | |||||
public void Main() | |||||
{ | |||||
//咖啡机开启主线程 | |||||
coffeeMachine.Start(); | |||||
//单片机开启主线程 | |||||
icchipMachine.Start(); | |||||
//冰淇淋机开启主线程 | |||||
iceCreamMachine.Start(); | |||||
new GSIceCream_ModeSetEvent() { Mode = MORKI_MODE.制冷模式 }.Publish(); | |||||
//开始心跳刷新,根据咖啡机及冰淇淋机来判断 | |||||
//ThreadManage.GetInstance().StartLong(new Action(() => | |||||
//{ | |||||
// GeneralConfig.Healthy = | |||||
// LebaiRobot.GetInstance.IsConnected && | |||||
// MorkCStatus.GetInstance().CanDo && | |||||
// ChipStatus.GetInstance().CanDo; | |||||
// //GeneralConfig.Healthy = true; | |||||
// Thread.Sleep(100); | |||||
//}), "MORK-IC心跳刷新"); | |||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
{ | |||||
while (!LebaiRobot.GetInstance.IsConnected) | |||||
{ | |||||
Thread.Sleep(10); | |||||
} | |||||
//LebaiRobot.GetInstance.Scene(LebaiRobot.SENCE_欢迎); | |||||
}), "MORK-IC欢迎"); | |||||
} | |||||
public void DataParse<T>(T order) | |||||
{ | |||||
if (order is MorkOrderPush morkOrderPush) | |||||
{ | |||||
//商品类型 | |||||
GOODS_TYPE currentGoodsType = GOODS_TYPE.NEITHER; | |||||
string loc_coffe = string.Empty; | |||||
string loc_cup = string.Empty; | |||||
#region 订单分类 | |||||
//遍历物料 | |||||
foreach (var item in morkOrderPush.GoodBatchings) | |||||
{ | |||||
var res = Json<BatchingInfoPar>.Data.orderMaterialDelivery.BatchingInfo.FirstOrDefault(p => p.BatchingId == item.BatchingId); | |||||
if (res != null) | |||||
{ | |||||
//验证商品是咖啡还是冰淇淋 | |||||
if (ValidateGoodsByBatching(res.BatchingLoc) != GOODS_TYPE.NEITHER) | |||||
{ | |||||
//获取当前物料所属商品类型 | |||||
currentGoodsType = ValidateGoodsByBatching(res.BatchingLoc); | |||||
} | |||||
//获取主料和容器位置 | |||||
switch (batchings[res.BatchingLoc].BatchingClass) | |||||
{ | |||||
case BATCHING_CLASS.HOLDER: | |||||
loc_cup = res.BatchingLoc; | |||||
break; | |||||
case BATCHING_CLASS.MAIN_MATERIAL: | |||||
loc_coffe = res.BatchingLoc; | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
//根据商品类型执行具体制作流程 | |||||
switch (currentGoodsType) | |||||
{ | |||||
case GOODS_TYPE.COFFEE: | |||||
morkOrderPushesCoffee.Enqueue(new SimOrderData { Loc = loc_coffe, morkOrder = morkOrderPush }); | |||||
break; | |||||
case GOODS_TYPE.ICECREAM: | |||||
morkOrderPushesIceCream.Enqueue(new SimOrderData { Loc = loc_coffe, morkOrder = morkOrderPush }); | |||||
break; | |||||
case GOODS_TYPE.NEITHER: | |||||
MessageLog.GetInstance.Show("未知的商品类型"); | |||||
break; | |||||
} | |||||
#endregion | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 验证当前是做咖啡还是做冰淇淋 | |||||
/// </summary> | |||||
/// <param name="batchingLoc">物料位置</param> | |||||
private GOODS_TYPE ValidateGoodsByBatching(string batchingLoc) | |||||
{ | |||||
if (batchings.ContainsKey(batchingLoc)) | |||||
return batchings[batchingLoc].GoodsType; | |||||
return GOODS_TYPE.NEITHER; | |||||
} | |||||
private void Wait(int value = 101) | |||||
{ | |||||
while (!(lebai.Ok && lebai.Value == value)) | |||||
{ | |||||
Thread.Sleep(5); | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 做咖啡-接杯子 并且 回到 安全位置 | |||||
/// </summary> | |||||
private void DoCoffee(SimOrderData order) | |||||
{ | |||||
#region 且时且多入场设备程序 | |||||
int checkeNum = 0; | |||||
// are.Reset(); | |||||
LebaiRobot.GetInstance.SetValue(0); | |||||
OrderChange(order.morkOrder.SuborderId, ORDER_STATUS.COOKING); | |||||
//SimpleFactory.GetInstance.OrderChanged(order.morkOrder.SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); | |||||
LebaiRobot.GetInstance.Scene(LebaiRobot.SENCE_取咖啡杯); | |||||
Wait(); | |||||
new SCChip_TakeCupEvent() { Cup = IC_CUP.CUP_COFFEE }.Publish();//落碗控制 | |||||
Thread.Sleep(500); | |||||
MessageLog.GetInstance.Show("尝试取咖啡杯!"); | |||||
LebaiRobot.GetInstance.SetValue(1); | |||||
int count = 2; | |||||
p: | |||||
LebaiRobot.GetInstance.Scene(LebaiRobot.SENCE_咖啡杯检测); | |||||
Wait(); | |||||
LebaiRobot.GetInstance.SetValue(1); | |||||
if (!LebaiRobot.GetInstance.GetInput()) | |||||
{ | |||||
if (count >= 3) | |||||
{ | |||||
//退出循环回到初始位置 | |||||
DeviceProcessLogShow($"执行{count}次取咖啡杯,仍为成功,订单默认废弃,机器人回到初始位置!"); | |||||
LebaiRobot.GetInstance.Scene(LebaiRobot.SENCE_咖啡杯回原点); | |||||
Wait(); | |||||
LebaiRobot.GetInstance.SetValue(1); | |||||
return; | |||||
} | |||||
DeviceProcessLogShow("执行二次取咖啡杯"); | |||||
LebaiRobot.GetInstance.Scene(LebaiRobot.SENCE_二次取咖啡杯); | |||||
Wait(); | |||||
new SCChip_TakeCupEvent() { Cup = IC_CUP.CUP_COFFEE }.Publish();//落碗控制 | |||||
LebaiRobot.GetInstance.SetValue(1); | |||||
count++; | |||||
goto p; | |||||
} | |||||
DeviceProcessLogShow("咖啡杯取杯完成"); | |||||
LebaiRobot.GetInstance.Scene(LebaiRobot.SENCE_接咖啡后回原点); | |||||
Wait(); | |||||
LebaiRobot.GetInstance.SetValue(1); | |||||
//加场景 回初始位置 | |||||
new DRCoffee_MakeCoffeeEvent() { DrinkCode = (Model.咖啡机.Enum.DrCoffeeDrinksCode)int.Parse(order.Loc) }.Publish(); //接咖啡控制 | |||||
DeviceProcessLogShow($"发送咖啡机制作{order.Loc}!"); | |||||
#endregion | |||||
} | |||||
/// <summary> | |||||
/// 将咖啡杯子 取走到 取餐口 | |||||
/// </summary> | |||||
private void DoCoffeeQC(SimOrderData order) | |||||
{ | |||||
LebaiRobot.GetInstance.Scene(LebaiRobot.SENCE_取咖啡出餐); | |||||
Wait(); | |||||
LebaiRobot.GetInstance.SetValue(1); | |||||
//订单状态改变:完成 | |||||
OrderChange(order.morkOrder.SuborderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_COOK); | |||||
//SimpleFactory.GetInstance.OrderChanged(order.morkOrder.SuborderId,BPA.Message.Enum.ORDER_STATUS.COMPLETED_COOK); | |||||
DeviceProcessLogShow($"{order.morkOrder.GoodsName}等待取餐"); | |||||
WaitTakeMealOrder.Enqueue(order); | |||||
} | |||||
/// <summary> | |||||
/// 做冰淇淋 | |||||
/// </summary> | |||||
private void DoIceCream(SimOrderData order) | |||||
{ | |||||
//if (LebaiRobot.GetInstance.GetInput(3)) | |||||
//{ | |||||
// MessageLog.GetInstance.Show("请擦拭冰淇淋机出口"); | |||||
// return; | |||||
//} | |||||
#region 且时且多入场设备程序 | |||||
int checkeNum = 0; | |||||
//are.Reset(); | |||||
LebaiRobot.GetInstance.SetValue(0); | |||||
LebaiRobot.GetInstance.Scene(LebaiRobot.SENCE_取冰淇淋杯); | |||||
Wait(); | |||||
new SCChip_TakeCupEvent() { Cup = IC_CUP.CUP_ICECREAM }.Publish();//落碗控制 | |||||
Thread.Sleep(500); | |||||
MessageLog.GetInstance.Show("尝试取冰淇淋杯!"); | |||||
LebaiRobot.GetInstance.SetValue(1); | |||||
int count = 2; | |||||
p: | |||||
LebaiRobot.GetInstance.Scene(LebaiRobot.SENCE_冰淇淋杯检测); | |||||
Wait(); | |||||
LebaiRobot.GetInstance.SetValue(1); | |||||
if (!LebaiRobot.GetInstance.GetInput()) | |||||
{ | |||||
if (count >= 3) | |||||
{ | |||||
//退出循环回到初始位置 | |||||
MessageLog.GetInstance.Show($"执行{count}次取冰淇淋杯,仍未成功,订单默认废弃,机器人回到初始位置!"); | |||||
LebaiRobot.GetInstance.Scene(LebaiRobot.SENCE_冰淇淋杯回原点); | |||||
Wait(); | |||||
LebaiRobot.GetInstance.SetValue(1); | |||||
return; | |||||
} | |||||
MessageLog.GetInstance.Show($"执行{count}次取冰淇淋杯!"); | |||||
LebaiRobot.GetInstance.Scene(LebaiRobot.SENCE_二次取冰淇淋杯); | |||||
new SCChip_TakeCupEvent() { Cup = IC_CUP.CUP_ICECREAM }.Publish();//落碗控制 | |||||
Wait(); | |||||
LebaiRobot.GetInstance.SetValue(1); | |||||
count++; | |||||
goto p; | |||||
} | |||||
MessageLog.GetInstance.Show("冰淇淋杯检测完成"); | |||||
#region 通讯冰淇淋机 | |||||
//制冷模式 | |||||
new GSIceCream_ModeSetEvent() { Mode = MORKI_MODE.制冷模式 }.Publish(); | |||||
LebaiRobot.GetInstance.SetValue(0); | |||||
OrderChange(order.morkOrder.SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); | |||||
//SimpleFactory.GetInstance.OrderChanged(order.morkOrder.SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); | |||||
LebaiRobot.GetInstance.Scene(LebaiRobot.SENCE_接1号冰淇淋); | |||||
Wait(); | |||||
bool doItResult = true; | |||||
//出料 | |||||
new GSIceCream_DischargeEvent().Publish(delegate (object[] args) | |||||
{ | |||||
doItResult = (bool)args[0]; | |||||
}); | |||||
if (doItResult) | |||||
{ | |||||
IceCreamCookCheck(); | |||||
} | |||||
else | |||||
{ | |||||
int count_1 = 0; | |||||
while (MorkIStatus.GetInstance().CXB <= 86) | |||||
{ | |||||
Thread.Sleep(5); | |||||
count_1++; | |||||
if (count_1 >= 2000) | |||||
break; | |||||
} | |||||
IceCreamCookCheck(); | |||||
} | |||||
LebaiRobot.GetInstance.SetValue(1); | |||||
#endregion | |||||
while (LebaiRobot.GetInstance.GetInput()) | |||||
{ | |||||
Thread.Sleep(500); | |||||
} | |||||
LebaiRobot.GetInstance.Scene(LebaiRobot.SENCE_放冰淇淋位置); | |||||
Wait(); | |||||
LebaiRobot.GetInstance.SetValue(1); | |||||
//订单状态改变:完成 | |||||
OrderChange(order.morkOrder.SuborderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_COOK); | |||||
//SimpleFactory.GetInstance.OrderChanged(order.morkOrder.SuborderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_COOK); | |||||
MessageLog.GetInstance.Show($"{order.morkOrder.GoodsName}等待取餐"); | |||||
WaitTakeMealOrder.Enqueue(order); | |||||
#endregion | |||||
} | |||||
/// <summary> | |||||
/// 冰淇淋制作 | |||||
/// </summary> | |||||
public void IceCreamCookCheck() | |||||
{ | |||||
int retry = 3; | |||||
DateTime beginTime = DateTime.Now; | |||||
while (!LebaiRobot.GetInstance.GetInput(3)) | |||||
{ | |||||
if (retry <= 0 && DateTime.Now.Subtract(beginTime).TotalSeconds >= 10) | |||||
{ | |||||
MessageLog.GetInstance.Show("超时未出料,重试次数用尽"); | |||||
break; | |||||
} | |||||
if (DateTime.Now.Subtract(beginTime).TotalSeconds > 5) | |||||
{ | |||||
MessageLog.GetInstance.Show("超时未出料,重新发送打料指令"); | |||||
new GSIceCream_ModeSetEvent() { Mode = MORKI_MODE.打料 }.Publish(); | |||||
beginTime = DateTime.Now; | |||||
retry--; | |||||
} | |||||
Thread.Sleep(10); | |||||
} | |||||
MessageLog.GetInstance.Show("开始等待6s"); | |||||
Thread.Sleep(5000); | |||||
} | |||||
//private void CoffeEndCookHandle(IEvent @event, EventBus.EventCallBackHandle callBack) | |||||
//{ | |||||
// //are.Set(); | |||||
// if(MakeCoffeeOrder!=null) | |||||
// MakeCoffeeOrder.OrderStatus = 1; | |||||
//} | |||||
public void ReadRobotData() | |||||
{ | |||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
{ | |||||
lebai = LebaiRobot.GetInstance.GetValueAsync(); | |||||
LebaiRobot.GetInstance.GetRobotModeStatus(); | |||||
//LebaiRobot.GetInstance.GetInput(); | |||||
Thread.Sleep(100); | |||||
}), "乐百机器人数据读取", true); | |||||
} | |||||
public void SimOrder<T>(T simOrder) | |||||
{ | |||||
} | |||||
/// <summary> | |||||
/// IOT 广播消息命令 | |||||
/// </summary> | |||||
public void IotBroadcast<T>(T broadcast) | |||||
{ | |||||
if (broadcast != null && broadcast is IOTCommandModel iOTCommand) | |||||
{ | |||||
switch (iOTCommand.CommandName) | |||||
{ | |||||
case 0://控制类 | |||||
if (iOTCommand.CommandValue != null) | |||||
{ | |||||
if (iOTCommand.CommandValue.ContainsKey("SimOrder")) | |||||
{ | |||||
//SimOrder(new SimOrderData { NoodleLoc = 1, BowlLoc = 10 }); | |||||
} | |||||
} | |||||
break; | |||||
case 1://设置属性 | |||||
break; | |||||
case 2://通知消息 | |||||
break; | |||||
default: | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
public override void DoMain() | |||||
{ | |||||
} | |||||
public override void Stop() | |||||
{ | |||||
} | |||||
public override void ReadData() | |||||
{ | |||||
} | |||||
public override void MainTask() | |||||
{ | |||||
} | |||||
public override void ResetProgram() | |||||
{ | |||||
} | |||||
} | |||||
public class SimOrderData | |||||
{ | |||||
public string id { get; set; } | |||||
public int OrderStatus { get; set; } | |||||
public string Loc { get; set; } | |||||
public MorkOrderPush morkOrder { get; set; } | |||||
public SimOrderData() | |||||
{ | |||||
id = Guid.NewGuid().ToString(); | |||||
OrderStatus = 0; | |||||
} | |||||
} | |||||
} |
@@ -1,122 +0,0 @@ | |||||
| |||||
using BPASmartClient.Lebai; | |||||
using BPASmartClient.Model.单片机.Enum; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.MORKIC | |||||
{ | |||||
internal enum GOODS_TYPE | |||||
{ | |||||
NEITHER, | |||||
COFFEE, | |||||
ICECREAM, | |||||
} | |||||
internal enum BATCHING_CLASS | |||||
{ | |||||
HOLDER, | |||||
MAIN_MATERIAL, | |||||
} | |||||
internal class PolymerBatching | |||||
{ | |||||
internal const string ICE_MAIN_BATCHIN1_LOC = "52"; | |||||
internal const string ICE_MAIN_BATCHIN2_LOC = "53"; | |||||
internal const string ICE_MAIN_BATCHIN3_LOC = "54"; | |||||
internal const string COFFEE_HOLDER_LOC = "30"; | |||||
internal const string ICE_HOLDER_LOC = "51"; | |||||
public static Dictionary<string, GOODS_TYPE> GOODS_TYPES = new Dictionary<string, GOODS_TYPE>() { | |||||
{"1", GOODS_TYPE.COFFEE}, | |||||
{"2", GOODS_TYPE.COFFEE}, | |||||
{"3", GOODS_TYPE.COFFEE}, | |||||
{"4", GOODS_TYPE.COFFEE}, | |||||
{"5", GOODS_TYPE.COFFEE}, | |||||
{"6", GOODS_TYPE.COFFEE}, | |||||
{"7", GOODS_TYPE.COFFEE}, | |||||
{"8", GOODS_TYPE.COFFEE}, | |||||
{"9", GOODS_TYPE.COFFEE}, | |||||
{"10",GOODS_TYPE.COFFEE}, | |||||
{"11",GOODS_TYPE.COFFEE}, | |||||
{"12",GOODS_TYPE.COFFEE}, | |||||
{"13",GOODS_TYPE.COFFEE}, | |||||
{"14",GOODS_TYPE.COFFEE}, | |||||
{"15",GOODS_TYPE.COFFEE}, | |||||
{"16",GOODS_TYPE.COFFEE}, | |||||
{"17",GOODS_TYPE.COFFEE}, | |||||
{"18",GOODS_TYPE.COFFEE}, | |||||
{"19",GOODS_TYPE.COFFEE}, | |||||
{"20",GOODS_TYPE.COFFEE}, | |||||
{"21",GOODS_TYPE.COFFEE}, | |||||
{"22",GOODS_TYPE.COFFEE}, | |||||
{"23",GOODS_TYPE.COFFEE}, | |||||
{"24",GOODS_TYPE.COFFEE}, | |||||
{"25",GOODS_TYPE.COFFEE}, | |||||
{"30",GOODS_TYPE.COFFEE}, | |||||
{"51",GOODS_TYPE.ICECREAM}, | |||||
{ICE_MAIN_BATCHIN1_LOC,GOODS_TYPE.ICECREAM}, | |||||
{ICE_MAIN_BATCHIN2_LOC,GOODS_TYPE.ICECREAM}, | |||||
{ICE_MAIN_BATCHIN3_LOC,GOODS_TYPE.ICECREAM}, | |||||
}; | |||||
public GOODS_TYPE GoodsType { get; set; } | |||||
public BATCHING_CLASS BatchingClass { get; set; } | |||||
private string loc; | |||||
public string Loc | |||||
{ | |||||
get { return loc; } | |||||
set | |||||
{ | |||||
loc = value; | |||||
if (GOODS_TYPES.ContainsKey(loc)) | |||||
GoodsType = GOODS_TYPES[loc]; | |||||
switch (loc) | |||||
{ | |||||
case COFFEE_HOLDER_LOC: | |||||
case ICE_HOLDER_LOC: | |||||
BatchingClass = BATCHING_CLASS.HOLDER; | |||||
break; | |||||
default: | |||||
BatchingClass = BATCHING_CLASS.MAIN_MATERIAL; | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
internal static Dictionary<string, PolymerBatching> BuildAll() | |||||
{ | |||||
Dictionary<string, PolymerBatching> temp = new Dictionary<string, PolymerBatching>(); | |||||
foreach (var item in GOODS_TYPES) | |||||
{ | |||||
temp.Add(item.Key, new PolymerBatching() { Loc = item.Key }); | |||||
} | |||||
return temp; | |||||
} | |||||
internal static IC_SE GetIceCreamSE(string loc, out int sence) | |||||
{ | |||||
switch (loc) | |||||
{ | |||||
case ICE_MAIN_BATCHIN1_LOC: | |||||
sence = LebaiRobot.SENCE_接1号冰淇淋; | |||||
return IC_SE.SE_1; | |||||
case ICE_MAIN_BATCHIN2_LOC: | |||||
sence = LebaiRobot.SENCE_接2号冰淇淋; | |||||
return IC_SE.SE_2; | |||||
case ICE_MAIN_BATCHIN3_LOC: | |||||
sence = LebaiRobot.SENCE_接3号冰淇淋; | |||||
return IC_SE.SE_3; | |||||
default: | |||||
sence = LebaiRobot.SENCE_接1号冰淇淋; | |||||
return IC_SE.SE_1; | |||||
} | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,7 @@ | |||||
namespace HubHelper | |||||
{ | |||||
public class HubHelper | |||||
{ | |||||
} | |||||
} |
@@ -0,0 +1,9 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | |||||
<PropertyGroup> | |||||
<TargetFramework>net6.0</TargetFramework> | |||||
<ImplicitUsings>enable</ImplicitUsings> | |||||
<Nullable>enable</Nullable> | |||||
</PropertyGroup> | |||||
</Project> |
@@ -104,7 +104,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkT_Contai | |||||
EndProject | EndProject | ||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.IceMaker", "BPASmartClient.IceMaker\BPASmartClient.IceMaker.csproj", "{F61AC179-156D-4075-BFEB-355862231F48}" | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.IceMaker", "BPASmartClient.IceMaker\BPASmartClient.IceMaker.csproj", "{F61AC179-156D-4075-BFEB-355862231F48}" | ||||
EndProject | EndProject | ||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MorkT_BarCounter", "BPASmartClient.MorkT_BarCounter\BPASmartClient.MorkT_BarCounter.csproj", "{048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}" | |||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkT_BarCounter", "BPASmartClient.MorkT_BarCounter\BPASmartClient.MorkT_BarCounter.csproj", "{048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}" | |||||
EndProject | |||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.AgvApi", "BPASmartClient.AgvApi\BPASmartClient.AgvApi.csproj", "{A0E79D88-9291-4C35-B245-906510F6D59F}" | |||||
EndProject | |||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FryPot_DosingSystem", "FryPot_DosingSystem\FryPot_DosingSystem.csproj", "{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}" | |||||
EndProject | |||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.ZhuoDian", "BPASmartClient.ZhuoDian\BPASmartClient.ZhuoDian.csproj", "{D3705A39-9875-4BB1-B592-C551A6DC6D87}" | |||||
EndProject | |||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.HubHelper", "BPASmartClient.HubHelper\BPASmartClient.HubHelper.csproj", "{67A46DBB-5984-4287-942F-5C392C0CBFAA}" | |||||
EndProject | EndProject | ||||
Global | Global | ||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
@@ -980,6 +988,86 @@ Global | |||||
{048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}.Release|x64.Build.0 = Release|Any CPU | {048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}.Release|x64.Build.0 = Release|Any CPU | ||||
{048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}.Release|x86.ActiveCfg = Release|Any CPU | {048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}.Release|x86.ActiveCfg = Release|Any CPU | ||||
{048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}.Release|x86.Build.0 = Release|Any CPU | {048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}.Release|x86.Build.0 = Release|Any CPU | ||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Debug|ARM.ActiveCfg = Debug|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Debug|ARM.Build.0 = Debug|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Debug|ARM64.ActiveCfg = Debug|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Debug|ARM64.Build.0 = Debug|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Debug|x64.ActiveCfg = Debug|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Debug|x64.Build.0 = Debug|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Debug|x86.ActiveCfg = Debug|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Debug|x86.Build.0 = Debug|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Release|ARM.ActiveCfg = Release|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Release|ARM.Build.0 = Release|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Release|ARM64.ActiveCfg = Release|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Release|ARM64.Build.0 = Release|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Release|x64.ActiveCfg = Release|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Release|x64.Build.0 = Release|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Release|x86.ActiveCfg = Release|Any CPU | |||||
{A0E79D88-9291-4C35-B245-906510F6D59F}.Release|x86.Build.0 = Release|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Debug|ARM.ActiveCfg = Debug|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Debug|ARM.Build.0 = Debug|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Debug|ARM64.ActiveCfg = Debug|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Debug|ARM64.Build.0 = Debug|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Debug|x64.ActiveCfg = Debug|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Debug|x64.Build.0 = Debug|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Debug|x86.ActiveCfg = Debug|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Debug|x86.Build.0 = Debug|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Release|ARM.ActiveCfg = Release|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Release|ARM.Build.0 = Release|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Release|ARM64.ActiveCfg = Release|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Release|ARM64.Build.0 = Release|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Release|x64.ActiveCfg = Release|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Release|x64.Build.0 = Release|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Release|x86.ActiveCfg = Release|Any CPU | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B}.Release|x86.Build.0 = Release|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Debug|ARM.ActiveCfg = Debug|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Debug|ARM.Build.0 = Debug|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Debug|ARM64.ActiveCfg = Debug|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Debug|ARM64.Build.0 = Debug|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Debug|x64.ActiveCfg = Debug|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Debug|x64.Build.0 = Debug|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Debug|x86.ActiveCfg = Debug|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Debug|x86.Build.0 = Debug|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Release|ARM.ActiveCfg = Release|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Release|ARM.Build.0 = Release|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Release|ARM64.ActiveCfg = Release|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Release|ARM64.Build.0 = Release|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Release|x64.ActiveCfg = Release|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Release|x64.Build.0 = Release|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Release|x86.ActiveCfg = Release|Any CPU | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87}.Release|x86.Build.0 = Release|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Debug|ARM.ActiveCfg = Debug|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Debug|ARM.Build.0 = Debug|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Debug|ARM64.ActiveCfg = Debug|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Debug|ARM64.Build.0 = Debug|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Debug|x64.ActiveCfg = Debug|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Debug|x64.Build.0 = Debug|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Debug|x86.ActiveCfg = Debug|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Debug|x86.Build.0 = Debug|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Release|ARM.ActiveCfg = Release|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Release|ARM.Build.0 = Release|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Release|ARM64.ActiveCfg = Release|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Release|ARM64.Build.0 = Release|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Release|x64.ActiveCfg = Release|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Release|x64.Build.0 = Release|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Release|x86.ActiveCfg = Release|Any CPU | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Release|x86.Build.0 = Release|Any CPU | |||||
EndGlobalSection | EndGlobalSection | ||||
GlobalSection(SolutionProperties) = preSolution | GlobalSection(SolutionProperties) = preSolution | ||||
HideSolutionNode = FALSE | HideSolutionNode = FALSE | ||||
@@ -1028,6 +1116,10 @@ Global | |||||
{3653724D-3683-4722-B978-EB88DD4AE5DB} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} | {3653724D-3683-4722-B978-EB88DD4AE5DB} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} | ||||
{F61AC179-156D-4075-BFEB-355862231F48} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD} | {F61AC179-156D-4075-BFEB-355862231F48} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD} | ||||
{048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} | {048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} | ||||
{A0E79D88-9291-4C35-B245-906510F6D59F} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | |||||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | |||||
{D3705A39-9875-4BB1-B592-C551A6DC6D87} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | |||||
{67A46DBB-5984-4287-942F-5C392C0CBFAA} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625} | |||||
EndGlobalSection | EndGlobalSection | ||||
GlobalSection(ExtensibilityGlobals) = postSolution | GlobalSection(ExtensibilityGlobals) = postSolution | ||||
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC} | SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC} | ||||