2015-04-15 18:32:56 +00:00
|
|
|
|
///
|
2022-11-02 09:14:30 +00:00
|
|
|
|
/// Copyright (c) 2013-2015 Sensus Slovensko a.s.
|
2015-04-15 18:32:56 +00:00
|
|
|
|
///
|
|
|
|
|
|
using System;
|
2014-07-28 07:54:35 +00:00
|
|
|
|
|
2021-10-26 09:23:57 +00:00
|
|
|
|
namespace TBF.Rig
|
2014-07-28 07:54:35 +00:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// This interface has to be implemented by each 'operation'. 'operations' are classes
|
2021-10-26 09:23:57 +00:00
|
|
|
|
/// in TBF.Rig name space with a class name ending with 'Op' (e.g. TimerOp).
|
2014-07-28 07:54:35 +00:00
|
|
|
|
/// This class name rule is a convention, not a requirement.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public interface IOperation
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Method is called when a state machine enters a state in which this operation
|
|
|
|
|
|
/// takes place/ will be executed.
|
|
|
|
|
|
/// Method is not called when this operation took place also in the previous state.
|
|
|
|
|
|
/// StateMachine checks whether Start() should be called depending on the previous
|
|
|
|
|
|
/// and the current state.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>true on success</returns>
|
|
|
|
|
|
void Start();
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Method is called in regular time intervals when state machine is
|
|
|
|
|
|
/// in a state in which this operation takes place.
|
|
|
|
|
|
/// During operation the IOparation derived object may issue events,
|
|
|
|
|
|
/// that means Run() method returns a value different from Event.Void (=0).
|
|
|
|
|
|
/// Examples: Timer expired
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
Event Run();
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Method is called when the state machine leaves a state in which
|
|
|
|
|
|
/// this operation takes place / was executed.
|
|
|
|
|
|
/// Method is not called when this operation takes place also in the next state.
|
|
|
|
|
|
/// StateMachine checks whether Start() should be called depending on the previous
|
|
|
|
|
|
/// and the current state.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
void Stop();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|