Aimsun Next Scripting
22
|
Public Member Functions | |
GKSystem () | |
bool | guiAvailable () const |
GKModel * | getActiveModel () const |
const QVector< GKModel * > & | getModels () const |
GKObject * | getActiveTarget () const |
const QList< GKObject * > * | getActiveSelection () const |
GKTask * | createTask (GKModel *model, QString uid=QString()) |
GKTask * | createInternalTask (GKModel *model, QString uid=QString()) |
const QString | getHome () const |
const QString | getUserHome () const |
const QString | getPluginsHome () const |
const QString | getResourcesHome () const |
const QString | getUserName () const |
QString | getUserPreferencesPath () const |
bool | isDemo () const |
GKObject * | newObject (const QString &, GKModel *) |
GKObject * | newTemporaryObject (const QString &typeName, GKModel *model, bool addItToModel=true) |
GKLog & | getLog () |
GKPlugin * | getPlugin (const QString &) const |
GKPreferencesValues & | setPreferences () |
const GKPreferencesValues & | getPreferences () const |
GKPreferences & | setPreferencesDefinition () |
const GKPreferences & | getPreferencesDefinition () const /NoCopy/ |
void | setUnitSystem (GK::UnitSystem) |
GK::UnitSystem | getUnitSystem () const |
double | distanceGuiToModel (GK::UnitSystem units, double dist) const |
double | unpreciseDistanceGuiToModel (GK::UnitSystem units, double dist) const |
double | speedGuiToModel (GK::UnitSystem units, double speed) const |
double | preciseSpeedGuiToModel (GK::UnitSystem units, double speed) const |
double | accelerationGuiToModel (GK::UnitSystem units, double accel) const |
double | densityGuiToModel (GK::UnitSystem units, double den) const |
double | travelTimeDistanceGuiToModel (GK::UnitSystem units, double ttd) const |
double | areaGuiToModel (GK::UnitSystem units, double area) const |
double | fuelConsumptionGuiToModel (GK::UnitSystem units, double c) const |
double | instantFuelConsumptionGuiToModel (GK::UnitSystem units, double c) const |
double | distanceFuelConsumptionGuiToModel (GK::UnitSystem units, double c) const |
double | emissionGuiToModel (GK::UnitSystem units, double e) const |
double | instantEmissionGuiToModel (GK::UnitSystem units, double e) const |
double | distanceEmissionGuiToModel (GK::UnitSystem units, double de) const |
double | temperatureGuiToModel (GK::UnitSystem units, double temperature) const |
double | weightGuiToModel (GK::UnitSystem units, double w) const |
double | weightHorsePowerGuiToModel (GK::UnitSystem units, double w) const |
double | weightFrontAreaGuiToModel (GK::UnitSystem units, double w) const |
double | distanceModelToGui (GK::UnitSystem units, double distance) const |
double | unpreciseDistanceModelToGui (GK::UnitSystem units, double dist) const |
double | speedModelToGui (GK::UnitSystem units, double speed) const |
double | preciseSpeedModelToGui (GK::UnitSystem units, double speed) const |
double | accelerationModelToGui (GK::UnitSystem units, double acceleration) const |
double | densityModelToGui (GK::UnitSystem units, double den) const |
double | travelTimeDistanceModelToGui (GK::UnitSystem units, double ttd) const |
double | areaModelToGui (GK::UnitSystem units, double area) const |
double | fuelConsumptionModelToGui (GK::UnitSystem units, double fc) const |
double | instantFuelConsumptionModelToGui (GK::UnitSystem units, double fc) const |
double | distanceFuelConsumptionModelToGui (GK::UnitSystem units, double fc) const |
double | emissionModelToGui (GK::UnitSystem units, double e) const |
double | instantEmissionModelToGui (GK::UnitSystem units, double e) const |
double | distanceEmissionModelToGui (GK::UnitSystem units, double de) const |
double | temperatureModelToGui (GK::UnitSystem units, double temperature) const |
double | weightModelToGui (GK::UnitSystem units, double w) const |
double | weightHorsePowerModelToGui (GK::UnitSystem units, double w) const |
double | weightFrontAreaModelToGui (GK::UnitSystem units, double w) const |
QString | distanceName (GK::UnitSystem units) const |
QString | speedName (GK::UnitSystem units) const |
QString | preciseSpeedName (GK::UnitSystem units) const |
QString | accelerationName (GK::UnitSystem units) const |
QString | densityName (GK::UnitSystem units) const |
QString | areaName (GK::UnitSystem units) const |
QString | weightName (GK::UnitSystem units) const |
QString | weightHorsePowerName (GK::UnitSystem units) const |
QString | weightFrontAreaName (GK::UnitSystem units) const |
QString | fuelConsumptionName (GK::UnitSystem units) const |
QString | instantFuelConsumptionName (GK::UnitSystem units) const |
QString | distanceFuelConsumptionName (GK::UnitSystem units) const |
QString | emissionsName (GK::UnitSystem units) const |
QString | instantEmissionsName (GK::UnitSystem units) const |
QString | distanceEmissionsName (GK::UnitSystem units) const |
QString | convertVariablePath (const QString &, GKModel *=0) |
QString | tryToPutVariablePath (const QString &, GKModel *=0) |
void | registerAimsunExtension (GKSimulatorExtensionDescription *) |
GKSimulatorExtensionDescription * | getAimsunExtension (const QString &) const |
void | registerFolder (const QString &folderInternalName, const QString &folderExternalName, const QString &folderGroup) |
GKFolder * | createFolder (GKFolder *root, const QString &folderInternalName, bool showOnlyConts=false) |
void | addTypeContentToFolder (const QString &folderInternalName, const QString &typeName) |
void | registerLastUsedFile (QString value) |
void | registerLastUsedFolder (QString value) |
QString | getLastUsedFolder (const GKModel *model=NULL) const |
bool | canExecuteAction (QString actionId, GKObject *target, QVector< GKObject * > selection) |
bool | executeAction (QString actionId, GKObject *target, QVector< GKObject * > selection, QString taskUID) |
bool | executeSystemAction (QString actionId, QString taskUID) |
QVector< GKKernelAction * > | getKernelActions (GKType *type) const |
QVector< GKKernelActionEntry > | getActions (GKType *type) const |
QString | getAppVersion () const |
GKGenericExperiment * | createExperiment (GKScenario *scenario, int engineId, int mode) |
Static Public Member Functions | |
static GKSystem & | getSystem () |
static void | deleteSystem () |
static bool | isInitialized () |
The class GKSystem is a singleton class (only one instance of this class exists) that holds all the data that is shared by the documents, mainly the types, the plug-ins and the filters. Note that this means that any two documents loaded in Aimsun Next can contain different data but they will share the same type of classes, filters and plug-ins.
The class hold only non GUI shared data. For the GUI equivalent see GKGUISystem class.
In order to access the unique instance of GKSystem the following code will be used:
GKSystem::GKSystem | ( | ) |
double GKSystem::accelerationGuiToModel | ( | GK::UnitSystem | units, |
double | accel | ||
) | const |
From an acceleration in m/s2 or f/s2 it returns the acceleration in m/s2.
double GKSystem::accelerationModelToGui | ( | GK::UnitSystem | units, |
double | acceleration | ||
) | const |
From an acceleration in m/s2 to acceleration in m/s2 or f/s2 depending of the units.
QString GKSystem::accelerationName | ( | GK::UnitSystem | units | ) | const |
Returns the acceleration name, either m/s^2 or f/s^2 depending of the units.
void GKSystem::addTypeContentToFolder | ( | const QString & | folderInternalName, |
const QString & | typeName | ||
) |
Add a type to the list of object types that a folder( by internalName) can hold.
double GKSystem::areaGuiToModel | ( | GK::UnitSystem | units, |
double | area | ||
) | const |
From an area in m2 or sqft returns it in m2.
double GKSystem::areaModelToGui | ( | GK::UnitSystem | units, |
double | area | ||
) | const |
From an area in m2 to m2 or sqft depending of the units.
QString GKSystem::areaName | ( | GK::UnitSystem | units | ) | const |
Returns the area name, either m^2 or sqft depending of the units.
bool GKSystem::canExecuteAction | ( | QString | actionId, |
GKObject * | target, | ||
QVector< GKObject * > | selection | ||
) |
Test if an action can be executed (the selection is valid, the action exists, the resources are available...
QString GKSystem::convertVariablePath | ( | const QString & | , |
GKModel * | = 0 |
||
) |
Expand the variables $APP_HOME, $RESOURCES_HOME, $PLUGINS_HOME, $PLUGIN_HOME or $MODEL_HOME (only if model parameter is not None) found in the parameter var to its actual values. For example: is APP_HOME = /here and var is "$APP_HOME/there" then the returned string will be: "/here/there"
GKGenericExperiment * GKSystem::createExperiment | ( | GKScenario * | scenario, |
int | engineId, | ||
int | mode | ||
) |
GKFolder * GKSystem::createFolder | ( | GKFolder * | root, |
const QString & | folderInternalName, | ||
bool | showOnlyConts = false |
||
) |
Creates a folder has a child of the root folder as registered by GKSystem::registerFolder
Adds a new task to the system. You can specify a unique ID or Aimsun Next will assign one for you.
This task cannot be monitorized by external systems. Use it for GUI and sub tasks.
Adds a new task to the system. You can specify a unique ID or Aimsun Next will assign one for you.
This task can be monitorized by external systems. Use it for execution tasks.
|
static |
Delete the system (just before exiting the application)
double GKSystem::densityGuiToModel | ( | GK::UnitSystem | units, |
double | den | ||
) | const |
From a density in veh/km or veh/mi it returns the density in veh/km.
double GKSystem::densityModelToGui | ( | GK::UnitSystem | units, |
double | den | ||
) | const |
From a density in veh/km to density in veh/km or veh/mi depending of the units.
QString GKSystem::densityName | ( | GK::UnitSystem | units | ) | const |
Returns the density name, either veh/km or veh/mi depending of the units.
double GKSystem::distanceEmissionGuiToModel | ( | GK::UnitSystem | units, |
double | de | ||
) | const |
From a distance pollutant emission in g/km or g/mi, returns it in g/km.
double GKSystem::distanceEmissionModelToGui | ( | GK::UnitSystem | units, |
double | de | ||
) | const |
From a pollutant emission in g/Km to g/Km or g/mi depending of the units.
QString GKSystem::distanceEmissionsName | ( | GK::UnitSystem | units | ) | const |
Returns the distance emissions name, either in g/Km or g/mi, depending on the units.
double GKSystem::distanceFuelConsumptionGuiToModel | ( | GK::UnitSystem | units, |
double | c | ||
) | const |
From a distance fuel consumption in l/100 km or gal/100 mi, returns it in l/100 km.
double GKSystem::distanceFuelConsumptionModelToGui | ( | GK::UnitSystem | units, |
double | fc | ||
) | const |
From a distance fuel consumption in l/100 km to l/100 km or gal/100 mi depending of the units.
QString GKSystem::distanceFuelConsumptionName | ( | GK::UnitSystem | units | ) | const |
Returns the distance fuel consumption name, either l/100 km or gal/100 mi depending on the units.
double GKSystem::distanceGuiToModel | ( | GK::UnitSystem | units, |
double | dist | ||
) | const |
From a distance in m or feet it returns the distance in m.
double GKSystem::distanceModelToGui | ( | GK::UnitSystem | units, |
double | distance | ||
) | const |
From a distance in m to distance in m or feet depending of the units.
QString GKSystem::distanceName | ( | GK::UnitSystem | units | ) | const |
Returns the distance name, either m or feet depending of the units.
double GKSystem::emissionGuiToModel | ( | GK::UnitSystem | units, |
double | e | ||
) | const |
From a pollutant emission in g, returns it in g.
double GKSystem::emissionModelToGui | ( | GK::UnitSystem | units, |
double | e | ||
) | const |
From a pollutant emission in g to g.
QString GKSystem::emissionsName | ( | GK::UnitSystem | units | ) | const |
Returns the emissions name (always g)
bool GKSystem::executeAction | ( | QString | actionId, |
GKObject * | target, | ||
QVector< GKObject * > | selection, | ||
QString | taskUID | ||
) |
Executes a kernel action over a set of objects. Returns true if the action was found and the task UID if this command generates a task.
bool GKSystem::executeSystemAction | ( | QString | actionId, |
QString | taskUID | ||
) |
Executes a kernel action over the GKSystem. Returns true if the action was found and the task UID if this command generates a task.
double GKSystem::fuelConsumptionGuiToModel | ( | GK::UnitSystem | units, |
double | c | ||
) | const |
From a fuel consumption in l or gal, returns it in l.
double GKSystem::fuelConsumptionModelToGui | ( | GK::UnitSystem | units, |
double | fc | ||
) | const |
From a fuel consumption in l to l or gal depending of the units.
QString GKSystem::fuelConsumptionName | ( | GK::UnitSystem | units | ) | const |
Returns the fuel consumption name, either l (liters) or gal (gallons) depending on the units.
QVector< GKKernelActionEntry > GKSystem::getActions | ( | GKType * | type | ) | const |
Gets the list of all possible kernel actions for the type specified.
GKModel * GKSystem::getActiveModel | ( | ) | const |
Get the active model as set by GKSystem::setActiveModel. Callable in a Python script to get its model.
const QList< GKObject * > * GKSystem::getActiveSelection | ( | ) | const |
The active selection (when executing the script as a context menu over an object).
GKObject * GKSystem::getActiveTarget | ( | ) | const |
The active target (when executing the script as a context menu over the target object).
GKSimulatorExtensionDescription * GKSystem::getAimsunExtension | ( | const QString & | ) | const |
Returns an Enhanced Extension description by its unique name.
QString GKSystem::getAppVersion | ( | ) | const |
Returns the application version in the format: A.b.c (RXXXXX), i.e. 7.0.1 (R15320)
const QString GKSystem::getHome | ( | ) | const |
Get the System (application) home.
QVector< GKKernelAction * > GKSystem::getKernelActions | ( | GKType * | type | ) | const |
Gets all the kernel actions that can be applied to type
QString GKSystem::getLastUsedFolder | ( | const GKModel * | model = NULL | ) | const |
Returns the last used folder. Used to start a file operation (save, open, import) from the last visited folder (so a new import starts from the previous imported folder).
If no last folder is found and model is not None then we will return the model folder. If nothing is found we will return the user's home folder.
GKLog & GKSystem::getLog | ( | ) |
System log.
const QVector< GKModel * > & GKSystem::getModels | ( | ) | const |
Returns a list of all the loaded models.
GKPlugin * GKSystem::getPlugin | ( | const QString & | ) | const |
Returns a plug-in called "moduleName".
const QString GKSystem::getPluginsHome | ( | ) | const |
Get the Plugins home:
const GKPreferencesValues & GKSystem::getPreferences | ( | ) | const |
Get the preferences for this application.
const GKPreferences & GKSystem::getPreferencesDefinition | ( | ) | const |
Get the preferences definition for this application.
const QString GKSystem::getResourcesHome | ( | ) | const |
Get the Resources home:
|
static |
Singleton !
Referenced by MacroPTExperimentParams::if(), GViewWindow::if(), GView::if(), GKBaseObject::if(), GKCommand::if(), GKControlGreenMetering::if(), GKControlMetering::if(), GKPlugin::if(), GKRealDataSetRestorer::if(), MacroExperimentParams::if(), Abstract::if(), GKSimulatorExtension::if(), and GKControllerPars::if().
GK::UnitSystem GKSystem::getUnitSystem | ( | ) | const |
Get the system units.
const QString GKSystem::getUserHome | ( | ) | const |
Get the User home.
const QString GKSystem::getUserName | ( | ) | const |
Get the name of the user that starts the application.
QString GKSystem::getUserPreferencesPath | ( | ) | const |
Get the name of the folder where preferences for the current user will be stored.
bool GKSystem::guiAvailable | ( | ) | const |
Returns true if a GUI is available for any user started operation. Aimsun can have a GUI but hidden (to create, for example, snapshots). In this case this function will return false even if GKSystem::getGui returns a valid GUI.
double GKSystem::instantEmissionGuiToModel | ( | GK::UnitSystem | units, |
double | e | ||
) | const |
From an instant pollutant emission in g/s, returns it in g/s.
double GKSystem::instantEmissionModelToGui | ( | GK::UnitSystem | units, |
double | e | ||
) | const |
From a pollutant emission in g/s to g/s.
QString GKSystem::instantEmissionsName | ( | GK::UnitSystem | units | ) | const |
Returns the instant emissions name (always g/s)
double GKSystem::instantFuelConsumptionGuiToModel | ( | GK::UnitSystem | units, |
double | c | ||
) | const |
From an instant fuel consumption in ml/s or fl oz/s, returns it in ml/s.
double GKSystem::instantFuelConsumptionModelToGui | ( | GK::UnitSystem | units, |
double | fc | ||
) | const |
From an instant fuel consumption in ml/s to ml/s or fl oz/s depending of the units.
QString GKSystem::instantFuelConsumptionName | ( | GK::UnitSystem | units | ) | const |
Returns the instant fuel consumption name, either ml/s or fl oz/s depending on the units.
bool GKSystem::isDemo | ( | ) | const |
Returns true if this is a DEMO version
|
static |
Returns true is the system has been initialized (calling GKSystem::init). A system will remain initialised until a call to GKSystem::deleteSystem is called.
Create a new object of type "typeName" in model "model" and with an ID "id"
If id = -1 then a new unique ID is automatically assigned to the new object.
If addItToModel is true the object is automatically add to the model catalog, if false then it is not (what is not recommended unless what the user wants to create is a temporary object). In any case the object can later on add to the model with the method GKCatalog::add.
You can also use the GKModel::newObject method for new objects (id = -1)
Use this function only when there is no new command available for the GKType of the object that is going to be created.
GKObject * GKSystem::newTemporaryObject | ( | const QString & | typeName, |
GKModel * | model, | ||
bool | addItToModel = true |
||
) |
Create a new temporary object of type "type" in model "model" with a new unique id that is automatically assigned to the new object from the the list of temporary IDs (see GKModel::getNewId and GKModel::getNewTemporalId )
If addItToModel is true the object is automatically add to the model catalog, if false then it is not (what is not recommended unless what the user wants to create is a temporary object). In any case the object can later on add to the model with the method GKCatalog::add.
double GKSystem::preciseSpeedGuiToModel | ( | GK::UnitSystem | units, |
double | speed | ||
) | const |
From a speed in m/s or feet/s it returns the speed in m/s.
double GKSystem::preciseSpeedModelToGui | ( | GK::UnitSystem | units, |
double | speed | ||
) | const |
From a speed in m/s to speed in m/s or feet/s depending of the units.
QString GKSystem::preciseSpeedName | ( | GK::UnitSystem | units | ) | const |
Returns the speed name, either m/s or f/s depending of the units.
void GKSystem::registerAimsunExtension | ( | GKSimulatorExtensionDescription * | ) |
Registers an Enhanced Extension. The pointer is adopted.
void GKSystem::registerFolder | ( | const QString & | folderInternalName, |
const QString & | folderExternalName, | ||
const QString & | folderGroup | ||
) |
Register a folder that will hold objects in the Project. It has:
void GKSystem::registerLastUsedFile | ( | QString | value | ) |
Notify the system of a file usage to be use at GKSystem::getLastUsedFolder
void GKSystem::registerLastUsedFolder | ( | QString | value | ) |
Notify the system of a folder usage to be use at GKSystem::getLastUsedFolder
GKPreferencesValues & GKSystem::setPreferences | ( | ) |
Get the preferences for this application for modification.
GKPreferences & GKSystem::setPreferencesDefinition | ( | ) |
Get the preferences definition for this application for modification.
void GKSystem::setUnitSystem | ( | GK::UnitSystem | ) |
Sets the system units type that will be used to present information to the user. Note that units used internally in this application are in Metric system.
double GKSystem::speedGuiToModel | ( | GK::UnitSystem | units, |
double | speed | ||
) | const |
From a speed in km/h or mile/h it returns the speed in km/h.
double GKSystem::speedModelToGui | ( | GK::UnitSystem | units, |
double | speed | ||
) | const |
From a speed in km/h to speed in km/h or mi/h depending of the units.
QString GKSystem::speedName | ( | GK::UnitSystem | units | ) | const |
Returns the speed name, either km/h or M/h depending of the units.
double GKSystem::temperatureGuiToModel | ( | GK::UnitSystem | units, |
double | temperature | ||
) | const |
From a temperature in Celsius or Fahrenheit, transform it into Celsius.
double GKSystem::temperatureModelToGui | ( | GK::UnitSystem | units, |
double | temperature | ||
) | const |
From a temperature in Celsius, transform it into Celsius or Fahrenheit, depending on the units.
double GKSystem::travelTimeDistanceGuiToModel | ( | GK::UnitSystem | units, |
double | ttd | ||
) | const |
From a travel time/distance in sec/km or sec/mi it returns it in sec/km.
double GKSystem::travelTimeDistanceModelToGui | ( | GK::UnitSystem | units, |
double | ttd | ||
) | const |
From a travel time/distance in sec/km to sec/km or sec/mi depending of the units.
QString GKSystem::tryToPutVariablePath | ( | const QString & | , |
GKModel * | = 0 |
||
) |
Returns a file path changing, if possible, well know path for a variable:
If no variable can be used then fileName is returned as:
double GKSystem::unpreciseDistanceGuiToModel | ( | GK::UnitSystem | units, |
double | dist | ||
) | const |
From a distance in kilometers or miles it returns the distance in kilometers.
double GKSystem::unpreciseDistanceModelToGui | ( | GK::UnitSystem | units, |
double | dist | ||
) | const |
From a distance in kilometers to a distance in kilometers or miles depending of the units.
double GKSystem::weightFrontAreaGuiToModel | ( | GK::UnitSystem | units, |
double | w | ||
) | const |
From a weight/frontal area in kg/m2 or lbs/sq.ft depending of the units to kg/m2.
double GKSystem::weightFrontAreaModelToGui | ( | GK::UnitSystem | units, |
double | w | ||
) | const |
From a weight/frontal area in kg/m2 to kg/m2 or lbs/sq.ft depending of the units.
QString GKSystem::weightFrontAreaName | ( | GK::UnitSystem | units | ) | const |
Returns the weight / front area name, either Kg/m^2 or lb/ft^2 depending of the units.
double GKSystem::weightGuiToModel | ( | GK::UnitSystem | units, |
double | w | ||
) | const |
From a weight in kg or lbs depending of the units to kg.
double GKSystem::weightHorsePowerGuiToModel | ( | GK::UnitSystem | units, |
double | w | ||
) | const |
From a weight/horse power in kg/hp or lbs/hp depending of the units to kg/hp.
double GKSystem::weightHorsePowerModelToGui | ( | GK::UnitSystem | units, |
double | w | ||
) | const |
From a weight/horse power in kg/hp to kg/hp or lbs/hp depending of the units.
QString GKSystem::weightHorsePowerName | ( | GK::UnitSystem | units | ) | const |
Returns the weight / hore power name, either Kg/hp or lb/hp depending of the units.
double GKSystem::weightModelToGui | ( | GK::UnitSystem | units, |
double | w | ||
) | const |
From a weight in kg to kg or lbs depending of the units.
QString GKSystem::weightName | ( | GK::UnitSystem | units | ) | const |
Returns the weight name, either Kg or lb depending of the units.