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:
@@ -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
+1483
-428
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;
|
||||
}
|
||||
|
||||
+12
-12
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user