@@ -0,0 +1,106 @@ | |||||
using System.Diagnostics; | |||||
using System.Runtime.InteropServices; | |||||
using System.Text; | |||||
namespace BPASmartClient.Argox | |||||
{ | |||||
public class ArgoxHelper | |||||
{ | |||||
private volatile static ArgoxHelper _Instance; | |||||
public static ArgoxHelper GetInstance => _Instance ?? (_Instance = new ArgoxHelper()); | |||||
private ArgoxHelper() { } | |||||
public void Print() | |||||
{ | |||||
int nLen, ret, sw; | |||||
byte[] pbuf = new byte[128]; | |||||
string strmsg; | |||||
IntPtr ver; | |||||
System.Text.Encoding encAscII = System.Text.Encoding.ASCII; | |||||
System.Text.Encoding encUnicode = System.Text.Encoding.Unicode; | |||||
// dll 版本. | |||||
ver = DLLHelper.B_Get_DLL_Version(0); | |||||
// 搜索端口号. | |||||
nLen = DLLHelper.B_GetUSBBufferLen() + 1; | |||||
strmsg = "DLL "; | |||||
strmsg += Marshal.PtrToStringAnsi(ver); | |||||
strmsg += "\r\n"; | |||||
if (nLen > 1) | |||||
{ | |||||
byte[] buf1, buf2; | |||||
int len1 = 128, len2 = 128; | |||||
buf1 = new byte[len1]; | |||||
buf2 = new byte[len2]; | |||||
DLLHelper.B_EnumUSB(pbuf); | |||||
DLLHelper.B_GetUSBDeviceInfo(1, buf1, out len1, buf2, out len2); | |||||
sw = 1; | |||||
if (1 == sw) | |||||
{ | |||||
ret = DLLHelper.B_CreatePrn(12, encAscII.GetString(buf2, 0, len2));// 打开 USB. | |||||
} | |||||
else | |||||
{ | |||||
ret = DLLHelper.B_CreateUSBPort(1);// must call B_GetUSBBufferLen() function fisrt. | |||||
} | |||||
if (0 != ret) | |||||
{ | |||||
strmsg += "Open USB fail!"; | |||||
} | |||||
else | |||||
{ | |||||
strmsg += "Open USB:\r\nDevice name: "; | |||||
strmsg += encAscII.GetString(buf1, 0, len1); | |||||
strmsg += "\r\nDevice path: "; | |||||
strmsg += encAscII.GetString(buf2, 0, len2); | |||||
//sw = 2; | |||||
if (2 == sw) | |||||
{ | |||||
//Immediate Error Report. | |||||
DLLHelper.B_WriteData(1, encAscII.GetBytes("^ee\r\n"), 5);//^ee | |||||
ret = DLLHelper.B_ReadData(pbuf, 4, 1000); | |||||
} | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
System.IO.Directory.CreateDirectory(DLLHelper.szSavePath); | |||||
ret = DLLHelper.B_CreatePrn(0, DLLHelper.szSaveFile);// open file. | |||||
strmsg += "Open "; | |||||
strmsg += DLLHelper.szSaveFile; | |||||
if (0 != ret) | |||||
{ | |||||
strmsg += " file fail!"; | |||||
} | |||||
else | |||||
{ | |||||
strmsg += " file succeed!"; | |||||
} | |||||
} | |||||
Debug.WriteLine(strmsg); | |||||
if (0 != ret) | |||||
return; | |||||
// 样品设置. | |||||
DLLHelper.B_Set_DebugDialog(0); | |||||
DLLHelper.B_Set_Originpoint(0, 0); | |||||
DLLHelper.B_Select_Option(2); | |||||
DLLHelper.B_Set_Darkness(8); | |||||
DLLHelper.B_Del_Pcx("*");// delete all picture. | |||||
DLLHelper.B_WriteData(0, encAscII.GetBytes(DLLHelper.sznop2), DLLHelper.sznop2.Length); | |||||
DLLHelper.B_WriteData(1, encAscII.GetBytes(DLLHelper.sznop1), DLLHelper.sznop1.Length); | |||||
DLLHelper.B_Set_LabelForSmartPrint(254 * 3, 30);//label information: length= 3 * 25.4 mm, gap= 3 mm. | |||||
int TextX = 160; | |||||
int BoxX = 150; | |||||
DLLHelper.B_Draw_Box(BoxX, 20, 4, 670, 370);//画框 | |||||
DLLHelper.B_Prn_Text_TrueType(TextX, 40, 30, "楷体", 1, 400, 0, 0, 0, "AA", $"原料名称:榨菜配方"); | |||||
DLLHelper.B_Prn_Text_TrueType_W(TextX, 80, 30, 20, "楷体", 1, 400, 0, 0, 0, "AB", $"日期:{DateTime.Now.ToString("yyy-MM-dd")}"); | |||||
DLLHelper.B_Prn_Text_TrueType_Uni(TextX, 120, 30, "楷体", 1, 400, 0, 0, 0, "AC", Encoding.Unicode.GetBytes($"时间:{DateTime.Now.ToString("HH:mm:ss")}"), 1);//UTF-16 | |||||
DLLHelper.B_Print_Out(1);//打印数量 | |||||
DLLHelper.B_ClosePrn(); | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,23 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | |||||
<PropertyGroup> | |||||
<TargetFramework>net6.0</TargetFramework> | |||||
<ImplicitUsings>enable</ImplicitUsings> | |||||
<Nullable>enable</Nullable> | |||||
</PropertyGroup> | |||||
<ItemGroup> | |||||
<None Remove="WinPort.dll" /> | |||||
<None Remove="Winpplb.dll" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<Content Include="WinPort.dll"> | |||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |||||
</Content> | |||||
<Content Include="Winpplb.dll"> | |||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |||||
</Content> | |||||
</ItemGroup> | |||||
</Project> |
@@ -0,0 +1,241 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Runtime.InteropServices; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.Argox | |||||
{ | |||||
internal class DLLHelper | |||||
{ | |||||
public const uint IMAGE_BITMAP = 0; | |||||
public const uint LR_LOADFROMFILE = 16; | |||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] | |||||
public static extern IntPtr LoadImage(IntPtr hinst, string lpszName, uint uType, int cxDesired, int cyDesired, uint fuLoad); | |||||
[DllImport("Gdi32.dll", SetLastError = true, CharSet = CharSet.Auto)] | |||||
public static extern int DeleteObject(IntPtr ho); | |||||
public const string szSavePath = "C:\\Argox"; | |||||
public const string szSaveFile = "C:\\Argox\\PPLB_Example.Prn"; | |||||
public const string sznop1 = "nop_front\r\n"; | |||||
public const string sznop2 = "nop_middle\r\n"; | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Bar2d_Maxi(int x, int y, int cl, int cc, int pc, string data); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Bar2d_PDF417(int x, int y, int w, int v, int s, int c, int px, int py, int r, int l, int t, int o, string data); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Bar2d_PDF417_N(int x, int y, int w, int h, string pParameter, string data); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Bar2d_DataMatrix(int x, int y, int r, int l, int h, int v, string data); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern void B_ClosePrn(); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_CreatePrn(int selection, string filename); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Del_Form(string formname); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Del_Pcx(string pcxname); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Draw_Box(int x, int y, int thickness, int hor_dots, int ver_dots); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Draw_Line(char mode, int x, int y, int hor_dots, int ver_dots); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Error_Reporting(char option); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern IntPtr B_Get_DLL_Version(int nShowMessage); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Get_DLL_VersionA(int nShowMessage); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Get_Graphic_ColorBMP(int x, int y, string filename); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Get_Graphic_ColorBMPEx(int x, int y, int nWidth, int nHeight, int rotate, string id_name, string filename); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Get_Graphic_ColorBMP_HBitmap(int x, int y, int nWidth, int nHeight, int rotate, string id_name, IntPtr hbm); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Get_Pcx(int x, int y, string filename); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Initial_Setting(int Type, string Source); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_WriteData(int IsImmediate, byte[] pbuf, int length); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_ReadData(byte[] pbuf, int length, int dwTimeoutms); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Load_Pcx(int x, int y, string pcxname); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Open_ChineseFont(string path); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Print_Form(int labset, int copies, string form_out, string var); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Print_MCopy(int labset, int copies); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Print_Out(int labset); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Prn_Barcode(int x, int y, int ori, string type, int narrow, int width, int height, char human, string data); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern void B_Prn_Configuration(); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Prn_Text(int x, int y, int ori, int font, int hor_factor, int ver_factor, char mode, string data); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Prn_Text_Chinese(int x, int y, int fonttype, string id_name, string data); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Prn_Text_TrueType(int x, int y, int FSize, string FType, int Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut, string id_name, string data); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Prn_Text_TrueType_W(int x, int y, int FHeight, int FWidth, string FType, int Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut, string id_name, string data); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Select_Option(int option); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Select_Option2(int option, int p); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Select_Symbol(int num_bit, int symbol, int country); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Select_Symbol2(int num_bit, string csymbol, int country); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_Backfeed(char option); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_Backfeed_Offset(int offset); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_CutPeel_Offset(int offset); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_BMPSave(int nSave, string strBMPFName); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_Darkness(int darkness); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_DebugDialog(int nEnable); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_Direction(char direction); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_Form(string formfile); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_Labgap(int lablength, int gaplength); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_Labwidth(int labwidth); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_Originpoint(int hor, int ver); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_Prncomport(int baud, char parity, int data, int stop); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_Prncomport_PC(int nBaudRate, int nByteSize, int nParity, int nStopBits, int nDsr, int nCts, int nXonXoff); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_Speed(int speed); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_ProcessDlg(int nShow); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_ErrorDlg(int nShow); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_GetUSBBufferLen(); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_EnumUSB(byte[] buf); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_CreateUSBPort(int nPort); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_ResetPrinter(); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_GetPrinterResponse(byte[] buf, int nMax); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_TFeedMode(int nMode); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_TFeedTest(); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_CreatePort(int nPortType, int nPort, string filename); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Execute_Form(string form_out, string var); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Bar2d_QR(int x, int y, int model, int scl, char error, char dinput, int c, int d, int p, string data); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_GetNetPrinterBufferLen(); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_EnumNetPrinter(byte[] buf); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_CreateNetPort(int nPort); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Prn_Text_TrueType_Uni(int x, int y, int FSize, string FType, int Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut, string id_name, byte[] data, int format); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Prn_Text_TrueType_UniB(int x, int y, int FSize, string FType, int Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut, string id_name, byte[] data, int format); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_GetUSBDeviceInfo(int nPort, byte[] pDeviceName, out int pDeviceNameLen, byte[] pDevicePath, out int pDevicePathLen); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_EncryptionKey(string encryptionKey); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Check_EncryptionKey(string decodeKey, string encryptionKey, int dwTimeoutms); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_CommTimeout(int ReadTotalTimeoutConstant, int WriteTotalTimeoutConstant); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Get_CommTimeout(out int ReadTotalTimeoutConstant, out int WriteTotalTimeoutConstant); | |||||
[DllImport("Winpplb.dll")] | |||||
public static extern int B_Set_LabelForSmartPrint(int lablength, int gaplength); | |||||
} | |||||
} |
@@ -38,6 +38,7 @@ | |||||
<None Remove="Image\AGV\蔬菜.png" /> | <None Remove="Image\AGV\蔬菜.png" /> | ||||
<None Remove="Image\AGV\语音箭头.png" /> | <None Remove="Image\AGV\语音箭头.png" /> | ||||
<None Remove="Image\bg.png" /> | <None Remove="Image\bg.png" /> | ||||
<None Remove="Image\bg12.png" /> | |||||
<None Remove="Image\btn_close.png" /> | <None Remove="Image\btn_close.png" /> | ||||
<None Remove="Image\btn_normal.png" /> | <None Remove="Image\btn_normal.png" /> | ||||
<None Remove="Image\buttonOff.png" /> | <None Remove="Image\buttonOff.png" /> | ||||
@@ -112,6 +113,7 @@ | |||||
<None Remove="Image\工艺流程.jpg" /> | <None Remove="Image\工艺流程.jpg" /> | ||||
<None Remove="Image\工艺流程.png" /> | <None Remove="Image\工艺流程.png" /> | ||||
<None Remove="Image\底部背景.png" /> | <None Remove="Image\底部背景.png" /> | ||||
<None Remove="Image\弹窗.png" /> | |||||
<None Remove="Image\搜索按钮.png" /> | <None Remove="Image\搜索按钮.png" /> | ||||
<None Remove="Image\搜索框.png" /> | <None Remove="Image\搜索框.png" /> | ||||
<None Remove="Image\文字.png" /> | <None Remove="Image\文字.png" /> | ||||
@@ -165,6 +167,7 @@ | |||||
<None Remove="Image\窗体样式\Tab\Tab_SelectWZBJ.png" /> | <None Remove="Image\窗体样式\Tab\Tab_SelectWZBJ.png" /> | ||||
<None Remove="Image\竖线.png" /> | <None Remove="Image\竖线.png" /> | ||||
<None Remove="Image\纹理背景.jpeg" /> | <None Remove="Image\纹理背景.jpeg" /> | ||||
<None Remove="Image\组 8.png" /> | |||||
<None Remove="Image\维护.png" /> | <None Remove="Image\维护.png" /> | ||||
<None Remove="Image\背景.png" /> | <None Remove="Image\背景.png" /> | ||||
<None Remove="Image\背景2.png" /> | <None Remove="Image\背景2.png" /> | ||||
@@ -247,6 +250,7 @@ | |||||
<Resource Include="Image\AGV\砖块.png" /> | <Resource Include="Image\AGV\砖块.png" /> | ||||
<Resource Include="Image\AGV\蔬菜.png" /> | <Resource Include="Image\AGV\蔬菜.png" /> | ||||
<Resource Include="Image\AGV\语音箭头.png" /> | <Resource Include="Image\AGV\语音箭头.png" /> | ||||
<Resource Include="Image\bg12.png" /> | |||||
<Resource Include="Image\btn_close.png" /> | <Resource Include="Image\btn_close.png" /> | ||||
<Resource Include="Image\ComboBoxPopSelect.png" /> | <Resource Include="Image\ComboBoxPopSelect.png" /> | ||||
<Resource Include="Image\ComboBoxSelect.png" /> | <Resource Include="Image\ComboBoxSelect.png" /> | ||||
@@ -266,6 +270,7 @@ | |||||
<Resource Include="Image\告警\轻微告警.png" /> | <Resource Include="Image\告警\轻微告警.png" /> | ||||
<Resource Include="Image\工艺流程.jpg" /> | <Resource Include="Image\工艺流程.jpg" /> | ||||
<Resource Include="Image\工艺流程.png" /> | <Resource Include="Image\工艺流程.png" /> | ||||
<Resource Include="Image\弹窗.png" /> | |||||
<Resource Include="Image\智慧城市科技风登录页面.png" /> | <Resource Include="Image\智慧城市科技风登录页面.png" /> | ||||
<Resource Include="Image\智慧城市科技风登录页面边框.png" /> | <Resource Include="Image\智慧城市科技风登录页面边框.png" /> | ||||
<Resource Include="Image\浅色背景.jpeg" /> | <Resource Include="Image\浅色背景.jpeg" /> | ||||
@@ -276,6 +281,7 @@ | |||||
<Resource Include="Image\登录界面背景.jpg" /> | <Resource Include="Image\登录界面背景.jpg" /> | ||||
<Resource Include="Image\登录界面背景1.jpg" /> | <Resource Include="Image\登录界面背景1.jpg" /> | ||||
<Resource Include="Image\纹理背景.jpeg" /> | <Resource Include="Image\纹理背景.jpeg" /> | ||||
<Resource Include="Image\组 8.png" /> | |||||
<Resource Include="Image\背景2.png" /> | <Resource Include="Image\背景2.png" /> | ||||
<Resource Include="Image\背景3.jpg" /> | <Resource Include="Image\背景3.jpg" /> | ||||
<Resource Include="Image\调味品.jpeg" /> | <Resource Include="Image\调味品.jpeg" /> | ||||
@@ -309,6 +315,7 @@ | |||||
<ItemGroup> | <ItemGroup> | ||||
<ProjectReference Include="..\BPASmartClient.Helper\BPASmartClient.Helper.csproj" /> | <ProjectReference Include="..\BPASmartClient.Helper\BPASmartClient.Helper.csproj" /> | ||||
<ProjectReference Include="..\BPASmartClient.Model\BPASmartClient.Model.csproj" /> | <ProjectReference Include="..\BPASmartClient.Model\BPASmartClient.Model.csproj" /> | ||||
<ProjectReference Include="..\BPASmartClient.Nfc\BPASmartClient.Nfc.csproj" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
@@ -24,10 +24,33 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||||
public class MenuModel : ObservableObject | public class MenuModel : ObservableObject | ||||
{ | { | ||||
private Permission[] pers | |||||
{ | |||||
get | |||||
{ | |||||
List<Permission> permissionList = new List<Permission>(); | |||||
foreach (var item in subMenumodels) | |||||
{ | |||||
foreach (var p in item.SubMenuPermission) | |||||
{ | |||||
if (!permissionList.Contains(p)) permissionList.Add(p); | |||||
} | |||||
} | |||||
return permissionList.ToArray(); | |||||
} | |||||
} | |||||
///// <summary> | |||||
///// 主菜单权限 | |||||
///// </summary> | |||||
//public Permission[] MainMenuPermission { get { return _mMainMenuPermission; } set { _mMainMenuPermission = value; OnPropertyChanged(); } } | |||||
//private Permission[] _mMainMenuPermission; | |||||
/// <summary> | /// <summary> | ||||
/// 主菜单权限 | /// 主菜单权限 | ||||
/// </summary> | /// </summary> | ||||
public Permission[] MainMenuPermission { get { return _mMainMenuPermission; } set { _mMainMenuPermission = value; OnPropertyChanged(); } } | |||||
public Permission[] MainMenuPermission { get { return pers; } set { _mMainMenuPermission = value; OnPropertyChanged(); } } | |||||
private Permission[] _mMainMenuPermission; | private Permission[] _mMainMenuPermission; | ||||
/// <summary> | /// <summary> | ||||
@@ -22,6 +22,8 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||||
public Action<string> RunLog { get; set; } | public Action<string> RunLog { get; set; } | ||||
public ObservableCollection<RunLog> runLogs { get; set; } = new ObservableCollection<RunLog>(); | public ObservableCollection<RunLog> runLogs { get; set; } = new ObservableCollection<RunLog>(); | ||||
public ObservableCollection<UserLog> userLogs { get; set; } = new ObservableCollection<UserLog>(); | public ObservableCollection<UserLog> userLogs { get; set; } = new ObservableCollection<UserLog>(); | ||||
@@ -32,12 +34,6 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||||
Sqlite<RunLog>.GetInstance.Save(); | Sqlite<RunLog>.GetInstance.Save(); | ||||
} | } | ||||
//public void GetLog() | |||||
//{ | |||||
// Sqlite<UserLog>.GetInstance.GetData(); | |||||
// Sqlite<RunLog>.GetInstance.GetData(); | |||||
//} | |||||
public void ShowUserLog(string info) | public void ShowUserLog(string info) | ||||
{ | { | ||||
lock (userlock) | lock (userlock) | ||||
@@ -68,10 +64,12 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||||
}; | }; | ||||
Sqlite<RunLog>.GetInstance.Base.Add(runLog); | Sqlite<RunLog>.GetInstance.Base.Add(runLog); | ||||
Application.Current.Dispatcher.Invoke(new Action(() => { runLogs.Insert(0, runLog); })); | Application.Current.Dispatcher.Invoke(new Action(() => { runLogs.Insert(0, runLog); })); | ||||
RunLog?.Invoke(info); | |||||
RunLog?.Invoke(info); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } |
@@ -0,0 +1,49 @@ | |||||
using BPASmartClient.CustomResource.Pages.ViewModel; | |||||
using BPASmartClient.Nfc; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.CustomResource.Pages.Model | |||||
{ | |||||
public class NfcServer | |||||
{ | |||||
private volatile static NfcServer _Instance; | |||||
public static NfcServer GetInstance => _Instance ?? (_Instance = new NfcServer()); | |||||
private NfcServer() { } | |||||
public bool EnableLogin { get; set; } | |||||
public Action Update { get; set; } | |||||
public void Init() | |||||
{ | |||||
NFCHelper.GetInstance.Update = new Action(() => | |||||
{ | |||||
Update?.Invoke(); | |||||
if (!EnableLogin) | |||||
{ | |||||
if (NFCHelper.GetInstance.GetReadResult?.CardNum.Length > 0) | |||||
{ | |||||
string id = NFCHelper.GetInstance.GetReadResult?.CardNum; | |||||
var res = Global.userManager.userInfos.FirstOrDefault(p => p.CardId?.FirstOrDefault(s => s == id) != null); | |||||
if (res != null) | |||||
{ | |||||
if (Global.userInfo.permission != res.permission) | |||||
{ | |||||
BPASmartClient.Message.MessageLog.GetInstance.ShowDebugLog("NFC卡登录"); | |||||
LoginViewModel.NfcLogin(id); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
}); | |||||
NFCHelper.GetInstance.Init(); | |||||
} | |||||
} | |||||
} |
@@ -10,14 +10,10 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||||
{ | { | ||||
public class UserInfo:ObservableObject | public class UserInfo:ObservableObject | ||||
{ | { | ||||
public string Id { get { return _id; } set { _id = value;OnPropertyChanged(); } } | |||||
private string _id; | |||||
public Permission Permission { get { return _permission; } set { _permission = value; OnPropertyChanged(); } } | |||||
private Permission _permission; | |||||
public string UserName { get { return _userName; } set { _userName = value;OnPropertyChanged(); } } | |||||
private string _userName; | |||||
public string Password { get { return _password; } set { _password = value; OnPropertyChanged(); } } | |||||
private string _password; | |||||
public Permission permission { get; set; } | |||||
public string UserName { get; set; } | |||||
public string Password { get; set; } | |||||
public List<string> CardId { get; set; } = new List<string>(); | |||||
} | } | ||||
} | } |
@@ -0,0 +1,40 @@ | |||||
<UserControl | |||||
x:Class="BPASmartClient.CustomResource.Pages.View.DebugLogView" | |||||
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.CustomResource.Pages.View" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel" | |||||
d:DesignHeight="450" | |||||
d:DesignWidth="800" | |||||
mc:Ignorable="d"> | |||||
<UserControl.DataContext> | |||||
<vm:DebugLogViewModel /> | |||||
</UserControl.DataContext> | |||||
<Grid> | |||||
<ScrollViewer | |||||
Margin="20" | |||||
HorizontalScrollBarVisibility="Hidden" | |||||
VerticalScrollBarVisibility="Hidden"> | |||||
<TextBlock | |||||
FontFamily="黑体" | |||||
FontSize="16" | |||||
Foreground="#20FDFA" | |||||
LineHeight="30" | |||||
Text="{Binding Message}" | |||||
TextWrapping="Wrap"> | |||||
<TextBlock.Effect> | |||||
<DropShadowEffect | |||||
Direction="0" | |||||
Opacity="0.5" | |||||
ShadowDepth="5" | |||||
Color="#20aefe" /> | |||||
</TextBlock.Effect> | |||||
</TextBlock> | |||||
</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.CustomResource.Pages.View | |||||
{ | |||||
/// <summary> | |||||
/// DebugLogView.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class DebugLogView : UserControl | |||||
{ | |||||
public DebugLogView() | |||||
{ | |||||
InitializeComponent(); | |||||
} | |||||
} | |||||
} |
@@ -30,7 +30,14 @@ namespace BPASmartClient.CustomResource.Pages.View | |||||
Username.SelectionStart = Username.Text.Trim().Length; | Username.SelectionStart = Username.Text.Trim().Length; | ||||
this.Loaded += LoginView_Loaded; | this.Loaded += LoginView_Loaded; | ||||
ActionManage.GetInstance.Register(new Action(() => { this.DialogResult = true; this.Close(); }), "LoginOk", true); | |||||
ActionManage.GetInstance.Register(new Action(() => | |||||
{ | |||||
if (this.IsVisible) | |||||
{ | |||||
this.DialogResult = true; | |||||
this.Close(); | |||||
} | |||||
}), "LoginOk", true); | |||||
ActionManage.GetInstance.Register(new Action(() => { this.DialogResult = false; this.Close(); }), "ExitAction", true); | ActionManage.GetInstance.Register(new Action(() => { this.DialogResult = false; this.Close(); }), "ExitAction", true); | ||||
} | } | ||||
@@ -0,0 +1,242 @@ | |||||
<Window | |||||
x:Class="BPASmartClient.CustomResource.Pages.View.NfcSetView" | |||||
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.CustomResource.Pages.View" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel" | |||||
Title="NfcSetView" | |||||
Width="500" | |||||
Height="250" | |||||
AllowsTransparency="True" | |||||
Background="{x:Null}" | |||||
Topmost="True" | |||||
WindowStartupLocation="CenterScreen" | |||||
WindowStyle="None" | |||||
mc:Ignorable="d"> | |||||
<Window.DataContext> | |||||
<vm:NfcSetViewModel /> | |||||
</Window.DataContext> | |||||
<Window.Resources> | |||||
<Style x:Key="rbStyle" TargetType="RadioButton"> | |||||
<Setter Property="Foreground" Value="#32b8ff" /> | |||||
<Setter Property="Margin" Value="0,5,0,5" /> | |||||
<Setter Property="HorizontalAlignment" Value="Center" /> | |||||
<Setter Property="FontSize" Value="14" /> | |||||
<Setter Property="GroupName" Value="all" /> | |||||
<Setter Property="Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate TargetType="RadioButton"> | |||||
<Grid | |||||
Name="gr" | |||||
Background="Transparent" | |||||
Opacity="0.8"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition Width="Auto" /> | |||||
<ColumnDefinition /> | |||||
</Grid.ColumnDefinitions> | |||||
<ContentControl | |||||
Name="cc" | |||||
Grid.Column="1" | |||||
Margin="{TemplateBinding Margin}" | |||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}" | |||||
VerticalAlignment="{TemplateBinding VerticalAlignment}" | |||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" | |||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" | |||||
Content="{TemplateBinding Content}" | |||||
FontSize="{TemplateBinding FontSize}" /> | |||||
<Grid Margin="0,0,4,0"> | |||||
<Ellipse | |||||
Name="e2" | |||||
Width="{Binding ElementName=cc, Path=ActualHeight}" | |||||
Height="{Binding ElementName=cc, Path=ActualHeight}" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
Fill="Transparent" | |||||
Stroke="{Binding ElementName=cc, Path=Foreground}" | |||||
StrokeThickness="1" /> | |||||
<Ellipse | |||||
Name="el" | |||||
Width="{Binding ElementName=cc, Path=FontSize}" | |||||
Height="{Binding ElementName=cc, Path=FontSize}" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
Fill="Transparent" | |||||
Stroke="{Binding ElementName=cc, Path=Foreground}" | |||||
StrokeThickness="0" /> | |||||
</Grid> | |||||
</Grid> | |||||
<ControlTemplate.Triggers> | |||||
<Trigger Property="IsChecked" Value="True"> | |||||
<Setter TargetName="el" Property="Fill" Value="#32b8ff" /> | |||||
</Trigger> | |||||
<Trigger Property="IsMouseOver" Value="True"> | |||||
<Setter TargetName="gr" Property="Opacity" Value="1" /> | |||||
</Trigger> | |||||
</ControlTemplate.Triggers> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style> | |||||
<Style x:Key="buttonStyle" TargetType="Button"> | |||||
<Setter Property="Margin" Value="10" /> | |||||
<Setter Property="FontSize" Value="17" /> | |||||
<Setter Property="Foreground" Value="#32b8ff" /> | |||||
<Setter Property="FontWeight" Value="SemiBold" /> | |||||
<Setter Property="FontFamily" Value="楷体" /> | |||||
<Setter Property="Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate TargetType="Button"> | |||||
<Border | |||||
Name="TitleBarBr" | |||||
BorderBrush="#00c2f4" | |||||
BorderThickness="0" | |||||
Opacity="0.8"> | |||||
<ContentPresenter | |||||
Margin="{TemplateBinding Margin}" | |||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" | |||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" | |||||
Content="{TemplateBinding Content}" /> | |||||
<Border.Background> | |||||
<ImageBrush ImageSource="../../Image/组 8.png" Stretch="Fill" /> | |||||
</Border.Background> | |||||
</Border> | |||||
<ControlTemplate.Triggers> | |||||
<Trigger Property="IsMouseOver" Value="true"> | |||||
<Setter TargetName="TitleBarBr" Property="Opacity" Value="1" /> | |||||
</Trigger> | |||||
</ControlTemplate.Triggers> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style> | |||||
</Window.Resources> | |||||
<Grid> | |||||
<Grid.Background> | |||||
<ImageBrush ImageSource="../../Image/弹窗.png" Stretch="Fill" /> | |||||
</Grid.Background> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition Width="0.5*" /> | |||||
<ColumnDefinition /> | |||||
</Grid.ColumnDefinitions> | |||||
<Grid Background="Transparent"> | |||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> | |||||
<TextBlock | |||||
FontSize="16" | |||||
Foreground="#32B8FF" | |||||
Text="用户权限列表:" /> | |||||
<ItemsControl ItemsSource="{Binding permissions}"> | |||||
<ItemsControl.ItemTemplate> | |||||
<DataTemplate> | |||||
<Grid> | |||||
<RadioButton | |||||
Content="{Binding PermissionName}" | |||||
IsChecked="{Binding PermissionSelected}" | |||||
Style="{StaticResource rbStyle}" /> | |||||
</Grid> | |||||
</DataTemplate> | |||||
</ItemsControl.ItemTemplate> | |||||
</ItemsControl> | |||||
</StackPanel> | |||||
</Grid> | |||||
<Grid Grid.Column="1"> | |||||
<Border | |||||
Width="1" | |||||
Margin="0,20,0,20" | |||||
HorizontalAlignment="Left"> | |||||
<Border.Background> | |||||
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> | |||||
<GradientStop Color="#FF0B2E56" /> | |||||
<GradientStop Offset="1" Color="#FF0B2E56" /> | |||||
<GradientStop Offset="0.58" Color="#FF32B8FF" /> | |||||
</LinearGradientBrush> | |||||
</Border.Background> | |||||
</Border> | |||||
<Grid Margin="10,30,30,30"> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition /> | |||||
<RowDefinition Height="0.5*" /> | |||||
</Grid.RowDefinitions> | |||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> | |||||
<StackPanel Margin="0,5,0,5" Orientation="Horizontal"> | |||||
<TextBlock | |||||
HorizontalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="#FF32B8FF" | |||||
Text="当前卡号:" /> | |||||
<TextBlock | |||||
HorizontalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="#FF32B8FF" | |||||
Text="{Binding CardNum}" /> | |||||
</StackPanel> | |||||
<TextBlock | |||||
Margin="0,5,0,5" | |||||
HorizontalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="#FFF53F62" | |||||
Text="{Binding Info}" /> | |||||
</StackPanel> | |||||
<Grid Grid.Row="1"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
</Grid.ColumnDefinitions> | |||||
<RadioButton | |||||
VerticalAlignment="Center" | |||||
Content="用户添加" | |||||
GroupName="add" | |||||
IsChecked="{Binding UserAdd}" | |||||
Style="{StaticResource rbStyle}" /> | |||||
<RadioButton | |||||
Grid.Column="1" | |||||
VerticalAlignment="Center" | |||||
Content="用户注销" | |||||
GroupName="add" | |||||
IsChecked="{Binding UserCnange}" | |||||
Style="{StaticResource rbStyle}" /> | |||||
</Grid> | |||||
</Grid> | |||||
<Border | |||||
Width="20" | |||||
Height="20" | |||||
Margin="0,18,18,0" | |||||
HorizontalAlignment="Right" | |||||
VerticalAlignment="Top" | |||||
Background="Transparent" | |||||
MouseLeftButtonDown="Border_MouseLeftButtonDown" /> | |||||
</Grid> | |||||
</Grid> | |||||
</Window> |
@@ -0,0 +1,45 @@ | |||||
using BPASmartClient.CustomResource.Pages.Model; | |||||
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.CustomResource.Pages.View | |||||
{ | |||||
/// <summary> | |||||
/// NfcSetView.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class NfcSetView : Window | |||||
{ | |||||
public NfcSetView() | |||||
{ | |||||
InitializeComponent(); | |||||
this.Closing += NfcSetView_Closing; | |||||
ActionManage.GetInstance.Register(new Action(() => | |||||
{ | |||||
Application.Current.Dispatcher.Invoke(new Action(() => { this.Close(); })); | |||||
NfcServer.GetInstance.EnableLogin = false; | |||||
}), "Exit", true); | |||||
} | |||||
private void NfcSetView_Closing(object? sender, System.ComponentModel.CancelEventArgs e) | |||||
{ | |||||
NfcServer.GetInstance.EnableLogin = false; | |||||
} | |||||
private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) | |||||
{ | |||||
this.Close(); | |||||
} | |||||
} | |||||
} |
@@ -25,8 +25,23 @@ namespace BPASmartClient.CustomResource.Pages.View | |||||
InitializeComponent(); | InitializeComponent(); | ||||
Username.Focus(); | Username.Focus(); | ||||
Username.SelectionStart = Username.Text.Trim().Length; | Username.SelectionStart = Username.Text.Trim().Length; | ||||
ActionManage.GetInstance.Register(new Action(() => { this.DialogResult = true; this.Close(); }), "LoginOk", true); | |||||
ActionManage.GetInstance.Register(new Action(() => { this.DialogResult = false; this.Close(); }), "ExitAction", true); | |||||
ActionManage.GetInstance.Register(new Action(() => | |||||
{ | |||||
if (this.IsVisible) | |||||
{ | |||||
this.DialogResult = true; | |||||
this.Close(); | |||||
} | |||||
}), "LoginOk", true); | |||||
ActionManage.GetInstance.Register(new Action(() => | |||||
{ | |||||
if (this.IsVisible) | |||||
{ | |||||
this.DialogResult = false; | |||||
this.Close(); | |||||
} | |||||
}), "ExitAction", true); | |||||
} | } | ||||
private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e) | private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e) | ||||
@@ -0,0 +1,34 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.ComponentModel; | |||||
using System.Linq; | |||||
using System.Runtime.CompilerServices; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using BPASmartClient.Message; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
namespace BPASmartClient.CustomResource.Pages.ViewModel | |||||
{ | |||||
public class DebugLogViewModel : ObservableObject | |||||
{ | |||||
public DebugLogViewModel() | |||||
{ | |||||
MessageLog.GetInstance.DebugLog = new Action<string>((o) => | |||||
{ | |||||
Message = MessageLog.GetInstance.DebugLogInfo; | |||||
}); | |||||
} | |||||
public static string Message { get { return _mMessage; } set { _mMessage = value; OnStaticPropertyChanged(); } } | |||||
private static string _mMessage = string.Empty; | |||||
public static event EventHandler<PropertyChangedEventArgs> StaticPropertyChanged; | |||||
private static void OnStaticPropertyChanged([CallerMemberName] string PropName = "") | |||||
{ | |||||
StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(PropName)); | |||||
} | |||||
} | |||||
} |
@@ -24,6 +24,37 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel | |||||
}); | }); | ||||
} | } | ||||
public static void NfcLogin(string cardId) | |||||
{ | |||||
var res = Global.userManager.userInfos.FirstOrDefault(p => p.CardId?.FirstOrDefault(s => s == cardId && s.Length > 0) != null); | |||||
if (res != null) | |||||
{ | |||||
Global.userInfo.permission = res.permission; | |||||
Global.userInfo.UserName = res.UserName; | |||||
Global.userInfo.Password = res.Password; | |||||
for (int i = 0; i < MenuManage.GetInstance.menuModels.Count; i++) | |||||
{ | |||||
if (MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuPermission.Contains(res.permission)) | |||||
MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Visible; | |||||
else | |||||
MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed; | |||||
if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.FirstOrDefault(p => p.SubMenuPermission.Contains(res.permission)) == null) | |||||
MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed; | |||||
for (int m = 0; m < MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.Count; m++) | |||||
{ | |||||
if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuPermission.Contains(res.permission)) | |||||
MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Visible; | |||||
else | |||||
MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Collapsed; | |||||
} | |||||
} | |||||
Application.Current.Dispatcher.Invoke(new Action(() => { ActionManage.GetInstance.Send("LoginOk"); })); | |||||
} | |||||
} | |||||
private void Login() | private void Login() | ||||
{ | { | ||||
var res = Global.userManager.userInfos.FirstOrDefault(p => p.UserName == UserName && p.Password == Password); | var res = Global.userManager.userInfos.FirstOrDefault(p => p.UserName == UserName && p.Password == Password); | ||||
@@ -0,0 +1,136 @@ | |||||
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 BPASmartClient.CustomResource.Pages.Enums; | |||||
using Microsoft.Toolkit.Mvvm.Input; | |||||
using BPASmartClient.CustomResource.Pages.Model; | |||||
using BPASmartClient.Nfc; | |||||
using System.Threading; | |||||
using BPASmartClient.Helper; | |||||
namespace BPASmartClient.CustomResource.Pages.ViewModel | |||||
{ | |||||
public class NfcSetViewModel : ObservableObject | |||||
{ | |||||
public NfcSetViewModel() | |||||
{ | |||||
NfcServer.GetInstance.EnableLogin = true; | |||||
permissions.Clear(); | |||||
Enum.GetNames(typeof(Permission)).ToList()?.ForEach(item => { permissions.Add(new PermissionSelect() { PermissionName = item }); }); | |||||
NfcServer.GetInstance.Update = new Action(() => | |||||
{ | |||||
CardNum = NFCHelper.GetInstance.GetReadResult.CardNum; | |||||
if (CardNum.Length <= 0) return; | |||||
if (!UserAdd && !UserCnange) | |||||
{ | |||||
Info = "Error:请选择操作模式;"; | |||||
return; | |||||
} | |||||
if (UserAdd) | |||||
{ | |||||
var per = Global.userManager.userInfos.FirstOrDefault(p => p.CardId.Contains(CardNum)); | |||||
if (per != null) | |||||
{ | |||||
Info = "Error:用户已存在!;"; | |||||
return; | |||||
} | |||||
if (permissions?.FirstOrDefault(p => p.PermissionSelected == true) == null) | |||||
{ | |||||
Info = "Error:请选择一个权限;"; | |||||
return; | |||||
} | |||||
var res = permissions.FirstOrDefault(p => p.PermissionSelected == true); | |||||
if (res != null) | |||||
{ | |||||
int index = Array.FindIndex(Global.userManager.userInfos.ToArray(), p => p.permission.ToString() == res.PermissionName); | |||||
if (index >= 0 && index < Global.userManager.userInfos.Count) | |||||
{ | |||||
if (!Global.userManager.userInfos.ElementAt(index).CardId.Contains(NFCHelper.GetInstance.GetReadResult.CardNum)) | |||||
{ | |||||
Global.userManager.userInfos.ElementAt(index).CardId.Add(NFCHelper.GetInstance.GetReadResult.CardNum); | |||||
Config.GetInstance.SaveUser(); | |||||
Info = $"Info:ID {NFCHelper.GetInstance.GetReadResult.CardNum} 添加成功;"; | |||||
Thread.Sleep(1000); | |||||
ActionManage.GetInstance.Send("Exit"); | |||||
} | |||||
} | |||||
else | |||||
Info = $"Info:ID {NFCHelper.GetInstance.GetReadResult.CardNum} 已存在;"; | |||||
} | |||||
} | |||||
if (UserCnange) | |||||
{ | |||||
int index = Array.FindIndex(Global.userManager.userInfos.ToArray(), p => p.CardId.FirstOrDefault(s => s == CardNum) != null); | |||||
if (index >= 0 && index < Global.userManager.userInfos.Count) | |||||
{ | |||||
if (Global.userManager.userInfos.ElementAt(index).CardId.Contains(CardNum)) | |||||
Global.userManager.userInfos.ElementAt(index).CardId.Remove(CardNum); | |||||
Config.GetInstance.SaveUser(); | |||||
Info = $"Info:ID {CardNum} 注销成功;"; | |||||
Thread.Sleep(1000); | |||||
ActionManage.GetInstance.Send("Exit"); | |||||
} | |||||
else | |||||
{ | |||||
Info = "Info:当前卡在系统中不存在;"; | |||||
return; | |||||
} | |||||
} | |||||
}); | |||||
} | |||||
private bool Verify() | |||||
{ | |||||
if (permissions?.FirstOrDefault(p => p.PermissionSelected == true) == null) | |||||
{ | |||||
Info = "Error:请选择一个权限;"; | |||||
return false; | |||||
} | |||||
if (CardNum == null || CardNum?.Length <= 0) | |||||
{ | |||||
Info = "Error:请将卡放到刷卡区;"; | |||||
return false; | |||||
} | |||||
return true; | |||||
} | |||||
public ObservableCollection<PermissionSelect> permissions { get; set; } = new ObservableCollection<PermissionSelect>(); | |||||
public string CardNum { get { return _mCardNum; } set { _mCardNum = value; OnPropertyChanged(); } } | |||||
private string _mCardNum; | |||||
public string Info { get { return _mInfo; } set { _mInfo = value; OnPropertyChanged(); } } | |||||
private string _mInfo; | |||||
public bool UserAdd { get { return _mUserAdd; } set { _mUserAdd = value; OnPropertyChanged(); } } | |||||
private bool _mUserAdd; | |||||
public bool UserCnange { get { return _mUserCnange; } set { _mUserCnange = value; OnPropertyChanged(); } } | |||||
private bool _mUserCnange; | |||||
public RelayCommand SavePermission { get; set; } | |||||
public RelayCommand DeletePermission { get; set; } | |||||
} | |||||
public class PermissionSelect : ObservableObject | |||||
{ | |||||
public string PermissionName { get { return _mPermissionName; } set { _mPermissionName = value; OnPropertyChanged(); } } | |||||
private string _mPermissionName; | |||||
public bool PermissionSelected { get { return _mPermissionSelected; } set { _mPermissionSelected = value; OnPropertyChanged(); } } | |||||
private bool _mPermissionSelected = false; | |||||
} | |||||
} |
@@ -95,23 +95,31 @@ namespace BPASmartClient.Helper | |||||
if (action != null) | if (action != null) | ||||
{ | { | ||||
if (IsAutoCancelRegister && actions.ContainsKey(key)) actions.TryRemove(key, out Delegation d); | if (IsAutoCancelRegister && actions.ContainsKey(key)) actions.TryRemove(key, out Delegation d); | ||||
if (!actions.ContainsKey(key)) | |||||
try | |||||
{ | { | ||||
if (action is Action actionBus) | |||||
actions.TryAdd(key, new Delegation() { ActionBus = actionBus }); | |||||
if (!actions.ContainsKey(key)) | |||||
{ | |||||
if (action is Action actionBus) | |||||
actions.TryAdd(key, new Delegation() { ActionBus = actionBus }); | |||||
if (action is Action<object> actionObj) | |||||
actions.TryAdd(key, new Delegation() { ActionPar = actionObj }); | |||||
if (action is Action<object> actionObj) | |||||
actions.TryAdd(key, new Delegation() { ActionPar = actionObj }); | |||||
if (action is Action<object[]> actionObjs) | |||||
actions.TryAdd(key, new Delegation() { ActionPars = actionObjs }); | |||||
if (action is Action<object[]> actionObjs) | |||||
actions.TryAdd(key, new Delegation() { ActionPars = actionObjs }); | |||||
if (action is Func<object> funcObj) | |||||
actions.TryAdd(key, new Delegation() { FuncObj = funcObj }); | |||||
if (action is Func<object> funcObj) | |||||
actions.TryAdd(key, new Delegation() { FuncObj = funcObj }); | |||||
if (action is Func<object, object> puncPar) | |||||
actions.TryAdd(key, new Delegation() { FuncPar = puncPar }); | |||||
if (action is Func<object, object> puncPar) | |||||
actions.TryAdd(key, new Delegation() { FuncPar = puncPar }); | |||||
} | |||||
} | } | ||||
catch (Exception ex) | |||||
{ | |||||
Message.MessageLog.GetInstance.ShowDebugLog(ex.ToString()); | |||||
} | |||||
} | } | ||||
} | } | ||||
@@ -22,6 +22,7 @@ | |||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.5" /> | <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.5" /> | ||||
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" /> | <PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" /> | ||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> | <PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> | ||||
<PackageReference Include="System.Data.OleDb" Version="6.0.0" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
@@ -0,0 +1,151 @@ | |||||
using BPASmartClient.Message; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Data; | |||||
using System.Data.OleDb; | |||||
using System.IO; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.Helper | |||||
{ | |||||
public class ExcelHelper | |||||
{ | |||||
public DataTable GetExcelToDataTableBySheet(string FileFullPath, string SheetName) | |||||
{ | |||||
//此连接只能操作Excel2007之前(.xls)文件 | |||||
//string strConn = "Provider=Microsoft.Jet.OleDb.4.0;" + "data source=" + FileFullPath + ";Extended Properties='Excel 8.0; HDR=NO; IMEX=1'"; | |||||
//此连接可以操作.xls与.xlsx文件 | |||||
string strConn = "Provider=Microsoft.Ace.OleDb.12.0;" + "data source=" + FileFullPath + ";Extended Properties='Excel 12.0; HDR=NO; IMEX=1'"; | |||||
OleDbConnection conn = new OleDbConnection(strConn); | |||||
conn.Open(); | |||||
DataSet ds = new DataSet(); | |||||
OleDbDataAdapter odda = new OleDbDataAdapter(string.Format("SELECT * FROM [{0}]", SheetName), conn); | |||||
//OleDbDataAdapter odda = new OleDbDataAdapter(string.Format("select * from [Sheet1$]", conn),conn); | |||||
odda.Fill(ds, SheetName); | |||||
conn.Close(); | |||||
return ds.Tables[0]; | |||||
} | |||||
//根据Excel物理路径获取Excel文件中所有表名 | |||||
public String[] GetExcelSheetNames(string excelFile) | |||||
{ | |||||
OleDbConnection objConn = null; | |||||
System.Data.DataTable dt = null; | |||||
try | |||||
{ | |||||
//此连接只能操作Excel2007之前(.xls)文件 | |||||
//string strConn = "Provider=Microsoft.Jet.OleDb.4.0;" + "data source=" + excelFile + ";Extended Properties='Excel 8.0; HDR=NO; IMEX=1'"; | |||||
//此连接可以操作.xls与.xlsx文件 | |||||
string strConn = "Provider=Microsoft.Ace.OleDb.12.0;" + "data source=" + excelFile + ";Extended Properties='Excel 12.0; HDR=NO; IMEX=1'"; | |||||
objConn = new OleDbConnection(strConn); | |||||
objConn.Open(); | |||||
dt = objConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); | |||||
if (dt == null) | |||||
{ | |||||
return null; | |||||
} | |||||
String[] excelSheets = new String[dt.Rows.Count]; | |||||
int i = 0; | |||||
foreach (DataRow row in dt.Rows) | |||||
{ | |||||
excelSheets[i] = row["TABLE_NAME"].ToString(); | |||||
i++; | |||||
} | |||||
return excelSheets; | |||||
} | |||||
catch | |||||
{ | |||||
return null; | |||||
} | |||||
finally | |||||
{ | |||||
if (objConn != null) | |||||
{ | |||||
objConn.Close(); | |||||
objConn.Dispose(); | |||||
} | |||||
if (dt != null) | |||||
{ | |||||
dt.Dispose(); | |||||
} | |||||
} | |||||
} | |||||
public static DataTable ReadDataFromCSV( string file) | |||||
{ | |||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); | |||||
DataTable dt = null; | |||||
if(File.Exists(file)) | |||||
{ | |||||
dt = new DataTable(); | |||||
FileStream fs = new FileStream(file, FileMode.Open,FileAccess.Read); | |||||
StreamReader sr; | |||||
try | |||||
{ | |||||
Encoding encoding = Encoding.Default; | |||||
using (sr = new StreamReader(fs, Encoding.GetEncoding("GB2312"))) | |||||
{ | |||||
string head = sr.ReadLine(); | |||||
string[] headNames = head.Split(','); | |||||
for (int i = 0; i < headNames.Length; i++) | |||||
{ | |||||
dt.Columns.Add(headNames[i], typeof(string)); | |||||
} | |||||
while (!sr.EndOfStream) | |||||
{ | |||||
string lineStr = sr.ReadLine(); | |||||
if (lineStr != null) | |||||
{ | |||||
string[] lines = lineStr.Split(','); | |||||
DataRow dr = dt.NewRow(); | |||||
for (int i = 0; i < lines.Length; i++) | |||||
{ | |||||
dr[i] = lines[i]; | |||||
} | |||||
dt.Rows.Add(dr); | |||||
} | |||||
} | |||||
sr.Close(); | |||||
fs.Close(); | |||||
} | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
MessageLog.GetInstance.ShowEx($"读取csv文件异常:{ex.Message}"); | |||||
} | |||||
} | |||||
return dt; | |||||
} | |||||
} | |||||
} | |||||
@@ -0,0 +1,17 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | |||||
<PropertyGroup> | |||||
<TargetFramework>net6.0</TargetFramework> | |||||
<ImplicitUsings>enable</ImplicitUsings> | |||||
<Nullable>enable</Nullable> | |||||
</PropertyGroup> | |||||
<ItemGroup> | |||||
<PackageReference Include="NModbus.Serial" Version="3.0.72" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<ProjectReference Include="..\BPASmartClient.SerialPort\BPASmartClient.SerialPort.csproj" /> | |||||
</ItemGroup> | |||||
</Project> |
@@ -0,0 +1,7 @@ | |||||
namespace BPASmartClient.KHKJ | |||||
{ | |||||
public class Class1 | |||||
{ | |||||
} | |||||
} |
@@ -0,0 +1,120 @@ | |||||
using BPASmartClient.Helper; | |||||
using BPASmartClient.Message; | |||||
using BPASmartClient.SerialPort; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.KHKJ | |||||
{ | |||||
public class KHKJMachine | |||||
{ | |||||
//通讯代理 | |||||
SerialPortClient commProxy = null; | |||||
//数据仓库 | |||||
private DataStorage<byte> dataStorage = new DataStorage<byte>(); | |||||
//是否下发指令,主线程等待 | |||||
private bool free = false; | |||||
//状态询问指令 | |||||
private byte[] cmdAsk; | |||||
public KHKJMachine() | |||||
{ | |||||
MainLoop(); | |||||
} | |||||
public void Communication(string serialPort) | |||||
{ | |||||
commProxy = new SerialPortClient(serialPort, BaudRates.BR_9600); | |||||
commProxy.SetDataStorage(dataStorage); | |||||
commProxy.Start(); | |||||
free = true; | |||||
} | |||||
private void MainLoop() | |||||
{ | |||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
{ | |||||
if (!free) | |||||
{ | |||||
commProxy.SendData(cmdAsk); | |||||
} | |||||
Thread.Sleep(500); | |||||
}), "KHKJ询问线程"); | |||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
{ | |||||
ResolveMsg(); | |||||
}), "KHKJ解析线程"); | |||||
} | |||||
private void ResolveMsg() | |||||
{ | |||||
List<byte> temp = new List<byte>(); | |||||
//一系列解包 | |||||
while (dataStorage.GetSize() > 0) | |||||
{ | |||||
byte item = dataStorage.GetData(); | |||||
List<byte> data = new List<byte>() { item }; | |||||
if (Encoding.ASCII.GetString(data.ToArray()) == ":") | |||||
{ | |||||
temp.Add(item); | |||||
while (dataStorage.GetSize() < 32) { Thread.Sleep(5); } | |||||
while (temp.Count < 32) | |||||
{ | |||||
temp.Add(dataStorage.GetData()); | |||||
} | |||||
List<byte> vs = new List<byte>() { temp[temp.Count - 4], temp[temp.Count - 3], temp[temp.Count - 2], temp[temp.Count - 1] }; | |||||
string t = Encoding.ASCII.GetString(vs.ToArray()).ToLower(); | |||||
var package = Encoding.ASCII.GetString(temp.ToArray()); | |||||
//if (package.Contains("\\r\\n")) | |||||
//{ | |||||
// ProcessMsg(package); | |||||
//} | |||||
temp.Clear(); | |||||
} | |||||
continue; | |||||
} | |||||
Thread.Sleep(500); | |||||
} | |||||
public void Stop() | |||||
{ | |||||
try | |||||
{ | |||||
commProxy.Stop(); | |||||
free = true; | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 16进制转字节数组 | |||||
/// </summary> | |||||
/// <param name="hexstring"></param> | |||||
/// <returns></returns> | |||||
public byte[] HexStringToByteArray( string hexstring) | |||||
{ | |||||
var byteArray = new byte[hexstring.Length/2]; | |||||
for (int i = 0; i < byteArray.Length; i++) | |||||
{ | |||||
var x = Convert.ToInt32(hexstring.Substring(i * 2, 2), 16); | |||||
byteArray[i] = (byte)x; | |||||
} | |||||
return byteArray; | |||||
} | |||||
} | |||||
} |
@@ -22,6 +22,10 @@ namespace BPASmartClient.Message | |||||
/// </summary> | /// </summary> | ||||
public Action<string> InfoNotify { get; set; } | public Action<string> InfoNotify { get; set; } | ||||
public Action<string> DebugLog { get; set; } | |||||
public string DebugLogInfo { get; set; } = string.Empty; | |||||
/// <summary> | /// <summary> | ||||
/// 日志信息 | /// 日志信息 | ||||
/// </summary> | /// </summary> | ||||
@@ -37,6 +41,13 @@ namespace BPASmartClient.Message | |||||
LogInfo = $"{DateTime.Now.ToString("HH:mm:ss")}:{info} \n\r {LogInfo}"; | LogInfo = $"{DateTime.Now.ToString("HH:mm:ss")}:{info} \n\r {LogInfo}"; | ||||
if (InfoNotify != null) InfoNotify(info); | if (InfoNotify != null) InfoNotify(info); | ||||
} | } | ||||
public void ShowDebugLog(string info) | |||||
{ | |||||
Debug.WriteLine($"{DateTime.Now.ToString("HH:mm:ss")}:{info}"); | |||||
DebugLogInfo = $"{DateTime.Now.ToString("HH:mm:ss")}:{info} \n\r {DebugLogInfo}"; | |||||
DebugLog?.Invoke(info); | |||||
} | |||||
#endregion | #endregion | ||||
#region 异常消息日志 | #region 异常消息日志 | ||||
@@ -83,7 +83,7 @@ | |||||
<Setter Property="Foreground" Value="DarkSlateGray" /> | <Setter Property="Foreground" Value="DarkSlateGray" /> | ||||
<Setter Property="FontSize" Value="18" /> | <Setter Property="FontSize" Value="18" /> | ||||
<Setter Property="Cursor" Value="Hand" /> | <Setter Property="Cursor" Value="Hand" /> | ||||
<Setter Property="Background" Value="White"/> | |||||
<Setter Property="Background" Value="#D3D3D3"/> | |||||
<Setter Property="Template"> | <Setter Property="Template"> | ||||
<Setter.Value> | <Setter.Value> | ||||
<ControlTemplate TargetType="DataGridColumnHeader"> | <ControlTemplate TargetType="DataGridColumnHeader"> | ||||
@@ -93,9 +93,9 @@ | |||||
<ColumnDefinition Width="*" /> | <ColumnDefinition Width="*" /> | ||||
</Grid.ColumnDefinitions> | </Grid.ColumnDefinitions> | ||||
<ContentPresenter Margin="0,0,0,0" VerticalAlignment="Center" | <ContentPresenter Margin="0,0,0,0" VerticalAlignment="Center" | ||||
HorizontalAlignment="Center" /> | |||||
HorizontalAlignment="Center" /> | |||||
<Path x:Name="SortArrow" Visibility="Collapsed" Data="M0,0 L1,0 0.5,1 z" Stretch="Fill" | <Path x:Name="SortArrow" Visibility="Collapsed" Data="M0,0 L1,0 0.5,1 z" Stretch="Fill" | ||||
Grid.Column="0" Width="8" Height="6" Fill="White" Margin="0,0,50,0" | |||||
Grid.Column="0" Width="8" Height="6" Fill="#D3D3D3" Margin="0,0,50,0" | |||||
VerticalAlignment="Center" RenderTransformOrigin="1,1" /> | VerticalAlignment="Center" RenderTransformOrigin="1,1" /> | ||||
<Rectangle Width="1" Fill="Black" HorizontalAlignment="Right" Grid.ColumnSpan="1" /> | <Rectangle Width="1" Fill="Black" HorizontalAlignment="Right" Grid.ColumnSpan="1" /> | ||||
</Grid> | </Grid> | ||||
@@ -191,6 +191,38 @@ | |||||
<Setter Property="Template"> | <Setter Property="Template"> | ||||
<Setter.Value> | <Setter.Value> | ||||
<ControlTemplate TargetType="{x:Type Expander}"> | <ControlTemplate TargetType="{x:Type Expander}"> | ||||
<ControlTemplate.Resources> | |||||
<Storyboard x:Key="STHide"> | |||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" | |||||
Storyboard.TargetName="ExpandSite"> | |||||
<EasingDoubleKeyFrame KeyTime="0:0:0.0" | |||||
Value="1" /> | |||||
<EasingDoubleKeyFrame KeyTime="0:0:0.5" | |||||
Value="0" /> | |||||
</DoubleAnimationUsingKeyFrames> | |||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" | |||||
Storyboard.TargetName="ExpandSite"> | |||||
<EasingDoubleKeyFrame KeyTime="0:0:0.5" | |||||
Value="1" /> | |||||
</DoubleAnimationUsingKeyFrames> | |||||
</Storyboard> | |||||
<Storyboard x:Key="STShow"> | |||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" | |||||
Storyboard.TargetName="ExpandSite"> | |||||
<EasingDoubleKeyFrame KeyTime="0" | |||||
Value="0" /> | |||||
<EasingDoubleKeyFrame KeyTime="0:0:0.3" | |||||
Value="1" /> | |||||
</DoubleAnimationUsingKeyFrames> | |||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" | |||||
Storyboard.TargetName="ExpandSite"> | |||||
<EasingDoubleKeyFrame KeyTime="0" | |||||
Value="0" /> | |||||
<EasingDoubleKeyFrame KeyTime="0:0:0.6" | |||||
Value="1" /> | |||||
</DoubleAnimationUsingKeyFrames> | |||||
</Storyboard> | |||||
</ControlTemplate.Resources> | |||||
<Grid> | <Grid> | ||||
<Grid.RowDefinitions> | <Grid.RowDefinitions> | ||||
<RowDefinition Height="auto"></RowDefinition> | <RowDefinition Height="auto"></RowDefinition> | ||||
@@ -204,8 +236,10 @@ | |||||
<ColumnDefinition Width="50"/> | <ColumnDefinition Width="50"/> | ||||
</Grid.ColumnDefinitions> | </Grid.ColumnDefinitions> | ||||
<ContentPresenter ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" VerticalAlignment="Center"/> | |||||
<ToggleButton x:Name="HeaderSite" Grid.Column="1" Background="Transparent" | |||||
<ContentPresenter ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" VerticalAlignment="Center"> | |||||
</ContentPresenter> | |||||
<ToggleButton x:Name="HeaderSite" Grid.Column="0" Grid.ColumnSpan="2" Background="Transparent" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Width="200" | |||||
ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" | ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" | ||||
IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" | IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" | ||||
Style="{DynamicResource ExpanderToggleButtonStyle}" /> | Style="{DynamicResource ExpanderToggleButtonStyle}" /> | ||||
@@ -213,9 +247,28 @@ | |||||
</Border> | </Border> | ||||
<ContentPresenter x:Name="ExpandSite" Grid.Row="1" | <ContentPresenter x:Name="ExpandSite" Grid.Row="1" | ||||
ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" | ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" | ||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> | |||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"> | |||||
<ContentPresenter.LayoutTransform> | |||||
<TransformGroup> | |||||
<ScaleTransform /> | |||||
<SkewTransform /> | |||||
<RotateTransform /> | |||||
<TranslateTransform /> | |||||
</TransformGroup> | |||||
</ContentPresenter.LayoutTransform> | |||||
</ContentPresenter> | |||||
</Grid> | </Grid> | ||||
<ControlTemplate.Triggers> | <ControlTemplate.Triggers> | ||||
<EventTrigger RoutedEvent="FrameworkElement.Loaded"> | |||||
<BeginStoryboard Storyboard="{StaticResource STHide}" /> | |||||
</EventTrigger> | |||||
<EventTrigger RoutedEvent="Expander.Expanded"> | |||||
<BeginStoryboard x:Name="STShow_BeginStoryboard" | |||||
Storyboard="{StaticResource STShow}" /> | |||||
</EventTrigger> | |||||
<EventTrigger RoutedEvent="Expander.Collapsed"> | |||||
<BeginStoryboard Storyboard="{StaticResource STHide}" /> | |||||
</EventTrigger> | |||||
<Trigger Property="IsMouseOver" Value="True"> | <Trigger Property="IsMouseOver" Value="True"> | ||||
<Setter Property="Background" Value=" #E1FFFF"/> | <Setter Property="Background" Value=" #E1FFFF"/> | ||||
</Trigger> | </Trigger> | ||||
@@ -247,15 +300,15 @@ | |||||
Background="{TemplateBinding Background}" SnapsToDevicePixels="True"> | Background="{TemplateBinding Background}" SnapsToDevicePixels="True"> | ||||
<Canvas x:Name="canvNormal" Visibility="Visible" | <Canvas x:Name="canvNormal" Visibility="Visible" | ||||
Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" | Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" | ||||
Background="{TemplateBinding Background}" SnapsToDevicePixels="True" Canvas.Left="-30"> | |||||
<Path Data="M 0 0 L 6 6 12 0 " Stroke="#FF37A0EA" StrokeThickness="2" Canvas.Left="5" Canvas.Top="10"/> | |||||
<Path Data="M 0 0 L 6 6 12 0 " Stroke="#FF37A0EA" StrokeThickness="2" Canvas.Left="5" Canvas.Top="15"/> | |||||
Background="{TemplateBinding Background}" SnapsToDevicePixels="True" Canvas.Right="30"> | |||||
<Path Data="M 0 0 L 6 6 12 0 " Stroke="#FF37A0EA" StrokeThickness="2" Canvas.Right="5" Canvas.Top="10"/> | |||||
<Path Data="M 0 0 L 6 6 12 0 " Stroke="#FF37A0EA" StrokeThickness="2" Canvas.Right="5" Canvas.Top="15"/> | |||||
</Canvas> | </Canvas> | ||||
<Canvas x:Name="canvChecked" Visibility="Hidden" | <Canvas x:Name="canvChecked" Visibility="Hidden" | ||||
Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" | Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" | ||||
Background="{TemplateBinding Background}" SnapsToDevicePixels="True" Canvas.Left="-30"> | |||||
<Path Data="M 0 0 L 6 -6 12 0 " Stroke="#FF37A0EA" StrokeThickness="2" Canvas.Left="5" Canvas.Top="15"/> | |||||
<Path Data="M 0 0 L 6 -6 12 0 " Stroke="#FF37A0EA" StrokeThickness="2" Canvas.Left="5" Canvas.Top="20"/> | |||||
Background="{TemplateBinding Background}" SnapsToDevicePixels="True" Canvas.Right="30"> | |||||
<Path Data="M 0 0 L 6 -6 12 0 " Stroke="#FF37A0EA" StrokeThickness="2" Canvas.Right="5" Canvas.Top="15"/> | |||||
<Path Data="M 0 0 L 6 -6 12 0 " Stroke="#FF37A0EA" StrokeThickness="2" Canvas.Right="5" Canvas.Top="20"/> | |||||
</Canvas> | </Canvas> | ||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" | <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" | ||||
@@ -263,7 +316,6 @@ | |||||
RecognizesAccessKey="True" | RecognizesAccessKey="True" | ||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" | SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" | ||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> | VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> | ||||
</Canvas> | </Canvas> | ||||
<ControlTemplate.Triggers> | <ControlTemplate.Triggers> | ||||
@@ -392,7 +444,7 @@ | |||||
<Setter Property="Template"> | <Setter Property="Template"> | ||||
<Setter.Value> | <Setter.Value> | ||||
<ControlTemplate TargetType="{x:Type ComboBox}"> | <ControlTemplate TargetType="{x:Type ComboBox}"> | ||||
<Border BorderThickness="0" CornerRadius="3" Width="{TemplateBinding Width}" Height="30" Background="{TemplateBinding Background}" > | |||||
<Border BorderThickness="1" BorderBrush="#CDC9C9 " CornerRadius="3" Width="{TemplateBinding Width}" Height="30" Background="{TemplateBinding Background}" > | |||||
<Grid > | <Grid > | ||||
<Grid.ColumnDefinitions> | <Grid.ColumnDefinitions> | ||||
<ColumnDefinition Width="3*"/> | <ColumnDefinition Width="3*"/> | ||||
@@ -585,7 +637,40 @@ | |||||
</Setter.Value> | </Setter.Value> | ||||
</Setter> | </Setter> | ||||
</Style> | </Style> | ||||
<Storyboard x:Key="Move0"> | |||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" | |||||
Storyboard.TargetName="contentRegion"> | |||||
<EasingDoubleKeyFrame KeyTime="0:0:0" Value="900"> | |||||
</EasingDoubleKeyFrame> | |||||
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"> | |||||
</EasingDoubleKeyFrame> | |||||
</DoubleAnimationUsingKeyFrames> | |||||
</Storyboard> | |||||
<Storyboard x:Key="Move1"> | |||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" | |||||
Storyboard.TargetName="contentRegion"> | |||||
<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="40"> | |||||
<EasingDoubleKeyFrame.EasingFunction> | |||||
<BackEase EasingMode="EaseInOut"/> | |||||
</EasingDoubleKeyFrame.EasingFunction> | |||||
</EasingDoubleKeyFrame> | |||||
</DoubleAnimationUsingKeyFrames> | |||||
</Storyboard> | |||||
<Storyboard x:Key="Move2"> | |||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" | |||||
Storyboard.TargetName="contentRegion"> | |||||
<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="80"> | |||||
<EasingDoubleKeyFrame.EasingFunction> | |||||
<BackEase EasingMode="EaseInOut"/> | |||||
</EasingDoubleKeyFrame.EasingFunction> | |||||
</EasingDoubleKeyFrame> | |||||
</DoubleAnimationUsingKeyFrames> | |||||
</Storyboard> | |||||
</Application.Resources> | </Application.Resources> | ||||
</Application> | </Application> |
@@ -1,4 +1,5 @@ | |||||
using System; | |||||
using BPASmartClient.Helper; | |||||
using System; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Configuration; | using System.Configuration; | ||||
using System.Data; | using System.Data; | ||||
@@ -13,5 +14,11 @@ namespace BPASmartClient.MilkWithTea | |||||
/// </summary> | /// </summary> | ||||
public partial class App : Application | public partial class App : Application | ||||
{ | { | ||||
protected override void OnStartup(StartupEventArgs e) | |||||
{ | |||||
base.OnStartup(e); | |||||
SystemHelper.GetInstance.CreateDesktopShortcut(); | |||||
} | |||||
} | } | ||||
} | } |
@@ -5,8 +5,14 @@ | |||||
<TargetFramework>net6.0-windows</TargetFramework> | <TargetFramework>net6.0-windows</TargetFramework> | ||||
<Nullable>enable</Nullable> | <Nullable>enable</Nullable> | ||||
<UseWPF>true</UseWPF> | <UseWPF>true</UseWPF> | ||||
<PackageIcon>hbl.ico</PackageIcon> | |||||
<ApplicationIcon>hbl.ico</ApplicationIcon> | |||||
</PropertyGroup> | </PropertyGroup> | ||||
<ItemGroup> | |||||
<Content Include="hbl.ico" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | <ItemGroup> | ||||
<ProjectReference Include="..\BPASmartClient.Business\BPASmartClient.Business.csproj" /> | <ProjectReference Include="..\BPASmartClient.Business\BPASmartClient.Business.csproj" /> | ||||
<ProjectReference Include="..\BPASmartClient.CustomResource\BPASmartClient.CustomResource.csproj" /> | <ProjectReference Include="..\BPASmartClient.CustomResource\BPASmartClient.CustomResource.csproj" /> | ||||
@@ -22,6 +28,10 @@ | |||||
<None Update="DeviceInfo.xml"> | <None Update="DeviceInfo.xml"> | ||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
</None> | </None> | ||||
<None Update="hbl.ico"> | |||||
<Pack>True</Pack> | |||||
<PackagePath>\</PackagePath> | |||||
</None> | |||||
</ItemGroup> | </ItemGroup> | ||||
</Project> | </Project> |
@@ -7,6 +7,7 @@ | |||||
xmlns:ccontrols="http://schemas.microsoft.com/expression/2010/drawing" | xmlns:ccontrols="http://schemas.microsoft.com/expression/2010/drawing" | ||||
mc:Ignorable="d" x:Name="circularProgress" | mc:Ignorable="d" x:Name="circularProgress" | ||||
Height="100" Width="100"> | Height="100" Width="100"> | ||||
<Grid x:Name="layout" Width="{Binding RelativeSource={RelativeSource Self}, Path=Width}" Height="100" > | <Grid x:Name="layout" Width="{Binding RelativeSource={RelativeSource Self}, Path=Width}" Height="100" > | ||||
<Ellipse Width="{Binding ElementName=layout, Path=Width}" | <Ellipse Width="{Binding ElementName=layout, Path=Width}" | ||||
Height="{Binding ElementName=layout, Path=Height}" | Height="{Binding ElementName=layout, Path=Height}" | ||||
@@ -19,6 +20,14 @@ | |||||
<Path.Effect> | <Path.Effect> | ||||
<DropShadowEffect Color="WhiteSmoke" ShadowDepth="0" BlurRadius="5"/> | <DropShadowEffect Color="WhiteSmoke" ShadowDepth="0" BlurRadius="5"/> | ||||
</Path.Effect> | </Path.Effect> | ||||
<Path.RenderTransform > | |||||
<RotateTransform CenterX="50" CenterY="50" x:Name="rotate"> | |||||
</RotateTransform> | |||||
</Path.RenderTransform> | |||||
</Path> | </Path> | ||||
<Viewbox Margin="20"> | <Viewbox Margin="20"> | ||||
@@ -10,6 +10,7 @@ using System.Windows.Data; | |||||
using System.Windows.Documents; | using System.Windows.Documents; | ||||
using System.Windows.Input; | using System.Windows.Input; | ||||
using System.Windows.Media; | using System.Windows.Media; | ||||
using System.Windows.Media.Animation; | |||||
using System.Windows.Media.Imaging; | using System.Windows.Media.Imaging; | ||||
using System.Windows.Navigation; | using System.Windows.Navigation; | ||||
using System.Windows.Shapes; | using System.Windows.Shapes; | ||||
@@ -53,7 +54,7 @@ namespace BPASmartClient.MilkWithTea.Control | |||||
{ | { | ||||
if (angle > 360) return; | if (angle > 360) return; | ||||
if (angle <= 0) return; | |||||
if (angle < 0) return; | |||||
int offset = 5; | int offset = 5; | ||||
if (angle > 359) angle = 359.8; | if (angle > 359) angle = 359.8; | ||||
@@ -65,12 +66,33 @@ namespace BPASmartClient.MilkWithTea.Control | |||||
double startPositionX = radius + offset; | double startPositionX = radius + offset; | ||||
double startPositionY = offset; | double startPositionY = offset; | ||||
if (angle > 180) | |||||
Storyboard sb = new Storyboard(); | |||||
DoubleAnimation yd1 = new DoubleAnimation();//实例化浮点动画 | |||||
cyclePath.RenderTransform = new RotateTransform();//设置为旋转动画 | |||||
cyclePath.RenderTransformOrigin = new Point(0.5, 0.5);//设置旋转的中心 | |||||
yd1.From = 0;//动画的起始值 | |||||
yd1.To = 360;//动画的结束值 | |||||
yd1.Duration = TimeSpan.FromSeconds(3);//动画的播放时间 | |||||
yd1.RepeatBehavior = RepeatBehavior.Forever;//设置动画循环播放 | |||||
Storyboard.SetTarget(yd1, cyclePath);//给故事板绑定动画 | |||||
Storyboard.SetTargetProperty(yd1, new PropertyPath("RenderTransform.Angle"));//动画的依赖属性 | |||||
sb.Children.Add(yd1);//故事板添加动画 | |||||
if (angle == 0) | |||||
{ | |||||
string Data = string.Format("M {0} {1} A {2} {2} 0 1 1 {3} {4}", startPositionX, startPositionY, radius, Math.Round(x, 2) + offset, Math.Round(y, 2) + offset); | |||||
this.cyclePath.Data = Geometry.Parse(Data); | |||||
sb.Begin();//播放动画 | |||||
} | |||||
else if (angle > 180) | |||||
{ | { | ||||
//string Data = string.Format("M {0} 0 A {0} {0} 0 1 1 {1} {2}", radius, Math.Round(x, 2), Math.Round(y, 2)); | //string Data = string.Format("M {0} 0 A {0} {0} 0 1 1 {1} {2}", radius, Math.Round(x, 2), Math.Round(y, 2)); | ||||
string Data = string.Format("M {0} {1} A {2} {2} 0 1 1 {3} {4}", startPositionX, startPositionY, radius, Math.Round(x, 2) + offset, Math.Round(y, 2) + offset); | string Data = string.Format("M {0} {1} A {2} {2} 0 1 1 {3} {4}", startPositionX, startPositionY, radius, Math.Round(x, 2) + offset, Math.Round(y, 2) + offset); | ||||
this.cyclePath.Data = Geometry.Parse(Data); | this.cyclePath.Data = Geometry.Parse(Data); | ||||
sb.Stop(); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
@@ -80,7 +102,10 @@ namespace BPASmartClient.MilkWithTea.Control | |||||
string Data = string.Format("M {0} {1} A {2} {2} 0 0 1 {3} {4}", startPositionX, startPositionY, radius, Math.Round(x, 2) + offset, Math.Round(y, 2) + offset); | string Data = string.Format("M {0} {1} A {2} {2} 0 0 1 {3} {4}", startPositionX, startPositionY, radius, Math.Round(x, 2) + offset, Math.Round(y, 2) + offset); | ||||
this.cyclePath.Data = Geometry.Parse(Data); | this.cyclePath.Data = Geometry.Parse(Data); | ||||
sb.Stop(); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -1,4 +1,5 @@ | |||||
using Model; | |||||
using BPASmartClient.Model; | |||||
using Model; | |||||
using Newtonsoft.Json; | using Newtonsoft.Json; | ||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
@@ -19,6 +20,10 @@ namespace BPASmartClient.MilkWithTea | |||||
public static bool makeEnable = false; | public static bool makeEnable = false; | ||||
public static ObservableCollection<LocalTeaWithMilkConfig> MaterialRecipes { get; set; } = new ObservableCollection<LocalTeaWithMilkConfig>(); | public static ObservableCollection<LocalTeaWithMilkConfig> MaterialRecipes { get; set; } = new ObservableCollection<LocalTeaWithMilkConfig>(); | ||||
/// <summary> | |||||
/// 设备信息列表 | |||||
/// </summary> | |||||
public static ObservableCollection<DeviceConfigModelJson> deviceConfig { get; set; } = new ObservableCollection<DeviceConfigModelJson>(); | |||||
/// <summary> | /// <summary> | ||||
@@ -12,6 +12,7 @@ | |||||
<vm:MainWindowVeiwModel/> | <vm:MainWindowVeiwModel/> | ||||
</Window.DataContext> | </Window.DataContext> | ||||
<Window.Resources> | <Window.Resources> | ||||
<Style x:Key="menuButtonTemplate" TargetType="{x:Type Button}"> | <Style x:Key="menuButtonTemplate" TargetType="{x:Type Button}"> | ||||
<Setter Property="Focusable" Value="False"/> | <Setter Property="Focusable" Value="False"/> | ||||
<Setter Property="Background" Value="Transparent"/> | <Setter Property="Background" Value="Transparent"/> | ||||
@@ -27,7 +28,7 @@ | |||||
<Setter Property="FontFamily" Value="/BPASmartClient.CustomResource;component/Fonts/MT/#iconfont"/> | <Setter Property="FontFamily" Value="/BPASmartClient.CustomResource;component/Fonts/MT/#iconfont"/> | ||||
<Setter Property="Template"> | <Setter Property="Template"> | ||||
<Setter.Value> | <Setter.Value> | ||||
<ControlTemplate TargetType="{x:Type Button}"> | |||||
<ControlTemplate TargetType="{x:Type Button}" > | |||||
<Border x:Name="border" CornerRadius="10" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"> | <Border x:Name="border" CornerRadius="10" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"> | ||||
<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> | <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> | ||||
</Border> | </Border> | ||||
@@ -54,7 +55,9 @@ | |||||
</Trigger> | </Trigger> | ||||
</ControlTemplate.Triggers> | </ControlTemplate.Triggers> | ||||
</ControlTemplate> | </ControlTemplate> | ||||
</Setter.Value> | </Setter.Value> | ||||
</Setter> | </Setter> | ||||
</Style> | </Style> | ||||
@@ -96,6 +99,7 @@ | |||||
<TextBlock Text="" Margin="5,0"/> | <TextBlock Text="" Margin="5,0"/> | ||||
<TextBlock Text="主页"/> | <TextBlock Text="主页"/> | ||||
</StackPanel> | </StackPanel> | ||||
</Button> | </Button> | ||||
<Button Grid.Row="3" Style="{StaticResource menuButtonTemplate}" Click="NavButton_Click" Tag="MessageLogInfo" Margin="0,20,0,20"> | <Button Grid.Row="3" Style="{StaticResource menuButtonTemplate}" Click="NavButton_Click" Tag="MessageLogInfo" Margin="0,20,0,20"> | ||||
<StackPanel Orientation="Horizontal"> | <StackPanel Orientation="Horizontal"> | ||||
@@ -126,9 +130,10 @@ | |||||
IsChecked="{Binding AutoStart}"/> | IsChecked="{Binding AutoStart}"/> | ||||
</Grid> | </Grid> | ||||
<Border Grid.Column="1" Grid.RowSpan="3" Background="Transparent"> | <Border Grid.Column="1" Grid.RowSpan="3" Background="Transparent"> | ||||
<Border Background="White" CornerRadius="20" BorderThickness="0"> | |||||
<Border Background="White" CornerRadius="20" BorderThickness="0" > | |||||
<Grid> | <Grid> | ||||
<ContentControl x:Name="contentRegion"> | <ContentControl x:Name="contentRegion"> | ||||
<local:MessageLogInfo/> | <local:MessageLogInfo/> | ||||
</ContentControl> | </ContentControl> | ||||
</Grid> | </Grid> | ||||
@@ -20,6 +20,7 @@ using System.Windows.Data; | |||||
using System.Windows.Documents; | using System.Windows.Documents; | ||||
using System.Windows.Input; | using System.Windows.Input; | ||||
using System.Windows.Media; | using System.Windows.Media; | ||||
using System.Windows.Media.Animation; | |||||
using System.Windows.Media.Imaging; | using System.Windows.Media.Imaging; | ||||
using System.Windows.Navigation; | using System.Windows.Navigation; | ||||
using System.Windows.Shapes; | using System.Windows.Shapes; | ||||
@@ -40,6 +41,10 @@ namespace BPASmartClient.MilkWithTea | |||||
} | } | ||||
Storyboard sb = new Storyboard(); | |||||
DoubleAnimation yd1 = new DoubleAnimation();//实例化浮点动画 | |||||
DoubleAnimation yd2 = new DoubleAnimation(); | |||||
private void Initialize() | private void Initialize() | ||||
{ | { | ||||
@@ -196,6 +201,8 @@ namespace BPASmartClient.MilkWithTea | |||||
private void NavButton_Click(object sender, RoutedEventArgs e) | private void NavButton_Click(object sender, RoutedEventArgs e) | ||||
{ | { | ||||
FadeInOut(0, 1, 750, 0); | |||||
try | try | ||||
{ | { | ||||
if (sender is Button bt ) | if (sender is Button bt ) | ||||
@@ -203,6 +210,7 @@ namespace BPASmartClient.MilkWithTea | |||||
Type type = Type.GetType($"BPASmartClient.MilkWithTea.View.{bt.Tag?.ToString()}"); | Type type = Type.GetType($"BPASmartClient.MilkWithTea.View.{bt.Tag?.ToString()}"); | ||||
ConstructorInfo cti = type.GetConstructor(System.Type.EmptyTypes); | ConstructorInfo cti = type.GetConstructor(System.Type.EmptyTypes); | ||||
contentRegion.Content = (FrameworkElement)cti.Invoke(null); | contentRegion.Content = (FrameworkElement)cti.Invoke(null); | ||||
sb.Begin(); | |||||
} | } | ||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
@@ -210,5 +218,23 @@ namespace BPASmartClient.MilkWithTea | |||||
MessageLog.GetInstance.ShowEx($"BPASmartClient 中引发错误,MainWindow.xaml.cs 类MenuItem_Click(),描述:[{ex.Message}]"); | MessageLog.GetInstance.ShowEx($"BPASmartClient 中引发错误,MainWindow.xaml.cs 类MenuItem_Click(),描述:[{ex.Message}]"); | ||||
} | } | ||||
} | } | ||||
private void FadeInOut(double opactityFrom ,double opactityTo,double yForm,double yTo) | |||||
{ | |||||
contentRegion.RenderTransform = new TranslateTransform(); | |||||
yd1.From = opactityFrom;//动画的起始值 | |||||
yd1.To = opactityTo;//动画的结束值 | |||||
yd1.Duration = TimeSpan.FromSeconds(0.8); | |||||
Storyboard.SetTarget(yd1, contentRegion);//给故事板绑定动画 | |||||
Storyboard.SetTargetProperty(yd1, new PropertyPath("Opacity"));//动画的依赖属性 | |||||
yd2.From = yForm;//动画的起始值 | |||||
yd2.To = yTo;//动画的结束值 | |||||
yd2.Duration = TimeSpan.FromSeconds(0.5); | |||||
Storyboard.SetTarget(yd2, contentRegion);//给故事板绑定动画 | |||||
Storyboard.SetTargetProperty(yd2, new PropertyPath("(UIElement.RenderTransform).(TranslateTransform.Y)"));//动画的依赖属性 | |||||
sb.Children.Add(yd1);//故事板添加动画 | |||||
sb.Children.Add(yd2); | |||||
} | |||||
} | } | ||||
} | } |
@@ -14,7 +14,6 @@ | |||||
<Style TargetType="{x:Type DataGridCell}"> | <Style TargetType="{x:Type DataGridCell}"> | ||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/> | <Setter Property="FocusVisualStyle" Value="{x:Null}"/> | ||||
<Setter Property="TextBlock.FontSize" Value="13" /> | <Setter Property="TextBlock.FontSize" Value="13" /> | ||||
<Setter Property="Padding" Value="10" /> | |||||
<Setter Property="Background" Value="Transparent"/> | <Setter Property="Background" Value="Transparent"/> | ||||
<Setter Property="BorderBrush" Value="Transparent"/> | <Setter Property="BorderBrush" Value="Transparent"/> | ||||
<Setter Property="BorderThickness" Value="0"/> | <Setter Property="BorderThickness" Value="0"/> | ||||
@@ -31,24 +30,6 @@ | |||||
</Setter.Value> | </Setter.Value> | ||||
</Setter> | </Setter> | ||||
<Style.Triggers> | <Style.Triggers> | ||||
<Trigger Property="IsKeyboardFocusWithin" Value="True"> | |||||
<Setter Property="BorderBrush" Value="Black"/> | |||||
</Trigger> | |||||
<MultiTrigger> | |||||
<MultiTrigger.Conditions> | |||||
<Condition Property="IsSelected" Value="True"/> | |||||
<Condition Property="Selector.IsSelectionActive" Value="False"/> | |||||
</MultiTrigger.Conditions> | |||||
<Setter Property="Background" Value="Black"/> | |||||
</MultiTrigger> | |||||
<MultiTrigger> | |||||
<MultiTrigger.Conditions> | |||||
<Condition Property="IsSelected" Value="True"/> | |||||
<Condition Property="Selector.IsSelectionActive" Value="True"/> | |||||
</MultiTrigger.Conditions> | |||||
<Setter Property="Foreground" Value="#666666"/> | |||||
<Setter Property="Background" Value="Black" /> | |||||
</MultiTrigger> | |||||
<Trigger Property="IsEnabled" Value="False"> | <Trigger Property="IsEnabled" Value="False"> | ||||
<Setter Property="Opacity" Value=".56"/> | <Setter Property="Opacity" Value=".56"/> | ||||
</Trigger> | </Trigger> | ||||
@@ -68,7 +49,7 @@ | |||||
</Trigger> | </Trigger> | ||||
<Trigger Property="IsMouseOver" Value="True"> | <Trigger Property="IsMouseOver" Value="True"> | ||||
<Setter Property="Background" Value="#F0FFFF" /> | |||||
<Setter Property="Background" Value="#87CEFA" /> | |||||
</Trigger> | </Trigger> | ||||
</Style.Triggers> | </Style.Triggers> | ||||
</Style> | </Style> | ||||
@@ -97,11 +78,9 @@ | |||||
</Setter.Value> | </Setter.Value> | ||||
</Setter> | </Setter> | ||||
</Style> | </Style> | ||||
</UserControl.Resources> | </UserControl.Resources> | ||||
<Grid Background="#F3F6F9" Margin="20"> | <Grid Background="#F3F6F9" Margin="20"> | ||||
<ScrollViewer VerticalScrollBarVisibility="Auto"> | |||||
<ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible"> | |||||
<StackPanel> | <StackPanel> | ||||
<!--奶茶配方录入--> | <!--奶茶配方录入--> | ||||
<Expander Style="{StaticResource ExpanderStyle}"> | <Expander Style="{StaticResource ExpanderStyle}"> | ||||
@@ -121,7 +100,7 @@ | |||||
<Button Content="保存" Margin="10,0" Width="80" Command="{Binding SaveRecipeCommand}" Style="{StaticResource buttonNormal}"/> | <Button Content="保存" Margin="10,0" Width="80" Command="{Binding SaveRecipeCommand}" Style="{StaticResource buttonNormal}"/> | ||||
<Button Content="清空" Margin="10,0" Width="80" Command="{Binding RecipeCancelCommand}" Style="{StaticResource buttonNormal}"/> | <Button Content="清空" Margin="10,0" Width="80" Command="{Binding RecipeCancelCommand}" Style="{StaticResource buttonNormal}"/> | ||||
</StackPanel> | </StackPanel> | ||||
<DataGrid Grid.Row="1" Margin="100,5,100,20" AutoGenerateColumns="False" RowHeight="30" ItemsSource="{Binding materialRecipes}" | |||||
<DataGrid Grid.Row="1" Margin="100,5,100,20" AutoGenerateColumns="False" RowHeight="32" ItemsSource="{Binding materialRecipes}" | |||||
x:Name="recipeDataGrid" | x:Name="recipeDataGrid" | ||||
FrozenColumnCount="1" | FrozenColumnCount="1" | ||||
VerticalAlignment="Center" HorizontalAlignment="Center" | VerticalAlignment="Center" HorizontalAlignment="Center" | ||||
@@ -141,9 +120,10 @@ | |||||
<DataGridTemplateColumn Header="配料" Width="200"> | <DataGridTemplateColumn Header="配料" Width="200"> | ||||
<DataGridTemplateColumn.CellTemplate > | <DataGridTemplateColumn.CellTemplate > | ||||
<DataTemplate> | <DataTemplate> | ||||
<ComboBox x:Name="combox" FontSize="16" Width="100" | |||||
<ComboBox x:Name="combox" FontSize="16" Width="100" VerticalContentAlignment="Top" | |||||
ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.MaterailList}" | ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.MaterailList}" | ||||
IsReadOnly="True" Style="{StaticResource cmbstyle}" Height="30" | IsReadOnly="True" Style="{StaticResource cmbstyle}" Height="30" | ||||
SelectedIndex="1" | |||||
SelectedValue="{Binding Material ,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> | SelectedValue="{Binding Material ,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> | ||||
</DataTemplate> | </DataTemplate> | ||||
</DataGridTemplateColumn.CellTemplate> | </DataGridTemplateColumn.CellTemplate> | ||||
@@ -190,13 +170,13 @@ | |||||
<ColumnDefinition Width="*"/> | <ColumnDefinition Width="*"/> | ||||
<ColumnDefinition Width="*"/> | <ColumnDefinition Width="*"/> | ||||
</Grid.ColumnDefinitions> | </Grid.ColumnDefinitions> | ||||
<Button Content="更新物料位置名称" Grid.ColumnSpan="2" Style="{StaticResource buttonNormal}" Height="34" Width="200" Command="{Binding UpdateMaterialPosionCommand}"/> | |||||
<DataGrid Grid.Row="1" Margin="100,5" AutoGenerateColumns="False" ItemsSource="{Binding materail1,Mode=TwoWay}" | |||||
FrozenColumnCount="1" RowHeight="30" | |||||
VerticalAlignment="Top" HorizontalAlignment="Center" | |||||
IsReadOnly="True" | |||||
CanUserResizeColumns="False" CanUserResizeRows="False" SelectionMode="Single" | |||||
CanUserReorderColumns="False" AlternationCount="2" RowHeaderWidth="0" CanUserAddRows="False"> | |||||
<Button Content="保存物料位置名称" Grid.ColumnSpan="2" Style="{StaticResource buttonNormal}" Height="34" Width="200" Command="{Binding UpdateMaterialPosionCommand}"/> | |||||
<DataGrid Grid.Row="1" Margin="50,5" AutoGenerateColumns="False" ItemsSource="{Binding materail1,Mode=TwoWay}" | |||||
FrozenColumnCount="1" RowHeight="34" | |||||
VerticalAlignment="Top" HorizontalAlignment="Right" | |||||
IsReadOnly="True" | |||||
CanUserResizeColumns="False" CanUserResizeRows="False" SelectionMode="Single" | |||||
CanUserReorderColumns="False" AlternationCount="2" RowHeaderWidth="0" CanUserAddRows="False"> | |||||
<DataGrid.Columns> | <DataGrid.Columns> | ||||
<DataGridTemplateColumn Header="物料位置" Width="170"> | <DataGridTemplateColumn Header="物料位置" Width="170"> | ||||
<DataGridTemplateColumn.CellTemplate> | <DataGridTemplateColumn.CellTemplate> | ||||
@@ -214,16 +194,17 @@ | |||||
<DataTemplate> | <DataTemplate> | ||||
<TextBox Text="{Binding MaterialName ,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | <TextBox Text="{Binding MaterialName ,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | ||||
VerticalAlignment="Center" HorizontalContentAlignment="Center" | VerticalAlignment="Center" HorizontalContentAlignment="Center" | ||||
Margin="2" | |||||
Width="160" FontSize="16"/> | |||||
VerticalContentAlignment="Center" | |||||
Margin="2" FontSize="16" | |||||
Width="160" Height="28" /> | |||||
</DataTemplate> | </DataTemplate> | ||||
</DataGridTemplateColumn.CellTemplate> | </DataGridTemplateColumn.CellTemplate> | ||||
</DataGridTemplateColumn> | </DataGridTemplateColumn> | ||||
</DataGrid.Columns> | </DataGrid.Columns> | ||||
</DataGrid> | </DataGrid> | ||||
<DataGrid Grid.Row="1" Grid.Column="1" Margin="100,5" AutoGenerateColumns="False" ItemsSource="{Binding materail2,Mode=TwoWay}" | |||||
FrozenColumnCount="1" RowHeight="30" | |||||
VerticalAlignment="Top" HorizontalAlignment="Center" | |||||
<DataGrid Grid.Row="1" Grid.Column="1" Margin="50,5" AutoGenerateColumns="False" ItemsSource="{Binding materail2,Mode=TwoWay}" | |||||
FrozenColumnCount="1" RowHeight="34" | |||||
VerticalAlignment="Top" HorizontalAlignment="Left" | |||||
IsReadOnly="True" | IsReadOnly="True" | ||||
CanUserResizeColumns="False" CanUserResizeRows="False" SelectionMode="Single" | CanUserResizeColumns="False" CanUserResizeRows="False" SelectionMode="Single" | ||||
CanUserReorderColumns="False" AlternationCount="2" RowHeaderWidth="0" CanUserAddRows="False"> | CanUserReorderColumns="False" AlternationCount="2" RowHeaderWidth="0" CanUserAddRows="False"> | ||||
@@ -243,8 +224,9 @@ | |||||
<DataGridTemplateColumn.CellTemplate> | <DataGridTemplateColumn.CellTemplate> | ||||
<DataTemplate> | <DataTemplate> | ||||
<TextBox Text="{Binding MaterialName ,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | <TextBox Text="{Binding MaterialName ,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | ||||
VerticalAlignment="Center" HorizontalContentAlignment="Center" | |||||
Margin="2" | |||||
VerticalAlignment="Center" HorizontalContentAlignment="Center" | |||||
VerticalContentAlignment="Center" | |||||
Margin="2" Height="28" | |||||
Width="160" FontSize="16"/> | Width="160" FontSize="16"/> | ||||
</DataTemplate> | </DataTemplate> | ||||
</DataGridTemplateColumn.CellTemplate> | </DataGridTemplateColumn.CellTemplate> | ||||
@@ -260,7 +242,7 @@ | |||||
<TextBlock Text="本地奶茶配方"/> | <TextBlock Text="本地奶茶配方"/> | ||||
</Expander.Header> | </Expander.Header> | ||||
<Expander.Content> | <Expander.Content> | ||||
<DataGrid Grid.Row="4" Margin="100,5" AutoGenerateColumns="False" RowHeight="30" ItemsSource="{Binding localMaterialRecipes}" Width="500" | |||||
<DataGrid Grid.Row="4" Margin="100,5" AutoGenerateColumns="False" RowHeight="32" ItemsSource="{Binding localMaterialRecipes}" Width="500" | |||||
FrozenColumnCount="1" | FrozenColumnCount="1" | ||||
VerticalAlignment="Top" | VerticalAlignment="Top" | ||||
IsReadOnly="True" | IsReadOnly="True" | ||||
@@ -59,17 +59,14 @@ | |||||
<Style TargetType="DataGridRow"> | <Style TargetType="DataGridRow"> | ||||
<Setter Property="FontSize" Value="16"/> | <Setter Property="FontSize" Value="16"/> | ||||
<Setter Property="VerticalAlignment" Value="Center"/> | <Setter Property="VerticalAlignment" Value="Center"/> | ||||
<Setter Property="Height" Value="28"/> | |||||
<Setter Property="Height" Value="28"/> | |||||
<Style.Triggers> | <Style.Triggers> | ||||
<!-- 隔行换色 --> | |||||
<Trigger Property="AlternationIndex" Value="0"> | |||||
<Setter Property="Background" Value="#FFFAFAFA" /> | |||||
<Trigger Property="IsSelected" Value="True"> | |||||
<Setter Property="Foreground" Value="Black"/> | |||||
</Trigger> | </Trigger> | ||||
<Trigger Property="AlternationIndex" Value="1"> | |||||
<Setter Property="Background" Value="#FFF5F5F7" /> | |||||
</Trigger> | |||||
<Trigger Property="IsMouseOver" Value="True"> | <Trigger Property="IsMouseOver" Value="True"> | ||||
<Setter Property="Foreground" Value="White"/> | |||||
<Setter Property="Background" Value="#4fade8" /> | <Setter Property="Background" Value="#4fade8" /> | ||||
</Trigger> | </Trigger> | ||||
</Style.Triggers> | </Style.Triggers> | ||||
@@ -77,10 +74,6 @@ | |||||
</ResourceDictionary> | </ResourceDictionary> | ||||
</UserControl.Resources> | </UserControl.Resources> | ||||
<Grid Background="#F3F6F9" Margin="20"> | <Grid Background="#F3F6F9" Margin="20"> | ||||
<Grid.ColumnDefinitions> | <Grid.ColumnDefinitions> | ||||
@@ -98,7 +91,7 @@ | |||||
<DataGrid ItemsSource="{Binding orderStatusLists}" | <DataGrid ItemsSource="{Binding orderStatusLists}" | ||||
Grid.Row="1" AutoGenerateColumns="False" RowHeight="250" | Grid.Row="1" AutoGenerateColumns="False" RowHeight="250" | ||||
FrozenColumnCount="1" Margin="30,5" | FrozenColumnCount="1" Margin="30,5" | ||||
VerticalAlignment="Top" | |||||
VerticalAlignment="Top" ForceCursor="False" | |||||
IsReadOnly="True" | IsReadOnly="True" | ||||
CanUserResizeColumns="False" CanUserResizeRows="False" SelectionMode="Single" | CanUserResizeColumns="False" CanUserResizeRows="False" SelectionMode="Single" | ||||
CanUserReorderColumns="False" RowHeaderWidth="0" CanUserAddRows="False"> | CanUserReorderColumns="False" RowHeaderWidth="0" CanUserAddRows="False"> | ||||
@@ -106,11 +99,11 @@ | |||||
<DataGridTextColumn Header="取餐号" Binding="{Binding OrderPush.SortNum}" Width="*" | <DataGridTextColumn Header="取餐号" Binding="{Binding OrderPush.SortNum}" Width="*" | ||||
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"> | Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"> | ||||
</DataGridTextColumn> | </DataGridTextColumn> | ||||
<DataGridTextColumn Header="商品名" Binding="{Binding OrderPush.GoodsName}" Width="2*" /> | |||||
<DataGridTextColumn Header="开始时间" Binding="{Binding StartDate}" Width="2*"/> | |||||
<DataGridTextColumn Header="结束时间" Binding="{Binding EndDate}" Width="2*"/> | |||||
<DataGridTextColumn Header="制作状态" Binding="{Binding OrderStatus, Converter={StaticResource TextConverter}}" Width="2*"/> | |||||
<DataGridTextColumn Header="完成时间" Binding="{Binding CompleteDate}" Width="2*" /> | |||||
<DataGridTextColumn Header="商品名" Binding="{Binding OrderPush.GoodsName}" Width="2*" Foreground="Black" /> | |||||
<DataGridTextColumn Header="开始时间" Binding="{Binding StartDate}" Width="2*" Foreground="Black"/> | |||||
<DataGridTextColumn Header="结束时间" Binding="{Binding EndDate}" Width="2*" Foreground="Black"/> | |||||
<DataGridTextColumn Header="制作状态" Binding="{Binding OrderStatus, Converter={StaticResource TextConverter}}" Width="2*" Foreground="Black"/> | |||||
<DataGridTextColumn Header="完成时间" Binding="{Binding CompleteDate}" Width="2*" Foreground="Black" /> | |||||
</DataGrid.Columns> | </DataGrid.Columns> | ||||
</DataGrid> | </DataGrid> | ||||
</GroupBox> | </GroupBox> | ||||
@@ -172,7 +165,7 @@ | |||||
</Border> | </Border> | ||||
</Border> | </Border> | ||||
<TextBlock Text="奶茶" Grid.Row="2" Margin="20,10" FontSize="22" /> | <TextBlock Text="奶茶" Grid.Row="2" Margin="20,10" FontSize="22" /> | ||||
<TextBlock Text="配方" Grid.Row="2" Grid.Column="1" Margin="10" FontSize="22"/> | |||||
<TextBlock Text="配方" Grid.Row="2" Grid.Column="1" Margin="10" FontSize="22" /> | |||||
<Border BorderBrush="#D5DFE5" BorderThickness="4" Grid.Row="3" Margin="20,0,0,0"> | <Border BorderBrush="#D5DFE5" BorderThickness="4" Grid.Row="3" Margin="20,0,0,0"> | ||||
<ListBox ItemsSource="{Binding localTeaWithMilks}" SelectionChanged="ListBox_SelectionChanged" IsEnabled="{Binding MakeEnable}" | <ListBox ItemsSource="{Binding localTeaWithMilks}" SelectionChanged="ListBox_SelectionChanged" IsEnabled="{Binding MakeEnable}" | ||||
Foreground="LightSlateGray"> | Foreground="LightSlateGray"> | ||||
@@ -192,12 +185,15 @@ | |||||
Width="200" HorizontalAlignment="Left" Foreground="LightSlateGray"> | Width="200" HorizontalAlignment="Left" Foreground="LightSlateGray"> | ||||
<ListBox.ItemTemplate> | <ListBox.ItemTemplate> | ||||
<DataTemplate > | <DataTemplate > | ||||
<Grid> | |||||
<StackPanel Orientation="Horizontal"> | |||||
<TextBlock Text="{Binding Material}" Margin="20,10"/> | |||||
<TextBlock Text="{Binding MaterialWeight}" Margin="20,10,0,10"/> | |||||
<TextBlock Text="g" Margin="0,10"/> | |||||
</StackPanel> | |||||
<Grid Width="180"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition Width="*"/> | |||||
<ColumnDefinition Width="40"/> | |||||
<ColumnDefinition Width="15"/> | |||||
</Grid.ColumnDefinitions> | |||||
<TextBlock Text="{Binding Material}" Margin="20,10" FontSize="16"/> | |||||
<TextBlock Text="{Binding MaterialWeight}" Margin="5,10,0,10" Grid.Column="1" HorizontalAlignment="Left" /> | |||||
<TextBlock Text="g" Margin="0,10" HorizontalAlignment="Right" Grid.Column="2"/> | |||||
</Grid> | </Grid> | ||||
</DataTemplate> | </DataTemplate> | ||||
</ListBox.ItemTemplate> | </ListBox.ItemTemplate> | ||||
@@ -6,7 +6,7 @@ | |||||
xmlns:local="clr-namespace:BPASmartClient.MilkWithTea.View" | xmlns:local="clr-namespace:BPASmartClient.MilkWithTea.View" | ||||
xmlns:vm="clr-namespace:BPASmartClient.MilkWithTea.ViewModel" | xmlns:vm="clr-namespace:BPASmartClient.MilkWithTea.ViewModel" | ||||
mc:Ignorable="d" | mc:Ignorable="d" | ||||
d:DesignHeight="800" d:DesignWidth="1400" Background="Transparent" > | |||||
d:DesignHeight="900" d:DesignWidth="1400" Background="Transparent" > | |||||
<UserControl.DataContext> | <UserControl.DataContext> | ||||
<vm:PatrameterSettiongViewModel/> | <vm:PatrameterSettiongViewModel/> | ||||
</UserControl.DataContext> | </UserControl.DataContext> | ||||
@@ -25,10 +25,11 @@ | |||||
<ColumnDefinition Width="*"/> | <ColumnDefinition Width="*"/> | ||||
</Grid.ColumnDefinitions> | </Grid.ColumnDefinitions> | ||||
<Grid.RowDefinitions> | <Grid.RowDefinitions> | ||||
<RowDefinition Height="300"/> | |||||
<RowDefinition Height="*"/> | |||||
<RowDefinition Height="*"/> | |||||
<RowDefinition Height="*"/> | <RowDefinition Height="*"/> | ||||
</Grid.RowDefinitions> | </Grid.RowDefinitions> | ||||
<GroupBox Grid.ColumnSpan="2" Header="参数调试" FontSize="20" Style="{StaticResource GroupBoxStyle1}" Padding="40,20"> | |||||
<GroupBox Grid.ColumnSpan="2" Header="参数调试" FontSize="20" Style="{StaticResource GroupBoxStyle1}" Padding="40,20" Margin="20,10"> | |||||
<GroupItem> | <GroupItem> | ||||
<Grid> | <Grid> | ||||
<Grid.RowDefinitions> | <Grid.RowDefinitions> | ||||
@@ -37,29 +38,29 @@ | |||||
<RowDefinition Height="*"/> | <RowDefinition Height="*"/> | ||||
</Grid.RowDefinitions> | </Grid.RowDefinitions> | ||||
<StackPanel Orientation="Horizontal"> | <StackPanel Orientation="Horizontal"> | ||||
<TextBlock Text="通道口:"/> | |||||
<ComboBox ItemsSource="{Binding materialPosions}" | |||||
<TextBlock Text="通道口:"/> | |||||
<ComboBox ItemsSource="{Binding materialPosions}" | |||||
SelectedIndex="{Binding MaterialID ,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | SelectedIndex="{Binding MaterialID ,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | ||||
Margin="10,0" Width="120 " Style="{StaticResource cmbstyle}"/> | Margin="10,0" Width="120 " Style="{StaticResource cmbstyle}"/> | ||||
<TextBlock Text="出料量:" Margin="10,0,0,0" /> | |||||
<TextBox Text="{Binding OutMaterailWeight}" Width="60" Margin="10,0" VerticalContentAlignment="Center"/> | |||||
<TextBlock Text="g" Margin="2,0"/> | |||||
<Button Content="出料" Style="{StaticResource buttonNormal}" Height="36" Width="100" Margin="30,0" Command="{Binding OutMaterailCommad}"/> | |||||
<TextBlock Text="转盘位置:" Margin="60,0,10,0"/> | |||||
<ComboBox ItemsSource="{Binding TurntablePosion}" | |||||
<TextBlock Text="出料量:" Margin="10,0,0,0" /> | |||||
<TextBox Text="{Binding OutMaterailWeight}" Width="60" Margin="10,0" VerticalContentAlignment="Center"/> | |||||
<TextBlock Text="g" Margin="2,0"/> | |||||
<Button Content="出料" Style="{StaticResource buttonNormal}" Height="36" Width="100" Margin="30,0" Command="{Binding OutMaterailCommad}"/> | |||||
<TextBlock Text="转盘位置:" Margin="60,0,10,0"/> | |||||
<ComboBox ItemsSource="{Binding TurntablePosion}" | |||||
SelectedIndex="{Binding TurntableID,Mode=TwoWay ,UpdateSourceTrigger=PropertyChanged}" | SelectedIndex="{Binding TurntableID,Mode=TwoWay ,UpdateSourceTrigger=PropertyChanged}" | ||||
Margin="10,0" Width="100 " Style="{StaticResource cmbstyle}"/> | Margin="10,0" Width="100 " Style="{StaticResource cmbstyle}"/> | ||||
<Button Content="转动" Style="{StaticResource buttonNormal}" Height="36" Width="80" Margin="30,0" | |||||
<Button Content="转动" Style="{StaticResource buttonNormal}" Height="36" Width="80" Margin="30,0" | |||||
Command="{Binding TurntableCommad}"/> | Command="{Binding TurntableCommad}"/> | ||||
</StackPanel> | |||||
</StackPanel> | |||||
<CheckBox Grid.Row="2" Content="禁用本地奶茶下单" HorizontalAlignment="Left" Margin="0,10" | <CheckBox Grid.Row="2" Content="禁用本地奶茶下单" HorizontalAlignment="Left" Margin="0,10" | ||||
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" | HorizontalContentAlignment="Center" VerticalContentAlignment="Center" | ||||
IsChecked="{Binding IsEnable}"/> | IsChecked="{Binding IsEnable}"/> | ||||
</Grid> | </Grid> | ||||
</GroupItem> | </GroupItem> | ||||
</GroupBox> | </GroupBox> | ||||
<GroupBox Grid.ColumnSpan="2" Grid.Row="1" Header="通道矫正" FontSize="20" BorderThickness="10" Style="{StaticResource GroupBoxStyle1}"> | |||||
<GroupBox Grid.ColumnSpan="2" Grid.Row="1" Header="通道矫正" FontSize="20" BorderThickness="10" Style="{StaticResource GroupBoxStyle1}" Margin="20,10"> | |||||
<GroupItem> | <GroupItem> | ||||
<Grid Margin="20"> | <Grid Margin="20"> | ||||
<Grid.RowDefinitions> | <Grid.RowDefinitions> | ||||
@@ -109,5 +110,49 @@ | |||||
</Grid> | </Grid> | ||||
</GroupItem> | </GroupItem> | ||||
</GroupBox> | </GroupBox> | ||||
<GroupBox Grid.ColumnSpan="2" Grid.Row="2" Header="设备配置" FontSize="20" BorderThickness="10" Style="{StaticResource GroupBoxStyle1}" Margin="20,10"> | |||||
<Grid Margin="30,5"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition Width="100"/> | |||||
<ColumnDefinition Width="90"/> | |||||
<ColumnDefinition Width="110"/> | |||||
<ColumnDefinition Width="90"/> | |||||
<ColumnDefinition Width="60"/> | |||||
<ColumnDefinition Width="60"/> | |||||
<ColumnDefinition/> | |||||
</Grid.ColumnDefinitions> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="*"/> | |||||
<RowDefinition Height="*"/> | |||||
<RowDefinition Height="*"/> | |||||
<RowDefinition Height="*"/> | |||||
</Grid.RowDefinitions> | |||||
<TextBlock Text="店铺名称:" Grid.ColumnSpan="2" FontSize="22" Height="28" Width="94" HorizontalAlignment="Left" Margin="20,0"/> | |||||
<TextBox Text="{Binding ShopName}" Grid.Column="2" Grid.ColumnSpan="2" Margin="-20,10,30,10" VerticalContentAlignment="Center"/> | |||||
<TextBlock Text="店铺ID:" Grid.Row="1" Height="23" Width="60" HorizontalAlignment="Left" Margin="20,0"/> | |||||
<TextBlock Text="设备ID:" Grid.Column="2" Grid.Row="1" Height="23" Width="60" /> | |||||
<TextBlock Text="PLC地址:" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" Height="23" Width="72" HorizontalAlignment="Left" Margin="20,0"/> | |||||
<TextBox Text="{Binding ShopID}" Width="60" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left" VerticalContentAlignment="Center" Margin="0,12"/> | |||||
<TextBox Text="{Binding DeviceID}" Width="60" Grid.Column="3" Grid.Row="1" HorizontalAlignment="Left" VerticalContentAlignment="Center" Margin="0,12"/> | |||||
<TextBox Text="{Binding PLCAdress}" Grid.Column="2" Grid.Row="2" Grid.ColumnSpan="2" Margin="-20,10,30,10" | |||||
VerticalContentAlignment="Center"/> | |||||
<Button Style="{StaticResource buttonNormal}" | |||||
Grid.Column="4" Grid.ColumnSpan="2" Grid.Row="0" Grid.RowSpan="3" | |||||
Height="130" Width="80" | |||||
Command="{Binding SaveDevicesCommand}"> | |||||
<Grid> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="*"/> | |||||
<RowDefinition Height="10"/> | |||||
<RowDefinition Height="*"/> | |||||
</Grid.RowDefinitions> | |||||
<TextBlock Text="保存" TextWrapping="Wrap" Foreground="White" FontSize="20" /> | |||||
<TextBlock Text="配置" TextWrapping="Wrap" Foreground="White" FontSize="20" Grid.Row="2"/> | |||||
</Grid> | |||||
</Button> | |||||
</Grid> | |||||
</GroupBox> | |||||
</Grid> | </Grid> | ||||
</UserControl> | </UserControl> |
@@ -39,12 +39,14 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
/// 当前正在制作的奶茶 | /// 当前正在制作的奶茶 | ||||
/// </summary> | /// </summary> | ||||
public string CurrentGood { get { return _currentGood; } set { _currentGood = value; OnPropertyChanged(); } } | public string CurrentGood { get { return _currentGood; } set { _currentGood = value; OnPropertyChanged(); } } | ||||
private string _currentGood = "无"; | |||||
private string _currentGood = "茉莉花茶"; | |||||
/// <summary> | /// <summary> | ||||
/// 奶茶制作百分比 | /// 奶茶制作百分比 | ||||
/// </summary> | /// </summary> | ||||
public string MakePercent { get { return _makePercent; } set { _makePercent = value; OnPropertyChanged(); } } | public string MakePercent { get { return _makePercent; } set { _makePercent = value; OnPropertyChanged(); } } | ||||
private string _makePercent = "100"; | |||||
private string _makePercent = "0"; | |||||
/// <summary> | /// <summary> | ||||
/// 当前正在制作的奶茶 | /// 当前正在制作的奶茶 | ||||
@@ -56,6 +58,8 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
/// </summary> | /// </summary> | ||||
public RelayCommand MakeGoodCommand { get; set; } | public RelayCommand MakeGoodCommand { get; set; } | ||||
public MainControlViewModel() | public MainControlViewModel() | ||||
{ | { | ||||
MakeGoodCommand = new RelayCommand(new Action(() => | MakeGoodCommand = new RelayCommand(new Action(() => | ||||
@@ -63,32 +67,34 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
})); | })); | ||||
Init(); | Init(); | ||||
MorkOrderPush morkOrderPush = new MorkOrderPush() { GoodsName = "水果奶茶", SortNum = 1 }; | |||||
MorkOrderPush morkOrderPush = new MorkOrderPush() { GoodsName = "珍珠奶茶", SortNum = 1 }; | |||||
MorkOrderPush morkOrderPush1 = new MorkOrderPush() { GoodsName = "茉莉花茶", SortNum = 2 }; | |||||
MorkOrderPush morkOrderPush2 = new MorkOrderPush() { GoodsName = "芝芝梅梅", SortNum = 3 }; | |||||
orderStatusLists.Add(new MorkOrder() | orderStatusLists.Add(new MorkOrder() | ||||
{ | { | ||||
StartDate = "11",EndDate ="15",CompleteDate ="4",OrderStatus = ORDER_STATUS.COOKING, | |||||
StartDate = "11:20",EndDate ="11:24",CompleteDate ="4",OrderStatus = ORDER_STATUS.COMPLETED_COOK, | |||||
OrderPush = morkOrderPush | OrderPush = morkOrderPush | ||||
}); | }); | ||||
orderStatusLists.Add(new MorkOrder() | orderStatusLists.Add(new MorkOrder() | ||||
{ | { | ||||
StartDate = "11", | |||||
EndDate = "15", | |||||
StartDate = "11:36", | |||||
EndDate = "11:40", | |||||
CompleteDate = "4", | CompleteDate = "4", | ||||
OrderStatus = ORDER_STATUS.COOKING, | OrderStatus = ORDER_STATUS.COOKING, | ||||
OrderPush = morkOrderPush | |||||
OrderPush = morkOrderPush1 | |||||
}); | }); | ||||
orderStatusLists.Add(new MorkOrder() | orderStatusLists.Add(new MorkOrder() | ||||
{ | { | ||||
StartDate = "11", | |||||
EndDate = "15", | |||||
CompleteDate = "4", | |||||
OrderStatus = ORDER_STATUS.COOKING, | |||||
OrderPush = morkOrderPush | |||||
StartDate = "10:33", | |||||
EndDate = "10:28", | |||||
CompleteDate = "5", | |||||
OrderStatus = ORDER_STATUS.COMPLETED_TAKE, | |||||
OrderPush = morkOrderPush2 | |||||
}); | }); | ||||
@@ -1,4 +1,5 @@ | |||||
using BPASmartClient.Helper; | using BPASmartClient.Helper; | ||||
using BPASmartClient.Model; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | using Microsoft.Toolkit.Mvvm.ComponentModel; | ||||
using Model; | using Model; | ||||
using System; | using System; | ||||
@@ -31,6 +32,7 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
GLobal.posionPath = Path.Combine(path, "MaterialPosion.json"); | GLobal.posionPath = Path.Combine(path, "MaterialPosion.json"); | ||||
GLobal.MaterialRecipes = GLobal.GetJsonToT<LocalTeaWithMilkConfig>(GLobal.recipePath); | GLobal.MaterialRecipes = GLobal.GetJsonToT<LocalTeaWithMilkConfig>(GLobal.recipePath); | ||||
GLobal.deviceConfig = GLobal.GetJsonToT<DeviceConfigModelJson>($"{LocaPath.GetInstance().GetDeviceConfigPath}奶茶味魔方.json"); | |||||
} | } | ||||
} | } | ||||
@@ -1,10 +1,14 @@ | |||||
using BPASmartClient.Helper; | using BPASmartClient.Helper; | ||||
using BPASmartClient.Message; | |||||
using BPASmartClient.Model; | |||||
using BPASmartClient.MorkTM; | using BPASmartClient.MorkTM; | ||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | using Microsoft.Toolkit.Mvvm.ComponentModel; | ||||
using Microsoft.Toolkit.Mvvm.Input; | using Microsoft.Toolkit.Mvvm.Input; | ||||
using Newtonsoft.Json; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Collections.ObjectModel; | using System.Collections.ObjectModel; | ||||
using System.IO; | |||||
using System.Linq; | using System.Linq; | ||||
using System.Text; | using System.Text; | ||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
@@ -80,21 +84,39 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
/// </summary> | /// </summary> | ||||
public RelayCommand CheckMaterailWeightCommand { get; set; } | public RelayCommand CheckMaterailWeightCommand { get; set; } | ||||
public PatrameterSettiongViewModel() | |||||
{ | |||||
foreach(MaterialPosion materialPosion in Enum.GetValues(typeof(MaterialPosion))) | |||||
{ | |||||
materialPosions.Add(materialPosion); | |||||
} | |||||
#region 设备配置 | |||||
/// <summary> | |||||
/// 店铺名称 | |||||
/// </summary> | |||||
public string ShopName { get { return _shopName; } set { _shopName = value; OnPropertyChanged(); } } | |||||
private string _shopName; | |||||
/// <summary> | |||||
/// 店铺ID | |||||
/// </summary> | |||||
public string ShopID { get { return _shopID; } set { _shopID = value; OnPropertyChanged(); } } | |||||
private string _shopID; | |||||
/// <summary> | |||||
/// 设备ID | |||||
/// </summary> | |||||
public string DeviceID { get { return _deviceID; } set { _deviceID = value; OnPropertyChanged(); } } | |||||
private string _deviceID; | |||||
/// <summary> | |||||
/// PLC地址 | |||||
/// </summary> | |||||
public string PLCAdress { get { return _pLCAdress; } set { _pLCAdress = value; OnPropertyChanged(); } } | |||||
private string _pLCAdress; | |||||
foreach(OutMaterialPosion outMaterialPosion in Enum.GetValues(typeof(OutMaterialPosion))) | |||||
{ | |||||
TurntablePosion.Add(outMaterialPosion); | |||||
} | |||||
public RelayCommand SaveDevicesCommand { get; set; } | |||||
#endregion | |||||
public PatrameterSettiongViewModel() | |||||
{ | |||||
OutMaterailCommad = new RelayCommand(new Action(() => | OutMaterailCommad = new RelayCommand(new Action(() => | ||||
{ | { | ||||
ActionManage.GetInstance.Send("通道口出料", new object[] { MaterialID +1, OutMaterailWeight }); | ActionManage.GetInstance.Send("通道口出料", new object[] { MaterialID +1, OutMaterailWeight }); | ||||
})); | })); | ||||
TurntableCommad = new RelayCommand(new Action(() => | TurntableCommad = new RelayCommand(new Action(() => | ||||
@@ -118,6 +140,39 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
ActionManage.GetInstance.Send("矫正重量", new object[] { CorrectPassway + 1, CorrectMatetailWeight }); | ActionManage.GetInstance.Send("矫正重量", new object[] { CorrectPassway + 1, CorrectMatetailWeight }); | ||||
})); | })); | ||||
SaveDevicesCommand = new RelayCommand(SaveDeviceMessage); | |||||
init(); | |||||
} | |||||
private void init() | |||||
{ | |||||
foreach (MaterialPosion materialPosion in Enum.GetValues(typeof(MaterialPosion))) | |||||
{ | |||||
materialPosions.Add(materialPosion); | |||||
} | |||||
foreach (OutMaterialPosion outMaterialPosion in Enum.GetValues(typeof(OutMaterialPosion))) | |||||
{ | |||||
TurntablePosion.Add(outMaterialPosion); | |||||
} | |||||
ShopName = GLobal.deviceConfig.ElementAt(0).ShopName; | |||||
ShopID = GLobal.deviceConfig.ElementAt(0).ShopId; | |||||
DeviceID = GLobal.deviceConfig.ElementAt(0).deviceModels.ElementAt(0).DeviceId; | |||||
PLCAdress = GLobal.deviceConfig.ElementAt(0).deviceModels.ElementAt(0).communicationDevcies.ElementAt(0).communicationPar.IPAddress; | |||||
} | |||||
private void SaveDeviceMessage() | |||||
{ | |||||
if (GLobal.deviceConfig.Count > 0) | |||||
{ | |||||
GLobal.deviceConfig.ElementAt(0).ShopName = ShopName; | |||||
GLobal.deviceConfig.ElementAt(0).ShopId = ShopID; | |||||
GLobal.deviceConfig.ElementAt(0).deviceModels.ElementAt(0).DeviceId = DeviceID; | |||||
GLobal.deviceConfig.ElementAt(0).deviceModels.ElementAt(0).Id = Guid.NewGuid().ToString(); | |||||
GLobal.deviceConfig.ElementAt(0).deviceModels.ElementAt(0).communicationDevcies.ElementAt(0).communicationPar.IPAddress = PLCAdress; | |||||
File.WriteAllText($"{LocaPath.GetInstance().GetDeviceConfigPath}奶茶味魔方.json", JsonConvert.SerializeObject(GLobal.deviceConfig)); | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -6,6 +6,7 @@ | |||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="NModbus" Version="3.0.72" /> | <PackageReference Include="NModbus" Version="3.0.72" /> | ||||
<PackageReference Include="System.IO.Ports" Version="6.0.0" /> | |||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" /> | <PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
@@ -0,0 +1,225 @@ | |||||
using NModbus; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.IO.Ports; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.Modbus | |||||
{ | |||||
public class ModbusRTU | |||||
{ | |||||
#region 参数配置 | |||||
private static IModbusMaster master; | |||||
private static IModbusSerialMaster serialMaster; | |||||
private static ModbusFactory factory; | |||||
private static SerialPort port; | |||||
//写线圈或写寄存器数组 | |||||
private bool[] coilsBuffer; | |||||
private ushort[] registerBuffer; | |||||
//功能码 | |||||
private string functionCode; | |||||
//串口参数 | |||||
private string portName; | |||||
private int baudRate; | |||||
private Parity parity; | |||||
private int dataBits; | |||||
private StopBits stopBits; | |||||
#endregion | |||||
#region 串口配置 | |||||
/// <summary> | |||||
/// 串口参数获取 | |||||
/// </summary> | |||||
/// <returns></返回串口配置参数> | |||||
public void InitSerialPortParameter(string protName, int bauRate, string currentParity, int dataBits, string currentStopBits) | |||||
{ | |||||
switch (currentParity) | |||||
{ | |||||
case "奇": | |||||
parity = Parity.Odd; | |||||
break; | |||||
case "偶": | |||||
parity = Parity.Even; | |||||
break; | |||||
case "无": | |||||
parity = Parity.None; | |||||
break; | |||||
default: | |||||
break; | |||||
} | |||||
switch (currentStopBits) | |||||
{ | |||||
case "1": | |||||
stopBits = StopBits.One; | |||||
break; | |||||
case "2": | |||||
stopBits = StopBits.Two; | |||||
break; | |||||
default: | |||||
break; | |||||
} | |||||
port = new SerialPort(portName, baudRate, parity, dataBits, stopBits); | |||||
//master = factory.CreateMaster() | |||||
} | |||||
#endregion | |||||
#region 串口收/发 | |||||
public async void ExecuteFunctionRecive(string functionCode, byte slaveAddress, ushort startAddress, ushort numberOfPoints) | |||||
{ | |||||
try | |||||
{ | |||||
if (port.IsOpen == false) | |||||
{ | |||||
port.Open(); | |||||
} | |||||
if (functionCode != null) | |||||
{ | |||||
switch (functionCode) | |||||
{ | |||||
case "01 Read Coils"://读取单个线圈 | |||||
try | |||||
{ | |||||
coilsBuffer = master.ReadCoils(slaveAddress, startAddress, numberOfPoints); | |||||
} | |||||
catch (Exception) | |||||
{ | |||||
//MessageBox.Show(e.Message); | |||||
break; | |||||
} | |||||
break; | |||||
case "02 Read DisCrete Inputs"://读取输入线圈/离散量线圈 | |||||
try | |||||
{ | |||||
coilsBuffer = master.ReadInputs(slaveAddress, startAddress, numberOfPoints); | |||||
} | |||||
catch (Exception) | |||||
{ | |||||
break; | |||||
} | |||||
break; | |||||
case "03 Read Holding Registers"://读取保持寄存 | |||||
try | |||||
{ | |||||
registerBuffer = master.ReadHoldingRegisters(slaveAddress, startAddress, numberOfPoints); | |||||
} | |||||
catch (Exception) | |||||
{ | |||||
break; | |||||
} | |||||
break; | |||||
case "04 Read Input Registers"://读取输入寄存器 | |||||
try | |||||
{ | |||||
registerBuffer = master.ReadInputRegisters(slaveAddress, startAddress, numberOfPoints); | |||||
} | |||||
catch (Exception) | |||||
{ | |||||
break; | |||||
} | |||||
break; | |||||
default: | |||||
break; | |||||
} | |||||
} | |||||
port.Close(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
port.Close(); | |||||
} | |||||
} | |||||
public async void ExecuteFunctionSend(string data, byte slaveAddress, ushort startAddress) | |||||
{ | |||||
try | |||||
{ | |||||
if (port.IsOpen == false) | |||||
{ | |||||
port.Open(); | |||||
} | |||||
if (functionCode != null) | |||||
{ | |||||
switch (functionCode) | |||||
{ | |||||
case "05 Write Single Coil"://写单个线圈 | |||||
SetWriteParametes(data,true); | |||||
await master.WriteSingleCoilAsync(slaveAddress, startAddress, coilsBuffer[0]); | |||||
break; | |||||
case "06 Write Single Registers"://写单个输入线圈/离散量线圈 | |||||
SetWriteParametes(data,true); | |||||
await master.WriteSingleRegisterAsync(slaveAddress, startAddress, registerBuffer[0]); | |||||
break; | |||||
case "0F Write Multiple Coils"://写一组线圈 | |||||
SetWriteParametes(data); | |||||
await master.WriteMultipleCoilsAsync(slaveAddress, startAddress, coilsBuffer); | |||||
break; | |||||
case "10 Write Multiple Registers"://写一组保持寄存器 | |||||
SetWriteParametes(data); | |||||
await master.WriteMultipleRegistersAsync(slaveAddress, startAddress, registerBuffer); | |||||
break; | |||||
default: | |||||
break; | |||||
} | |||||
} | |||||
port.Close(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
port.Close(); | |||||
} | |||||
} | |||||
#endregion | |||||
/// <summary> | |||||
/// 设置写参数 | |||||
/// </summary> | |||||
private void SetWriteParametes(string data,bool isParametes =false) | |||||
{ | |||||
//判断是否写线圈 | |||||
if (isParametes) | |||||
{ | |||||
string[] strarr = data.Split(' '); | |||||
coilsBuffer = new bool[strarr.Length]; | |||||
//转化为bool数组 | |||||
for (int i = 0; i < strarr.Length; i++) | |||||
{ | |||||
// strarr[i] == "0" ? coilsBuffer[i] = false : coilsBuffer[i] = true; | |||||
if (strarr[i] == "0") | |||||
{ | |||||
coilsBuffer[i] = false; | |||||
} | |||||
else | |||||
{ | |||||
coilsBuffer[i] = true; | |||||
} | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
//转化ushort数组 | |||||
string[] strarr = data.Split(' '); | |||||
registerBuffer = new ushort[strarr.Length]; | |||||
for (int i = 0; i < strarr.Length; i++) | |||||
{ | |||||
registerBuffer[i] = ushort.Parse(strarr[i]); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} |
@@ -47,6 +47,7 @@ | |||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1264.42" /> | <PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1264.42" /> | ||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
</Project> | </Project> |
@@ -36,7 +36,7 @@ namespace BPASmartClient.MorkTM | |||||
Dictionary<int, float> res = new Dictionary<int, float>(); | Dictionary<int, float> res = new Dictionary<int, float>(); | ||||
res.Add(Convert.ToInt32(o[0]), Convert.ToSingle(o[1])); | res.Add(Convert.ToInt32(o[0]), Convert.ToSingle(o[1])); | ||||
SetMatertialWeight(res); | SetMatertialWeight(res); | ||||
Thread.Sleep(1000); | |||||
Thread.Sleep(100); | |||||
OpenUsePassageWay(Convert.ToInt32(o[0])); | OpenUsePassageWay(Convert.ToInt32(o[0])); | ||||
} | } | ||||
}), "通道口出料"); | }), "通道口出料"); | ||||
@@ -82,7 +82,7 @@ namespace BPASmartClient.MorkTM | |||||
{ | { | ||||
if (o != null && o is WritePar writePar) WriteData(writePar.Address, writePar.Value); | if (o != null && o is WritePar writePar) WriteData(writePar.Address, writePar.Value); | ||||
}), "WriteBools"); | }), "WriteBools"); | ||||
morkTM.ReachPosions = new List<bool>() { morkTM.ReachOutPosion_0, morkTM.ReachPosion_1, morkTM.ReachPosion_2, morkTM.ReachPosion_3, morkTM.ReachPosion_4, morkTM.ReachPosion_5, morkTM.ReachPosion_6 }; | |||||
morkTM.ReachPosions = new List<bool>() { morkTM.ReachPosion_1, morkTM.ReachPosion_2, morkTM.ReachPosion_3, morkTM.ReachPosion_4, morkTM.ReachPosion_5, morkTM.ReachPosion_6 , morkTM.ReachOutPosion_0, }; | |||||
DeviceProcessLogShow("设备初始化完成"); | DeviceProcessLogShow("设备初始化完成"); | ||||
@@ -170,11 +170,12 @@ namespace BPASmartClient.MorkTM | |||||
{ | { | ||||
if (morkTM.morkOrderPushesTeaWithMilk.TryDequeue(out OrderLocInfo orderLoc)) //&&原点位置是否有杯子) | if (morkTM.morkOrderPushesTeaWithMilk.TryDequeue(out OrderLocInfo orderLoc)) //&&原点位置是否有杯子) | ||||
{ | { | ||||
DeviceProcessLogShow($"开始制作奶茶{orderLoc.GoodName}"); | |||||
morkTM.MakeCount = 0; | morkTM.MakeCount = 0; | ||||
SetMatertialWeight(orderLoc.GoodPushes);//设置物料出料量 | SetMatertialWeight(orderLoc.GoodPushes);//设置物料出料量 | ||||
morkTM.RecipesPushes.Clear(); | morkTM.RecipesPushes.Clear(); | ||||
morkTM.RecipesPushes = orderLoc.GoodPushes; | morkTM.RecipesPushes = orderLoc.GoodPushes; | ||||
MakeProcess(orderLoc.GoodName, morkTM.MakeCount, morkTM.RecipesPushes.Count); | |||||
MakeProcess(orderLoc.GoodName, morkTM.MakeCount, morkTM.RecipesPushes.Count);//制作进度 | |||||
OrderChange(orderLoc.SuborderId, ORDER_STATUS.COOKING); | OrderChange(orderLoc.SuborderId, ORDER_STATUS.COOKING); | ||||
foreach (var item in morkTM.RecipesPushes) | foreach (var item in morkTM.RecipesPushes) | ||||
{ | { | ||||
@@ -189,9 +190,6 @@ namespace BPASmartClient.MorkTM | |||||
OrderChange(orderLoc.SuborderId, ORDER_STATUS.COMPLETED_COOK); | OrderChange(orderLoc.SuborderId, ORDER_STATUS.COMPLETED_COOK); | ||||
MakeProcess(orderLoc.GoodName, 1, 1); | MakeProcess(orderLoc.GoodName, 1, 1); | ||||
DeviceProcessLogShow($"奶茶{orderLoc.GoodName}制作完成"); | DeviceProcessLogShow($"奶茶{orderLoc.GoodName}制作完成"); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -240,7 +238,7 @@ namespace BPASmartClient.MorkTM | |||||
return; | return; | ||||
} | } | ||||
} | } | ||||
while(!morkTM.ReachPosions[i])//等待转盘到达信号 | |||||
while(!morkTM.ReachPosions[i-1])//等待转盘到达信号 | |||||
{ | { | ||||
Thread.Sleep(1000); | Thread.Sleep(1000); | ||||
} | } | ||||
@@ -284,13 +282,12 @@ namespace BPASmartClient.MorkTM | |||||
return ; | return ; | ||||
} | } | ||||
} | } | ||||
while(morkTM.ReachPosions[i-1]) | |||||
while(morkTM.ReachPosions[posion - 1]) | |||||
{ | { | ||||
Thread.Sleep(1000); | Thread.Sleep(1000); | ||||
} | } | ||||
WriteData(address,false); | WriteData(address,false); | ||||
DeviceProcessLogShow($"转盘转动到位置{i}"); | |||||
} | } | ||||
} | } | ||||
@@ -316,6 +313,7 @@ namespace BPASmartClient.MorkTM | |||||
private void CheckPassway(int passway,int time) | private void CheckPassway(int passway,int time) | ||||
{ | { | ||||
WriteData(polymer.PasswayPosionList[(MaterialPosion)passway], Convert.ToInt32(time * expand));//写入出料时间 | WriteData(polymer.PasswayPosionList[(MaterialPosion)passway], Convert.ToInt32(time * expand));//写入出料时间 | ||||
Thread.Sleep(100); | |||||
WriteData("M5.0", true);//开始校正 | WriteData("M5.0", true);//开始校正 | ||||
} | } | ||||
@@ -348,6 +346,7 @@ namespace BPASmartClient.MorkTM | |||||
{ | { | ||||
int value = Convert.ToInt32(material.Value*expand); | int value = Convert.ToInt32(material.Value*expand); | ||||
WriteData(polymer.MaterialPosionList[(MaterialPosion)material.Key], value); | WriteData(polymer.MaterialPosionList[(MaterialPosion)material.Key], value); | ||||
DeviceProcessLogShow($"通道{material.Key}预设料{material.Value}g"); | |||||
Thread.Sleep(200); | Thread.Sleep(200); | ||||
} | } | ||||
} | } | ||||
@@ -1,5 +1,7 @@ | |||||
using System; | |||||
using BPASmartClient.Helper; | |||||
using System; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Data; | |||||
using System.Linq; | using System.Linq; | ||||
using System.Text; | using System.Text; | ||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
@@ -15,7 +17,7 @@ namespace BPASmartClient.MorkTM | |||||
} | } | ||||
public enum OutMaterialPosion | public enum OutMaterialPosion | ||||
{ | { | ||||
出料位=0, 一号位 = 1, 二号位 = 2, 三号位 = 3, 四号位 = 4, 五号位 = 5, 六号位 = 6 | |||||
一号位 = 1, 二号位 = 2, 三号位 = 3, 四号位 = 4, 五号位 = 5, 六号位 = 6,出料位 = 0 | |||||
} | } | ||||
public class CommationPosionPLC | public class CommationPosionPLC | ||||
{ | { | ||||
@@ -34,7 +36,7 @@ namespace BPASmartClient.MorkTM | |||||
public class PolymerBatching | public class PolymerBatching | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 物料对应的plc点位 | |||||
/// 物料需求对应的plc点位 | |||||
/// </summary> | /// </summary> | ||||
public Dictionary<MaterialPosion, string> MaterialPosionList = new Dictionary<MaterialPosion, string>() | public Dictionary<MaterialPosion, string> MaterialPosionList = new Dictionary<MaterialPosion, string>() | ||||
{ | { | ||||
@@ -69,7 +71,7 @@ namespace BPASmartClient.MorkTM | |||||
}; | }; | ||||
/// <summary> | /// <summary> | ||||
/// 通道校正PLC点位 | |||||
/// 通道校正值PLC点位 | |||||
/// </summary> | /// </summary> | ||||
public Dictionary<MaterialPosion, string> PasswayPosionList = new Dictionary<MaterialPosion, string>() | public Dictionary<MaterialPosion, string> PasswayPosionList = new Dictionary<MaterialPosion, string>() | ||||
{ | { | ||||
@@ -108,48 +110,50 @@ namespace BPASmartClient.MorkTM | |||||
/// </summary> | /// </summary> | ||||
public List<CommationPosionPLC> TurnPosionPLCs = new List<CommationPosionPLC>() | public List<CommationPosionPLC> TurnPosionPLCs = new List<CommationPosionPLC>() | ||||
{ | { | ||||
new CommationPosionPLC("M4.0","M14.0",OutMaterialPosion.一号位), | |||||
new CommationPosionPLC("M4.1","M14.1",OutMaterialPosion.二号位), | |||||
new CommationPosionPLC("M4.2","M14.2",OutMaterialPosion.三号位), | |||||
new CommationPosionPLC("M4.3","M14.3",OutMaterialPosion.四号位), | |||||
new CommationPosionPLC("M4.4","M14.4",OutMaterialPosion.五号位), | |||||
new CommationPosionPLC("M4.5","M14.5",OutMaterialPosion.六号位), | |||||
//new CommationPosionPLC("M4.0","M14.0",OutMaterialPosion.一号位), | |||||
//new CommationPosionPLC("M4.1","M14.1",OutMaterialPosion.二号位), | |||||
//new CommationPosionPLC("M4.2","M14.2",OutMaterialPosion.三号位), | |||||
//new CommationPosionPLC("M4.3","M14.3",OutMaterialPosion.四号位), | |||||
//new CommationPosionPLC("M4.4","M14.4",OutMaterialPosion.五号位), | |||||
//new CommationPosionPLC("M4.5","M14.5",OutMaterialPosion.六号位), | |||||
}; | }; | ||||
/// <summary> | |||||
/// <summary> | |||||
/// plc出料点位 | /// plc出料点位 | ||||
/// </summary> | /// </summary> | ||||
public List<CommationPosionPLC> OutPosionPLCs = new List<CommationPosionPLC>() | public List<CommationPosionPLC> OutPosionPLCs = new List<CommationPosionPLC>() | ||||
{ | { | ||||
new CommationPosionPLC("M0.0","M10.0",MaterialPosion.Top1), | |||||
new CommationPosionPLC("M0.1","M10.1",MaterialPosion.Top2), | |||||
new CommationPosionPLC("M0.2","M10.2",MaterialPosion.Top3), | |||||
new CommationPosionPLC("M0.3","M10.3",MaterialPosion.Top4), | |||||
new CommationPosionPLC("M0.4","M10.4",MaterialPosion.Top5), | |||||
new CommationPosionPLC("M0.5","M10.5",MaterialPosion.Top6), | |||||
new CommationPosionPLC("M0.6","M10.6",MaterialPosion.Top7), | |||||
new CommationPosionPLC("M0.7","M10.7",MaterialPosion.Top8), | |||||
new CommationPosionPLC("M1.0","M11.0",MaterialPosion.Top9), | |||||
new CommationPosionPLC("M1.1","M11.1",MaterialPosion.Top10), | |||||
new CommationPosionPLC("M1.2","M11.2",MaterialPosion.Top11), | |||||
new CommationPosionPLC("M1.3","M11.3",MaterialPosion.Top12), | |||||
new CommationPosionPLC("M1.4","M11.4",MaterialPosion.Top13), | |||||
new CommationPosionPLC("M1.5","M11.5",MaterialPosion.Top14), | |||||
new CommationPosionPLC("M1.6","M11.6",MaterialPosion.Top15), | |||||
new CommationPosionPLC("M1.7","M11.7",MaterialPosion.Top16), | |||||
new CommationPosionPLC("M2.0","M12.0",MaterialPosion.Top17), | |||||
new CommationPosionPLC("M2.1","M12.1",MaterialPosion.Top18), | |||||
new CommationPosionPLC("M2.2","M12.2",MaterialPosion.Top19), | |||||
new CommationPosionPLC("M2.3","M12.3",MaterialPosion.Top20), | |||||
new CommationPosionPLC("M2.4","M12.4",MaterialPosion.Top21), | |||||
new CommationPosionPLC("M2.5","M12.5",MaterialPosion.Top22), | |||||
new CommationPosionPLC("M2.6","M12.6",MaterialPosion.Top23), | |||||
new CommationPosionPLC("M2.7","M12.7",MaterialPosion.Top24), | |||||
new CommationPosionPLC("M3.0","M13.0",MaterialPosion.Top25), | |||||
new CommationPosionPLC("M3.1","M13.1",MaterialPosion.Top26), | |||||
new CommationPosionPLC("M3.2","M13.2",MaterialPosion.Top27), | |||||
new CommationPosionPLC("M3.3","M13.3",MaterialPosion.Top28), | |||||
//new CommationPosionPLC("M0.0","M10.0",MaterialPosion.Top1), | |||||
//new CommationPosionPLC("M0.1","M10.1",MaterialPosion.Top2), | |||||
//new CommationPosionPLC("M0.2","M10.2",MaterialPosion.Top3), | |||||
//new CommationPosionPLC("M0.3","M10.3",MaterialPosion.Top4), | |||||
//new CommationPosionPLC("M0.4","M10.4",MaterialPosion.Top5), | |||||
//new CommationPosionPLC("M0.5","M10.5",MaterialPosion.Top6), | |||||
//new CommationPosionPLC("M0.6","M10.6",MaterialPosion.Top7), | |||||
//new CommationPosionPLC("M0.7","M10.7",MaterialPosion.Top8), | |||||
//new CommationPosionPLC("M1.0","M11.0",MaterialPosion.Top9), | |||||
//new CommationPosionPLC("M1.1","M11.1",MaterialPosion.Top10), | |||||
//new CommationPosionPLC("M1.2","M11.2",MaterialPosion.Top11), | |||||
//new CommationPosionPLC("M1.3","M11.3",MaterialPosion.Top12), | |||||
//new CommationPosionPLC("M1.4","M11.4",MaterialPosion.Top13), | |||||
//new CommationPosionPLC("M1.5","M11.5",MaterialPosion.Top14), | |||||
//new CommationPosionPLC("M1.6","M11.6",MaterialPosion.Top15), | |||||
//new CommationPosionPLC("M1.7","M11.7",MaterialPosion.Top16), | |||||
//new CommationPosionPLC("M2.0","M12.0",MaterialPosion.Top17), | |||||
//new CommationPosionPLC("M2.1","M12.1",MaterialPosion.Top18), | |||||
//new CommationPosionPLC("M2.2","M12.2",MaterialPosion.Top19), | |||||
//new CommationPosionPLC("M2.3","M12.3",MaterialPosion.Top20), | |||||
//new CommationPosionPLC("M2.4","M12.4",MaterialPosion.Top21), | |||||
//new CommationPosionPLC("M2.5","M12.5",MaterialPosion.Top22), | |||||
//new CommationPosionPLC("M2.6","M12.6",MaterialPosion.Top23), | |||||
//new CommationPosionPLC("M2.7","M12.7",MaterialPosion.Top24), | |||||
//new CommationPosionPLC("M3.0","M13.0",MaterialPosion.Top25), | |||||
//new CommationPosionPLC("M3.1","M13.1",MaterialPosion.Top26), | |||||
//new CommationPosionPLC("M3.2","M13.2",MaterialPosion.Top27), | |||||
//new CommationPosionPLC("M3.3","M13.3",MaterialPosion.Top28), | |||||
}; | }; | ||||
/// <summary> | |||||
/// 通道绑定出料位置 | |||||
/// </summary> | |||||
public void GetMaterialInfo() | public void GetMaterialInfo() | ||||
{ | { | ||||
List<MaterialPosion> materialPosions = Enum.GetValues(typeof(MaterialPosion)).Cast<MaterialPosion>().ToList(); | List<MaterialPosion> materialPosions = Enum.GetValues(typeof(MaterialPosion)).Cast<MaterialPosion>().ToList(); | ||||
@@ -168,9 +172,36 @@ namespace BPASmartClient.MorkTM | |||||
} | } | ||||
} | } | ||||
} | |||||
} | |||||
/// <summary> | |||||
/// 出料通道和出料口位置绑定集合 | |||||
/// 一号位(1,2,3,4,5),二号位(6,7,8,9,10),三号位(11,12,13,14),4号位(15,16,17,18),五号位(19,20,21,22,23),六号位(24,25,26,27,28) | |||||
/// </summary> | |||||
public Dictionary<List<MaterialPosion>, CommationPosionPLC> GoodsMaterialPosion = new Dictionary<List<MaterialPosion>, CommationPosionPLC>(); | public Dictionary<List<MaterialPosion>, CommationPosionPLC> GoodsMaterialPosion = new Dictionary<List<MaterialPosion>, CommationPosionPLC>(); | ||||
string Path = AppDomain.CurrentDomain.BaseDirectory + "AccessFile\\DeviceConfig\\PLCVars.csv"; | |||||
private void init() | |||||
{ | |||||
DataTable dt = ExcelHelper.ReadDataFromCSV(Path); | |||||
DataRowCollection dr = dt.Rows; | |||||
for (int i = 0; i < 28; i++) | |||||
{ | |||||
OutPosionPLCs.Add(new CommationPosionPLC(dr[i][0].ToString(), dr[i][2].ToString(), (MaterialPosion)i+1)); | |||||
} | |||||
for(int i = 28; i <34;i++) | |||||
{ | |||||
TurnPosionPLCs.Add(new CommationPosionPLC(dr[i][0].ToString(), dr[i][2].ToString(), (OutMaterialPosion)i - 27)); | |||||
} | |||||
} | |||||
public PolymerBatching() | |||||
{ | |||||
init(); | |||||
} | |||||
} | } | ||||
} | } |
@@ -0,0 +1,28 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | |||||
<PropertyGroup> | |||||
<TargetFramework>net6.0</TargetFramework> | |||||
<ImplicitUsings>enable</ImplicitUsings> | |||||
<Nullable>enable</Nullable> | |||||
</PropertyGroup> | |||||
<ItemGroup> | |||||
<None Remove="function.dll" /> | |||||
<None Remove="USB.dll" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<Content Include="function.dll"> | |||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |||||
</Content> | |||||
<Content Include="USB.dll"> | |||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |||||
</Content> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<ProjectReference Include="..\BPASmartClient.Helper\BPASmartClient.Helper.csproj" /> | |||||
<ProjectReference Include="..\BPASmartClient.Message\BPASmartClient.Message.csproj" /> | |||||
</ItemGroup> | |||||
</Project> |
@@ -0,0 +1,242 @@ | |||||
using BPASmartClient.Helper; | |||||
using BPASmartClient.Message; | |||||
using System.Text.RegularExpressions; | |||||
namespace BPASmartClient.Nfc | |||||
{ | |||||
public class NFCHelper | |||||
{ | |||||
private volatile static NFCHelper _Instance; | |||||
public static NFCHelper GetInstance => _Instance ?? (_Instance = new NFCHelper()); | |||||
private NFCHelper() { } | |||||
public ReadResult GetReadResult { get; set; } = new ReadResult(); | |||||
public Action Update { get; set; } | |||||
//转换卡号专用 | |||||
private byte[] convertSNR(string str, int keyN) | |||||
{ | |||||
string regex = "[^a-fA-F0-9]"; | |||||
string tmpJudge = Regex.Replace(str, regex, ""); | |||||
//长度不对,直接退回错误 | |||||
if (tmpJudge.Length != 12) return null; | |||||
string[] tmpResult = Regex.Split(str, regex); | |||||
byte[] result = new byte[keyN]; | |||||
int i = 0; | |||||
foreach (string tmp in tmpResult) | |||||
{ | |||||
result[i] = Convert.ToByte(tmp, 16); | |||||
i++; | |||||
} | |||||
return result; | |||||
} | |||||
//数据输入判断函数2个 | |||||
private string formatStr(string str, int num_blk) | |||||
{ | |||||
string tmp = Regex.Replace(str, "[^a-fA-F0-9]", ""); | |||||
//长度不对直接报错 | |||||
//num_blk==-1指示不用检查位数 | |||||
if (num_blk == -1) return tmp; | |||||
//num_blk==其它负数,为-1/num_blk | |||||
if (num_blk < -1) | |||||
{ | |||||
if (tmp.Length != -16 / num_blk * 2) return null; | |||||
else return tmp; | |||||
} | |||||
if (tmp.Length != 16 * num_blk * 2) return null; | |||||
else return tmp; | |||||
} | |||||
private void convertStr(byte[] after, string before, int length) | |||||
{ | |||||
for (int i = 0; i < length; i++) | |||||
{ | |||||
after[i] = Convert.ToByte(before.Substring(2 * i, 2), 16); | |||||
} | |||||
} | |||||
//显示命令执行结果 | |||||
private string showStatue(int Code) | |||||
{ | |||||
string msg = ""; | |||||
switch (Code) | |||||
{ | |||||
case 0x00: | |||||
msg = "命令执行成功"; | |||||
break; | |||||
case 0x01: | |||||
msg = "命令操作失败"; | |||||
break; | |||||
case 0x02: | |||||
msg = "地址校验错误"; | |||||
break; | |||||
case 0x03: | |||||
msg = "找不到已选择的端口"; | |||||
break; | |||||
case 0x04: | |||||
msg = "读写器返回超时"; | |||||
break; | |||||
case 0x05: | |||||
msg = "数据包流水号不正确"; | |||||
break; | |||||
case 0x07: | |||||
msg = "接收异常"; | |||||
break; | |||||
case 0x0A: | |||||
msg = "参数值超出范围"; | |||||
break; | |||||
case 0x80: | |||||
msg = "参数设置成功"; | |||||
break; | |||||
case 0x81: | |||||
msg = "参数设置失败"; | |||||
break; | |||||
case 0x82: | |||||
msg = "通讯超时"; | |||||
break; | |||||
case 0x83: | |||||
msg = "卡不存在"; | |||||
break; | |||||
case 0x84: | |||||
msg = "接收卡数据出错"; | |||||
break; | |||||
case 0x85: | |||||
msg = "未知的错误"; | |||||
break; | |||||
case 0x87: | |||||
msg = "输入参数或者输入命令格式错误"; | |||||
break; | |||||
case 0x89: | |||||
msg = "输入的指令代码不存在"; | |||||
break; | |||||
case 0x8A: | |||||
msg = "在对于卡块初始化命令中出现错误"; | |||||
break; | |||||
case 0x8B: | |||||
msg = "在防冲突过程中得到错误的序列号"; | |||||
break; | |||||
case 0x8C: | |||||
msg = "密码认证没通过"; | |||||
break; | |||||
case 0x8F: | |||||
msg = "读取器接收到未知命令"; | |||||
break; | |||||
case 0x90: | |||||
msg = "卡不支持这个命令"; | |||||
break; | |||||
case 0x91: | |||||
msg = "命令格式有错误"; | |||||
break; | |||||
case 0x92: | |||||
msg = "在命令的FLAG参数中,不支持OPTION 模式"; | |||||
break; | |||||
case 0x93: | |||||
msg = "要操作的BLOCK不存在"; | |||||
break; | |||||
case 0x94: | |||||
msg = "要操作的对象已经别锁定,不能进行修改"; | |||||
break; | |||||
case 0x95: | |||||
msg = "锁定操作不成功"; | |||||
break; | |||||
case 0x96: | |||||
msg = "写操作不成功"; | |||||
break; | |||||
default: | |||||
msg = "未知错误2"; | |||||
break; | |||||
} | |||||
return msg; | |||||
} | |||||
/// <summary> | |||||
/// 结果显示 | |||||
/// </summary> | |||||
/// <param name="text"></param> | |||||
/// <param name="data"></param> | |||||
/// <param name="s"></param> | |||||
/// <param name="e"></param> | |||||
private string showData(byte[] data, int s, int e) | |||||
{ | |||||
string res = string.Empty; | |||||
//非负转换 | |||||
for (int i = 0; i < e; i++) | |||||
{ | |||||
if (data[s + i] < 0) | |||||
data[s + i] = Convert.ToByte(Convert.ToInt32(data[s + i]) + 256); | |||||
} | |||||
for (int i = 0; i < e; i++) | |||||
{ | |||||
res += data[s + i].ToString("X2") + " "; | |||||
} | |||||
return res; | |||||
} | |||||
public void Init() | |||||
{ | |||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
{ | |||||
Read(); | |||||
if (GetReadResult.ErrorInfo.Length > 0) MessageLog.GetInstance.ShowDebugLog(GetReadResult.ErrorInfo); | |||||
Thread.Sleep(1000); | |||||
}), "NFC数据读取"); | |||||
} | |||||
public void Read(ReadKeyEnum readKeyEnum = ReadKeyEnum.KeyA, ReadTypeEnum readTypeEnum = ReadTypeEnum.Idle, byte ReadStart = 16, byte ReadNum = 1) | |||||
{ | |||||
//数据是一个64位的长整形,读取块的数量就是指第几个字 | |||||
if (ReadStart < 0 || ReadStart > 63) return; | |||||
if (ReadNum <= 0 || ReadNum > 4) return; | |||||
byte mode1 = (readKeyEnum == ReadKeyEnum.KeyB) ? (byte)0x01 : (byte)0x00; | |||||
byte mode2 = (readTypeEnum == ReadTypeEnum.All) ? (byte)0x01 : (byte)0x00; | |||||
byte mode = (byte)((mode1 << 1) | mode2); | |||||
byte blk_add = ReadStart; | |||||
byte num_blk = ReadNum; | |||||
//秘钥: | |||||
//第一组:FF FF FF FF FF FF | |||||
//第二组:B0 B1 B2 B3 B4 B5 | |||||
//第三组:A0 A1 A2 A3 A4 A5 | |||||
byte[] snr = new byte[6]; | |||||
snr = convertSNR("FF FF FF FF FF FF", 6); | |||||
if (snr == null) | |||||
{ | |||||
GetReadResult.ErrorInfo = "序列号无效!"; | |||||
return; | |||||
} | |||||
byte[] buffer = new byte[16 * num_blk]; | |||||
try | |||||
{ | |||||
int nRet = Reader.MF_Read(mode, blk_add, num_blk, snr, buffer); | |||||
GetReadResult.StatueCode = showStatue(nRet); | |||||
if (nRet != 0) | |||||
{ | |||||
GetReadResult.StatueCode = showStatue(buffer[0]); | |||||
GetReadResult.CardNum = string.Empty; | |||||
GetReadResult.Data = string.Empty; | |||||
} | |||||
else | |||||
{ | |||||
GetReadResult.CardNum = showData(snr, 0, 4); | |||||
GetReadResult.Data = showData(buffer, 0, 16 * num_blk); | |||||
} | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
GetReadResult.CardNum = string.Empty; | |||||
GetReadResult.Data = string.Empty; | |||||
MessageLog.GetInstance.ShowDebugLog(ex.ToString()); | |||||
} | |||||
finally | |||||
{ | |||||
Update?.Invoke(); | |||||
} | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,20 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.Nfc | |||||
{ | |||||
public enum ReadKeyEnum | |||||
{ | |||||
KeyA, | |||||
KeyB, | |||||
} | |||||
public enum ReadTypeEnum | |||||
{ | |||||
Idle, | |||||
All | |||||
} | |||||
} |
@@ -0,0 +1,16 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.Nfc | |||||
{ | |||||
public class ReadResult | |||||
{ | |||||
public string ErrorInfo { get; set; } = string.Empty; | |||||
public string CardNum { get; set; } = string.Empty; | |||||
public string StatueCode { get; set; } = string.Empty; | |||||
public string Data { get; set; } = string.Empty; | |||||
} | |||||
} |
@@ -0,0 +1,263 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Runtime.InteropServices; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.Nfc | |||||
{ | |||||
public class Reader | |||||
{ | |||||
/*System Setting*/ | |||||
[DllImport("function.dll")] | |||||
public static extern int SetSerNum(byte[] newValue, [In] byte[] buffer); | |||||
/* | |||||
函数功能:设置 8个字节的产品序列号。 | |||||
输入参数: 描述 | |||||
newValue 8个字节的读写器序列号 | |||||
buffer 用来返回接收到的数据的指针 | |||||
输出参数: | |||||
buffer 返回STATUS后的状态 | |||||
* 如果设置成功,则*buffer=0x 80 | |||||
如果设置失败,则*buffer为底层(读卡器单片机)上传的错误代码 | |||||
返回值: | |||||
0x00,设置成功 | |||||
0x01,设置失败 | |||||
*/ | |||||
[DllImport("function.dll")] | |||||
public static extern int GetSerNum([In] byte[] buffer); | |||||
/* | |||||
函数功能: | |||||
读取由厂家预设的1个字节的读卡器地址和8个字节序列号. | |||||
输入参数: | |||||
buffer 传入一个指针,用来返回接收到的数据 | |||||
输出参数: | |||||
buffer buffer[0] 读写器地址 | |||||
buffer[1...8] 8个字节的读写器序列号 | |||||
返回值: | |||||
0x00,操作成功 | |||||
0x01,操作失败 | |||||
*/ | |||||
[DllImport("function.dll")] | |||||
public static extern int GetVersionNum([In] byte[] strVersionNum); | |||||
/* | |||||
函数功能: | |||||
读取读写器的版本号. | |||||
输入参数: | |||||
VersionNum 待读入的版本号 | |||||
输出参数: | |||||
*VersionNum | |||||
* 如果 :操作失败, 则VersionNum [0] 为 错误代码 | |||||
如果 :操作成功, 则VersionNum [0..N] 为读入的版本号 | |||||
返回值: | |||||
0x00,操作成功 | |||||
0x01,操作失败 | |||||
*/ | |||||
[DllImport("function.dll")] | |||||
public static extern int ControlLED(int freq, int duration, [In] byte[] buffer); | |||||
/* | |||||
函数功能: 设置读卡器的错误提示 | |||||
输入参数: | |||||
buffer 待返回的参数 | |||||
输出参数: | |||||
buffer 如果 :操作失败, 则buffer [0] 为 错误代码(参考2.2) | |||||
如果 :操作成功, 则buffer [0] 为成功标志 ,即为0x80 | |||||
返回值: | |||||
0x00,操作成功, | |||||
0x01,操作失败 | |||||
*/ | |||||
[DllImport("function.dll")] | |||||
public static extern int ControlBuzzer(int freq, int duration, [In] byte[] buffer); | |||||
/* | |||||
函数功能: 控制读卡器的正确提示 | |||||
输入参数: | |||||
buffer 待返回的参数 | |||||
输出参数: | |||||
buffer 如果 :操作失败, 则buffer [0] 为 错误代码(参考2.2) | |||||
如果 :操作成功, 则buffer [0] 为成功标志 ,即为0x80 | |||||
返回值: | |||||
0x00,操作成功, | |||||
0x01,操作失败 | |||||
*/ | |||||
/*14443A-MF*/ | |||||
[DllImport("function.dll")] | |||||
public static extern int MF_Read(byte mode, byte blk_add, byte num_blk, [In] byte[] snr, [In] byte[] buffer); | |||||
[DllImport("function.dll")] | |||||
public static extern int MF_Write(byte mode, byte blk_add, byte num_blk, [In] byte[] snr, [In] byte[] buffer); | |||||
[DllImport("function.dll")] | |||||
public static extern int MF_InitValue(byte mode, byte SectNum, [In] byte[] snr, [In] byte[] value); | |||||
[DllImport("function.dll")] | |||||
public static extern int MF_Dec(byte mode, byte SectNum, [In] byte[] snr, [In] byte[] value); | |||||
[DllImport("function.dll")] | |||||
public static extern int MF_Inc(byte mode, byte SectNum, [In] byte[] snr, [In] byte[] value); | |||||
[DllImport("function.dll")] | |||||
public static extern int MF_Request([In] byte[] commHandle, int DeviceAdddress, byte inf_mode, [In] byte[] Buffer); | |||||
[DllImport("function.dll")] | |||||
public static extern int MF_Select([In] byte[] commHandle, int DeviiceAddress, byte inf_mode, [In] byte[] buffer); | |||||
[DllImport("function.dll")] | |||||
public static extern int MF_Halt(); | |||||
[DllImport("function.dll")] | |||||
public static extern int MF_Anticoll([In] byte[] commHandle, int DeviceAddress, [In] byte[] snr, [In] byte[] status); | |||||
[DllImport("function.dll")] | |||||
public static extern int MF_Restore([In] byte[] commHandle, int DeviceAddress, byte mode, byte cardlength, [In] byte[] carddata); | |||||
[DllImport("function.dll")] | |||||
public static extern int MF_Getsnr(int mode, int halt, [In] byte[] snr, [In] byte[] value); | |||||
/*Ultralight*/ | |||||
[DllImport("function.dll")] | |||||
public static extern int UL_Request(byte mode, [In] byte[] snr); | |||||
[DllImport("function.dll")] | |||||
public static extern int UL_HLRead(byte mode, byte blk_add, [In] byte[] snr, [In] byte[] buffer); | |||||
[DllImport("function.dll")] | |||||
public static extern int UL_HLWrite(byte mode, byte blk_add, [In] byte[] snr, [In] byte[] buffer); | |||||
/*ISO14443TypeB*/ | |||||
[DllImport("function.dll")] | |||||
public static extern int TypeB_Request([In] byte[] buffer); | |||||
[DllImport("function.dll")] | |||||
public static extern int TYPEB_SFZSNR(byte mode, byte halt, [In] byte[] snr, [In] byte[] value); | |||||
[DllImport("function.dll")] | |||||
public static extern int TypeB_TransCOS([In] byte[] cmd, int cmdSize, [In] byte[] buffer); | |||||
/*ISO15693*/ | |||||
[DllImport("function.dll")] | |||||
public static extern int ISO15693_Inventory([In] byte[] Cardnumber, [In] byte[] pBuffer); | |||||
/* | |||||
函数功能:此命令通过防冲突用于得到读卡区域内所有卡片的序列号(能得到的卡片数量与模块天线的输出功率有关,一般能对2~6卡进行防冲突) | |||||
输入参数: | |||||
Cardnumber 返回的卡的数量(一个字节) | |||||
pBuffer 返回的数据(包括FLAG和DSFID和8*n个字节的卡号) | |||||
输出参数: | |||||
如果:操作成功 | |||||
Cardnumber 返回的卡的数量(一个字节) | |||||
pBuffer 返回的数据(包括FLAG和DSFID和8*n个字节的卡号) | |||||
如果:操作失败,则*nrOfCard为错误代码 | |||||
返回值: | |||||
0x00,操作成功, | |||||
0x01,操作失败 | |||||
*/ | |||||
[DllImport("function.dll")] | |||||
public static extern int ISO15693_Read(byte flags, byte blk_add, byte num_blk, [In] byte[] uid, [In] byte[] buffer); | |||||
/* | |||||
函数功能: | |||||
用来读取1个或多个扇区的值,如果要读每个块的安全位, | |||||
将FLAGS中Option_flag置为1,即FLAG = 0X42,每个扇区将返回5个字节,包括1个表示安全状态字节和4个字节的块内容,这时候每次最多能读12个块。 | |||||
如果FLAG = 02,将只返回4字节的块内容,这时候每次最多能读63个块。 | |||||
输入参数: | |||||
flags 0x02 不带uid | |||||
0x22 带uid | |||||
0x42 不带uid但是要读安全位 | |||||
blk_add, 要读的起始块号 | |||||
num_blk, 块的数量 | |||||
*uid UID信息 | |||||
*buffer 返回值 | |||||
输出参数: | |||||
操作成功,buffer[0] 返回的flag buffer[1..N] Data | |||||
操作失败,buffer[0]为错误代码 | |||||
返回值: | |||||
0x00,操作成功, | |||||
0x01,操作失败 | |||||
*/ | |||||
[DllImport("function.dll")] | |||||
public static extern int ISO15693_Write(byte flag, byte blk_add, byte num_blk, [In] byte[] uid, [In] byte[] data); | |||||
/* | |||||
函数功能: 对一个块进行写操作(每次只能写一个块) | |||||
输入参数: | |||||
flags 0x02 不带uid | |||||
0x22 带uid | |||||
0x42 不带uid但是要读安全位 | |||||
blk_add, 要写的起始块号 | |||||
num_blk, 写的块的数量 | |||||
*uid UID信息 | |||||
*data 返回值 | |||||
输出参数: | |||||
如果:操作失败,则data[0]为错误代码 | |||||
返回值: | |||||
0x00,操作成功, | |||||
0x01,操作失败 | |||||
*/ | |||||
[DllImport("function.dll")] | |||||
public static extern int ISO15693_GetSysInfo(byte flag, [In] byte[] uid, [In] byte[] Buffer); | |||||
[DllImport("function.dll")] | |||||
public static extern int ISO15693_Lock(byte flags, byte num_blk, [In] byte[] uid, [In] byte[] buffer); | |||||
[DllImport("function.dll")] | |||||
public static extern int ISO15693_Select(byte flags, [In] byte[] uid, [In] byte[] buffer); | |||||
[DllImport("function.dll")] | |||||
public static extern int ISO15693_WriteAFI(byte flags, byte afi, [In] byte[] uid, [In] byte[] buffer); | |||||
[DllImport("function.dll")] | |||||
public static extern int ISO15693_LockAFI(byte flags, [In] byte[] uid, [In] byte[] buffer); | |||||
[DllImport("function.dll")] | |||||
public static extern int ISO15693_WriteDSFID(byte flags, byte DSFID, [In] byte[] uid, [In] byte[] buffer); | |||||
[DllImport("function.dll")] | |||||
public static extern int ISO15693_LockDSFID(byte flags, [In] byte[] uid, [In] byte[] buffer); | |||||
[DllImport("function.dll")] | |||||
public static extern int ISO15693_GetMulSecurity(byte flag, byte blkAddr, byte blkNum, [In] byte[] uid, [In] byte[] pBuffer); | |||||
} | |||||
} |
@@ -154,7 +154,7 @@ namespace BPASmartClient.SerialPort | |||||
{ | { | ||||
if (!IsHavePort) | if (!IsHavePort) | ||||
{ | { | ||||
MessageLog.GetInstance.Show($"{portName}连接失败"); | |||||
//MessageLog.GetInstance.Show("咖乐美咖啡机连接失败"); | |||||
return; | return; | ||||
} | } | ||||
if (comPort.IsOpen) comPort.Close(); | if (comPort.IsOpen) comPort.Close(); | ||||
@@ -164,7 +164,7 @@ namespace BPASmartClient.SerialPort | |||||
comPort.DataBits = (int)dataBits; | comPort.DataBits = (int)dataBits; | ||||
comPort.StopBits = stopBits; | comPort.StopBits = stopBits; | ||||
comPort.Open(); | comPort.Open(); | ||||
MessageLog.GetInstance.Show($"{portName}连接成功"); | |||||
//MessageLog.GetInstance.Show("咖乐美咖啡机连接成功"); | |||||
} | } | ||||
} | } | ||||
@@ -6,17 +6,17 @@ | |||||
<!--<add key="ClientId" value="43"/>--> | <!--<add key="ClientId" value="43"/>--> | ||||
<add key="IsEnableTest" value="false"/> | <add key="IsEnableTest" value="false"/> | ||||
<!--测试环境--> | |||||
<!--<add key="apollouri" value="http://10.2.1.21:28080/"/> | |||||
<!--测试环境--><!-- | |||||
<add key="apollouri" value="http://10.2.1.21:28080/"/> | |||||
<add key="AppId" value="test1_HostComputer"/> | <add key="AppId" value="test1_HostComputer"/> | ||||
<add key ="Namespaces" value="DEV.test1.Config"/>--> | <add key ="Namespaces" value="DEV.test1.Config"/>--> | ||||
<!--开发环境--> | |||||
<!--开发环境--><!-- | |||||
<add key="apollouri" value="http://10.2.1.21:28080/"/> | <add key="apollouri" value="http://10.2.1.21:28080/"/> | ||||
<add key="AppId" value="HostComputer"/> | <add key="AppId" value="HostComputer"/> | ||||
<add key ="Namespaces" value="DEV.Config"/> | |||||
<add key ="Namespaces" value="DEV.Config"/>--> | |||||
<!--正式环境--> | |||||
<!--正式环境--> | |||||
<add key="apollouri" value="http://47.108.65.220:28080/"/> | <add key="apollouri" value="http://47.108.65.220:28080/"/> | ||||
<add key="AppId" value="HostComputer"/> | <add key="AppId" value="HostComputer"/> | ||||
<add key ="Namespaces" value="TEST1.Config"/> | <add key ="Namespaces" value="TEST1.Config"/> | ||||
@@ -384,11 +384,11 @@ | |||||
Grid.Column="3" | Grid.Column="3" | ||||
Width="170" | Width="170" | ||||
HorizontalAlignment="Left" | HorizontalAlignment="Left" | ||||
Command="{Binding NewShopCommand}" | |||||
Content="新建店铺" | Content="新建店铺" | ||||
FontSize="16" | FontSize="16" | ||||
Foreground="{StaticResource TextBlockForeground}" | Foreground="{StaticResource TextBlockForeground}" | ||||
IcoText="" | IcoText="" | ||||
Command="{Binding NewShopCommand}" | |||||
Style="{StaticResource IcoButtonStyle}" /> | Style="{StaticResource IcoButtonStyle}" /> | ||||
<pry:IcoButton | <pry:IcoButton | ||||
@@ -4,14 +4,17 @@ using System.Collections.ObjectModel; | |||||
using System.Configuration; | using System.Configuration; | ||||
using System.Data; | using System.Data; | ||||
using System.Linq; | using System.Linq; | ||||
using System.Threading; | |||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
using System.Windows; | using System.Windows; | ||||
using BPASmartClient.CustomResource.Pages.Enums; | using BPASmartClient.CustomResource.Pages.Enums; | ||||
using BPASmartClient.CustomResource.Pages.Model; | using BPASmartClient.CustomResource.Pages.Model; | ||||
using BPASmartClient.CustomResource.Pages.View; | using BPASmartClient.CustomResource.Pages.View; | ||||
using BPASmartClient.CustomResource.Pages.ViewModel; | |||||
using BPASmartClient.DosingSystem.Model; | using BPASmartClient.DosingSystem.Model; | ||||
using BPASmartClient.DosingSystem.View; | using BPASmartClient.DosingSystem.View; | ||||
using BPASmartClient.Helper; | using BPASmartClient.Helper; | ||||
using BPASmartClient.Nfc; | |||||
namespace BPASmartClient.DosingSystem | namespace BPASmartClient.DosingSystem | ||||
{ | { | ||||
@@ -27,6 +30,7 @@ namespace BPASmartClient.DosingSystem | |||||
MenuInit(); | MenuInit(); | ||||
DataInit(); | DataInit(); | ||||
MainView mv = new MainView(); | MainView mv = new MainView(); | ||||
//mv.Show(); | //mv.Show(); | ||||
LoginView lv = new LoginView(); | LoginView lv = new LoginView(); | ||||
@@ -43,10 +47,12 @@ namespace BPASmartClient.DosingSystem | |||||
base.OnExit(e); | base.OnExit(e); | ||||
Json<LocaPar>.Save(); | Json<LocaPar>.Save(); | ||||
MessageLog.GetInstance.LogSave(); | MessageLog.GetInstance.LogSave(); | ||||
ThreadManage.GetInstance().Dispose(); | |||||
} | } | ||||
private void MenuInit() | private void MenuInit() | ||||
{ | { | ||||
NfcServer.GetInstance.Init(); | |||||
#region 配方管理菜单 | #region 配方管理菜单 | ||||
ObservableCollection<SubMenumodel> RecipeManage = new ObservableCollection<SubMenumodel>(); | ObservableCollection<SubMenumodel> RecipeManage = new ObservableCollection<SubMenumodel>(); | ||||
@@ -71,7 +77,6 @@ namespace BPASmartClient.DosingSystem | |||||
MainMenuIcon = "", | MainMenuIcon = "", | ||||
MainMenuName = "配方管理", | MainMenuName = "配方管理", | ||||
Alias = "Recipe Management", | Alias = "Recipe Management", | ||||
MainMenuPermission = new Permission[] { Permission.管理员 }, | |||||
subMenumodels = RecipeManage, | subMenumodels = RecipeManage, | ||||
}); | }); | ||||
#endregion | #endregion | ||||
@@ -102,12 +107,19 @@ namespace BPASmartClient.DosingSystem | |||||
ToggleWindowPath = "Pages.View.AlarmView" | ToggleWindowPath = "Pages.View.AlarmView" | ||||
}); | }); | ||||
InfoLog.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "调试日志", | |||||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | |||||
ToggleWindowPath = "Pages.View.DebugLogView" | |||||
}); | |||||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | MenuManage.GetInstance.menuModels.Add(new MenuModel() | ||||
{ | { | ||||
MainMenuIcon = "", | MainMenuIcon = "", | ||||
MainMenuName = "消息日志", | MainMenuName = "消息日志", | ||||
Alias = "Message Log", | Alias = "Message Log", | ||||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||||
subMenumodels = InfoLog, | subMenumodels = InfoLog, | ||||
}); | }); | ||||
#endregion | #endregion | ||||
@@ -130,15 +142,11 @@ namespace BPASmartClient.DosingSystem | |||||
ToggleWindowPath = "View.HardwareStatusView" | ToggleWindowPath = "View.HardwareStatusView" | ||||
}); | }); | ||||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | MenuManage.GetInstance.menuModels.Add(new MenuModel() | ||||
{ | { | ||||
MainMenuIcon = "", | MainMenuIcon = "", | ||||
MainMenuName = "设备监控", | MainMenuName = "设备监控", | ||||
Alias = "Device Monitor", | Alias = "Device Monitor", | ||||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||||
subMenumodels = DeviceMonitor, | subMenumodels = DeviceMonitor, | ||||
}); | }); | ||||
#endregion | #endregion | ||||
@@ -161,13 +169,19 @@ namespace BPASmartClient.DosingSystem | |||||
ToggleWindowPath = "Pages.View.PasswordChangeView" | ToggleWindowPath = "Pages.View.PasswordChangeView" | ||||
}); | }); | ||||
UserManager.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "NFC登录设置", | |||||
SubMenuPermission = new Permission[] { Permission.管理员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | |||||
ToggleWindowPath = "Pages.View.NfcSetView" | |||||
}); | |||||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | MenuManage.GetInstance.menuModels.Add(new MenuModel() | ||||
{ | { | ||||
MainMenuIcon = "", | MainMenuIcon = "", | ||||
MainMenuName = "用户管理", | MainMenuName = "用户管理", | ||||
Alias = "User Management", | Alias = "User Management", | ||||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||||
subMenumodels = UserManager, | subMenumodels = UserManager, | ||||
}); | }); | ||||
#endregion | #endregion | ||||
@@ -7,7 +7,7 @@ | |||||
<UseWPF>true</UseWPF> | <UseWPF>true</UseWPF> | ||||
<ApplicationManifest></ApplicationManifest> | <ApplicationManifest></ApplicationManifest> | ||||
<ApplicationIcon>hbl.ico</ApplicationIcon> | <ApplicationIcon>hbl.ico</ApplicationIcon> | ||||
<PlatformTarget>AnyCPU</PlatformTarget> | |||||
<PlatformTarget>x86</PlatformTarget> | |||||
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild> | <EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild> | ||||
</PropertyGroup> | </PropertyGroup> | ||||
@@ -24,6 +24,7 @@ | |||||
<ItemGroup> | <ItemGroup> | ||||
<ProjectReference Include="..\BPASmartClient.CustomResource\BPASmartClient.CustomResource.csproj" /> | <ProjectReference Include="..\BPASmartClient.CustomResource\BPASmartClient.CustomResource.csproj" /> | ||||
<ProjectReference Include="..\BPASmartClient.Modbus\BPASmartClient.Modbus.csproj" /> | <ProjectReference Include="..\BPASmartClient.Modbus\BPASmartClient.Modbus.csproj" /> | ||||
<ProjectReference Include="..\BPASmartClient.Nfc\BPASmartClient.Nfc.csproj" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
</Project> | </Project> |
@@ -51,7 +51,7 @@ | |||||
Height="500" | Height="500" | ||||
CurrentValue="50" />--> | CurrentValue="50" />--> | ||||
<pry:MotorBottle IsRun="True" CurrentValue="100"/> | |||||
<pry:MotorBottle CurrentValue="100" IsRun="True" /> | |||||
<Grid> | <Grid> | ||||
@@ -46,7 +46,7 @@ | |||||
<Grid Margin="20"> | <Grid Margin="20"> | ||||
<ScrollViewer > | |||||
<ScrollViewer> | |||||
<ListView | <ListView | ||||
Margin="5" | Margin="5" | ||||
@@ -87,8 +87,8 @@ | |||||
<Grid | <Grid | ||||
Name="gr" | Name="gr" | ||||
Grid.Row="2" | Grid.Row="2" | ||||
Background="#00BEFA" | |||||
Height="30"> | |||||
Height="30" | |||||
Background="#00BEFA"> | |||||
<pry:IcoButton | <pry:IcoButton | ||||
Width="{Binding ElementName=gr, Path=ActualWidth}" | Width="{Binding ElementName=gr, Path=ActualWidth}" | ||||
@@ -1,20 +1,21 @@ | |||||
<Window x:Class="FryPot_DosingSystem.View.MainWindow" | |||||
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel" | |||||
xmlns:local="clr-namespace:FryPot_DosingSystem.View" | |||||
xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||||
Title="MainWindow" | |||||
Width="1300" | |||||
Height="800" | |||||
AllowsTransparency="True" | |||||
Background="{x:Null}" | |||||
Topmost="False" | |||||
WindowStartupLocation="CenterScreen" | |||||
WindowStyle="None" | |||||
mc:Ignorable="d"> | |||||
<Window | |||||
x:Class="FryPot_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:FryPot_DosingSystem.View" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel" | |||||
Title="MainWindow" | |||||
Width="1300" | |||||
Height="800" | |||||
AllowsTransparency="True" | |||||
Background="{x:Null}" | |||||
Topmost="False" | |||||
WindowStartupLocation="CenterScreen" | |||||
WindowStyle="None" | |||||
mc:Ignorable="d"> | |||||
<Window.Resources> | <Window.Resources> | ||||
<ResourceDictionary> | <ResourceDictionary> | ||||
<ResourceDictionary.MergedDictionaries> | <ResourceDictionary.MergedDictionaries> | ||||
@@ -46,7 +47,7 @@ | |||||
</ResourceDictionary> | </ResourceDictionary> | ||||
</Window.Resources> | </Window.Resources> | ||||
<Window.DataContext> | <Window.DataContext> | ||||
<vm:MainViewModel></vm:MainViewModel> | |||||
<vm:MainViewModel /> | |||||
</Window.DataContext> | </Window.DataContext> | ||||
<Border x:Name="br" Style="{DynamicResource border主窗体背景}"> | <Border x:Name="br" Style="{DynamicResource border主窗体背景}"> | ||||
@@ -76,20 +77,18 @@ | |||||
<ListBox | <ListBox | ||||
x:Name="lstEnt" | x:Name="lstEnt" | ||||
Margin="0,0,293,0" | |||||
Background="{x:Null}" | Background="{x:Null}" | ||||
BorderBrush="{x:Null}" | BorderBrush="{x:Null}" | ||||
ScrollViewer.CanContentScroll="False" | |||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden" | |||||
ScrollViewer.VerticalScrollBarVisibility="Disabled" | |||||
BorderThickness="0" | BorderThickness="0" | ||||
ItemContainerStyle="{StaticResource ResourceKey=ListBoxItemStyle1}" | ItemContainerStyle="{StaticResource ResourceKey=ListBoxItemStyle1}" | ||||
ItemsSource="{Binding DisplayMenus}" Margin="0,0,293,0"> | |||||
ItemsSource="{Binding DisplayMenus}" | |||||
ScrollViewer.CanContentScroll="False" | |||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden" | |||||
ScrollViewer.VerticalScrollBarVisibility="Disabled"> | |||||
<ListBox.ItemsPanel> | <ListBox.ItemsPanel> | ||||
<ItemsPanelTemplate> | <ItemsPanelTemplate> | ||||
<StackPanel Orientation="Horizontal" /> | |||||
<StackPanel Orientation="Horizontal" /> | |||||
</ItemsPanelTemplate> | </ItemsPanelTemplate> | ||||
</ListBox.ItemsPanel> | </ListBox.ItemsPanel> | ||||
<ListBox.ItemTemplate> | <ListBox.ItemTemplate> | ||||
@@ -186,8 +185,7 @@ ScrollViewer.HorizontalScrollBarVisibility="Hidden" | |||||
Content="退出" | Content="退出" | ||||
Cursor="Hand" | Cursor="Hand" | ||||
Style="{DynamicResource CommonBtn_返回}" | Style="{DynamicResource CommonBtn_返回}" | ||||
ToolTip="退出程序" | |||||
/> | |||||
ToolTip="退出程序" /> | |||||
</StackPanel> | </StackPanel> | ||||
</Grid> | </Grid> | ||||
@@ -229,8 +227,7 @@ ScrollViewer.HorizontalScrollBarVisibility="Hidden" | |||||
<CheckBox | <CheckBox | ||||
Margin="5,0,5,0" | Margin="5,0,5,0" | ||||
Content="设备初始化" | Content="设备初始化" | ||||
IsChecked="{Binding Status}" | |||||
/> | |||||
IsChecked="{Binding Status}" /> | |||||
</StackPanel> | </StackPanel> | ||||
<TextBlock | <TextBlock | ||||
@@ -244,13 +241,12 @@ ScrollViewer.HorizontalScrollBarVisibility="Hidden" | |||||
</Grid> | </Grid> | ||||
<!--#region 底部窗体栏--> | <!--#region 底部窗体栏--> | ||||
<ContentControl | |||||
<ContentControl | |||||
x:Name="contentRegion" | x:Name="contentRegion" | ||||
Grid.Row="1" | Grid.Row="1" | ||||
Content="{Binding MyWindow}" | |||||
/> | |||||
Content="{Binding MyWindow}" /> | |||||
<!--#endregion--> | <!--#endregion--> | ||||
</Grid> | |||||
</Grid> | |||||
</Grid> | </Grid> | ||||
@@ -118,6 +118,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkTSingle" | |||||
EndProject | EndProject | ||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MilkWithTea", "BPASmartClient.MilkWithTea\BPASmartClient.MilkWithTea.csproj", "{BFA4E222-BBCC-4AC7-9EA4-4549AEF3174B}" | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MilkWithTea", "BPASmartClient.MilkWithTea\BPASmartClient.MilkWithTea.csproj", "{BFA4E222-BBCC-4AC7-9EA4-4549AEF3174B}" | ||||
EndProject | EndProject | ||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectricCurrentTestDemo", "..\..\TEST\ElectricCurrentTestDemo\ElectricCurrentTestDemo.csproj", "{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}" | |||||
EndProject | |||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.KHKJ", "BPASmartClient.KHKJ\BPASmartClient.KHKJ.csproj", "{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}" | |||||
EndProject | |||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Nfc", "BPASmartClient.Nfc\BPASmartClient.Nfc.csproj", "{42D35B7C-764C-4692-AA85-9B343A0F5B7F}" | |||||
EndProject | |||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.Argox", "BPASmartClient.Argox\BPASmartClient.Argox.csproj", "{B8D499BA-A18A-4FD6-B036-44F02B4D164B}" | |||||
EndProject | |||||
Global | Global | ||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
Debug|Any CPU = Debug|Any CPU | Debug|Any CPU = Debug|Any CPU | ||||
@@ -1112,6 +1120,86 @@ Global | |||||
{BFA4E222-BBCC-4AC7-9EA4-4549AEF3174B}.Release|x64.Build.0 = Release|Any CPU | {BFA4E222-BBCC-4AC7-9EA4-4549AEF3174B}.Release|x64.Build.0 = Release|Any CPU | ||||
{BFA4E222-BBCC-4AC7-9EA4-4549AEF3174B}.Release|x86.ActiveCfg = Release|Any CPU | {BFA4E222-BBCC-4AC7-9EA4-4549AEF3174B}.Release|x86.ActiveCfg = Release|Any CPU | ||||
{BFA4E222-BBCC-4AC7-9EA4-4549AEF3174B}.Release|x86.Build.0 = Release|Any CPU | {BFA4E222-BBCC-4AC7-9EA4-4549AEF3174B}.Release|x86.Build.0 = Release|Any CPU | ||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|ARM.ActiveCfg = Debug|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|ARM.Build.0 = Debug|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|ARM64.ActiveCfg = Debug|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|ARM64.Build.0 = Debug|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|x64.ActiveCfg = Debug|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|x64.Build.0 = Debug|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|x86.ActiveCfg = Debug|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|x86.Build.0 = Debug|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|ARM.ActiveCfg = Release|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|ARM.Build.0 = Release|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|ARM64.ActiveCfg = Release|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|ARM64.Build.0 = Release|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|x64.ActiveCfg = Release|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|x64.Build.0 = Release|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|x86.ActiveCfg = Release|Any CPU | |||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|x86.Build.0 = Release|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Debug|ARM.ActiveCfg = Debug|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Debug|ARM.Build.0 = Debug|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Debug|ARM64.ActiveCfg = Debug|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Debug|ARM64.Build.0 = Debug|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Debug|x64.ActiveCfg = Debug|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Debug|x64.Build.0 = Debug|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Debug|x86.ActiveCfg = Debug|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Debug|x86.Build.0 = Debug|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Release|ARM.ActiveCfg = Release|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Release|ARM.Build.0 = Release|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Release|ARM64.ActiveCfg = Release|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Release|ARM64.Build.0 = Release|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Release|x64.ActiveCfg = Release|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Release|x64.Build.0 = Release|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Release|x86.ActiveCfg = Release|Any CPU | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Release|x86.Build.0 = Release|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Debug|ARM.ActiveCfg = Debug|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Debug|ARM.Build.0 = Debug|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Debug|ARM64.ActiveCfg = Debug|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Debug|ARM64.Build.0 = Debug|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Debug|x64.ActiveCfg = Debug|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Debug|x64.Build.0 = Debug|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Debug|x86.ActiveCfg = Debug|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Debug|x86.Build.0 = Debug|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Release|ARM.ActiveCfg = Release|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Release|ARM.Build.0 = Release|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Release|ARM64.ActiveCfg = Release|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Release|ARM64.Build.0 = Release|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Release|x64.ActiveCfg = Release|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Release|x64.Build.0 = Release|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Release|x86.ActiveCfg = Release|Any CPU | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Release|x86.Build.0 = Release|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Debug|ARM.ActiveCfg = Debug|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Debug|ARM.Build.0 = Debug|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Debug|ARM64.ActiveCfg = Debug|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Debug|ARM64.Build.0 = Debug|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Debug|x64.ActiveCfg = Debug|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Debug|x64.Build.0 = Debug|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Debug|x86.ActiveCfg = Debug|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Debug|x86.Build.0 = Debug|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Release|ARM.ActiveCfg = Release|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Release|ARM.Build.0 = Release|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Release|ARM64.ActiveCfg = Release|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Release|ARM64.Build.0 = Release|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Release|x64.ActiveCfg = Release|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Release|x64.Build.0 = Release|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Release|x86.ActiveCfg = Release|Any CPU | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Release|x86.Build.0 = Release|Any CPU | |||||
EndGlobalSection | EndGlobalSection | ||||
GlobalSection(SolutionProperties) = preSolution | GlobalSection(SolutionProperties) = preSolution | ||||
HideSolutionNode = FALSE | HideSolutionNode = FALSE | ||||
@@ -1166,6 +1254,10 @@ Global | |||||
{099E047C-F40E-47A3-A5BA-81FC1500D5E8} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625} | {099E047C-F40E-47A3-A5BA-81FC1500D5E8} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625} | ||||
{2366AC9B-B662-4550-9486-AF848B4D2961} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} | {2366AC9B-B662-4550-9486-AF848B4D2961} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} | ||||
{BFA4E222-BBCC-4AC7-9EA4-4549AEF3174B} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | {BFA4E222-BBCC-4AC7-9EA4-4549AEF3174B} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | ||||
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | |||||
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD} | |||||
{42D35B7C-764C-4692-AA85-9B343A0F5B7F} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625} | |||||
{B8D499BA-A18A-4FD6-B036-44F02B4D164B} = {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} | ||||