Add project files.
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
// <auto-generated/>
|
||||
global using global::System;
|
||||
global using global::System.Collections.Generic;
|
||||
global using global::System.Linq;
|
||||
global using global::System.Threading;
|
||||
global using global::System.Threading.Tasks;
|
||||
@@ -0,0 +1,95 @@
|
||||
using DE70_CMDv2;
|
||||
using Serilog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
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 SafeBagDE70.Admin
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for AdminConfigurationUC.xaml
|
||||
/// </summary>
|
||||
public partial class AdminConfigurationUC : UserControl
|
||||
{
|
||||
public AdminConfigurationUC()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btnResetCounter_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (AppData.cCmdRsp != null)
|
||||
{
|
||||
Log.Information("[ADMIN] reset counter");
|
||||
CCmdRsp cCmdRsp = AppData.cCmdRsp;
|
||||
cCmdRsp.SendDeSense();
|
||||
Thread.Sleep(1000);
|
||||
cCmdRsp.SendXXCmd((byte)Command.CMD_DE_UNLOCK);
|
||||
Thread.Sleep(1000);
|
||||
cCmdRsp.SendDeSense();
|
||||
Thread.Sleep(1000);
|
||||
//Event fix
|
||||
var recvData = cCmdRsp.recv_dat;
|
||||
|
||||
if (recvData.dat[14] == recvData.dat[16])
|
||||
{
|
||||
cCmdRsp.SendLock();
|
||||
}
|
||||
else
|
||||
{
|
||||
cCmdRsp.SendEventFix(recvData.dat[16]);
|
||||
cCmdRsp.SendLock();
|
||||
}
|
||||
|
||||
var currentMode = cCmdRsp.GetLockParam().mode;
|
||||
cCmdRsp.GetLockParam().mode = Mode.MODE_COLLECTION;
|
||||
cCmdRsp.SendLock();
|
||||
Thread.Sleep(10000);
|
||||
cCmdRsp.SendDeSense();
|
||||
Thread.Sleep(1000);
|
||||
recvData = cCmdRsp.recv_dat;
|
||||
|
||||
if (recvData.dat[14] != recvData.dat[16])
|
||||
{
|
||||
Log.Information("[ADMIN] reset counter success");
|
||||
lblStatus.Text = "TRẠNG THÁI: KHỞI TẠO BỘ ĐẾM THÀNH CÔNG";
|
||||
((MainWindow)Application.Current.MainWindow).ShowWelcomeScreen();
|
||||
Task.Run(() =>
|
||||
{
|
||||
Thread.Sleep(2);
|
||||
lblStatus.Text = "";
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Information("[ADMIN] reset counter fail");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnOpenEscrow_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Log.Information("[ADMIN] Do Check");
|
||||
var mainWindow = ((MainWindow)Application.Current.MainWindow);
|
||||
if (mainWindow!=null)
|
||||
mainWindow.DoCheck();
|
||||
}
|
||||
|
||||
private void btnGetCDMState_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AppData.GetCDMState();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user