Add project files.
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
using DE70_CMDv2;
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for CollectionUC.xaml
|
||||
/// </summary>
|
||||
public partial class CollectionUC : UserControl
|
||||
{
|
||||
public CollectionUC()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private void btnCollect_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(AppData.cCmdRsp!=null)
|
||||
{
|
||||
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])
|
||||
{
|
||||
lblStatus.Text="TRẠNG THÁI: KHỞI TẠO BỘ ĐẾM THÀNH CÔNG";
|
||||
((MainWindow)Application.Current.MainWindow).ShowWelcomeScreen();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(AppData.cCmdRsp!=null)
|
||||
AppData.cCmdRsp.SendXXCmd((byte)Command.CMD_DE_CANCEL);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<Application x:Class="SafeBagDE70.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:SafeBagDE70"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<hc:ThemeResources RequestedTheme="Light">
|
||||
<ResourceDictionary x:Key="Light" hc:ThemeDictionary.Key="Light">
|
||||
|
||||
<!-- Put the resources you want to use in the Light theme Here -->
|
||||
|
||||
<SolidColorBrush x:Key="PrimaryBrush" Color="Red" />
|
||||
<SolidColorBrush x:Key="AppBackgroundBrush" Color="LightBlue" />
|
||||
</ResourceDictionary>
|
||||
</hc:ThemeResources>
|
||||
<hc:Theme/>
|
||||
<ResourceDictionary Source="pack://application:,,,/VirtualKeyboard;component/ResourceDictionaries/DefaultStyles.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
Reference in New Issue
Block a user