Clone( ) function added to IParamsProvider and all procedure/test parameters classes.
This commit is contained in:
@@ -224,6 +224,42 @@ namespace TBF.BenchControl.Cameras.CameraRoi
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(RoiProcedureParams prms)
|
||||
{
|
||||
prms.IRoiX = this.IRoiX;
|
||||
prms.IRoiY = this.IRoiY;
|
||||
prms.IRoiW = this.IRoiW;
|
||||
prms.IRoiH = this.IRoiH;
|
||||
|
||||
prms.GradPerLtr = this.GradPerLtr;
|
||||
prms.CCW = this.CCW;
|
||||
prms.ORoiW = this.ORoiW;
|
||||
prms.ORoiH = this.ORoiH;
|
||||
prms.CX = this.CX;
|
||||
prms.CY = this.CY;
|
||||
|
||||
prms.R1 = this.R1;
|
||||
prms.R2 = this.R2;
|
||||
prms.R3 = this.R3;
|
||||
prms.Ang1 = this.Ang1;
|
||||
prms.Ang2 = this.Ang2;
|
||||
prms.AngStep = this.AngStep;
|
||||
prms.MinMvmt = this.MinMvmt;
|
||||
prms.MaxMvmt = this.MaxMvmt;
|
||||
|
||||
prms.SequenceLen = this.SequenceLen;
|
||||
prms.SequenceTiming = this.SequenceTiming;
|
||||
prms.BackgroundCorr = this.BackgroundCorr;
|
||||
prms.BrightnessRoi = this.BrightnessRoi;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
RoiProcedureParams pars = new RoiProcedureParams();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public override void UpdateProcedureParams(Entities.ComponentProcedure dbEntity)
|
||||
{
|
||||
if (dbEntity == null) return;
|
||||
@@ -236,31 +272,7 @@ namespace TBF.BenchControl.Cameras.CameraRoi
|
||||
componentName = dbEntity.CmpntName;
|
||||
procedure = dbEntity.Procedure;
|
||||
|
||||
IRoiX = tmp.IRoiX;
|
||||
IRoiY = tmp.IRoiY;
|
||||
IRoiW = tmp.IRoiW;
|
||||
IRoiH = tmp.IRoiH;
|
||||
|
||||
GradPerLtr = tmp.GradPerLtr;
|
||||
CCW = tmp.CCW;
|
||||
ORoiW = tmp.ORoiW;
|
||||
ORoiH = tmp.ORoiH;
|
||||
CX = tmp.CX;
|
||||
CY = tmp.CY;
|
||||
|
||||
R1 = tmp.R1;
|
||||
R2 = tmp.R2;
|
||||
R3 = tmp.R3;
|
||||
Ang1 = tmp.Ang1;
|
||||
Ang2 = tmp.Ang2;
|
||||
AngStep = tmp.AngStep;
|
||||
MinMvmt = tmp.MinMvmt;
|
||||
MaxMvmt = tmp.MaxMvmt;
|
||||
|
||||
SequenceLen = tmp.SequenceLen;
|
||||
SequenceTiming = tmp.SequenceTiming;
|
||||
BackgroundCorr = tmp.BackgroundCorr;
|
||||
BrightnessRoi = tmp.BrightnessRoi;
|
||||
tmp.CopyContentTo(this);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -65,6 +65,18 @@ namespace TBF.BenchControl.Elde.FixedStartRegisterReader
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(RRProcedureParams prms)
|
||||
{
|
||||
prms.PulsesPerLtr = this.PulsesPerLtr;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
RRProcedureParams pars = new RRProcedureParams();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public override void UpdateProcedureParams(Entities.ComponentProcedure dbEntity)
|
||||
{
|
||||
if (dbEntity == null) return;
|
||||
@@ -77,7 +89,7 @@ namespace TBF.BenchControl.Elde.FixedStartRegisterReader
|
||||
componentName = dbEntity.CmpntName;
|
||||
procedure = dbEntity.Procedure;
|
||||
|
||||
PulsesPerLtr = tmp.PulsesPerLtr;
|
||||
tmp.CopyContentTo(this);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -65,6 +65,18 @@ namespace TBF.BenchControl.Elde.RegisterReader
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(RRProcedureParams prms)
|
||||
{
|
||||
prms.PulsesPerLtr = this.PulsesPerLtr;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
RRProcedureParams pars = new RRProcedureParams();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public override void UpdateProcedureParams(Entities.ComponentProcedure dbEntity)
|
||||
{
|
||||
if (dbEntity == null) return;
|
||||
@@ -77,7 +89,7 @@ namespace TBF.BenchControl.Elde.RegisterReader
|
||||
componentName = dbEntity.CmpntName;
|
||||
procedure = dbEntity.Procedure;
|
||||
|
||||
PulsesPerLtr = tmp.PulsesPerLtr;
|
||||
tmp.CopyContentTo(this);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -46,5 +46,11 @@ namespace TBF.BenchControl.Generic
|
||||
void UpdateParam(int ix, string strValue);
|
||||
|
||||
void UpdateDbEntity();
|
||||
|
||||
/// <summary>
|
||||
/// Creates an object copy
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IParamsProvider Clone();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,21 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
|
||||
}
|
||||
}
|
||||
|
||||
void CopyContentTo(ProcParams prms)
|
||||
{
|
||||
prms.Version = this.Version;
|
||||
prms.Zaehlertyp = this.Zaehlertyp;
|
||||
prms.Pruefvorlage = this.Pruefvorlage;
|
||||
prms.Eichjahr = this.Eichjahr;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
ProcParams pars = new ProcParams();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public override void UpdateProcedureParams(Entities.ComponentProcedure dbEntity)
|
||||
{
|
||||
if (dbEntity == null) return;
|
||||
@@ -87,10 +102,7 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
|
||||
componentName = dbEntity.CmpntName;
|
||||
procedure = dbEntity.Procedure;
|
||||
|
||||
Version = tmp.Version;
|
||||
Zaehlertyp = tmp.Zaehlertyp;
|
||||
Pruefvorlage = tmp.Pruefvorlage;
|
||||
Eichjahr = tmp.Eichjahr;
|
||||
tmp.CopyContentTo(this);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -63,6 +63,18 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(CombinedTestParams prms)
|
||||
{
|
||||
prms.SupressTrills = this.SupressTrills;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
CombinedTestParams pars = new CombinedTestParams();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public override void UpdateTestParams(Entities.ComponentTest dbEntity)
|
||||
{
|
||||
if (dbEntity == null) return;
|
||||
@@ -75,8 +87,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
componentName = dbEntity.CmpntName;
|
||||
test = dbEntity.Test;
|
||||
|
||||
SupressTrills = tmp.SupressTrills;
|
||||
|
||||
tmp.CopyContentTo(this);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
+18
-7
@@ -98,6 +98,23 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(CombinedWithDetTestParams prms)
|
||||
{
|
||||
prms.TargetQ = this.TargetQ;
|
||||
prms.RelativeQfrom = this.RelativeQfrom;
|
||||
prms.RelativeQto = this.RelativeQto;
|
||||
prms.RateOfChange = this.RateOfChange;
|
||||
prms.DetectionThreshold = this.DetectionThreshold;
|
||||
prms.SupressTrills = this.SupressTrills;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
CombinedWithDetTestParams pars = new CombinedWithDetTestParams();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public override void UpdateTestParams(Entities.ComponentTest dbEntity)
|
||||
{
|
||||
if (dbEntity == null) return;
|
||||
@@ -110,13 +127,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
componentName = dbEntity.CmpntName;
|
||||
test = dbEntity.Test;
|
||||
|
||||
TargetQ = tmp.TargetQ;
|
||||
RelativeQfrom = tmp.RelativeQfrom;
|
||||
RelativeQto = tmp.RelativeQto;
|
||||
RateOfChange = tmp.RateOfChange;
|
||||
DetectionThreshold = tmp.DetectionThreshold;
|
||||
SupressTrills = tmp.SupressTrills;
|
||||
|
||||
tmp.CopyContentTo(this);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
+15
-3
@@ -69,6 +69,19 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(TestParams prms)
|
||||
{
|
||||
prms.Evaluate = this.Evaluate;
|
||||
prms.Publish = this.Publish;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
TestParams pars = new TestParams();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public override void UpdateTestParams(Entities.ComponentTest dbEntity)
|
||||
{
|
||||
if (dbEntity == null) return;
|
||||
@@ -81,9 +94,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
componentName = dbEntity.CmpntName;
|
||||
test = dbEntity.Test;
|
||||
|
||||
Evaluate = tmp.Evaluate;
|
||||
Publish = tmp.Publish;
|
||||
}
|
||||
tmp.CopyContentTo(this);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
@@ -85,6 +85,21 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(LeakTestParams prms)
|
||||
{
|
||||
prms.PressureLo = this.PressureLo;
|
||||
prms.PressureHi = this.PressureHi;
|
||||
prms.DurationPMax = this.DurationPMax;
|
||||
prms.DurationLeak = this.DurationLeak;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
LeakTestParams pars = new LeakTestParams();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public override void UpdateTestParams(Entities.ComponentTest dbEntity)
|
||||
{
|
||||
if (dbEntity == null) return;
|
||||
@@ -97,10 +112,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
||||
componentName = dbEntity.CmpntName;
|
||||
test = dbEntity.Test;
|
||||
|
||||
PressureLo = tmp.PressureLo;
|
||||
PressureHi = tmp.PressureHi;
|
||||
DurationPMax = tmp.DurationPMax;
|
||||
DurationLeak = tmp.DurationLeak;
|
||||
tmp.CopyContentTo(this);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -79,6 +79,20 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(PMaxTestParams prms)
|
||||
{
|
||||
prms.PressureLo = this.PressureLo;
|
||||
prms.PressureHi = this.PressureHi;
|
||||
prms.DurationPMax = this.DurationPMax;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
PMaxTestParams pars = new PMaxTestParams();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public override void UpdateTestParams(Entities.ComponentTest dbEntity)
|
||||
{
|
||||
if (dbEntity == null) return;
|
||||
@@ -91,9 +105,7 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
|
||||
componentName = dbEntity.CmpntName;
|
||||
test = dbEntity.Test;
|
||||
|
||||
PressureLo = tmp.PressureLo;
|
||||
PressureHi = tmp.PressureHi;
|
||||
DurationPMax = tmp.DurationPMax;
|
||||
tmp.CopyContentTo(this);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
+15
-3
@@ -76,6 +76,20 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(iPerlCommunicationParams prms)
|
||||
{
|
||||
prms.Activity = this.Activity;
|
||||
prms.SimultWithPrevious = this.SimultWithPrevious;
|
||||
prms.SimultWithNext = this.SimultWithNext;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
iPerlCommunicationParams pars = new iPerlCommunicationParams();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public override void UpdateTestParams(Entities.ComponentTest dbEntity)
|
||||
{
|
||||
if (dbEntity == null) return;
|
||||
@@ -88,9 +102,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
componentName = dbEntity.CmpntName;
|
||||
test = dbEntity.Test;
|
||||
|
||||
Activity = tmp.Activity;
|
||||
SimultWithPrevious = tmp.SimultWithPrevious;
|
||||
SimultWithNext = tmp.SimultWithNext;
|
||||
tmp.CopyContentTo(this);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -109,6 +109,21 @@ namespace TBF.BenchControl.WaterMeters.WaterMeter
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(ProcParams prms)
|
||||
{
|
||||
prms.Producer = this.Producer;
|
||||
prms.Qn = this.Qn;
|
||||
prms.ApprovalInfo = this.ApprovalInfo;
|
||||
prms.MetrologicalClass = this.MetrologicalClass;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
ProcParams pars = new ProcParams();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public override void UpdateProcedureParams(Entities.ComponentProcedure dbEntity)
|
||||
{
|
||||
if (dbEntity == null) return;
|
||||
@@ -121,17 +136,16 @@ namespace TBF.BenchControl.WaterMeters.WaterMeter
|
||||
componentName = dbEntity.CmpntName;
|
||||
procedure = dbEntity.Procedure;
|
||||
|
||||
Producer = tmp.Producer;
|
||||
Qn = tmp.Qn;
|
||||
ApprovalInfo = tmp.ApprovalInfo;
|
||||
MetrologicalClass = tmp.MetrologicalClass;
|
||||
tmp.CopyContentTo(this);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Parameterless constructor initializes the parameters
|
||||
/// </summary>
|
||||
public ProcParams()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -91,6 +91,22 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(ProcParams prms)
|
||||
{
|
||||
prms.PulsesPerLtr = this.PulsesPerLtr;
|
||||
prms.Producer = this.Producer;
|
||||
prms.Qn = this.Qn;
|
||||
prms.ApprovalInfo = this.ApprovalInfo;
|
||||
prms.MetrologicalClass = this.MetrologicalClass;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
ProcParams pars = new ProcParams();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public override void UpdateProcedureParams(Entities.ComponentProcedure dbEntity)
|
||||
{
|
||||
if (dbEntity == null) return;
|
||||
@@ -103,11 +119,7 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
||||
componentName = dbEntity.CmpntName;
|
||||
procedure = dbEntity.Procedure;
|
||||
|
||||
PulsesPerLtr = tmp.PulsesPerLtr;
|
||||
Producer = tmp.Producer;
|
||||
Qn = tmp.Qn;
|
||||
ApprovalInfo = tmp.ApprovalInfo;
|
||||
MetrologicalClass = tmp.MetrologicalClass;
|
||||
tmp.CopyContentTo(this);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user