PyANGKernel.GKModel¶
- class GKModel¶
This class contains all the objects in a model.
Details
The entire object model is organized around the
GKModelclass. This class contains all the objects in a model (in our context a model is a document. For example a CAD map of a city will be the document, or model, in a CAD application).Each time the user creates or open a new document an instance of
GKModelis created. Each time the user saves the document to disk, all the data in theGKModelis saved.A model is a collection of GKObjects instances (in fact of subclasses of
GKObject). A line, a road, an OD matrix… they are instances of a subclass ofGKObject. An instance of aGKObjecthas a unique identifier (assigned when the object is first created and immutable during the live of the object) and a type.The model contains preferences available using the
getPreferencesmethod.<h2>
GKModelas an object container</h2> The model holds all the data in a catalog (an instance ofGKCatalog). This catalog keeps the data organized by type and identifier. It also keeps all the visible geo objects (instances ofGKGeoObjectsub-classes) in theGKGeoModel. And it can also keep objects inside its root folder.The main difference between this three types of containers (catalog, geo-model and folder) is that the catalog has all the objects in the model created using
newObjecteither graphical and non-graphical. The geo-model contains only graphical objects that are shown at this moment (a graphical object will not be draw if is not in the geo-model). The root folder will contain any object (usually non-graphical) that will be shown in the GListViewForModel (seeGKFolder).<h2>Object deletion and commands</h2> When an object is deleted all the relationships with it must destroyed too. If the deleted object is the owner of the relationship the solution is simple, this will be done at the object delete command. The problem is when the owner of the relationship is not the deleted object. This owner must be informed of the destruction to react accordingly.
As is possible that the deleted object do not know this relationship the
GKModelimplements a simple mechanism to be informed of when an object is deleted. In fact what is expected is that the owner of the relationship not only updates it but also support a possible UNDO.When an object is “interested” in another and the target object is deleted the deleted object will ask the model for all the interested objects (unknowns to it until this moment) and will ask these “interested” objects to generate a
GKObjectConnectionDelCmdcommand (seegetDelConnectionCmd) with the information that will be deleted or modified to support a possible UNDO.If the deleted object is removed outside a command (no UNDO will be possible) then the object or editor that deletes it must call
nonCommandObjectRemovedto inform any interested object of this deletion. This method will call then tononCommandObjectRemovedfor each interested object.Synopsis¶
Methods¶
def
__init__()def
areaGuiToModel()def
areaModelToGui()def
areaName()def
canBeClosed()def
cleanUp()def
closePlugins()def
createNewCmd()def
createRevision()def
densityName()def
destroy()def
distanceName()def
existsObject()def
finishRestore()def
fork()def
freeze()def
getAuthor()def
getCatalog()def
getColumn()def
getColumns()def
getCommander()def
getDocumentDB()def
getGeoModel()def
getInterests()def
getLog()def
getNewId()def
getObjectHash()def
getPluginData()def
getPreferences()def
getProjectId()def
getType()def
getTypes()def
getUID()def
getUnitSystem()def
importFile()def
inSimulation()def
inherits()def
initNewModel()def
initUnitTest()def
isARevision()def
isColumnUsed()def
isFrozen()def
isOnRestore()def
isOnStore()def
lockMutex()def
newObject()def
openPlugins()def
registerColumn()def
registerType()def
registerUsedId()def
removeColumn()def
removeColums()def
reportError()def
reportWarning()def
restoreFromDB()def
setAuthor()def
setDocumentDB()def
setFreezeFlag()def
setObjectHash()def
setOnRestore()def
setOnStore()def
setPluginData()def
setPreferences()def
setProjectId()def
setUnitSystem()def
setUserName()def
speedName()def
unlockMutex()def
unregisterType()def
weightName()
Virtual methods¶
def
setStatus()
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
- PyANGKernel.GKModel.currentAvailableTypePos¶
- PyANGKernel.GKModel.currentAvailableColPos¶
- __init__()¶
From an acceleration in m/s2 or f/s2 it returns the acceleration in m/s2
From an acceleration in m/s2 to acceleration in m/s2 or f/s2 depending of the units
Returns the accelaration name, either m/s^2 or f/s^2 depending of the units
- addObjectToFolder(object, context, folderName)¶
Adds an object to the most appropriate folder
- addTSDescription(description)¶
- Parameters:
description –
GKTSDescription
Adds a description to the model. The pointer is adopted. Delete it using
deleteDescriptionFrom an area in m2 or sqft returns it in m2
From an area in m2 to m2 or sqft depending of the units
Returns the area name, either m^2 or sqft depending of the units
- assignStoreIdToTypesAndColumns()¶
Before a store operation, ensure that types and columns have a valid storeId.
Returns the battery consumption, either kwh
Can this document be closed? Maybe a plug-in is doing something that must be stopped first. If it returns false the document will not be closed.
Returns true if a revision can be created from the following model (it checks that the model has been stored on disk, asDB / stream revisions are not supported right now).
- checkAndFixPath(location, description[, who=None[, anyFile=false]])¶
Check if the external file at “location” (path to a file including the file name) can be found. If not it will look in the searchPaths folders to locate the file. If it fails to it will ask the user for the new location (and will add the folder to the searchPaths variable) if the GUI is available.
If the file is found ina location different from the supplied one the variable “location” will be updated with the new file location.
If anyFile is false only existing files can be selected.
Returns true if the file exists (note that this do not mean that it can be opened) or false otherwise.
description holds a single line description of what is missing. This string will appear as the title of the file dialog used to look for the missing file.
who is the object requesting the file, used to add a link in the log.
- checkObjectHash(uuid, ba)¶
- Parameters:
uuid –
QUuidba –
QByteArray
- Return type:
Determines if the given object’s hash has changed by comparing it with the stored one. UnknownCommand uuid : ID of the obj to store the hash for UnknownCommand ba : current serialization byte array (not the hash!!!) UnknownCommand : true if current hash still matches the stored one, false otherwise (either because it has changed or because we hadn’t it stored yet)
- cleanRealityBasedOnGeometryConfigurations(iScenario)¶
- Parameters:
iScenario –
GKGenericScenario
Remove the target scenario from the Geometry Configuration Connection without rebuilding the other scenarios.
Returns true if the model is executing code from its destructor
- clearObjectHashes()¶
Removes all object hashes from the model
- clearRestoredTypeVersions()¶
Clears temporary structure after restoring ADB file.
- closePlugins()¶
Notify the plug-ins that the model will be closed.
- consolidateRevision()¶
Stops current model for being a revision. Most specifically, it clears the configuration name & revision flag (base network information is kept, however)
Returns true if the object has a hash (if not is a new object that will be saved for the first time)
Creates a creation cmd for a type. Note that not all the types can have an associated creation command. After creating the command it should be customized (if required) and added to the commander for execution. Upon execution the user can gets the created object using
createdObject. Example:cmd = model.createNewCmd( model.getType( "GKCentroid" )); p = view2d->screen2World( event->pos() ); cmd->setData( GKPoint( 10, 10 ), activeCenConf ); model.getCommander().addCommand( cmd );
- createRevision(configName, newInitialId)¶
- Parameters:
configName – str
newInitialId – int
- Return type:
“Forks” the model as a revision. First, saves the base model. Then, it calls
fork(), sets revision flag, configuration name and registers the new base ID for newly created objects. To finish, the revision file is saved.- deleteDescription(description)¶
- Parameters:
description –
GKTSDescription
Delete a description created using
getCreateDescription().From a density in veh/km or veh/mi it returns the density in veh/km
From a density in veh/km to density in veh/km or veh/mi depending of the units
Returns the density name, either veh/km or veh/mi depending of the units
Deletes all the info from this model. Used before the delete to cleanup memotu reporting the process in a task.
From a distance in m or feet it returns the distance in m
From a distance in m to distance in m or feet depending of the units
Returns the distance name, either m or feet depending of the units
Returns true if the sections belonging to a road type that has been set to be not drawn in the draw mode attribute will be drawn and false if they will not be drawn.
See also
- existsObject(objectId, iScenario)¶
- Parameters:
objectId –
QUuidiScenario –
GKGenericScenario
- Return type:
Returns true if object (by ID) exists in the scenario. An object can exists in several, all or just one scenario. * If scenario is 0 it will return always true. * Objects exists or not based on Geometry Configuration settings attached to the Scenario. * This method doesn’t take into account objects that are not part of the geometry because a required object is not. * For example a turn can return true while a required section returns false. * This is, thus, a simpler version of the query. * Use
existsinstead.- findDescription(uniqueName)¶
- Parameters:
uniqueName – str
- Return type:
Find a description specifying its uniqueName. Returns NULL if the model has no description with this unique name.
- finishRestore(fileVersion)¶
- Parameters:
fileVersion – int
After a GKModel::restoreData creates modes, fixes data… GKModel::restore is equivalent to GKModel::restoreData and then GKModel::finishRestore
“Forks” the model by storing current filename & UID as the base network information (unless the model is a revision, in which case the base network information is maintained), and then resets UID to a new value.
Called whenever the model is going to be saved under a different filename or when creating a revision, to preserve history.
Freeze this network (saving it to the frozen folder).
- getActiveCentroidConfiguration([createIt=false])¶
- Parameters:
createIt – bool
- Return type:
Returns the active centroid configuration.
- getActiveExperiment()¶
- Return type:
In which experiment (if any) is the user working?
- getActivePedestrianCentroidConfiguration([createIt=false])¶
- Parameters:
createIt – bool
- Return type:
Returns the active pedestrian configuration.
- getActiveReplication()¶
- Return type:
In which replication (if any) is the user working?
- getActiveScenario()¶
- Return type:
In which scenario (if any) is the user working?
Author of this network.
The base network of this derived network. Empty for a base network.
The base network UID of this derived network. Empty for a base network.
Returns the Catalog
Get a column by its internal name (that is unique).
- getColumn(uniqueID)
- Parameters:
uniqueID – int
- Return type:
Get a column by its id (that is unique).
- getColumns()¶
- Return type:
Dictionary with keys of type .QString and values of type GKColumn.
Returns all columns in this model.
- getCommander()¶
- Return type:
Returns the Commander
The configuration name. Empty for a base network.
- getCreateDescription(col, uniqueName, aIncludeDeviation, aIncludeBands)¶
- Parameters:
col –
GKColumnuniqueName – str
aIncludeDeviation – bool
aIncludeBands – bool
- Return type:
Find (and create a new one if none is found) a TS description by uniqueName.
- getCreateDescription(cols, uniqueName, aIncludeDeviation, aIncludeBands)
- Parameters:
cols – .list of GKColumn
uniqueName – str
aIncludeDeviation – bool
aIncludeBands – bool
- Return type:
- getCreateDescription(col, uniqueName, aFrom, aTo, anInterval, aggType, aIncludeDeviation, aIncludeBands)
- Parameters:
col –
GKColumnuniqueName – str
aFrom –
QDateTimeaTo –
QDateTimeanInterval –
GKTimeDurationaggType –
AggregationTypeaIncludeDeviation – bool
aIncludeBands – bool
- Return type:
Find (and create a new one if none is found) a TS description by uniqueName.
- getCreateDescription(cols, uniqueName, aFrom, aTo, anInterval, aggType, aIncludeDeviation, aIncludeBands)
- Parameters:
cols – .list of GKColumn
uniqueName – str
aFrom –
QDateTimeaTo –
QDateTimeanInterval –
GKTimeDurationaggType –
AggregationTypeaIncludeDeviation – bool
aIncludeBands – bool
- Return type:
Returns the folder that could be used to store an object with the specified type, * creating one if needed.
Creation Date.
- getDataForPlugins()¶
- Return type:
Dictionary with keys of type .QString and values of type QString.
Get all data stored for all the plug-ins.
- getDocumentDB()¶
- Return type:
DB of the loaded document
Directory of the loaded document. Only usable if
isStorageFileBasedis true.Path and file name of the loaded document if
isStorageFileBased. The document URL otherwise.The user’s comment when frozen the network.
- getGeoModel()¶
- Return type:
Returns the GeoModel
Returns the objects that are interested in “target”.
It returns the ID (for non temporary objects) assigned to the last object that has been created in the model.
If GUI: The last frame drawn. A consecutive number to know the current frame.
Gets the id of the last executed simulation.
Last Modification Date.
- getLog()¶
- Return type:
Returns the system log.
- getModelConnection()¶
- Return type:
Returns the model connection for the active experiment.
The version of the file. Goes from 0 (unsaved) and adds 1 every save.
Returns a new (unused) id. Used by
newObjectto assign unique IDsReturns a new (unused) id for a temporary object. Used by
newObjectto assign unique IDs.See also
Returns the object hash for the given object id, or an empty byte array if not found
Returns true if the model is being simulated
Gets an unused plug-in data (the plug-in was not available) probably to store it.
- getPreferences()¶
- Return type:
Get the preferences for this model.
- getProjectDatabase()¶
- Return type:
The database info (but not the database) that holds project external data (Sim Stats, external OD matrices, Real Data Sets values…).
Id of this project.
Returns the GUI data restored when reading this model. If we open the model without a GUI, we will keep it to store it back (as no GUI will be able to generate it).
Returns the restored version of this model. Can be used by GKPlugins to migrate data to the last version as an older version will contain less data.
- getRevisionChanges(addedObjects, changedObjects, removedObjects)¶
- Parameters:
addedObjects – .list of GKObject
changedObjects – .list of GKObject
removedObjects – Dictionary with keys of type .QUuid and values of type GKType.
Determines which changes have been made to the base network in this revision.
Returns the software version of this model used to save it for the last time. It will be the restored software version after loading and the current release version after saving it for the first time.
Get a type by name, if the type does not exist NULL is returned.
Get a type by name, if the type does not exist it is created.
During ADB restore, it returns the version (on store) for a given TypeName. If not found: -1.
- getTypes()¶
- Return type:
QList<GKType*>
Returns all types in this model.
- getUnitSystem()¶
- Return type:
Returns the network units
- importFile(fileName, mainLayer, p, filterArea)¶
Imports a file into the current model. It look for all the registered filters until it finds one that can load the file (GKFilterDescription::canImport).
Returns true if the file has been imported.
Returns true if the model is currently being simulated and false otherwise.
See also
Return true if typeName inherits superType (that is: if “superType” its a super type of “typeName”). If typeName is equal to superType true is returned.
- initNewModel()¶
Init a new created model (not from restore)
- initUnitTest()¶
Initialize for use in unit-tests (sans python.)
- initializePlugins()¶
Initialize the plug-ins (GKPlugin::initModel) just after creating this model (constructor) but before doing anything else. A perfect moment to declare types.
Returns true if this network is a revision (of another network)
Returns true if the Column col is used by any object in the model. Used only to test columns that are not AutoStore (in this case it is always used). Column usage will be tested on
GKTriggerandGKViewModeStyle.Is frozen ?
Returns true if obj is an object created in the revision
returns whether the model is in multiple adding mode
Returns true if we are restoring the model.
Returns true if we are storing the model.
Returns true if the document is stored in a file, false for: DB, stream and unknown storage.
Returns true if the given network URL is valid as a base for a revision. Right now, only file-based networks (so url is a “file://…” or a simple path) are supported.
- lockMutex()¶
*
lockMutex * access to the model exclusively
A method equivalent to this call:
GKSystem::getSystem().newObject( type, model );
- newObject(typeName)
- Parameters:
typeName – str
- Return type:
A method equivalent to this call:
GKSystem::getSystem().newObject( typeName, model );
- openPlugins()¶
Modify the plug-ins that the model has been created or restored.
From a speed in m/s or feet/s it returns the speed in m/s
From a speed in m/s to speed in m/s or feet/s depending of the units
Returns the speed name, either m/s or f/s depending of the units
Storing a network to be use as a base for a revision
See also
- putObjectsInFolder(typeName, internalFolderName)¶
- Parameters:
typeName – str
internalFolderName – str
A helper function. It puts all the objects with type “typeName” in the folder with “folderName” Used to recover missing information form a corrupted network. If the folder does not exist it will be created.
Public to be usable by the plug-ins in the GKPlugin::docOpened method.
- rebuildRealityBasedOnGeometryConfigurations([updateGeo=true])¶
- Parameters:
updateGeo – bool
Recreate the reallity after a Scenario or Geometry Configuration change.
- rebuildRealityBasedOnGeometryConfigurations(iScenario)
- Parameters:
iScenario –
GKGenericScenario
Recreate the reality after a Scenario change.
Register a column. The pointer is adopted.
Registers an interest between “target” and “connected”. If “target” is removed then the system will ask to “connected” to delete any relationship with it.
Registers an interest between all the instances of “target” (or any type that inherits “target” ) and “connected”. If any instance of “target” is removed then the system will ask to “connected” to delete any relationship with these instance.
Register a type. The pointer is adopted.
- registerType(typeName, superType)
- Parameters:
typeName – str
superType – str
- Return type:
Register a type creating it is needed and assigning to it a super type (that is also created if needed). The just created type is returned.
- registerUsedId(aId)¶
- Parameters:
aId – int
Updates the variable that hols the next free id to be used to discard “aId” because it is already in use. It updates both the normal and the temporary IDs.
Remove all objects from a type for this model. The object will be deleted too.
Look in
removeAllObjectsfor a method that removes objects from the geo model without removing its from the model and deleting its.- removeColumn(column, keepUsedColumns[, forceRemove=false])¶
- Parameters:
column –
GKColumnkeepUsedColumns – bool
forceRemove – bool
Obsolete (will be removed in Aimsun 8). Use GKModel::removeColumn(
GKColumn* column, bool keepUsedColumns,GKColumn* substituteColumn ) instead. * Removes a column from the model. That means that will be removed from the type and from all the objects in the catalog that use it.Note that only external attributes can be removed.
If first bool parameter (keepUsedColumns) is true (recommended) columns in triggers and styles will not be removed. If second bool parameter (forceRemove) is false (recommended) only external columns will be deleted. If true, all columns will be removed regardless of their storage type.
- removeColumn(column, keepUsedColumns, forceRemove, substituteColumn)
Removes a column from the model. That means that will be removed from the type and from all the objects in the catalog that use it.
Note that only external attributes can be removed.
If keepUsedColumns is true (recommended) columns in triggers and styles will not be removed. If false and a substituteColumn is provided, triggers and styles based on column will be changed to be based on substituteColumn. If second bool parameter (forceRemove) is false (recommended) only external columns will be deleted. If true, all columns will be removed regardless of their storage type.
Removes all columns from the originator
Removes a column from the model. That means that will be removed from the type and from all the objects in the catalog that use it.
Only for columns defined as
eInternalRemoves the object hash for the given object id
- removeObsoleteColums()¶
Removes all the existing columns created by Aimsun types that may exist in old networks but that are not longer needed. Called automatically after restoring a model.
- removeObsoletePreferences()¶
Removes all the existing preferences created by older release of Aimsun that may exist in old networks but that are not longer needed. Called automatically after restoring a model.
- removePluginData(pluginName)¶
- Parameters:
pluginName – str
Removes data associated with a plug-in as the data is no longer needed.
- removeTemporaryColumns(columns)¶
- Parameters:
columns – .list of GKColumn
Removes temporary columns from object of the same type in bulk. Columns will be removed even if they are used in styles (we will remove them from the style) Use this method to remove columns temporary after or before an execution
- removeViewModeStyles(types)¶
- Parameters:
types – .std.vectorGKType
Removes all ViewModeStyles with any of the selected Types.
Report an error in an operation. This method will write the title and the message in the model log and, if there is a GUI available, it will show a QMessageBox::critical. Use this function to report critical errors.
Report a warning in an operation. This method will write the title and the message in the model log and, if there is a GUI available, it will show a QMessageBox::warning. Use this function to report warnings.
- resetLastAssignedId()¶
Resets the last assigned id. Use before a save operation if reseting ids.
- restoreFromDB(dbInfo, modelId, taskId)¶
- Parameters:
dbInfo –
GKDataBaseInfomodelId – str
taskId – str
- Return type:
Restores the model. No other task is done. Call
finishRestorefor some needed postprocessing.- restoreFromFile(fileName, isATemplate, taskId)¶
- Parameters:
fileName – str
isATemplate – bool
taskId – str
- Return type:
Restores the model. No other task is done. Call
finishRestorefor some needed postprocessing.- restoreFromFile(fileName, ba, taskId)
- Parameters:
fileName – str
ba –
QByteArraytaskId – str
- Return type:
Restores the model. No other task is done. Call
finishRestorefor some needed postprocessing.- setActiveCentroidConfiguration(cenConf)¶
- Parameters:
cenConf –
GKCentroidConfiguration
Sets the active centroid configuration.
- setActiveExperiment(experiment)¶
- Parameters:
experiment –
GKGenericExperiment
In which experiment (if any) is the user working?
- setActivePedestrianCentroidConfiguration(cenConf)¶
- Parameters:
cenConf –
GKCentroidConfiguration
Sets the active pedestrian configuration.
- setActiveReplication(replication)¶
- Parameters:
replication –
GKReplication
In which replication (if any) is the user working?
- setAuthor(anAuthor)¶
- Parameters:
anAuthor – str
Author of this network.
- setBaseNetworkFileName(baseNetworkFile)¶
- Parameters:
baseNetworkFile – str
Sets base network filename
- setBaseNetworkUID(baseNetworkUID)¶
- Parameters:
baseNetworkUID – str
Sets the base network UID of this derived network. Empty for a base network.
- setConfigurationName(configName)¶
- Parameters:
configName – str
Sets the configuration name.
Creation Date.
- setDocumentDB(dbInfo)¶
- Parameters:
dbInfo –
GKDataBaseInfo
DB of the loaded document
- setDocumentFileName(afileName)¶
- Parameters:
afileName – str
Set the path of the loaded document
- setDrawInvisibleSections(value)¶
- Parameters:
value – bool
If value is true then the sections belonging to a road type that has been set to be not drawn in the draw mode attribute will be drawn and they will not be drawn if value is false.
See also
- setFreezeComment(freezeComment)¶
- Parameters:
freezeComment – str
The user’s comment when frozen the network.
- setFreezeFlag(freezeFlag)¶
- Parameters:
freezeFlag – bool
Set has frozen (or not)
- setInSimulation(value)¶
- Parameters:
value – bool
Sets the model as being in a current simulation if value is true and not being in any simulation otherwise.
See also
- setLastFrameDrawed(value)¶
- Parameters:
value – int
If GUI: The last frame drawn. A consecutive number to know the current frame.
- setLastGeneratedId(id)¶
- Parameters:
id – int
Sets the id of the last executed simulation.
Last Modification Date.
- setModelAsRevision(configName, newInitialId)¶
- Parameters:
configName – str
newInitialId – int
- Return type:
Creates a new revision of the model. It calls first
fork(), then sets revision flag, configuration name and registers the new base ID for newly created objects. It sets the revision attributes but it doesn’t do the need save before with prepareRevision flag and the save of the revision created.- setNetworkVersion(networkVersion)¶
- Parameters:
networkVersion – int
The version of the file. Goes from 0 (unsaved) and adds 1 every save.
- setNextStoreIsViewer(isViewer)¶
- Parameters:
isViewer – bool
Sets if the next store will generate a viewer file
- setObjectHash(uuid, ba)¶
- Parameters:
uuid –
QUuidba –
QByteArray
Calculates and stores internally the object hash for a given object. This hash is later used to determine if the object has changed when storing a revision, a DB model, etc… UnknownCommand uuid : UID of the obj to store the hash for UnknownCommand ba : serialization byte array (not the hash!!!)
- setOnMultipleModifications(value)¶
- Parameters:
value – bool
Set the model in multiple modification mode, which if true it avoids to update the project view each time a single object is added/modified/removed
See also
- setOnRestore(value)¶
- Parameters:
value – bool
Set the model in restore mode
See also
- setOnSimulation(value)¶
- Parameters:
value – bool
Sets the model on simulation or not simulation mode. If true, the signal router won’t emit any acknowledgement.
- setOnStore(value)¶
- Parameters:
value – bool
Set the model in store mode
See also
- setPluginData(pluginName, pluginData)¶
- Parameters:
pluginName – str
pluginData – str
Stores an unused plug-in data (the plug-in was not available) for later store.
- setPreferences()¶
- Return type:
Get the preferences for this model for modification.
- setPrepareForRevision(value)¶
- Parameters:
value – bool
Storing a network to be use as a base for a revision
See also
- setProjectDatabase(adatabase)¶
- Parameters:
adatabase –
GKDataBaseInfo
The database info (but not the database) that holds project external data (Sim Stats, external OD matrices, Real Data Sets values…).
- setProjectId(id)¶
- Parameters:
id – str
Id of this project.
- setRestoredGuiData(restoredGuiData)¶
- Parameters:
restoredGuiData – str
Sets the GUI data restored when reading this model. If we open the model without a GUI, we will keep it to store it back (as no GUI will be able to generate it).
- setRestoredSoftwareVersion(value)¶
- Parameters:
value – int
The restored version of this model as set from an external restorer.
- setRestoredTypeVersions(typeVersions)¶
- Parameters:
typeVersions – Dictionary with keys of type .QString and values of type int.
Sets, for each stored Type, which version was it stored on. Temporary for network restore (ADB).
- setRevisionFlag([set=true])¶
- Parameters:
set – bool
Sets revision flag to the given state
- setSimulatorInObjects(value)¶
- Parameters:
value – bool
Will set the geometrical catalog objects as being currently simulated or not depending on value.
- setStatus(astatus)¶
- Parameters:
astatus –
GKObjectStatus
Changes the status of the model and emits the signal modelStatusChanged (through GKSignalRouter)
- setStoredSoftwareVersion(value)¶
- Parameters:
value – int
The current stored version of this model as set when storing this model in a file.
- setUnitSystem(units)¶
- Parameters:
units –
UnitSystem
Sets the unit system that will be used to present information to the user. Note that unit system used internally in this application is the Metric system.
- setUserName()¶
Assign the current user name and data to the model properties. Done when creating a new network from a template.
From a speed in km/h or m/h it returns the speed in km/h
From a speed in km/h to speed in km/h or mi/h depending of the units
Returns the speed name, either km/h or M/h depending of the units
Returns true if the model uses a fixed folder structure for projects
From a temperature in Celsius or Fahrenheit, transform it into Celsius
From a temperature in Celsius, transform it into Celsius or Fahrenheit, depending on the units
For structured projects, the top folder of the project (the one that includes the ReadMe.md file)
- unlockMutex()¶
*
unlockMutex * access to the model exclusively
From a distance in km or miles it returns the distance in km
From a distance in Km to distance in Km or miles depending of the units
Returns the distance name, either Km or miles depending of the units
Unregister a columns (that will be remove). The pointer is not deleted. This is a responsibility of the caller. See
removeColumn.Note that only external attributes can be removed.
Unregisters an interest between “target” and “connected”.
Unregisters an interest between any instance of “target” (or any type that inherits “target” ) and “connected”.
Unregisters an interest between “target” and any object of type “type” (or any type that inherits “type” ).
Unregisters a type
From a weight/frontal area in kg/m2 or lbs/sq.ft depending of the units to kg/m2
From a weight/frontal area in kg/m2 to kg/m2 or lbs/sq.ft depending of the units
Returns the weight / front area name, either Kg/m^2 or lb/ft^2 depending of the units
From a weight in kg or lbs depending of the units to kg
From a weight/horse power in kg/hp or lbs/hp depending of the units to kg/hp
From a weight/horse power in kg/hp to kg/hp or lbs/hp depending of the units
Returns the weight / horse power name, either Kg/hp or lb/hp depending of the units
From a weight in kg to kg or lbs depending of the units
Returns the weight name, either Kg or lb depending of the units