uitgebreide logging
This commit is contained in:
parent
b7e83379c3
commit
f35159a76c
10 changed files with 181 additions and 109 deletions
|
|
@ -20,14 +20,33 @@ namespace eDosStation
|
|||
|
||||
public System.IntPtr moduleHandle;
|
||||
|
||||
|
||||
public bool TestOrCreateFolder(string fn)
|
||||
{
|
||||
bool rv = true;
|
||||
try
|
||||
{
|
||||
if (!System.IO.Directory.Exists(fn))
|
||||
{
|
||||
if (System.IO.File.Exists(fn)) System.IO.File.Delete(fn);
|
||||
System.IO.Directory.CreateDirectory(fn);
|
||||
}
|
||||
}
|
||||
catch { rv = false; }
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
private void Application_Startup(object sender, StartupEventArgs e)
|
||||
{
|
||||
//var pth1 = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "EpdBaseClr.dll");
|
||||
//var pth2 = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Reader2.dll");
|
||||
|
||||
|
||||
//moduleHandle = LoadLibraryEx(pth2, IntPtr.Zero, 0);
|
||||
//moduleHandle = LoadLibraryEx(pth1, IntPtr.Zero, 0);
|
||||
|
||||
TestOrCreateFolder("c:/temp");
|
||||
TestOrCreateFolder("c:/Logs");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ namespace eDosStation
|
|||
public LSWDesfirePublic.CCard dfReader = null;
|
||||
static User _User;
|
||||
DataSet1.GetTaskInfoRow CurTaskRow;
|
||||
eDosStation.DataSet1 dataSet1;
|
||||
|
||||
private DateTime ResultTime;
|
||||
enum eCOE { quiz = 1 };
|
||||
#if SimulateEPD
|
||||
|
|
@ -35,18 +37,7 @@ namespace eDosStation
|
|||
{
|
||||
InitializeComponent();
|
||||
dataInterface = curStation.dataInterface;
|
||||
try
|
||||
{
|
||||
ep = new EpdBaseClr.Epd2(curStation.ComPort);
|
||||
ep.SetFeedbackSound(curStation.useBeep, curStation.useBeepMK3());
|
||||
ep.EpdRead += Ep_EpdRead;
|
||||
ep.EpdError += Ep_EpdError;
|
||||
ep.EpdTO += Ep_EpdTO;
|
||||
} catch (System.Exception ex)
|
||||
{
|
||||
MessageBox.Show($"{ex.Message}");
|
||||
ep = null;
|
||||
}
|
||||
|
||||
thisStation = curStation;
|
||||
_User = null;
|
||||
taskLoading = false;
|
||||
|
|
@ -312,7 +303,8 @@ namespace eDosStation
|
|||
}
|
||||
private void SetFilter(bool isAlara)
|
||||
{
|
||||
dataInterface.stationLog?.WriteLine($"SetFilter Start {DateTime.Now.ToString("HH:mm:ss.fff")}");
|
||||
string TaskName = "SetFilter";
|
||||
dataInterface.stationLog?.WriteLine($"{TaskName} Start {DateTime.Now.ToString("HH:mm:ss.fff")}");
|
||||
taskLoading = true; TaskOK.IsEnabled = false;
|
||||
Inst1 = (cbInst1.IsChecked == true) && thisStation.Inst_CODE1 > 0;
|
||||
Inst2 = (cbInst2.IsChecked == true) && thisStation.Inst_CODE2 > 0;
|
||||
|
|
@ -329,24 +321,26 @@ namespace eDosStation
|
|||
if (Inst2 ) fi.Append(thisStation.Inst_CODE2.ToString());
|
||||
fi.Append($") AND TaskType_CODE {(isAlara ? ">=" : "<")} '1000' ) ");
|
||||
}
|
||||
//fi.Append(" and TaskEnable=1");
|
||||
|
||||
string filter = fi.ToString();
|
||||
thisStation.splunkLog?.KvSet(LSWLib.CLog.skeys.sqlWhere, filter);
|
||||
|
||||
System.Windows.Data.CollectionViewSource getTaskListViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("getTaskListViewSource")));
|
||||
var dv = getTaskListViewSource.View.SourceCollection as DataView;
|
||||
//if (isAlara) dv.RowFilter = "ID_Task>=1000"; else dv.RowFilter = "ID_Task<1000";
|
||||
try
|
||||
{
|
||||
dataInterface.stationLog?.WriteLine($"filter = {fi.ToString()}");
|
||||
dv.RowFilter = fi.ToString();
|
||||
var dv = getTaskListViewSource.View.SourceCollection as DataView;
|
||||
dataInterface.stationLog?.WriteLine($"filter = {filter}");
|
||||
dv.RowFilter = filter;
|
||||
dv.Sort = "TaskType_CODE";
|
||||
getTaskListViewSource.View.MoveCurrentTo(null);
|
||||
} catch (System.Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
dataInterface.stationLog?.WriteLine($"SetFilter Error {ex.Message}");
|
||||
thisStation.splunkLog?.WriteException(TaskName, "rowFilter", ex);
|
||||
dataInterface.stationLog?.WriteLine($"{TaskName} Error {ex.Message}");
|
||||
}
|
||||
getTaskListViewSource.View.MoveCurrentTo(null);
|
||||
taskLoading = false;
|
||||
dataInterface.stationLog?.WriteLine($"SetFilter Stop {DateTime.Now.ToString("HH:mm:ss.fff")}");
|
||||
thisStation.splunkLog?.WriteSplunkLog(TaskName, LSWLib.CLog.iseverity.info);
|
||||
}
|
||||
public string getCommentUnknown()
|
||||
{
|
||||
|
|
@ -360,7 +354,6 @@ namespace eDosStation
|
|||
res.AppendLine("---");
|
||||
return res.ToString();
|
||||
}
|
||||
|
||||
public string getCommentOnEvent(string prefix, int id)
|
||||
{
|
||||
string res = string.Empty;
|
||||
|
|
@ -380,25 +373,25 @@ namespace eDosStation
|
|||
/// Get User data
|
||||
/// </summary>
|
||||
/// <returns>doCancel</returns>
|
||||
bool ShowUserInfo()
|
||||
void ShowUserInfo()
|
||||
{
|
||||
const string taskName = "ShowUserInfo";
|
||||
dataInterface.stationLog?.WriteLine($"ShowUserInfo Start {DateTime.Now.ToString("HH:mm:ss.fff")}");
|
||||
bool doCancel = false;
|
||||
|
||||
UserSeconds = 10;
|
||||
//UserScreen
|
||||
string ReasonNoAccess = string.Empty;
|
||||
dispatcherTimer = null;
|
||||
if (_User.PersID == 0)
|
||||
{
|
||||
thisStation.splunkLog?.WriteSplunkLog(taskName, LSWLib.CLog.iseverity.info,"PersID 0 no access");
|
||||
tReasonNoAccess.Text = getCommentUnknown();
|
||||
if (_User.Error > 0) tReasonNoAccess.Text = _User.ErrorMessage;
|
||||
tbNotAllowed.IsSelected = true;
|
||||
doCancel = true;
|
||||
Dispatcher.InvokeAsync(() => { endPage(); });
|
||||
}
|
||||
else
|
||||
{
|
||||
doCancel = false;
|
||||
tbUser.IsSelected = true;
|
||||
if (_User == null || _User.VisitIDLocked > 0 || _User.AccessAllow == false || _User.hasEPD)
|
||||
{
|
||||
|
|
@ -419,34 +412,37 @@ namespace eDosStation
|
|||
|
||||
if (!string.IsNullOrWhiteSpace(ReasonNoAccess))
|
||||
UserAccess.Text = ReasonNoAccess;
|
||||
else
|
||||
//UserAccess.Text = "Welcome to eDOS";
|
||||
doCancel = false;
|
||||
|
||||
Username.Text = _User.FullUserName();
|
||||
|
||||
if (!_User.HasMessage())
|
||||
|
||||
Username.Text = _User.FullUserName();
|
||||
string msg = string.Empty;
|
||||
if (!_User.HasMessage() && string.IsNullOrEmpty(ReasonNoAccess))
|
||||
{
|
||||
dataInterface.stationLog?.WriteLine($"ShowUserInfo to AskTask {DateTime.Now.ToString("HH:mm:ss.fff")}");
|
||||
msg = $"ShowUserInfo to AskTask {DateTime.Now.ToString("HH:mm:ss.fff")}";
|
||||
dataInterface.stationLog?.WriteLine(msg);
|
||||
thisStation.splunkLog?.WriteSplunkLog(taskName, LSWLib.CLog.iseverity.info, msg);
|
||||
pUserSeconds.Visibility = Visibility.Collapsed;
|
||||
pUserSeconds.Maximum = pUserSeconds.Value = 1;
|
||||
Dispatcher.InvokeAsync(AskTask, DispatcherPriority.Normal);
|
||||
}
|
||||
else
|
||||
{
|
||||
dataInterface.stationLog?.WriteLine($"ShowUserInfo add timer {DateTime.Now.ToString("HH:mm:ss.fff")}");
|
||||
msg = $"ShowUserInfo add timer {DateTime.Now.ToString("HH:mm:ss.fff")}";
|
||||
dataInterface.stationLog?.WriteLine(msg);
|
||||
thisStation.splunkLog?.WriteSplunkLog(taskName, LSWLib.CLog.iseverity.info, msg);
|
||||
tReasonNoAccess.Text = ReasonNoAccess;
|
||||
pUserSeconds.Visibility = Visibility.Visible;
|
||||
pUserSeconds.Maximum = pUserSeconds.Value = UserSeconds;
|
||||
pUserSeconds.Maximum = pUserSeconds.Value = UserSeconds;
|
||||
dispatcherTimer = new DispatcherTimer(DispatcherPriority.Background);
|
||||
dispatcherTimer.Interval = TimeSpan.FromSeconds(1);
|
||||
dispatcherTimer.Tick += SwitchToTask;
|
||||
dispatcherTimer.Start();
|
||||
thisStation.splunkLog?.WriteSplunkLog(taskName, LSWLib.CLog.iseverity.info, "Timer");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
dataInterface.stationLog?.WriteLine($"ShowUserInfo Stop {DateTime.Now.ToString("HH:mm:ss.fff")}");
|
||||
return doCancel;
|
||||
|
||||
return ;
|
||||
}
|
||||
private void SwitchToTask(object sender, EventArgs e)
|
||||
{
|
||||
|
|
@ -457,21 +453,20 @@ namespace eDosStation
|
|||
}
|
||||
else
|
||||
{
|
||||
//dispatcherTimer.Stop();
|
||||
//dispatcherTimer.Tick -= SwitchToTask;
|
||||
dispatcherTimer = null;
|
||||
if (_User.AllOk == true) Dispatcher.InvokeAsync(AskTask, DispatcherPriority.Normal);
|
||||
if (_User.AllOk == true && !_User.hasEPD) Dispatcher.InvokeAsync(AskTask, DispatcherPriority.Normal);
|
||||
else Dispatcher.InvokeAsync(() => {endPage(); });
|
||||
}
|
||||
}
|
||||
void AskTask()
|
||||
{
|
||||
thisStation.splunkLog?.WriteSplunkLog("AskTask", LSWLib.CLog.iseverity.info);
|
||||
tbTask.IsSelected = true;
|
||||
Naam.Text = _User.FirstName + " " + _User.LastName;
|
||||
eDosStation.DataSet1 dataSet1 = ((eDosStation.DataSet1)(this.FindResource("dataSet1")));
|
||||
dataSet1 = ((eDosStation.DataSet1)(this.FindResource("dataSet1")));
|
||||
dataInterface.FillTaskInfo(_User, dataSet1);
|
||||
bool isAlara = (cbAlara.IsChecked == true);
|
||||
Dispatcher.InvokeAsync(() => { SetFilter(isAlara); });
|
||||
SetFilter(isAlara);
|
||||
}
|
||||
void CheckBadge()
|
||||
{
|
||||
|
|
@ -479,6 +474,8 @@ namespace eDosStation
|
|||
#if DEBUG
|
||||
//_User.UserComment = "Hallo";
|
||||
#endif
|
||||
thisStation.splunkLog?.KvAdd(LSWLib.CLog.skeys.persID, _User.PersID);
|
||||
thisStation.splunkLog?.WriteSplunkLog("CheckBadge", LSWLib.CLog.iseverity.info, _User.PersID.ToString(),null);
|
||||
Dispatcher.InvokeAsync(() => { ShowUserInfo(); });
|
||||
}
|
||||
public void showBadge(int persID, string csn)
|
||||
|
|
@ -562,29 +559,41 @@ namespace eDosStation
|
|||
}
|
||||
private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (taskLoading) return;
|
||||
const string TaskName = "ListBox_SelectionChanged";
|
||||
if (taskLoading ) return;
|
||||
var lb = sender as ListBox;
|
||||
DataRowView o = null;
|
||||
if (lb == null || !lb.Name.Equals("LB1")) return;
|
||||
|
||||
bool exceeded = false;
|
||||
e.Handled = true;
|
||||
DataSet1.GetTaskInfoRow o = null;
|
||||
if (e.AddedItems.Count > 0)
|
||||
{
|
||||
o = e.AddedItems[0] as DataRowView;
|
||||
o = ((DataRowView) e.AddedItems[0]).Row as DataSet1.GetTaskInfoRow;
|
||||
TaskOK.IsEnabled = true;
|
||||
}
|
||||
bool exceeded = false;
|
||||
thisStation.splunkLog?.KvClear();
|
||||
thisStation.splunkLog?.KvAdd(LSWLib.CLog.skeys.persID, _User.PersID);
|
||||
|
||||
if (o != null)
|
||||
{
|
||||
exceeded = (((DataSet1.GetTaskInfoRow)o.Row).MarginExceeded);
|
||||
}
|
||||
exceeded = o.MarginExceeded;
|
||||
thisStation.splunkLog?.KvAdd(LSWLib.CLog.skeys.TaskCode, o.TaskType_CODE);
|
||||
TaskOK.Content = "Task"; TaskOK.Tag = "B";
|
||||
}
|
||||
if (_User == null) { TaskOK.Content = "Badge"; TaskOK.Tag = "B"; }
|
||||
else if (!_User.AllOk)
|
||||
{
|
||||
if (_User.AccessAllow != true) { TaskOK.Content = "No Access"; TaskOK.Tag = "A"; }
|
||||
else if (_User.VisitIDLocked > 0) { TaskOK.Content = "Locked"; TaskOK.Tag = "L"; }
|
||||
else if (exceeded == true) { TaskOK.Content = "No Margin"; TaskOK.Tag = "M"; }
|
||||
dataInterface.stationLog?.WriteLine($"User {_User.PersID} not ok ");
|
||||
thisStation.splunkLog?.WriteSplunkLog(TaskName, LSWLib.CLog.iseverity.warning, TaskOK.Content.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
TaskOK.Content = "OK"; TaskOK.Tag = "O";
|
||||
thisStation.splunkLog?.WriteSplunkLog(TaskName, LSWLib.CLog.iseverity.info);
|
||||
}
|
||||
}
|
||||
private void CbInst1_Click(object sender, RoutedEventArgs e)
|
||||
|
|
@ -707,13 +716,29 @@ namespace eDosStation
|
|||
Inst2 = false;
|
||||
cbInst2.IsChecked = Inst2;
|
||||
}
|
||||
|
||||
dataInterface.FillComment();
|
||||
|
||||
initialising = false;
|
||||
|
||||
if (thisStation.useTestButtons) AddTestButtons();
|
||||
taskLoading = false;
|
||||
|
||||
//StartEPD
|
||||
if (ep==null)
|
||||
try
|
||||
{
|
||||
ep = new EpdBaseClr.Epd2(thisStation.ComPort);
|
||||
ep.SetFeedbackSound(thisStation.useBeep, thisStation.useBeepMK3());
|
||||
ep.EpdRead += Ep_EpdRead;
|
||||
ep.EpdError += Ep_EpdError;
|
||||
ep.EpdTO += Ep_EpdTO;
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
thisStation.splunkLog.WriteException(null, "StartEpd", ex);
|
||||
MessageBox.Show($"{ex.Message}");
|
||||
ep = null;
|
||||
}
|
||||
|
||||
//StartBadge
|
||||
if (dfReader == null)
|
||||
{
|
||||
dfReader = new LSWDesfirePublic.CCard();
|
||||
|
|
@ -725,7 +750,6 @@ namespace eDosStation
|
|||
dfReader.BadgeTO += DfReader_BadgeTO;
|
||||
dfReader.BadgeError += DfReader_BadgeError;
|
||||
ReaderTask = dfReader.Wait(PageTimeout,10);
|
||||
//dfReader.WaitForBadge();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -736,7 +760,7 @@ namespace eDosStation
|
|||
dfReader.Dispose(); dfReader = null;
|
||||
}
|
||||
}
|
||||
taskLoading = false;
|
||||
|
||||
}
|
||||
private void DfReader_BadgeError(LSWDesfirePublic.CCard Sender, LSWDesfirePublic.BadgeErrorEventArgs e)
|
||||
{
|
||||
|
|
@ -786,8 +810,6 @@ namespace eDosStation
|
|||
SelectTask(numPanelDisplay.Text);
|
||||
scrollTask.Visibility = Visibility.Visible;
|
||||
numPanel.Visibility = Visibility.Collapsed;
|
||||
//getTaskListViewSource
|
||||
//var x = this.findvie
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -811,9 +833,11 @@ namespace eDosStation
|
|||
if (e.PersID > 0)
|
||||
this.Dispatcher.InvokeAsync(new Action(() => showBadge(e.PersID, e.UID)), DispatcherPriority.Background);
|
||||
else
|
||||
MessageBox.Show("No PersID found on badge " + e.UID, "Error", MessageBoxButton.OK);
|
||||
{
|
||||
string msg = $"No PersID found on badge {e.UID}";
|
||||
MessageBox.Show(msg, "Error",MessageBoxButton.OK);
|
||||
thisStation.splunkLog?.WriteSplunkLog("Badged", LSWLib.CLog.iseverity.warning, null, msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Style="{Binding Mode=OneWay, Source={StaticResource CustomScrollViewer}}"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,24 +41,39 @@ namespace eDosStation
|
|||
|
||||
private void BEntry_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string ers=string.Empty;
|
||||
thisStation.splunkLog?.WriteSplunkLog("Entry", LSWLib.CLog.iseverity.info);
|
||||
|
||||
var w = new EntryBadge(thisStation);
|
||||
w.ShowDialog();
|
||||
#if SimulateEPD
|
||||
simulData = w.simulData;
|
||||
#endif
|
||||
w = null;
|
||||
if (thisStation.RestartCom) devcon.Restart();
|
||||
if (thisStation.RestartCom)
|
||||
{
|
||||
ers = devcon.Restart();
|
||||
if (!string.IsNullOrEmpty(ers)) thisStation.splunkLog?.WriteSplunkLog("Restart USB error", LSWLib.CLog.iseverity.err, null, ers); ;
|
||||
}
|
||||
thisStation.splunkLog?.WriteSplunkLog("Entry done", LSWLib.CLog.iseverity.info);
|
||||
}
|
||||
|
||||
private void BExit_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string ers = string.Empty;
|
||||
thisStation.splunkLog?.WriteSplunkLog("Exit", LSWLib.CLog.iseverity.info);
|
||||
var w = new EpdExit(thisStation);
|
||||
#if SimulateEPD
|
||||
w.simulData = simulData;
|
||||
#endif
|
||||
w.ShowDialog();
|
||||
w = null;
|
||||
if (thisStation.RestartCom) devcon.Restart();
|
||||
if (thisStation.RestartCom)
|
||||
{
|
||||
ers = devcon.Restart();
|
||||
if (!string.IsNullOrEmpty(ers)) thisStation?.splunkLog.WriteSplunkLog("Restart USB error", LSWLib.CLog.iseverity.err, null, ers); ;
|
||||
}
|
||||
thisStation.splunkLog?.WriteSplunkLog("Exit Done", LSWLib.CLog.iseverity.info);
|
||||
}
|
||||
|
||||
private void MenuItem_Click(object sender, RoutedEventArgs e)
|
||||
|
|
@ -67,21 +82,23 @@ namespace eDosStation
|
|||
s.ShowDialog();
|
||||
}
|
||||
|
||||
|
||||
private void setLocalStatus()
|
||||
{
|
||||
if (!dataInterface.isOnline())
|
||||
{
|
||||
Status.Content = "*** Offline ***";
|
||||
thisStation.splunkLog?.WriteSplunkLog("Went Offline", LSWLib.CLog.iseverity.warning);
|
||||
}
|
||||
else
|
||||
{
|
||||
Status.Content = "--- Online ---";
|
||||
thisStation.splunkLog?.WriteSplunkLog("Back online", LSWLib.CLog.iseverity.info);
|
||||
}
|
||||
}
|
||||
|
||||
private void setErrorStatus(string errMsg)
|
||||
{
|
||||
thisStation.splunkLog?.WriteSplunkLog("Errorstatus", LSWLib.CLog.iseverity.err,null,errMsg);
|
||||
Status.Content = $"*** Error {errMsg} ***";
|
||||
Status.Foreground = Brushes.Yellow;
|
||||
Status.Background = Brushes.Red;
|
||||
|
|
@ -117,29 +134,30 @@ namespace eDosStation
|
|||
ok = false;
|
||||
}
|
||||
|
||||
if (ok)
|
||||
try
|
||||
{
|
||||
//var sp = new System.IO.Ports.SerialPort($"com{thisStation.ComPort}");
|
||||
//sp.BaudRate = 9600;
|
||||
//sp.Parity = System.IO.Ports.Parity.None;
|
||||
//sp.StopBits = System.IO.Ports.StopBits.One;
|
||||
//sp.Open();
|
||||
//sp.DiscardInBuffer();
|
||||
//sp.Close();
|
||||
#if SimulateEPD
|
||||
thisStation.ComPort = 0;
|
||||
#endif
|
||||
//ep = new EpdBaseClr.Epd2(thisStation.ComPort);
|
||||
//ep.SetFeedbackSound(thisStation.useBeep);
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
errMsg = $"Edp software error {ex.Message}";
|
||||
MessageBox.Show(errMsg);
|
||||
ok = false;
|
||||
dataInterface.stationLog?.WriteLine($"Window_Loaded {ex.Message}");
|
||||
}
|
||||
// if (ok)
|
||||
// try
|
||||
// {
|
||||
// //var sp = new System.IO.Ports.SerialPort($"com{thisStation.ComPort}");
|
||||
// //sp.BaudRate = 9600;
|
||||
// //sp.Parity = System.IO.Ports.Parity.None;
|
||||
// //sp.StopBits = System.IO.Ports.StopBits.One;
|
||||
// //sp.Open();
|
||||
// //sp.DiscardInBuffer();
|
||||
// //sp.Close();
|
||||
//#if SimulateEPD
|
||||
// thisStation.ComPort = 0;
|
||||
//#endif
|
||||
// //ep = new EpdBaseClr.Epd2(thisStation.ComPort);
|
||||
// //ep.SetFeedbackSound(thisStation.useBeep);
|
||||
// }
|
||||
// catch (System.Exception ex)
|
||||
// {
|
||||
// errMsg = $"Edp software error {ex.Message}";
|
||||
// MessageBox.Show(errMsg);
|
||||
// ok = false;
|
||||
// thisStation.splunkLog.WriteException("mainWindow", "Epd", ex);
|
||||
// dataInterface.stationLog?.WriteLine($"Window_Loaded {ex.Message}");
|
||||
// }
|
||||
if (ok)
|
||||
{
|
||||
if (thisStation.insComments.Length > 2)
|
||||
|
|
@ -185,12 +203,13 @@ namespace eDosStation
|
|||
{
|
||||
About x = new About(thisStation);
|
||||
x.ShowDialog();
|
||||
|
||||
}
|
||||
|
||||
private void mExit_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
dataInterface.stationLog?.Close();
|
||||
thisStation.splunkLog.KvClear();
|
||||
thisStation.splunkLog?.CloseSplunkLog();
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,5 +51,5 @@ using System.Windows;
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.5.5.0")]
|
||||
[assembly: AssemblyFileVersion("2.5.5.0")]
|
||||
[assembly: AssemblyVersion("2.5.6.0")]
|
||||
[assembly: AssemblyFileVersion("2.5.6.0")]
|
||||
|
|
|
|||
|
|
@ -7,11 +7,12 @@ using System.Threading.Tasks;
|
|||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
|
||||
using spl1 = LSWLib.CLog;
|
||||
namespace eDosStation
|
||||
{
|
||||
public class Station
|
||||
{
|
||||
public spl1 splunkLog;
|
||||
private bool doLog;
|
||||
public System.IO.StreamWriter stationLog=null;
|
||||
public int ID_Station { get; set; }
|
||||
|
|
@ -26,7 +27,6 @@ namespace eDosStation
|
|||
public bool useTestButtons { get; set; }
|
||||
public byte useBeep { get; set; }
|
||||
public bool checkUser { get; internal set; }
|
||||
|
||||
public bool RestartCom { get; set; }
|
||||
public int EPDTimeOut { get; internal set; }
|
||||
public int EPDRetries { get; internal set; }
|
||||
|
|
@ -49,6 +49,7 @@ namespace eDosStation
|
|||
|
||||
public Station(DataInterface mDataInterface, string Station)
|
||||
{
|
||||
splunkLog = new spl1(Environment.MachineName);
|
||||
stationLog = null;
|
||||
dataInterface = mDataInterface;
|
||||
Error = 0;
|
||||
|
|
@ -165,11 +166,14 @@ namespace eDosStation
|
|||
EPDRetries = 2;
|
||||
}
|
||||
rs.Close();
|
||||
splunkLog.WriteSplunkLog("StationInit", spl1.iseverity.info);
|
||||
Error = 0;
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
Error = 1;
|
||||
ErrorMessage = ex.Message;
|
||||
splunkLog.WriteException(null,"StationInit", ex);
|
||||
if (stationLog != null) stationLog.WriteLine($"GetStationSettings error {ex.Message} {System.DateTime.Now}");
|
||||
}
|
||||
}
|
||||
|
|
@ -214,7 +218,6 @@ namespace eDosStation
|
|||
}
|
||||
|
||||
|
||||
|
||||
private void CmdSetParams(SqlCommand cmd)
|
||||
{
|
||||
//for (int ix = 0; ix < cmd.Parameters.Count; ix++)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ namespace eDosStation
|
|||
{
|
||||
class devcon
|
||||
{
|
||||
static StringBuilder error = null;
|
||||
static bool hasError;
|
||||
static private string ExecuteDevcon(string command)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
|
@ -37,9 +39,10 @@ namespace eDosStation
|
|||
}
|
||||
p.WaitForExit();
|
||||
}
|
||||
} catch
|
||||
} catch(System.Exception ex)
|
||||
{
|
||||
|
||||
hasError = true;
|
||||
error.Append(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -59,9 +62,11 @@ namespace eDosStation
|
|||
return eDosCom;
|
||||
}
|
||||
|
||||
static public void Restart()
|
||||
static public string Restart()
|
||||
{
|
||||
error = new StringBuilder(); hasError = false;
|
||||
string cp = devcon.ExecuteDevcon("restart");
|
||||
if (hasError) return error.ToString(); else return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\LSWLib.3.0.8\build\LSWLib.props" Condition="Exists('..\packages\LSWLib.3.0.8\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\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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
|
@ -333,16 +333,16 @@
|
|||
<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>
|
||||
</PropertyGroup>
|
||||
<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\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'))" />
|
||||
<Error Condition="!Exists('..\packages\LSWLib.3.0.8\build\LSWLib.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LSWLib.3.0.8\build\LSWLib.props'))" />
|
||||
<Error Condition="!Exists('..\packages\LSWLib.3.0.8\build\LSWLib.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LSWLib.3.0.8\build\LSWLib.targets'))" />
|
||||
</Target>
|
||||
<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>
|
||||
</PropertyGroup>
|
||||
<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\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.targets" Condition="Exists('..\packages\LSWDesfirePublic.1.3.9\build\LSWDesfirePublic.targets')" />
|
||||
<Import Project="..\packages\LSWLib.3.0.8\build\LSWLib.targets" Condition="Exists('..\packages\LSWLib.3.0.8\build\LSWLib.targets')" />
|
||||
</Project>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="LSWDesfirePublic" version="1.3.9" targetFramework="net48" />
|
||||
<package id="LSWLib" version="3.0.6" targetFramework="net48" />
|
||||
<package id="LSWLib" version="3.0.8" targetFramework="net48" />
|
||||
<package id="Microsoft.VisualStudio.SlowCheetah" version="4.0.8" targetFramework="net48" developmentDependency="true" />
|
||||
<package id="SharpDX" version="4.2.0" targetFramework="net48" />
|
||||
<package id="SharpDX.D3DCompiler" version="4.2.0" targetFramework="net48" />
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="LSWLib" version="1.0.8" targetFramework="net48" />
|
||||
<package id="Microsoft.VisualStudio.SlowCheetah" version="3.2.26" targetFramework="net472" developmentDependency="true" />
|
||||
<package id="LSWLib" version="3.0.8" targetFramework="net48" />
|
||||
<package id="Microsoft.VisualStudio.SlowCheetah" version="4.0.8" targetFramework="net48" developmentDependency="true" />
|
||||
</packages>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\LSWLib.1.0.8\build\LSWLib.props" Condition="Exists('..\packages\LSWLib.1.0.8\build\LSWLib.props')" />
|
||||
<Import Project="..\packages\LSWLib.3.0.8\build\LSWLib.props" Condition="Exists('..\packages\LSWLib.3.0.8\build\LSWLib.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
|
@ -40,6 +40,8 @@
|
|||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Runtime" />
|
||||
<Reference Include="System.Runtime.InteropServices" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
|
|
@ -98,14 +100,14 @@
|
|||
</Content>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\packages\Microsoft.VisualStudio.SlowCheetah.3.2.26\build\Microsoft.VisualStudio.SlowCheetah.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.SlowCheetah.3.2.26\build\Microsoft.VisualStudio.SlowCheetah.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<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>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.SlowCheetah.3.2.26\build\Microsoft.VisualStudio.SlowCheetah.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VisualStudio.SlowCheetah.3.2.26\build\Microsoft.VisualStudio.SlowCheetah.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\LSWLib.1.0.8\build\LSWLib.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LSWLib.1.0.8\build\LSWLib.props'))" />
|
||||
<Error Condition="!Exists('..\packages\LSWLib.1.0.8\build\LSWLib.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LSWLib.1.0.8\build\LSWLib.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\LSWLib.3.0.8\build\LSWLib.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LSWLib.3.0.8\build\LSWLib.props'))" />
|
||||
<Error Condition="!Exists('..\packages\LSWLib.3.0.8\build\LSWLib.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LSWLib.3.0.8\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'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\LSWLib.1.0.8\build\LSWLib.targets" Condition="Exists('..\packages\LSWLib.1.0.8\build\LSWLib.targets')" />
|
||||
<Import Project="..\packages\LSWLib.3.0.8\build\LSWLib.targets" Condition="Exists('..\packages\LSWLib.3.0.8\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')" />
|
||||
</Project>
|
||||
Loading…
Add table
Reference in a new issue