chenqinghong
2024-05-07 3ec06a830367465068963156dcc1d8e522571c13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Quintiq file version 2.0
#parent: #root
Method PTF_ExecuteAction () id:Method_LibPTF_pnlTestRunner_PTF_ExecuteAction
{
  #keys: '[105690.0.203956224]'
  Body:
  [*
    // Determines the status of an executing action and run through the script
    curraction       := this.PTF_GetCurrentAction();
    action           := '';
    mintimerinterval := this.PTF_GetMinTimerInterval();
    
    if( curraction = '' )
    {
      this.PTF_EndExecution();
    
      if( vhAutoClose.Value() = 'true' )
      {
        this.PTF_WriteLogForStartEndClient( true );
        this.Application().Close();
      }
    }
    else
    {
      parameters := construct( Strings );
      action     := this.PTF_GetActionAndParameters( curraction, &parameters );
    
      if( not action = LibPTF_StandardAction::Wait() )
      {
        gtPTF.Interval( mintimerinterval );
      }
    
      if( action = LibPTF_StandardAction::Wait() )
      {
        this.PTF_SetCurrentAction();
    
        targetdelayinsecond := 0.0;
        if( parameters.Size() = 1 )
        {
          targetdelayinsecond := [Real]parameters.Element( 0 );
        }
        else
        {
          targetdelayinsecond := Real::Random( [Real]parameters.Element( 0 ), [Real]parameters.Element( 1 ) );
        }
    
        targetdelayinmillis := [Number]( targetdelayinsecond * 1000 ) ;
    
        // Set next action to be executed from the script
        this.PTF_SetNextAction();
    
        this.PTF_DebugInfoAction( action, [String]targetdelayinmillis );
        if ( targetdelayinmillis <= mintimerinterval )
        {
          gtPTF.Interval( mintimerinterval );
        }
        else
        {
          gtPTF.Interval( targetdelayinmillis );
        }
      }
      else if( not chkLoggedStartMarker.Checked() )
      {
        this.PTF_SetCurrentAction();
    
        this.vhLogStart().Value( this.PTF_GetCurrentDatetime()
                                          + '|' + [String]OS::PrecisionCounter()
                                                   );
        chkLoggedStartMarker.Checked( true );
      }
      else if( not chkActionDone.Checked() )
      {
        this.PTF_DoAction( curraction );
        chkActionDone.Checked( true );
      }
      else
      {
        this.PTF_WriteLogForAction( curraction );
    
        this.PTF_SetNextAction();
    
        chkLoggedStartMarker.Checked( false );
        chkActionDone.Checked( false );
      }
    }
  *]
}