PyANGGui.GGui

class GGui

The GUI for one or more Aimsun Document(s)

Details

It includes a menu bar, one or more tool bars, 2D and 3D Views and a collection of side windows (log, project, legend, 3D info, system…)

It is created automatically when Aimsun Next starts in GUI mode. This object doesn’t exist in Aimsun Next Server mode.

After creating the GUI no document exists yet.

Inheritance diagram of PyANGGui.GGui

Synopsis

Methods

Slots

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

class GGuiSaveType

When saving, what type of save operation. The differences are: - eSave: stores the network and makes a backup of the old files. - eSaveAs: stores the network and, because is a copy, no backup is done. - eAutoSave: stores the net in a tmp file, no backup is done. - eSaveStandalone: same as eSaveAs, but no changes the current document file path.

class GKMessageType
__init__()
closeDocument([model=None])
Parameters:

modelGKModel

Return type:

bool

Closes the document. If model is NULL, closes the current document

editThis(view, obj[, editionByType=None])
Parameters:
Return type:

QDialog

Opens an suitable editor for object “obj”. This function calls editorAdded automatically. It is possible also to all an editor by type (when obj is NULL and editionByType is not). In this case the editor target will be NULL (but the model and the gui will not, as the view is set correctly when calling this method).

exportToPDF()

Exports the view to PDF (print to PDF).

forceCloseDocument(model)
Parameters:

modelGKModel

Return type:

bool

Closes the document. This command doesn’t ask the user for any unsaved data and it cannot be cancelled.

forceQuit()

Quits the current Aimsun Next application. This command do not ask the user for any unsaved data and cannot be cancelled.

getActiveModel()
Return type:

GKModel

It returns the current model. It can be None (no model opened/created yet)

getActiveView([model=None])
Parameters:

modelGKModel

Return type:

GView

Get the active view (the one with the focus). If model is not null then it will look for a view for this model, first the active one and, if is not valid, then it will look for the first one with that model.

getActiveViewWindow([model=None])
Parameters:

modelGKModel

Return type:

GViewWindow

Get the active view window (the one with the focus). If model is not null then it will look for a view window for this model, first the active one and, if is not valid, then it will look for the first one with that model.

getNumberOfOpenViews(model)
Parameters:

modelGKModel

Return type:

int

Returns the number of open views for a given model. If model is NULL, returns the number of open views for all the models.

getOpenedEditorForTarget(obj)
Parameters:

objGKObject

Return type:

GEditor

Returns a currently opened editor, if any, for “obj” object.

invalidateViews([showProgress=false])
Parameters:

showProgress – bool

Force a redraw of all the current open views. If showProgress is true a progress dialog will show the drawing progression. Usually is not needed but, after importing or creating a lot of data, it is.

invalidateViews(model[, showProgress=false])
Parameters:
  • modelGKModel

  • showProgress – bool

Force a redraw of all the current open views ffor the given model, or for all models if given model is NULL. If showProgress is true a progress dialog will show the drawing progression. Usually is not needed but, after importing or creating a lot of data, it is.

inverseSelection()

Inverses the current selection. Objects selected will be deselected and objects deselected will be selected. Note that a drawer can refuse a selection, so this command will not affected it.

loadNetwork(fn[, isATemplate=false[, checkLocks=true[, aditionalPaths=list()]]])
Parameters:
  • fn – str

  • isATemplate – bool

  • checkLocks – bool

  • aditionalPaths – list of strings

Return type:

GKModel

Load a network from file “fn”. If isATemplate is true (a new document using a template) no error will be given to the user if something goes wrong as newDoc will report the error.

newDoc(templateFile, initialCS)
Parameters:
  • templateFile – str

  • initialCS – str

Return type:

GKModel

Creates a new document. The template will be used as the new document calling loadNetwork . If no template can be used or if templateFile is “_none_” it will call newSimpleDoc .

If templateFile is empty it will use the first valid template (usually the English one).

If initialCS is empty we will default to EPSG:32601

newSimpleDoc()
Return type:

GKModel

Creates a new document (no template is used)

pan(obj)
Parameters:

objGKGeoObject

Pan the active view (if any) so that “obj” will be centered on it

print()
Return type:

bool

Opens the print dialog to print the current view.

processEvents([allowUserInput=true[, maxTime=5]])
Parameters:
  • allowUserInput – bool

  • maxTime – int

Standard “process events” function to be used for GUI. It process events for up to a given amount of time, allowing or not user interaction during the process.

UnknownCommandallowUserInput: if false, user input events (mouse, keyboard) will be excluded from event processing. UnknownCommand maxTime: maximum time devoted to event processing, in ms. If 0, function will not return until all pending events have been processed.

Use this function instead of direct call to QCoreApplication::instance()->processEvents() when possible.

quit()
Return type:

bool

Quits the current Aimsun Next application. This command ask the user for any unsaved data. The user can cancel the quit.

save([model=None])
Parameters:

modelGKModel

Return type:

bool

Return true if the model can be saved in its current file (look for file and dir permissions) It also makes a copy of the file (if exists) renaming the original file adding the “.old” extensions. If a problem happen it return false and shows a dialog informing of the problem.

selectAll()

Select all the geo objects. This command uses the current view in order to know which objects can be selected. Note that a drawer can make non selectable an object and that this setting is per view and not per model. This is the reason because the current view is used.

If no current view is available nothing is selected.

showMessage(type, title, message[, parent=None])
Parameters:

Show a critical message to the user. If we are in hidden mode (see GKSystem::getInHideMode) the message will appear in the log. If we are in normal mode (the default) it will appear in a dialog and in the log.

If parent is NULL, GGui will be the parent.