diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index bb0e389a6..4128f7be8 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.30.1984.0")] -[assembly: AssemblyFileVersion("2.30.1984.0")] +[assembly: AssemblyVersion("2.30.1986.0")] +[assembly: AssemblyFileVersion("2.30.1986.0")] diff --git a/TBF/Rig/Sequences/MainSeq.cs b/TBF/Rig/Sequences/MainSeq.cs index 5d9b49cbb..2755bdc2b 100644 --- a/TBF/Rig/Sequences/MainSeq.cs +++ b/TBF/Rig/Sequences/MainSeq.cs @@ -23,7 +23,8 @@ namespace TBF.Rig.Sequences public override string ToString() { return "Sequences.MainSeq"; } - bool approvedByLegalizator = false; + bool isApprovedByLegalizator = false; + string legalizatorName = string.Empty; DateTime lastApprovalByLegalizatorTime; int simultWithPurgingCount; @@ -217,7 +218,6 @@ namespace TBF.Rig.Sequences do { - bool approval = true; do { selection = MakeSelection(MKSelContext.ProcedureNotSelected); @@ -226,13 +226,8 @@ namespace TBF.Rig.Sequences Shutdown(); return; } - -#if KEMPNO_50 || KRAKOW_50 || TORUN_50 || WARSAW_50 || WARSAW_END - approval = (selection == Selection.Cycle || selection == Selection.Test || selection == Selection.Q1 || - selection == Selection.Q2 || selection == Selection.Q3) && IsApprovedByLegalizator(); -#endif } - while (selection == Selection.Shutdown || !approval); + while (selection == Selection.Shutdown); selectedTestName = (selection == Selection.Q1) ? "Q1" : ((selection == Selection.Q2) ? "Q2" @@ -409,6 +404,16 @@ namespace TBF.Rig.Sequences } while (StateMachine.Procedure == null); /// Make sure a valid procedure is selected +#if KEMPNO_50 || KRAKOW_50 || TORUN_50 || WARSAW_50 || WARSAW_END + /// + /// Approval of a legalizator + /// + if (!string.IsNullOrEmpty(StateMachine.Procedure.AltProcName) && !IsApprovedByLegalizator()) + { + goto select_procedure; /// Loop back to procedure selection if not approved by a legalizator + } +#endif + Debug.WriteLine(string.Empty); Debug.WriteLine(string.Format("TransitionSequences {0}", NHibernateUtil.IsInitialized(StateMachine.TransitionSequences) ? "initialized" : "NOT initialized")); Debug.WriteLine(string.Format("TransitionSteps {0}", NHibernateUtil.IsInitialized(StateMachine.TransitionSteps) ? "initialized" : "NOT initialized")); @@ -422,7 +427,6 @@ namespace TBF.Rig.Sequences UiBridge.Bridge.OnError(this, string.Empty); /// Clear an error message (if any) - if (selection == Selection.RestoreInterruptedSession) { if (!LoadProcessData()) @@ -1476,7 +1480,7 @@ namespace TBF.Rig.Sequences bool IsApprovedByLegalizator() { - if (approvedByLegalizator && DateTime.Now < lastApprovalByLegalizatorTime.Date.AddDays(1)) + if (isApprovedByLegalizator && DateTime.Now < lastApprovalByLegalizatorTime.Date.AddDays(1)) { return true; } @@ -1484,11 +1488,13 @@ namespace TBF.Rig.Sequences var loginDlg = new Users.Forms.PlainLoginDlg(new GID[] { GID.CalibrationSpecialists }, "Approval by legalizator"); if (loginDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { - approvedByLegalizator = true; + isApprovedByLegalizator = true; + legalizatorName = loginDlg.FullName; lastApprovalByLegalizatorTime = DateTime.Now; return true; } + legalizatorName = string.Empty; return false; } diff --git a/TBF/Rig/Sequences/MainSeqUtils.cs b/TBF/Rig/Sequences/MainSeqUtils.cs index 8dbb075ea..922a8ec0b 100644 --- a/TBF/Rig/Sequences/MainSeqUtils.cs +++ b/TBF/Rig/Sequences/MainSeqUtils.cs @@ -629,7 +629,11 @@ namespace TBF.Rig.Sequences (BenchInfo != null) ? BenchInfo.Address3 : string.Empty, (BenchInfo != null) ? BenchInfo.Address4 : string.Empty, (BenchInfo != null) ? BenchInfo.Address5 : string.Empty, +#if BAHRAIN_50 (Users.CurrentUser.User() != null) ? Users.CurrentUser.User().ToEncodedStr() : "none", +#else + (Users.CurrentUser.User() != null) ? Users.CurrentUser.User().ToEncodedStr(legalizatorName) : "none", +#endif Users.CurrentUser.Number(), Program.Version, StateMachine.Procedure, diff --git a/TBF/UI/Shared/LoginDlgWithBenchSelection.cs b/TBF/UI/Shared/LoginDlgWithBenchSelection.cs index 47b3d6398..e4c104ae7 100644 --- a/TBF/UI/Shared/LoginDlgWithBenchSelection.cs +++ b/TBF/UI/Shared/LoginDlgWithBenchSelection.cs @@ -55,7 +55,7 @@ namespace TBF.UI.Shared { benchName = predefinedBench; -#if LANG_PL || BAHRAIN_50 +#if BAHRAIN_50 Height = 156; EnableAndPrepareLegalizatorCombo(legalizatorComboBox); #else diff --git a/Users/Entities/User.cs b/Users/Entities/User.cs index 37b6f3dcd..f79fc3832 100644 --- a/Users/Entities/User.cs +++ b/Users/Entities/User.cs @@ -530,9 +530,15 @@ namespace Users.Entities public virtual string ToEncodedStr() { + /// Bahrain: legalizator from bench login dialog is used return string.Format("{0}~{1}~{2}", UserName, FullName, legalizator); } + public virtual string ToEncodedStr(string _legalizator) + { + return string.Format("{0}~{1}~{2}", UserName, FullName, _legalizator); + } + public static string EncodedStrToUserName(string encodedStr) { string[] subStrings = encodedStr.Split(new char[] { '~' }); diff --git a/Users/Forms/PlainLoginDlg.cs b/Users/Forms/PlainLoginDlg.cs index ebd0f75c0..53f675a3d 100644 --- a/Users/Forms/PlainLoginDlg.cs +++ b/Users/Forms/PlainLoginDlg.cs @@ -22,6 +22,7 @@ namespace Users.Forms /// Public readonly public string UserName { get { return user; } } + public string FullName { get { return fullName; } } /// Private fields string user; @@ -29,6 +30,7 @@ namespace Users.Forms GID[] requiredGroupMembership; bool noDatabase; Color oriBackColor; + string fullName; /// Description of the selected user /// Smart card support, card S/N is used as user.Tag CardNative card; @@ -175,6 +177,7 @@ namespace Users.Forms password = passwordTextBox.Text; bool authorized = Entities.User.IsPowerUser(user, password); + if (authorized) fullName = "Power user"; if (!authorized && !noDatabase) { @@ -189,6 +192,7 @@ namespace Users.Forms if (usr1.IsMemberOf(requiredGroupMembership) && usr1.IsCorrectPassword(password)) { authorized = true; + fullName = usr1.FullName; break; } }