SelectedProcedure stored in ProcessData, used in DataEntry.iPERL and S620, S640Comm cleaned, IOrderInfo, I640Cfg, OrderManagement v.3.0.6, etc.
This commit is contained in:
parent
ff28d507cf
commit
68c3ccbef6
@ -65,6 +65,7 @@
|
||||
<Compile Include="Formulas.cs" />
|
||||
<Compile Include="GlobalData.cs" />
|
||||
<Compile Include="IMeasurementCorrection.cs" />
|
||||
<Compile Include="IOrderInfo.cs" />
|
||||
<Compile Include="IParamsProvider.cs" />
|
||||
<Compile Include="Iperl\OptoTelegramRaw.cs" />
|
||||
<Compile Include="IUncertainty.cs" />
|
||||
|
||||
26
Common/IOrderInfo.cs
Normal file
26
Common/IOrderInfo.cs
Normal file
@ -0,0 +1,26 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
|
||||
namespace Common
|
||||
{
|
||||
public interface IOrderInfo
|
||||
{
|
||||
string POName { get; }
|
||||
string VariantCode { get; }
|
||||
string ModuleParam { get; }
|
||||
int PiecesCount { get; }
|
||||
string SNPrefix { get; }
|
||||
int SNFirst { get; }
|
||||
int SNDigitsCount { get; }
|
||||
string SNSuffix { get; }
|
||||
string RAPrefix { get; }
|
||||
int RAFirst { get; }
|
||||
string RASuffix { get; }
|
||||
string Remark { get; }
|
||||
int CurrentPcsCount { get; set; }
|
||||
int CurrentSN { get; set; }
|
||||
int CurrentRA { get; set; }
|
||||
}
|
||||
}
|
||||
@ -17,7 +17,7 @@ namespace Common
|
||||
public readonly string Name;
|
||||
public readonly string Signature;
|
||||
public string Variant;
|
||||
public string Order;
|
||||
public IOrderInfo OrderInfo;
|
||||
public string Workflow;
|
||||
public string LaserMarking;
|
||||
public bool IsNative;
|
||||
@ -25,14 +25,14 @@ namespace Common
|
||||
public string ResolvedName;
|
||||
|
||||
public ProcedureInfo(ProcedureSelection source, int itemNr, string name, string signature = null,
|
||||
string variant = null, string order = null, string workflow = null, string laserMarking = null)
|
||||
string variant = null, IOrderInfo orderInfo = null, string workflow = null, string laserMarking = null)
|
||||
{
|
||||
Source = source;
|
||||
ItemNr = itemNr;
|
||||
Name = name;
|
||||
Signature = (signature == null) ? string.Empty : signature;
|
||||
Variant = (variant == null) ? string.Empty : variant;
|
||||
Order = order;
|
||||
OrderInfo = orderInfo;
|
||||
Workflow = workflow;
|
||||
LaserMarking = laserMarking;
|
||||
|
||||
|
||||
@ -86,6 +86,7 @@ namespace OrderManagement
|
||||
Workflow,
|
||||
Procedure,
|
||||
Variant,
|
||||
ModuleParam,
|
||||
LaserMarking,
|
||||
Pieces,
|
||||
SNPrefix,
|
||||
@ -94,7 +95,6 @@ namespace OrderManagement
|
||||
SNSuffix,
|
||||
RAPrefix,
|
||||
RAFirst,
|
||||
RADigitsCount,
|
||||
RASuffix,
|
||||
Remark,
|
||||
Count
|
||||
@ -107,6 +107,7 @@ namespace OrderManagement
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.Workflow, Width = 150 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.Test_procedure, Width = 150 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.Variant_code, Width = 150 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.Module_parameter, Width = 150 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.Laser_marking, Width = 150 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.Pieces_count, Width = 80 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.SN + " " + Strings.prefix, Width = 80 });
|
||||
@ -115,7 +116,6 @@ namespace OrderManagement
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.SN + " " + Strings.suffix, Width = 80 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.RA + " " + Strings.prefix, Width = 80 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.RA + " " + Strings.first, Width = 80 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.RA + " " + Strings.digits_count, Width = 80 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.RA + " " + Strings.suffix, Width = 80 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.Remark, Width = 200 });
|
||||
}
|
||||
@ -127,6 +127,7 @@ namespace OrderManagement
|
||||
lvi.SubItems.Add(o.Workflow);
|
||||
lvi.SubItems.Add(o.TestProcedure);
|
||||
lvi.SubItems.Add(o.VariantCode);
|
||||
lvi.SubItems.Add(o.ModuleParam);
|
||||
lvi.SubItems.Add(o.LaserMarking);
|
||||
lvi.SubItems.Add(o.PiecesCount.ToString());
|
||||
lvi.SubItems.Add(o.SNPrefix);
|
||||
@ -134,8 +135,7 @@ namespace OrderManagement
|
||||
lvi.SubItems.Add(o.SNDigitsCount.ToString());
|
||||
lvi.SubItems.Add(o.SNSuffix);
|
||||
lvi.SubItems.Add(o.RAPrefix);
|
||||
lvi.SubItems.Add(o.RAFirst.ToString(string.Format("D{0}", o.RADigitsCount)));
|
||||
lvi.SubItems.Add(o.RADigitsCount.ToString());
|
||||
lvi.SubItems.Add(o.RAFirst.ToString("D9"));
|
||||
lvi.SubItems.Add(o.RASuffix);
|
||||
lvi.SubItems.Add(o.Remark);
|
||||
lvi.Tag = o;
|
||||
@ -150,6 +150,7 @@ namespace OrderManagement
|
||||
lvi.SubItems[i++].Text = o.Workflow;
|
||||
lvi.SubItems[i++].Text = o.TestProcedure;
|
||||
lvi.SubItems[i++].Text = o.VariantCode;
|
||||
lvi.SubItems[i++].Text = o.ModuleParam;
|
||||
lvi.SubItems[i++].Text = o.LaserMarking;
|
||||
lvi.SubItems[i++].Text = o.PiecesCount.ToString();
|
||||
lvi.SubItems[i++].Text = o.SNPrefix;
|
||||
@ -157,8 +158,7 @@ namespace OrderManagement
|
||||
lvi.SubItems[i++].Text = o.SNDigitsCount.ToString();
|
||||
lvi.SubItems[i++].Text = o.SNSuffix;
|
||||
lvi.SubItems[i++].Text = o.RAPrefix;
|
||||
lvi.SubItems[i++].Text = o.RAFirst.ToString(string.Format("D{0}", o.RADigitsCount));
|
||||
lvi.SubItems[i++].Text = o.RADigitsCount.ToString();
|
||||
lvi.SubItems[i++].Text = o.RAFirst.ToString("D9");
|
||||
lvi.SubItems[i++].Text = o.RASuffix;
|
||||
lvi.SubItems[i++].Text = o.Remark;
|
||||
}
|
||||
@ -298,9 +298,8 @@ namespace OrderManagement
|
||||
sortOrder = MySortOrder.Ascending;
|
||||
}
|
||||
|
||||
if (sortColumn == (int)Clmn.Pieces ||
|
||||
sortColumn == (int)Clmn.SNFirst || sortColumn == (int)Clmn.SNDigitsCount ||
|
||||
sortColumn == (int)Clmn.RAFirst || sortColumn == (int)Clmn.RADigitsCount)
|
||||
if (sortColumn == (int)Clmn.Pieces || sortColumn == (int)Clmn.SNFirst ||
|
||||
sortColumn == (int)Clmn.SNDigitsCount || sortColumn == (int)Clmn.RAFirst)
|
||||
{
|
||||
listViewEx1.ListViewItemSorter = new LviIntColumnComparer(sortColumn, sortOrder);
|
||||
}
|
||||
|
||||
@ -91,11 +91,11 @@ namespace OrderManagement
|
||||
(order.SNSuffix != null) ? order.SNSuffix : string.Empty),
|
||||
Strings.First_radio_address + " :",
|
||||
string.Format("{0}{1}{2}", (order.RAPrefix != null) ? order.RAPrefix : string.Empty,
|
||||
order.RADigitsCount != 0 ? order.RAFirst.ToString(string.Format("D{0}", order.RADigitsCount)) : string.Empty,
|
||||
order.RAFirst.ToString("D9"),
|
||||
(order.RASuffix != null) ? order.RASuffix : string.Empty),
|
||||
Strings.Last_radio_address + " :",
|
||||
string.Format("{0}{1}{2}", (order.RAPrefix != null) ? order.RAPrefix : string.Empty,
|
||||
order.RADigitsCount != 0 ? (order.RAFirst + order.PiecesCount - 1).ToString(string.Format("D{0}", order.RADigitsCount)) : string.Empty,
|
||||
(order.RAFirst + order.PiecesCount - 1).ToString("D9"),
|
||||
(order.RASuffix != null) ? order.RASuffix : string.Empty),
|
||||
Strings.Workflow + " :",
|
||||
(order.Workflow != null) ? order.Workflow : string.Empty,
|
||||
|
||||
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// 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("3.0.4.0")]
|
||||
[assembly: AssemblyFileVersion("3.0.4.0")]
|
||||
[assembly: AssemblyVersion("3.0.6.0")]
|
||||
[assembly: AssemblyFileVersion("3.0.6.0")]
|
||||
|
||||
9
OrderManagement/Resources/Strings.Designer.cs
generated
9
OrderManagement/Resources/Strings.Designer.cs
generated
@ -213,6 +213,15 @@ namespace OrderManagement.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Module parameter.
|
||||
/// </summary>
|
||||
internal static string Module_parameter {
|
||||
get {
|
||||
return ResourceManager.GetString("Module_parameter", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to OK.
|
||||
/// </summary>
|
||||
|
||||
@ -252,4 +252,7 @@
|
||||
<data name="Show_predefined_orders" xml:space="preserve">
|
||||
<value>Show predefined orders</value>
|
||||
</data>
|
||||
<data name="Module_parameter" xml:space="preserve">
|
||||
<value>Module parameter</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// 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("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: AssemblyVersion("3.0.2.0")]
|
||||
[assembly: AssemblyFileVersion("3.0.2.0")]
|
||||
|
||||
@ -6,7 +6,7 @@ using SharedDatabase.Resources;
|
||||
|
||||
namespace SharedDatabase.Entities
|
||||
{
|
||||
public class OrderInfo : IParamsProvider
|
||||
public class OrderInfo : IParamsProvider, Common.IOrderInfo
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual string POName { get; set; } /// 0
|
||||
@ -14,16 +14,19 @@ namespace SharedDatabase.Entities
|
||||
public virtual string Workflow { get; set; } /// 2
|
||||
public virtual string TestProcedure { get; set; } /// 3
|
||||
public virtual string VariantCode { get; set; } /// 4
|
||||
public virtual string LaserMarking { get; set; } /// 5
|
||||
public virtual int PiecesCount { get; set; } /// 6
|
||||
public virtual string SNPrefix { get; set; } /// 7
|
||||
public virtual int SNFirst { get; set; } /// 8
|
||||
public virtual int SNDigitsCount { get; set; } /// 9
|
||||
public virtual string SNSuffix { get; set; } /// 10
|
||||
public virtual string RAPrefix { get; set; } /// 11
|
||||
public virtual int RAFirst { get; set; } /// 12
|
||||
public virtual int RADigitsCount { get; set; } /// 13
|
||||
public virtual string ModuleParam { get; set; } /// 5
|
||||
public virtual string LaserMarking { get; set; } /// 6
|
||||
public virtual int PiecesCount { get; set; } /// 7
|
||||
public virtual string SNPrefix { get; set; } /// 8
|
||||
public virtual int SNFirst { get; set; } /// 9
|
||||
public virtual int SNDigitsCount { get; set; } /// 10
|
||||
public virtual string SNSuffix { get; set; } /// 11
|
||||
public virtual string RAPrefix { get; set; } /// 12
|
||||
public virtual int RAFirst { get; set; } /// 13
|
||||
public virtual string RASuffix { get; set; } /// 14
|
||||
public virtual int CurrentPcsCount { get; set; }
|
||||
public virtual int CurrentSN { get; set; }
|
||||
public virtual int CurrentRA { get; set; }
|
||||
public virtual int BaseNr1 { get; set; }
|
||||
public virtual int BaseNr2 { get; set; }
|
||||
public virtual int BaseNr3 { get; set; }
|
||||
@ -50,6 +53,7 @@ namespace SharedDatabase.Entities
|
||||
Workflow = string.Empty;
|
||||
TestProcedure = string.Empty;
|
||||
VariantCode = string.Empty;
|
||||
ModuleParam = string.Empty;
|
||||
LaserMarking = string.Empty;
|
||||
SNPrefix = string.Empty;
|
||||
SNSuffix = string.Empty;
|
||||
@ -69,6 +73,7 @@ namespace SharedDatabase.Entities
|
||||
Strings.Workflow,
|
||||
Strings.Test_procedure,
|
||||
Strings.Variant_code,
|
||||
Strings.Module_parameter,
|
||||
Strings.Laser_marking,
|
||||
Strings.Pieces_count,
|
||||
Strings.Serial_nr + " " + Strings.prefix,
|
||||
@ -77,7 +82,6 @@ namespace SharedDatabase.Entities
|
||||
Strings.Serial_nr + " " + Strings.suffix,
|
||||
Strings.Radio_address + " " + Strings.prefix,
|
||||
Strings.Radio_address + " " + Strings.first,
|
||||
Strings.Radio_address + " " + Strings.digits_count,
|
||||
Strings.Radio_address + " " + Strings.suffix,
|
||||
Strings.Remark,
|
||||
};
|
||||
@ -107,15 +111,15 @@ namespace SharedDatabase.Entities
|
||||
case 2: return Workflow;
|
||||
case 3: return TestProcedure;
|
||||
case 4: return VariantCode;
|
||||
case 5: return LaserMarking;
|
||||
case 6: return PiecesCount.ToString();
|
||||
case 7: return SNPrefix;
|
||||
case 8: return SNFirst.ToString();
|
||||
case 9: return SNDigitsCount.ToString();
|
||||
case 10: return SNSuffix;
|
||||
case 11: return RAPrefix;
|
||||
case 12: return RAFirst.ToString();
|
||||
case 13: return RADigitsCount.ToString();
|
||||
case 5: return ModuleParam;
|
||||
case 6: return LaserMarking;
|
||||
case 7: return PiecesCount.ToString();
|
||||
case 8: return SNPrefix;
|
||||
case 9: return SNFirst.ToString();
|
||||
case 10: return SNDigitsCount.ToString();
|
||||
case 11: return SNSuffix;
|
||||
case 12: return RAPrefix;
|
||||
case 13: return RAFirst.ToString();
|
||||
case 14: return RASuffix;
|
||||
case 15: return Remark;
|
||||
default:
|
||||
@ -146,31 +150,31 @@ namespace SharedDatabase.Entities
|
||||
VariantCode = str;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 5:
|
||||
LaserMarking = str;
|
||||
ModuleParam = str;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 6:
|
||||
PiecesCount = int.Parse(str);
|
||||
LaserMarking = str;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 7:
|
||||
SNPrefix = str;
|
||||
PiecesCount = int.Parse(str);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 8:
|
||||
SNFirst = int.Parse(str);
|
||||
SNPrefix = str;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 9:
|
||||
SNDigitsCount = int.Parse(str);
|
||||
SNFirst = int.Parse(str);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 10:
|
||||
SNSuffix = str;
|
||||
SNDigitsCount = int.Parse(str);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 11:
|
||||
RAPrefix = str;
|
||||
SNSuffix = str;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 12:
|
||||
RAFirst = int.Parse(str);
|
||||
RAPrefix = str;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 13:
|
||||
RADigitsCount = int.Parse(str);
|
||||
RAFirst = int.Parse(str);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 14:
|
||||
RASuffix = str;
|
||||
@ -204,29 +208,33 @@ namespace SharedDatabase.Entities
|
||||
return true;
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
/// nonempty string
|
||||
if (!string.IsNullOrEmpty(str)) return true;
|
||||
message = string.Format(Strings._0_should_not_be_empty, ParamName(i));
|
||||
return false;
|
||||
case 4:
|
||||
case 5:
|
||||
/// string (incl. an empty one)
|
||||
if (str != null) return true;
|
||||
message = string.Format("Should not be null", ParamName(i));
|
||||
return false;
|
||||
case 1:
|
||||
if (ParamValues(i).Contains(str)) return true;
|
||||
break;
|
||||
case 6:
|
||||
case 9:
|
||||
case 7:
|
||||
case 10:
|
||||
/// positive integers
|
||||
if (int.TryParse(str, out idummy) && idummy > 0) return true;
|
||||
break;
|
||||
case 7:
|
||||
case 10:
|
||||
case 8:
|
||||
case 11:
|
||||
case 12:
|
||||
case 14:
|
||||
case 15:
|
||||
/// strings
|
||||
return true;
|
||||
case 8:
|
||||
case 12:
|
||||
case 9:
|
||||
case 13:
|
||||
/// non-negative integer
|
||||
if (int.TryParse(str, out idummy) && idummy >= 0) return true;
|
||||
@ -247,6 +255,7 @@ namespace SharedDatabase.Entities
|
||||
dest.Workflow = Workflow;
|
||||
dest.TestProcedure = TestProcedure;
|
||||
dest.VariantCode = VariantCode;
|
||||
dest.ModuleParam = ModuleParam;
|
||||
dest.LaserMarking = LaserMarking;
|
||||
dest.PiecesCount = PiecesCount;
|
||||
dest.SNPrefix = SNPrefix;
|
||||
@ -255,7 +264,6 @@ namespace SharedDatabase.Entities
|
||||
dest.SNSuffix = SNSuffix;
|
||||
dest.RAPrefix = RAPrefix;
|
||||
dest.RAFirst = RAFirst;
|
||||
dest.RADigitsCount = RADigitsCount;
|
||||
dest.RASuffix = RASuffix;
|
||||
dest.BaseNr1 = BaseNr1;
|
||||
dest.BaseNr2 = BaseNr2;
|
||||
@ -283,6 +291,11 @@ namespace SharedDatabase.Entities
|
||||
{
|
||||
return true; /// =OK, do nothing
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return POName;
|
||||
}
|
||||
}
|
||||
|
||||
public enum OrderState : sbyte
|
||||
|
||||
@ -13,16 +13,21 @@ namespace SharedDatabase.Mappings
|
||||
Map(x => x.Workflow);
|
||||
Map(x => x.TestProcedure);
|
||||
Map(x => x.VariantCode);
|
||||
Map(x => x.ModuleParam)
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(2000)");
|
||||
Map(x => x.LaserMarking);
|
||||
Map(x => x.PiecesCount);
|
||||
Map(x => x.SNFirst);
|
||||
Map(x => x.SNPrefix);
|
||||
Map(x => x.SNFirst);
|
||||
Map(x => x.SNDigitsCount);
|
||||
Map(x => x.SNSuffix);
|
||||
Map(x => x.RAFirst);
|
||||
Map(x => x.RAPrefix);
|
||||
Map(x => x.RADigitsCount);
|
||||
Map(x => x.RAFirst);
|
||||
Map(x => x.RASuffix);
|
||||
Map(x => x.CurrentPcsCount);
|
||||
Map(x => x.CurrentSN);
|
||||
Map(x => x.CurrentRA);
|
||||
Map(x => x.BaseNr1);
|
||||
Map(x => x.BaseNr2);
|
||||
Map(x => x.BaseNr3);
|
||||
|
||||
9
SharedDatabase/Resources/Strings.Designer.cs
generated
9
SharedDatabase/Resources/Strings.Designer.cs
generated
@ -366,6 +366,15 @@ namespace SharedDatabase.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Module parameter.
|
||||
/// </summary>
|
||||
internal static string Module_parameter {
|
||||
get {
|
||||
return ResourceManager.GetString("Module_parameter", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {0} users copied.
|
||||
/// </summary>
|
||||
|
||||
@ -414,4 +414,7 @@
|
||||
<data name="Laser_marking" xml:space="preserve">
|
||||
<value>Laser marking</value>
|
||||
</data>
|
||||
<data name="Module_parameter" xml:space="preserve">
|
||||
<value>Module parameter</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("3.1.1819.0")]
|
||||
[assembly: AssemblyFileVersion("3.1.1819.0")]
|
||||
[assembly: AssemblyVersion("3.1.1827.0")]
|
||||
[assembly: AssemblyFileVersion("3.1.1827.0")]
|
||||
|
||||
@ -7,6 +7,7 @@ using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.Rig;
|
||||
using TBF.Rig.GenericDevices;
|
||||
using TBF.Rig.Sequences;
|
||||
|
||||
namespace TBF.Rig.DataEntry.S620
|
||||
{
|
||||
@ -90,7 +91,7 @@ namespace TBF.Rig.DataEntry.S620
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleBeginning;
|
||||
this.waterMeters = TBF.Rig.Sequences.ProcessData.BatchRslts.Batch.WaterMeters;
|
||||
this.waterMeters = ProcessData.BatchRslts.Batch.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -133,8 +134,8 @@ namespace TBF.Rig.DataEntry.S620
|
||||
{
|
||||
if (entryFormCfg.ProductionTracing)
|
||||
{
|
||||
string order = (TBF.Rig.Sequences.ProcessData.BatchRslts != null) ? TBF.Rig.Sequences.ProcessData.BatchRslts.Batch.PurchaseOrder : null;
|
||||
string workflow = (TBF.Rig.Sequences.ProcessData.BatchRslts != null) ? TBF.Rig.Sequences.ProcessData.BatchRslts.Batch.Workflow : null;
|
||||
string order = ProcessData.SelectedProcedure.OrderInfo.POName;
|
||||
string workflow = ProcessData.SelectedProcedure.Workflow;
|
||||
|
||||
myRef.modelessDlg = new FormForMechanicalMetersWithTracing(waterMeters, entryFormCfg.MaxWMsCount, entryFormCfg.CloseButton, false,
|
||||
true, entryFormCfg.OrdersFromProdTracing, order, workflow);
|
||||
@ -150,8 +151,8 @@ namespace TBF.Rig.DataEntry.S620
|
||||
{
|
||||
if (entryFormCfg.ProductionTracing)
|
||||
{
|
||||
string order = (TBF.Rig.Sequences.ProcessData.BatchRslts != null) ? TBF.Rig.Sequences.ProcessData.BatchRslts.Batch.PurchaseOrder : null;
|
||||
string workflow = (TBF.Rig.Sequences.ProcessData.BatchRslts != null) ? TBF.Rig.Sequences.ProcessData.BatchRslts.Batch.Workflow : null;
|
||||
string order = ProcessData.SelectedProcedure.OrderInfo.POName;
|
||||
string workflow = ProcessData.SelectedProcedure.Workflow;
|
||||
|
||||
myRef.modelessDlg = new FormForMechanicalMetersWithTracing(waterMeters, entryFormCfg.MaxWMsCount, entryFormCfg.CloseButton, true,
|
||||
true, entryFormCfg.OrdersFromProdTracing, order, workflow);
|
||||
|
||||
@ -11,6 +11,7 @@ using TBF.Rig.Sequences;
|
||||
using TBF.Rig.Output.DB.SensusOracle;
|
||||
using TBF.Resources;
|
||||
using System.Drawing;
|
||||
using NHibernate;
|
||||
|
||||
namespace TBF.Rig.DataEntry.iPerl
|
||||
{
|
||||
@ -23,7 +24,8 @@ namespace TBF.Rig.DataEntry.iPerl
|
||||
readonly EntryFormCfg cfg;
|
||||
|
||||
/// Loaded from database beforethe form is open
|
||||
IList<OrderDetails> listOfOrders;
|
||||
IList<IOrderInfo> listOfOrders;
|
||||
string preselectedOrder;
|
||||
|
||||
/// To be retrieved after the form is closed
|
||||
public string PurchaseOrder;
|
||||
@ -40,6 +42,7 @@ namespace TBF.Rig.DataEntry.iPerl
|
||||
{
|
||||
InitializeComponent();
|
||||
ControlBox = false;
|
||||
preselectedOrder = null;
|
||||
|
||||
completed = false;
|
||||
StartForceCloseHandler();
|
||||
@ -50,11 +53,12 @@ namespace TBF.Rig.DataEntry.iPerl
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
|
||||
public CycleBeginningForm(int waterMetersCount, EntryFormCfg cfg)
|
||||
public CycleBeginningForm(int waterMetersCount, EntryFormCfg cfg, string preselectedOrder = null)
|
||||
: this()
|
||||
{
|
||||
this.WaterMetersCount = waterMetersCount;
|
||||
this.cfg = cfg;
|
||||
this.preselectedOrder = preselectedOrder;
|
||||
SNText = null;
|
||||
Disabled = null;
|
||||
}
|
||||
@ -66,19 +70,38 @@ namespace TBF.Rig.DataEntry.iPerl
|
||||
orderGroupBox.Text = Strings.Purchase_order;
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
|
||||
listOfOrders = ((cfg.Orders == Orders.FromOracle || cfg.Orders == Orders.CombinedAndFromOracle) && ProcessData.OracleDB != null)
|
||||
? ProcessData.OracleDB.ReadOrderNumbers()
|
||||
: new List<OrderDetails>();
|
||||
listOfOrders = new List<IOrderInfo>();
|
||||
|
||||
if ((cfg.Orders == Orders.FromOracle || cfg.Orders == Orders.CombinedAndFromOracle) && ProcessData.OracleDB != null)
|
||||
{
|
||||
var list = ProcessData.OracleDB.ReadOrders();
|
||||
foreach (var o in list) listOfOrders.Add(o);
|
||||
}
|
||||
|
||||
if ((cfg.Orders == Orders.FromTracingDB || cfg.Orders == Orders.CombinedAndFromTracingDB) && ProcessData.TracingDB != null)
|
||||
{
|
||||
ISession session = ProcessData.TracingDB.SessionFactory.OpenSession();
|
||||
var list = ProcessData.TracingDB.ReadOrders(session);
|
||||
if (session.IsOpen) session.Close();
|
||||
foreach (var o in list) listOfOrders.Add(o);
|
||||
}
|
||||
|
||||
string insertFirst = null;
|
||||
if (Program.LocalSettings.PurchaseOrderHistoryCount > 0)
|
||||
if (!string.IsNullOrEmpty(preselectedOrder))
|
||||
{
|
||||
foreach (var o in listOfOrders)
|
||||
insertFirst = preselectedOrder;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Program.LocalSettings.PurchaseOrderHistoryCount > 0)
|
||||
{
|
||||
if (o.AuftragsNummer == Program.LocalSettings.PurchaseOrderHistory[0])
|
||||
foreach (var o in listOfOrders)
|
||||
{
|
||||
insertFirst = o.AuftragsNummer;
|
||||
break;
|
||||
if (o.POName == Program.LocalSettings.PurchaseOrderHistory[0])
|
||||
{
|
||||
insertFirst = o.POName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -90,6 +113,7 @@ namespace TBF.Rig.DataEntry.iPerl
|
||||
break;
|
||||
|
||||
case Orders.FromOracle:
|
||||
case Orders.FromTracingDB:
|
||||
if (insertFirst != null)
|
||||
{
|
||||
orderComboBox.Items.Add(insertFirst);
|
||||
@ -97,11 +121,12 @@ namespace TBF.Rig.DataEntry.iPerl
|
||||
}
|
||||
|
||||
foreach (var o in listOfOrders)
|
||||
if (o.AuftragsNummer != insertFirst)
|
||||
orderComboBox.Items.Add(o.AuftragsNummer);
|
||||
if (o.POName != insertFirst)
|
||||
orderComboBox.Items.Add(o.POName);
|
||||
break;
|
||||
|
||||
case Orders.CombinedAndFromOracle:
|
||||
case Orders.CombinedAndFromTracingDB:
|
||||
if (insertFirst != null)
|
||||
{
|
||||
orderComboBox.Items.Add(insertFirst);
|
||||
@ -141,8 +166,8 @@ namespace TBF.Rig.DataEntry.iPerl
|
||||
orderComboBox.Items.Add("GFAATMXX");
|
||||
|
||||
foreach (var o in listOfOrders)
|
||||
if (o.AuftragsNummer != insertFirst)
|
||||
orderComboBox.Items.Add(o.AuftragsNummer);
|
||||
if (o.POName != insertFirst)
|
||||
orderComboBox.Items.Add(o.POName);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -201,7 +226,7 @@ namespace TBF.Rig.DataEntry.iPerl
|
||||
return;
|
||||
}
|
||||
|
||||
ProcessData.OrderDetails = (listOfOrders == null) ? null : listOfOrders.FirstOrDefault<OrderDetails>(x => x.AuftragsNummer == orderComboBox.Text);
|
||||
ProcessData.OrderInfo = (listOfOrders == null) ? null : listOfOrders.FirstOrDefault<IOrderInfo>(x => x.POName == orderComboBox.Text);
|
||||
|
||||
PurchaseOrder = orderComboBox.Text;
|
||||
Program.LocalSettings.UpdateHistory(orderComboBox.Text, ref Program.LocalSettings.PurchaseOrderHistory);
|
||||
|
||||
@ -7,6 +7,7 @@ using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.Rig;
|
||||
using TBF.Rig.GenericDevices;
|
||||
using TBF.Rig.Sequences;
|
||||
|
||||
namespace TBF.Rig.DataEntry.iPerl
|
||||
{
|
||||
@ -84,7 +85,7 @@ namespace TBF.Rig.DataEntry.iPerl
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleBeginning;
|
||||
this.waterMeters = TBF.Rig.Sequences.ProcessData.BatchRslts.Batch.WaterMeters;
|
||||
this.waterMeters = ProcessData.BatchRslts.Batch.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -116,7 +117,8 @@ namespace TBF.Rig.DataEntry.iPerl
|
||||
///
|
||||
void OpenBeginningDlg(EntryForm myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleBeginningForm(TBF.Data.WMsCount, myRef.entryFormCfg);
|
||||
myRef.modelessDlg = new CycleBeginningForm(TBF.Data.WMsCount, myRef.entryFormCfg,
|
||||
ProcessData.SelectedProcedure.OrderInfo != null ? ProcessData.SelectedProcedure.OrderInfo.POName : string.Empty);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
@ -139,7 +141,14 @@ namespace TBF.Rig.DataEntry.iPerl
|
||||
switch (currentOp)
|
||||
{
|
||||
case CurrentOp.ShowFormAtCycleBeginning:
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this);
|
||||
if (ProcessData.SelectedProcedure.OrderInfo == null || entryFormCfg.Direction != Direction.S640)
|
||||
{
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this);
|
||||
}
|
||||
else
|
||||
{
|
||||
modelessDlg = null;
|
||||
}
|
||||
break;
|
||||
case CurrentOp.EnterTestStartStates:
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OpenTestStartStatesDlg), this);
|
||||
@ -154,7 +163,17 @@ namespace TBF.Rig.DataEntry.iPerl
|
||||
/// <returns>Event.ResultsPrinted</returns>
|
||||
public Event Run()
|
||||
{
|
||||
if ((modelessDlg is IHasCompleted) && !(modelessDlg as IHasCompleted).Completed)
|
||||
if (ProcessData.SelectedProcedure.OrderInfo != null && entryFormCfg.Direction == Direction.S640)
|
||||
{
|
||||
for (int i = 0; i < waterMeters.Count; i++)
|
||||
{
|
||||
if (waterMeters[i] != null)
|
||||
waterMeters[i].PurchaseOrder = ProcessData.SelectedProcedure.OrderInfo.POName;
|
||||
}
|
||||
return Event.ModelessFormClosed;
|
||||
}
|
||||
|
||||
if ((modelessDlg is IHasCompleted) && !(modelessDlg as IHasCompleted).Completed)
|
||||
{
|
||||
return Event.ModelessFormIsOpen;
|
||||
}
|
||||
|
||||
@ -32,17 +32,23 @@ namespace TBF.Rig.DataEntry.iPerl
|
||||
public enum Orders
|
||||
{
|
||||
#if LANG_SK
|
||||
[Description("Ľubovolné")] Arbitrary,
|
||||
[Description("Aktívne z Oracle")] FromOracle,
|
||||
[Description("Združené a aktívne z Oracle")] CombinedAndFromOracle,
|
||||
#elif LANG_DE
|
||||
[Description("Arbitrary")] Arbitrary,
|
||||
[Description("Active from Oracle")] FromOracle,
|
||||
[Description("Combined and active from Oracle")] CombinedAndFromOracle,
|
||||
[Description("Ľubovolné")] Arbitrary,
|
||||
[Description("Z Oracle databázy")] FromOracle,
|
||||
[Description("Zo sledovacej databázy")] FromTracingDB,
|
||||
[Description("Združené a z Oracle")] CombinedAndFromOracle,
|
||||
[Description("Združené a zo sledovacej databázy")] CombinedAndFromTracingDB,
|
||||
#elif LANG_CZ
|
||||
[Description("Libovolné")] Arbitrary,
|
||||
[Description("Z Oracle databáze")] FromOracle,
|
||||
[Description("Ze sledovací databáze")] FromTracingDB,
|
||||
[Description("Sdružené a z Oracle")] CombinedAndFromOracle,
|
||||
[Description("Sdružené a ze sledovací databáze")] CombinedAndFromTracingDB,
|
||||
#else
|
||||
[Description("Arbitrary")] Arbitrary,
|
||||
[Description("Active from Oracle")] FromOracle,
|
||||
[Description("Combined and active from Oracle")] CombinedAndFromOracle,
|
||||
[Description("Arbitrary")] Arbitrary,
|
||||
[Description("From Oracle")] FromOracle,
|
||||
[Description("From Tracing DB")] FromTracingDB,
|
||||
[Description("Combined and from Oracle")] CombinedAndFromOracle,
|
||||
[Description("Combined and from Tracing DB")] CombinedAndFromTracingDB,
|
||||
#endif
|
||||
Count,
|
||||
}
|
||||
@ -93,22 +99,15 @@ namespace TBF.Rig.DataEntry.iPerl
|
||||
|
||||
public ICollection<string> ParamValues(int i)
|
||||
{
|
||||
var list = new List<string>();
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
return new string[]
|
||||
{
|
||||
Direction.Forward_RL.ToDescription(),
|
||||
Direction.Reversed_LR.ToDescription(),
|
||||
Direction.S640.ToDescription(),
|
||||
};
|
||||
for (Direction d = 0; d < Direction.Count; d++) list.Add(d.ToDescription());
|
||||
return list;
|
||||
case 1:
|
||||
return new string[]
|
||||
{
|
||||
Orders.Arbitrary.ToDescription(),
|
||||
Orders.FromOracle.ToDescription(),
|
||||
Orders.CombinedAndFromOracle.ToDescription(),
|
||||
};
|
||||
for (Orders o = 0; o < Orders.Count; o++) list.Add(o.ToDescription());
|
||||
return list;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -75,7 +75,8 @@ namespace TBF.Rig.Output.DB.ProductionTracing
|
||||
Results.Entities.Batch batch;
|
||||
|
||||
|
||||
ISessionFactory sessionFactory; /// Factory to create database sessions that is initialized in the constructor
|
||||
public ISessionFactory SessionFactory; /// Factory to create database sessions that is initialized in the constructor
|
||||
|
||||
IList<SharedDatabase.Entities.Process> processes;
|
||||
Dictionary<int, SharedDatabase.Entities.Process> processDictionary;
|
||||
Dictionary<int, IList<SharedDatabase.Entities.Workstep>> workstepsDictionary;
|
||||
@ -125,7 +126,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing
|
||||
///
|
||||
/// Session factory is used to create database sessions
|
||||
///
|
||||
sessionFactory = FluentNHibernate.Cfg.Fluently.Configure()
|
||||
SessionFactory = FluentNHibernate.Cfg.Fluently.Configure()
|
||||
.Database(FluentNHibernate.Cfg.Db.MySQLConfiguration.Standard.ConnectionString(tracingCfg.ConnStr))
|
||||
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Process>())
|
||||
.ExposeConfiguration(SharedDatabase.TracingDB.BuildSchema)
|
||||
@ -146,7 +147,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing
|
||||
///
|
||||
/// Register this test bench in the tracing DB for approx. 2 weeks
|
||||
///
|
||||
ISession session = sessionFactory.OpenSession();
|
||||
ISession session = SessionFactory.OpenSession();
|
||||
|
||||
#if !DEBUG
|
||||
/// Only a release version registers a workplace
|
||||
@ -160,7 +161,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing
|
||||
#endif
|
||||
session.Flush();
|
||||
session.Close();
|
||||
SharedDatabase.TracingDB.SessionFactory = sessionFactory;
|
||||
SharedDatabase.TracingDB.SessionFactory = SessionFactory;
|
||||
if (session != null) session.Dispose();
|
||||
|
||||
currentWorkflow = null;
|
||||
@ -178,7 +179,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing
|
||||
{
|
||||
if (tracingCfg.DebugLevel == DebugMode.Simulate) return;
|
||||
|
||||
using (ISession session = sessionFactory.OpenSession())
|
||||
using (ISession session = SessionFactory.OpenSession())
|
||||
{
|
||||
SharedDatabase.TracingDB.UnregisterWorkplaceObsolete(session, workplace);
|
||||
session.Flush();
|
||||
@ -187,6 +188,69 @@ namespace TBF.Rig.Output.DB.ProductionTracing
|
||||
public void StopDevice2() {}
|
||||
|
||||
|
||||
public IList<OrderInfo> ReadOrders(ISession session)
|
||||
{
|
||||
try
|
||||
{
|
||||
session = SessionFactory.OpenSession();
|
||||
var result = session.QueryOver<OrderInfo>()
|
||||
.Where(x => (x.POState == (sbyte)OrderState.New || x.POState == (sbyte)OrderState.Active))
|
||||
.List<OrderInfo>();
|
||||
return result;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
log.ErrorFormat("Cannot read orders from the tracing DB: {0}", exc.Message);
|
||||
return new List<OrderInfo>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Read reference records belonging to specified order
|
||||
/// </summary>
|
||||
/// <param name="session">DB sesson</param>
|
||||
/// <param name="order">Order</param>
|
||||
/// <returns>List of reference records-s</returns>
|
||||
public IList<ReferenceRecord> ReadRefRecords(ISession session, OrderInfo order)
|
||||
{
|
||||
try
|
||||
{
|
||||
return session.QueryOver<ReferenceRecord>()
|
||||
.Where(x => (x.POrder == order))
|
||||
.List();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
log.ErrorFormat("Cannot read orders from the tracing DB: {0}", exc.Message);
|
||||
return new List<ReferenceRecord>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Read records belonging to specified order
|
||||
/// </summary>
|
||||
/// <param name="session">DB sesson</param>
|
||||
/// <param name="order">Order</param>
|
||||
/// <returns>List of records</returns>
|
||||
public IList<Record> ReadRecords(ISession session, OrderInfo order)
|
||||
{
|
||||
try
|
||||
{
|
||||
return session.QueryOver<Record>()
|
||||
.JoinQueryOver<ReferenceRecord>(rec => rec.ReferenceRecord)
|
||||
.Where(rr => rr.POrder.Id == order.Id)
|
||||
.List<Record>();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
log.ErrorFormat("Cannot read orders from the tracing DB: {0}", exc.Message);
|
||||
return new List<Record>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Reads information on start of a cycle, Events: Event.InfoRead
|
||||
/// </summary>
|
||||
@ -349,7 +413,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing
|
||||
if (sampleWM != null)
|
||||
{
|
||||
bool isAtLeastOneNOK = false;
|
||||
using (ISession session = sessionFactory.OpenSession())
|
||||
using (ISession session = SessionFactory.OpenSession())
|
||||
{
|
||||
var cOrders = session.QueryOver<OrderInfo>()
|
||||
.Where(x => x.POName == sampleWM.PurchaseOrder)
|
||||
@ -518,7 +582,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing
|
||||
///
|
||||
try
|
||||
{
|
||||
session = sessionFactory.OpenSession();
|
||||
session = SessionFactory.OpenSession();
|
||||
transaction = session.BeginTransaction();
|
||||
|
||||
var cOrders = session.QueryOver<OrderInfo>()
|
||||
|
||||
@ -1546,7 +1546,7 @@ namespace TBF.Rig.Output.DB.SensusOracle
|
||||
/// </summary>
|
||||
/// <param name="connection">Oracle DB connection</param>
|
||||
/// <returns>List of active purchase orders</returns>
|
||||
public IList<OrderDetails> ReadOrderNumbers()
|
||||
public IList<OrderDetails> ReadOrders()
|
||||
{
|
||||
OracleConnection connection = ProductionDB;
|
||||
|
||||
@ -1588,18 +1588,18 @@ namespace TBF.Rig.Output.DB.SensusOracle
|
||||
int znrlaenge = dr.GetInt32(i++);
|
||||
string modul_param; try { modul_param = dr.GetString(i++); } catch { modul_param = string.Empty; }
|
||||
|
||||
orders.Add(new OrderDetails { AuftragsNummer = auftragsnummer,
|
||||
VariantenCode = variantencode,
|
||||
EsrsteZaehlerNr = erste_zaehlernr,
|
||||
Prefix = prefix,
|
||||
Suffix = suffix,
|
||||
orders.Add(new OrderDetails { POName = auftragsnummer,
|
||||
VariantCode = variantencode,
|
||||
SNFirst = erste_zaehlernr,
|
||||
SNPrefix = prefix,
|
||||
SNSuffix = suffix,
|
||||
Zaehlwerk = zaehlwerk,
|
||||
Created = erfasst_am,
|
||||
DueDate = sollende,
|
||||
TargetPcsCount = sollstueck,
|
||||
PiecesCount = sollstueck,
|
||||
Remark = zusatztext,
|
||||
SNLength = znrlaenge,
|
||||
ModuleParameter = modul_param });
|
||||
SNDigitsCount = znrlaenge,
|
||||
ModuleParam = modul_param });
|
||||
}
|
||||
dr.Close();
|
||||
}
|
||||
@ -1615,10 +1615,10 @@ namespace TBF.Rig.Output.DB.SensusOracle
|
||||
}
|
||||
else
|
||||
{
|
||||
orders = new List<OrderDetails> ()
|
||||
orders = new List<OrderDetails>()
|
||||
{
|
||||
new OrderDetails { AuftragsNummer = "1234567", EsrsteZaehlerNr = 1, TargetPcsCount = 100, Prefix = "Pre", Suffix = "Suf", VariantenCode = "abeceda" },
|
||||
new OrderDetails { AuftragsNummer = "2345678", EsrsteZaehlerNr = 1, TargetPcsCount = 200, Prefix = "Pfx", Suffix = "Sfx", VariantenCode = "zjedla_deda" },
|
||||
new OrderDetails { POName = "1234567", SNFirst = 1, PiecesCount = 100, SNPrefix = "Pre", SNSuffix = "Suf", VariantCode = "abeceda" },
|
||||
new OrderDetails { POName = "2345678", SNFirst = 1, PiecesCount = 200, SNPrefix = "Pfx", SNSuffix = "Sfx", VariantCode = "zjedla_deda" },
|
||||
};
|
||||
}
|
||||
|
||||
@ -1631,7 +1631,7 @@ namespace TBF.Rig.Output.DB.SensusOracle
|
||||
/// </summary>
|
||||
/// <param name="connection">Oracle DB connection</param>
|
||||
/// <returns>List of active purchase orders</returns>
|
||||
public bool ReadOrderDetails(ref OrderDetails auftrag)
|
||||
public bool ReadOrderDetails(ref OrderDetails order)
|
||||
{
|
||||
if (dbCfg.DebugLevel == DebugMode.Normal)
|
||||
{
|
||||
@ -1643,12 +1643,12 @@ namespace TBF.Rig.Output.DB.SensusOracle
|
||||
|
||||
|
||||
OracleCommand cmd = new OracleCommand("SELECT iststueck FROM vt_auftrag_pd WHERE auftragsnummer=:1 AND anbid=:2", connection);
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = auftrag.AuftragsNummer });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = order.POName });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = ProducerAnbid });
|
||||
OracleDataReader dr = cmd.ExecuteReader();
|
||||
if (dr.Read())
|
||||
{
|
||||
try { auftrag.CurrentPcsCount = dr.GetInt32(0); } catch { auftrag.CurrentPcsCount = 0; }
|
||||
try { order.CurrentPcsCount = dr.GetInt32(0); } catch { order.CurrentPcsCount = 0; }
|
||||
}
|
||||
dr.Close();
|
||||
|
||||
@ -1657,20 +1657,20 @@ namespace TBF.Rig.Output.DB.SensusOracle
|
||||
" prefix_adresse, suffix_adresse, akt_adresse " +
|
||||
"FROM vt_auft_zaehlernr_pd " +
|
||||
"WHERE auftragsnummer=:1 AND anbid=:2", connection);
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = auftrag.AuftragsNummer });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = order.POName });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = ProducerAnbid });
|
||||
dr = cmd.ExecuteReader();
|
||||
if (dr.Read())
|
||||
{
|
||||
int i = 0;
|
||||
auftrag.FirstSerialNr = dr.GetInt32(i++);
|
||||
auftrag.LastSerialNr = dr.GetInt32(i++);
|
||||
auftrag.CurrentSerialNr = dr.GetInt32(i++);
|
||||
auftrag.FirstRadioAddress = dr.GetInt32(i++);
|
||||
auftrag.LastRadioAddress = dr.GetInt32(i++);
|
||||
try { auftrag.RadioAddressPrefix = dr.GetString(i++); } catch { auftrag.RadioAddressPrefix = string.Empty; }
|
||||
try { auftrag.RadioAddressSuffix = dr.GetString(i++); } catch { auftrag.RadioAddressSuffix = string.Empty; }
|
||||
auftrag.CurrentRadioAddress = dr.GetInt32(i++);
|
||||
order.SNFirst = dr.GetInt32(i++);
|
||||
order.LastSerialNr = dr.GetInt32(i++);
|
||||
order.CurrentSN = dr.GetInt32(i++);
|
||||
order.RAFirst = dr.GetInt32(i++);
|
||||
order.LastRadioAddress = dr.GetInt32(i++);
|
||||
try { order.RAPrefix = dr.GetString(i++); } catch { order.RAPrefix = string.Empty; }
|
||||
try { order.RASuffix = dr.GetString(i++); } catch { order.RASuffix = string.Empty; }
|
||||
order.CurrentRA = dr.GetInt32(i++);
|
||||
}
|
||||
dr.Close();
|
||||
|
||||
@ -1681,7 +1681,7 @@ namespace TBF.Rig.Output.DB.SensusOracle
|
||||
catch (Exception exc)
|
||||
{
|
||||
log.ErrorFormat("ERROR: Oracle DB query SELECT ... FROM vt_auft_zaehlernr_pd WHERE auftragsnummer={0} failed: {1}",
|
||||
auftrag.AuftragsNummer, exc.Message);
|
||||
order.POName, exc.Message);
|
||||
if (connection != null) connection.Close();
|
||||
return false;
|
||||
}
|
||||
@ -1711,16 +1711,16 @@ namespace TBF.Rig.Output.DB.SensusOracle
|
||||
|
||||
OracleCommand cmd = new OracleCommand("UPDATE vt_auftrag_pd SET iststueck=:1 WHERE auftragsnummer=:2 AND anbid=:3", connection);
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = auftrag.CurrentPcsCount });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = auftrag.AuftragsNummer });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = auftrag.POName });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = ProducerAnbid });
|
||||
int updatedRows = cmd.ExecuteNonQuery();
|
||||
|
||||
|
||||
cmd = new OracleCommand("UPDATE vt_auft_zaehlernr_pd SET akt_nummer=:1, akt_adresse=:2 " +
|
||||
"WHERE auftragsnummer=:3 AND anbid=:4", connection);
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = auftrag.CurrentSerialNr });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = auftrag.CurrentRadioAddress });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = auftrag.AuftragsNummer });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = auftrag.CurrentSN });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = auftrag.CurrentRA });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = auftrag.POName });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = ProducerAnbid });
|
||||
updatedRows = Math.Min(cmd.ExecuteNonQuery(), updatedRows);
|
||||
|
||||
@ -1731,7 +1731,7 @@ namespace TBF.Rig.Output.DB.SensusOracle
|
||||
catch (Exception exc)
|
||||
{
|
||||
log.ErrorFormat("ERROR: Oracle DB query SELECT ... FROM vt_auft_zaehlernr_pd WHERE auftragsnummer={0} failed: {1}",
|
||||
auftrag.AuftragsNummer, exc.Message);
|
||||
auftrag.POName, exc.Message);
|
||||
if (connection != null) connection.Close();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -5,49 +5,48 @@ using System;
|
||||
|
||||
namespace TBF.Rig.Output.DB.SensusOracle
|
||||
{
|
||||
public class OrderDetails
|
||||
public class OrderDetails : Common.IOrderInfo
|
||||
{
|
||||
///
|
||||
/// Fixed
|
||||
///
|
||||
public string AuftragsNummer; /// Production order
|
||||
public string VariantenCode; /// Spec
|
||||
public int EsrsteZaehlerNr; /// First S/N
|
||||
public string Prefix; /// S/N prefix
|
||||
public string Suffix; /// S/N suffix
|
||||
public int Zaehlwerk; /// SAP number of the counter
|
||||
public string POName { get; set; } /// Production order
|
||||
public string VariantCode { get; set; } /// Spec
|
||||
public string ModuleParam { get; set; }
|
||||
public int PiecesCount { get; set; } /// Target pieces count
|
||||
public string SNPrefix { get; set; } /// S/N prefix
|
||||
public int SNFirst { get; set; } /// First S/N
|
||||
public int SNDigitsCount { get; set; }
|
||||
public string SNSuffix { get; set; } /// S/N suffix
|
||||
public string RAPrefix { get; set; }
|
||||
public int RAFirst { get; set; }
|
||||
public string RASuffix { get; set; }
|
||||
public string Remark { get; set; }
|
||||
public DateTime Created;
|
||||
public DateTime DueDate;
|
||||
public int TargetPcsCount; /// Target pieces count
|
||||
public string Remark;
|
||||
public int SNLength;
|
||||
public string ModuleParameter;
|
||||
public int FirstSerialNr;
|
||||
public int Zaehlwerk; /// SAP number of the counter
|
||||
public int LastSerialNr;
|
||||
public int FirstRadioAddress;
|
||||
public int LastRadioAddress;
|
||||
public string RadioAddressPrefix;
|
||||
public string RadioAddressSuffix;
|
||||
///
|
||||
/// Incremented
|
||||
///
|
||||
public int CurrentPcsCount;
|
||||
public int CurrentSerialNr;
|
||||
public int CurrentRadioAddress;
|
||||
public int CurrentPcsCount { get; set; }
|
||||
public int CurrentSN { get; set; }
|
||||
public int CurrentRA { get; set; }
|
||||
|
||||
public OrderDetails()
|
||||
{
|
||||
Prefix = string.Empty;
|
||||
Suffix = string.Empty;
|
||||
SNPrefix = string.Empty;
|
||||
SNSuffix = string.Empty;
|
||||
Remark = string.Empty;
|
||||
ModuleParameter = string.Empty;
|
||||
RadioAddressPrefix = string.Empty;
|
||||
RadioAddressSuffix = string.Empty;
|
||||
ModuleParam = string.Empty;
|
||||
RAPrefix = string.Empty;
|
||||
RASuffix = string.Empty;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0} [{1}] {2}", AuftragsNummer, TargetPcsCount, VariantenCode);
|
||||
return string.Format("{0} [{1}] {2}", POName, PiecesCount, VariantCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,7 +101,8 @@ namespace TBF.Rig.Sequences
|
||||
/// 2nd argument: as is
|
||||
/// 3rd argument: as is
|
||||
|
||||
myRef.modelessDlg = new TestMethods.S640Communication.S640CommForm(activities, config, procParams, tests);
|
||||
myRef.modelessDlg = new TestMethods.S640Communication.S640CommForm(activities, config, procParams, tests,
|
||||
ProcessData.BatchRslts.Batch.WaterMeters);
|
||||
myRef.modelessDlg.Show();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -212,9 +213,12 @@ namespace TBF.Rig.Sequences
|
||||
}
|
||||
while (selection == Selection.Shutdown);
|
||||
|
||||
ProcessData.SelectedProcedure = Program.MainWnd.SelectedProcedure;
|
||||
ProcessData.OrderInfo = Program.MainWnd.SelectedProcedure.OrderInfo;
|
||||
|
||||
selectedTestName = (selection == Selection.Q1) ? "Q1"
|
||||
: ((selection == Selection.Q2) ? "Q2"
|
||||
: ((selection == Selection.Q3) ? "Q3" : Bridge.SelectedTestName));
|
||||
: ((selection == Selection.Q3) ? "Q3" : Program.MainWnd.BenchControlPanel.TestName));
|
||||
|
||||
///
|
||||
/// Auto invocation actions
|
||||
@ -286,9 +290,9 @@ namespace TBF.Rig.Sequences
|
||||
foreach (var test in StateMachine.Procedure.Tests) a += test.MoreParams.Count;
|
||||
}
|
||||
}
|
||||
else if (Bridge.SelectedProcedure != null &&
|
||||
Bridge.SelectedProcedure.ResolvedSource != ProcedureSelection.None &&
|
||||
!string.IsNullOrEmpty(Bridge.SelectedProcedure.ResolvedName))
|
||||
else if (SelectedProcedure != null &&
|
||||
SelectedProcedure.ResolvedSource != ProcedureSelection.None &&
|
||||
!string.IsNullOrEmpty(SelectedProcedure.ResolvedName))
|
||||
{
|
||||
if (selection == Selection.Cycle)
|
||||
{
|
||||
@ -306,13 +310,13 @@ namespace TBF.Rig.Sequences
|
||||
}
|
||||
|
||||
/// TODO: Repeate twice for DBKind.Config and DBKind.RemoteConfig
|
||||
using (ISession remoteOrLocalSession = TBF.DB.CreateSession((Bridge.SelectedProcedure.ResolvedSource == ProcedureSelection.FromSharedDB) ?
|
||||
using (ISession remoteOrLocalSession = TBF.DB.CreateSession((SelectedProcedure.ResolvedSource == ProcedureSelection.FromSharedDB) ?
|
||||
DBKind.RemoteConfig :
|
||||
DBKind.Config))
|
||||
{
|
||||
StateMachine.LoadProcedure(remoteOrLocalSession,
|
||||
Bridge.SelectedProcedure.ResolvedName,
|
||||
(Bridge.SelectedProcedure.ResolvedSource == ProcedureSelection.FromSharedDB),
|
||||
SelectedProcedure.ResolvedName,
|
||||
(SelectedProcedure.ResolvedSource == ProcedureSelection.FromSharedDB),
|
||||
testsInside);
|
||||
StateMachine.LoadProcedureParams(StateMachine.Procedure);
|
||||
|
||||
@ -426,10 +430,12 @@ namespace TBF.Rig.Sequences
|
||||
else if (selection != Selection.RestoreInterruptedSession)
|
||||
{
|
||||
/// This is a regular session => initialize BatchRslts
|
||||
BatchRslts = CreateNewBatchResults(newBatchNr, StateMachine.Procedure, Bridge.SelectedProcedure.Variant,
|
||||
Bridge.SelectedProcedure.Order,
|
||||
Bridge.SelectedProcedure.Workflow,
|
||||
Bridge.SelectedProcedure.LaserMarking);
|
||||
string vaco = (SelectedProcedure != null) ? SelectedProcedure.Variant : string.Empty;
|
||||
string order = (SelectedProcedure != null && SelectedProcedure.OrderInfo != null) ? SelectedProcedure.OrderInfo.POName : string.Empty;
|
||||
string wflow = (SelectedProcedure != null) ? SelectedProcedure.Workflow : string.Empty;
|
||||
string laser = (SelectedProcedure != null) ? SelectedProcedure.LaserMarking : string.Empty;
|
||||
///
|
||||
BatchRslts = CreateNewBatchResults(newBatchNr, StateMachine.Procedure, vaco, order, wflow, laser);
|
||||
}
|
||||
|
||||
|
||||
@ -684,10 +690,12 @@ namespace TBF.Rig.Sequences
|
||||
}
|
||||
switch (selection)
|
||||
{
|
||||
case Selection.Q1: selectedTestName = "Q1"; break;
|
||||
case Selection.Q2: selectedTestName = "Q2"; break;
|
||||
case Selection.Q3: selectedTestName = "Q3"; break;
|
||||
default: selectedTestName = Bridge.SelectedTestName; break;
|
||||
case Selection.Q1: selectedTestName = "Q1"; break;
|
||||
case Selection.Q2: selectedTestName = "Q2"; break;
|
||||
case Selection.Q3: selectedTestName = "Q3"; break;
|
||||
default:
|
||||
selectedTestName = Program.MainWnd.BenchControlPanel.TestName;
|
||||
break;
|
||||
}
|
||||
///
|
||||
UiBridge.Bridge.OnError(this, string.Empty); /// Clear an error message (if any)
|
||||
|
||||
@ -22,7 +22,6 @@ namespace TBF.Rig.Sequences
|
||||
public static IErrorFlags ErrorFlagsComp;
|
||||
public static IStatisticsMonitoring StatisticsMonitoringComp;
|
||||
public static Output.DB.SensusOracle.Database OracleDB;
|
||||
public static Output.DB.SensusOracle.OrderDetails OrderDetails;
|
||||
public static Output.DB.ProductionTracing.Tracing TracingDB;
|
||||
|
||||
///
|
||||
@ -33,11 +32,17 @@ namespace TBF.Rig.Sequences
|
||||
public static int LineSize { get { return BenchInfo != null ? BenchInfo.WaterMetersCount / Math.Max(1, BenchInfo.LinesCount) : 10; } }
|
||||
public static int CompoundWMsCount { get { return BenchInfo != null ? BenchInfo.CompoundMetersCount : 1; } }
|
||||
|
||||
///------------------------------------------------------------
|
||||
///
|
||||
/// Procedure related state variables
|
||||
///
|
||||
public static ProcedureInfo SelectedProcedure;
|
||||
public static Common.IOrderInfo OrderInfo;
|
||||
|
||||
///
|
||||
/// Test related (instance) variables.
|
||||
/// Created when test sequence is open.
|
||||
/// They persist during all repetitions of the same test
|
||||
///------------------------------------------------------------
|
||||
///
|
||||
protected static Rig.BenchPath benchPath;
|
||||
protected static Rig.OutputPath outPath;
|
||||
public static Rig.OutputPath Devices { get { return outPath; } }
|
||||
|
||||
@ -29,6 +29,15 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
IndividualKey,
|
||||
}
|
||||
|
||||
public enum SerialNumbers
|
||||
{
|
||||
None,
|
||||
DisplayReadonly,
|
||||
EnterManually,
|
||||
FromProductionTracing,
|
||||
Count
|
||||
}
|
||||
|
||||
public enum Result
|
||||
{
|
||||
None,
|
||||
|
||||
@ -10,7 +10,8 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
int OptoDataTimeout { get; }
|
||||
string FileExchangePath { get; }
|
||||
int FileExchangeTimeout { get; }
|
||||
bool EnterSerialNumbers { get; }
|
||||
SerialNumbers SerialNumbers { get; }
|
||||
SerialNumbers AssignedNumbers { get; }
|
||||
bool SkipBadMeters { get; }
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -24,7 +24,7 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
///
|
||||
void OpenS640CommForm(S640CommSeq myRef, S640Activity activity, I640Cfg config, ProcParams procParams, Test test)
|
||||
{
|
||||
myRef.modelessDlg = new S640CommForm(activity, config, procParams, test);
|
||||
myRef.modelessDlg = new S640CommForm(activity, config, procParams, test, BatchRslts.Batch.WaterMeters);
|
||||
myRef.modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
|
||||
@ -19,17 +19,21 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(S640EndCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities)
|
||||
{
|
||||
return new Configs.ParamsProvider.ComponentCfgCtrl(this, null);
|
||||
}
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public int OptoDataTimeout { get; set; }
|
||||
public string FileExchangePath { get; set; }
|
||||
public int FileExchangeTimeout { get; set; }
|
||||
public bool EnterSerialNumbers { get; set; }
|
||||
public bool SkipBadMeters { get; set; }
|
||||
public bool SimultWithEvacuation { get; set; }
|
||||
public int OptoDataTimeout { get; set; } /// 0
|
||||
public string FileExchangePath { get; set; } /// 1
|
||||
public int FileExchangeTimeout { get; set; } /// 2
|
||||
public SerialNumbers SerialNumbers { get; set; } /// 3
|
||||
public SerialNumbers AssignedNumbers { get; set; } /// 4
|
||||
public bool SkipBadMeters { get; set; } /// 5
|
||||
public bool SimultWithEvacuation { get; set; } /// 6
|
||||
|
||||
/// <summary> Procedure parameters </summary>
|
||||
[XmlIgnore]
|
||||
@ -59,7 +63,8 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
OptoDataTimeout = 120;
|
||||
FileExchangePath = "1";
|
||||
FileExchangeTimeout = 420;
|
||||
EnterSerialNumbers = false;
|
||||
SerialNumbers = SerialNumbers.None;
|
||||
AssignedNumbers = SerialNumbers.None;
|
||||
SkipBadMeters = false;
|
||||
SimultWithEvacuation = true;
|
||||
}
|
||||
@ -69,7 +74,8 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
"Awaiting optical data timeout [s] (0 = off)",
|
||||
"File exchange path",
|
||||
"File exchange timeout [s] (0 = off)",
|
||||
"Enter serial numbers",
|
||||
"Housing numbers mode",
|
||||
"Assigned S/N-s mode",
|
||||
"Skip bad meters when entering s/n",
|
||||
"Simultaneous with evacuation",
|
||||
};
|
||||
@ -82,7 +88,12 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
{
|
||||
case 3:
|
||||
case 4:
|
||||
return new List<string> { SerialNumbers.None.ToString(),
|
||||
SerialNumbers.DisplayReadonly.ToString(),
|
||||
SerialNumbers.EnterManually.ToString(),
|
||||
SerialNumbers.FromProductionTracing.ToString() };
|
||||
case 5:
|
||||
case 6:
|
||||
return new List<string> { Strings.yes, Strings.no };
|
||||
default:
|
||||
return null;
|
||||
@ -96,9 +107,10 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
case 0: return OptoDataTimeout.ToString();
|
||||
case 1: return FileExchangePath;
|
||||
case 2: return FileExchangeTimeout.ToString();
|
||||
case 3: return EnterSerialNumbers ? Strings.yes : Strings.no;
|
||||
case 4: return SkipBadMeters ? Strings.yes : Strings.no;
|
||||
case 5: return SimultWithEvacuation ? Strings.yes : Strings.no;
|
||||
case 3: return SerialNumbers.ToString();
|
||||
case 4: return AssignedNumbers.ToString();
|
||||
case 5: return SkipBadMeters ? Strings.yes : Strings.no;
|
||||
case 6: return SimultWithEvacuation ? Strings.yes : Strings.no;
|
||||
default:
|
||||
return string.Format("{0}: FileExchangePath = '{1}' FileExchangeTimeout = {2}s", Name, FileExchangePath, FileExchangeTimeout);
|
||||
}
|
||||
@ -108,15 +120,42 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0: OptoDataTimeout = int.Parse(strValue); return CfgUpdateFlags.RestartRqrd;
|
||||
case 1: FileExchangePath = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 2: FileExchangeTimeout = int.Parse(strValue); return CfgUpdateFlags.RestartRqrd;
|
||||
case 3: EnterSerialNumbers = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
|
||||
case 4: SkipBadMeters = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
|
||||
case 5: SimultWithEvacuation = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
|
||||
case 0:
|
||||
OptoDataTimeout = int.Parse(strValue);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 1:
|
||||
FileExchangePath = strValue;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 2:
|
||||
FileExchangeTimeout = int.Parse(strValue);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 3:
|
||||
for (SerialNumbers sn = 0; sn < SerialNumbers.Count; sn++)
|
||||
if (sn.ToString() == strValue)
|
||||
{
|
||||
SerialNumbers = sn;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
for (SerialNumbers sn = 0; sn < SerialNumbers.Count; sn++)
|
||||
if (sn.ToString() == strValue)
|
||||
{
|
||||
AssignedNumbers = sn;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
SkipBadMeters = (strValue == Strings.yes);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 6:
|
||||
SimultWithEvacuation = (strValue == Strings.yes);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
default:
|
||||
return CfgUpdateFlags.None;
|
||||
break;
|
||||
}
|
||||
|
||||
return CfgUpdateFlags.None;
|
||||
}
|
||||
|
||||
public bool ValidateParam(int i, string strValue, out string message)
|
||||
@ -135,6 +174,7 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
if (ParamValues(i).Contains(strValue)) return true;
|
||||
break;
|
||||
default:
|
||||
@ -151,7 +191,8 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
prms.OptoDataTimeout = this.OptoDataTimeout;
|
||||
prms.FileExchangePath = this.FileExchangePath;
|
||||
prms.FileExchangeTimeout = this.FileExchangeTimeout;
|
||||
prms.EnterSerialNumbers = this.EnterSerialNumbers;
|
||||
prms.SerialNumbers = this.SerialNumbers;
|
||||
prms.AssignedNumbers = this.AssignedNumbers;
|
||||
prms.SkipBadMeters = this.SkipBadMeters;
|
||||
prms.SimultWithEvacuation = this.SimultWithEvacuation;
|
||||
}
|
||||
|
||||
@ -19,17 +19,21 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(S640StartCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities)
|
||||
{
|
||||
return new Configs.ParamsProvider.ComponentCfgCtrl(this, null);
|
||||
}
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public int OptoDataTimeout { get; set; }
|
||||
public string FileExchangePath { get; set; }
|
||||
public int FileExchangeTimeout { get; set; }
|
||||
public bool EnterSerialNumbers { get; set; }
|
||||
public bool SkipBadMeters { get; set; }
|
||||
public bool SimultWithPurging { get; set; }
|
||||
public int OptoDataTimeout { get; set; } /// 0
|
||||
public string FileExchangePath { get; set; } /// 1
|
||||
public int FileExchangeTimeout { get; set; } /// 2
|
||||
public SerialNumbers SerialNumbers { get; set; } /// 3
|
||||
public SerialNumbers AssignedNumbers { get; set; } /// 4
|
||||
public bool SkipBadMeters { get; set; } /// 5
|
||||
public bool SimultWithPurging { get; set; } /// 6
|
||||
|
||||
/// <summary> Procedure parameters </summary>
|
||||
[XmlIgnore]
|
||||
@ -59,7 +63,8 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
OptoDataTimeout = 180;
|
||||
FileExchangePath = "1";
|
||||
FileExchangeTimeout = 420;
|
||||
EnterSerialNumbers = true;
|
||||
SerialNumbers = SerialNumbers.None;
|
||||
AssignedNumbers = SerialNumbers.None;
|
||||
SkipBadMeters = false;
|
||||
SimultWithPurging = true;
|
||||
}
|
||||
@ -69,7 +74,8 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
"Awaiting optical data timeout [s] (0 = off)",
|
||||
"File exchange path",
|
||||
"File exchange timeout [s] (0 = off)",
|
||||
"Enter serial numbers",
|
||||
"Housing numbers mode",
|
||||
"Assigned S/N-s mode",
|
||||
"Skip bad meters when entering s/n",
|
||||
"Simultaneous with purging",
|
||||
};
|
||||
@ -82,7 +88,12 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
{
|
||||
case 3:
|
||||
case 4:
|
||||
return new List<string> { SerialNumbers.None.ToString(),
|
||||
SerialNumbers.DisplayReadonly.ToString(),
|
||||
SerialNumbers.EnterManually.ToString(),
|
||||
SerialNumbers.FromProductionTracing.ToString() };
|
||||
case 5:
|
||||
case 6:
|
||||
return new List<string> { Strings.yes, Strings.no };
|
||||
default:
|
||||
return null;
|
||||
@ -96,9 +107,10 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
case 0: return OptoDataTimeout.ToString();
|
||||
case 1: return FileExchangePath;
|
||||
case 2: return FileExchangeTimeout.ToString();
|
||||
case 3: return EnterSerialNumbers ? Strings.yes : Strings.no;
|
||||
case 4: return SkipBadMeters ? Strings.yes : Strings.no;
|
||||
case 5: return SimultWithPurging ? Strings.yes : Strings.no;
|
||||
case 3: return SerialNumbers.ToString();
|
||||
case 4: return AssignedNumbers.ToString();
|
||||
case 5: return SkipBadMeters ? Strings.yes : Strings.no;
|
||||
case 6: return SimultWithPurging ? Strings.yes : Strings.no;
|
||||
default:
|
||||
return string.Format("{0}: FileExchangePath = '{1}' FileExchangeTimeout = {2}s", Name, FileExchangePath, FileExchangeTimeout);
|
||||
}
|
||||
@ -108,15 +120,42 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0: OptoDataTimeout = int.Parse(strValue); return CfgUpdateFlags.RestartRqrd;
|
||||
case 1: FileExchangePath = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 2: FileExchangeTimeout = int.Parse(strValue); return CfgUpdateFlags.RestartRqrd;
|
||||
case 3: EnterSerialNumbers = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
|
||||
case 4: SkipBadMeters = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
|
||||
case 5: SimultWithPurging = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
|
||||
case 0:
|
||||
OptoDataTimeout = int.Parse(strValue);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 1:
|
||||
FileExchangePath = strValue;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 2:
|
||||
FileExchangeTimeout = int.Parse(strValue);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 3:
|
||||
for (SerialNumbers sn = 0; sn < SerialNumbers.Count; sn++)
|
||||
if (sn.ToString() == strValue)
|
||||
{
|
||||
SerialNumbers = sn;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
for (SerialNumbers sn = 0; sn < SerialNumbers.Count; sn++)
|
||||
if (sn.ToString() == strValue)
|
||||
{
|
||||
AssignedNumbers = sn;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
SkipBadMeters = (strValue == Strings.yes);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 6:
|
||||
SimultWithPurging = (strValue == Strings.yes);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
default:
|
||||
return CfgUpdateFlags.None;
|
||||
break;
|
||||
}
|
||||
|
||||
return CfgUpdateFlags.None;
|
||||
}
|
||||
|
||||
public bool ValidateParam(int i, string strValue, out string message)
|
||||
@ -135,6 +174,7 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
if (ParamValues(i).Contains(strValue)) return true;
|
||||
break;
|
||||
default:
|
||||
@ -151,7 +191,8 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
prms.OptoDataTimeout = this.OptoDataTimeout;
|
||||
prms.FileExchangePath = this.FileExchangePath;
|
||||
prms.FileExchangeTimeout = this.FileExchangeTimeout;
|
||||
prms.EnterSerialNumbers = this.EnterSerialNumbers;
|
||||
prms.SerialNumbers = this.SerialNumbers;
|
||||
prms.AssignedNumbers = this.AssignedNumbers;
|
||||
prms.SkipBadMeters = this.SkipBadMeters;
|
||||
prms.SimultWithPurging = this.SimultWithPurging;
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ namespace TBF.UI
|
||||
///
|
||||
IList<Procedure> localProcedures; /// procedures loaded form the local DB
|
||||
IList<Procedure> remoteProcedures; /// Procedures loaded from thr remote/shared DB
|
||||
IList<SharedDatabase.Entities.OrderInfo> mySqlOrders; /// Production orders loaded from the production tracing DB
|
||||
IList<SharedDatabase.Entities.OrderInfo> tracingDBOrders; /// Production orders loaded from the production tracing DB
|
||||
IList<TBF.Rig.Output.DB.SensusOracle.OrderDetails> oracleOrders; /// Production orders loaded from the Oracle DB
|
||||
IList<ProcedureInfo> procedureInfos; /// Composed procedure infos
|
||||
///
|
||||
@ -118,7 +118,7 @@ namespace TBF.UI
|
||||
|
||||
localProcedures = new List<Procedure>();
|
||||
remoteProcedures = new List<Procedure>();
|
||||
mySqlOrders = new List<SharedDatabase.Entities.OrderInfo>();
|
||||
tracingDBOrders = new List<SharedDatabase.Entities.OrderInfo>();
|
||||
oracleOrders = new List<Rig.Output.DB.SensusOracle.OrderDetails>();
|
||||
procedureInfos = new List<ProcedureInfo>();
|
||||
SelectedProcedure = null;
|
||||
@ -796,31 +796,31 @@ namespace TBF.UI
|
||||
}
|
||||
else if (src == ProcedureSelection.OrderFromOracleDB)
|
||||
{
|
||||
oracleOrders = Rig.Sequences.ProcessData.OracleDB.ReadOrderNumbers();
|
||||
oracleOrders = Rig.Sequences.ProcessData.OracleDB.ReadOrders();
|
||||
|
||||
foreach (var order in oracleOrders)
|
||||
{
|
||||
procedureInfos.Add(new ProcedureInfo(src, 0, order.AuftragsNummer.ToString(), signature, order.VariantenCode, order.AuftragsNummer));
|
||||
procedureInfos.Add(new ProcedureInfo(src, 0, order.POName.ToString(), signature, order.VariantCode, order));
|
||||
}
|
||||
}
|
||||
else if (src == ProcedureSelection.OrderFromTracingDB)
|
||||
{
|
||||
try
|
||||
{
|
||||
mySqlOrders = SharedDatabase.TracingDB.CreateSession(TBF.DB.CurrentBench.EventsDBSettings.ConnectionString)
|
||||
tracingDBOrders = SharedDatabase.TracingDB.CreateSession(TBF.DB.CurrentBench.EventsDBSettings.ConnectionString)
|
||||
.QueryOver<SharedDatabase.Entities.OrderInfo>()
|
||||
.Where(x => x.POState != (sbyte)SharedDatabase.Entities.OrderState.Finished)
|
||||
.List();
|
||||
}
|
||||
catch
|
||||
{
|
||||
mySqlOrders = new List<SharedDatabase.Entities.OrderInfo>();
|
||||
tracingDBOrders = new List<SharedDatabase.Entities.OrderInfo>();
|
||||
}
|
||||
|
||||
foreach (var order in mySqlOrders)
|
||||
foreach (var order in tracingDBOrders)
|
||||
{
|
||||
procedureInfos.Add(new ProcedureInfo(src, 0, order.POName, signature, order.VariantCode,
|
||||
order.POName, order.Workflow, order.LaserMarking));
|
||||
procedureInfos.Add(new ProcedureInfo(src, 0, order.POName, signature, order.VariantCode, order,
|
||||
order.Workflow, order.LaserMarking));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -869,7 +869,7 @@ namespace TBF.UI
|
||||
{
|
||||
/// pi.Name is the order name (the production order number)
|
||||
/// Production orders in the tracing DB contain test procedure names
|
||||
var order = mySqlOrders.FirstOrDefault(x => x.POName == pi.Name);
|
||||
var order = tracingDBOrders.FirstOrDefault(x => x.POName == pi.Name);
|
||||
var procInfo = (order == null) ? null : procInfos.FirstOrDefault(x => x.IsNative && x.Name == order.TestProcedure);
|
||||
if (procInfo != null)
|
||||
{
|
||||
@ -882,8 +882,8 @@ namespace TBF.UI
|
||||
{
|
||||
/// pi.Name is the order name (the production order number)
|
||||
/// Production orders in Oracle DB contain varian codes
|
||||
var order = oracleOrders.FirstOrDefault(x => x.AuftragsNummer == pi.Name);
|
||||
var vaco = (order == null) ? null : order.VariantenCode;
|
||||
var order = oracleOrders.FirstOrDefault(x => x.POName == pi.Name);
|
||||
var vaco = (order == null) ? null : order.VariantCode;
|
||||
foreach (var pi2 in procInfos)
|
||||
{
|
||||
if (pi2.IsNative && IsMatch(pi, pi2))
|
||||
|
||||
@ -22,11 +22,6 @@ namespace TBF.UiBridge
|
||||
|
||||
public static int BatchNr;
|
||||
|
||||
public static ProcedureInfo SelectedProcedure { get { return Program.MainWnd.SelectedProcedure; } }
|
||||
|
||||
public static string SelectedTestName { get { return Program.MainWnd.BenchControlPanel.TestName; } }
|
||||
|
||||
|
||||
static Bridge()
|
||||
{
|
||||
Ui2MachineQueue = new Queue<UI2BenchCmd>();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user