203 lines
5.6 KiB
C#
203 lines
5.6 KiB
C#
///
|
|
/// Copyright (c) 2018-2020 Sensus Slovensko a.s.
|
|
///
|
|
using System;
|
|
using System.Reflection;
|
|
|
|
|
|
namespace TracingDB
|
|
{
|
|
/// <summary>
|
|
/// Helper class to assign descriptions to enum values
|
|
/// </summary>
|
|
public class Description : Attribute
|
|
{
|
|
public string Text;
|
|
public Description(string t)
|
|
{
|
|
Text = t;
|
|
}
|
|
}
|
|
|
|
public static class GetDescription
|
|
{
|
|
/// Extension method for enum-s
|
|
public static string ToDescription(this Enum enm)
|
|
{
|
|
Type type = enm.GetType();
|
|
MemberInfo[] memInfo = type.GetMember(enm.ToString());
|
|
|
|
if (memInfo != null && memInfo.Length > 0)
|
|
{
|
|
object[] attrs = memInfo[0].GetCustomAttributes(typeof(Description), false);
|
|
if (attrs != null && attrs.Length > 0)
|
|
return ((Description)attrs[0]).Text;
|
|
}
|
|
|
|
return enm.ToString(); /// Return ToString() value in case there is no description
|
|
}
|
|
}
|
|
|
|
|
|
public enum CodeType
|
|
{
|
|
[Description("")]
|
|
UniqueNr,
|
|
|
|
[Description("Sap6-8")]
|
|
FlowtubeNr, /// prvé 3 znaky sa zhodujú s poslednými 3 znakmi názvu
|
|
|
|
[Description("FT-20")]
|
|
FlowtubeNrLU, /// začiatok kódu sa zhoduje s názvom
|
|
|
|
[Description("1")]
|
|
BatchNr,
|
|
|
|
[Description("2")]
|
|
BatchNrContainingPartName,
|
|
|
|
[Description("3")]
|
|
DateMMYY,
|
|
|
|
[Description("4")]
|
|
QualityCheck,
|
|
|
|
[Description("Obj.")]
|
|
PO, /// Purchase order from Oracle table VT_AUFTRAG_PD
|
|
|
|
[Description("Silicon")]
|
|
Silicon, /// 1. change requires special password
|
|
/// 2. do not clear
|
|
/// 3. save locally
|
|
/// 4. carry over to other workflows
|
|
Count
|
|
}
|
|
|
|
public enum CodeForm
|
|
{
|
|
Barcode, /// Barcode
|
|
QRCode, /// QR code
|
|
Keyboard, /// Data entered by a keyboard
|
|
OkNok, /// OK/NOK or Yes/No data entered by a keyboard or a mouse
|
|
Count
|
|
}
|
|
|
|
public enum CodeLocation
|
|
{
|
|
OnPallet,
|
|
OnPart,
|
|
Count
|
|
}
|
|
|
|
public enum LifetimeManagement
|
|
{
|
|
None,
|
|
OneYear,
|
|
Count,
|
|
}
|
|
|
|
public enum SubClass
|
|
{
|
|
[Description("invalid")]
|
|
Invalid = 0,
|
|
|
|
[Description("vodomery")]
|
|
Normal = 1, /// Original process type
|
|
|
|
[Description("vodomery bez PCB")]
|
|
NormalWithoutPCB = 2, ///
|
|
|
|
[Description("flowtuby")]
|
|
FlowTube = 4, /// FlowTube
|
|
|
|
[Description("vodomery odvodene z flowtuby")]
|
|
InheritsFlowTube = 8, ///
|
|
|
|
[Description("vodomery z flowtuby bez PCB")]
|
|
InheritsFlowTubeWithoutPCB = 16, ///
|
|
}
|
|
|
|
public enum ReleaseStatus
|
|
{
|
|
In_preparation, /// Process definition is not completed, cannot be used in production
|
|
ToBeApproved, /// Process is completed, protected against changes and waits for an approval
|
|
ReleasedActive, /// Process is ready for production, it is active = enabled
|
|
Released, /// Process is ready for production (completed, protected, approved), but it is inactive
|
|
Deactivated, /// Process was used in production but it was de-activated (should never be deleted as there are references to the process)
|
|
Separator, /// 'Process' is only a named separator between other process items
|
|
Count,
|
|
}
|
|
|
|
public enum Mode
|
|
{
|
|
Production, /// Stara Tura production DB is used
|
|
Test, /// Stara Tura test DB is used
|
|
ProductionLU, /// Ludwigshafen production DB is used
|
|
TestLU, /// Ludwigshafen test DB is used
|
|
NoWritesToDB, /// Stara Tura production DB - no writes to the database
|
|
Debug, /// Debug mode - no database used at all
|
|
Count,
|
|
}
|
|
|
|
public enum LoginLevel
|
|
{
|
|
None,
|
|
TeamLeader,
|
|
Administrator,
|
|
MH,
|
|
Count,
|
|
}
|
|
|
|
public enum ItemSpecID
|
|
{
|
|
RefRecordID = 0,
|
|
|
|
TimeStamp,
|
|
Workstep,
|
|
Workplace,
|
|
UserName,
|
|
Barcode,
|
|
RefPartName,
|
|
PartBarcode,
|
|
PartName,
|
|
|
|
TimeStamp2,
|
|
Workstep2,
|
|
Workplace2,
|
|
UserName2,
|
|
Barcode2,
|
|
PartBarcode2,
|
|
|
|
SerialNr,
|
|
PurchaseOrder,
|
|
TestResult,
|
|
MaxPruefindex,
|
|
MaxTestindexEx,
|
|
TestBenchId,
|
|
|
|
Process,
|
|
Result,
|
|
}
|
|
|
|
public enum ItemSpecCaps
|
|
{
|
|
None = 0,
|
|
ReferenceRecord = 1,
|
|
AssociatedRecord = 2,
|
|
OracleQuery = 4,
|
|
}
|
|
|
|
public enum VerifState
|
|
{
|
|
Undefined = 0, /// Undefined (only used in OnActivity(..) when start/stop info message is issued)
|
|
SNisMissing, /// S/N is missing in the parsed record
|
|
SNisInvalid, /// S/N in the parsed record is invalid
|
|
NoRecordAtAll, /// No record with this S/N in tracing DB
|
|
VerificationIsDisabled, /// ...
|
|
NoVerificationForThisProcess,
|
|
VerificationPassed, /// Verification of a previous record passed
|
|
VerificationFailed, /// Verification of a previous record failed, no matching record found
|
|
TracingDBReadOrWriteFailed,
|
|
PrintingFailed,
|
|
}
|
|
} |