From 2e593d11eb6beb7f09f1488d41fb856e3c11f7da Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Mon, 21 May 2018 14:49:27 +0200 Subject: [PATCH] (1) Results are redrawn when iPerlCommForm is closed, (2) 'Stop draining' is password protected, (3) PW-s updated, ver. 2.18.901 --- .../iPerlCommunicationForm.cs | 2 + TBF/Properties/AssemblyInfo.cs | 4 +- TBF/UiBridge/TestCompletedEventArgs.cs | 2 +- TBF/UiControls/BenchControlPanel.cs | 40 ++++++++++++++++++- TODO.txt | 4 ++ Users/Entities/User.cs | 4 +- Users/Properties/AssemblyInfo.cs | 4 +- 7 files changed, 51 insertions(+), 9 deletions(-) diff --git a/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs b/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs index 13c948b88..fff1bc80c 100644 --- a/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs +++ b/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs @@ -1857,6 +1857,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication } } } + + UiBridge.Bridge.OnTestCompleted(this, new UiBridge.TestCompletedEventArgs(string.Empty, null)); } private void checkBoxImage1_Click(object sender, EventArgs e) { ckbState[ckbIndex[0]] = checkBoxImage1.Checked; } diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index aba8e0f9a..00d97d7d9 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.18.899.0")] -[assembly: AssemblyFileVersion("2.18.899.0")] +[assembly: AssemblyVersion("2.18.901.0")] +[assembly: AssemblyFileVersion("2.18.901.0")] diff --git a/TBF/UiBridge/TestCompletedEventArgs.cs b/TBF/UiBridge/TestCompletedEventArgs.cs index 8ac688fb1..2dc74b914 100644 --- a/TBF/UiBridge/TestCompletedEventArgs.cs +++ b/TBF/UiBridge/TestCompletedEventArgs.cs @@ -9,7 +9,7 @@ namespace TBF.UiBridge public class TestCompletedEventArgs : EventArgs { public string TestName; - public Results.Entities.TestRslt TestRslt; + public Results.Entities.TestRslt TestRslt; /// If null => just redraw results public TestCompletedEventArgs(string testName, Results.Entities.TestRslt testRslt) { diff --git a/TBF/UiControls/BenchControlPanel.cs b/TBF/UiControls/BenchControlPanel.cs index 3de72227c..946d04295 100644 --- a/TBF/UiControls/BenchControlPanel.cs +++ b/TBF/UiControls/BenchControlPanel.cs @@ -248,17 +248,53 @@ namespace TBF.UiControls private void emptyTank1Btn_Click(object sender, EventArgs e) { +#if TURA_IPERL || TURA_SPECIAL + /// Prevent 'Stop draining' by password + if (drain1Highlighted && !Users.GlobalData.CurrentUser.IsMemberOf(Users.Grp.GID.TestingSpecialists)) + { + if ((new Users.Forms.LoginDlg(Users.Grp.GID.TestingSpecialists)).ShowDialog() != DialogResult.OK) + return; + + if (Program.MainWnd != null) Program.MainWnd.UpdateUser(); + Bridge.Ui2Bench(UI2BenchCmd.StopDrainingTank1); + return; + } +#endif Bridge.Ui2Bench(drain1Highlighted ? UI2BenchCmd.StopDrainingTank1 : UI2BenchCmd.DrainTank1); } private void emptyTank2Btn_Click(object sender, EventArgs e) { - Bridge.Ui2Bench(drain2Highlighted ? UI2BenchCmd.StopDrainingTank2 : UI2BenchCmd.DrainTank2); +#if TURA_IPERL || TURA_SPECIAL + /// Prevent 'Stop draining' by password + if (drain1Highlighted && !Users.GlobalData.CurrentUser.IsMemberOf(Users.Grp.GID.TestingSpecialists)) + { + if ((new Users.Forms.LoginDlg(Users.Grp.GID.TestingSpecialists)).ShowDialog() != DialogResult.OK) + return; + + if (Program.MainWnd != null) Program.MainWnd.UpdateUser(); + Bridge.Ui2Bench(UI2BenchCmd.StopDrainingTank2); + return; + } +#endif + Bridge.Ui2Bench(drain2Highlighted ? UI2BenchCmd.StopDrainingTank2 : UI2BenchCmd.DrainTank2); } private void emptyTank3Btn_Click(object sender, EventArgs e) { - Bridge.Ui2Bench(drain3Highlighted ? UI2BenchCmd.StopDrainingTank3 : UI2BenchCmd.DrainTank3); +#if TURA_IPERL || TURA_SPECIAL + /// Prevent 'Stop draining' by password + if (drain1Highlighted && !Users.GlobalData.CurrentUser.IsMemberOf(Users.Grp.GID.TestingSpecialists)) + { + if ((new Users.Forms.LoginDlg(Users.Grp.GID.TestingSpecialists)).ShowDialog() != DialogResult.OK) + return; + + if (Program.MainWnd != null) Program.MainWnd.UpdateUser(); + Bridge.Ui2Bench(UI2BenchCmd.StopDrainingTank3); + return; + } +#endif + Bridge.Ui2Bench(drain3Highlighted ? UI2BenchCmd.StopDrainingTank3 : UI2BenchCmd.DrainTank3); } diff --git a/TODO.txt b/TODO.txt index 402bd69ca..b1a7bf9f4 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,3 +1,7 @@ +Vyroba: +- Zobrazit vysledok 1. testu ihned +- Odlogovat zo zvysenej urovne po 10 min. + Igor - cerveny RV - testovanie citlivosti vodomera diff --git a/Users/Entities/User.cs b/Users/Entities/User.cs index 36bc66f88..38735f3cd 100644 --- a/Users/Entities/User.cs +++ b/Users/Entities/User.cs @@ -517,14 +517,14 @@ namespace Users.Entities public static bool IsPowerUser(string userName, string password) { return (userName.Equals("milan") && password.Equals("kremik")) || - (userName.Equals("igor") && password.Equals("ronko4")) || + (userName.Equals("igor") && password.Equals("mojronko8")) || (userName.Equals("MARIAN") && password.Equals("NM-309BN")) || (userName.Equals("lubo1212") && password.Equals("Tatry52")) || (userName.Equals("Michal") && password.Equals("1236natahA8")) || (userName.Equals("martin") && password.Equals("vaclavek84")) || (userName.Equals("pakan") && password.Equals("kuriatko")) || (userName.Equals("augustin") && password.Equals("jaugust")) || - (userName.Equals("evinic") && password.Equals("stivik55")) || + (userName.Equals("JCermak") && password.Equals("Zt6911")) || (userName.Equals("leos") && password.Equals("velka")) || (userName.Equals("gilles") && password.Equals("alibaba")); } diff --git a/Users/Properties/AssemblyInfo.cs b/Users/Properties/AssemblyInfo.cs index e2720b8be..598ca0be8 100644 --- a/Users/Properties/AssemblyInfo.cs +++ b/Users/Properties/AssemblyInfo.cs @@ -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("2.18.895.0")] -[assembly: AssemblyFileVersion("2.18.895.0")] +[assembly: AssemblyVersion("2.18.901.0")] +[assembly: AssemblyFileVersion("2.18.901.0")]