working 1
This commit is contained in:
parent
bd44ce11d6
commit
4c713b89df
19 changed files with 491 additions and 91 deletions
|
|
@ -24,7 +24,8 @@ void EpdBase::Epd2U::StartDiscover()
|
|||
FlushDiscoveryCache(port);
|
||||
DiscRV= Discover(port, DeviceIDs, MaxDevices, &DeviceCount);
|
||||
Commit();
|
||||
if (DiscRV == 1 && DeviceCount == 0) {
|
||||
if (DiscRV == 1 && DeviceCount == 0)
|
||||
{
|
||||
OnRV = EpdOn();
|
||||
Commit();
|
||||
Sleep(1100);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@ int EpdBaseClr::Epd2::Connect()
|
|||
{
|
||||
b->CurrentDeviceID = 0;
|
||||
epd->StartDiscover();
|
||||
DiscRV = epd->DiscRV;
|
||||
DiscRV = epd->DeviceCount;
|
||||
DeviceCount = epd->DeviceCount;
|
||||
if (epd->DiscRV == 1 && epd->DeviceCount >= 0) b->CurrentDeviceID = epd->DeviceIDs[0];
|
||||
return DiscRV;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ namespace EpdBaseClr {
|
|||
int DiscRV;
|
||||
int StatusRV;
|
||||
int ReadDosesRV;
|
||||
int DeviceCount = 0;
|
||||
|
||||
|
||||
double Hp07;
|
||||
|
|
|
|||
30
eDosStation/Converters.cs
Normal file
30
eDosStation/Converters.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace eDosStation
|
||||
{
|
||||
class Converters
|
||||
{
|
||||
|
||||
public class BrushColorConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
Color rv = System.Windows.Media.Colors.Green;
|
||||
if (value == null || (bool?)value ==true ) rv = System.Windows.Media.Colors.Red;
|
||||
return new SolidColorBrush(rv);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
110
eDosStation/DataSet1.Designer.cs
generated
110
eDosStation/DataSet1.Designer.cs
generated
|
|
@ -667,6 +667,10 @@ namespace eDosStation {
|
|||
|
||||
private global::System.Data.DataColumn columnInst_CODE;
|
||||
|
||||
private global::System.Data.DataColumn columnMinWorkerDosisMargin;
|
||||
|
||||
private global::System.Data.DataColumn columnMarginExceeded;
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
public GetTaskInfoDataTable() {
|
||||
|
|
@ -876,6 +880,22 @@ namespace eDosStation {
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
public global::System.Data.DataColumn MinWorkerDosisMarginColumn {
|
||||
get {
|
||||
return this.columnMinWorkerDosisMargin;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
public global::System.Data.DataColumn MarginExceededColumn {
|
||||
get {
|
||||
return this.columnMarginExceeded;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
[global::System.ComponentModel.Browsable(false)]
|
||||
|
|
@ -934,7 +954,9 @@ namespace eDosStation {
|
|||
double FNGain_ANGainValue,
|
||||
string InstallationActivity,
|
||||
string Description,
|
||||
int Inst_CODE) {
|
||||
int Inst_CODE,
|
||||
double MinWorkerDosisMargin,
|
||||
bool MarginExceeded) {
|
||||
GetTaskInfoRow rowGetTaskInfoRow = ((GetTaskInfoRow)(this.NewRow()));
|
||||
object[] columnValuesArray = new object[] {
|
||||
null,
|
||||
|
|
@ -958,7 +980,9 @@ namespace eDosStation {
|
|||
FNGain_ANGainValue,
|
||||
InstallationActivity,
|
||||
Description,
|
||||
Inst_CODE};
|
||||
Inst_CODE,
|
||||
MinWorkerDosisMargin,
|
||||
MarginExceeded};
|
||||
rowGetTaskInfoRow.ItemArray = columnValuesArray;
|
||||
this.Rows.Add(rowGetTaskInfoRow);
|
||||
return rowGetTaskInfoRow;
|
||||
|
|
@ -1010,6 +1034,8 @@ namespace eDosStation {
|
|||
this.columnInstallationActivity = base.Columns["InstallationActivity"];
|
||||
this.columnDescription = base.Columns["Description"];
|
||||
this.columnInst_CODE = base.Columns["Inst_CODE"];
|
||||
this.columnMinWorkerDosisMargin = base.Columns["MinWorkerDosisMargin"];
|
||||
this.columnMarginExceeded = base.Columns["MarginExceeded"];
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
|
|
@ -1059,6 +1085,10 @@ namespace eDosStation {
|
|||
base.Columns.Add(this.columnDescription);
|
||||
this.columnInst_CODE = new global::System.Data.DataColumn("Inst_CODE", typeof(int), null, global::System.Data.MappingType.Element);
|
||||
base.Columns.Add(this.columnInst_CODE);
|
||||
this.columnMinWorkerDosisMargin = new global::System.Data.DataColumn("MinWorkerDosisMargin", typeof(double), null, global::System.Data.MappingType.Element);
|
||||
base.Columns.Add(this.columnMinWorkerDosisMargin);
|
||||
this.columnMarginExceeded = new global::System.Data.DataColumn("MarginExceeded", typeof(bool), null, global::System.Data.MappingType.Element);
|
||||
base.Columns.Add(this.columnMarginExceeded);
|
||||
this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
|
||||
this.columnID_Task}, true));
|
||||
this.columnID_Task.AutoIncrement = true;
|
||||
|
|
@ -1074,6 +1104,7 @@ namespace eDosStation {
|
|||
this.columnEPDRad.MaxLength = 2;
|
||||
this.columnInstallationActivity.MaxLength = 100;
|
||||
this.columnDescription.MaxLength = 500;
|
||||
this.columnMarginExceeded.ReadOnly = true;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
|
|
@ -1649,6 +1680,38 @@ namespace eDosStation {
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
public double MinWorkerDosisMargin {
|
||||
get {
|
||||
try {
|
||||
return ((double)(this[this.tableGetTaskInfo.MinWorkerDosisMarginColumn]));
|
||||
}
|
||||
catch (global::System.InvalidCastException e) {
|
||||
throw new global::System.Data.StrongTypingException("The value for column \'MinWorkerDosisMargin\' in table \'GetTaskInfo\' is DBNull.", e);
|
||||
}
|
||||
}
|
||||
set {
|
||||
this[this.tableGetTaskInfo.MinWorkerDosisMarginColumn] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
public bool MarginExceeded {
|
||||
get {
|
||||
try {
|
||||
return ((bool)(this[this.tableGetTaskInfo.MarginExceededColumn]));
|
||||
}
|
||||
catch (global::System.InvalidCastException e) {
|
||||
throw new global::System.Data.StrongTypingException("The value for column \'MarginExceeded\' in table \'GetTaskInfo\' is DBNull.", e);
|
||||
}
|
||||
}
|
||||
set {
|
||||
this[this.tableGetTaskInfo.MarginExceededColumn] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
public bool IsTask_NameNull() {
|
||||
|
|
@ -1888,6 +1951,30 @@ namespace eDosStation {
|
|||
public void SetInst_CODENull() {
|
||||
this[this.tableGetTaskInfo.Inst_CODEColumn] = global::System.Convert.DBNull;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
public bool IsMinWorkerDosisMarginNull() {
|
||||
return this.IsNull(this.tableGetTaskInfo.MinWorkerDosisMarginColumn);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
public void SetMinWorkerDosisMarginNull() {
|
||||
this[this.tableGetTaskInfo.MinWorkerDosisMarginColumn] = global::System.Convert.DBNull;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
public bool IsMarginExceededNull() {
|
||||
return this.IsNull(this.tableGetTaskInfo.MarginExceededColumn);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
public void SetMarginExceededNull() {
|
||||
this[this.tableGetTaskInfo.MarginExceededColumn] = global::System.Convert.DBNull;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -2276,6 +2363,8 @@ namespace eDosStation.DataSet1TableAdapters {
|
|||
tableMapping.ColumnMappings.Add("InstallationActivity", "InstallationActivity");
|
||||
tableMapping.ColumnMappings.Add("Description", "Description");
|
||||
tableMapping.ColumnMappings.Add("Inst_CODE", "Inst_CODE");
|
||||
tableMapping.ColumnMappings.Add("MinWorkerDosisMargin", "MinWorkerDosisMargin");
|
||||
tableMapping.ColumnMappings.Add("MarginExceeded", "MarginExceeded");
|
||||
this._adapter.TableMappings.Add(tableMapping);
|
||||
}
|
||||
|
||||
|
|
@ -2296,13 +2385,14 @@ namespace eDosStation.DataSet1TableAdapters {
|
|||
this._commandCollection[0].CommandType = global::System.Data.CommandType.StoredProcedure;
|
||||
this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ID_Task", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@WorkerDosisMargin", global::System.Data.SqlDbType.Float, 8, global::System.Data.ParameterDirection.Input, 53, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
|
||||
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
|
||||
public virtual int Fill(DataSet1.GetTaskInfoDataTable dataTable, global::System.Nullable<int> ID_Task) {
|
||||
public virtual int Fill(DataSet1.GetTaskInfoDataTable dataTable, global::System.Nullable<int> ID_Task, global::System.Nullable<double> WorkerDosisMargin) {
|
||||
this.Adapter.SelectCommand = this.CommandCollection[0];
|
||||
if ((ID_Task.HasValue == true)) {
|
||||
this.Adapter.SelectCommand.Parameters[1].Value = ((int)(ID_Task.Value));
|
||||
|
|
@ -2310,6 +2400,12 @@ namespace eDosStation.DataSet1TableAdapters {
|
|||
else {
|
||||
this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
|
||||
}
|
||||
if ((WorkerDosisMargin.HasValue == true)) {
|
||||
this.Adapter.SelectCommand.Parameters[2].Value = ((double)(WorkerDosisMargin.Value));
|
||||
}
|
||||
else {
|
||||
this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value;
|
||||
}
|
||||
if ((this.ClearBeforeFill == true)) {
|
||||
dataTable.Clear();
|
||||
}
|
||||
|
|
@ -2321,7 +2417,7 @@ namespace eDosStation.DataSet1TableAdapters {
|
|||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
|
||||
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
|
||||
public virtual DataSet1.GetTaskInfoDataTable GetData(global::System.Nullable<int> ID_Task) {
|
||||
public virtual DataSet1.GetTaskInfoDataTable GetData(global::System.Nullable<int> ID_Task, global::System.Nullable<double> WorkerDosisMargin) {
|
||||
this.Adapter.SelectCommand = this.CommandCollection[0];
|
||||
if ((ID_Task.HasValue == true)) {
|
||||
this.Adapter.SelectCommand.Parameters[1].Value = ((int)(ID_Task.Value));
|
||||
|
|
@ -2329,6 +2425,12 @@ namespace eDosStation.DataSet1TableAdapters {
|
|||
else {
|
||||
this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
|
||||
}
|
||||
if ((WorkerDosisMargin.HasValue == true)) {
|
||||
this.Adapter.SelectCommand.Parameters[2].Value = ((double)(WorkerDosisMargin.Value));
|
||||
}
|
||||
else {
|
||||
this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value;
|
||||
}
|
||||
DataSet1.GetTaskInfoDataTable dataTable = new DataSet1.GetTaskInfoDataTable();
|
||||
this.Adapter.Fill(dataTable);
|
||||
return dataTable;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
<Parameters>
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@ID_Task" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="float" DbType="Double" Direction="Input" ParameterName="@WorkerDosisMargin" Precision="53" ProviderType="Float" Scale="0" Size="8" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</SelectCommand>
|
||||
|
|
@ -65,6 +66,8 @@
|
|||
<Mapping SourceColumn="InstallationActivity" DataSetColumn="InstallationActivity" />
|
||||
<Mapping SourceColumn="Description" DataSetColumn="Description" />
|
||||
<Mapping SourceColumn="Inst_CODE" DataSetColumn="Inst_CODE" />
|
||||
<Mapping SourceColumn="MinWorkerDosisMargin" DataSetColumn="MinWorkerDosisMargin" />
|
||||
<Mapping SourceColumn="MarginExceeded" DataSetColumn="MarginExceeded" />
|
||||
</Mappings>
|
||||
<Sources />
|
||||
</TableAdapter>
|
||||
|
|
@ -76,7 +79,7 @@
|
|||
<xs:element name="DataSet1" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="DataSet1" msprop:Generator_UserDSName="DataSet1">
|
||||
<xs:complexType>
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="GetTaskList" msprop:Generator_TableClassName="GetTaskListDataTable" msprop:Generator_TableVarName="tableGetTaskList" msprop:Generator_TablePropName="GetTaskList" msprop:Generator_RowDeletingName="GetTaskListRowDeleting" msprop:Generator_RowChangingName="GetTaskListRowChanging" msprop:Generator_RowEvHandlerName="GetTaskListRowChangeEventHandler" msprop:Generator_RowDeletedName="GetTaskListRowDeleted" msprop:Generator_UserTableName="GetTaskList" msprop:Generator_RowChangedName="GetTaskListRowChanged" msprop:Generator_RowEvArgName="GetTaskListRowChangeEvent" msprop:Generator_RowClassName="GetTaskListRow">
|
||||
<xs:element name="GetTaskList" msprop:Generator_TableClassName="GetTaskListDataTable" msprop:Generator_TableVarName="tableGetTaskList" msprop:Generator_RowChangedName="GetTaskListRowChanged" msprop:Generator_TablePropName="GetTaskList" msprop:Generator_RowDeletingName="GetTaskListRowDeleting" msprop:Generator_RowChangingName="GetTaskListRowChanging" msprop:Generator_RowEvHandlerName="GetTaskListRowChangeEventHandler" msprop:Generator_RowDeletedName="GetTaskListRowDeleted" msprop:Generator_RowClassName="GetTaskListRow" msprop:Generator_UserTableName="GetTaskList" msprop:Generator_RowEvArgName="GetTaskListRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID_Task" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnID_Task" msprop:Generator_ColumnPropNameInRow="ID_Task" msprop:Generator_ColumnPropNameInTable="ID_TaskColumn" msprop:Generator_UserColumnName="ID_Task" type="xs:int" />
|
||||
|
|
@ -104,7 +107,7 @@
|
|||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="GetTaskInfo" msprop:Generator_TableClassName="GetTaskInfoDataTable" msprop:Generator_TableVarName="tableGetTaskInfo" msprop:Generator_RowChangedName="GetTaskInfoRowChanged" msprop:Generator_TablePropName="GetTaskInfo" msprop:Generator_RowDeletingName="GetTaskInfoRowDeleting" msprop:Generator_RowChangingName="GetTaskInfoRowChanging" msprop:Generator_RowEvHandlerName="GetTaskInfoRowChangeEventHandler" msprop:Generator_RowDeletedName="GetTaskInfoRowDeleted" msprop:Generator_RowClassName="GetTaskInfoRow" msprop:Generator_UserTableName="GetTaskInfo" msprop:Generator_RowEvArgName="GetTaskInfoRowChangeEvent">
|
||||
<xs:element name="GetTaskInfo" msprop:Generator_TableClassName="GetTaskInfoDataTable" msprop:Generator_TableVarName="tableGetTaskInfo" msprop:Generator_TablePropName="GetTaskInfo" msprop:Generator_RowDeletingName="GetTaskInfoRowDeleting" msprop:Generator_RowChangingName="GetTaskInfoRowChanging" msprop:Generator_RowEvHandlerName="GetTaskInfoRowChangeEventHandler" msprop:Generator_RowDeletedName="GetTaskInfoRowDeleted" msprop:Generator_UserTableName="GetTaskInfo" msprop:Generator_RowChangedName="GetTaskInfoRowChanged" msprop:Generator_RowEvArgName="GetTaskInfoRowChangeEvent" msprop:Generator_RowClassName="GetTaskInfoRow">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID_Task" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnID_Task" msprop:Generator_ColumnPropNameInRow="ID_Task" msprop:Generator_ColumnPropNameInTable="ID_TaskColumn" msprop:Generator_UserColumnName="ID_Task" type="xs:int" />
|
||||
|
|
@ -159,6 +162,8 @@
|
|||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="Inst_CODE" msprop:Generator_ColumnVarNameInTable="columnInst_CODE" msprop:Generator_ColumnPropNameInRow="Inst_CODE" msprop:Generator_ColumnPropNameInTable="Inst_CODEColumn" msprop:Generator_UserColumnName="Inst_CODE" type="xs:int" minOccurs="0" />
|
||||
<xs:element name="MinWorkerDosisMargin" msprop:Generator_ColumnVarNameInTable="columnMinWorkerDosisMargin" msprop:Generator_ColumnPropNameInRow="MinWorkerDosisMargin" msprop:Generator_ColumnPropNameInTable="MinWorkerDosisMarginColumn" msprop:Generator_UserColumnName="MinWorkerDosisMargin" type="xs:double" minOccurs="0" />
|
||||
<xs:element name="MarginExceeded" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnMarginExceeded" msprop:Generator_ColumnPropNameInRow="MarginExceeded" msprop:Generator_ColumnPropNameInTable="MarginExceededColumn" msprop:Generator_UserColumnName="MarginExceeded" type="xs:boolean" minOccurs="0" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="0" ViewPortY="0" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
|
||||
<Shapes>
|
||||
<Shape ID="DesignTable:GetTaskList" ZOrder="2" X="70" Y="70" Height="153" Width="211" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
|
||||
<Shape ID="DesignTable:GetTaskInfo" ZOrder="1" X="351" Y="70" Height="305" Width="215" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
|
||||
<Shape ID="DesignTable:GetTaskInfo" ZOrder="1" X="351" Y="70" Height="305" Width="270" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
|
||||
</Shapes>
|
||||
<Connectors />
|
||||
</DiagramLayout>
|
||||
|
|
@ -6,11 +6,16 @@
|
|||
xmlns:local="clr-namespace:eDosStation"
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="eDosStation.EntryBadge"
|
||||
mc:Ignorable="d"
|
||||
Title="EntryBadge" Height="450" Width="800" Loaded="Window_Loaded">
|
||||
Title="EntryBadge" Height="768" Width="1024" Loaded="Window_Loaded" FontFamily="Comic Sans MS">
|
||||
<Window.Resources>
|
||||
<local:DataSet1 x:Key="dataSet1"/>
|
||||
<CollectionViewSource x:Key="getTaskListViewSource" Source="{Binding GetTaskInfo, Source={StaticResource dataSet1}}"/>
|
||||
<local:Converters x:Key="BConverter"/>
|
||||
|
||||
|
||||
</Window.Resources>
|
||||
<DockPanel>
|
||||
|
||||
<TabControl Name="tb">
|
||||
<TabItem Header="Entry" Name="tbEntry">
|
||||
|
||||
|
|
@ -41,7 +46,17 @@
|
|||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Grid.Row="0" Background="AliceBlue" HorizontalAlignment="Stretch" CornerRadius="10" >
|
||||
<TextBlock FontSize="36" TextAlignment="Center" Text="Select the Task" />
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Orientation="Horizontal" Grid.Column="0">
|
||||
<telerik:RadToggleButton Name="cbAlara" HorizontalAlignment="Left" Width="150" Content="Normal" TextBlock.FontSize="24" Checked="CbAlara_Checked" Unchecked="CbAlara_Checked" IsChecked="False" CornerRadius="15" />
|
||||
</StackPanel>
|
||||
<TextBlock Grid.Column="1" FontSize="36" TextAlignment="Center" Text="Select the Task" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<StackPanel Grid.Row="1" Orientation="Vertical" HorizontalAlignment="Stretch" >
|
||||
<ScrollViewer VerticalScrollBarVisibility="Visible" Style="{Binding Mode=OneWay, Source={StaticResource CustomScrollViewer}}" >
|
||||
|
|
@ -51,16 +66,29 @@
|
|||
>
|
||||
<ListBox.ItemsPanel >
|
||||
<ItemsPanelTemplate >
|
||||
<WrapPanel IsItemsHost="True" Orientation="Vertical" MaxHeight="200" MaxWidth="800" >
|
||||
|
||||
<WrapPanel IsItemsHost="True" Orientation="Vertical" >
|
||||
</WrapPanel>
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal" TextBlock.FontSize="24" Margin="5,5,5,5" >
|
||||
<TextBlock Text="{Binding ID_Task}" Width="50" />
|
||||
<TextBlock Text="{Binding Task_Name}" Width="300" />
|
||||
<StackPanel Orientation="Horizontal" TextBlock.FontSize="20" Margin="5,5,5,5" >
|
||||
<TextBlock Text="{Binding ID_Task}" Width="50" >
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding MarginExceeded}" Value="true">
|
||||
<Setter Property="Background" Value="Red"></Setter>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding MarginExceeded}" Value="false">
|
||||
<Setter Property="Background" Value="Green"></Setter>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding Task_Name}" Width="350" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
|
|
@ -121,6 +149,7 @@
|
|||
</TextBlock>
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="{Binding EPDRad,StringFormat={}Type: {0} }" />
|
||||
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding FNGain_ANGainValue,StringFormat={}Gain: {0:0.00} }" />
|
||||
<TextBlock Grid.Row="2" Grid.Column="2" Text="{Binding MinWorkerDosisMargin,StringFormat={}Margin: {0:0.00} }" />
|
||||
|
||||
|
||||
|
||||
|
|
@ -133,14 +162,21 @@
|
|||
<TabItem Header="EPD" Name="tbEPD">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="100" />
|
||||
<RowDefinition Height="100" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0">
|
||||
<Run Text="EPD:" />
|
||||
<TextBlock Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center" FontSize="25" FontFamily="Comic Sans MS">
|
||||
<Run Text="Issuing EPD:" />
|
||||
<Run Name="statusEPD" Text="" />
|
||||
<LineBreak/>
|
||||
|
||||
</TextBlock>
|
||||
<TextBlock Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24" Background="LawnGreen" Padding="10,10,10,10" Visibility="Hidden" Name="IssueOK">
|
||||
<Run Name="Done" Text="OK" />
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</DockPanel>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ namespace eDosStation
|
|||
{
|
||||
dispatcherTimer.Stop();
|
||||
ep.Connect();
|
||||
if (ep.DiscRV == 1 && ep.b.CurrentDeviceID >= 0)
|
||||
if (ep.DeviceCount == 1)
|
||||
{
|
||||
EpdFound = true;
|
||||
DoEPD();
|
||||
|
|
@ -148,7 +148,7 @@ namespace eDosStation
|
|||
//ep.K5 = 13100;
|
||||
//ep.K6 = 1310;
|
||||
|
||||
if (ep.K6!=1310)
|
||||
if (ep.K6 != 1310)
|
||||
{
|
||||
MessageBox.Show("Alarm");
|
||||
}
|
||||
|
|
@ -157,6 +157,7 @@ namespace eDosStation
|
|||
}
|
||||
|
||||
ep.SetIssued();
|
||||
IssueOK.Visibility = Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -166,14 +167,14 @@ namespace eDosStation
|
|||
|
||||
ep = new EpdBaseClr.Epd2(Properties.Settings.Default.comport);
|
||||
ep.Connect();
|
||||
if (ep.DiscRV == 1 && ep.b.CurrentDeviceID >= 0)
|
||||
if (ep.DeviceCount == 1)
|
||||
{
|
||||
EpdFound = true;
|
||||
DoEPD();
|
||||
}
|
||||
if (!EpdFound)
|
||||
{
|
||||
statusEPD.Text= $"EPD: Wait ";
|
||||
statusEPD.Text = $"EPD: Wait ";
|
||||
Search = 100;
|
||||
dispatcherTimer = new DispatcherTimer();
|
||||
dispatcherTimer.Tick += DispatcherTimer_Tick;
|
||||
|
|
@ -188,10 +189,13 @@ namespace eDosStation
|
|||
|
||||
void AskTask()
|
||||
{
|
||||
|
||||
eDosStation.DataSet1 dataSet1 = ((eDosStation.DataSet1)(this.FindResource("dataSet1")));
|
||||
using (var dataSet1GetTaskInfoTableAdapter = new eDosStation.DataSet1TableAdapters.GetTaskInfoTableAdapter())
|
||||
{
|
||||
dataSet1GetTaskInfoTableAdapter.Fill(dataSet1.GetTaskInfo, null, _User.Margin);
|
||||
}
|
||||
tbTask.IsSelected = true;
|
||||
|
||||
|
||||
}
|
||||
void CheckBadge()
|
||||
{
|
||||
|
|
@ -261,24 +265,75 @@ namespace eDosStation
|
|||
}
|
||||
|
||||
private void TaskOK_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
bool isOk = false;
|
||||
switch (TaskOK.Tag)
|
||||
{
|
||||
case "A": //No access
|
||||
break;
|
||||
case "M": //Margin
|
||||
break;
|
||||
case "B": // Badge
|
||||
break;
|
||||
case "L": //Locked
|
||||
break;
|
||||
case "O": // OK
|
||||
isOk = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (isOk)
|
||||
{
|
||||
tbEPD.IsSelected = true;
|
||||
System.Windows.Data.CollectionViewSource getTaskListViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("getTaskListViewSource")));
|
||||
var rv = getTaskListViewSource.View.CurrentItem as DataRowView;
|
||||
CurTaskRow = rv.Row as DataSet1.GetTaskInfoRow;
|
||||
|
||||
GetEPD();
|
||||
}
|
||||
}
|
||||
|
||||
private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
var lb = sender as ListBox;
|
||||
DataRowView o;
|
||||
DataRowView o = null;
|
||||
if (e.AddedItems.Count > 0)
|
||||
{
|
||||
o = e.AddedItems[0] as DataRowView;
|
||||
}
|
||||
bool exceeded = false;
|
||||
if (o != null)
|
||||
{
|
||||
exceeded = (((DataSet1.GetTaskInfoRow)o.Row).MarginExceeded);
|
||||
}
|
||||
if (_User == null) { TaskOK.Content = "Badge"; TaskOK.Tag = "B"; }
|
||||
else if (_User.AccessAllow != true) { TaskOK.Content = "No Access"; TaskOK.Tag = "A"; }
|
||||
else if (_User.VisitIDLocked == true) { TaskOK.Content = "Locked"; TaskOK.Tag = "L"; }
|
||||
else if (exceeded == true) { TaskOK.Content = "No Margin"; TaskOK.Tag = "M"; }
|
||||
else
|
||||
{
|
||||
TaskOK.Content = "OK"; TaskOK.Tag = "O";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void CbAlara_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
bool isAlara = (cbAlara.IsChecked == true);
|
||||
if (isAlara) cbAlara.Content = "Alara"; else cbAlara.Content = "Normal";
|
||||
//cbNormal.IsChecked = !isAlara;
|
||||
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";
|
||||
getTaskListViewSource.View.MoveCurrentToFirst();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void Starter()
|
||||
{
|
||||
|
|
@ -287,15 +342,17 @@ namespace eDosStation
|
|||
}
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
tbEntry.IsSelected = true;
|
||||
IssueOK.Visibility = Visibility.Hidden;
|
||||
|
||||
eDosStation.DataSet1 dataSet1 = ((eDosStation.DataSet1)(this.FindResource("dataSet1")));
|
||||
using (eDosStation.DataSet1TableAdapters.GetTaskListTableAdapter dataSet1GetTaskListTableAdapter = new eDosStation.DataSet1TableAdapters.GetTaskListTableAdapter())
|
||||
{
|
||||
dataSet1GetTaskListTableAdapter.Fill(dataSet1.GetTaskList);
|
||||
}
|
||||
//using (eDosStation.DataSet1TableAdapters.GetTaskListTableAdapter dataSet1GetTaskListTableAdapter = new eDosStation.DataSet1TableAdapters.GetTaskListTableAdapter())
|
||||
//{
|
||||
// dataSet1GetTaskListTableAdapter.Fill(dataSet1.GetTaskList);
|
||||
//}
|
||||
using (var dataSet1GetTaskInfoTableAdapter = new eDosStation.DataSet1TableAdapters.GetTaskInfoTableAdapter())
|
||||
{
|
||||
dataSet1GetTaskInfoTableAdapter.Fill(dataSet1.GetTaskInfo,null);
|
||||
dataSet1GetTaskInfoTableAdapter.Fill(dataSet1.GetTaskInfo, null, null);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -309,9 +366,11 @@ namespace eDosStation
|
|||
//t.Start();
|
||||
|
||||
|
||||
|
||||
////Debug
|
||||
_User = new User("0428790A0B4E80",string.Empty);
|
||||
Dispatcher.Invoke(AskTask);
|
||||
_User = new User("0428790A0B4E80", string.Empty);
|
||||
|
||||
Dispatcher.InvokeAsync(AskTask);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ namespace eDosStation
|
|||
{
|
||||
ep = new EpdBaseClr.Epd2(Properties.Settings.Default.comport);
|
||||
ep.Connect();
|
||||
if (ep.DiscRV == 1 && ep.b.CurrentDeviceID > 0)
|
||||
if (ep.DeviceCount == 1 )
|
||||
{
|
||||
EpdFound = true;
|
||||
statusEPD.Content = $"EPD: {ep.b.CurrentDeviceID}";
|
||||
|
|
@ -67,14 +67,13 @@ namespace eDosStation
|
|||
dispatcherTimer.Interval = new TimeSpan(0, 0, 2);
|
||||
dispatcherTimer.Start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void DispatcherTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
dispatcherTimer.Stop();
|
||||
ep.Connect();
|
||||
if (ep.DiscRV == 1 && ep.b.CurrentDeviceID > 0)
|
||||
if (ep.DeviceCount == 1 )
|
||||
{
|
||||
EpdFound = true;
|
||||
statusEPD.Content = $"EPD: {ep.b.CurrentDeviceID}";
|
||||
|
|
@ -90,9 +89,7 @@ namespace eDosStation
|
|||
{
|
||||
statusEPD.Content = $"Search Timeout";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void BIssue_Click(object sender, RoutedEventArgs e)
|
||||
|
|
@ -105,7 +102,6 @@ namespace eDosStation
|
|||
ep.WearerName = wName.Text;
|
||||
ep.SetIssued();
|
||||
this.Close();
|
||||
|
||||
}
|
||||
|
||||
private void Window_Unloaded(object sender, RoutedEventArgs e)
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
<StatusBar DockPanel.Dock="Bottom" >
|
||||
<StatusBarItem Name="statusEPD" Content="Epd" />
|
||||
</StatusBar>
|
||||
<TabControl>
|
||||
<TabItem Name="Wait" Header="Wait">
|
||||
|
||||
</TabItem>
|
||||
<TabItem Name="ok" Header="OK">
|
||||
<Grid TextBlock.FontSize="40" TextBlock.FontFamily="comic sans ms">
|
||||
<Grid.RowDefinitions >
|
||||
<RowDefinition Height="auto" />
|
||||
|
|
@ -37,6 +42,41 @@
|
|||
<Button Grid.Row="2" Grid.Column="1" Content="OK" Name="bCloseExit" Click="BCloseExit_Click" />
|
||||
</Grid>
|
||||
|
||||
</TabItem>
|
||||
<TabItem Name="Alarm" Header="Alarm">
|
||||
<StackPanel>
|
||||
<Border Background="LightYellow" TextBlock.FontSize="24" TextBlock.LineHeight="30px" Padding="20,20,20,20" >
|
||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center" >
|
||||
<LineBreak/>
|
||||
<Run>Your dose and/or doserate has been above the alarmlevel</Run>
|
||||
<Run>during your visit !</Run>
|
||||
<LineBreak/>
|
||||
<Run>Please contact the Radioprotection officer of the building.</Run>>
|
||||
<LineBreak/>
|
||||
<Run>He needs to validate and clear your alarm(s).</Run>
|
||||
<LineBreak/>
|
||||
</TextBlock>
|
||||
</Border>
|
||||
<Button Content="OK" Height="40" Width="200" Name="bConfirmAlarm" Click="BConfirmAlarm_Click" />
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<TabItem Name="OtherAlarm" Header="Other Alarm">
|
||||
<StackPanel>
|
||||
<Border Background="LightYellow" TextBlock.FontSize="24" TextBlock.LineHeight="30px" Padding="20,20,20,20" >
|
||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center" >
|
||||
<LineBreak/>
|
||||
<Run>Your EPD has encounterd a problem.</Run>
|
||||
<LineBreak/>
|
||||
<Run>Please contact the Radioprotection officer of the building.</Run>
|
||||
<LineBreak/>
|
||||
<Run> He needs to investigate it’.</Run>
|
||||
</TextBlock>
|
||||
</Border>
|
||||
<Button Content="OK" Height="40" Width="200" Name="bConfirmAlarm2" Click="BConfirmAlarm_Click" />
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
</DockPanel>
|
||||
</Window>
|
||||
|
||||
|
|
|
|||
|
|
@ -36,19 +36,25 @@ namespace eDosStation
|
|||
}
|
||||
|
||||
|
||||
private void ShowAlarm()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void LoadDoses()
|
||||
{
|
||||
if (dispatcherTimer == null)
|
||||
{
|
||||
dispatcherTimer = new DispatcherTimer();
|
||||
dispatcherTimer.Interval = new TimeSpan(0, 0, 2);
|
||||
dispatcherTimer.Interval = new TimeSpan(0, 0, 5);
|
||||
} else
|
||||
{
|
||||
dispatcherTimer.Tick -= DispatcherTimer_Tick;
|
||||
dispatcherTimer.Stop();
|
||||
dispatcherTimer.Tick += DispatcherTimer_TickTO; ;
|
||||
}
|
||||
|
||||
dispatcherTimer.Tick += DispatcherTimer_TickTO; ;
|
||||
|
||||
ep.GetStatus();
|
||||
if (!ep.Issued)
|
||||
|
|
@ -59,7 +65,20 @@ namespace eDosStation
|
|||
}
|
||||
|
||||
|
||||
if (ep.alarmStatus != 0) DosePanel.Background = AlarmBrush; else DosePanel.Background = GreenBrush;
|
||||
if (ep.alarmStatus != 0)
|
||||
{
|
||||
DosePanel.Background = AlarmBrush;
|
||||
Alarm.IsSelected = true;
|
||||
}
|
||||
else if ((ep.otherAlarms & 0x7f) != 0)
|
||||
{
|
||||
DosePanel.Background = AlarmBrush;
|
||||
OtherAlarm.IsSelected = true;
|
||||
} else
|
||||
{
|
||||
DosePanel.Background = GreenBrush;
|
||||
ok.IsSelected = true;
|
||||
}
|
||||
int rv = ep.ReadExtraStatus(); //D1 BaseD1 ...
|
||||
|
||||
Wearer.Text = $"Wearer: {ep.WearerName}";
|
||||
|
|
@ -123,9 +142,7 @@ namespace eDosStation
|
|||
ep.SetDeIssued();
|
||||
|
||||
|
||||
|
||||
|
||||
dispatcherTimer.Start();
|
||||
dispatcherTimer.Start(); //Knop hide
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -135,15 +152,15 @@ namespace eDosStation
|
|||
this.Close();
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
|
||||
private void StartScan()
|
||||
{
|
||||
ep = new EpdBaseClr.Epd2(Properties.Settings.Default.comport);
|
||||
ep.Connect();
|
||||
if (ep.DiscRV == 1 && ep.b.CurrentDeviceID > 0)
|
||||
if (ep.DeviceCount == 1)
|
||||
{
|
||||
EpdFound = true;
|
||||
statusEPD.Content = $"EPD: {ep.b.CurrentDeviceID}";
|
||||
|
||||
LoadDoses();
|
||||
}
|
||||
if (!EpdFound)
|
||||
|
|
@ -155,14 +172,21 @@ namespace eDosStation
|
|||
dispatcherTimer.Interval = new TimeSpan(0, 0, 2);
|
||||
dispatcherTimer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Wait.IsSelected = true;
|
||||
Dispatcher.InvokeAsync(StartScan);
|
||||
}
|
||||
|
||||
private void DispatcherTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
dispatcherTimer.Stop();
|
||||
EpdFound = false;
|
||||
ep.Connect();
|
||||
if (ep.DiscRV == 1 && ep.b.CurrentDeviceID >= 0)
|
||||
if (ep.DeviceCount == 1 )
|
||||
{
|
||||
EpdFound = true;
|
||||
statusEPD.Content = $"EPD: {ep.b.CurrentDeviceID}";
|
||||
|
|
@ -178,14 +202,17 @@ namespace eDosStation
|
|||
{
|
||||
statusEPD.Content = $"Search Timeout";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void BCloseExit_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void BConfirmAlarm_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,17 @@
|
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:eDosStation"
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
|
||||
mc:Ignorable="d"
|
||||
Title="eDose Station" Height="450" Width="800">
|
||||
Title="eDose Station" Height="450" Width="800" FontFamily="Comic Sans MS" FontSize="36">
|
||||
<DockPanel>
|
||||
<Menu DockPanel.Dock="Top">
|
||||
<MenuItem Header="Settings" Click="MenuItem_Click" >
|
||||
|
||||
|
||||
</MenuItem>
|
||||
|
||||
</Menu>
|
||||
<StatusBar DockPanel.Dock="Bottom" >
|
||||
<StatusBarItem Name="Status" Content="Offline"/>
|
||||
</StatusBar>
|
||||
|
|
@ -16,9 +24,10 @@
|
|||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Button Grid.Row="0" Grid.Column="0" Content="Entry" Name="bEntry" Click="BEntry_Click" Margin="10,10,10,10" />
|
||||
<Button Grid.Row="1" Grid.Column="0" Content="Exit" Name="bExit" Click="BExit_Click" Margin="10,10,10,10" />
|
||||
<Button Grid.Row="2" Grid.Column="0" Content="Show EPD Dosis" Click="Button_Click" Margin="10,10,10,10" />
|
||||
|
||||
<telerik:RadButton Grid.Row="0" Grid.Column="0" Content="Entry" Name="bEntry" Click="BEntry_Click" Margin="10,10,10,10" CornerRadius="15" />
|
||||
<telerik:RadButton Grid.Row="1" Grid.Column="0" Content="Exit" Name="bExit" Click="BExit_Click" Margin="10,10,10,10" CornerRadius="15"/>
|
||||
<telerik:RadButton Grid.Row="2" Grid.Column="0" Content="Show EPD Dosis" Click="Button_Click" Margin="10,10,10,10" CornerRadius="15"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,10 @@ namespace eDosStation
|
|||
w.ShowDialog();
|
||||
}
|
||||
|
||||
|
||||
private void MenuItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Settings s = new Settings();
|
||||
s.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
26
eDosStation/Settings.xaml
Normal file
26
eDosStation/Settings.xaml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<Window x:Class="eDosStation.Settings"
|
||||
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:local="clr-namespace:eDosStation"
|
||||
mc:Ignorable="d"
|
||||
Title="Settings" Height="450" Width="800" Loaded="Window_Loaded">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="150"/>
|
||||
<ColumnDefinition Width="150"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Com port"></TextBlock>
|
||||
<TextBox Name="tComPort" Text="1" Grid.Column="1" />
|
||||
|
||||
<Button Grid.Row="1" Grid.Column="0" Content="OK" Name="bOK" Click="BOK_Click" />
|
||||
<Button Grid.Row="1" Grid.Column="1" Content="Cancel" Name="bCancel" Click="BCancel_Click" />
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
48
eDosStation/Settings.xaml.cs
Normal file
48
eDosStation/Settings.xaml.cs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
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 eDosStation
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for Settings.xaml
|
||||
/// </summary>
|
||||
public partial class Settings : Window
|
||||
{
|
||||
public Settings()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void BOK_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (tComPort.Text != Properties.Settings.Default.comport.ToString())
|
||||
{
|
||||
Properties.Settings.Default.comport = int.Parse(tComPort.Text);
|
||||
Properties.Settings.Default.Save();
|
||||
Properties.Settings.Default.Reload();
|
||||
tComPort.Text = Properties.Settings.Default.comport.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void BCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
tComPort.Text = Properties.Settings.Default.comport.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -59,7 +59,7 @@ namespace eDosStation
|
|||
{
|
||||
ep = new EpdBaseClr.Epd2(Properties.Settings.Default.comport);
|
||||
ep.Connect();
|
||||
if (ep.DiscRV == 1 && ep.b.CurrentDeviceID >= 0)
|
||||
if (ep.DeviceCount == 1 )
|
||||
{
|
||||
EpdFound = true;
|
||||
statusEPD.Content = $"EPD: {ep.b.CurrentDeviceID}";
|
||||
|
|
@ -81,7 +81,7 @@ namespace eDosStation
|
|||
{
|
||||
dispatcherTimer.Stop();
|
||||
ep.Connect();
|
||||
if (ep.DiscRV == 1 && ep.b.CurrentDeviceID > 0)
|
||||
if (ep.DeviceCount == 1 )
|
||||
{
|
||||
EpdFound = true;
|
||||
statusEPD.Content = $"EPD: {ep.b.CurrentDeviceID}";
|
||||
|
|
|
|||
|
|
@ -9,13 +9,17 @@ namespace eDosStation
|
|||
{
|
||||
public class User
|
||||
{
|
||||
public int PersID {get; set; }
|
||||
public int PersID { get; set; }
|
||||
public string LastName { get; set; }
|
||||
public string FirstName { get; set; }
|
||||
public string conCode { get; set; }
|
||||
public string Language { get; set; }
|
||||
public bool? AccessAllow { get; set; }
|
||||
|
||||
public double? Margin { get; set; }
|
||||
|
||||
public bool? VisitIDLocked {get;set; }
|
||||
|
||||
public User(string CSN, string Code)
|
||||
{
|
||||
LastName = FirstName = conCode = Language = string.Empty;
|
||||
|
|
@ -39,6 +43,9 @@ namespace eDosStation
|
|||
conCode = Values[rs.GetOrdinal("conCode")].ToString();
|
||||
Language = Values[rs.GetOrdinal("Language")].ToString();
|
||||
AccessAllow = Values[rs.GetOrdinal("AccessAllow")] as bool?;
|
||||
Margin = Values[rs.GetOrdinal("AccessAllow")] as double?;
|
||||
VisitIDLocked = Values[rs.GetOrdinal("VisitIDLocked")] as bool?;
|
||||
|
||||
}
|
||||
rs.Close();
|
||||
co.Close();
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="Converters.cs" />
|
||||
<Compile Include="DataSet1.cs">
|
||||
<DependentUpon>DataSet1.xsd</DependentUpon>
|
||||
</Compile>
|
||||
|
|
@ -95,6 +96,9 @@
|
|||
<Compile Include="EpdEntry.xaml.cs">
|
||||
<DependentUpon>EpdEntry.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Settings.xaml.cs">
|
||||
<DependentUpon>Settings.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ShowEPDDose.xaml.cs">
|
||||
<DependentUpon>ShowEPDDose.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
|
@ -127,6 +131,10 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Settings.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="ShowEPDDose.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue