devcon
This commit is contained in:
parent
8b4769520a
commit
94b6f54779
11 changed files with 113 additions and 72 deletions
|
|
@ -65,7 +65,6 @@ EpdBase::Epd2U::~Epd2U()
|
||||||
EndCom();
|
EndCom();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int EpdBase::Epd2U::StartDiscover( int EpdTimeout)
|
int EpdBase::Epd2U::StartDiscover( int EpdTimeout)
|
||||||
{
|
{
|
||||||
maxDiscoverTime = EpdTimeout;
|
maxDiscoverTime = EpdTimeout;
|
||||||
|
|
|
||||||
|
|
@ -343,7 +343,7 @@ namespace eDosStation
|
||||||
public User GetUser( string CSN, string Code)
|
public User GetUser( string CSN, string Code)
|
||||||
{
|
{
|
||||||
User u = new User();
|
User u = new User();
|
||||||
object[] Values = null;
|
//object[] Values = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var cmd = new SqlCommand("GetPersonInfo", localConnection))
|
using (var cmd = new SqlCommand("GetPersonInfo", localConnection))
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,9 @@ namespace eDosStation
|
||||||
DataSet1.GetTaskInfoRow CurTaskRow;
|
DataSet1.GetTaskInfoRow CurTaskRow;
|
||||||
private DateTime ResultTime;
|
private DateTime ResultTime;
|
||||||
enum eCOE { quiz = 1 };
|
enum eCOE { quiz = 1 };
|
||||||
|
|
||||||
#if SimulateEPD
|
#if SimulateEPD
|
||||||
public SimulateData simulData = new SimulateData();
|
public SimulateData simulData = new SimulateData();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public EntryBadge(Station curStation)
|
public EntryBadge(Station curStation)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
@ -53,14 +51,12 @@ namespace eDosStation
|
||||||
_User = null;
|
_User = null;
|
||||||
taskLoading = false;
|
taskLoading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Ep_EpdTO(EpdBaseClr.Epd2 Sender, EpdBaseClr.EpdTOEventArgs e)
|
private void Ep_EpdTO(EpdBaseClr.Epd2 Sender, EpdBaseClr.EpdTOEventArgs e)
|
||||||
{
|
{
|
||||||
Dispatcher.InvokeAsync(() => {
|
Dispatcher.InvokeAsync(() => {
|
||||||
endPage();
|
endPage();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Ep_EpdError(EpdBaseClr.Epd2 Sender, EpdBaseClr.EpdErrorEventArgs e)
|
private void Ep_EpdError(EpdBaseClr.Epd2 Sender, EpdBaseClr.EpdErrorEventArgs e)
|
||||||
{
|
{
|
||||||
Dispatcher.InvokeAsync(() => {
|
Dispatcher.InvokeAsync(() => {
|
||||||
|
|
@ -68,12 +64,10 @@ namespace eDosStation
|
||||||
endPage();
|
endPage();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Ep_EpdRead(EpdBaseClr.Epd2 Sender, EpdBaseClr.EpdEventArgs e)
|
private void Ep_EpdRead(EpdBaseClr.Epd2 Sender, EpdBaseClr.EpdEventArgs e)
|
||||||
{
|
{
|
||||||
Dispatcher.InvokeAsync(() => GetEPD());
|
Dispatcher.InvokeAsync(() => GetEPD());
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool LoadDoses()
|
private bool LoadDoses()
|
||||||
{
|
{
|
||||||
bool rv = true;
|
bool rv = true;
|
||||||
|
|
@ -308,7 +302,6 @@ namespace eDosStation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GetEPD()
|
private void GetEPD()
|
||||||
{
|
{
|
||||||
if (ep.DeviceCount == 1 && ep.EpdID> 0)
|
if (ep.DeviceCount == 1 && ep.EpdID> 0)
|
||||||
|
|
@ -317,7 +310,6 @@ namespace eDosStation
|
||||||
DoEPD();
|
DoEPD();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetFilter(bool isAlara)
|
private void SetFilter(bool isAlara)
|
||||||
{
|
{
|
||||||
dataInterface.stationLog?.WriteLine($"SetFilter Start {DateTime.Now.ToString("HH:mm:ss.fff")}");
|
dataInterface.stationLog?.WriteLine($"SetFilter Start {DateTime.Now.ToString("HH:mm:ss.fff")}");
|
||||||
|
|
@ -384,7 +376,6 @@ namespace eDosStation
|
||||||
}
|
}
|
||||||
return res.Replace("\\n", "\n");
|
return res.Replace("\\n", "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get User data
|
/// Get User data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -457,7 +448,6 @@ namespace eDosStation
|
||||||
dataInterface.stationLog?.WriteLine($"ShowUserInfo Stop {DateTime.Now.ToString("HH:mm:ss.fff")}");
|
dataInterface.stationLog?.WriteLine($"ShowUserInfo Stop {DateTime.Now.ToString("HH:mm:ss.fff")}");
|
||||||
return doCancel;
|
return doCancel;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SwitchToTask(object sender, EventArgs e)
|
private void SwitchToTask(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (--UserSeconds > 0 && (_User.AccessAllow != true || !string.IsNullOrEmpty(_User.UserComment) || !string.IsNullOrEmpty(_User.ReasonNoAccess)))
|
if (--UserSeconds > 0 && (_User.AccessAllow != true || !string.IsNullOrEmpty(_User.UserComment) || !string.IsNullOrEmpty(_User.ReasonNoAccess)))
|
||||||
|
|
@ -502,19 +492,16 @@ namespace eDosStation
|
||||||
{
|
{
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bClose_Click(object sender, RoutedEventArgs e)
|
private void bClose_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
endPage();
|
endPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BClear_Click(object sender, RoutedEventArgs e)
|
private void BClear_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
CSN.Text = string.Empty;
|
CSN.Text = string.Empty;
|
||||||
Site.Text = string.Empty;
|
Site.Text = string.Empty;
|
||||||
Code.Text = string.Empty;
|
Code.Text = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TaskOK_Click(object sender, RoutedEventArgs e)
|
private void TaskOK_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -562,7 +549,6 @@ namespace eDosStation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CountDown(object sender, EventArgs e)
|
private void CountDown(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
double v = (ResultTime - DateTime.Now).TotalSeconds;
|
double v = (ResultTime - DateTime.Now).TotalSeconds;
|
||||||
|
|
@ -574,7 +560,6 @@ namespace eDosStation
|
||||||
endPage();
|
endPage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (taskLoading) return;
|
if (taskLoading) return;
|
||||||
|
|
@ -602,7 +587,6 @@ namespace eDosStation
|
||||||
TaskOK.Content = "OK"; TaskOK.Tag = "O";
|
TaskOK.Content = "OK"; TaskOK.Tag = "O";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CbInst1_Click(object sender, RoutedEventArgs e)
|
private void CbInst1_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Inst1 = (cbInst1.IsChecked == true);
|
Inst1 = (cbInst1.IsChecked == true);
|
||||||
|
|
@ -610,7 +594,6 @@ namespace eDosStation
|
||||||
bool isAlara = (cbAlara.IsChecked == true);
|
bool isAlara = (cbAlara.IsChecked == true);
|
||||||
SetFilter(isAlara);
|
SetFilter(isAlara);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CbAlara_Click(object sender, RoutedEventArgs e)
|
private void CbAlara_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (!initialising)
|
if (!initialising)
|
||||||
|
|
@ -621,7 +604,6 @@ namespace eDosStation
|
||||||
SetFilter(isAlara);
|
SetFilter(isAlara);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CbNormal_Click(object sender, RoutedEventArgs e)
|
private void CbNormal_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (!initialising)
|
if (!initialising)
|
||||||
|
|
@ -632,7 +614,6 @@ namespace eDosStation
|
||||||
SetFilter(isAlara);
|
SetFilter(isAlara);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BUserRead_Click(object sender, RoutedEventArgs e)
|
private void BUserRead_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
dispatcherTimer.Stop();
|
dispatcherTimer.Stop();
|
||||||
|
|
@ -641,12 +622,10 @@ namespace eDosStation
|
||||||
AskTask();
|
AskTask();
|
||||||
else Close();
|
else Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TaskCancel_Click(object sender, RoutedEventArgs e)
|
private void TaskCancel_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BTestPerson_Click(object sender, RoutedEventArgs e)
|
private void BTestPerson_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Button b = sender as Button;
|
Button b = sender as Button;
|
||||||
|
|
@ -659,7 +638,6 @@ namespace eDosStation
|
||||||
dfReader?.WaitEnd();
|
dfReader?.WaitEnd();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
@ -682,7 +660,6 @@ namespace eDosStation
|
||||||
System.Diagnostics.Debug.WriteLine(ex.Message);
|
System.Diagnostics.Debug.WriteLine(ex.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CbInst2_Click(object sender, RoutedEventArgs e)
|
private void CbInst2_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Inst2 = (cbInst2.IsChecked == true);
|
Inst2 = (cbInst2.IsChecked == true);
|
||||||
|
|
@ -690,7 +667,6 @@ namespace eDosStation
|
||||||
bool isAlara = (cbAlara.IsChecked == true);
|
bool isAlara = (cbAlara.IsChecked == true);
|
||||||
SetFilter(isAlara);
|
SetFilter(isAlara);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddTestButtons()
|
private void AddTestButtons()
|
||||||
{
|
{
|
||||||
StackPanel sp = pTestButtons;
|
StackPanel sp = pTestButtons;
|
||||||
|
|
@ -713,7 +689,6 @@ namespace eDosStation
|
||||||
|
|
||||||
sp.Visibility = Visibility.Visible;
|
sp.Visibility = Visibility.Visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
initialising = true;
|
initialising = true;
|
||||||
|
|
@ -763,22 +738,18 @@ namespace eDosStation
|
||||||
}
|
}
|
||||||
taskLoading = false;
|
taskLoading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DfReader_BadgeError(LSWDesfirePublic.CCard Sender, LSWDesfirePublic.BadgeErrorEventArgs e)
|
private void DfReader_BadgeError(LSWDesfirePublic.CCard Sender, LSWDesfirePublic.BadgeErrorEventArgs e)
|
||||||
{
|
{
|
||||||
endPage();
|
endPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LeesCancel_Click(object sender, RoutedEventArgs e)
|
private void LeesCancel_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
endPage();
|
endPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DfReader_BadgeTO(LSWDesfirePublic.CCard Sender, EventArgs e)
|
private void DfReader_BadgeTO(LSWDesfirePublic.CCard Sender, EventArgs e)
|
||||||
{
|
{
|
||||||
this.Dispatcher.InvokeAsync(new Action(() => endPage()),DispatcherPriority.Normal);
|
this.Dispatcher.InvokeAsync(new Action(() => endPage()),DispatcherPriority.Normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool SelectTask(string id_task)
|
private bool SelectTask(string id_task)
|
||||||
{
|
{
|
||||||
System.Windows.Data.CollectionViewSource getTaskListViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("getTaskListViewSource")));
|
System.Windows.Data.CollectionViewSource getTaskListViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("getTaskListViewSource")));
|
||||||
|
|
@ -791,7 +762,6 @@ namespace eDosStation
|
||||||
}
|
}
|
||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void numPanel_Click(object sender, RoutedEventArgs e)
|
private void numPanel_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Button x = sender as Button;
|
Button x = sender as Button;
|
||||||
|
|
@ -821,7 +791,6 @@ namespace eDosStation
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ShowNumpad_Click(object sender, RoutedEventArgs e)
|
private void ShowNumpad_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (numPanel.Visibility != Visibility.Visible)
|
if (numPanel.Visibility != Visibility.Visible)
|
||||||
|
|
@ -837,7 +806,6 @@ namespace eDosStation
|
||||||
numPanel.Visibility = Visibility.Collapsed;
|
numPanel.Visibility = Visibility.Collapsed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DFReader_Badged(LSWDesfirePublic.CCard Sender, LSWDesfirePublic.BadgeEventArgs e)
|
private void DFReader_Badged(LSWDesfirePublic.CCard Sender, LSWDesfirePublic.BadgeEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.PersID > 0)
|
if (e.PersID > 0)
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ namespace eDosStation
|
||||||
simulData = w.simulData;
|
simulData = w.simulData;
|
||||||
#endif
|
#endif
|
||||||
w = null;
|
w = null;
|
||||||
|
if (thisStation.RestartCom) devcon.Restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BExit_Click(object sender, RoutedEventArgs e)
|
private void BExit_Click(object sender, RoutedEventArgs e)
|
||||||
|
|
@ -57,6 +58,7 @@ namespace eDosStation
|
||||||
#endif
|
#endif
|
||||||
w.ShowDialog();
|
w.ShowDialog();
|
||||||
w = null;
|
w = null;
|
||||||
|
if (thisStation.RestartCom) devcon.Restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MenuItem_Click(object sender, RoutedEventArgs e)
|
private void MenuItem_Click(object sender, RoutedEventArgs e)
|
||||||
|
|
@ -183,6 +185,7 @@ namespace eDosStation
|
||||||
{
|
{
|
||||||
About x = new About(thisStation);
|
About x = new About(thisStation);
|
||||||
x.ShowDialog();
|
x.ShowDialog();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void mExit_Click(object sender, RoutedEventArgs e)
|
private void mExit_Click(object sender, RoutedEventArgs e)
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
<RowDefinition Height="auto" />
|
<RowDefinition Height="auto" />
|
||||||
<RowDefinition Height="auto" />
|
<RowDefinition Height="auto" />
|
||||||
<RowDefinition Height="auto" />
|
<RowDefinition Height="auto" />
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
<RowDefinition Height="20" />
|
<RowDefinition Height="20" />
|
||||||
<RowDefinition Height="auto" />
|
<RowDefinition Height="auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
@ -53,8 +54,10 @@
|
||||||
<TextBlock Grid.Row="8" Grid.Column="0" Text="Timeout EPD (ms)" Height="23" Margin="0,0,0.2,0" VerticalAlignment="Top"></TextBlock>
|
<TextBlock Grid.Row="8" Grid.Column="0" Text="Timeout EPD (ms)" Height="23" Margin="0,0,0.2,0" VerticalAlignment="Top"></TextBlock>
|
||||||
<TextBox Grid.Row="8" Grid.ColumnSpan="2" Name="tEPDTimeout" Text="" Grid.Column="1" />
|
<TextBox Grid.Row="8" Grid.ColumnSpan="2" Name="tEPDTimeout" Text="" Grid.Column="1" />
|
||||||
|
|
||||||
<telerik:RadButton Grid.Row="10" Grid.Column="0" Name="bOK" Content="OK" Click="BOK_Click" Style="{DynamicResource OkCancelButton}" />
|
<TextBlock Grid.Row="9" Grid.Column="0" Text="Restart COM" Height="23" Margin="0,0,0.2,0" VerticalAlignment="Top"></TextBlock>
|
||||||
<telerik:RadButton Grid.Row="10" Grid.Column="1" Name="bCancel" Content="Cancel" Click="BCancel_Click" Style="{DynamicResource OkCancelButton}" HorizontalAlignment="Right" />
|
<CheckBox Grid.Row="9" Grid.ColumnSpan="2" Name="cbRestartCom" Grid.Column="1" Padding="10,0,10,0" VerticalAlignment="Center" />
|
||||||
|
|
||||||
|
<telerik:RadButton Grid.Row="11" Grid.Column="0" Name="bOK" Content="OK" Click="BOK_Click" Style="{DynamicResource OkCancelButton}" />
|
||||||
|
<telerik:RadButton Grid.Row="11" Grid.Column="1" Name="bCancel" Content="Cancel" Click="BCancel_Click" Style="{DynamicResource OkCancelButton}" HorizontalAlignment="Right" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace eDosStation
|
namespace eDosStation
|
||||||
|
|
@ -59,7 +60,7 @@ namespace eDosStation
|
||||||
thisStation.useTestButtons = cbValidation.IsChecked.Value;
|
thisStation.useTestButtons = cbValidation.IsChecked.Value;
|
||||||
thisStation.Reader = (string)cbReaders.SelectedValue;
|
thisStation.Reader = (string)cbReaders.SelectedValue;
|
||||||
thisStation.checkUser = cbCheckUsers.IsChecked != null ? cbCheckUsers.IsChecked.Value : false;
|
thisStation.checkUser = cbCheckUsers.IsChecked != null ? cbCheckUsers.IsChecked.Value : false;
|
||||||
|
thisStation.RestartCom = cbRestartCom.IsChecked != null ? cbRestartCom.IsChecked.Value : false;
|
||||||
thisStation.EPDTimeOut = int.Parse(tEPDTimeout.Text);
|
thisStation.EPDTimeOut = int.Parse(tEPDTimeout.Text);
|
||||||
thisStation.Update();
|
thisStation.Update();
|
||||||
this.Close();
|
this.Close();
|
||||||
|
|
@ -76,7 +77,7 @@ namespace eDosStation
|
||||||
|
|
||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
string eDosCom = devcon.FindEdosCom();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var a = new LSWDesfirePublic.CCard())
|
using (var a = new LSWDesfirePublic.CCard())
|
||||||
|
|
@ -146,6 +147,7 @@ namespace eDosStation
|
||||||
tBeep.ItemsSource = beepValues;
|
tBeep.ItemsSource = beepValues;
|
||||||
|
|
||||||
string thisComport = $"COM{thisStation.ComPort}";
|
string thisComport = $"COM{thisStation.ComPort}";
|
||||||
|
if (!string.IsNullOrEmpty(eDosCom)) thisComport = eDosCom;
|
||||||
if (!cComPort.Items.Contains(thisComport)) cComPort.Items.Add(thisComport);
|
if (!cComPort.Items.Contains(thisComport)) cComPort.Items.Add(thisComport);
|
||||||
cComPort.SelectedItem = thisComport;
|
cComPort.SelectedItem = thisComport;
|
||||||
|
|
||||||
|
|
@ -168,12 +170,12 @@ namespace eDosStation
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
tBeep.SelectedValue = thisStation.useBeep;
|
tBeep.SelectedValue = thisStation.useBeep;
|
||||||
cbValidation.IsChecked = thisStation.useTestButtons;
|
cbValidation.IsChecked = thisStation.useTestButtons;
|
||||||
cbCheckUsers.IsChecked= thisStation.checkUser;
|
cbCheckUsers.IsChecked= thisStation.checkUser;
|
||||||
|
cbRestartCom.IsChecked = thisStation.RestartCom;
|
||||||
tEPDTimeout.Text = thisStation.EPDTimeOut.ToString();
|
tEPDTimeout.Text = thisStation.EPDTimeOut.ToString();
|
||||||
}
|
}
|
||||||
catch (System.Exception ex)
|
catch (System.Exception ex)
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ namespace eDosStation
|
||||||
public class Station
|
public class Station
|
||||||
{
|
{
|
||||||
private bool doLog;
|
private bool doLog;
|
||||||
|
|
||||||
public System.IO.StreamWriter stationLog=null;
|
public System.IO.StreamWriter stationLog=null;
|
||||||
public int ID_Station { get; set; }
|
public int ID_Station { get; set; }
|
||||||
public int ComPort { get; set; }
|
public int ComPort { get; set; }
|
||||||
|
|
@ -28,6 +27,7 @@ namespace eDosStation
|
||||||
public byte useBeep { get; set; }
|
public byte useBeep { get; set; }
|
||||||
public bool checkUser { get; internal set; }
|
public bool checkUser { get; internal set; }
|
||||||
|
|
||||||
|
public bool RestartCom { get; set; }
|
||||||
public int EPDTimeOut { get; internal set; }
|
public int EPDTimeOut { get; internal set; }
|
||||||
public int EPDRetries { get; internal set; }
|
public int EPDRetries { get; internal set; }
|
||||||
public bool Changed = false;
|
public bool Changed = false;
|
||||||
|
|
@ -240,12 +240,14 @@ namespace eDosStation
|
||||||
cmd.SetIfExists("useBeep", useBeep);
|
cmd.SetIfExists("useBeep", useBeep);
|
||||||
cmd.SetIfExists("EPDTimeout", EPDTimeOut);
|
cmd.SetIfExists("EPDTimeout", EPDTimeOut);
|
||||||
cmd.SetIfExists("EPDRetries", EPDRetries);
|
cmd.SetIfExists("EPDRetries", EPDRetries);
|
||||||
|
cmd.SetIfExists("RestartCom", RestartCom);
|
||||||
}
|
}
|
||||||
catch (System.Exception ex)
|
catch (System.Exception ex)
|
||||||
{
|
{
|
||||||
|
Error = 1;
|
||||||
|
ErrorMessage = ex.Message;
|
||||||
|
if (stationLog != null) stationLog.WriteLine($"GetStationSettings error {ex.Message} {System.DateTime.Now}");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateToDb(SqlConnection co, SqlCommand cmd)
|
private void UpdateToDb(SqlConnection co, SqlCommand cmd)
|
||||||
|
|
|
||||||
67
eDosStation/devcon.cs
Normal file
67
eDosStation/devcon.cs
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace eDosStation
|
||||||
|
{
|
||||||
|
class devcon
|
||||||
|
{
|
||||||
|
static private string ExecuteDevcon(string command)
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
System.Diagnostics.Process p = null;
|
||||||
|
string curPath = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "extra");
|
||||||
|
string devcon;
|
||||||
|
|
||||||
|
if (System.IO.Directory.Exists(curPath))
|
||||||
|
{
|
||||||
|
devcon = System.IO.Path.Combine(curPath, "devcon.exe");
|
||||||
|
if (System.IO.File.Exists(devcon))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (p = new System.Diagnostics.Process())
|
||||||
|
{
|
||||||
|
p.StartInfo.WorkingDirectory = curPath;
|
||||||
|
p.StartInfo.FileName = devcon;
|
||||||
|
p.StartInfo.Arguments = $"{command} \"USB\\VID_0EBB&PID_0340&MI_00\"";
|
||||||
|
p.StartInfo.RedirectStandardOutput = true;
|
||||||
|
p.StartInfo.UseShellExecute = false;
|
||||||
|
p.Start();
|
||||||
|
var i = p.StandardOutput;
|
||||||
|
while (!i.EndOfStream)
|
||||||
|
{
|
||||||
|
sb.AppendLine(i.ReadLine());
|
||||||
|
}
|
||||||
|
p.WaitForExit();
|
||||||
|
}
|
||||||
|
} catch
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
static public string FindEdosCom()
|
||||||
|
{
|
||||||
|
string eDosCom = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string cp = devcon.ExecuteDevcon("find");
|
||||||
|
var ix = cp.IndexOf("(COM");
|
||||||
|
if (ix >= 0) eDosCom = cp.Substring(ix + 1, 4);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
return eDosCom;
|
||||||
|
}
|
||||||
|
|
||||||
|
static public void Restart()
|
||||||
|
{
|
||||||
|
string cp = devcon.ExecuteDevcon("restart");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="..\packages\LSWLib.3.0.6\build\LSWLib.props" Condition="Exists('..\packages\LSWLib.3.0.6\build\LSWLib.props')" />
|
|
||||||
<Import Project="..\packages\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.props" Condition="Exists('..\packages\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.props')" />
|
<Import Project="..\packages\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.props" Condition="Exists('..\packages\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.props')" />
|
||||||
|
<Import Project="..\packages\LSWLib.3.0.6\build\LSWLib.props" Condition="Exists('..\packages\LSWLib.3.0.6\build\LSWLib.props')" />
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
|
@ -112,20 +112,16 @@
|
||||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Telerik.Windows.Controls, Version=2022.1.222.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
|
<Reference Include="Telerik.Windows.Controls, Version=2022.1.222.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
|
||||||
<HintPath>..\lib\RCWPF\2022.1.222.45\Telerik.Windows.Controls.dll</HintPath>
|
<HintPath>..\packages\Telerik.Windows.Controls.for.Wpf.Xaml.2022.1.222\lib\net45\Telerik.Windows.Controls.dll</HintPath>
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Telerik.Windows.Controls.GridView, Version=2022.1.222.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
|
<Reference Include="Telerik.Windows.Controls.GridView, Version=2022.1.222.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
|
||||||
<HintPath>..\lib\RCWPF\2022.1.222.45\Telerik.Windows.Controls.GridView.dll</HintPath>
|
<HintPath>..\packages\Telerik.Windows.Controls.GridView.for.Wpf.Xaml.2022.1.222\lib\net45\Telerik.Windows.Controls.GridView.dll</HintPath>
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Telerik.Windows.Controls.Input, Version=2022.1.222.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
|
<Reference Include="Telerik.Windows.Controls.Input, Version=2022.1.222.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
|
||||||
<HintPath>..\lib\RCWPF\2022.1.222.45\Telerik.Windows.Controls.Input.dll</HintPath>
|
<HintPath>..\packages\Telerik.Windows.Controls.Input.for.Wpf.Xaml.2022.1.222\lib\net45\Telerik.Windows.Controls.Input.dll</HintPath>
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Telerik.Windows.Data, Version=2022.1.222.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
|
<Reference Include="Telerik.Windows.Data, Version=2022.1.222.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
|
||||||
<HintPath>..\lib\RCWPF\2022.1.222.45\Telerik.Windows.Data.dll</HintPath>
|
<HintPath>..\packages\Telerik.Windows.Data.for.Wpf.Xaml.2022.1.222\lib\net45\Telerik.Windows.Data.dll</HintPath>
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UIAutomationProvider">
|
<Reference Include="UIAutomationProvider">
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
|
|
@ -157,6 +153,7 @@
|
||||||
<DependentUpon>DataSet1.xsd</DependentUpon>
|
<DependentUpon>DataSet1.xsd</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Decoder.cs" />
|
<Compile Include="Decoder.cs" />
|
||||||
|
<Compile Include="devcon.cs" />
|
||||||
<Compile Include="EntryBadge.xaml.cs">
|
<Compile Include="EntryBadge.xaml.cs">
|
||||||
<DependentUpon>EntryBadge.xaml</DependentUpon>
|
<DependentUpon>EntryBadge.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|
@ -290,6 +287,9 @@
|
||||||
<Resource Include="Images\EPD-N2.png" />
|
<Resource Include="Images\EPD-N2.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Content Include="extra\devcon.exe">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="Reader3.dll">
|
<Content Include="Reader3.dll">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
|
@ -326,26 +326,23 @@
|
||||||
<Project>{f1f47b79-9930-48b0-8dde-56e2c4bed2a2}</Project>
|
<Project>{f1f47b79-9930-48b0-8dde-56e2c4bed2a2}</Project>
|
||||||
<Name>EpdBaseClr</Name>
|
<Name>EpdBaseClr</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\OkReadBadge\OkReadBadge.vcxproj">
|
|
||||||
<Project>{f98f3496-8a4c-4bdb-9f17-c7af47a60739}</Project>
|
|
||||||
<Name>OkReadBadge</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup />
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\packages\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\LSWLib.3.0.6\build\LSWLib.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LSWLib.3.0.6\build\LSWLib.props'))" />
|
<Error Condition="!Exists('..\packages\LSWLib.3.0.6\build\LSWLib.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LSWLib.3.0.6\build\LSWLib.props'))" />
|
||||||
<Error Condition="!Exists('..\packages\LSWLib.3.0.6\build\LSWLib.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LSWLib.3.0.6\build\LSWLib.targets'))" />
|
<Error Condition="!Exists('..\packages\LSWLib.3.0.6\build\LSWLib.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LSWLib.3.0.6\build\LSWLib.targets'))" />
|
||||||
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.SlowCheetah.4.0.8\build\Microsoft.VisualStudio.SlowCheetah.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VisualStudio.SlowCheetah.4.0.8\build\Microsoft.VisualStudio.SlowCheetah.targets'))" />
|
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.SlowCheetah.4.0.8\build\Microsoft.VisualStudio.SlowCheetah.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VisualStudio.SlowCheetah.4.0.8\build\Microsoft.VisualStudio.SlowCheetah.targets'))" />
|
||||||
|
<Error Condition="!Exists('..\packages\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.props'))" />
|
||||||
|
<Error Condition="!Exists('..\packages\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /sha1 857150b64ef7d3e679c8cbde425d2a0b5e58ffaa /fd sha256 /d "Integrity & Authenticity" /tr "http://timestamp.digicert.com" $(TargetPath)</PostBuildEvent>
|
<PostBuildEvent>"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /sha1 857150b64ef7d3e679c8cbde425d2a0b5e58ffaa /fd sha256 /d "Integrity & Authenticity" /tr "http://timestamp.digicert.com" $(TargetPath)</PostBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="..\packages\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.targets" Condition="Exists('..\packages\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.targets')" />
|
|
||||||
<Import Project="..\packages\LSWLib.3.0.6\build\LSWLib.targets" Condition="Exists('..\packages\LSWLib.3.0.6\build\LSWLib.targets')" />
|
<Import Project="..\packages\LSWLib.3.0.6\build\LSWLib.targets" Condition="Exists('..\packages\LSWLib.3.0.6\build\LSWLib.targets')" />
|
||||||
<Import Project="..\packages\Microsoft.VisualStudio.SlowCheetah.4.0.8\build\Microsoft.VisualStudio.SlowCheetah.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.SlowCheetah.4.0.8\build\Microsoft.VisualStudio.SlowCheetah.targets')" />
|
<Import Project="..\packages\Microsoft.VisualStudio.SlowCheetah.4.0.8\build\Microsoft.VisualStudio.SlowCheetah.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.SlowCheetah.4.0.8\build\Microsoft.VisualStudio.SlowCheetah.targets')" />
|
||||||
|
<Import Project="..\packages\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.targets" Condition="Exists('..\packages\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.targets')" />
|
||||||
</Project>
|
</Project>
|
||||||
BIN
eDosStation/extra/devcon.exe
Normal file
BIN
eDosStation/extra/devcon.exe
Normal file
Binary file not shown.
|
|
@ -9,8 +9,8 @@
|
||||||
<package id="SharpDX.Direct3D10" version="4.2.0" targetFramework="net48" />
|
<package id="SharpDX.Direct3D10" version="4.2.0" targetFramework="net48" />
|
||||||
<package id="SharpDX.Direct3D9" version="4.2.0" targetFramework="net48" />
|
<package id="SharpDX.Direct3D9" version="4.2.0" targetFramework="net48" />
|
||||||
<package id="SharpDX.DXGI" version="4.2.0" targetFramework="net48" />
|
<package id="SharpDX.DXGI" version="4.2.0" targetFramework="net48" />
|
||||||
<package id="Telerik.Windows.Controls.for.Wpf.Xaml" version="2022.1.117" targetFramework="net48" />
|
<package id="Telerik.Windows.Controls.for.Wpf.Xaml" version="2022.1.222" targetFramework="net48" />
|
||||||
<package id="Telerik.Windows.Controls.GridView.for.Wpf.Xaml" version="2022.1.117" targetFramework="net48" />
|
<package id="Telerik.Windows.Controls.GridView.for.Wpf.Xaml" version="2022.1.222" targetFramework="net48" />
|
||||||
<package id="Telerik.Windows.Controls.Input.for.Wpf.Xaml" version="2022.1.117" targetFramework="net48" />
|
<package id="Telerik.Windows.Controls.Input.for.Wpf.Xaml" version="2022.1.222" targetFramework="net48" />
|
||||||
<package id="Telerik.Windows.Data.for.Wpf.Xaml" version="2022.1.117" targetFramework="net48" />
|
<package id="Telerik.Windows.Data.for.Wpf.Xaml" version="2022.1.222" targetFramework="net48" />
|
||||||
</packages>
|
</packages>
|
||||||
Loading…
Add table
Reference in a new issue