Test profile includes test method, ver. 2.31.1988

This commit is contained in:
Milan Hanajik 2022-11-18 13:35:43 +01:00
parent d29d8be81a
commit 604120e2b8
5 changed files with 39 additions and 6 deletions

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
/// Copyright (c) 2019-2022 Sensus Slovensko a.s.
///
using System;
using System.Globalization;
@ -27,6 +27,7 @@ namespace Config.Entities
public virtual double PressLimHi { get; set; } /// [bar] max. water pressure
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool Evaluate { get; set; }
public virtual string Method { get; set; } /// Test method (component name)
public virtual sbyte E1 { get; set; } ///
public virtual sbyte E2 { get; set; } ///
@ -81,6 +82,7 @@ namespace Config.Entities
PressLimHi = 16.0; /// [bar]
Publish = (sbyte)Common.Publish.Always;
Evaluate = true;
Method = string.Empty;
E1 = (sbyte)ErrorFlagsMode.On;
E2 = (sbyte)ErrorFlagsMode.On;
@ -140,6 +142,7 @@ namespace Config.Entities
result.PressLimHi = PressLimHi;
result.Publish = Publish;
result.Evaluate = Evaluate;
result.Method = Method;
result.E1 = E1;
result.E2 = E2;
@ -193,6 +196,7 @@ namespace Config.Entities
output.WriteLine(PressLimHi.ToString(ci));
output.WriteLine(Publish.ToString());
output.WriteLine(Evaluate.ToString());
output.WriteLine(Method);
output.WriteLine(E1.ToString());
output.WriteLine(E2.ToString());
@ -251,6 +255,7 @@ namespace Config.Entities
tst.PressLimHi = double.Parse(input.ReadLine(), ci);
tst.Publish = sbyte.Parse(input.ReadLine(), ci);
tst.Evaluate = bool.Parse(input.ReadLine());
tst.Method = input.ReadLine();
tst.E1 = sbyte.Parse(input.ReadLine(), ci);
tst.E2 = sbyte.Parse(input.ReadLine(), ci);
@ -311,6 +316,7 @@ namespace Config.Entities
ln = inp.ReadLine(); if (ln != PressLimHi.ToString(ci)) { diff.AppendFormat(fmt, "Pressure_max", PressLimHi.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Publish.ToString()) { diff.AppendFormat(fmt, "Publish", Publish.ToString(), ln); };
ln = inp.ReadLine(); if (ln != Evaluate.ToString()) { diff.AppendFormat(fmt, "Evaluate", Evaluate.ToString(), ln); };
ln = inp.ReadLine(); if (ln != Method) { diff.AppendFormat(fmt, "Method", Method, ln); };
ln = inp.ReadLine(); if (ln != E1.ToString()) { diff.AppendFormat(fmt, "E1", E1.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E2.ToString()) { diff.AppendFormat(fmt, "E2", E2.ToString(), ln); };

View File

@ -24,6 +24,7 @@ namespace Config.Mappings
Map(x => x.PressLimHi);
Map(x => x.Publish);
Map(x => x.Evaluate);
Map(x => x.Method);
Map(x => x.E1);
Map(x => x.E2);
Map(x => x.E3);

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.30.1987.0")]
[assembly: AssemblyFileVersion("2.30.1987.0")]
[assembly: AssemblyVersion("2.31.1988.0")]
[assembly: AssemblyFileVersion("2.31.1988.0")]

View File

@ -39,6 +39,7 @@ namespace TBF.UI.Bench.TestProfiles
/// Auxiliary public lists used also by user controls in tab pages
public IList<Rig.Generic.IComponent> TbfComponents;
public IList<ITestMethod> TestMethods;
bool unlocked;
@ -60,6 +61,18 @@ namespace TBF.UI.Bench.TestProfiles
this.usedNames = usedNames;
this.openUnlocked = openUnlocked;
TestMethods = new List<ITestMethod>();
using (NHibernate.ISession session = TBF.DB.CreateSession(DBKind.Config))
{
/// Prepare a list of components and a list of test methods
TbfComponents = Rig.TbfComponents.LoadComponentsFromDB(session);
if (TbfComponents != null)
foreach (var c in TbfComponents)
if (c is ITestMethod)
TestMethods.Add(c as ITestMethod);
}
/// SharedDlgButtons configuration
sharedButtons.ParentForm = parentForm;
sharedButtons.RequiredGroupMembership = new Common.GID[] { Common.GID.MetrologicalAuthority };
@ -224,6 +237,7 @@ namespace TBF.UI.Bench.TestProfiles
PressLimHi,
Publish,
Evaluate,
Method,
ColumnsCount
}
@ -242,6 +256,7 @@ namespace TBF.UI.Bench.TestProfiles
lv.Columns.Add(new ColumnHeader { Text = Strings.Press_lim_hi_chdr, Width = 80 });
lv.Columns.Add(new ColumnHeader { Text = Strings.Publish, Width = 80 });
lv.Columns.Add(new ColumnHeader { Text = Strings.Evaluate, Width = 80 });
lv.Columns.Add(new ColumnHeader { Text = Strings.Method_chdr, Width = 200 });
ComboBox publishCBox = new ComboBox(); /// control for Publish
for (Publish pb = 0; pb < Publish.Count; pb++)
@ -253,6 +268,9 @@ namespace TBF.UI.Bench.TestProfiles
yesNoCBox.Items.Add(Strings.yes);
yesNoCBox.Items.Add(Strings.no);
ComboBox methodCBox = new ComboBox();
foreach (var m in TestMethods) methodCBox.Items.Add(m.Name);
metrologyEditors = new Control[]
{
new TextBox(), /// Name
@ -267,6 +285,7 @@ namespace TBF.UI.Bench.TestProfiles
new TextBox(), /// Press.Lim. +
publishCBox, /// Publish
yesNoCBox, /// Evaluate
methodCBox, /// Test method
};
foreach (var ctrl in metrologyEditors)
@ -312,6 +331,7 @@ namespace TBF.UI.Bench.TestProfiles
lvi.SubItems.Add(pTest.PressLimHi.ToString());
lvi.SubItems.Add(((Publish)pTest.Publish).ToDescription());
lvi.SubItems.Add(pTest.Evaluate ? Strings.yes : Strings.no);
lvi.SubItems.Add((pTest.Method != null) ? pTest.Method : string.Empty);
metrologyListViewEx.Items.Add(lvi);
}
@ -365,6 +385,8 @@ namespace TBF.UI.Bench.TestProfiles
break;
}
}
entity.Method = lvi.SubItems[(int)MtrlgyClmn.Method].Text;
}
catch (Exception exc)
{
@ -454,7 +476,7 @@ namespace TBF.UI.Bench.TestProfiles
}
/// Combo boxes
if ((e.SubItem == (int)MtrlgyClmn.Publish) || (e.SubItem == (int)MtrlgyClmn.Evaluate))
if ((e.SubItem == (int)MtrlgyClmn.Publish) || (e.SubItem == (int)MtrlgyClmn.Evaluate) || (e.SubItem == (int)MtrlgyClmn.Method))
{
if (!(metrologyEditors[e.SubItem] as ComboBox).Items.Contains(e.DisplayText))
{

View File

@ -74,6 +74,7 @@ namespace TBF.UI.Procedures.TestWizard
listViewEx.Columns.Add("Selector");
listViewEx.Columns.Add(Strings.Err_limit_neg_pct_chdr, 80);
listViewEx.Columns.Add(Strings.Err_limit_pos_pct_chdr, 80);
listViewEx.Columns.Add(Strings.Method_chdr, 150);
listViewEx.SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked);
listViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing);
@ -184,6 +185,7 @@ namespace TBF.UI.Procedures.TestWizard
test.TempLimHi = Convert.ToSingle(ptest.TempLimHi);
test.Publish = ptest.Publish;
test.DoEvaluate = ptest.Evaluate;
test.Method = (ptest.Method != null) ? ptest.Method : string.Empty;
if (profile.ProfileType != ProfileType.QpQi)
{
@ -210,7 +212,8 @@ namespace TBF.UI.Procedures.TestWizard
test.Qto.ToString(),
EmptySelector,
ptest.ErrLimLo.ToString(),
ptest.ErrLimHi.ToString() });
ptest.ErrLimHi.ToString(),
ptest.Method != null ? ptest.Method : string.Empty });
}
else
{
@ -221,7 +224,8 @@ namespace TBF.UI.Procedures.TestWizard
test.Qto.ToString(),
EmptySelector,
Strings.calculated,
Strings.calculated });
Strings.calculated,
ptest.Method != null ? ptest.Method : string.Empty });
}
lvi.Tag = test;