diff --git a/EventViewer/LocalSettings.cs b/EventViewer/LocalSettings.cs index d68be119c..3ea77b836 100644 --- a/EventViewer/LocalSettings.cs +++ b/EventViewer/LocalSettings.cs @@ -147,7 +147,7 @@ namespace EventViewer } } } - catch (Exception e) + catch (Exception) { //log.ErrorFormat("Failed to load from '{0}': {1}", fileName, e.Message); return null; @@ -203,7 +203,7 @@ namespace EventViewer } #endif } - catch (Exception e) + catch (Exception) { //log.ErrorFormat("Failed to save to '{0}': {1}", Program.LocalSettingsFileName, e.Message); } diff --git a/EventViewer/Program.cs b/EventViewer/Program.cs index 725979222..9841c89b9 100644 --- a/EventViewer/Program.cs +++ b/EventViewer/Program.cs @@ -122,7 +122,7 @@ namespace EventViewer /// Open the main application window Application.Run(new EventViewerWnd()); } - catch (Exception e) + catch (Exception) { //LogException(log, "Exception in Application.Run(new ResultsBrowserWnd(args))", e); } diff --git a/GraphLib/DataSource.cs b/GraphLib/DataSource.cs index 532c9a1a7..dc90a0fad 100644 --- a/GraphLib/DataSource.cs +++ b/GraphLib/DataSource.cs @@ -193,7 +193,7 @@ namespace GraphLib Samples = newSamples; return samplesCount; } - catch (Exception exc) + catch (Exception) { return 0; } diff --git a/RestClient/BaseClient.cs b/RestClient/BaseClient.cs index de14b7be5..9bacba7ac 100644 --- a/RestClient/BaseClient.cs +++ b/RestClient/BaseClient.cs @@ -11,13 +11,10 @@ namespace RestClient { public class BaseClient { - private string _token; - private string _baseUrl; public string ErrorMessage { get; set; } - private readonly HttpClient client; private AuthenticationHeaderValue _authValue; public BaseClient(string baseUrl) diff --git a/Results/Forms/MoreWMResultsDlg.Designer.cs b/Results/Forms/MoreWMResultsDlg.Designer.cs index b7f7762fd..fb07d1db8 100644 --- a/Results/Forms/MoreWMResultsDlg.Designer.cs +++ b/Results/Forms/MoreWMResultsDlg.Designer.cs @@ -153,7 +153,6 @@ #endregion private System.Windows.Forms.TabControl tabControl1; - private OneWMResultsRowsCtrl oneWMResultsCtrl; private System.Windows.Forms.TabPage graphsTabPage; private System.Windows.Forms.TabPage productionTracingTabPage; private System.Windows.Forms.SplitContainer productionTracingSplitContainer; diff --git a/ResultsBrowser/ResultsBrowserWnd.cs b/ResultsBrowser/ResultsBrowserWnd.cs index 7bd4392eb..d7a54e85d 100644 --- a/ResultsBrowser/ResultsBrowserWnd.cs +++ b/ResultsBrowser/ResultsBrowserWnd.cs @@ -33,9 +33,9 @@ namespace ResultsBrowser static IList tbfComponents; static IList tbfDevices; - +#if IPERL OracleConnection oracleConnection; /// Oracle database connection - +#endif public ResultsBrowserWnd(string[] args) { InitializeComponent(); diff --git a/Statistics/UserControls/MidOrWaterMetersCtrl.cs b/Statistics/UserControls/MidOrWaterMetersCtrl.cs index d21cc58f5..5b77b910f 100644 --- a/Statistics/UserControls/MidOrWaterMetersCtrl.cs +++ b/Statistics/UserControls/MidOrWaterMetersCtrl.cs @@ -14,7 +14,7 @@ namespace Statistics.UserControls public partial class MidOrWaterMetersCtrl : UserControl { public int MidId; /// 1-based MID Id. - public StatisticsDlg Parent; + public new StatisticsDlg Parent; public bool IsFlowEnabled(int i) diff --git a/TBF/Program.cs b/TBF/Program.cs index 43bef683d..09832da15 100644 --- a/TBF/Program.cs +++ b/TBF/Program.cs @@ -140,7 +140,7 @@ namespace TBF IEnumerable files = Directory.EnumerateFiles(TempImagesDir); /// TODO: Implement recursive directory delete foreach (var file in files) File.Delete(file); } - catch (Exception e) + catch (Exception) { MessageBox.Show("Error creating a local application data directory and preparing an initial configuration", "Fatal error"); return; /// Fatal error diff --git a/TBF/Rig/Ambient/Comet/Ambient.cs b/TBF/Rig/Ambient/Comet/Ambient.cs index 374b29fba..15e876f82 100644 --- a/TBF/Rig/Ambient/Comet/Ambient.cs +++ b/TBF/Rig/Ambient/Comet/Ambient.cs @@ -84,7 +84,7 @@ namespace TBF.Rig.Ambient.Comet log.Warn(this.ToString()); } - public void Initialize() + public override void Initialize() { temperature = DefaultTemperature; pressure = DefaultPressure; diff --git a/TBF/Rig/Ambient/Greco/Ambient.cs b/TBF/Rig/Ambient/Greco/Ambient.cs index eb18a7449..ab31cc46a 100644 --- a/TBF/Rig/Ambient/Greco/Ambient.cs +++ b/TBF/Rig/Ambient/Greco/Ambient.cs @@ -85,7 +85,7 @@ namespace TBF.Rig.Ambient.Greco log.Warn(this.ToString()); } - public void Initialize() + public override void Initialize() { temperature = DefaultTemperature; pressure = DefaultPressure; diff --git a/TBF/Rig/BuiltIn/Valve/ValveCfgCtrl.cs b/TBF/Rig/BuiltIn/Valve/ValveCfgCtrl.cs index 87453e4d7..154c37594 100644 --- a/TBF/Rig/BuiltIn/Valve/ValveCfgCtrl.cs +++ b/TBF/Rig/BuiltIn/Valve/ValveCfgCtrl.cs @@ -6,7 +6,6 @@ using System.Windows.Forms; using Config.Entities; using TBF.Rig.Generic; using TBF.UI.Bench.Components; -using TBF.UI.Bench.Components; namespace TBF.Rig.BuiltIn.Valve { diff --git a/TBF/Rig/ControlBoard/Legacy/ExecuteCommandOp.cs b/TBF/Rig/ControlBoard/Legacy/ExecuteCommandOp.cs index 372985e13..992ec5001 100644 --- a/TBF/Rig/ControlBoard/Legacy/ExecuteCommandOp.cs +++ b/TBF/Rig/ControlBoard/Legacy/ExecuteCommandOp.cs @@ -17,8 +17,6 @@ namespace TBF.Rig.ControlBoard.Legacy readonly Command commandOnStopOp; readonly TestMethods testMethod; - bool started = false; - /// /// Internal states of this operation /// diff --git a/TBF/Rig/ControlBoard/Legacy/ReadDiverterTransitionOp.cs b/TBF/Rig/ControlBoard/Legacy/ReadDiverterTransitionOp.cs index 9b009d27d..5ebff051d 100644 --- a/TBF/Rig/ControlBoard/Legacy/ReadDiverterTransitionOp.cs +++ b/TBF/Rig/ControlBoard/Legacy/ReadDiverterTransitionOp.cs @@ -30,8 +30,6 @@ namespace TBF.Rig.ControlBoard.Legacy readonly int repetition; int counter; - bool cmdSent = false; - bool divRead = false; /// @@ -133,7 +131,6 @@ namespace TBF.Rig.ControlBoard.Legacy { controlBoard.SyncRoute(); controlBoard.SendCommand(Command.ReadDivTransition, 0, 0, 0, 0, StopDevs.None); - cmdSent = true; } /// diff --git a/TBF/Rig/ControlBoard/Legacy/StartMeasurementOp.cs b/TBF/Rig/ControlBoard/Legacy/StartMeasurementOp.cs index ed80d84dc..478b0e580 100644 --- a/TBF/Rig/ControlBoard/Legacy/StartMeasurementOp.cs +++ b/TBF/Rig/ControlBoard/Legacy/StartMeasurementOp.cs @@ -15,7 +15,7 @@ namespace TBF.Rig.ControlBoard.Legacy /// Set by the constructor readonly CBoard controlBoard; readonly IRegValve regulValve; - readonly int regulValveNr; + readonly int regulValveNr; readonly int regulValveStableTime; readonly int flowMeterNr; readonly double nominalFlow; @@ -79,6 +79,8 @@ namespace TBF.Rig.ControlBoard.Legacy flowMeterNr = outputPath.FlowMeter.Idx1; this.regulValve = outputPath.RegValve; + regulValveNr = 0; + regulValveStableTime = 0; if (outputPath.Diverter is TBF.Rig.Uni.Diverter.Diverter) { diff --git a/TBF/Rig/ControlBoard/Papouch/PapouchCB.cs b/TBF/Rig/ControlBoard/Papouch/PapouchCB.cs index 10dacfc44..23891b1b6 100644 --- a/TBF/Rig/ControlBoard/Papouch/PapouchCB.cs +++ b/TBF/Rig/ControlBoard/Papouch/PapouchCB.cs @@ -73,7 +73,7 @@ namespace TBF.Rig.ControlBoard.Papouch /// /// IDevice interface /// - public void Initialize() + public override void Initialize() { outputsInitialized = false; runningOp = SelectedOp.None; diff --git a/TBF/Rig/Danfoss/VLT2800/Pump.cs b/TBF/Rig/Danfoss/VLT2800/Pump.cs index 25f5103e4..aabd37fc4 100644 --- a/TBF/Rig/Danfoss/VLT2800/Pump.cs +++ b/TBF/Rig/Danfoss/VLT2800/Pump.cs @@ -153,7 +153,7 @@ namespace TBF.Rig.Danfoss.VLT2800 log.Warn(this.ToString()); } - public void Initialize() + public override void Initialize() { bitNr = pumpCfg.BitNr; Mask = (((UInt128)1) << bitNr); diff --git a/TBF/Rig/Dummy/Balance/Component.cs b/TBF/Rig/Dummy/Balance/Component.cs index da8cc1b66..7559f67b2 100644 --- a/TBF/Rig/Dummy/Balance/Component.cs +++ b/TBF/Rig/Dummy/Balance/Component.cs @@ -12,25 +12,12 @@ namespace TBF.Rig.Dummy.Balance public class Component : ComponentBase, IScale, IOperation { private static readonly ILog log = LogManager.GetLogger(typeof(Component)); - public override string ToString() - { - return string.Format("{0}({1})", this.GetType().Namespace.Substring(8), Cfg.ToString(1)); - } - - public Component() - { - } - - public Component(Generic.IComponentCfg cfg) - : base(cfg) - { - log.Warn(this.ToString()); - } + public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(1)); } public int ScaleNr { get { return 0; } } public double Capacity { get { return 10000.0; } } - public IValve DrainValve { get { return null; } } - public IValve DrainValve2 { get { return null; } } + public IValve DrainValve { get { return null; } } + public IValve DrainValve2 { get { return null; } } public bool ContainsMoreThen(float thld) { return (thld == 0); } public bool IsEmpty() { return true; } public double EvaporationRate(double t) { return 0; } @@ -40,6 +27,16 @@ namespace TBF.Rig.Dummy.Balance public float BuoyancyPress { get { return 1.013f; } } public float BuoyancyHumi { get { return 50.0f; } } + + public Component() { } + + public Component(Generic.IComponentCfg cfg) + : base(cfg) + { + log.Warn(this.ToString()); + } + + public IOperation ZeroOp() { return this; @@ -63,9 +60,7 @@ namespace TBF.Rig.Dummy.Balance } /// Start this operation - public void Start() - { - } + public void Start() { } /// Run this operation public Event Run() @@ -74,8 +69,6 @@ namespace TBF.Rig.Dummy.Balance } /// Stop this operation - public void Stop() - { - } + public void Stop() { } } } diff --git a/TBF/Rig/Dummy/RegValve/RegValve.cs b/TBF/Rig/Dummy/RegValve/RegValve.cs index a7682549f..576aeac6b 100644 --- a/TBF/Rig/Dummy/RegValve/RegValve.cs +++ b/TBF/Rig/Dummy/RegValve/RegValve.cs @@ -8,7 +8,7 @@ using TBF.Boxes; namespace TBF.Rig.Dummy.RegValve { - public class RegValve : ComponentBase, IDevice, GenericDevices.IRegValve, SchematicDrawing.IDrawingItCmpnt + public class RegValve : ComponentBase, GenericDevices.IRegValve, SchematicDrawing.IDrawingItCmpnt { private static readonly ILog log = LogManager.GetLogger(typeof(RegValve)); public override string ToString() { return string.Format("RegulValve({0})", Cfg.ToString(-1)); } @@ -27,24 +27,19 @@ namespace TBF.Rig.Dummy.RegValve public IDictionary Dict { get { return dict; } } - public RegValve() - { - } + public RegValve() { } public RegValve(Generic.IComponentCfg cfg, IList components) : base(cfg) { RegulValveCfg = cfg as RegValveCfg; - dict = new Dictionary(); - log.Warn(this.ToString()); } - public void Initialize() { } - public void RunDeviceBefore() { } - public void RunDeviceAfter() { } - public void StopDevice() { } - public void StopDevice2() { } + public override void Initialize() + { + dict = new Dictionary(); + } /// diff --git a/TBF/Rig/Dummy/RegValve/RegulValveCfgCtrl.cs b/TBF/Rig/Dummy/RegValve/RegulValveCfgCtrl.cs index cd0a96371..031ed7dae 100644 --- a/TBF/Rig/Dummy/RegValve/RegulValveCfgCtrl.cs +++ b/TBF/Rig/Dummy/RegValve/RegulValveCfgCtrl.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2017 Sensus Metering Systems +/// Copyright (c) 2017 Sensus Slovensko a.s. /// using System; using System.Windows.Forms; @@ -11,8 +11,6 @@ namespace TBF.Rig.Dummy.RegValve { public partial class RegulValveCfgCtrl : UserControl, IComponentCfgCtrl { - ComponentParametersDlg parent; - public bool ShowMore { get { return true; } } RegValveCfg config; diff --git a/TBF/Rig/Dummy/RegValve/SetRegValvePositionOp.cs b/TBF/Rig/Dummy/RegValve/SetRegValvePositionOp.cs index 9e8654590..5efa54f9e 100644 --- a/TBF/Rig/Dummy/RegValve/SetRegValvePositionOp.cs +++ b/TBF/Rig/Dummy/RegValve/SetRegValvePositionOp.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2017 Sensus Metering Systems +/// Copyright (c) 2017 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; @@ -35,7 +35,6 @@ namespace TBF.Rig.Dummy.RegValve readonly int timeout; /// Process values - bool firstRun; int expireTime; bool positionReached; @@ -56,7 +55,6 @@ namespace TBF.Rig.Dummy.RegValve this.posLoPct = posLoPct; this.posHiPct = posHiPct; - this.timeout = timeout; log.Debug(this.ToString()); @@ -74,7 +72,6 @@ namespace TBF.Rig.Dummy.RegValve /// Start this operation public void Start() { - firstRun = true; positionReached = false; expireTime = StateMachine.Time + timeout; log.InfoFormat("Start(): RV#={0}, reqPosLo={1}%, reqPosHi={2}%", posLoPct.ToString("F1"), posHiPct.ToString("F1")); @@ -111,8 +108,6 @@ namespace TBF.Rig.Dummy.RegValve } /// Stop this operation - public void Stop() - { - } + public void Stop() { } } } diff --git a/TBF/Rig/Dummy/Valve/Component.cs b/TBF/Rig/Dummy/Valve/Component.cs index 16cb01000..8f376e9de 100644 --- a/TBF/Rig/Dummy/Valve/Component.cs +++ b/TBF/Rig/Dummy/Valve/Component.cs @@ -27,9 +27,7 @@ namespace TBF.Rig.Dummy.Valve log.Warn(this.ToString()); } - bool state; - - public bool State { get { return state; } } + public bool State { get { return false; } } public ValveCategory Category { get { return ValveCategory.None; } } public int Delay { get { return 1; } } public IValve CoupledTo { get { return null; } } diff --git a/TBF/Rig/Generic/IComponent.cs b/TBF/Rig/Generic/IComponent.cs index ae3b84990..c56d48896 100644 --- a/TBF/Rig/Generic/IComponent.cs +++ b/TBF/Rig/Generic/IComponent.cs @@ -19,6 +19,9 @@ namespace TBF.Rig.Generic IComponentCfg Cfg { get; } + /// + /// Measurement correction table + /// IList Corrections { get; set; } IList Uncertainties { get; set; } diff --git a/TBF/Rig/GenericDevices/IEventTrigger.cs b/TBF/Rig/GenericDevices/IEventTrigger.cs index d22a6d99b..af1837bf9 100644 --- a/TBF/Rig/GenericDevices/IEventTrigger.cs +++ b/TBF/Rig/GenericDevices/IEventTrigger.cs @@ -6,12 +6,5 @@ namespace TBF.Rig.GenericDevices { public interface IEventTrigger : IResultsProcessor { - /// - /// Analyze results of one batch of water meters and trigger appropriate events. - /// Events: Event.ResultsProcessed, Event.Busy - /// - /// Results of a batch of water meters - /// Reference to the operation - IOperation ProcessResultsOp(Results.Entities.Batch batch); } } diff --git a/TBF/Rig/GenericDevices/IFlowMeter.cs b/TBF/Rig/GenericDevices/IFlowMeter.cs index 5d751407d..5b100f9e9 100644 --- a/TBF/Rig/GenericDevices/IFlowMeter.cs +++ b/TBF/Rig/GenericDevices/IFlowMeter.cs @@ -34,11 +34,6 @@ namespace TBF.Rig.GenericDevices /// int Idx1 { get; } - /// - /// Measurement correction table - /// - IList Corrections { get; } - /// /// Returns current flow value in [m3/h] /// diff --git a/TBF/Rig/GenericDevices/IPressureMeter.cs b/TBF/Rig/GenericDevices/IPressureMeter.cs index 1131d4931..78336a616 100644 --- a/TBF/Rig/GenericDevices/IPressureMeter.cs +++ b/TBF/Rig/GenericDevices/IPressureMeter.cs @@ -13,11 +13,6 @@ namespace TBF.Rig.GenericDevices /// public interface IPressureMeter : IComponent { - /// - /// Measurement correction table - /// - IList Corrections { get; } - /// /// Events: PressureDone, Error /// diff --git a/TBF/Rig/GenericDevices/IRegReaderPulses.cs b/TBF/Rig/GenericDevices/IRegReaderPulses.cs index eba6d8877..1ddd678c6 100644 --- a/TBF/Rig/GenericDevices/IRegReaderPulses.cs +++ b/TBF/Rig/GenericDevices/IRegReaderPulses.cs @@ -5,12 +5,6 @@ namespace TBF.Rig.GenericDevices { interface IRegReaderPulses : IRegReader { - int Position { get; } int Filter { get; } - - double PulsesPerLtr { get; } /// [imp/l] ... water meter or volume measurement part of a heat meter - double LtrsPerPulse { get; } /// [l/imp] - - int WMPulses { get; } /// Counted pulses of the water meter } } diff --git a/TBF/Rig/GenericDevices/IResultsPrinter.cs b/TBF/Rig/GenericDevices/IResultsPrinter.cs index 86562ddcb..55c423a40 100644 --- a/TBF/Rig/GenericDevices/IResultsPrinter.cs +++ b/TBF/Rig/GenericDevices/IResultsPrinter.cs @@ -6,14 +6,6 @@ namespace TBF.Rig.GenericDevices { public interface IResultsPrinter : IResultsProcessor { - /// - /// Prints results fo one batch of water meters. - /// Events: Event.ResultsPrinted, Event.Busy - /// - /// Results of a batch of water meters - /// Reference to the operation - IOperation ProcessResultsOp(Results.Entities.Batch batch); - /// /// When true printing at the end of cycle is bypassed. /// Can be used to disable printing without having to modify all procedures. diff --git a/TBF/Rig/GenericDevices/IResultsWriter.cs b/TBF/Rig/GenericDevices/IResultsWriter.cs index b637da36c..dabbc6630 100644 --- a/TBF/Rig/GenericDevices/IResultsWriter.cs +++ b/TBF/Rig/GenericDevices/IResultsWriter.cs @@ -6,12 +6,5 @@ namespace TBF.Rig.GenericDevices { public interface IResultsWriter : IResultsProcessor { - /// - /// Writes results of one batch of water meters into a file or a database. - /// Events: Event.ResultsWritten, Event.Busy - /// - /// Results of a batch of water meters - /// Reference to the operation - IOperation ProcessResultsOp(Results.Entities.Batch batch); } } diff --git a/TBF/Rig/GenericDevices/IScaleOrTank.cs b/TBF/Rig/GenericDevices/IScaleOrTank.cs index 22b490dbd..1b4cce7b6 100644 --- a/TBF/Rig/GenericDevices/IScaleOrTank.cs +++ b/TBF/Rig/GenericDevices/IScaleOrTank.cs @@ -49,10 +49,5 @@ namespace TBF.Rig.GenericDevices /// Time in seconds to empty the tank completely when it is full /// int EmptyTimeSec { get; } - - /// - /// Measurement correction table - /// - IList Corrections { get; } } } diff --git a/TBF/Rig/MettlerToledo/Standard/BalanceDev.cs b/TBF/Rig/MettlerToledo/Standard/BalanceDev.cs index 5d9655642..e01598422 100644 --- a/TBF/Rig/MettlerToledo/Standard/BalanceDev.cs +++ b/TBF/Rig/MettlerToledo/Standard/BalanceDev.cs @@ -87,7 +87,7 @@ namespace TBF.Rig.MettlerToledo.Standard log.Warn(this.ToString()); } - public void Initialize() + public override void Initialize() { base.Initalize(); /// Initializes DrainValve, etc., should be called in DebugMode.Simulate diff --git a/TBF/Rig/MettlerToledo/Standard/ReadStableMassOp.cs b/TBF/Rig/MettlerToledo/Standard/ReadStableMassOp.cs index c0399d88e..f5c2f7616 100644 --- a/TBF/Rig/MettlerToledo/Standard/ReadStableMassOp.cs +++ b/TBF/Rig/MettlerToledo/Standard/ReadStableMassOp.cs @@ -30,7 +30,6 @@ namespace TBF.Rig.MettlerToledo.Standard int currentReadingsCount; int startTime; - bool activityStarted; bool measurementCompleted; int timeout; @@ -57,7 +56,6 @@ namespace TBF.Rig.MettlerToledo.Standard massReadings = new double[totalReadingsCount]; sortedMassReadings = new double[totalReadingsCount]; currentReadingsCount = 0; - activityStarted = false; measurementCompleted = false; timeout = (method == Config.Entities.MassMethod.Scale) ? 60 : 2; @@ -94,13 +92,11 @@ namespace TBF.Rig.MettlerToledo.Standard if (delayBefore == 0 && scale.Activity == Activity.Idle) { StartMeasurement(); - activityStarted = true; scale.Activity = Activity.RunningOperation; opState = OpState.MassMeasurement; } else { - activityStarted = false; opState = OpState.WaitingBeforeMeasurment; } } @@ -118,7 +114,6 @@ namespace TBF.Rig.MettlerToledo.Standard if (StateMachine.Time >= startTime + delayBefore && scale.Activity == Activity.Idle) { StartMeasurement(); - activityStarted = true; scale.Activity = Activity.RunningOperation; opState = OpState.MassMeasurement; } diff --git a/TBF/Rig/Modbus/Ambient/Comet/Ambient.cs b/TBF/Rig/Modbus/Ambient/Comet/Ambient.cs index f32aaceb4..76745cdc7 100644 --- a/TBF/Rig/Modbus/Ambient/Comet/Ambient.cs +++ b/TBF/Rig/Modbus/Ambient/Comet/Ambient.cs @@ -90,7 +90,7 @@ namespace TBF.Rig.Modbus.Ambient.Comet log.Warn(this.ToString()); } - public void Initialize() + public override void Initialize() { temperature = DefaultTemperature; pressure = DefaultPressure; diff --git a/TBF/Rig/Modbus/Common/Modbus.cs b/TBF/Rig/Modbus/Common/Modbus.cs index 9253835a4..26c386d1b 100644 --- a/TBF/Rig/Modbus/Common/Modbus.cs +++ b/TBF/Rig/Modbus/Common/Modbus.cs @@ -58,7 +58,7 @@ namespace TBF.Rig.Modbus.Common log.Warn(this.ToString()); } - public void Initialize() + public override void Initialize() { telegramsToSend = new Queue(); diff --git a/TBF/Rig/Modbus/PressureMeter/Meret/PressureMeter.cs b/TBF/Rig/Modbus/PressureMeter/Meret/PressureMeter.cs index ab654145e..dc2c020f3 100644 --- a/TBF/Rig/Modbus/PressureMeter/Meret/PressureMeter.cs +++ b/TBF/Rig/Modbus/PressureMeter/Meret/PressureMeter.cs @@ -44,7 +44,7 @@ namespace TBF.Rig.Modbus.PressureMeter.Meret /// /// IDevice interface /// - public void Initialize() + public override void Initialize() { ticketNumber = modbus.RegisterForPolling(); } diff --git a/TBF/Rig/Modbus/TankSelector/UnselectTankOp.cs b/TBF/Rig/Modbus/TankSelector/UnselectTankOp.cs index 7d5f26689..3ceddbe6d 100644 --- a/TBF/Rig/Modbus/TankSelector/UnselectTankOp.cs +++ b/TBF/Rig/Modbus/TankSelector/UnselectTankOp.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2017 Sensus Metering Systems +/// Copyright (c) 2017 Sensus Slovensko a.s. /// namespace TBF.Rig.Modbus.TankSelector { @@ -10,7 +10,6 @@ namespace TBF.Rig.Modbus.TankSelector ushort unselectBitMask; bool doUnselect; bool unselectedWaitLevel; - int time; public UnselectTankOp(TankSelector tankSelector) { @@ -72,8 +71,6 @@ namespace TBF.Rig.Modbus.TankSelector } /// Stop this operation - public void Stop() - { - } + public void Stop() { } } } diff --git a/TBF/Rig/Modbus/TempMeter/Groch/TempMeter.cs b/TBF/Rig/Modbus/TempMeter/Groch/TempMeter.cs index 04d6529fb..f74d91538 100644 --- a/TBF/Rig/Modbus/TempMeter/Groch/TempMeter.cs +++ b/TBF/Rig/Modbus/TempMeter/Groch/TempMeter.cs @@ -58,6 +58,15 @@ namespace TBF.Rig.Modbus.TempMeter.Groch log.Warn(this.ToString()); } + public override void Initialize() + { + /// Only TempMeter with Channel == 0 communicates via the parent Modbus component + if (Channel == 0) + { + ticketNumber = modbus.RegisterForPolling(); + } + } + public IList GetCalendarEvents() { @@ -90,15 +99,6 @@ namespace TBF.Rig.Modbus.TempMeter.Groch return calendarEvents; } - public void Initialize() - { - /// Only TempMeter with Channel == 0 communicates via the parent Modbus component - if (Channel == 0) - { - ticketNumber = modbus.RegisterForPolling(); - } - } - public void RunDeviceBefore() { if (Channel != 0 || @@ -160,6 +160,7 @@ namespace TBF.Rig.Modbus.TempMeter.Groch public void StopDevice() { } public void StopDevice2() { } + public double ReadTemperature() { if (Cfg.DebugLevel == Config.Entities.DebugMode.Normal) diff --git a/TBF/Rig/Modbus/TempMeter/Meret/TempMeter.cs b/TBF/Rig/Modbus/TempMeter/Meret/TempMeter.cs index c57954975..b066e1b9e 100644 --- a/TBF/Rig/Modbus/TempMeter/Meret/TempMeter.cs +++ b/TBF/Rig/Modbus/TempMeter/Meret/TempMeter.cs @@ -41,14 +41,14 @@ namespace TBF.Rig.Modbus.TempMeter.Meret log.Warn(this.ToString()); } - /// - /// IDevice interface - /// - public void Initialize() + public override void Initialize() { ticketNumber = modbus.RegisterForPolling(); } + /// + /// IDevice interface + /// /// Run this device public void RunDeviceBefore() { diff --git a/TBF/Rig/Modbus/UltrasoundLevelMeter/LevelMeterCfg.cs b/TBF/Rig/Modbus/UltrasoundLevelMeter/LevelMeterCfg.cs index 5daaa8362..654d3be73 100644 --- a/TBF/Rig/Modbus/UltrasoundLevelMeter/LevelMeterCfg.cs +++ b/TBF/Rig/Modbus/UltrasoundLevelMeter/LevelMeterCfg.cs @@ -106,9 +106,6 @@ namespace TBF.Rig.Modbus.UltrasoundLevelMeter message = "Invalid index"; return false; } - - message = ParamName(i) + " is invalid"; - return false; } void CopyContentTo(LevelMeterCfg prms) diff --git a/TBF/Rig/Modbus/WaterAnalyzer/AnalyzerCfg.cs b/TBF/Rig/Modbus/WaterAnalyzer/AnalyzerCfg.cs index b169cb044..df4e9b2d6 100644 --- a/TBF/Rig/Modbus/WaterAnalyzer/AnalyzerCfg.cs +++ b/TBF/Rig/Modbus/WaterAnalyzer/AnalyzerCfg.cs @@ -106,9 +106,6 @@ namespace TBF.Rig.Modbus.WaterAnalyzer message = "Invalid index"; return false; } - - message = ParamName(i) + " is invalid"; - return false; } void CopyContentTo(AnalyzerCfg prms) diff --git a/TBF/Rig/Network/Camera/CLP1611/Camera.cs b/TBF/Rig/Network/Camera/CLP1611/Camera.cs index 373b9a135..77876fbad 100644 --- a/TBF/Rig/Network/Camera/CLP1611/Camera.cs +++ b/TBF/Rig/Network/Camera/CLP1611/Camera.cs @@ -150,7 +150,7 @@ namespace TBF.Rig.Network.Camera.CLP1611 } - public void Initialize() + public override void Initialize() { cameraIdx = GetCameraIdx(); diff --git a/TBF/Rig/Network/Camera/CLP1611/TerminalDlg.cs b/TBF/Rig/Network/Camera/CLP1611/TerminalDlg.cs index b7521f87c..a50c58c8f 100644 --- a/TBF/Rig/Network/Camera/CLP1611/TerminalDlg.cs +++ b/TBF/Rig/Network/Camera/CLP1611/TerminalDlg.cs @@ -7,7 +7,6 @@ namespace TBF.Rig.Network.Camera.CLP1611 public partial class TerminalDlg : Form { TelnetClient telnet; - bool dlgLoaded; public TerminalDlg() { @@ -24,11 +23,10 @@ namespace TBF.Rig.Network.Camera.CLP1611 private void Terminal_Load(object sender, EventArgs e) { telnet.vtTextChangedHandler += delegate(object sndr, VtTextChangedEventArgs args) - { - if (InvokeRequired) { Invoke(new EventHandler(OnTextChanged), sndr, args); } - else OnTextChanged(sndr, args); - }; - dlgLoaded = true; + { + if (InvokeRequired) { Invoke(new EventHandler(OnTextChanged), sndr, args); } + else OnTextChanged(sndr, args); + }; } void OnTextChanged(object sndr, VtTextChangedEventArgs args) diff --git a/TBF/Rig/Operations/EnthalpyCalculationOp.cs b/TBF/Rig/Operations/EnthalpyCalculationOp.cs index e1ee6ace1..03453e094 100644 --- a/TBF/Rig/Operations/EnthalpyCalculationOp.cs +++ b/TBF/Rig/Operations/EnthalpyCalculationOp.cs @@ -49,6 +49,7 @@ namespace TBF.Rig.Operations this.enthalpy = enthalpy; if (path == null) throw new Exception("path argument in EnthalpyCalculationOp constructor"); + this.path = path; } /// Time period (TimeSpan) diff --git a/TBF/Rig/Output/DB/ProductionTracing/Tracing.cs b/TBF/Rig/Output/DB/ProductionTracing/Tracing.cs index b32246b68..35c400ce4 100644 --- a/TBF/Rig/Output/DB/ProductionTracing/Tracing.cs +++ b/TBF/Rig/Output/DB/ProductionTracing/Tracing.cs @@ -117,7 +117,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing /// /// IDevice interface implementation /// - public void Initialize() + public override void Initialize() { if (tracingCfg.DebugLevel == DebugMode.Simulate) return; diff --git a/TBF/Rig/Output/DB/SensusOracle/Database.cs b/TBF/Rig/Output/DB/SensusOracle/Database.cs index 390f1ac3b..888a15cac 100644 --- a/TBF/Rig/Output/DB/SensusOracle/Database.cs +++ b/TBF/Rig/Output/DB/SensusOracle/Database.cs @@ -112,32 +112,32 @@ namespace TBF.Rig.Output.DB.SensusOracle } } - - /// - /// The following 3 variables are always updated together - /// - int wmTypeId; - int wmTypeRevision; - string procedureSignature; +#if ORACLE_DB IList oracleTestInfo; /// Raw incomplete test info from Oracle DB (or null) SensusTestInfo[] completeTestInfo; /// Complete TBF test info obtained as the best match (never null when oracleTestInfo != null) + /// The following 3 variables are always updated together + int wmTypeId; + int wmTypeRevision; + string procedureSignature; +#endif - public Database() {} + public Database() {} public Database(Generic.IComponentCfg cfg) : base(cfg) { dbCfg = cfg as DatabaseCfg; - currentOpState = OpState.None; log.Warn(this.ToString()); } /// /// IDevice interface implementation /// - public void Initialize() + public override void Initialize() { + currentOpState = OpState.None; + if (dbCfg.DebugLevel == DebugMode.Simulate) return; productionDB = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;"); diff --git a/TBF/Rig/Output/FileWriters/ImageArchiver/Archiver.cs b/TBF/Rig/Output/FileWriters/ImageArchiver/Archiver.cs index 91a3cd086..8b4d3df79 100644 --- a/TBF/Rig/Output/FileWriters/ImageArchiver/Archiver.cs +++ b/TBF/Rig/Output/FileWriters/ImageArchiver/Archiver.cs @@ -57,8 +57,6 @@ namespace TBF.Rig.Output.FileWriters.ImageArchiver Results.Entities.Batch batch; - bool abort; /// Set to 'true' by Stop() operation to abort writing to the file - public Archiver() {} diff --git a/TBF/Rig/Output/FileWriters/ImageArchiver/ArchiverCfgCtrl.cs b/TBF/Rig/Output/FileWriters/ImageArchiver/ArchiverCfgCtrl.cs index fa29852a4..1e3a75275 100644 --- a/TBF/Rig/Output/FileWriters/ImageArchiver/ArchiverCfgCtrl.cs +++ b/TBF/Rig/Output/FileWriters/ImageArchiver/ArchiverCfgCtrl.cs @@ -25,14 +25,12 @@ namespace TBF.Rig.Output.FileWriters.ImageArchiver } } - string[] selectedItems; - public ArchiverCfgCtrl() { InitializeComponent(); } - private void WriterCfgCtrl_Load(object sender, EventArgs e) + private void ArchiverCfgCtrl_Load(object sender, EventArgs e) { for (YearFolders s = 0; s < YearFolders.Count; s++) yearFoldersComboBox.Items.Add(s.ToString()); for (MonthFolders s = 0; s < MonthFolders.Count; s++) monthFoldersComboBox.Items.Add(s.ToString()); diff --git a/TBF/Rig/Output/FileWriters/ImageArchiver/ArchiverCfgCtrl.designer.cs b/TBF/Rig/Output/FileWriters/ImageArchiver/ArchiverCfgCtrl.designer.cs index 96ba8e82f..57205ddcf 100644 --- a/TBF/Rig/Output/FileWriters/ImageArchiver/ArchiverCfgCtrl.designer.cs +++ b/TBF/Rig/Output/FileWriters/ImageArchiver/ArchiverCfgCtrl.designer.cs @@ -292,7 +292,7 @@ namespace TBF.Rig.Output.FileWriters.ImageArchiver this.Controls.Add(this.classNameLabel); this.Name = "ArchiverCfgCtrl"; this.Size = new System.Drawing.Size(455, 350); - this.Load += new System.EventHandler(this.WriterCfgCtrl_Load); + this.Load += new System.EventHandler(this.ArchiverCfgCtrl_Load); this.ResumeLayout(false); this.PerformLayout(); diff --git a/TBF/Rig/StateMachine.cs b/TBF/Rig/StateMachine.cs index fde2e748b..c9a9d385e 100644 --- a/TBF/Rig/StateMachine.cs +++ b/TBF/Rig/StateMachine.cs @@ -46,7 +46,9 @@ namespace TBF.Rig static IList benchPaths; static IList outputPaths; static IList metersPaths; +#if HEAT_METERS static IList heatMetersPaths; +#endif public static IList TransitionSequences; public static IList TransitionSteps; diff --git a/TBF/Rig/TestMethods/Adjustment/AdjustmentSeq.cs b/TBF/Rig/TestMethods/Adjustment/AdjustmentSeq.cs index 0bd59e53a..b6d84d7d0 100644 --- a/TBF/Rig/TestMethods/Adjustment/AdjustmentSeq.cs +++ b/TBF/Rig/TestMethods/Adjustment/AdjustmentSeq.cs @@ -249,9 +249,6 @@ namespace TBF.Rig.TestMethods.Adjustment while (!e.Contains(Event.TimerExpired)); } - - setting_flow: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ @@ -400,11 +397,9 @@ namespace TBF.Rig.TestMethods.Adjustment } while (!e.Contains(Event.TestCompleted) && !e.Contains(Event.Next)); /// 'Next' button is enabled in Debug version only - /// Measurement loop - end + /// One test completed StopRecordingStatistics(); - one_test_completed: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Adjustment_in_progress); //------------------------------------------------ diff --git a/TBF/Rig/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs b/TBF/Rig/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs index 8636d6bd4..9ce7e5505 100644 --- a/TBF/Rig/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs +++ b/TBF/Rig/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs @@ -173,8 +173,8 @@ namespace TBF.Rig.TestMethods.CombinedWithDetection /// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f); - //==================================== - loop: + ///============================================================================================ + /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) .AddOperation(checkUiOp) @@ -228,9 +228,6 @@ namespace TBF.Rig.TestMethods.CombinedWithDetection switching_flow_detection: int flowDetectTime0 = StateMachine.Time; - int flowDetectTime = 0; - float estFlowSetTime = 100.0f; - /// /// Prepare cameras, ROI-s and measurementOperations diff --git a/TBF/Rig/TestMethods/Counter/TestMethod.cs b/TBF/Rig/TestMethods/Counter/TestMethod.cs index fc2bd89a2..736b1db2a 100644 --- a/TBF/Rig/TestMethods/Counter/TestMethod.cs +++ b/TBF/Rig/TestMethods/Counter/TestMethod.cs @@ -9,7 +9,7 @@ using TBF.Rig; namespace TBF.Rig.TestMethods.Counter { - public class TestMethod : ComponentBase, GenericDevices.ITestMethod, Generic.IDevice + public class TestMethod : ComponentBase, GenericDevices.ITestMethod { private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod)); public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); } @@ -34,17 +34,14 @@ namespace TBF.Rig.TestMethods.Counter public TestMethod() { } - /// + public TestMethod(Generic.IComponentCfg cfg) : base(cfg) { log.Warn(this.ToString()); } - /// - /// IDevice interface implementation - /// - public void Initialize() + public override void Initialize() { counterIdx0 = nextCounterIdx; nextCounterIdx++; @@ -57,10 +54,7 @@ namespace TBF.Rig.TestMethods.Counter Counters[nextCounterIdx - 1] = this; } } - public void RunDeviceBefore() { } - public void RunDeviceAfter() { } - public void StopDevice() { } - public void StopDevice2() { } + public IList Execute(Test test, int repetNr, bool isLastRepetition) { diff --git a/TBF/Rig/TestMethods/DiverterTest/DiverterTestSeq.cs b/TBF/Rig/TestMethods/DiverterTest/DiverterTestSeq.cs index 643bea6c9..55af76221 100644 --- a/TBF/Rig/TestMethods/DiverterTest/DiverterTestSeq.cs +++ b/TBF/Rig/TestMethods/DiverterTest/DiverterTestSeq.cs @@ -142,8 +142,8 @@ namespace TBF.Rig.TestMethods.DiverterTest LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f); - //==================================== - loop: + ///============================================================================================ + /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) .AddOperation(checkUiOp) @@ -305,9 +305,6 @@ namespace TBF.Rig.TestMethods.DiverterTest while (!e.Contains(Event.TimerExpired)); } - - setting_flow: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ @@ -560,10 +557,7 @@ namespace TBF.Rig.TestMethods.DiverterTest } } /// end for ... diverter test loop - /// Measurement loop - end - - test_completed: - + /// Test completed StopRecordingStatistics(); /// @@ -861,8 +855,6 @@ namespace TBF.Rig.TestMethods.DiverterTest cBrd.Stop(false); } - stopTestWOStoppingDivGateEtc: - return new List { retVal }; } } diff --git a/TBF/Rig/TestMethods/Endurance/EnduranceSeq.cs b/TBF/Rig/TestMethods/Endurance/EnduranceSeq.cs index e71e85ee9..ed051a5e8 100644 --- a/TBF/Rig/TestMethods/Endurance/EnduranceSeq.cs +++ b/TBF/Rig/TestMethods/Endurance/EnduranceSeq.cs @@ -142,8 +142,8 @@ namespace TBF.Rig.TestMethods.Endurance LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h] int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f); - //==================================== - loop: + ///============================================================================================ + /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) .AddOperation(checkUiOp) @@ -690,8 +690,6 @@ namespace TBF.Rig.TestMethods.Endurance while (!e.Contains(Event.PreviousStopped)); } - stopTestWOStoppingDivGateEtc: - return new List { retVal }; } } diff --git a/TBF/Rig/TestMethods/FixedStart/FixedStartSeq.cs b/TBF/Rig/TestMethods/FixedStart/FixedStartSeq.cs index 29ba5a534..80f1d95c3 100644 --- a/TBF/Rig/TestMethods/FixedStart/FixedStartSeq.cs +++ b/TBF/Rig/TestMethods/FixedStart/FixedStartSeq.cs @@ -133,9 +133,8 @@ namespace TBF.Rig.TestMethods.FixedStart /// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f); - - //==================================== - loop: + ///============================================================================================ + /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) .AddOperation(checkUiOp) @@ -247,9 +246,6 @@ namespace TBF.Rig.TestMethods.FixedStart while (!e.Contains(Event.TimerExpired)); } - - setting_flow: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ @@ -1068,8 +1064,6 @@ namespace TBF.Rig.TestMethods.FixedStart while (!e.Contains(Event.PreviousStopped)); } - stopTestWOStoppingDivGateEtc: - return new List { retVal }; } } diff --git a/TBF/Rig/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs b/TBF/Rig/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs index c30ce9260..787ecf5d5 100644 --- a/TBF/Rig/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs +++ b/TBF/Rig/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs @@ -141,8 +141,8 @@ namespace TBF.Rig.TestMethods.FixedStartAdvanced /// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f); - //==================================== - loop: + ///============================================================================================ + /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) .AddOperation(checkUiOp) @@ -235,9 +235,6 @@ namespace TBF.Rig.TestMethods.FixedStartAdvanced } while (!e.Contains(Event.ValvesSet)); - - set_flow: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ diff --git a/TBF/Rig/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs b/TBF/Rig/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs index 69e1e7414..b3b68428c 100644 --- a/TBF/Rig/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs +++ b/TBF/Rig/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs @@ -151,9 +151,8 @@ namespace TBF.Rig.TestMethods.FixedStartDeferredEval /// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f); + ///============================================================================================ - //==================================== - loop: /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) .AddOperation(checkUiOp) @@ -265,9 +264,6 @@ namespace TBF.Rig.TestMethods.FixedStartDeferredEval while (!e.Contains(Event.TimerExpired)); } - - setting_flow: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ @@ -892,8 +888,6 @@ namespace TBF.Rig.TestMethods.FixedStartDeferredEval while (!e.Contains(Event.PreviousStopped)); } - stopTestWOTransitionAfter: - return new List { retVal }; /// default 'retVal' value is Event.Done } diff --git a/TBF/Rig/TestMethods/FixedStartMassCollAdvanced/FixedStartMassCollAdvancedSeq.cs b/TBF/Rig/TestMethods/FixedStartMassCollAdvanced/FixedStartMassCollAdvancedSeq.cs index 479b25a50..aa2535291 100644 --- a/TBF/Rig/TestMethods/FixedStartMassCollAdvanced/FixedStartMassCollAdvancedSeq.cs +++ b/TBF/Rig/TestMethods/FixedStartMassCollAdvanced/FixedStartMassCollAdvancedSeq.cs @@ -151,9 +151,8 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced /// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f); + ///============================================================================================ - //==================================== - loop: /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) .AddOperation(checkUiOp) @@ -1090,8 +1089,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced while (!e.Contains(Event.PreviousStopped)); } - stopTestWOTransitionAfter: - return new List { retVal }; } } diff --git a/TBF/Rig/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs b/TBF/Rig/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs index bd968ec94..fcfe00bf2 100644 --- a/TBF/Rig/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs +++ b/TBF/Rig/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs @@ -176,8 +176,8 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f); - //==================================== - loop: + ///============================================================================================ + /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) .AddOperation(checkUiOp) @@ -346,9 +346,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval while (!e.Contains(Event.TimerExpired)); } - - setting_flow: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ @@ -1011,8 +1008,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval while (!e.Contains(Event.PreviousStopped)); } - stopTestWOTransitionAfter: - return new List { retVal }; /// default 'retVal' value is Event.Done } diff --git a/TBF/Rig/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs b/TBF/Rig/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs index 725962a44..c966283eb 100644 --- a/TBF/Rig/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs +++ b/TBF/Rig/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs @@ -151,9 +151,8 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection /// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f); + ///============================================================================================ - //==================================== - loop: /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) .AddOperation(checkUiOp) @@ -323,9 +322,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection while (!e.Contains(Event.TimerExpired)); } - - setting_flow: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ @@ -1236,8 +1232,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection while (!e.Contains(Event.PreviousStopped)); } - stopTestWOTransitionAfter: - return new List { retVal }; } } diff --git a/TBF/Rig/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs b/TBF/Rig/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs index da6af4c21..59c7dbbd2 100644 --- a/TBF/Rig/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs +++ b/TBF/Rig/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs @@ -158,8 +158,8 @@ namespace TBF.Rig.TestMethods.FixedStartTankCollection DoubleBox volumeBox = new DoubleBox(); - //==================================== - loop: + ///============================================================================================ + /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) .AddOperation(checkUiOp) @@ -268,9 +268,6 @@ namespace TBF.Rig.TestMethods.FixedStartTankCollection while (!e.Contains(Event.TimerExpired)); } - - setting_flow: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ diff --git a/TBF/Rig/TestMethods/FlowAdjustment/FlowAdjustmentSeq.cs b/TBF/Rig/TestMethods/FlowAdjustment/FlowAdjustmentSeq.cs index cc68fe70a..5cf7acd41 100644 --- a/TBF/Rig/TestMethods/FlowAdjustment/FlowAdjustmentSeq.cs +++ b/TBF/Rig/TestMethods/FlowAdjustment/FlowAdjustmentSeq.cs @@ -129,8 +129,8 @@ namespace TBF.Rig.TestMethods.FlowAdjustment LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h] int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f); - //==================================== - loop: + ///============================================================================================ + /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) .AddOperation(checkUiOp) @@ -416,8 +416,6 @@ namespace TBF.Rig.TestMethods.FlowAdjustment while (!e.Contains(Event.PreviousStopped)); } - stopTestWOStoppingDivGateEtc: - return new List { retVal }; } diff --git a/TBF/Rig/TestMethods/FlyingStart/FlyingStartSeq.cs b/TBF/Rig/TestMethods/FlyingStart/FlyingStartSeq.cs index 9b45a0726..e26b875d2 100644 --- a/TBF/Rig/TestMethods/FlyingStart/FlyingStartSeq.cs +++ b/TBF/Rig/TestMethods/FlyingStart/FlyingStartSeq.cs @@ -129,8 +129,8 @@ namespace TBF.Rig.TestMethods.FlyingStart LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h] int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f); - //==================================== - loop: + ///============================================================================================ + /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) .AddOperation(checkUiOp) @@ -248,9 +248,6 @@ namespace TBF.Rig.TestMethods.FlyingStart while (!e.Contains(Event.TimerExpired)); } - - setting_flow: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ @@ -740,8 +737,6 @@ namespace TBF.Rig.TestMethods.FlyingStart cBrd.Stop(false); } - stopTestWOStoppingDivGateEtc: - return new List { retVal }; } diff --git a/TBF/Rig/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs b/TBF/Rig/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs index 0b0c8941b..cc164fe55 100644 --- a/TBF/Rig/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs +++ b/TBF/Rig/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs @@ -162,13 +162,12 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl : ((compoundTestParams != null) ? compoundTestParams.NextTestVolume : heatMetersTestParams.NextTestVolume); - //==================================== - loop: - /// 'totalPulses' calculation has to be inside test repetition loop for this method !!! LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; int totalPulses = (int)((repetitionNr == 1 ? test.Volume : nextTestVolume) / LtrPerRefPulse + 0.5f); + ///============================================================================================ + /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) .AddOperation(checkUiOp) @@ -349,9 +348,6 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl while (!e.Contains(Event.TimerExpired)); } - - setting_flow: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ diff --git a/TBF/Rig/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs b/TBF/Rig/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs index b3ccf1455..872269c40 100644 --- a/TBF/Rig/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs +++ b/TBF/Rig/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs @@ -183,8 +183,8 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f); - //==================================== - loop: + ///============================================================================================ + /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) .AddOperation(checkUiOp) @@ -363,9 +363,6 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative while (!e.Contains(Event.TimerExpired)); } - - setting_flow: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ diff --git a/TBF/Rig/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs b/TBF/Rig/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs index d621f947f..cd552f697 100644 --- a/TBF/Rig/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs +++ b/TBF/Rig/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs @@ -161,8 +161,8 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged int targetTotalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f); int targetMassPulses = (int)(volumeToTank / LtrPerRefPulse + 0.5f); - //==================================== - loop: + ///============================================================================================ + /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) .AddOperation(checkUiOp) @@ -341,9 +341,6 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged while (!e.Contains(Event.TimerExpired)); } - - setting_flow: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ @@ -1021,8 +1018,6 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged cBrd.Stop(false); } - stopTestWOStoppingDivGateEtc: - return new List { retVal }; } diff --git a/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs b/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs index cf21816aa..414faa750 100644 --- a/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs +++ b/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs @@ -157,8 +157,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection LtrPerRefPulse = cBrd.Devices.FlowMeter.LtrPerPulse; int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f); - //==================================== - loop: + ///============================================================================================ /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) @@ -338,9 +337,6 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection while (!e.Contains(Event.TimerExpired)); } - - setting_flow: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ @@ -1066,8 +1062,6 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection cBrd.Stop(false); } - stopTestWOStoppingDivGateEtc: - return new List { retVal }; } diff --git a/TBF/Rig/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs b/TBF/Rig/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs index 7a04940da..c3199e862 100644 --- a/TBF/Rig/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs +++ b/TBF/Rig/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs @@ -167,8 +167,8 @@ namespace TBF.Rig.TestMethods.FlyingStartTankCollection DoubleBox volumeBox = new DoubleBox(); - //==================================== - loop: + ///============================================================================================ + /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) .AddOperation(checkUiOp) @@ -288,9 +288,6 @@ namespace TBF.Rig.TestMethods.FlyingStartTankCollection while (!e.Contains(Event.TimerExpired)); } - - setting_flow: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ diff --git a/TBF/Rig/TestMethods/ManualEntry/ManualEntryCfgCtrl.cs b/TBF/Rig/TestMethods/ManualEntry/ManualEntryCfgCtrl.cs index 9793f37ca..eee572590 100644 --- a/TBF/Rig/TestMethods/ManualEntry/ManualEntryCfgCtrl.cs +++ b/TBF/Rig/TestMethods/ManualEntry/ManualEntryCfgCtrl.cs @@ -29,8 +29,6 @@ namespace TBF.Rig.TestMethods.ManualEntry } } - string header; - string[] commonItems; string[] testItems; public ManualEntryCfgCtrl() diff --git a/TBF/Rig/TestMethods/PMaxTest/PMaxTestSeq.cs b/TBF/Rig/TestMethods/PMaxTest/PMaxTestSeq.cs index de5e783ad..39da94aa4 100644 --- a/TBF/Rig/TestMethods/PMaxTest/PMaxTestSeq.cs +++ b/TBF/Rig/TestMethods/PMaxTest/PMaxTestSeq.cs @@ -189,12 +189,8 @@ namespace TBF.Rig.TestMethods.PMaxTest } while (e.Contains(Event.TimerBusy)); - /// Measurement loop - end - - test_completed: - + /// Test completed StopRecordingStatistics(); - TestEndTime = DateTime.Now; //------------------------------------------------ diff --git a/TBF/Rig/TestMethods/PulsesTest/PulsesTestSeq.cs b/TBF/Rig/TestMethods/PulsesTest/PulsesTestSeq.cs index 8b692f0f1..88e84b685 100644 --- a/TBF/Rig/TestMethods/PulsesTest/PulsesTestSeq.cs +++ b/TBF/Rig/TestMethods/PulsesTest/PulsesTestSeq.cs @@ -211,9 +211,6 @@ namespace TBF.Rig.TestMethods.PulsesTest while (!e.Contains(Event.TimerExpired)); } - - setting_flow: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ diff --git a/TBF/Rig/TestMethods/PulsesTestManual/PulsesTestManualSeq.cs b/TBF/Rig/TestMethods/PulsesTestManual/PulsesTestManualSeq.cs index 3fb9e5bed..1d0ddc5d9 100644 --- a/TBF/Rig/TestMethods/PulsesTestManual/PulsesTestManualSeq.cs +++ b/TBF/Rig/TestMethods/PulsesTestManual/PulsesTestManualSeq.cs @@ -213,9 +213,6 @@ namespace TBF.Rig.TestMethods.PulsesTestManual while (!e.Contains(Event.TimerExpired)); } - - setting_flow: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ @@ -513,8 +510,6 @@ namespace TBF.Rig.TestMethods.PulsesTestManual while (!e.Contains(Event.PreviousStopped)); } - stopTestWOStoppingDivGateEtc: - return new List { retVal }; } } diff --git a/TBF/Rig/TestMethods/RoiDetection/RoiDetectionSeq.cs b/TBF/Rig/TestMethods/RoiDetection/RoiDetectionSeq.cs index 7f1757375..af03dccd2 100644 --- a/TBF/Rig/TestMethods/RoiDetection/RoiDetectionSeq.cs +++ b/TBF/Rig/TestMethods/RoiDetection/RoiDetectionSeq.cs @@ -138,9 +138,6 @@ namespace TBF.Rig.TestMethods.RoiDetection while (!e.Contains(Event.TimerExpired)); } - - setting_flow: - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ diff --git a/TBF/Rig/TestMethods/SensitivityTest/SensitivityTestSeq.cs b/TBF/Rig/TestMethods/SensitivityTest/SensitivityTestSeq.cs index 3e7666a0b..bce011e33 100644 --- a/TBF/Rig/TestMethods/SensitivityTest/SensitivityTestSeq.cs +++ b/TBF/Rig/TestMethods/SensitivityTest/SensitivityTestSeq.cs @@ -120,10 +120,10 @@ namespace TBF.Rig.TestMethods.SensitivityTest /// float timeHr = volumeLtr / (1000.0f * targetFlow); /// float timeSec = 3600.0f * timeHr; /// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); - int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f); + int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f); + + ///============================================================================================ - //==================================== - loop: /// Read pressure and temperature once before calling Bridge.OnTestSelected(...) State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name)) .AddOperation(checkUiOp) @@ -590,8 +590,6 @@ namespace TBF.Rig.TestMethods.SensitivityTest while (!e.Contains(Event.PreviousStopped)); } - stopTestWOStoppingDivGateEtc: - return new List { retVal }; } } diff --git a/TBF/Rig/TestMethods/iPerlCommunication/TestMethod.cs b/TBF/Rig/TestMethods/iPerlCommunication/TestMethod.cs index 9e341406d..d76b4c293 100644 --- a/TBF/Rig/TestMethods/iPerlCommunication/TestMethod.cs +++ b/TBF/Rig/TestMethods/iPerlCommunication/TestMethod.cs @@ -10,7 +10,7 @@ using TBF.Rig; namespace TBF.Rig.TestMethods.iPerlCommunication { - public class TestMethod : ComponentBase, GenericDevices.ISimultTestMethod, Generic.IDevice + public class TestMethod : ComponentBase, GenericDevices.ISimultTestMethod { private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod)); protected static readonly ILog rfidDataLogger = LogManager.GetLogger("RfidData"); @@ -76,7 +76,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication } /// IDevice interface - only Initialize() is used - public void Initialize() + public override void Initialize() { if (DebugLevel == DebugMode.Normal) { @@ -113,14 +113,9 @@ namespace TBF.Rig.TestMethods.iPerlCommunication rfidDataLogger.Fatal("------------------------------------------------------------------------"); rfidDataLogger.FatalFormat("Test Bench Framework ver. {0}", Program.Version); + log.FatalFormat("{0} - Device successfully initialized", Name); } - /// IDevice interface - only Initialize() is used - public void RunDeviceBefore() { } - public void RunDeviceAfter() { } - public void StopDevice() { } - public void StopDevice2() { } - public IList Execute(Test test, int repetNr, bool isLastRepetition) { return (new iPerlCommunicationSeq()).Execute(test, repetNr, testMethodCfg, testMethodCfg.TestParams); diff --git a/TBF/Rig/Uni/FlowMeter/FlowMeter.cs b/TBF/Rig/Uni/FlowMeter/FlowMeter.cs index 234bd0733..3ac21c620 100644 --- a/TBF/Rig/Uni/FlowMeter/FlowMeter.cs +++ b/TBF/Rig/Uni/FlowMeter/FlowMeter.cs @@ -11,7 +11,7 @@ using TBF.Resources; namespace TBF.Rig.Uni.FlowMeter { - public class FlowMeter : ComponentBase, Generic.IDevice, GenericDevices.IFlowMeter, GenericDevices.IHasCalendarEvents, IDrawingItCmpntWithMeasuredVal + public class FlowMeter : ComponentBase, GenericDevices.IFlowMeter, GenericDevices.IHasCalendarEvents, IDrawingItCmpntWithMeasuredVal { private static readonly ILog log = LogManager.GetLogger(typeof(FlowMeter)); public override string ToString() { return string.Format("FlowMeter({0})", Cfg.ToString(-1)); } @@ -103,10 +103,7 @@ namespace TBF.Rig.Uni.FlowMeter log.Warn(this.ToString()); } - /// - /// IDevice interface functions - /// - public void Initialize() + public override void Initialize() { for (int r = 0; r <= 5; r++) { @@ -125,10 +122,6 @@ namespace TBF.Rig.Uni.FlowMeter log.FatalFormat("Successfully initialized device {0}", Name); } - public void RunDeviceBefore() { } - public void RunDeviceAfter() { } - public void StopDevice() { } - public void StopDevice2() { } /// /// Calendar support diff --git a/TBF/Rig/Uni/RegValve/SetRegValvePositionOp.cs b/TBF/Rig/Uni/RegValve/SetRegValvePositionOp.cs index 216692a69..4ce9539d4 100644 --- a/TBF/Rig/Uni/RegValve/SetRegValvePositionOp.cs +++ b/TBF/Rig/Uni/RegValve/SetRegValvePositionOp.cs @@ -40,7 +40,6 @@ namespace TBF.Rig.Uni.RegValve readonly int timeout; /// Process values - bool firstRun; int expireTime; bool positionReached; @@ -83,7 +82,6 @@ namespace TBF.Rig.Uni.RegValve /// Start this operation public void Start() { - firstRun = true; positionReached = false; expireTime = StateMachine.Time + timeout; log.InfoFormat("Start(): {0} reqPosLo={1}%, reqPosHi={2}%", regV.Name, posLoPct.ToString("F1"), posHiPct.ToString("F1")); @@ -105,8 +103,6 @@ namespace TBF.Rig.Uni.RegValve return Event.OpArgumentError; } - firstRun = false; - regV.MoveToPosition(false, posLoPct, posHiPct); opState = OpState.CheckState; return Event.None; @@ -157,8 +153,6 @@ namespace TBF.Rig.Uni.RegValve } /// Stop this operation - public void Stop() - { - } + public void Stop() { } } } diff --git a/TBF/Rig/Uni/RegValveAnalog/SetRegValvePositionOp.cs b/TBF/Rig/Uni/RegValveAnalog/SetRegValvePositionOp.cs index d71ee62c6..eaf96e9f6 100644 --- a/TBF/Rig/Uni/RegValveAnalog/SetRegValvePositionOp.cs +++ b/TBF/Rig/Uni/RegValveAnalog/SetRegValvePositionOp.cs @@ -37,7 +37,6 @@ namespace TBF.Rig.Uni.RegValveAnalog readonly int timeout; /// Process values - bool firstRun; int expireTime; bool positionReached; @@ -78,7 +77,6 @@ namespace TBF.Rig.Uni.RegValveAnalog /// Start this operation public void Start() { - firstRun = true; positionReached = false; expireTime = StateMachine.Time + timeout; log.InfoFormat("Start(): RV#={0}, reqPosLo={1}%, reqPosHi={2}%", regValve.Idx1, posLoPct.ToString("F1"), posHiPct.ToString("F1")); @@ -100,8 +98,6 @@ namespace TBF.Rig.Uni.RegValveAnalog return Event.OpArgumentError; } - firstRun = false; - uniCB.RegVlvMoveToPos(false, regValve.Idx1, posLoPct, posHiPct); opState = OpState.CheckState; return Event.None; @@ -154,8 +150,6 @@ namespace TBF.Rig.Uni.RegValveAnalog } /// Stop this operation - public void Stop() - { - } + public void Stop() { } } } diff --git a/TBF/Rig/Various/CoverTest/CoverTestForm.cs b/TBF/Rig/Various/CoverTest/CoverTestForm.cs index a598e0497..75035f9bd 100644 --- a/TBF/Rig/Various/CoverTest/CoverTestForm.cs +++ b/TBF/Rig/Various/CoverTest/CoverTestForm.cs @@ -84,7 +84,7 @@ namespace TBF.Rig.Various.CoverTest { CloseThisFormHandler(sender, null); } - catch (Exception e) + catch (Exception) { } } diff --git a/TBF/Rig/Various/TankWithLevelMsrmnt/Tank.cs b/TBF/Rig/Various/TankWithLevelMsrmnt/Tank.cs index 758b89f9b..771c6171f 100644 --- a/TBF/Rig/Various/TankWithLevelMsrmnt/Tank.cs +++ b/TBF/Rig/Various/TankWithLevelMsrmnt/Tank.cs @@ -5,15 +5,13 @@ using System; using System.Collections.Generic; using System.Globalization; using System.IO; -using System.Text; using log4net; using TBF.Boxes; -using TBF.Rig.Generic; using TBF.Rig.GenericDevices; namespace TBF.Rig.Various.TankWithLevelMsrmnt { - public class Tank : TBF.Rig.MettlerToledo.TankDraining, IDevice, IScaleOrTank, IVolumeMeter, IOperation + public class Tank : TBF.Rig.MettlerToledo.TankDraining, IScaleOrTank, IVolumeMeter, IOperation { /// /// Info: StartMassMeasurement() and "Balnce response = .., Mass = ..." @@ -68,7 +66,7 @@ namespace TBF.Rig.Various.TankWithLevelMsrmnt /// /// IDevice interface (required to call base and initialize 'DrainValve') /// - public void Initialize() + public override void Initialize() { base.Initalize(); @@ -83,10 +81,6 @@ namespace TBF.Rig.Various.TankWithLevelMsrmnt useCalibTable = LoadCalibrationTable(tankCfg.CalibrationTable); } - public void RunDeviceBefore() { } - public void RunDeviceAfter() { } - public void StopDevice() { } - public void StopDevice2() { } public override bool IsEmpty() diff --git a/TBF/UI/Bench/EditSchDrawing/EditSchDrawingDlg.cs b/TBF/UI/Bench/EditSchDrawing/EditSchDrawingDlg.cs index 34d5ad227..3428a20d0 100644 --- a/TBF/UI/Bench/EditSchDrawing/EditSchDrawingDlg.cs +++ b/TBF/UI/Bench/EditSchDrawing/EditSchDrawingDlg.cs @@ -34,7 +34,6 @@ namespace TBF.UI.Bench.EditSchDrawing } bool unlocked; - Config.Entities.CfgUpdateFlags flags; /// Or-ed from particular Flags from ComponentParametersDlg ISession session; IList cmpntEntities; TBF.Rig.Various.Drawing.Pipes.Configuration pipesScfg; @@ -48,7 +47,6 @@ namespace TBF.UI.Bench.EditSchDrawing { InitializeComponent(); Controls.Add(new TextBox() { Visible = false }); - flags = Config.Entities.CfgUpdateFlags.None; selectComponentTypeDlg = new SelectComponentClassDlg("Various.Drawing."); sharedButtons.RequiredGroupMembership = new Users.Entities.GID[] { Users.Entities.GID.Administrators }; sharedButtons.OptionalButtons = SharedButtons.Buttons.Add; diff --git a/TBF/UI/Bench/Paths/PathsHeatMetersCtrl.cs b/TBF/UI/Bench/Paths/PathsHeatMetersCtrl.cs index 75f9ee1e6..f55d4b822 100644 --- a/TBF/UI/Bench/Paths/PathsHeatMetersCtrl.cs +++ b/TBF/UI/Bench/Paths/PathsHeatMetersCtrl.cs @@ -55,6 +55,29 @@ namespace TBF.UI.Bench.Paths this.parent = parent; this.parentControl = parentControl; + IList tempMeters = new List(); + foreach (var cmpnt in parent.TbfComponents) + { + if (cmpnt is ITempMeter) tempMeters.Add(cmpnt as ITempMeter); + } + + editors = new Control[fixedColumnsCount]; + /// + for (int i = 0; i < (int)Column.TMRefW1; i++) + { + editors[i] = new TextBox(); /// Name + editors[i].Visible = false; + parent.Controls.Add(editors[i]); + } + for (int i = (int)Column.TMRefW1; i < editors.Length; i++) + { + editors[i] = new ComboBox(); + (editors[i] as ComboBox).Items.Add("---"); + foreach (var t in tempMeters) (editors[i] as ComboBox).Items.Add(t.Name); + editors[i].Visible = false; + parent.Controls.Add(editors[i]); + } + #if HEAT_METERS /// Load the paths MyItems = parent.Session.QueryOver() @@ -67,12 +90,6 @@ namespace TBF.UI.Bench.Paths SubItemRightClicked += new SubItemEventHandler(listViewEx_SubItemRightClicked); SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing); - IList tempMeters = new List(); - foreach (var cmpnt in parent.TbfComponents) - { - if (cmpnt is ITempMeter) tempMeters.Add(cmpnt as ITempMeter); - } - /// ListViewEx columns TBF.LocalSettings ls = Program.LocalSettings; Columns.Add(Strings.Name, (ls.HeatMetersColumnCount > 0) ? ls.HeatMetersColumnWidths[0] : 60 * parent.Dpi / Constants.Dpi100pct); @@ -101,23 +118,6 @@ namespace TBF.UI.Bench.Paths } } - editors = new Control[fixedColumnsCount]; - /// - for (int i = 0; i < (int)Column.TMRefW1; i++) - { - editors[i] = new TextBox(); /// Name - editors[i].Visible = false; - parent.Controls.Add(editors[i]); - } - for (int i = (int)Column.TMRefW1; i < editors.Length; i++) - { - editors[i] = new ComboBox(); - (editors[i] as ComboBox).Items.Add("---"); - foreach (var t in tempMeters) (editors[i] as ComboBox).Items.Add(t.Name); - editors[i].Visible = false; - parent.Controls.Add(editors[i]); - } - base.RedrawAll(); #endif } diff --git a/TBF/UI/Calendar/CalendarCtrl.cs b/TBF/UI/Calendar/CalendarCtrl.cs index e4928c4a1..83b7b3808 100644 --- a/TBF/UI/Calendar/CalendarCtrl.cs +++ b/TBF/UI/Calendar/CalendarCtrl.cs @@ -1050,9 +1050,9 @@ namespace TBF.UI.Calendar if ((!ev.Hidden || _showHiddenEvents) && Config.CalendarEvent.Utils.DayMatchesExactly(ev, dt)) { /// Determine event background color - int alpha = 255; - if (ev.Hidden && _dimDisabledEvents) - alpha = 64; + //int alpha = 255; + //if (ev.Hidden && _dimDisabledEvents) + // alpha = 64; Color alphaColor = Color.FromArgb(ev.BackColor); /// Determine event text position diff --git a/TBF/UI/MainWnd.cs b/TBF/UI/MainWnd.cs index db40fffff..3778f189d 100644 --- a/TBF/UI/MainWnd.cs +++ b/TBF/UI/MainWnd.cs @@ -133,7 +133,7 @@ namespace TBF.UI var session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config); cmptnEntities = session.QueryOver().OrderBy(x => x.ItemNr).Asc.List(); } - catch (Exception exc) + catch (Exception) { MessageBox.Show(Strings.Failed_to_load_components, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); cmptnEntities = new List();