Clean-up
This commit is contained in:
@@ -35,10 +35,14 @@ namespace TBF.Rig.Sequences
|
||||
///
|
||||
/// Procedure related state variables
|
||||
///
|
||||
public static ProcedureInfo SelectedProcedure;
|
||||
public static TBF.UI.ProcedureInfo SelectedProcedure;
|
||||
public static Common.IOrderInfo OrderInfo;
|
||||
///
|
||||
public static SharedDatabase.Entities.Process Workflow;
|
||||
public static SharedDatabase.Entities.Workstep Workstep;
|
||||
public static string PreviousStepName;
|
||||
public static string Part1Name;
|
||||
public static string Part2Name;
|
||||
|
||||
///
|
||||
/// Test related (instance) variables.
|
||||
|
||||
@@ -2225,6 +2225,7 @@
|
||||
<Compile Include="UI\MainWnd.designer.cs">
|
||||
<DependentUpon>MainWnd.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\ProcedureInfo.cs" />
|
||||
<Compile Include="UI\Procedures\IProcParamsCtrl.cs" />
|
||||
<Compile Include="UI\Procedures\ProcedureDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Common;
|
||||
|
||||
namespace TBF.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains a procedure name and procedure selection source specification
|
||||
/// (local/shared/order from Oracle/order from tracing DB)
|
||||
/// </summary>
|
||||
public class ProcedureInfo
|
||||
{
|
||||
public readonly ProcedureSelection Source;
|
||||
public int ItemNr;
|
||||
public readonly string Name;
|
||||
public readonly string Signature;
|
||||
public string Variant;
|
||||
public IOrderInfo OrderInfo;
|
||||
public string Workflow;
|
||||
public string LaserMarking;
|
||||
public bool IsNative;
|
||||
public ProcedureSelection ResolvedSource; /// ProcedureSelection.FromLocalDB or ProcedureSelection.FromSharedDB when Resolved==true
|
||||
public string ResolvedName;
|
||||
|
||||
public ProcedureInfo(ProcedureSelection source, int itemNr, string name, string signature = 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;
|
||||
OrderInfo = orderInfo;
|
||||
Workflow = workflow;
|
||||
LaserMarking = laserMarking;
|
||||
|
||||
if (source == ProcedureSelection.FromLocalDB || source == ProcedureSelection.FromSharedDB)
|
||||
{
|
||||
IsNative = true;
|
||||
ResolvedSource = source;
|
||||
ResolvedName = name;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsNative = false;
|
||||
ResolvedSource = ProcedureSelection.None;
|
||||
ResolvedName = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetSignature(ProcedureSelection source, ICollection<ProcedureSelection> allSources)
|
||||
{
|
||||
return (source == ProcedureSelection.OrderFromOracleDB) ? ""
|
||||
: (source == ProcedureSelection.OrderFromTracingDB) ? ""
|
||||
: (source == ProcedureSelection.FromSharedDB) ? "R"
|
||||
: (allSources != null && allSources.Contains(ProcedureSelection.FromSharedDB)) ? "L" : "";
|
||||
}
|
||||
|
||||
public bool IsValid
|
||||
{
|
||||
get {
|
||||
return (ResolvedSource != ProcedureSelection.None) && !string.IsNullOrEmpty(ResolvedName);
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
switch (Source)
|
||||
{
|
||||
case ProcedureSelection.OrderFromOracleDB:
|
||||
case ProcedureSelection.OrderFromTracingDB:
|
||||
return Name;
|
||||
case ProcedureSelection.FromSharedDB:
|
||||
case ProcedureSelection.FromLocalDB:
|
||||
default:
|
||||
return string.Format("{0}{1} {2}", Signature, ItemNr, Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user