C2xStartScenario
Open topic with navigation CAPL Functions » Car2x » C2xStartScenario Valid for: CANoe DEFunction Syntax
long C2xStartScenario(); // form 1long C2xStartScenario(char* stationName, double latitude, double longitude, double heading); // form 2
Description
Form 1 This function starts the scenario assigned to the current CANoe DE product configuration immediately. The scenario can also be started manually in Scenario Manager Window. In both cases, the successful scenario start will be indicated by OnScenarioStart() callback function. Form 2 Starts the current scenario at specified geographical position (latitude, longitude) in specified direction (heading parameter). The original scenario will be transformed in the following way before the scenario starts:- All routes and stations in the scenario will be moved to a new geographical position in a way that the position of the scenario station specified by
stationNameparameter is equal to geographical position specified inlatitudeandlongitudeparameters. - All routes and stations in the scenario will be rotated around the geographical position specified in
latitudeandlongitudeparameters until the route of the scenario station specified bystationNamehave the same direction as specified in theheadingparameter.
Parameters
- stationName (form 2): Name of the scenario station.
- latitude (form 2): Actual geographical latitude of the station.
- longitude (form 2): Actual geographical longitude of the station.
- heading (form 2): Actual heading of the station relative to the north.
Return Values
- 1: Success
- -1: Error, scenario start was not successful.
- -2: Error, invalid or out of range parameter specified.