Changes for Xylem Nanjing, ver. 3.1.1676

This commit is contained in:
Milan Hanajik
2021-06-18 15:35:46 +02:00
parent f1ef16e1a3
commit 827a9f7c58
837 changed files with 46518 additions and 5851 deletions
+6 -6
View File
@@ -26,7 +26,7 @@ namespace TBF.Rig.Various.CoverTest
UInt128 mask; /// derived from bitPosition in the constructor
UInt128 target;
string message;
Users.Entities.GID[] bypassLevel;
Common.GID[] bypassLevel;
public CoverTest() { }
@@ -48,11 +48,11 @@ namespace TBF.Rig.Various.CoverTest
mask = (((UInt128)1) << coverTestCfg.BitNr);
target = coverTestCfg.Inverted ? 0 : mask;
message = coverTestCfg.Message;
var groups = new List<Users.Entities.GID>();
if (coverTestCfg.BypassGroup1 != Users.Entities.GID.None) groups.Add(coverTestCfg.BypassGroup1);
if (coverTestCfg.BypassGroup2 != Users.Entities.GID.None) groups.Add(coverTestCfg.BypassGroup2);
if (coverTestCfg.BypassGroup3 != Users.Entities.GID.None) groups.Add(coverTestCfg.BypassGroup3);
if (coverTestCfg.BypassGroup4 != Users.Entities.GID.None) groups.Add(coverTestCfg.BypassGroup4);
var groups = new List<Common.GID>();
if (coverTestCfg.BypassGroup1 != Common.GID.None) groups.Add(coverTestCfg.BypassGroup1);
if (coverTestCfg.BypassGroup2 != Common.GID.None) groups.Add(coverTestCfg.BypassGroup2);
if (coverTestCfg.BypassGroup3 != Common.GID.None) groups.Add(coverTestCfg.BypassGroup3);
if (coverTestCfg.BypassGroup4 != Common.GID.None) groups.Add(coverTestCfg.BypassGroup4);
bypassLevel = groups.ToArray();
}
+20 -20
View File
@@ -4,7 +4,7 @@
using System.IO;
using System.Collections.Generic;
using System.Xml.Serialization;
using Config;
using Common;
using Config.Entities;
using SchematicDrawing;
using TBF.Rig.Generic;
@@ -28,10 +28,10 @@ namespace TBF.Rig.Various.CoverTest
public int BitNr { get; set; } /// Bit-position
public bool Inverted { get; set; } /// When true the valve function is inverted: 0 = open, 1 = closed
public string Message;
public Users.Entities.GID BypassGroup1;
public Users.Entities.GID BypassGroup2;
public Users.Entities.GID BypassGroup3;
public Users.Entities.GID BypassGroup4;
public Common.GID BypassGroup1;
public Common.GID BypassGroup2;
public Common.GID BypassGroup3;
public Common.GID BypassGroup4;
/// Schematic drawing info
public Shape Shape { get; set; }
@@ -75,10 +75,10 @@ namespace TBF.Rig.Various.CoverTest
BitNr = 22;
Inverted = false;
Message = Strings.Close_the_cover;
BypassGroup1 = Users.Entities.GID.TestingSpecialists;
BypassGroup2 = Users.Entities.GID.None;
BypassGroup3 = Users.Entities.GID.None;
BypassGroup4 = Users.Entities.GID.None;
BypassGroup1 = GID.TestingSpecialists;
BypassGroup2 = GID.None;
BypassGroup3 = GID.None;
BypassGroup4 = GID.None;
}
string[] paramNames = new string[]
@@ -105,8 +105,8 @@ namespace TBF.Rig.Various.CoverTest
case 5:
case 6:
ICollection<string> values = new List<string>();
values.Add(Users.Entities.GID.None.ToString());
for (Users.Entities.GID gid = 0; gid < Users.Entities.GID.NrOfGroups; gid++)
values.Add(GID.None.ToString());
for (GID gid = 0; gid < GID.NrOfGroups; gid++)
{
values.Add(gid.ToString());
}
@@ -142,35 +142,35 @@ namespace TBF.Rig.Various.CoverTest
case 2: Message = str; return CfgUpdateFlags.RestartRqrd;
case 3:
for (Users.Entities.GID gid = 0; gid < Users.Entities.GID.NrOfGroups; gid++)
for (GID gid = 0; gid < GID.NrOfGroups; gid++)
{
if (gid.ToString() == str) { BypassGroup1 = gid; return CfgUpdateFlags.RestartRqrd; }
}
BypassGroup1 = Users.Entities.GID.None;
BypassGroup1 = GID.None;
return CfgUpdateFlags.RestartRqrd;
case 4:
for (Users.Entities.GID gid = 0; gid < Users.Entities.GID.NrOfGroups; gid++)
for (GID gid = 0; gid < GID.NrOfGroups; gid++)
{
if (gid.ToString() == str) { BypassGroup2 = gid; return CfgUpdateFlags.RestartRqrd; }
}
BypassGroup2 = Users.Entities.GID.None;
BypassGroup2 = GID.None;
return CfgUpdateFlags.RestartRqrd;
case 5:
for (Users.Entities.GID gid = 0; gid < Users.Entities.GID.NrOfGroups; gid++)
for (GID gid = 0; gid < GID.NrOfGroups; gid++)
{
if (gid.ToString() == str) { BypassGroup3 = gid; return CfgUpdateFlags.RestartRqrd; }
}
BypassGroup3 = Users.Entities.GID.None;
BypassGroup3 = GID.None;
return CfgUpdateFlags.RestartRqrd;
case 6:
for (Users.Entities.GID gid = 0; gid < Users.Entities.GID.NrOfGroups; gid++)
for (GID gid = 0; gid < GID.NrOfGroups; gid++)
{
if (gid.ToString() == str) { BypassGroup4 = gid; return CfgUpdateFlags.RestartRqrd; }
}
BypassGroup4 = Users.Entities.GID.None;
BypassGroup4 = GID.None;
return CfgUpdateFlags.RestartRqrd;
default:
@@ -217,7 +217,7 @@ namespace TBF.Rig.Various.CoverTest
prms.BypassGroup4 = BypassGroup4;
}
public Config.Entities.IParamsProvider Clone()
public IParamsProvider Clone()
{
var pars = new CoverTestCfg();
CopyContentTo(pars);
+7 -5
View File
@@ -5,6 +5,7 @@ using System;
using System.Drawing;
using System.Windows.Forms;
using log4net;
using Common;
using TBF.Resources;
namespace TBF.Rig.Various.CoverTest
@@ -18,9 +19,9 @@ namespace TBF.Rig.Various.CoverTest
public bool Completed { get { return completed; } }
bool completed;
Users.Entities.GID[] bypassLevel;
GID[] bypassLevel;
public CoverTestForm(string message, Users.Entities.GID[] bypassLevel, ILog bypassLog)
public CoverTestForm(string message, GID[] bypassLevel, ILog bypassLog)
{
InitializeComponent();
ControlBox = false;
@@ -54,9 +55,10 @@ namespace TBF.Rig.Various.CoverTest
private void bypassButton_Click(object sender, EventArgs e)
{
if (!Users.GlobalData.CurrentUser.IsMemberOf(bypassLevel))
if (!(GlobalData.CurrentUser is SharedDatabase.Entities.User) ||
!(GlobalData.CurrentUser as SharedDatabase.Entities.User).IsMemberOf(bypassLevel))
{
if ((new Users.Forms.LoginDlg(bypassLevel)).ShowDialog() != DialogResult.OK)
if ((new SharedDatabase.Forms.LoginDlg(bypassLevel)).ShowDialog() != DialogResult.OK)
{
return;
}
@@ -66,7 +68,7 @@ namespace TBF.Rig.Various.CoverTest
}
}
bypassLog.InfoFormat("{0} bypassed by {1}", message, Users.GlobalData.CurrentUser.UserName);
bypassLog.InfoFormat("{0} bypassed by {1}", message, GlobalData.GetCurrentUserName());
completed = true;
Close();