diff --git a/SlnMesnac.Business/base/BaseBusiness.cs b/SlnMesnac.Business/base/BaseBusiness.cs index 644ff4d..bf05e09 100644 --- a/SlnMesnac.Business/base/BaseBusiness.cs +++ b/SlnMesnac.Business/base/BaseBusiness.cs @@ -1,4 +1,5 @@ -using SlnMesnac.Plc; +using SlnMesnac.Common; +using SlnMesnac.Plc; using SlnMesnac.Rfid; using System; using System.Collections.Generic; @@ -35,10 +36,16 @@ namespace SlnMesnac.Business.@base private readonly List _rfidFactories; - public BaseBusiness(List plcFactories, List rfidFactories) + private readonly StringChange stringChange; + + private readonly HIDMode hIDMode; + + public BaseBusiness(List plcFactories, List rfidFactories, StringChange stringChanges, HIDMode hIDModes) { _plcFactories = plcFactories; _rfidFactories = rfidFactories; + stringChange = stringChanges; + hIDMode = hIDModes; } /// diff --git a/SlnMesnac.Common/HIDMode.cs b/SlnMesnac.Common/HIDMode.cs new file mode 100644 index 0000000..5db8948 --- /dev/null +++ b/SlnMesnac.Common/HIDMode.cs @@ -0,0 +1,56 @@ +using HighRFIDSendCardDemo; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SlnMesnac.Common +{ + public class HIDMode + { + DeviceClass deviceClass = new DeviceClass(); + public HIDMode() + { + deviceClass.isConnectedFunc = ConnectStart; + deviceClass.pushTagData = GetTag; + } + + public void ConnectStart(bool Start) + { + if (Start) + { + //button1.Text = "DisConnect"; + } + else + { + //button1.Text = "Monitor"; + } + } + + private void GetTag(Tag tag) + { + //this.Invoke(new Action(() => { + // int flag = 0; + // foreach (ListViewItem viewitem in listView1.Items) + // { + // if (viewitem.SubItems[1].Text == tag.UID) + // { + // viewitem.SubItems[2].Text = (int.Parse(viewitem.SubItems[2].Text) + 1).ToString(); + // viewitem.SubItems[3].Text = System.DateTime.Now.ToString(); + // flag = 1; + // } + // } + // if (flag == 0) + // { + // System.Windows.Forms.ListViewItem EPCitem = new System.Windows.Forms.ListViewItem((listView1.Items.Count + 1).ToString()); + // EPCitem.SubItems.Add(tag.UID); + // EPCitem.SubItems.Add("1"); + + // DateTime TimeNow_temp = System.DateTime.Now; + // string TimeNow_str = TimeNow_temp.ToString(); + // EPCitem.SubItems.Add(TimeNow_str); + // listView1.Items.Add(EPCitem); + // } + //})); + } + } +} diff --git a/SlnMesnac.Common/SlnMesnac.Common.csproj b/SlnMesnac.Common/SlnMesnac.Common.csproj index d031ec1..d2f2774 100644 --- a/SlnMesnac.Common/SlnMesnac.Common.csproj +++ b/SlnMesnac.Common/SlnMesnac.Common.csproj @@ -1,4 +1,4 @@ - + netstandard2.1 @@ -10,4 +10,10 @@ + + + C:\Users\Administrator\Desktop\信明橡塑\Tool For HID Mode_V1.0.0\Tool For HID Mode_V1.0.0\HighRFIDSendCardDLL.dll + + + diff --git a/SlnMesnac.WPF/Page/EmployeeLoginPage.xaml b/SlnMesnac.WPF/Page/EmployeeLoginPage.xaml index 6dea713..bad076b 100644 --- a/SlnMesnac.WPF/Page/EmployeeLoginPage.xaml +++ b/SlnMesnac.WPF/Page/EmployeeLoginPage.xaml @@ -7,6 +7,11 @@ mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> - + + + + + + diff --git a/SlnMesnac.WPF/Page/ExecutePage.xaml b/SlnMesnac.WPF/Page/ExecutePage.xaml index b0e952e..038adf1 100644 --- a/SlnMesnac.WPF/Page/ExecutePage.xaml +++ b/SlnMesnac.WPF/Page/ExecutePage.xaml @@ -36,7 +36,7 @@ - + @@ -139,6 +139,7 @@ Foreground="#FFFFFF" SelectedItem="{Binding SelectedDataItem}"> + @@ -222,6 +223,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs b/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs index 73c7568..5328b2b 100644 --- a/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs +++ b/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs @@ -2,6 +2,7 @@ using GalaSoft.MvvmLight.Command; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; +using SlnMesnac.Common; using SlnMesnac.WPF.Page; using SlnMesnac.WPF.Page.Generate; using System; @@ -85,6 +86,8 @@ namespace SlnMesnac.WPF.ViewModel UserContent = _executePage; _logger = App.ServiceProvider.GetService>(); + var info = App.ServiceProvider.GetService(); + ControlOnClickCommand = new RelayCommand(obj => ControlOnClick(obj)); FormControlCommand = new RelayCommand(x => FormControl(x));