Class TcoStateBase
Provides basic state controller. It could be implemented using IF
, IF
ELSIF
or CASE
statement. The transition to the different state needs to be perfromed by calling
method. This method ensures also calling the OnStateChange(Object, Object) every time that state is changed. The
OnStateChange()
could be overloaded and some custom code that needs to be executed on each change of the state could be placed here. The TcoState could be used like this:
Example 1
_myTask()
is not a member of this TcoState()
, it is restored manually to be able to trigger it in the next state.
IF State = 10 THEN
Main._myTask.Invoke();
Main._myTask.Execute();
IF Main._myTask.Done THEN
ChangeState(State + 10);
Main._myTask.Restore();
END_IF
END_IF
IF State = 20 THEN
Main._myTask.Invoke();
Main._myTask.Execute();
IF Main._myTask.Done THEN
ChangeState(State + 10);
Main._myTask.Restore();
END_IF
END_IF
Example 2
_myTask()
is a member of this TcoState()
, it is restored manually using the fluent syntax to be able to trigger it in the next state.
CASE State OF
10:
_myTask.Invoke();
_myTask.Execute();
IF _myTask.Done THEN
ChangeState(State + 10).RestoreObject(_myTask);
END_IF
20:
_myTask.Invoke();
_myTask.Execute();
IF _myTask.Done THEN
ChangeState(State + 10).RestoreObject(_myTask);
END_IF
END_CASE
See for more details.
Inheritance
System.Object
TcoStateBase
Implements
Vortex.Connector.Identity.IVortexIdentity
Vortex.Connector.IVortexObject
Vortex.Connector.ITwinObject
Vortex.Connector.IVortexElement
Vortex.Connector.IVortexOnlineObject
Vortex.Connector.IVortexShadowObject
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: TcoCoreConnector.dll
Syntax
[TypeMetaDescriptor("{attribute addProperty Name \"\" }", "TcoStateBase", "TcoCore", TypeComplexityEnum.Complex)]
public class TcoStateBase : TcoObject, IVortexIdentity, IsTcoObject, IVortexObject, ITwinObject, IVortexElement, ITcoStateBase, ITcoObject, IShadowTcoStateBase, IShadowTcoObject, IVortexOnlineObject, IVortexShadowObject
Constructors
|
Improve this Doc
View Source
TcoStateBase()
Declaration
|
Improve this Doc
View Source
TcoStateBase(IVortexObject, String, String)
Declaration
public TcoStateBase(IVortexObject parent, string readableTail, string symbolTail)
Parameters
Type |
Name |
Description |
Vortex.Connector.IVortexObject |
parent |
|
System.String |
readableTail |
|
System.String |
symbolTail |
|
Fields
|
Improve this Doc
View Source
__State
Declaration
Field Value
Type |
Description |
Vortex.Connector.ValueTypes.OnlinerInt |
|
Properties
|
Improve this Doc
View Source
_State
Declaration
[ReadOnly]
public OnlinerInt _State { get; }
Property Value
Type |
Description |
Vortex.Connector.ValueTypes.OnlinerInt |
|
Methods
|
Improve this Doc
View Source
CopyPlainToShadow(PlainTcoStateBase)
Declaration
public void CopyPlainToShadow(PlainTcoStateBase source)
Parameters
|
Improve this Doc
View Source
CreatePlainerType()
Declaration
public PlainTcoStateBase CreatePlainerType()
Returns
|
Improve this Doc
View Source
CreatePlainerType(PlainTcoStateBase)
Declaration
protected PlainTcoStateBase CreatePlainerType(PlainTcoStateBase cloned)
Parameters
Returns
|
Improve this Doc
View Source
FlushOnlineToPlain(PlainTcoStateBase)
Declaration
public void FlushOnlineToPlain(PlainTcoStateBase source)
Parameters
|
Improve this Doc
View Source
FlushOnlineToShadow()
Declaration
public void FlushOnlineToShadow()
|
Improve this Doc
View Source
FlushPlainToOnline(PlainTcoStateBase)
Declaration
public void FlushPlainToOnline(PlainTcoStateBase source)
Parameters
|
Improve this Doc
View Source
FlushShadowToOnline()
Declaration
public void FlushShadowToOnline()
|
Improve this Doc
View Source
LazyOnlineToShadow()
Declaration
public void LazyOnlineToShadow()
|
Improve this Doc
View Source
LazyShadowToOnline()
Declaration
public void LazyShadowToOnline()
|
Improve this Doc
View Source
PexConstructor(IVortexObject, String, String)
Declaration
void PexConstructor(IVortexObject parent, string readableTail, string symbolTail)
Parameters
Type |
Name |
Description |
Vortex.Connector.IVortexObject |
parent |
|
System.String |
readableTail |
|
System.String |
symbolTail |
|
|
Improve this Doc
View Source
PexConstructorParameterless()
Declaration
void PexConstructorParameterless()
|
Improve this Doc
View Source
PexPreConstructor(IVortexObject, String, String)
Declaration
void PexPreConstructor(IVortexObject parent, string readableTail, string symbolTail)
Parameters
Type |
Name |
Description |
Vortex.Connector.IVortexObject |
parent |
|
System.String |
readableTail |
|
System.String |
symbolTail |
|
|
Improve this Doc
View Source
PexPreConstructorParameterless()
Declaration
void PexPreConstructorParameterless()
Explicit Interface Implementations
|
Improve this Doc
View Source
IShadowTcoStateBase._State
Declaration
[ReadOnly]
IShadowInt IShadowTcoStateBase._State { get; }
Returns
Type |
Description |
Vortex.Connector.ValueTypes.Shadows.IShadowInt |
|
|
Improve this Doc
View Source
ITcoStateBase._State
Declaration
[ReadOnly]
IOnlineInt ITcoStateBase._State { get; }
Returns
Type |
Description |
Vortex.Connector.ValueTypes.Online.IOnlineInt |
|
Implements
Vortex.Connector.Identity.IVortexIdentity
Vortex.Connector.IVortexObject
Vortex.Connector.ITwinObject
Vortex.Connector.IVortexElement
Vortex.Connector.IVortexOnlineObject
Vortex.Connector.IVortexShadowObject
See Also