diff --git a/DM_Weight/App.config b/DM_Weight/App.config
index 3b4ccbb..d7768c3 100644
--- a/DM_Weight/App.config
+++ b/DM_Weight/App.config
@@ -116,5 +116,13 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DM_Weight/App.xaml.cs b/DM_Weight/App.xaml.cs
index 9a8c12b..2ca71d2 100644
--- a/DM_Weight/App.xaml.cs
+++ b/DM_Weight/App.xaml.cs
@@ -275,6 +275,11 @@ namespace DM_Weight
//药箱设置
containerRegistry.RegisterForNavigation();
+ //操作记录
+ containerRegistry.RegisterForNavigation();
+ //温湿度记录
+ containerRegistry.RegisterForNavigation();
+
#endregion
// 设备记录页面
diff --git a/DM_Weight/DM_Weight.csproj b/DM_Weight/DM_Weight.csproj
index 34f4cf0..aa44d2f 100644
--- a/DM_Weight/DM_Weight.csproj
+++ b/DM_Weight/DM_Weight.csproj
@@ -70,6 +70,8 @@
+
+
diff --git a/DM_Weight/Models/TemperatureHumidityInfo.cs b/DM_Weight/Models/TemperatureHumidityInfo.cs
new file mode 100644
index 0000000..6a6aa10
--- /dev/null
+++ b/DM_Weight/Models/TemperatureHumidityInfo.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using SqlSugar;
+
+namespace DM_Weight.Models
+{
+ ///
+ /// 温湿度
+ ///
+ [SugarTable("temperature_humidity")]
+ public class TemperatureHumidityInfo
+ {
+
+ [SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
+ public int ID { get; set; }
+
+ [SugarColumn(ColumnName = "groupNo")]
+ public string GroupNo { get; set; }
+
+ [SugarColumn(ColumnName = "temp")]
+ public string Temp { get; set; }
+
+ [SugarColumn(ColumnName = "humi")]
+ public string Humi { get; set; }
+
+ [SugarColumn(ColumnName = "addTime")]
+ public DateTime AddTime { get; set; }
+ }
+}
diff --git a/DM_Weight/Port/ModbusHelper.cs b/DM_Weight/Port/ModbusHelper.cs
new file mode 100644
index 0000000..e69ed21
--- /dev/null
+++ b/DM_Weight/Port/ModbusHelper.cs
@@ -0,0 +1,126 @@
+using Modbus.Device;
+using Polly;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Diagnostics;
+using System.Linq;
+using System.Net;
+using System.Net.Sockets;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DM_Weight.Port
+{
+ public class ModbusHelper
+ {
+ private ModbusIpMaster master;
+ private Socket socket;
+ private TcpClient client;
+ private static ModbusHelper instance;
+ private static readonly object objLock = new object();
+ public ModbusHelper()
+ {
+ socket = MakeKeepALiveSocket();
+ client = new TcpClient();
+ client.Client = socket;
+ master = ModbusIpMaster.CreateIp(client);
+
+ }
+ public static ModbusHelper GetInstance()
+ {
+ if (instance == null)
+ {
+ lock (objLock)
+ {
+ if (instance == null)
+ instance = new ModbusHelper();
+ }
+ }
+
+ return instance;
+ }
+ private void SetModusIpMaster()
+ {
+ Debug.WriteLine("SetModusIpMaster");
+ socket = MakeKeepALiveSocket();
+ client = new TcpClient();
+ client.Client = socket;
+ master = ModbusIpMaster.CreateIp(client);
+ }
+
+ public bool[] GetAllBoxState()
+ {
+ bool[] bools = Policy.Handle()
+ .Retry(3, (exception, retryCount) =>
+ {
+ this.Dispose();
+ Debug.WriteLine($"获取所有箱子门状态出错,第{retryCount}次重试", exception);
+ this.SetModusIpMaster();
+ // return TimeSpan.FromSeconds (1);
+ }).Execute(() =>
+ {
+ bool[] flags = new bool[18];
+ var result = master.ReadInputRegisters(1, 0x0033, 2);
+ var r1 = Convert.ToString(((int)result[0] >> 14) | ((int)result[1] << 2), 2).PadLeft(18, '0');
+ var r2 = r1.ToCharArray();
+ Debug.WriteLine("r2=>" + string.Join(", ", r2));
+ for (int i = 0; i < 18; i++)
+ {
+ flags[i] = r2[17 - i] == '1' ? true : false;
+ }
+ return flags;
+ });
+ return bools;
+ }
+ public void OpenBoxDoor(int boxNum)
+ {
+ Policy.Handle().Retry(3, ((exception, retryCount) =>
+ {
+ this.Dispose();
+ Debug.WriteLine($"打开箱子出错,第{retryCount}次重试", exception);
+ this.SetModusIpMaster();
+ //return TimeSpan.FromSeconds (1);
+ })).Execute(() =>
+ {
+ master.WriteSingleRegister(1, (ushort)boxNum, 14);
+ Console.WriteLine($"开门指令已发送{(ushort)boxNum}");
+ });
+ }
+ private void Dispose()
+ {
+ socket.Shutdown(SocketShutdown.Both);
+ socket.Close();
+ client.Close();
+ master.Dispose();
+ }
+ public static Socket MakeKeepALiveSocket()
+ {
+ uint dummy = 0;
+ byte[] inOptionValues = new byte[Marshal.SizeOf(dummy) * 3];
+ BitConverter.GetBytes((uint)1).CopyTo(inOptionValues, 0);//启用Keep-Alive
+ BitConverter.GetBytes((uint)10000).CopyTo(inOptionValues, Marshal.SizeOf(dummy));//在这个时间间隔内没有数据交互,则发送探测包
+ BitConverter.GetBytes((uint)10000).CopyTo(inOptionValues, Marshal.SizeOf(dummy) * 2);//发探测包时间间隔
+ //IPEndPoint iep = new IPEndPoint(IPAddress.Parse("192.168.1.13"), 502);
+ string modbusIp = ConfigurationManager.AppSettings["modbusIp"].ToString();
+ int modbusPort =Convert.ToInt32(ConfigurationManager.AppSettings["modbusPort"]);
+ IPEndPoint iep = new IPEndPoint(IPAddress.Parse(modbusIp), modbusPort);
+ Socket _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+ _socket = Policy.Handle()
+ .Retry(3, (exception, retryCount) =>
+ {
+ Console.WriteLine($"建立Socket,第{retryCount}次重试", exception);
+ // return TimeSpan.FromSeconds (1);
+ })
+ .Execute(() =>
+ {
+ _socket.IOControl(IOControlCode.KeepAliveValues, inOptionValues, null);
+ _socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true);
+ _socket.Connect(iep);
+ return _socket;
+ });
+ return _socket;
+ }
+ }
+}
diff --git a/DM_Weight/Port/PortUtil.cs b/DM_Weight/Port/PortUtil.cs
index 7f82867..a7a55c8 100644
--- a/DM_Weight/Port/PortUtil.cs
+++ b/DM_Weight/Port/PortUtil.cs
@@ -29,6 +29,9 @@ using System.Runtime.InteropServices;
using DM_Weight.Common;
using System.Net;
using System.Text.RegularExpressions;
+using Modbus.Device;
+using Polly;
+using DM_Weight.Models;
namespace DM_Weight.Port
{
@@ -46,6 +49,9 @@ namespace DM_Weight.Port
// 冰箱串口
public SerialPort fridgeSerial;
+ // 温湿度串口
+ public SerialPort wsdSerial;
+
// 抽屉串口协议232 | 485
private int _drawerProtocol = Convert.ToInt32(ConfigurationManager.AppSettings["DrawerProtocol"]);
@@ -167,7 +173,7 @@ namespace DM_Weight.Port
{
_eventAggregator.GetEvent().Publish(new util.DeviceMsg()
{
- EventType = util.EventType.OPENERROR,
+ EventType = util.EventType.OPENERROR,
Message = $"打开药箱异常{ex.Message}"
});
logger.Info($"打开药箱{DrawerNo}异常:{ex.Message}");
@@ -743,6 +749,18 @@ namespace DM_Weight.Port
}
}
+ try
+ {
+ string wsdSerialPort = ConfigurationManager.AppSettings["wsdSerialPort"];
+ logger.Info($"打开温湿度串口【{wsdSerialPort}】");
+ wsdSerial = new SerialPort(wsdSerialPort, 9600, Parity.None, 8);
+ wsdSerial.Open();
+ logger.Info($"温湿度串口打开结果【{wsdSerial.IsOpen}】");
+ }
+ catch (Exception e)
+ {
+ logger.Error("温湿度串口打开错误" + e.Message);
+ }
_chkFunction = chkFunction;
}
@@ -1856,7 +1874,36 @@ namespace DM_Weight.Port
}
//FridgeOperate = false;
}
- #endregion
+ #endregion
+
+ #region 温湿度
+ public TemperatureHumidityInfo GetWSD()
+ {
+ TemperatureHumidityInfo temperatureHumidityInfo = new TemperatureHumidityInfo();
+ var master = ModbusSerialMaster.CreateRtu(wsdSerial);
+ int no = 1;
+ var r = master.ReadHoldingRegisters((byte)no, 00, 2);
+
+ if (r != null && r.Length > 0)
+ {
+ var result = string.Join("", r);
+ var result1 = result.Substring(0, 3);
+ var result2 = result.Substring(3, 3);
+ float temp = Int32.Parse(result2) / 10.0F;
+ float humi = Int32.Parse(result1) / 10.0F;
+ temperatureHumidityInfo.GroupNo = "DM5";
+ temperatureHumidityInfo.Temp = temp.ToString();
+ temperatureHumidityInfo.Humi = humi.ToString();
+
+ }
+ //if (wsdSerial.IsOpen)
+ //{
+ // wsdSerial.Close();
+ //}
+ master.Dispose();
+ return temperatureHumidityInfo;
+ }
+ #endregion
}
}
diff --git a/DM_Weight/Port/TemperatureHumidityJob.cs b/DM_Weight/Port/TemperatureHumidityJob.cs
new file mode 100644
index 0000000..82b8b4e
--- /dev/null
+++ b/DM_Weight/Port/TemperatureHumidityJob.cs
@@ -0,0 +1,92 @@
+using DM_Weight.Models;
+using log4net.Repository.Hierarchy;
+using Modbus.Device;
+using Polly;
+using System;
+using System.Collections.Generic;
+using System.IO.Ports;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DM_Weight.Port
+{
+ public class TemperatureHumidityJob
+ {
+
+ public TemperatureHumidityJob()
+ {
+ //try
+ //{
+ // using (SerialPort serialPort = new SerialPort("com1"))
+ // {
+ // serialPort.BaudRate = 9600;
+ // serialPort.DataBits = 8;
+ // serialPort.Parity = Parity.None;
+ // serialPort.StopBits = StopBits.One;
+ // if (!serialPort.IsOpen)
+ // {
+ // serialPort.Open();
+ // }
+ // var master = ModbusSerialMaster.CreateRtu(wsdSerial);
+ // int no = 1;
+ // switch (Global.CabinetNo)
+ // {
+ // case "1":
+ // no = 1;
+ // break;
+ // case "2":
+ // no = 9;
+ // break;
+ // case "3":
+ // no = 5;
+ // break;
+ // case "4":
+ // no = 3;
+ // break;
+ // case "5":
+ // no = 2;
+ // break;
+ // case "6":
+ // no = 6;
+ // break;
+ // case "7":
+ // no = 8;
+ // break;
+ // case "8":
+ // no = 4;
+ // break;
+ // case "9":
+ // no = 7;
+ // break;
+
+ // }
+ // var r = master.ReadHoldingRegisters((byte)no, 00, 2);
+
+ // if (r != null && r.Length > 0)
+ // {
+ // var result = string.Join("", r);
+ // var result1 = result.Substring(0, 3);
+ // var result2 = result.Substring(3, 3);
+ // float temp = Int32.Parse(result2) / 10.0F;
+ // float humi = Int32.Parse(result1) / 10.0F;
+ // TemperatureHumidityInfo temperatureHumidityInfo = new TemperatureHumidityInfo();
+ // temperatureHumidityInfo.GroupNo = "DM1"
+ // temperatureHumidityInfo.Temp = temp;
+ // temperatureHumidityInfo.Humi = humi;
+ // _temperatureHumidityService.SaveTemperatureAndHumidity(temperatureHumidityInfo);
+ // }
+ // if (serialPort.IsOpen)
+ // {
+ // serialPort.Close();
+ // }
+ // master.Dispose();
+ // }
+ //}
+ //catch (Exception ex)
+ //{
+ // logger.LogError(ex.Message);
+ //}
+ }
+ }
+}
diff --git a/DM_Weight/ViewModels/BindBoxPackageWindowViewModel.cs b/DM_Weight/ViewModels/BindBoxPackageWindowViewModel.cs
index e57b7a2..378f562 100644
--- a/DM_Weight/ViewModels/BindBoxPackageWindowViewModel.cs
+++ b/DM_Weight/ViewModels/BindBoxPackageWindowViewModel.cs
@@ -88,22 +88,22 @@ namespace DM_Weight.ViewModels
private bool _isEnable = true;
public bool IsEnable { get => _isEnable; set => SetProperty(ref _isEnable, value); }
private int _status = 0;
- public int Status { get => _status; set { SetProperty(ref _status, value); } }
+ public int Status { get => _status; set { SetProperty(ref _status, value); } }
public bool KeepAlive => false;
//抽屉号列表
public static List iList = new List();
- //第几个抽屉号
- public static int iNumber = 1;
+ //第几个抽屉号下标
+ //public static int iNumber = 0;
- private PortUtil _portUtil;
+ //private PortUtil _portUtil;
IEventAggregator _eventAggregator;
- public BindBoxPackageWindowViewModel(PortUtil portUtil, IEventAggregator eventAggregator)
+ public BindBoxPackageWindowViewModel(IEventAggregator eventAggregator)
{
vm = this;
- _portUtil = portUtil;
+ //_portUtil = portUtil;
_eventAggregator = eventAggregator;
}
@@ -120,13 +120,16 @@ namespace DM_Weight.ViewModels
{
Channels = list;
}
+ else
+ {
+ Channels = null;
+ }
}
public void OnNavigatedTo(NavigationContext navigationContext)
{
RequestDrug();
RequestData();
- _eventAggregator.GetEvent().Subscribe(DoMyPrismEvent);
}
public bool IsNavigationTarget(NavigationContext navigationContext)
@@ -137,7 +140,7 @@ namespace DM_Weight.ViewModels
public void OnNavigatedFrom(NavigationContext navigationContext)
{
// 取消消息订阅
- _eventAggregator.GetEvent().Unsubscribe(DoMyPrismEvent);
+ //_eventAggregator.GetEvent().Unsubscribe(DoMyPrismEvent);
}
@@ -190,10 +193,10 @@ namespace DM_Weight.ViewModels
}
var f = SqlSugarHelper.Db.UseTran(() =>
{
- string chnguid=SqlSugarHelper.Db.Queryable().Where(cs => cs.MachineId == ConfigurationManager.AppSettings[""].ToString()&&cs.DrawerNo==DrawerNo).Select(cs=>cs.Id).First();
+ string chnguid = SqlSugarHelper.Db.Queryable().Where(cs => cs.MachineId == ConfigurationManager.AppSettings["machineId"].ToString() && cs.DrawerNo == DrawerNo).Select(cs => cs.Id).First();
SqlSugarHelper.Db.Insertable(new ChannelStock()
{
- Chnguid=chnguid,
+ Chnguid = chnguid,
DrawerNo = DrawerNo,
DrugId = DrugInfo.DrugId.ToString(),
BaseQuantity = baseQuantity,
@@ -328,13 +331,33 @@ namespace DM_Weight.ViewModels
.Select(cl => cl.DrawerNo).ToList();
if (iList.Count > 0)
{
- IsEnable = false;
- Status = 1;
- _portUtil.SpeakAsync("正在打开药箱");
- _portUtil.DrawerNo = iList[iNumber];
- iNumber++;
- _portUtil.OpenBox();
+ for (int i = 0; i < iList.Count; i++)
+ {
+ //记录开药箱日志
+ SqlSugarHelper.Db.Insertable(new MachineRecord()
+ {
+ MachineId = "DM5",
+ DrawerNo = DrawerNo,
+ Operator = HomeWindowViewModel.Operator?.Id,
+ OperationTime = DateTime.Now,
+ Type = 55,
+ InvoiceId = $"打开{DrawerNo}号药箱",
+ }).ExecuteCommand();
+ IsEnable = false;
+ Status = 1;
+ Console.WriteLine($"正在打开{iList[i]}号药箱");
+ ModbusHelper.GetInstance().OpenBoxDoor(iList[i]-1);
+ //iNumber++;
+ }
+
+ ModbusHelper.GetInstance().GetAllBoxState();
+ if (Status == 2)
+ {
+ Status = 3;
+ }
+ IsEnable = true;
}
+
}
void DoMyPrismEvent(DeviceMsg msg)
{
@@ -346,27 +369,27 @@ namespace DM_Weight.ViewModels
SqlSugarHelper.Db.Insertable(new MachineRecord()
{
MachineId = "DM5",
- DrawerNo = _portUtil.DrawerNo,
+ //DrawerNo = _portUtil.DrawerNo,
Operator = HomeWindowViewModel.Operator?.Id,
OperationTime = DateTime.Now,
Type = 55,
InvoiceId = "药箱打开",
}).ExecuteCommand();
- if (iNumber < iList.Count)
+ //if (iNumber < iList.Count)
+ //{
+ // //_portUtil.DrawerNo = iList[iNumber];
+ // iNumber++;
+ // if (Status == 1)
+ // {
+ // Status = 2;
+ // }
+ // //_portUtil.OpenBox();
+ //}
+ //else
{
- _portUtil.DrawerNo = iList[iNumber];
- iNumber++;
- if (Status == 1)
- {
- Status = 2;
- }
- _portUtil.OpenBox();
- }
- else
- {
- iNumber = 0;
- _portUtil.GetBoxStatus();
+ //iNumber = 0;
+ //_portUtil.GetBoxStatus();
}
break;
// 药箱关闭
@@ -375,7 +398,7 @@ namespace DM_Weight.ViewModels
SqlSugarHelper.Db.Insertable(new MachineRecord()
{
MachineId = "DM5",
- DrawerNo = _portUtil.DrawerNo,
+ //DrawerNo = _portUtil.DrawerNo,
Operator = HomeWindowViewModel.Operator?.Id,
OperationTime = DateTime.Now,
Type = 55,
@@ -388,7 +411,7 @@ namespace DM_Weight.ViewModels
}
IsEnable = true;
DrawerNo = -1;
- _portUtil.Operate = false;
+ //_portUtil.Operate = false;
break;
// 打开失败
case EventType.OPENERROR:
@@ -407,13 +430,13 @@ namespace DM_Weight.ViewModels
SqlSugarHelper.Db.Insertable(new MachineRecord()
{
MachineId = "DM5",
- DrawerNo = _portUtil.DrawerNo,
+ //DrawerNo = _portUtil.DrawerNo,
Operator = HomeWindowViewModel.Operator?.Id,
OperationTime = DateTime.Now,
Type = 55,
InvoiceId = "药箱打开失败",
}).ExecuteCommand();
- _portUtil.Operate = false;
+ //_portUtil.Operate = false;
break;
}
}
diff --git a/DM_Weight/ViewModels/CheckOrderNewWindowViewModel.cs b/DM_Weight/ViewModels/CheckOrderNewWindowViewModel.cs
index 563b7d1..0775921 100644
--- a/DM_Weight/ViewModels/CheckOrderNewWindowViewModel.cs
+++ b/DM_Weight/ViewModels/CheckOrderNewWindowViewModel.cs
@@ -168,6 +168,10 @@ namespace DM_Weight.ViewModels
OrderInfoList.ForEach(oi => oi.ItemIsChecked = true);
TotalDrugList = OrderInfoList.Where(oi => oi.ItemIsChecked).GroupBy(oi => oi._OrderDetail.DrugInfo.DrugName).Select(oi => new TotalDrug { DrugName = oi.Key, TotalCount = oi.Sum(item => item._OrderDetail.Quantity) }).ToList();
}
+ else
+ {
+ TotalDrugList = null;
+ }
TotalCount = totalCount;
PageCount = (int)Math.Ceiling((double)TotalCount / PageSize);
@@ -420,22 +424,31 @@ namespace DM_Weight.ViewModels
public async void OpenBoxAction(string strDrawerNo)
{
- DrawerNo = Convert.ToInt32(strDrawerNo);
+ DrawerNo = Convert.ToInt32(strDrawerNo)-1;
if (DrawerNo > 0)
{
RequestData();
IsEnable = false;
Status = 1;
- _portUtil.SpeakAsync("正在打开药箱");
- _portUtil.DrawerNo = DrawerNo;
- _portUtil.OpenBox();
+ _portUtil.SpeakAsync($"正在打开{DrawerNo}号药箱");
+ //记录开药箱日志
+ SqlSugarHelper.Db.Insertable(new MachineRecord()
+ {
+ MachineId = "DM5",
+ DrawerNo = DrawerNo,
+ Operator = HomeWindowViewModel.Operator?.Id,
+ OperationTime = DateTime.Now,
+ Type = 55,
+ InvoiceId = $"打开{DrawerNo}号药箱",
+ }).ExecuteCommand();
+ ModbusHelper.GetInstance().OpenBoxDoor(DrawerNo);
}
}
public void OnNavigatedTo(NavigationContext navigationContext)
{
RequestData();
- _eventAggregator.GetEvent().Subscribe(DoMyPrismEvent);
+ //_eventAggregator.GetEvent().Subscribe(DoMyPrismEvent);
}
public bool IsNavigationTarget(NavigationContext navigationContext)
@@ -446,7 +459,7 @@ namespace DM_Weight.ViewModels
public void OnNavigatedFrom(NavigationContext navigationContext)
{
// 取消消息订阅
- _eventAggregator.GetEvent().Unsubscribe(DoMyPrismEvent);
+ //_eventAggregator.GetEvent().Unsubscribe(DoMyPrismEvent);
}
void DoMyPrismEvent(DeviceMsg msg)
{
@@ -466,7 +479,7 @@ namespace DM_Weight.ViewModels
Operator = HomeWindowViewModel.Operator?.Id,
OperationTime = DateTime.Now,
Type = 55,
- InvoiceId = "药箱打开",
+ InvoiceId = $"打开{DrawerNo}号药箱",
}).ExecuteCommand();
_portUtil.GetBoxStatus();
break;
diff --git a/DM_Weight/ViewModels/HomeWindowViewModel.cs b/DM_Weight/ViewModels/HomeWindowViewModel.cs
index efd9efd..292d83d 100644
--- a/DM_Weight/ViewModels/HomeWindowViewModel.cs
+++ b/DM_Weight/ViewModels/HomeWindowViewModel.cs
@@ -43,6 +43,8 @@ namespace DM_Weight.ViewModels
public string WD { get => _wd; set => SetProperty(ref _wd, value); }
System.Timers.Timer WDTimer;
+ System.Timers.Timer WSDTimer;
+
///
/// 是否有冰箱抽屉
///
@@ -320,6 +322,24 @@ namespace DM_Weight.ViewModels
}
}
}
+ //保存温湿度信息
+ private async void GetWSD(object sender,ElapsedEventArgs e)
+ {
+ TemperatureHumidityInfo temp = _portUtil.GetWSD();
+ if(temp != null)
+ {
+ SqlSugarHelper.Db.Insertable(new TemperatureHumidityInfo()
+ {
+ GroupNo = temp.GroupNo,
+ Temp = temp.Temp,
+ Humi = temp.Humi,
+ AddTime = temp.AddTime
+ }).ExecuteCommand();
+ }
+
+ }
+
+
///
/// 将收到的返回转换成具体温度数值
///
@@ -436,20 +456,19 @@ namespace DM_Weight.ViewModels
};
timer.Start();
}
- //#region 温度查询定时
- //int interval = Convert.ToInt32(ConfigurationManager.AppSettings["Interval"]);
- //if (interval > 0)
- //{
- // WDTimer = new System.Timers.Timer();
+ #region 温度查询定时
+ int interval = Convert.ToInt32(ConfigurationManager.AppSettings["Interval"]);
+ if (interval > 0)
+ {
+ WSDTimer = new System.Timers.Timer();
- // WDTimer.Elapsed += new System.Timers.ElapsedEventHandler(GetWD);
- // WDTimer.Interval = interval;
- // //WDTimer.Start();
- // //WDTimer.AutoReset = true;
- // //WDTimer.Enabled = true;
- //}
- //#endregion
- //GetWD();
+ WSDTimer.Elapsed += new System.Timers.ElapsedEventHandler(GetWSD);
+ WSDTimer.Interval = interval;
+ WSDTimer.Start();
+ //WDTimer.AutoReset = true;
+ //WDTimer.Enabled = true;
+ }
+ #endregion
if (stopRecord > 0)
{
System.Timers.Timer timer = new System.Timers.Timer();
diff --git a/DM_Weight/ViewModels/LoginWindowViewModel.cs b/DM_Weight/ViewModels/LoginWindowViewModel.cs
index 87124ba..d42cdf5 100644
--- a/DM_Weight/ViewModels/LoginWindowViewModel.cs
+++ b/DM_Weight/ViewModels/LoginWindowViewModel.cs
@@ -95,6 +95,11 @@ namespace DM_Weight.ViewModels
{
get => !_portUtil.fridgeSerial.IsOpen;
}
+ //温湿度
+ public bool WSDPortMsg
+ {
+ get => !_portUtil.wsdSerial.IsOpen;
+ }
//录像机登录状态
private bool _hikMsg;
public bool HIKMsg
diff --git a/DM_Weight/ViewModels/MachineRecordWindowViewModel.cs b/DM_Weight/ViewModels/MachineRecordWindowViewModel.cs
new file mode 100644
index 0000000..417f9c8
--- /dev/null
+++ b/DM_Weight/ViewModels/MachineRecordWindowViewModel.cs
@@ -0,0 +1,144 @@
+using DM_Weight.Models;
+using DM_Weight.util;
+using Prism.Commands;
+using Prism.Events;
+using Prism.Mvvm;
+using Prism.Regions;
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DM_Weight.ViewModels
+{
+ internal class MachineRecordWindowViewModel : BindableBase, INavigationAware, IRegionMemberLifetime
+ {
+ private int _pageNum = 1;
+ public int PageNum
+ {
+ get => _pageNum;
+ set
+ {
+ SetProperty(ref _pageNum, value);
+ RequestData();
+ }
+ }
+
+ private int _pageCount = 1;
+ public int PageCount
+ {
+ get => _pageCount;
+ set
+ {
+ SetProperty(ref _pageCount, value);
+ }
+ }
+
+ private int _pageSize = 8;
+ public int PageSize
+ {
+ get => _pageSize;
+ set
+ {
+ SetProperty(ref _pageSize, value);
+ }
+ }
+
+ private int _totalCount = 0;
+ public int TotalCount
+ {
+ get => _totalCount;
+ set
+ {
+ SetProperty(ref _totalCount, value);
+ }
+ }
+ private DateTime? _startDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
+
+ public DateTime? StartDate
+ {
+ get => _startDate;
+ set
+ {
+ if (value != null)
+ {
+ SetProperty(ref _startDate, new DateTime(value?.Year ?? 0, value?.Month ?? 0, value?.Day ?? 0));
+ }
+ else
+ {
+ SetProperty(ref _startDate, value);
+ }
+ RequestData();
+ }
+ }
+
+ private DateTime? _endDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
+
+ public DateTime? EndDate
+ {
+ get => _endDate;
+ set
+ {
+ if (value != null)
+ {
+ TimeSpan ershisi = new TimeSpan(23, 59, 59);
+ SetProperty(ref _endDate, new DateTime(value?.Year ?? 0, value?.Month ?? 0, value?.Day ?? 0, 23, 59, 59));
+ }
+ else
+ {
+ SetProperty(ref _endDate, value);
+ }
+
+ RequestData();
+ }
+ }
+ private List? machineRecords;
+
+ public List? MachineRecords
+ {
+ get { return machineRecords; }
+ set { SetProperty(ref machineRecords, value); }
+ }
+ public DelegateCommand Query
+ {
+ get => new DelegateCommand(() =>
+ {
+ RequestData();
+ });
+ }
+ public bool KeepAlive => false;
+
+ public bool IsNavigationTarget(NavigationContext navigationContext)
+ {
+ return true;
+ }
+
+ public void OnNavigatedFrom(NavigationContext navigationContext)
+ {
+
+ }
+
+ public void OnNavigatedTo(NavigationContext navigationContext)
+ {
+ //查询表格数据
+ RequestData();
+ }
+ void RequestData()
+ {
+ int totalCount = 0;
+ string machineId = ConfigurationManager.AppSettings["machineId"] ?? "DM5";
+ MachineRecords = SqlSugarHelper.Db.Queryable()
+ .Includes(mr => mr.DrugInfo)
+ .Includes(mr => mr.User)
+ .Where(mr => mr.MachineId == machineId)
+ .WhereIF(StartDate != null, (mr) => mr.OperationTime > StartDate)
+ .WhereIF(EndDate != null, (mr) => mr.OperationTime < EndDate).OrderByDescending(mr=>mr.OperationTime)
+ .ToPageList(PageNum, PageSize, ref totalCount);
+ //.ToList();
+ TotalCount = totalCount;
+ }
+ }
+}
diff --git a/DM_Weight/ViewModels/OpenBoxWindowViewModel.cs b/DM_Weight/ViewModels/OpenBoxWindowViewModel.cs
index 39945ba..9dbab4a 100644
--- a/DM_Weight/ViewModels/OpenBoxWindowViewModel.cs
+++ b/DM_Weight/ViewModels/OpenBoxWindowViewModel.cs
@@ -2,6 +2,7 @@
using DM_Weight.msg;
using DM_Weight.Port;
using DM_Weight.util;
+using log4net;
using log4net.Repository.Hierarchy;
using Prism.Commands;
using Prism.Events;
@@ -19,6 +20,7 @@ namespace DM_Weight.ViewModels
{
public class OpenBoxWindowViewModel : BindableBase, INavigationAware, IRegionMemberLifetime
{
+ private readonly ILog logger = LogManager.GetLogger(typeof(CheckOrderNewWindowViewModel));
private int _drawerNo = -1;
public int DrawerNo
@@ -50,10 +52,10 @@ namespace DM_Weight.ViewModels
//抽屉号列表
public static List iList = new List();
//第几个抽屉号
- public static int iNumber = 1;
+ //public static int iNumber = 1;
private PortUtil _portUtil;
IEventAggregator _eventAggregator;
- public OpenBoxWindowViewModel(PortUtil portUtil, IEventAggregator eventAggregator)
+ public OpenBoxWindowViewModel(PortUtil portUtil,IEventAggregator eventAggregator)
{
_portUtil = portUtil;
_eventAggregator = eventAggregator;
@@ -81,14 +83,38 @@ namespace DM_Weight.ViewModels
private void SearchBox()
{
iList = SqlSugarHelper.Db.Queryable().Where(cl => cl.MachineId == "DM5" && cl.DrawerType == this.DrawerNo)
- .WhereIF(this.DrawerNo==0,cl=> cl.BelongUser == HomeWindowViewModel.Operator.UserName)
+ .WhereIF(this.DrawerNo==0,cl=> cl.BelongUser == HomeWindowViewModel.Operator.UserBarcode)
.Select(cl => cl.DrawerNo).ToList();
if (iList.Count > 0)
{
- _portUtil.SpeakAsync("正在打开药箱");
- _portUtil.DrawerNo = iList[iNumber];
- iNumber++;
- _portUtil.OpenBox();
+ //_portUtil.SpeakAsync("正在打开药箱");
+ //_portUtil.DrawerNo = iList[iNumber];
+ //iNumber++;
+ //_portUtil.OpenBox();
+ logger.Info("");
+
+ for (int i = 0; i < iList.Count; i++)
+ {
+ //记录开药箱日志
+ SqlSugarHelper.Db.Insertable(new MachineRecord()
+ {
+ MachineId = "DM5",
+ DrawerNo = iList[i],
+ Operator = HomeWindowViewModel.Operator?.Id,
+ OperationTime = DateTime.Now,
+ Type = 55,
+ InvoiceId = $"打开{iList[i]}号药箱",
+ }).ExecuteCommand();
+ _portUtil.SpeakAsync($"正在打开{iList[i]}号药箱");
+ ModbusHelper.GetInstance().OpenBoxDoor(iList[i] - 1);
+ Thread.Sleep(1000);
+ }
+
+ PublicStatus = 0;
+ SelfStatus = 0;
+ PublicEnable = true;
+ SelfEnable = true;
+ DrawerNo = -1;
}
}
void DoMyPrismEvent(DeviceMsg msg)
@@ -101,17 +127,17 @@ namespace DM_Weight.ViewModels
SqlSugarHelper.Db.Insertable(new MachineRecord()
{
MachineId = "DM5",
- DrawerNo = _portUtil.DrawerNo,
+ //DrawerNo = _portUtil.DrawerNo,
Operator = HomeWindowViewModel.Operator?.Id,
OperationTime = DateTime.Now,
Type = 55,
InvoiceId = "药箱打开",
}).ExecuteCommand();
- if (iNumber < iList.Count)
- {
- _portUtil.DrawerNo = iList[iNumber];
- iNumber++;
+ //if (iNumber < iList.Count)
+ //{
+ //_portUtil.DrawerNo = iList[iNumber];
+ //iNumber++;
if(PublicStatus==1)
{
PublicStatus = 2;
@@ -120,13 +146,13 @@ namespace DM_Weight.ViewModels
{
SelfStatus = 2;
}
- _portUtil.OpenBox();
- }
- else
- {
- iNumber = 0;
- _portUtil.GetBoxStatus();
- }
+ //_portUtil.OpenBox();
+ //}
+ //else
+ //{
+ //iNumber = 0;
+ //_portUtil.GetBoxStatus();
+ //}
break;
// 药箱关闭
case EventType.DRAWERCLOSE:
@@ -134,7 +160,7 @@ namespace DM_Weight.ViewModels
SqlSugarHelper.Db.Insertable(new MachineRecord()
{
MachineId = "DM5",
- DrawerNo = _portUtil.DrawerNo,
+ //DrawerNo = _portUtil.DrawerNo,
Operator = HomeWindowViewModel.Operator?.Id,
OperationTime = DateTime.Now,
Type = 55,
@@ -152,7 +178,7 @@ namespace DM_Weight.ViewModels
PublicEnable = true;
SelfEnable = true;
DrawerNo = -1;
- _portUtil.Operate = false;
+ //_portUtil.Operate = false;
break;
// 打开失败
case EventType.OPENERROR:
@@ -173,13 +199,13 @@ namespace DM_Weight.ViewModels
SqlSugarHelper.Db.Insertable(new MachineRecord()
{
MachineId = "DM5",
- DrawerNo = _portUtil.DrawerNo,
+ //DrawerNo = _portUtil.DrawerNo,
Operator = HomeWindowViewModel.Operator?.Id,
OperationTime = DateTime.Now,
Type = 55,
InvoiceId = "药箱打开失败",
}).ExecuteCommand();
- _portUtil.Operate = false;
+ //_portUtil.Operate = false;
break;
}
}
@@ -193,12 +219,12 @@ namespace DM_Weight.ViewModels
public void OnNavigatedFrom(NavigationContext navigationContext)
{
// 取消消息订阅
- _eventAggregator.GetEvent().Unsubscribe(DoMyPrismEvent);
+ //_eventAggregator.GetEvent().Unsubscribe(DoMyPrismEvent);
}
public void OnNavigatedTo(NavigationContext navigationContext)
{
- _eventAggregator.GetEvent().Subscribe(DoMyPrismEvent);
+ //_eventAggregator.GetEvent().Subscribe(DoMyPrismEvent);
}
}
}
diff --git a/DM_Weight/ViewModels/RoleManagerWindowViewModel.cs b/DM_Weight/ViewModels/RoleManagerWindowViewModel.cs
index a1a75cf..fb593eb 100644
--- a/DM_Weight/ViewModels/RoleManagerWindowViewModel.cs
+++ b/DM_Weight/ViewModels/RoleManagerWindowViewModel.cs
@@ -456,6 +456,18 @@ namespace DM_Weight.ViewModels
PremissionName = "药箱设置",
PremissionPath = "SettingBoxWindow",
};
+ PremissionDm machineRecord= new PremissionDm
+ {
+ Id = 54,
+ PremissionName = "操作记录",
+ PremissionPath = "MachineRecordWindow",
+ };
+ PremissionDm wSDRecord= new PremissionDm
+ {
+ Id = 54,
+ PremissionName = "温湿度记录",
+ PremissionPath = "WSDRecordWindow",
+ };
//PremissionDm sysset3;
//if (Convert.ToInt32(ConfigurationManager.AppSettings["hasFridge"]) > 0)
//{
@@ -477,10 +489,13 @@ namespace DM_Weight.ViewModels
// PremissionPath = "SettingWindow",
// };
//}
+
syssetChild.Add(sysset1);
syssetChild.Add(sysset2);
syssetChild.Add(sysset3);
syssetChild.Add(settingBox);
+ syssetChild.Add(machineRecord);
+ syssetChild.Add(wSDRecord);
sysset.Children = syssetChild;
defaultAll.Add(sysset);
#endregion
diff --git a/DM_Weight/ViewModels/SettingBoxWindowViewModel.cs b/DM_Weight/ViewModels/SettingBoxWindowViewModel.cs
index 524cc25..9b71866 100644
--- a/DM_Weight/ViewModels/SettingBoxWindowViewModel.cs
+++ b/DM_Weight/ViewModels/SettingBoxWindowViewModel.cs
@@ -9,6 +9,7 @@ using Prism.Regions;
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -74,16 +75,16 @@ namespace DM_Weight.ViewModels
}
}
- static List StaticUserList = SqlSugarHelper.Db.Queryable().Where(us => us.MachineId == "DM3").Select(us => new BindUserList() { UserId =Convert.ToInt32(us.UserBarcode), UserName = us.Nickname }).ToList();
+ //static List StaticUserList = SqlSugarHelper.Db.Queryable().Where(us => us.MachineId == "DM3").Select(us => new BindUserList() { UserId =Convert.ToInt32(us.UserBarcode), UserName = us.Nickname }).ToList();
//药师
- private List _userLists = StaticUserList;
+ private List _userLists;// = StaticUserList;
public List UserLists
{
get => _userLists;
set => SetProperty(ref _userLists, value);
}
- private BindUserList _userListSelectedItem = StaticUserList[0];
+ private BindUserList _userListSelectedItem;// = _userLists[0];
public BindUserList UserListSelectedItem { get => _userListSelectedItem; set => SetProperty(ref _userListSelectedItem, value); }
private PortUtil _portUtil;
@@ -93,6 +94,15 @@ namespace DM_Weight.ViewModels
_portUtil = portUtil;
_eventAggregator = eventAggregator;
+ BindUserList();
+ }
+ private void BindUserList()
+ {
+ if (_userLists == null)
+ {
+ _userLists = SqlSugarHelper.Db.Queryable().Where(us => us.MachineId == (ConfigurationManager.AppSettings["machineId"] ??"DM5")).Select(us => new BindUserList() { UserId = Convert.ToInt32(us.UserBarcode), UserName = us.Nickname }).ToList();
+ _userListSelectedItem = _userLists[0];
+ }
}
public bool KeepAlive => false;
@@ -105,7 +115,7 @@ namespace DM_Weight.ViewModels
{
// 取消消息订阅
- _eventAggregator.GetEvent().Unsubscribe(DoMyPrismEvent);
+ //_eventAggregator.GetEvent().Unsubscribe(DoMyPrismEvent);
}
private void BindBoxTypeList()
{
@@ -114,7 +124,7 @@ namespace DM_Weight.ViewModels
}
public void OnNavigatedTo(NavigationContext navigationContext)
{
- _eventAggregator.GetEvent().Subscribe(DoMyPrismEvent);
+ //_eventAggregator.GetEvent().Subscribe(DoMyPrismEvent);
}
//点击药箱
public DelegateCommand UpdateDrawerNo
@@ -133,10 +143,10 @@ namespace DM_Weight.ViewModels
{
//药箱归属药师,把药师信息显示出来
UserStatus = Visibility.Visible;
- UserListSelectedItem = StaticUserList.Where(sul => sul.UserId.ToString() == cnl.BelongUser).FirstOrDefault();
- if (UserListSelectedItem == null && StaticUserList != null)
+ UserListSelectedItem = _userLists.Where(sul => sul.UserId.ToString() == cnl.BelongUser).FirstOrDefault();
+ if (UserListSelectedItem == null && _userLists != null)
{
- UserListSelectedItem = StaticUserList[0];
+ UserListSelectedItem = _userLists[0];
}
}
else
@@ -160,9 +170,20 @@ namespace DM_Weight.ViewModels
{
IsEnable = false;
Status = 1;
- _portUtil.SpeakAsync("正在打开药箱");
- _portUtil.DrawerNo = DrawerNo;
- _portUtil.OpenBox();
+ //_portUtil.SpeakAsync("正在打开药箱");
+ //_portUtil.DrawerNo = DrawerNo;
+ //_portUtil.OpenBox();
+ _portUtil.SpeakAsync($"正在打开{DrawerNo}号药箱");//记录开药箱日志
+ SqlSugarHelper.Db.Insertable(new MachineRecord()
+ {
+ MachineId = "DM5",
+ DrawerNo = DrawerNo,
+ Operator = HomeWindowViewModel.Operator?.Id,
+ OperationTime = DateTime.Now,
+ Type = 55,
+ InvoiceId = $"打开{DrawerNo}号药箱",
+ }).ExecuteCommand();
+ ModbusHelper.GetInstance().OpenBoxDoor(DrawerNo-1);
}
});
}
@@ -273,6 +294,7 @@ namespace DM_Weight.ViewModels
break;
}
}
+
}
///
/// 药箱类型
diff --git a/DM_Weight/ViewModels/WSDRecordWindowViewModel.cs b/DM_Weight/ViewModels/WSDRecordWindowViewModel.cs
new file mode 100644
index 0000000..ae066d4
--- /dev/null
+++ b/DM_Weight/ViewModels/WSDRecordWindowViewModel.cs
@@ -0,0 +1,126 @@
+using DM_Weight.Models;
+using DM_Weight.util;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DM_Weight.ViewModels
+{
+ public class WSDRecordWindowViewModel : BindableBase, IRegionMemberLifetime
+ {
+ private int _pageNum = 1;
+ public int PageNum
+ {
+ get => _pageNum;
+ set
+ {
+ SetProperty(ref _pageNum, value);
+ RequestData();
+ }
+ }
+
+ private int _pageCount = 1;
+ public int PageCount
+ {
+ get => _pageCount;
+ set
+ {
+ SetProperty(ref _pageCount, value);
+ }
+ }
+
+ private int _pageSize = 8;
+ public int PageSize
+ {
+ get => _pageSize;
+ set
+ {
+ SetProperty(ref _pageSize, value);
+ }
+ }
+
+ private int _totalCount = 0;
+ public int TotalCount
+ {
+ get => _totalCount;
+ set
+ {
+ SetProperty(ref _totalCount, value);
+ }
+ }
+ private DateTime? _startDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
+
+ public DateTime? StartDate
+ {
+ get => _startDate;
+ set
+ {
+ if (value != null)
+ {
+ SetProperty(ref _startDate, new DateTime(value?.Year ?? 0, value?.Month ?? 0, value?.Day ?? 0));
+ }
+ else
+ {
+ SetProperty(ref _startDate, value);
+ }
+ RequestData();
+ }
+ }
+
+ private DateTime? _endDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
+
+ public DateTime? EndDate
+ {
+ get => _endDate;
+ set
+ {
+ if (value != null)
+ {
+ TimeSpan ershisi = new TimeSpan(23, 59, 59);
+ SetProperty(ref _endDate, new DateTime(value?.Year ?? 0, value?.Month ?? 0, value?.Day ?? 0, 23, 59, 59));
+ }
+ else
+ {
+ SetProperty(ref _endDate, value);
+ }
+
+ RequestData();
+ }
+ }
+ private List? _temperatureHumidityInfos;
+
+ public List? TemperatureHumidityInfos
+ {
+ get { return _temperatureHumidityInfos; }
+ set { SetProperty(ref _temperatureHumidityInfos, value); }
+ }
+ public DelegateCommand Query
+ {
+ get => new DelegateCommand(() =>
+ {
+ RequestData();
+ });
+ }
+
+ public bool KeepAlive => false;
+
+ void RequestData()
+ {
+ int totalCount = 0;
+ string machineId = ConfigurationManager.AppSettings["machineId"] ?? "DM5";
+ TemperatureHumidityInfos = SqlSugarHelper.Db.Queryable()
+ .Where(mr => mr.GroupNo == machineId)
+ .WhereIF(StartDate != null, (mr) => mr.AddTime > StartDate)
+ .WhereIF(EndDate != null, (mr) => mr.AddTime < EndDate).OrderByDescending(mr => mr.AddTime)
+ .ToPageList(PageNum, PageSize, ref totalCount);
+ //.ToList();
+ TotalCount = totalCount;
+ }
+ }
+}
diff --git a/DM_Weight/Views/BindBoxPackageWindow.xaml b/DM_Weight/Views/BindBoxPackageWindow.xaml
index b91e5d3..e234391 100644
--- a/DM_Weight/Views/BindBoxPackageWindow.xaml
+++ b/DM_Weight/Views/BindBoxPackageWindow.xaml
@@ -112,7 +112,7 @@
-
+
@@ -129,17 +129,17 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/DM_Weight/Views/CheckOrderNewWindow.xaml b/DM_Weight/Views/CheckOrderNewWindow.xaml
index ee8594f..68818c6 100644
--- a/DM_Weight/Views/CheckOrderNewWindow.xaml
+++ b/DM_Weight/Views/CheckOrderNewWindow.xaml
@@ -30,7 +30,7 @@
-
+
@@ -68,7 +68,7 @@
-
+
@@ -85,18 +85,18 @@
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -109,7 +109,7 @@
-
+
@@ -141,9 +141,8 @@
-
- -->
+
-
+
-
-
@@ -192,10 +182,10 @@
-
-
-
-
- -->
+
+
@@ -226,7 +216,7 @@
-
+
+
diff --git a/DM_Weight/Views/MachineRecordWindow.xaml b/DM_Weight/Views/MachineRecordWindow.xaml
new file mode 100644
index 0000000..f0d7fc7
--- /dev/null
+++ b/DM_Weight/Views/MachineRecordWindow.xaml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DM_Weight/Views/MachineRecordWindow.xaml.cs b/DM_Weight/Views/MachineRecordWindow.xaml.cs
new file mode 100644
index 0000000..51d3221
--- /dev/null
+++ b/DM_Weight/Views/MachineRecordWindow.xaml.cs
@@ -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 DM_Weight.Views
+{
+ ///
+ /// MachineRecordWindowViewModel.xaml 的交互逻辑
+ ///
+ public partial class MachineRecordWindow : UserControl
+ {
+ public MachineRecordWindow()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/DM_Weight/Views/SettingBoxWindow.xaml b/DM_Weight/Views/SettingBoxWindow.xaml
index fc13bd6..782d108 100644
--- a/DM_Weight/Views/SettingBoxWindow.xaml
+++ b/DM_Weight/Views/SettingBoxWindow.xaml
@@ -62,7 +62,7 @@
-
+
@@ -79,17 +79,17 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/DM_Weight/Views/WSDRecordWindow.xaml b/DM_Weight/Views/WSDRecordWindow.xaml
new file mode 100644
index 0000000..b9eb09f
--- /dev/null
+++ b/DM_Weight/Views/WSDRecordWindow.xaml
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DM_Weight/Views/WSDRecordWindow.xaml.cs b/DM_Weight/Views/WSDRecordWindow.xaml.cs
new file mode 100644
index 0000000..41999ee
--- /dev/null
+++ b/DM_Weight/Views/WSDRecordWindow.xaml.cs
@@ -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 DM_Weight.Views
+{
+ ///
+ /// WSDRecordWindow.xaml 的交互逻辑
+ ///
+ public partial class WSDRecordWindow : UserControl
+ {
+ public WSDRecordWindow()
+ {
+ InitializeComponent();
+ }
+ }
+}