Handling of error conditions in ProcedureDlg (e.g. when sensors are changed and user changes parameters without reopening), ver. 2.18.1096
This commit is contained in:
@@ -60,7 +60,11 @@ namespace Config.Entities
|
||||
/// <param name="strValue">String representation of the parameter</param>
|
||||
CfgUpdateFlags UpdateParam(int ix, string strValue);
|
||||
|
||||
void UpdateEmbeddedDbEntity();
|
||||
/// <summary>
|
||||
/// Updates DB entities for related parameters
|
||||
/// </summary>
|
||||
/// <returns>true when successful</returns>
|
||||
bool UpdateEmbeddedDbEntity();
|
||||
|
||||
/// <summary>
|
||||
/// Creates an object copy
|
||||
|
||||
@@ -215,9 +215,9 @@ namespace TBF.BenchControl.BenchInfo.Extended
|
||||
return pars;
|
||||
}
|
||||
|
||||
public void UpdateEmbeddedDbEntity()
|
||||
public bool UpdateEmbeddedDbEntity()
|
||||
{
|
||||
/// Do nothing
|
||||
return true; /// =OK, do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,9 +258,9 @@ namespace TBF.BenchControl.BenchInfo.iPerl
|
||||
return pars;
|
||||
}
|
||||
|
||||
public void UpdateEmbeddedDbEntity()
|
||||
public bool UpdateEmbeddedDbEntity()
|
||||
{
|
||||
/// Do nothing
|
||||
return true; /// =OK, do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,9 +175,9 @@ namespace TBF.BenchControl.Elde.TempMeterMeret
|
||||
return pars;
|
||||
}
|
||||
|
||||
public void UpdateEmbeddedDbEntity()
|
||||
public bool UpdateEmbeddedDbEntity()
|
||||
{
|
||||
/// Do nothing
|
||||
return true; /// =OK, do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,9 +240,9 @@ namespace TBF.BenchControl.Hart.Common
|
||||
return pars;
|
||||
}
|
||||
|
||||
public void UpdateEmbeddedDbEntity()
|
||||
public bool UpdateEmbeddedDbEntity()
|
||||
{
|
||||
/// Do nothing
|
||||
return true; /// =OK, do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,9 +200,9 @@ namespace TBF.BenchControl.Hart.Nivotrack
|
||||
return pars;
|
||||
}
|
||||
|
||||
public void UpdateEmbeddedDbEntity()
|
||||
public bool UpdateEmbeddedDbEntity()
|
||||
{
|
||||
/// Do nothing
|
||||
return true; /// =OK, do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,9 +137,9 @@ namespace TBF.BenchControl.Modbus.UltrasoundLevelMeter
|
||||
return pars;
|
||||
}
|
||||
|
||||
public void UpdateEmbeddedDbEntity()
|
||||
public bool UpdateEmbeddedDbEntity()
|
||||
{
|
||||
/// Do nothing
|
||||
return true; /// =OK, do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,9 +173,9 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
|
||||
return pars;
|
||||
}
|
||||
|
||||
public void UpdateEmbeddedDbEntity()
|
||||
public bool UpdateEmbeddedDbEntity()
|
||||
{
|
||||
/// Do nothing
|
||||
return true; /// =OK, do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,8 +72,14 @@ namespace TBF.BenchControl
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateEmbeddedDbEntity()
|
||||
/// <summary>
|
||||
/// Updates DB entities for procedure parameters
|
||||
/// </summary>
|
||||
/// <returns>true when successful</returns>
|
||||
public bool UpdateEmbeddedDbEntity()
|
||||
{
|
||||
if (procedureParamsEntity == null) return false;
|
||||
|
||||
using (var writer = new StringWriter())
|
||||
{
|
||||
/// Serialize this class and update the entity
|
||||
@@ -82,6 +88,7 @@ namespace TBF.BenchControl
|
||||
procedureParamsEntity.CmpntName = componentName;
|
||||
procedureParamsEntity.Procedure = procedure;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual string ParamName(int i) { return string.Empty; }
|
||||
|
||||
@@ -73,8 +73,14 @@ namespace TBF.BenchControl
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateEmbeddedDbEntity()
|
||||
/// <summary>
|
||||
/// Updates DB entities for test parameters
|
||||
/// </summary>
|
||||
/// <returns>true when successful</returns>
|
||||
public bool UpdateEmbeddedDbEntity()
|
||||
{
|
||||
if (testParamsEntity == null) return false;
|
||||
|
||||
using (var writer = new StringWriter())
|
||||
{
|
||||
/// Serialize this class and update the entity
|
||||
@@ -83,6 +89,7 @@ namespace TBF.BenchControl
|
||||
testParamsEntity.CmpntName = componentName;
|
||||
testParamsEntity.Test = test;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual string ParamName(int i) { return string.Empty; }
|
||||
|
||||
+2
-2
@@ -1759,8 +1759,8 @@ namespace TBF
|
||||
case ProcedureTabs.Parameters: UpdateFromParametersTab(); break;
|
||||
}
|
||||
|
||||
foreach (var ctrl in testParamsCtrls) ctrl.UpdateAll();
|
||||
foreach (var ctrl in procedureParamsCtrls) ctrl.UpdateAll();
|
||||
foreach (var ctrl in testParamsCtrls) if (!ctrl.UpdateAll()) MessageBox.Show(string.Format(Strings.Error_saving_parameters_of_0, ctrl.Name));
|
||||
foreach (var ctrl in procedureParamsCtrls) if (!ctrl.UpdateAll()) MessageBox.Show(string.Format(Strings.Error_saving_parameters_of_0, ctrl.Name));
|
||||
|
||||
if (usedNames != null && usedNames.Contains(LoadedProcedure.Name))
|
||||
{
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.18.1094.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1094.0")]
|
||||
[assembly: AssemblyVersion("2.18.1096.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1096.0")]
|
||||
|
||||
Generated
+9
@@ -1518,6 +1518,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error saving parameters of {0}.
|
||||
/// </summary>
|
||||
internal static string Error_saving_parameters_of_0 {
|
||||
get {
|
||||
return ResourceManager.GetString("Error_saving_parameters_of_0", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error while creating the database. Reason: .
|
||||
/// </summary>
|
||||
|
||||
@@ -898,13 +898,13 @@
|
||||
<value>Zastavení průtoku před zkouškou s pevným startem</value>
|
||||
</data>
|
||||
<data name="SupressWMTrills" xml:space="preserve">
|
||||
<value>Potlačit WM vibrace</value>
|
||||
<value>Potlačit vibrace vodoměru</value>
|
||||
</data>
|
||||
<data name="Switching_flow_detection" xml:space="preserve">
|
||||
<value>Přepínání detekce průtoku</value>
|
||||
<value>Detekce přepínacího průtoku</value>
|
||||
</data>
|
||||
<data name="Switching_Points" xml:space="preserve">
|
||||
<value>Spínací body</value>
|
||||
<value>Přepínací body</value>
|
||||
</data>
|
||||
<data name="T_div" xml:space="preserve">
|
||||
<value>T div</value>
|
||||
@@ -1353,4 +1353,7 @@
|
||||
<data name="Side" xml:space="preserve">
|
||||
<value>Strana</value>
|
||||
</data>
|
||||
<data name="Error_saving_parameters_of_0" xml:space="preserve">
|
||||
<value>Chyba při ukládání parametrů {0}</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1906,4 +1906,7 @@
|
||||
<data name="Side" xml:space="preserve">
|
||||
<value>Side</value>
|
||||
</data>
|
||||
<data name="Error_saving_parameters_of_0" xml:space="preserve">
|
||||
<value>Error saving parameters of {0}</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -201,14 +201,19 @@ namespace TBF.UiControls
|
||||
listViewEx.Items.Add(lvi);
|
||||
}
|
||||
|
||||
public void UpdateAll()
|
||||
public bool UpdateAll()
|
||||
{
|
||||
if (!unlocked) return;
|
||||
if (!unlocked) return false;
|
||||
|
||||
foreach (ListViewItem lvi in listViewEx.Items)
|
||||
{
|
||||
if (lvi.Tag is IParamsProvider) (lvi.Tag as IParamsProvider).UpdateEmbeddedDbEntity();
|
||||
if (lvi.Tag is IParamsProvider)
|
||||
{
|
||||
if (!(lvi.Tag as IParamsProvider).UpdateEmbeddedDbEntity()) return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,14 +239,19 @@ namespace TBF.UiControls
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateAll()
|
||||
public bool UpdateAll()
|
||||
{
|
||||
if (!unlocked) return;
|
||||
if (!unlocked) return false;
|
||||
|
||||
foreach (ListViewItem lvi in listViewEx.Items)
|
||||
{
|
||||
if (lvi.Tag is IParamsProvider) (lvi.Tag as IParamsProvider).UpdateEmbeddedDbEntity();
|
||||
if (lvi.Tag is IParamsProvider)
|
||||
{
|
||||
if (!(lvi.Tag as IParamsProvider).UpdateEmbeddedDbEntity()) return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user