OTX-Runtime for C++  
OpenTestSystem::Otx::Runtime::Api::IRuntimeManager Class Referenceabstract

Main class to load and execute an OTX project More...

#include <IRuntimeManager.h>

Public Member Functions

virtual bool AddDiagConnectionStateChangedListener (std::shared_ptr< std::function< void(ClampState batteryState, ClampState ignitionState)>> listener)=0
 Adds diagnostic connection state changed listener. More...
 
virtual bool AddInOutParameterValueChangedListener (std::shared_ptr< std::function< void(const IRuntimeContext &, const IProcedureInOutParameter &)>> listener)=0
 Adds ProcedureInOutParameter value changed listener. More...
 
virtual bool AddProcedureAbortedListener (std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
 Adds procedure aborted listener. More...
 
virtual bool AddProcedureContinuedListener (std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
 Adds procedure continued listener. More...
 
virtual bool AddProcedureFinishedListener (std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
 Adds procedure finished listener. More...
 
virtual bool AddProcedurePausedListener (std::shared_ptr< std::function< void(const IRuntimeContext &, ExecutionStateChangeReason)>> listener)=0
 Adds procedure paused listener. More...
 
virtual bool AddProcedurePendingListener (std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
 Adds procedure pending listener. More...
 
virtual bool AddProcedureStartedListener (std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
 Adds procedure started listener. More...
 
virtual bool AddProcedureStoppedListener (std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
 Adds procedure stopped listener. More...
 
virtual bool AddProcedureTimeoutListener (std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
 Adds procedure timeout listener. More...
 
virtual std::shared_ptr< IRuntimeContextExecute (const std::string &name, std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure > procedure, ExpectedState expectedConnectionState, unsigned long long timeout=0)=0
 Executes a procedure synchronously at an expected connection state. More...
 
virtual std::shared_ptr< IRuntimeContextExecute (const std::string &name, std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure > procedure, unsigned long long timeout=0)=0
 Executes a procedure synchronously. More...
 
virtual std::shared_ptr< IRuntimeContextExecute (std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure > procedure, unsigned long long timeout=0)=0
 Executes a procedure synchronously. More...
 
virtual std::shared_ptr< IRuntimeContextExecuteAsync (const std::string &name, std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure > procedure, ExpectedState expectedConnectionState, unsigned long long timeout=0)=0
 Executes a procedure asynchronously at an expected connection state. More...
 
virtual std::shared_ptr< IRuntimeContextExecuteAsync (const std::string &name, std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure > procedure, unsigned long long timeout=0)=0
 Executes a procedure asynchronously. More...
 
virtual std::shared_ptr< IRuntimeContextExecuteAsync (std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure > procedure, unsigned long long timeout=0)=0
 Executes a procedure asynchronously. More...
 
virtual std::shared_ptr< DiagConnectionStateGetDiagConnectionState ()=0
 Get the diagnostic connection state. More...
 
virtual std::string GetSearchPath ()=0
 Gets search path. More...
 
virtual bool IsProtected (const std::string &fileName)=0
 Checks if a PTX/PPX is signed and/or encrypted. More...
 
virtual std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Project::IPlayerProjectLoadPpx (const std::string &fileName)=0
 Loads a PPX file. More...
 
virtual std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Project::IPlayerProjectLoadPpx (const std::string &fileName, const std::string &password)=0
 Loads a protected PPX file. More...
 
virtual std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Project::IProjectLoadPtx (const std::string &fileName)=0
 Loads a PTX file. More...
 
virtual std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Project::IProjectLoadPtx (const std::string &fileName, const std::string &password)=0
 Loads a protected PTX file. More...
 
virtual bool RemoveDiagConnectionStateChangedListener (std::shared_ptr< std::function< void(ClampState batteryState, ClampState ignitionState)>> listener)=0
 Removes diagnostic connection state changed listener. More...
 
virtual bool RemoveInOutParameterValueChangedListener (std::shared_ptr< std::function< void(const IRuntimeContext &, const IProcedureInOutParameter &)>> listener)=0
 Removes ProcedureInOutParameter value changed listener. More...
 
virtual bool RemoveProcedureAbortedListener (std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
 Removes procedure aborted listener. More...
 
virtual bool RemoveProcedureContinuedListener (std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
 Removes procedure continued listener. More...
 
virtual bool RemoveProcedureFinishedListener (std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
 Removes procedure finished listener. More...
 
virtual bool RemoveProcedurePausedListener (std::shared_ptr< std::function< void(const IRuntimeContext &, ExecutionStateChangeReason)>> listener)=0
 Removes procedure paused listener. More...
 
virtual bool RemoveProcedurePendingListener (std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
 Removes procedure pending listener. More...
 
virtual bool RemoveProcedureStartedListener (std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
 Removes procedure started listener. More...
 
virtual bool RemoveProcedureStoppedListener (std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
 Removes procedure stopped listener. More...
 
virtual bool RemoveProcedureTimeoutListener (std::shared_ptr< std::function< void(const IRuntimeContext &)>> listener)=0
 Adds procedure timeout listener. More...
 
virtual void SetCustomImplementation (std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::IBasicScreenImplementation > implementation)=0
 Sets BasicScreenImplementation. More...
 
virtual void SetCustomImplementation (std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::ICommonDialogsImplementation > implementation)=0
 Sets ICommonDialogsImplementation. More...
 
virtual void SetCustomImplementation (std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::IContextVariableImplementation > implementation)=0
 Sets IContextVariableImplementation. More...
 
virtual void SetCustomImplementation (std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::ICustomScreenImplementation > implementation)=0
 Sets ICustomScreenImplementation. More...
 
virtual void SetCustomImplementation (std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::IExternalServiceProviderImplementation > implementation)=0
 Sets IExternalServiceProviderImplementation. More...
 
virtual void SetCustomImplementation (std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::Ii18nImplementation > implementation)=0
 Sets Ii18nImplementation. More...
 
virtual void SetCustomImplementation (std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::ILoggingImplementation > implementation)=0
 Sets ILoggingImplementation. More...
 
virtual void SetCustomImplementation (std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::IMeasureImplementation > implementation)=0
 Sets IMeasureImplementation. More...
 
virtual void SetCustomImplementation (std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::ISqlImplementation > implementation)=0
 Sets ISqlImplementation. More...
 
virtual void SetCustomImplementation (std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::IStateVariableImplementation > implementation)=0
 Sets IStateVariableImplementation. More...
 
virtual bool SetSearchPath (const std::string &path)=0
 Sets search path. More...
 
virtual void StopAll ()=0
 Stops all synchronous and asynchronous executing procedures of this RuntimeManager. More...
 

Detailed Description

Main class to load and execute an OTX project

Member Function Documentation

◆ AddDiagConnectionStateChangedListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::AddDiagConnectionStateChangedListener ( std::shared_ptr< std::function< void(ClampState batteryState, ClampState ignitionState)>>  listener)
pure virtual

Adds diagnostic connection state changed listener.

Parameters
listenerA callback function which will be invoked when a diagnostic connection state changed.

◆ AddInOutParameterValueChangedListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::AddInOutParameterValueChangedListener ( std::shared_ptr< std::function< void(const IRuntimeContext &, const IProcedureInOutParameter &)>>  listener)
pure virtual

Adds ProcedureInOutParameter value changed listener.

Parameters
listenerA callback function which will be invoked when ProcedureInOutParameter value changed from Otx-Runtime.

◆ AddProcedureAbortedListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::AddProcedureAbortedListener ( std::shared_ptr< std::function< void(const IRuntimeContext &)>>  listener)
pure virtual

Adds procedure aborted listener.

Parameters
listenerA callback function which will be invoked when a Procedure is stopped with an exception.

◆ AddProcedureContinuedListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::AddProcedureContinuedListener ( std::shared_ptr< std::function< void(const IRuntimeContext &)>>  listener)
pure virtual

Adds procedure continued listener.

Parameters
listenerA callback function which will be invoked after a Procedure is continued.

◆ AddProcedureFinishedListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::AddProcedureFinishedListener ( std::shared_ptr< std::function< void(const IRuntimeContext &)>>  listener)
pure virtual

Adds procedure finished listener.

Parameters
listenerA callback function which will be invoked when a procedure finished without exception.

◆ AddProcedurePausedListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::AddProcedurePausedListener ( std::shared_ptr< std::function< void(const IRuntimeContext &, ExecutionStateChangeReason)>>  listener)
pure virtual

Adds procedure paused listener.

Parameters
listenerA callback function which will be invoked before a Procedure is paused.

◆ AddProcedurePendingListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::AddProcedurePendingListener ( std::shared_ptr< std::function< void(const IRuntimeContext &)>>  listener)
pure virtual

Adds procedure pending listener.

Parameters
listenerA callback function which will be invoked after a Procedure is executed but the Procedure is not really started.

◆ AddProcedureStartedListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::AddProcedureStartedListener ( std::shared_ptr< std::function< void(const IRuntimeContext &)>>  listener)
pure virtual

Adds procedure started listener.

Parameters
listenerA callback function which will be invoked when a procedure started.

◆ AddProcedureStoppedListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::AddProcedureStoppedListener ( std::shared_ptr< std::function< void(const IRuntimeContext &)>>  listener)
pure virtual

Adds procedure stopped listener.

Parameters
listenerA callback function which will be invoked when a procedure stopped.

◆ AddProcedureTimeoutListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::AddProcedureTimeoutListener ( std::shared_ptr< std::function< void(const IRuntimeContext &)>>  listener)
pure virtual

Adds procedure timeout listener.

Parameters
listenerA callback function which will be invoked when a timeout expires.

◆ Execute() [1/3]

virtual std::shared_ptr<IRuntimeContext> OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::Execute ( const std::string &  name,
std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure procedure,
ExpectedState  expectedConnectionState,
unsigned long long  timeout = 0 
)
pure virtual

Executes a procedure synchronously at an expected connection state.

Parameters
nameOptional name of the RuntimeContext. The name will be used for example to better distinguish the different clients inside the trace file.
procedureProcedure to execute.
expectedConnectionStateThe expected connection state during the procedure execution:
  • None, the procedure will be executed normally without connection state handling
  • BatteryOn, the procedure is only started if the battery voltage is ON. The ignition state will be ignored (KL30 = On). The execution will be paused, as long as the battery voltage is not ON.
  • IgnitionOff, the procedure is only started if the battery voltage is ON and the ignition is OFF (KL30 = On AND (KL15 = Off OR KL15 = NotAvailable)). The execution will be paused, as long as the battery voltage is not ON or the ignition is ON.
  • IgnitionOn, the procedure is only started if the battery voltage is ON and the ignition is ON (KL30 = On AND KL15 = On). The execution will be paused, as long as the battery voltage is not ON or the ignition is not ON.
timeoutThe procedure execution will be stopped when the timeout expires.
Returns
The RuntimeContext of the procedure execution.
Exceptions
Exceptions.ConnectionStateExceptionThrows a ConnectionStateException if the expected state is greater BatteryOn, and the battery state is higher than BatteryOff and the ignition state cannot be determined by the underlying system.

◆ Execute() [2/3]

virtual std::shared_ptr<IRuntimeContext> OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::Execute ( const std::string &  name,
std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure procedure,
unsigned long long  timeout = 0 
)
pure virtual

Executes a procedure synchronously.

Parameters
nameOptional name of the RuntimeContext. The name will be used for example to better distinguish the different OTX runners and/or clients of DiagManager inside the trace files. For the DiagManager the method SetClientName will be called internally.
procedureProcedure to execute.
timeoutThe procedure execution will be stopped when the timeout expires.
Returns
The RuntimeContext of the procedure execution.

Examples

1 #include "RuntimeManagerFactory.h"
2 #include "IRuntimeContext"
3 using namespace OpenTestSystem.Otx.Runtime.Api;
4 #include "Project/IProject.h";
5 #include "Otx/IProcedure.h"
6 #include "Otx/IProcedureParameter.h"
7 #include "Otx/IProcedureInParameter.h"
8 using namespace OpenTestSystem.Otx.Runtime.Api.Otx;
9 #include <memory>
10 using namespace std;
11 void main()
12 {
13  shared_ptr<IRuntimeManager> rt = RuntimeManagerFactory::CreateRawRuntimeManager();
14  shared_ptr<IProject> project = rt->LoadPtx("C:\\Sample.ptx");
15  shared_ptr<IProcedure> procedure = project->GetMainProcedure();
16  if (procedure->GetParameters().size() > 0)
17  {
18  shared_ptr<IProcedureParameter> parameter = procedure->GetParameters().at[0]
19  if (parameter.GetDataType() == "String" && dynamic_pointer_cast<IProcedureInParameter>(parameter) != nullptr)
20  {
21  dynamic_pointer_cast<IProcedureInParameter>(parameter)->SetValue("Hello World");
22  }
23  }
24 
25  shared_ptr<IRuntimeContext> context = rt->Execute(procedure);
26  if (context->IsFinished())
27  {
28  //Procedure finished without Exception.
29  }
30  else if (context->HasRuntimeException())
31  {
32  //Procedure was terminated an Runtime Exception.
33  }
34 }
static std::shared_ptr< IRuntimeManager > CreateRawRuntimeManager()
Creates RawRuntimeManager without DiagManager.
Namespace for browsing at OTX data structure.
Definition: IRuntimeContext.h:12
Namespace containing the programming interface for browsing and execution of OTX procedures in own ap...
Definition: ClampState.h:7
Namespace containing all objects for browsing and execution of OTX procedures
Definition: ClampState.h:6
Namespace containing all objects which are standardized according to ISO 13209 (OTX)
Namespace containing all objects related to testing inside automotive industry

◆ Execute() [3/3]

virtual std::shared_ptr<IRuntimeContext> OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::Execute ( std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure procedure,
unsigned long long  timeout = 0 
)
pure virtual

Executes a procedure synchronously.

Parameters
procedureProcedure to execute.
timeoutThe procedure execution will be stopped when the timeout expires.
Returns
The RuntimeContext of the procedure execution.

Examples

1 #include "RuntimeManagerFactory.h"
2 #include "IRuntimeContext"
3 using namespace OpenTestSystem.Otx.Runtime.Api;
4 #include "Project/IProject.h";
5 #include "Otx/IProcedure.h"
6 #include "Otx/IProcedureParameter.h"
7 #include "Otx/IProcedureInParameter.h"
8 using namespace OpenTestSystem.Otx.Runtime.Api.Otx;
9 #include <memory>
10 using namespace std;
11 void main()
12 {
13  shared_ptr<IRuntimeManager> rt = RuntimeManagerFactory::CreateRawRuntimeManager();
14  shared_ptr<IProject> project = rt->LoadPtx("C:\\Sample.ptx");
15  shared_ptr<IProcedure> procedure = project->GetMainProcedure();
16  if (procedure->GetParameters().size() > 0)
17  {
18  shared_ptr<IProcedureParameter> parameter = procedure->GetParameters().at[0]
19  if (parameter.GetDataType() == "String" && dynamic_pointer_cast<IProcedureInParameter>(parameter) != nullptr)
20  {
21  dynamic_pointer_cast<IProcedureInParameter>(parameter)->SetValue("Hello World");
22  }
23  }
24 
25  shared_ptr<IRuntimeContext> context = rt->Execute(procedure);
26  if (context->IsFinished())
27  {
28  //Procedure finished without Exception.
29  }
30  else if (context->HasRuntimeException())
31  {
32  //Procedure was terminated an Runtime Exception.
33  }
34 }

◆ ExecuteAsync() [1/3]

virtual std::shared_ptr<IRuntimeContext> OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::ExecuteAsync ( const std::string &  name,
std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure procedure,
ExpectedState  expectedConnectionState,
unsigned long long  timeout = 0 
)
pure virtual

Executes a procedure asynchronously at an expected connection state.

Parameters
nameOptional name of the RuntimeContext. The name will be used for example to better distinguish the different clients inside the trace file.
procedureProcedure to execute.
expectedConnectionStateThe expected connection state during the procedure execution:
  • None, the procedure will be executed normally without connection state handling
  • BatteryOn, the procedure is only started if the battery voltage is ON. The ignition state will be ignored (KL30 = On). The execution will be paused, as long as the battery voltage is not ON.
  • IgnitionOff, the procedure is only started if the battery voltage is ON and the ignition is OFF (KL30 = On AND (KL15 = Off OR KL15 = NotAvailable)). The execution will be paused, as long as the battery voltage is not ON or the ignition is ON.
  • IgnitionOn, the procedure is only started if the battery voltage is ON and the ignition is ON (KL30 = On AND KL15 = On). The execution will be paused, as long as the battery voltage is not ON or the ignition is not ON.
timeoutThe procedure execution will be stopped when the timeout expires.
Returns
The RuntimeContext of the procedure execution.
Exceptions
Exceptions.ConnectionStateExceptionThrows a ConnectionStateException if the expected state is greater BatteryOn, and the battery state is higher than BatteryOff and the ignition state cannot be determined by the underlying system.

◆ ExecuteAsync() [2/3]

virtual std::shared_ptr<IRuntimeContext> OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::ExecuteAsync ( const std::string &  name,
std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure procedure,
unsigned long long  timeout = 0 
)
pure virtual

Executes a procedure asynchronously.

Parameters
nameOptional name of the RuntimeContext. The name will be used for example to better distinguish the different OTX runners and/or clients of DiagManager inside the trace files. For the DiagManager the method SetClientName will be called internally.
procedureProcedure to execute.
timeoutThe procedure execution will be stopped when the timeout expires.
Returns
The RuntimeContext of the procedure execution.

◆ ExecuteAsync() [3/3]

virtual std::shared_ptr<IRuntimeContext> OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::ExecuteAsync ( std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure procedure,
unsigned long long  timeout = 0 
)
pure virtual

Executes a procedure asynchronously.

Parameters
procedureProcedure to execute.
timeoutThe procedure execution will be stopped when the timeout expires.
Returns
The RuntimeContext of the procedure execution.

◆ GetDiagConnectionState()

virtual std::shared_ptr<DiagConnectionState> OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::GetDiagConnectionState ( )
pure virtual

Get the diagnostic connection state.

◆ GetSearchPath()

virtual std::string OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::GetSearchPath ( )
pure virtual

Gets search path.

Returns
Base directory.

◆ IsProtected()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::IsProtected ( const std::string &  fileName)
pure virtual

Checks if a PTX/PPX is signed and/or encrypted.

Parameters
fileNamePath of PTX/PPX file to check.
Returns
True if the PTX/PPX file is signed or encrypted; otherwise false.

Examples

1 #include "RuntimeManagerFactory.h"
3 #include <memory>
4 using std;
5 void main()
6 {
7  shared_ptr<IRuntimeManager> rt = RuntimeManagerFactory::CreateRawRuntimeManager();
8  if(rt->IsProtected("C:\\Sample.ptx"))
9  {
10  rt->LoadPtx("C:\\Sample.ptx", "MyPassword");
11  }
12  else
13  {
14  rt->LoadPtx("C:\\Sample.ptx");
15  }
16 }

◆ LoadPpx() [1/2]

virtual std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Project::IPlayerProject> OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::LoadPpx ( const std::string &  fileName)
pure virtual

Loads a PPX file.

The OTX-Runtime cannot compile OTX to binary format. Therefore the PTX file must contain the OTX binary format, which can be created inside the OTX Development Environment. Otherwise the project cannot be loaded.

Parameters
fileNamePath of PPX file to load.
Returns
A IPlayerProject which exposes Projects, Packages, Documents, Parameters, etc.
Exceptions
OpenTestSystem::Otx::Runtime::Api::Exceptions::FileNotFoundExceptionThrown when the given file cannot be found.
OpenTestSystem::Otx::Runtime::Api::Exceptions::FileFormatExceptionThrow if PPX's format is invalid
OpenTestSystem::Otx::Runtime::Api::Exceptions::ExceptionThrown when loading protected PPX file without password or wrong password

Examples
A sample which loads a PPX file and browses its structure.

1 #include "RuntimeManagerFactory.h"
3 #include "Project/IProject.h";
4 #include "Project/IPlayerProject.h";
5 #include "Otx/IPackage.h"
6 #include "Otx/IDocument.h"
7 #include "Otx/IProcedure.h"
8 #include "Otx/IProcedureParameter.h"
9 #include "Otx/IProcedureInParameter.h"
11 #include <vector>
12 #include <memory>
13 using namespace std;
14 void main()
15 {
16  shared_ptr<IRuntimeManager> rt = RuntimeManagerFactory::CreateRawRuntimeManager();
17  shared_ptr<IPlayerProject> player = rt->LoadPpx("C:\\Sample.ppx");
18  for (int i = 0; i < player->GetProjects().size(); i++)
19  {
20  shared_ptr<IProject> project = player->GetProjects().at(i);
21  for (int j = 0; j < project->GetPackages().size(); j++)
22  {
23  shared_ptr<IPackage> package = project->GetPackages().at(j);
24  for (int k = 0; k < package->GetDocuments().size(); k++)
25  {
26  shared_ptr<IDocument> document = package->GetDocuments().at(k);
27  for (int m = 0; m < document->GetProcedures().size(); m++)
28  {
29  shared_ptr<IProcedure> procedure = document->GetProcedures().at(m);
30  for (int n = 0; n < procedure->GetParameters().size(); n++)
31  {
32  shared_ptr<IProcedureParameter> parameter = procedure->GetParameters().at(n);
33  }
34  }
35  }
36  }
37  }
38 }

◆ LoadPpx() [2/2]

virtual std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Project::IPlayerProject> OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::LoadPpx ( const std::string &  fileName,
const std::string &  password 
)
pure virtual

Loads a protected PPX file.

The OTX-Runtime cannot compile OTX to binary format. Therefore the PTX file must contain the OTX binary format, which can be created inside the OTX Development Environment. Otherwise the project cannot be loaded.

Parameters
fileNamePath of PPX file to load.
passwordPassword to decrypt the PPX file.
Returns
A IPlayerProject which exposes Projects, Packages, Documents, Parameters, etc.
Exceptions
OpenTestSystem::Otx::Runtime::Api::Exceptions::FileNotFoundExceptionThrown when the given file cannot be found.
OpenTestSystem::Otx::Runtime::Api::Exceptions::FileFormatExceptionThrow if PPX's format is invalid
OpenTestSystem::Otx::Runtime::Api::Exceptions::ExceptionThrown when loading protected PPX file without password or wrong password

◆ LoadPtx() [1/2]

virtual std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Project::IProject> OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::LoadPtx ( const std::string &  fileName)
pure virtual

Loads a PTX file.

The OTX-Runtime cannot compile OTX to binary format. Therefore the PTX file must contain the OTX binary format, which can be created inside the OTX Development Environment. Otherwise the project cannot be loaded.

Parameters
fileNamePath of PTX file to load.
Returns
A IProject which exposes Packages, Documents, Parameters, etc.
Exceptions
OpenTestSystem::Otx::Runtime::Api::Exceptions::FileNotFoundExceptionThrown when the given file cannot be found.
OpenTestSystem::Otx::Runtime::Api::Exceptions::FileFormatExceptionThrow if PTX's format is invalid or PTX version is older than required or Runtime version is older than PTX's required RuntimeVersion
OpenTestSystem::Otx::Runtime::Api::Exceptions::ExceptionThrown when loading protected PTX file without password or wrong password

Examples
A sample which loads a PTX file and browses its structure.

1 #include "RuntimeManagerFactory.h"
3 #include "Project/IProject.h";
4 #include "Otx/IPackage.h"
5 #include "Otx/IDocument.h"
6 #include "Otx/IProcedure.h"
7 #include "Otx/IProcedureParameter.h"
8 #include "Otx/IProcedureInParameter.h"
10 #include <vector>
11 #include <memory>
12 using namespace std;
13 void main()
14 {
15  shared_ptr<IRuntimeManager> rt = RuntimeManagerFactory::CreateRawRuntimeManager();
16  shared_ptr<IProject> project = rt->LoadPtx("C:\\Sample.ptx");
17  for (int i = 0; i < project->GetPackages().size(); i++)
18  {
19  shared_ptr<IPackage> package = project->GetPackages().at(i);
20  for (int j = 0; j < package->GetDocuments().size(); j++)
21  {
22  shared_ptr<IDocument> document = package->GetDocuments().at(j);
23  for (int k = 0; k < document->GetProcedures().size(); k++)
24  {
25  shared_ptr<IProcedure> procedure = document->GetProcedures().at(k);
26  for (int m = 0; m < procedure->GetParameters().size(); m++)
27  {
28  shared_ptr<IProcedureParameter> parameter = procedure->GetParameters().at(m);
29  }
30  }
31  }
32  }
33 }

◆ LoadPtx() [2/2]

virtual std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Project::IProject> OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::LoadPtx ( const std::string &  fileName,
const std::string &  password 
)
pure virtual

Loads a protected PTX file.

The OTX-Runtime cannot compile OTX to binary format. Therefore the PTX file must contain the OTX binary format, which can be created inside the OTX Development Environment. Otherwise the project cannot be loaded.

Parameters
fileNamePath of PTX file to load.
passwordPassword to decrypt the PTX file.
Returns
A IProject which exposes Packages, Documents, Parameters, etc.
Exceptions
OpenTestSystem::Otx::Runtime::Api::Exceptions::FileNotFoundExceptionThrown when the given file cannot be found.
OpenTestSystem::Otx::Runtime::Api::Exceptions::FileFormatExceptionThrow if PTX's format is invalid or PTX version is older than required or Runtime version is older than PTX's required RuntimeVersion
OpenTestSystem::Otx::Runtime::Api::Exceptions::ExceptionThrown when loading protected PTX file without password or wrong password

◆ RemoveDiagConnectionStateChangedListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::RemoveDiagConnectionStateChangedListener ( std::shared_ptr< std::function< void(ClampState batteryState, ClampState ignitionState)>>  listener)
pure virtual

Removes diagnostic connection state changed listener.

Parameters
listenerA callback function which will be invoked when a diagnostic connection state changed.

◆ RemoveInOutParameterValueChangedListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::RemoveInOutParameterValueChangedListener ( std::shared_ptr< std::function< void(const IRuntimeContext &, const IProcedureInOutParameter &)>>  listener)
pure virtual

Removes ProcedureInOutParameter value changed listener.

Parameters
listenerA callback function which will be invoked when ProcedureInOutParameter value changed from Otx-Runtime.

◆ RemoveProcedureAbortedListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::RemoveProcedureAbortedListener ( std::shared_ptr< std::function< void(const IRuntimeContext &)>>  listener)
pure virtual

Removes procedure aborted listener.

Parameters
listenerA callback function which will be invoked when a Procedure is stopped with an exception.

◆ RemoveProcedureContinuedListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::RemoveProcedureContinuedListener ( std::shared_ptr< std::function< void(const IRuntimeContext &)>>  listener)
pure virtual

Removes procedure continued listener.

Parameters
listenerA callback function which will be invoked after a Procedure is continued.

◆ RemoveProcedureFinishedListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::RemoveProcedureFinishedListener ( std::shared_ptr< std::function< void(const IRuntimeContext &)>>  listener)
pure virtual

Removes procedure finished listener.

Parameters
listenerA callback function which will be invoked when a procedure finished without exception.

◆ RemoveProcedurePausedListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::RemoveProcedurePausedListener ( std::shared_ptr< std::function< void(const IRuntimeContext &, ExecutionStateChangeReason)>>  listener)
pure virtual

Removes procedure paused listener.

Parameters
listenerA callback function which will be invoked before a Procedure is paused.

◆ RemoveProcedurePendingListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::RemoveProcedurePendingListener ( std::shared_ptr< std::function< void(const IRuntimeContext &)>>  listener)
pure virtual

Removes procedure pending listener.

Parameters
listenerA callback function which will be invoked after a Procedure is executed but the Procedure is not really started.

◆ RemoveProcedureStartedListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::RemoveProcedureStartedListener ( std::shared_ptr< std::function< void(const IRuntimeContext &)>>  listener)
pure virtual

Removes procedure started listener.

Parameters
listenerA callback function which will be invoked when a procedure started.

◆ RemoveProcedureStoppedListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::RemoveProcedureStoppedListener ( std::shared_ptr< std::function< void(const IRuntimeContext &)>>  listener)
pure virtual

Removes procedure stopped listener.

Parameters
listenerA callback function which will be invoked when a procedure stopped.

◆ RemoveProcedureTimeoutListener()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::RemoveProcedureTimeoutListener ( std::shared_ptr< std::function< void(const IRuntimeContext &)>>  listener)
pure virtual

Adds procedure timeout listener.

Parameters
listenerA callback function which will be invoked when a timeout expires.

◆ SetCustomImplementation() [1/10]

virtual void OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::SetCustomImplementation ( std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::IBasicScreenImplementation implementation)
pure virtual

Sets BasicScreenImplementation.

Parameters
implementationAn implementation of IBasicScreenImplementation.

◆ SetCustomImplementation() [2/10]

virtual void OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::SetCustomImplementation ( std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::ICommonDialogsImplementation implementation)
pure virtual

Sets ICommonDialogsImplementation.

Parameters
implementationAn implementation of ICommonDialogsImplementation.

◆ SetCustomImplementation() [3/10]

virtual void OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::SetCustomImplementation ( std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::IContextVariableImplementation implementation)
pure virtual

Sets IContextVariableImplementation.

Parameters
implementationAn implementation of IContextVariableImplementation.

◆ SetCustomImplementation() [4/10]

virtual void OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::SetCustomImplementation ( std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::ICustomScreenImplementation implementation)
pure virtual

Sets ICustomScreenImplementation.

Parameters
implementationAn implementation of ICustomScreenImplementation.

◆ SetCustomImplementation() [5/10]

virtual void OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::SetCustomImplementation ( std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::IExternalServiceProviderImplementation implementation)
pure virtual

Sets IExternalServiceProviderImplementation.

Parameters
implementationAn implementation of IExternalServiceProviderImplementation.

◆ SetCustomImplementation() [6/10]

virtual void OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::SetCustomImplementation ( std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::Ii18nImplementation implementation)
pure virtual

Sets Ii18nImplementation.

Parameters
implementationAn implementation of Ii18nImplementation.

◆ SetCustomImplementation() [7/10]

virtual void OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::SetCustomImplementation ( std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::ILoggingImplementation implementation)
pure virtual

Sets ILoggingImplementation.

Parameters
implementationAn implementation of ILoggingImplementation.

◆ SetCustomImplementation() [8/10]

virtual void OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::SetCustomImplementation ( std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::IMeasureImplementation implementation)
pure virtual

Sets IMeasureImplementation.

Parameters
implementationAn implementation of IMeasureImplementation.

◆ SetCustomImplementation() [9/10]

virtual void OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::SetCustomImplementation ( std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::ISqlImplementation implementation)
pure virtual

Sets ISqlImplementation.

Parameters
implementationAn implementation of ISqlImplementation.

◆ SetCustomImplementation() [10/10]

virtual void OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::SetCustomImplementation ( std::shared_ptr< OpenTestSystem::Otx::Runtime::Api::Custom::IStateVariableImplementation implementation)
pure virtual

Sets IStateVariableImplementation.

Parameters
implementationAn implementation of IStateVariableImplementation.

◆ SetSearchPath()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::SetSearchPath ( const std::string &  path)
pure virtual

Sets search path.

The OTX search path (OTX-Home) determines the base directory to which all relative path specifications refer. It can contain several directories separated by semicolons (";") and the placeholders "?" (One arbitrary character) and "*" (any characters). You can also use the placeholder [ProjectDir] (e.g. [ProjectDir]/*) with the following semantic:

Scope Path which [ProjectDir] refers Sample path
Within OTF Directory of the project inside OTF solution C:/Users/[Current User]/Documents/Open Test Framework/OtxSolution1/OtxProject1
Runtime API uses PTX file Directory of PTX file location c:/Users/[Current User]/Documents/Open Test Framework
Runtime API uses OTX file Directory of OTX file location c:/Users/[Current User]/Documents/Open Test Framework
Runtime API uses binary file (DLL, JAR) Directory of the binary file location c:/Users/[Current User]/Documents/Open Test Framework

While file reading operations with relative paths, the runtime environment takes each directory starting from the left as a base for relative paths. If the file is found, the search is canceled.

For file writing operations with relative paths, the first directory is used. The first directory shall exists and shall not contain wildcards.

If no OTX search path is specified, the default value [ProjectDir];[ProjectDir]/.. is used.

Parameters
pathBase directory.

◆ StopAll()

virtual void OpenTestSystem::Otx::Runtime::Api::IRuntimeManager::StopAll ( )
pure virtual

Stops all synchronous and asynchronous executing procedures of this RuntimeManager.


The documentation for this class was generated from the following file: