/*@!Encoding:1252*/
includes
{
  
}

variables
{
  
}

testcase WaitForInitiating()
{
  Wait(7000);
  testStepPass();
}

testcase StartTaskOnTC()
{
  TCIL_StartTask(TC);
  Wait(2000); // Wait for 2 seconds
  testStepPass();
}

testcase DefineSetpointActivationRate()
{
  TCIL_ValueCommandPhysical(TC, Sprayer, 6/*DDI*/, 2/*elNum*/, 39000/* kg/ha */);
  Wait(2000); // Wait for 2 seconds
  testStepPass();
}

testcase TurnOnSprayer()
{
  VTIL_PressSoftKey(VT, 151/*keyId*/, 500/*duration*/);
  Wait(1000); // Wait for 1 second
  testStepPass();
}

testcase ActivateAdditionalSections()
{
  VTIL_PressSoftKey(VT, 153/*keyId*/, 500/*duration*/);
  Wait(1000); // Wait for 1 second
  VTIL_PressSoftKey(VT, 153/*keyId*/, 500/*duration*/);
  Wait(1000); // Wait for 1 second
  testStepPass();
}

testcase StartMoving()
{
  byte counter;

  $GBSD_TECU::GroundBasedMachineDirection = VtSig_GroundBasedMachineDirection::Forward;
  $GBSD_TECU::GroundBasedMachineSpeed = 1;

  // 6. Slow increase the speed
  for(counter = 0; counter < 4; counter++)
  {
    Wait(500); // Wait for 500 ms
    $GBSD_TECU::GroundBasedMachineSpeed += 2;
    Wait(500); // Wait for 500 ms
  }
  testStepPass();
}

testcase CheckReportedFlowRate()
{
  double curFlowRate;

  TCIL_GetValuePhysical(TC, Sprayer, 37/*DDI*/, 4/*elNum*/, curFlowRate);
  if(curFlowRate < 62 || curFlowRate > 65)
  {
    testStepFail("CheckReportedFlowRate", "Wrong reported Flow Rate (%f, has to be between 14 and 15)!",  curFlowRate);
    return;
  }
  testStepPass();
}

Wait(int timeToWait)
{
  testWaitForTimeout(timeToWait);
}
