stateDiagram

%% Initial state name as "." so that it fits in black circle shape.
%% See https://github.com/StateSmith/StateSmith/issues/404
state "." as ROOT.(InitialState)

PowerPoint1

PowerPoint1 : PowerPoint1

PowerPoint1 : enter / #123; ResetPowerCalibration()#59; #125;

PowerPoint1 : exit / #123; RecordPowerDataPoint()#59; #125;

PowerPoint2

PowerPoint2 : PowerPoint2

PowerPoint2 : enter / #123; StartPowerPoint()#59; #125;

PowerPoint2 : exit / #123; RecordPowerDataPoint()#59; #125;

PowerPoint3

PowerPoint3 : PowerPoint3

PowerPoint3 : enter / #123; StartPowerPoint()#59; #125;

PowerPoint3 : exit / #123; RecordPowerDataPoint()#59; #125;

PowerComplete

PowerComplete : PowerComplete

PowerComplete : enter / #123; CalculatePowerCurveFit()#59; #125;

PowerComplete : exit / #123;  #125;

SSBPoint

SSBPoint : SSBPoint

SSBPoint : enter / #123; StartSSBPoint()#59; #125;

SSBPoint : exit / #123; RecordPowerDataPoint()#59; #125;

MeasurementComplete

MeasurementComplete : MeasurementComplete

MeasurementComplete : enter / #123; CalculateSSBPoint()#59; #125;

MeasurementComplete : exit / #123;  #125;

ACQUISITION

ACQUISITION : ACQUISITION

ACQUISITION : enter / #123; count_ms = 0#59; #125;

ACQUISITION : 1. do / #123; count_ms++#59; #125;

READ_AND_ADJUST

READ_AND_ADJUST : READ_AND_ADJUST

READ_AND_ADJUST : enter / #123; AdjustAttenuation()#59; #125;

ROOT.(InitialState) --> PowerPoint1

PowerPoint1 --> PowerPoint2 : RECORD_DATA_POINT

PowerPoint1 --> ACQUISITION : AUTO

PowerPoint2 --> PowerPoint3 : RECORD_DATA_POINT

PowerPoint2 --> PowerPoint1 : RESET

PowerPoint3 --> PowerComplete : RECORD_DATA_POINT

PowerPoint3 --> PowerPoint1 : RESET

PowerComplete --> SSBPoint : CURVE_COMPLETE

PowerComplete --> PowerPoint1 : RESET

SSBPoint --> MeasurementComplete : RECORD_DATA_POINT

SSBPoint --> PowerPoint1 : RESET

MeasurementComplete --> PowerPoint1 : RESET

ACQUISITION --> READ_AND_ADJUST : do [count_ms >= acquisitionDuration_ms]

READ_AND_ADJUST --> ACQUISITION : NEXT_POINT

READ_AND_ADJUST --> SSBPoint : CURVE_COMPLETE