PyANGKernel.GKSystem¶
- class GKSystem¶
Class that keeps information about all data that is shared by the documents. * * The class
GKSystemis 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.Details
The class hold only non GUI shared data. For the GUI equivalent see
GKGUISystemclass.In order to access the unique instance of
GKSystemthe following code will be used:GKSystem &system = GKSystem::getSystem();
Synopsis¶
Methods¶
def
__init__()def
areaGuiToModel()def
areaModelToGui()def
areaName()def
createFolder()def
createTask()def
densityName()def
distanceName()def
emissionsName()def
executeAction()def
getActions()def
getActiveModel()def
getAppVersion()def
getHome()def
getIPAddress()def
getLog()def
getModel()def
getModels()def
getPlugin()def
getPluginsHome()def
getPreferences()def
getUnitSystem()def
getUserHome()def
getUserName()def
guiAvailable()def
newObject()def
registerFolder()def
setPreferences()def
setUnitSystem()def
speedName()def
weightName()
Static functions¶
def
deleteSystem()def
exit()def
getSystem()def
isInitialized()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
- __init__()¶
- accelerationGuiToModel(units, accel)¶
- Parameters:
units –
UnitSystemaccel – float
- Return type:
From an acceleration in m/s2 or f/s2 it returns the acceleration in m/s2.
From an acceleration in m/s or f/s it returns the acceleration in m/s.
- accelerationModelToGui(units, acceleration)¶
- Parameters:
units –
UnitSystemacceleration – float
- Return type:
From an acceleration in m/s2 to acceleration in m/s2 or f/s2 depending of the units.
- accelerationName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the acceleration name, either m/s^2 or f/s^2 depending of the units.
From an acceleration in m/s to acceleration in m/s or f/s depending of the system units defined in the preferences.
- addTypeContentToFolder(folderInternalName, typeName)¶
- Parameters:
folderInternalName – str
typeName – str
Add a type to the list of object types that a folder( by internalName) can hold.
- areaGuiToModel(units, area)¶
- Parameters:
units –
UnitSystemarea – float
- Return type:
From an area in m2 or sqft returns it in m2.
From an area in m2 or sqft returns it in m2.
- areaModelToGui(units, area)¶
- Parameters:
units –
UnitSystemarea – float
- Return type:
From an area in m2 to m2 or sqft depending of the units.
- areaName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the area name, either m^2 or sqft depending of the units.
From an area in m2 or sqft returns it in m2.
- batteryConsumptionGuiToModel(units, c)¶
- Parameters:
units –
UnitSystemc – float
- Return type:
From a fuel consumption in kWh, returns it in kWh.
- batteryConsumptionModelToGui(units, fc)¶
- Parameters:
units –
UnitSystemfc – float
- Return type:
From a distance fuel consumption in kWh to kWh depending of the units.
- batteryConsumptionName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the distance fuel consumption name, either kWh or kWh depending on the units.
- canExecuteAction(actionId, target, selection)¶
Test if an action can be executed (the selection is valid, the action exists, the resources are available…
Expand the variables $APP_HOME, $RESOURCES_HOME, $PLUGINS_HOME, $PLUGIN_HOME or $MODEL_HOME (only if model parameter is not null) 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”.
- createExperiment(scenario, engineId, mode)¶
- Parameters:
scenario –
GKScenarioengineId – int
mode – int
- Return type:
- createFolder(root, folderInternalName[, showOnlyConts=false])¶
Creates a folder as a child of the root folder as registered by
registerFolderThe used root (can be a different one than the root specified) is returned in the newRoot argument.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 deleteSystem()¶
Delete the system (just before exiting the application).
- densityGuiToModel(units, den)¶
- Parameters:
units –
UnitSystemden – float
- Return type:
From a density in veh/km or veh/mi it returns the density in veh/km.
- densityModelToGui(units, den)¶
- Parameters:
units –
UnitSystemden – float
- Return type:
From a density in veh/km to density in veh/km or veh/mi depending of the units.
- densityName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the density name, either veh/km or veh/mi depending of the units.
- distanceBatteryConsumptionGuiToModel(units, c)¶
- Parameters:
units –
UnitSystemc – float
- Return type:
From a distance fuel consumption in kWh/100 km, returns it in kWh/100 km.
- distanceBatteryConsumptionModelToGui(units, fc)¶
- Parameters:
units –
UnitSystemfc – float
- Return type:
From a distance fuel consumption in kWh/100 km to kWh/100 mi depending of the units.
- distanceBatteryConsumptionName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the distance fuel consumption name, either kWh/100 km or kWh/100 mi depending on the units.
- distanceEmissionGuiToModel(units, de)¶
- Parameters:
units –
UnitSystemde – float
- Return type:
From a distance pollutant emission in g/km or g/mi, returns it in g/km.
- distanceEmissionModelToGui(units, de)¶
- Parameters:
units –
UnitSystemde – float
- Return type:
From a pollutant emission in g/Km to g/Km or g/mi depending of the units.
- distanceEmissionsName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the distance emissions name, either in g/Km or g/mi, depending on the units.
- distanceFuelConsumptionGuiToModel(units, c)¶
- Parameters:
units –
UnitSystemc – float
- Return type:
From a distance fuel consumption in l/100 km or gal/100 mi, returns it in l/100 km.
- distanceFuelConsumptionModelToGui(units, fc)¶
- Parameters:
units –
UnitSystemfc – float
- Return type:
From a distance fuel consumption in l/100 km to l/100 km or gal/100 mi depending of the units.
- distanceFuelConsumptionName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the distance fuel consumption name, either l/100 km or gal/100 mi depending on the units.
- distanceGuiToModel(units, dist)¶
- Parameters:
units –
UnitSystemdist – float
- Return type:
From a distance in m or feet it returns the distance in m.
Given a distance in the system units (that is, the ones set by preferences) it returns the distance in m.
- distanceModelToGui(units, distance)¶
- Parameters:
units –
UnitSystemdistance – float
- Return type:
From a distance in m to distance in m or feet depending of the units.
- distanceName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the distance name, either m or feet depending of the units.
From a distance in m to distance in m or feet depending of the system units defined in the preferences.
- emissionGuiToModel(units, e)¶
- Parameters:
units –
UnitSysteme – float
- Return type:
From a pollutant emission in g, returns it in g.
- emissionModelToGui(units, e)¶
- Parameters:
units –
UnitSysteme – float
- Return type:
From a pollutant emission in g to g.
- emissionPerHourGuiToModel(units, e)¶
- Parameters:
units –
UnitSysteme – float
- Return type:
From an instant pollutant emission in g/s, returns it in g/s.
- emissionPerHourModelToGui(units, e)¶
- Parameters:
units –
UnitSysteme – float
- Return type:
From a pollutant emission in g/h to g/h.
- emissionsName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the emissions name (always g).
- emissionsPerHourName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the instant emissions name (always g/h).
- executeAction(actionId, target, selection, 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.
Executes a kernel action over the
GKSystem. Returns true if the action was found and the task UID if this command generates a task.- static exit(errorCode)¶
- Parameters:
errorCode – int
- fuelConsumptionGuiToModel(units, c)¶
- Parameters:
units –
UnitSystemc – float
- Return type:
From a fuel consumption in l or gal, returns it in l.
- fuelConsumptionModelToGui(units, fc)¶
- Parameters:
units –
UnitSystemfc – float
- Return type:
From a fuel consumption in l to l or gal depending of the units.
- fuelConsumptionName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the fuel consumption name, either l (liters) or gal (gallons) depending on the units.
- getActions(type)¶
- Parameters:
type –
GKType- Return type:
.list of GKKernelActionEntry
Gets the list of all possible kernel actions for the type specified.
Get the active model as set by GKSystem::setActiveModel. Callable in a Python script to get its model.
- getActiveSelection()¶
- Return type:
QList
The active selection (when executing the script as a context menu over an object).
The active target (when executing the script as a context menu over the target object).
- getAimsunExtension(name)¶
- Parameters:
name – str
- Return type:
Returns an Enhanced Extension description by its unique name.
Returns the application version in the format: A.b.c (RXXXXX), i.e. 7.0.1 (R15320)
Get the computer name.
Get the System (application) home.
Get the computer IP address.
- getKernelActions(type)¶
- Parameters:
type –
GKType- Return type:
.list of GKKernelAction
Gets all the kernel actions that can be applied to type.
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 null then we will return the model folder. If nothing is found we will return the user’s home folder.
System log.
Get a loaded model by its UID.
Get a loaded model by its UID.
Returns a list of all the loaded models.
Returns a plug-in called “moduleName”
Get the Plugins home: - In Windows and Unix:
getSystem().getHome()+ “/plugins” - In MAC OS X: qApp->applicationDirPath() + “/../PlugIns”- getPreferences()¶
- Return type:
Get the preferences for this application.
- getPreferencesDefinition()¶
- Return type:
Get the preferences definition for this application.
Get the Resources home: - In Windows and Unix:
getSystem().getHome()- In MAC OS X: qApp->applicationDirPath() + “/../Resources” The Resources folder contains the folders: - shared - translations - templates - shapesSingleton !
- getUnitSystem()¶
- Return type:
Get the system units.
Get the User home.
Get the name of the user that starts the application.
- getUserPreferencesPath([version=""[, applicationPreferences=""]])¶
- Parameters:
version – str
applicationPreferences – str
- Return type:
Get the name of the folder where preferences for the current user will be stored.
UnknownCommandversion : version path to look for. If empty, the current version number (7.0 now) will be used.
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
getGuireturns a valid GUI.- instantBatteryConsumptionGuiToModel(units, c)¶
- Parameters:
units –
UnitSystemc – float
- Return type:
From an instant fuel consumption in Wh/s or Wh/s, returns it in ml/s.
- instantBatteryConsumptionModelToGui(units, fc)¶
- Parameters:
units –
UnitSystemfc – float
- Return type:
From a distance fuel consumption in Wh to Wh depending of the units.
- instantBatteryConsumptionName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the distance fuel consumption name, either Wh or Wh depending on the units.
- instantEmissionGuiToModel(units, e)¶
- Parameters:
units –
UnitSysteme – float
- Return type:
From an instant pollutant emission in g/s, returns it in g/s.
- instantEmissionModelToGui(units, e)¶
- Parameters:
units –
UnitSysteme – float
- Return type:
From a pollutant emission in g/s to g/s.
- instantEmissionsName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the instant emissions name (always g/s).
- instantFuelConsumptionGuiToModel(units, c)¶
- Parameters:
units –
UnitSystemc – float
- Return type:
From an instant fuel consumption in ml/s or fl oz/s, returns it in ml/s.
- instantFuelConsumptionModelToGui(units, fc)¶
- Parameters:
units –
UnitSystemfc – float
- Return type:
From an instant fuel consumption in ml/s to ml/s or fl oz/s depending of the units.
- instantFuelConsumptionName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the instant fuel consumption name, either ml/s or fl oz/s depending on the units.
Returns true is the system has been initialized (calling GKSystem::init). A system will remain initialised until a call to
deleteSystemis called.Returns the max number of GKModels that we can open in the system at the same time.
- newObject(type, model[, uuid=QUuid()[, id=-1[, addItToModel=true]]])¶
Create a new object of type “type” 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
add.You can also use the
newObjectmethod for new objects (id = -1).- newObject(typeName, model[, uuid=QUuid()[, id=-1[, addItToModel=true]]])
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
add.You can also use the
newObjectmethod for new objects (id = -1).- newTemporaryObject(type, model[, 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
getNewIdandgetNewTemporalId).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
add.- newTemporaryObject(typeName, model[, 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
getNewIdandgetNewTemporalId).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
add.- preciseSpeedGuiToModel(units, speed)¶
- Parameters:
units –
UnitSystemspeed – float
- Return type:
From a speed in m/s or feet/s it returns the speed in m/s.
- preciseSpeedModelToGui(units, speed)¶
- Parameters:
units –
UnitSystemspeed – float
- Return type:
From a speed in m/s to speed in m/s or feet/s depending of the units.
- preciseSpeedName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the speed name, either m/s or f/s depending of the units.
- registerAimsunExtension(extension)¶
- Parameters:
extension –
GKSimulatorExtensionDescription
Registers an Enhanced Extension. The pointer is adopted. * Never call this method directly, use GKPlugin::registerAimsunExtension.
- registerFolder(folderInternalName, folderExternalName, folderGroup)¶
- Parameters:
folderInternalName – str
folderExternalName – str
folderGroup – str
Register a folder that will hold objects in the Project. It has: - an internal, unique, name - an external name that can be translated - a group folder: the internal name of a top folder where this folder will be.
- registerLastUsedFile(value)¶
- Parameters:
value – str
Notify the system of a file usage to be use at
getLastUsedFolder.- registerLastUsedFolder(value)¶
- Parameters:
value – str
Notify the system of a folder usage to be use at
getLastUsedFolder.- setPreferences()¶
- Return type:
Get the preferences for this application for modification.
- setPreferencesDefinition()¶
- Return type:
Get the preferences definition for this application for modification.
- setUnitSystem(units)¶
- Parameters:
units –
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.
- speedGuiToModel(units, speed)¶
- Parameters:
units –
UnitSystemspeed – float
- Return type:
From a speed in km/h or mile/h it returns the speed in km/h.
From a speed in km/h or m/h it returns the speed in km/h.
- speedModelToGui(units, speed)¶
- Parameters:
units –
UnitSystemspeed – float
- Return type:
From a speed in km/h to speed in km/h or mi/h depending of the units.
- speedName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the speed name, either km/h or M/h depending of the units.
From a speed in km/h to speed in km/h or mi/h depending of the system units defined in the preferences.
- temperatureGuiToModel(units, temperature)¶
- Parameters:
units –
UnitSystemtemperature – float
- Return type:
From a temperature in Celsius or Fahrenheit, transform it into Celsius.
- temperatureModelToGui(units, temperature)¶
- Parameters:
units –
UnitSystemtemperature – float
- Return type:
From a temperature in Celsius, transform it into Celsius or Fahrenheit, depending on the units.
- travelTimeDistanceGuiToModel(units, ttd)¶
- Parameters:
units –
UnitSystemttd – float
- Return type:
From a travel time/distance in sec/km or sec/mi it returns it in sec/km.
- travelTimeDistanceModelToGui(units, ttd)¶
- Parameters:
units –
UnitSystemttd – float
- Return type:
From a travel time/distance in sec/km to sec/km or sec/mi depending of the units.
- tryToPutVariablePath(fileName[, model=None])¶
Returns a file path changing, if possible, well know path for a variable: - $APP_HOME - $PLUGINS_HOME
If no variable can be used then fileName is returned as:
QFileInfo( fileName ).filePath()
- unpreciseDistanceGuiToModel(units, dist)¶
- Parameters:
units –
UnitSystemdist – float
- Return type:
From a distance in kilometers or miles it returns the distance in kilometers.
- unpreciseDistanceModelToGui(units, dist)¶
- Parameters:
units –
UnitSystemdist – float
- Return type:
From a distance in kilometers to a distance in kilometers or miles depending of the units .
- unpreciseDistanceName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the distance name, either km or miles depending of the units.
- weightFrontAreaGuiToModel(units, w)¶
- Parameters:
units –
UnitSystemw – float
- Return type:
From a weight/frontal area in kg/m2 or lbs/sq.ft depending of the units to kg/m2.
- weightFrontAreaModelToGui(units, w)¶
- Parameters:
units –
UnitSystemw – float
- Return type:
From a weight/frontal area in kg/m2 to kg/m2 or lbs/sq.ft depending of the units.
- weightFrontAreaName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the weight / front area name, either Kg/m^2 or lb/ft^2 depending of the units.
- weightGuiToModel(units, w)¶
- Parameters:
units –
UnitSystemw – float
- Return type:
From a weight in kg or lbs depending of the units to kg.
- weightHorsePowerGuiToModel(units, w)¶
- Parameters:
units –
UnitSystemw – float
- Return type:
From a weight/horse power in kg/hp or lbs/hp depending of the units to kg/hp.
- weightHorsePowerModelToGui(units, w)¶
- Parameters:
units –
UnitSystemw – float
- Return type:
From a weight/horse power in kg/hp to kg/hp or lbs/hp depending of the units.
- weightHorsePowerName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the weight / hore power name, either Kg/hp or lb/hp depending of the units.
- weightModelToGui(units, w)¶
- Parameters:
units –
UnitSystemw – float
- Return type:
From a weight in kg to kg or lbs depending of the units.
- weightName(units)¶
- Parameters:
units –
UnitSystem- Return type:
Returns the weight name, either Kg or lb depending of the units.