59class BaseFieldHandlerBase:
81class BaseFieldHandlerFactory:
104class BaseFieldMessage(RemoteMessage):
211class DoubleField(NumberField):
284 NON_PERSISTENT_FIELD = 4
287 NON_EDITABLE_FIELD = 8
307 def setup(name, type, flags, fieldOwner):
751 def log(msg, msgType, msgOrigin, msgLogGroup, msgArguments):
870class MCStateCreatingModule(MCState):
881class MCStateFailedToCreateModule(MCState):
895class MCStateMDLReady(MCState):
935class MCStateRenderingSlavesActivated(MCState):
1445 DISCONNECT_BY_SERVER_REJECTION = 1
1452 DISCONNECT_BY_SERVER_CLOSE = 2
1458 WEBSOCKET_CLOSE_REASON_CONNECTION_LIMIT_REACHED = 4503
1461 WEBSOCKET_CLOSE_REASON_INVALID_URL = 4400
1464 WEBSOCKET_CLOSE_REASON_METHOD_NOT_ALLOWED = 4405
1467 WEBSOCKET_CLOSE_REASON_AUTHENTICATION_FAILED = 4403
1470 WEBSOCKET_CLOSE_REASON_SERVER_ERROR = 4500
1473 WEBSOCKET_CLOSE_REASON_UNKNOWN_APPLICATION = 4404
1476 WEBSOCKET_CLOSE_REASON_REQUEST_TIMEOUT = 4408
1479 WEBSOCKET_CLOSE_REASON_AUTHENTICATION_TIMEOUT = 4504
1706 MODULE_EXISTS_ALREADY = 1
1710 MODULE_IS_UNKNOWN = 2
1714 MODULE_CREATION_FAILED = 3
1719 AUTHENTICATION_FAILED = 4
1731class ModuleProcessInformationMessage(RemoteMessage):
2039class ParallelResourceLoader(ResourceLoader):
2059class RemoteCallInterfaceHandler(BaseFieldHandlerBase):
2123class RemoteManager(Object):
2351class RemoteRenderingBaseFieldHandler(BaseFieldHandlerBase):
2400class RemoteRenderingEventHandler:
2420class RemoteRenderingSlave(RemoteRenderingEventHandler):
2508class RenderSettings:
2571class RenderingQEventMessage(BaseFieldMessage):
2651class RenderingSetCursorShapeMessage(BaseFieldMessage):
2722class ResourceLoader:
2743class ResourceManager:
2760 def loadResources(scriptModules, cssModules, loadingFinishedCallback, jsLoader, cssLoader):
2773class ResponseHandler:
2780 def __init__(responseHandler, timeoutCallback, remoteManager):
2796class ScriptResource(Resource):
2809class SequentialResourceLoader(ResourceLoader):
2822class StringField(Field):
2899class TextDataStream:
Base class for base field handlers.
sendBaseFieldMessage(messageClass, data)
Passes the handled field, the message class, and the data to MLAB.Core.Module.sendBaseFieldMessage().
handleMessage(message)
Handles the given message of the base field.
registerHandler(baseFieldType, handlerClass)
Registers the class of a base field handler for the given base field type.
createHandler(baseField)
Creates a base field handler for the type of the given base field and returns it.
getBaseType()
Returns the type of the current base object.
handleMessage(message)
Handles base field messages by passing it to the handler.
_setBaseType(type, generationId)
Sets the base type and calls MLAB.Core.BaseFieldHandlerFactory.createHandler() to create a new handle...
getHandler()
Returns the handler that handles the messages for this field.
getGenerationId()
Returns the generation id of this base field.
setBaseType(baseType)
Sets the base type and calls MLAB.Core.BaseField._setBaseType() with the base object type.
The settings for the web socket connection.
getRequestTimeoutInterval()
Returns the request timeout, i.e.
getWebSocketHostName()
Returns the web socket hostname.
getApplicationName()
Returns the application name.
getWebSocketBasePath()
Returns the web socket base path.
getAuthenticationToken()
Returns the authentication token.
_getWebSocketPortFromWorkerService()
Retrieves the web socket port from the MeVisLabWorkerService http server.
getConnectionTimeoutInterval()
Returns the connection timeout, i.e.
getWebSocketProtocol()
Returns the web socket protocol.
getWebSocketPort()
Returns the web socket port.
items()
Returns the enum items.
setItems(items)
Sets the enum items.
setCurrentItem(item)
Sets the current enum item.
addDependencyField()
Adds a dependency field that causes reevaluate.
resultChanged(boolValue, value, evaluator)
Is emitted if one of the fields used in the expression is touched.
Attempts to implement the same type conversion logic as QVariant.
This class is based on the MeVisLab class MLABField.
touch()
Triggers a notification of all field listeners in JavaScript and in the MeVisLab process on the serve...
logError(erro)
Logs an error.
isStringField()
Returns true if this is an MLAB.Core.StringField.
isBaseField()
Returns true if this is an MLAB.Core.BaseField.
getName()
Returns the field name.
_valueFromString()
Converts the given string to the value type.
isIntegerField()
Returns true if this is an MLAB.Core.IntegerField.
addListener(listener)
Adds a listener to this field.
isOutput()
Returns true if this field is an output field.
isNumberField()
Returns true if this is an MLAB.Core.NumberField derived class.
title()
Returns the title of the field.
getType()
Returns the field type.
isPersistent()
Returns true if this field is persistent.
_setValueOnClientOnly(value)
Sets the field value and notifies all JavaScript field listeners.
isEditable()
Returns true if this field is editable.
isParameterField()
Returns true if this field is a parameter field.
setValue(value)
Sets the value.
logException(exception)
Logs an exception.
getValue()
Returns the field value.
getFieldOwner()
Returns the field owner.
setup(name, type, flags, fieldOwner)
Sets the field up.
isColorField()
Returns true if this is an MLAB.Core.ColorField.
isTriggerField()
Returns true if this is an MLAB.Core.TriggerField.
fieldChanged(field)
Is emitted if the field value is changed (or the field is touched).
lastChangeSerialID()
Get a virtual time stamp when the value was last changed from the client.
notifyListeners()
Notifies all JavaScript field listeners, but not the field listeners in the MeVisLab process on the s...
getRawName()
Returns the raw field name, which includes all sub module names.
isInput()
Returns true if this field is an input field.
isVectorField()
Returns true if this is an MLAB.Core.VectorField.
isDoubleField()
Returns true if this is an MLAB.Core.DoubleField.
isBoolField()
Returns true if this is an MLAB.Core.BoolField.
isFloatField()
Returns true if this is an MLAB.Core.FloatField.
stringValue()
Returns the value as string.
setLastChangeSerialID()
Set the virtual time stamp when the value is changed from the client.
getFlags()
Returns the flags.
isInOut()
Returns true if this field is an input and output field.
isMatrixField()
Returns true if this is an MLAB.Core.MatrixField.
isEnumField()
Returns true if this is an MLAB.Core.EnumField.
log(message)
Logs a message.
setTitle()
Sets the title of the field.
setStringValueOnClientOnly(value)
Does the same as _setValueOnClientOnly() except that the value is a string.
_valueToString()
Converts the given value to string.
setStringValue(value)
Sets the value as string.
The central logging class.
isLoggingInBrowserConsole()
Returns if logging into the browser console (https://www.w3schools.com/jsref/obj_console....
printInBrowserConsole(msgType, arguments)
Calls console.
setLogInBrowserConsole()
Sets if logging into the browser console (https://www.w3schools.com/jsref/obj_console....
log(msg, msgType, msgOrigin, msgLogGroup, msgArguments)
Logs the given message.
handleMessageAndGetNextState(message)
__init__(moduleContext)
Creates this module context state.
This module context state is active when the module was created and authentication was successful.
__init__(moduleContext)
Creates this module context state.
handleMessageAndGetNextState(message)
_setMDLReady()
Performs the transition from this state to MLAB.Core.MCStateMDLReady.
This module context state is initially active.
This is the base class for module context states.
_createSubModule(module, subModuleName)
Creates a MLAB.Core.Module instance with the given name and adds it as sub module to the given module...
_setKnownWidgetControls()
Sets the known widget controls on the MLAB.Core.ModuleContext.
_handleBaseFieldMessage(message)
Looks up the target base field on the module and calls handleMessage() with the given message.
_createFields(module, message)
Creates all MLAB.Core.Field instances from the module info message and adds them to the MLAB....
_handleGenericRequest(message)
Handles a generic request message.
_updateFieldMinMaxValues(message)
Updates the fields min/max values from the given message data.
_lookupField(rawFieldName)
Determines the owning module and looks up the field by the given field name.
_handleWebSetupMessage()
Handles the WebSetup message.
run()
This method is called when this is state is made current.
handleMessageAndGetNextState(message)
Handles the given remote message in the appropriate way for the current state.
_updateFieldValues(message)
Updates the field values from the given message data.
The module context is the communication interface between the MLAB.Core.Module, MLAB....
sendGenericRequest()
Sends the given generic request to the server.
connected(moduleContext)
Is emitted when the connection to the server is established.
showIDE()
Send the show IDE request to the MeVisLab process on the server to show the MeVisLab IDE.
isModuleReady()
Returns true if the module is ready.
sendMessage()
Sends the given message to the server.
disconnected(moduleContext, reason, details, ev)
Is emitted when the connection to the server is disconnected.
getState()
Returns the current module context state.
isBodyVisible()
Returns true if the html body is already visible.
handleMessage(message)
Handles the given remote message.
openConnection(connectionSettings)
See MLARemoteManager.openConnection().
closeConnection()
Closes the web socket connection.
setDebugRemoteMessages()
Sets if debugging of sent/received remote messages is enabled.
getModule()
Returns the managed module.
_setKnownWidgetControls(controls)
Sets the known widget controls.
notifyAboutToBeDestroyed()
Must be called when the module is being destroyed.
_areKnownWidgetControlsSet()
Returns true if the known widget controls array is not empty.
setRenderSettings()
Sets the render settings.
isWidgetControl()
Returns true if the given MDL tag is the name of a widget control.
authenticate(username, password)
Sends the given credentials as user field and password field values to the server.
setBodyIsVisible()
Notifies the module context that the body of the web page is visible.
hasModuleReadyMessage()
Returns true if the server sends the module ready message.
This message includes the module creation status.
registerFieldListener()
Registers a field listener for the given field.
createControl(mdlTree)
Creates a control for the given MDL tree by calling MLABWindowController.createControl().
control(controlName)
Returns the first widget control with the given name.
getType()
Returns the type of this module.
setWindowController(windowController)
Sets the window controller which is responsible for creating widget controls from an MDL tree.
parent()
Returns the parent module of this module.
windowsExported(windowNames)
Is emitted when the windows definitions have been received by the server.
getWindow(windowName)
Returns the window control, or null if it was not found.
getFieldByRawName(rawFieldName)
Looks up a field by its raw name, which is the name that includes the sub module names.
sendBaseFieldMessage(field, baseFieldMessageClass, data)
Creates a base field message using the provided class and data and sends it to the module in the MeVi...
addOutputField(name, type, flags)
Creates and adds an output field.
_getFieldsRecursively(includeInputFields, includeOutputFields, includeParameterFields)
Collects all fields of the given types recursively from this module and sub modules.
addWindowDefinitions(windowTrees)
Adds the MDL tree.
getName()
Returns the name of this module.
createModuleContext()
Creates a new module context for this module.
module(moduleName)
Searches for a sub module and returns it if it exists.
logException(exception, prefix)
Logs an exception with an optional prefix.
applicationModule()
Returns the application module.
removeAndDestroySubModule(moduleName)
Removes and destroys the sub module with the given name, if the sub module exists.
showPanel(windowName, windowContainer)
Shows the panel.
log(message, prefix)
Logs a message with an optional prefix.
_createAndAddField(name, type, flags)
Creates a field from the given arguments.
sendGenericRequest()
Deprecated.
getWindowDefinitions()
Returns the window definitions MDL tree of this module, or null if it was not yet received from the M...
callRemoteFunction(functionName, args, responseHandler)
Calls a function on the remote server by sending a generic request via the web socket connection to M...
addParameterField(name, type, flags)
Creates and adds a parameter field.
getOutputFields(includeSubModuleFields)
Returns the output fields.
isWidgetControl(mdlTag)
Returns true if the given MDL tag is a known widget control.
sendMessage(message)
Sends the message via the web socket connection to MeVisLab.
createWindow(windowName, windowContainer)
Creates a window.
isSubModule()
Returns true if this module is a sub module.
prependQualifiedModuleName()
Returns the name containing all sub modules names.
fieldValueChanged(field)
Handles field value changes.
showDialog(windowName, windowContainer)
Shows a dialog.
_removeWindowDefinitionsForSubModule(moduleName)
Removes the window definitions for the given sub module (with dotted submodule name) NOTE: window def...
hideWindow(windowName)
Hides the window.
showWindow(windowName, windowContainer)
Shows the window.
_copyFields(dict, fieldDict)
Helper function for MLAB.Core.Module._getFieldsRecursively().
getParameterFields(includeSubModuleFields)
Returns the parameter fields.
getModuleContext()
Returns the ModuleContext.
field(fieldName)
Returns the field with the given name or null if it does not exist.
createBaseFieldHandler(baseField)
Creates a base field handler using the base field handler factory.
getInputFields(includeSubModuleFields)
Returns the input fields.
createPanel(windowName, windowContainer)
Creates a panel.
getRemoteRenderingControl(domElement)
Returns the remote rendering control for the given DOM element.
logError(erro, prefix)
Logs an error with an optional prefix.
addInputField(name, type, flags)
Creates and adds an input field.
destroy()
Destroys this module and all its windows.
getWindowController()
Returns the window controller.
requestStopProcessing()
Sends a message to the worker that it should stop the current processing.
windowCreated(windowControl)
Is emitted if a Window is created.
hidePanel(windowName)
Hides the panel.
addSubModule(module)
Adds a sub module.
The signal "minMaxValueChanged(this)" is emitted when the min/max values are changed from the backend...
getMinValue()
Returns the minimum value of this number field.
setMaxValue(value)
Sets the maximum value of this number field.
setMinValue(value)
Sets the minimum value of this number field.
getMaxValue()
Returns the maximum value of this number field.
Base class for objects with signals and slots.
connectCallback(signal, callback)
Connects a signal of this object to the given callback function.
disconnectCallback(signal, callback)
Disconnects a signal of this object from the given callback function.
signalsBlocked()
Returns true if signals are blocked.
connectSignal(signal, receiver, targetSignal)
Connects a signal of this object to the signal of the receiver, so that if this signal is emitted,...
blockSignals(blocked)
Sets if signals are blocked, which means that signals are suppressed in situations where they would h...
isSignalRegistered()
Returns true if the given signal is registered.
connect(signal, receiver, slot)
Connects a signal of this object to the slot of the receiver.
__init__()
Creates a new MLAB.Core.Object.
disconnect(signal, receiver, signal)
Disconnects a signal of this object from the slot of the receiver.
disconnectReceiver(signal, receiver)
Disconnects a signal of this object from all slots of the receiver.
registerSignal(signal)
Registers a signal.
emit(signal)
Emits a signal.
_resourceLoaded(resource)
Remote the given resource from the list of pending resources and calls the loading finished callback ...
loadResources()
Loads all resources.
addInterfaceObject(objectName, object)
Adds a local interface object that is available to a remote client under the given objectName.
_handleGenericBaseRequest(message)
Handles the given generic base request message.
_handleGenericBaseReply(message)
If the given generic base reply message has a valid request id (> 0), then a callback is looked up in...
callWithResult()
Calls the given remote method with the given arguments.
handleMessage(message)
Handles the given base field message.
call()
Calls the given remote method with the given arguments.
removeInterfaceObject(objectName)
Removes the local interface object.
hasInterfaceObject(objectName)
Returns true if a local interface object was added with the given name, false otherwise.
logException(exception, prefix)
Same as logError(), except that an exception instead of an message is expected.
_setup()
Creates the web socket and registers callbacks on it.
hasModuleReadyMessage()
Returns true if the server supports a module ready message.
handleConnected()
This method is called directly after the remote manager is connected and emits the connected signal.
handleConnectionError()
The web socket's onerror handler.
logError(message, prefix)
Same as log(), except that the message is treated as an error.
getRequestTimeoutInterval()
Returns the request timeout, i.e.
_handleMessage()
Handle a received message.
disconnected(ev)
Is emitted from the onclose method of the WebSocket.
connectionError(ev)
Is emitted from the onerror method of the WebSocket.
sendGenericRequest(functionName, args, responseHandler)
Calls the script function named by functionName on the application module.
_requestTimedOut(requestID, functionName, args)
This method is used as a callback when waiting for a response times out.
log(message, prefix)
Sends the given log message to the MeVisLab process.
handleMessageReceived(messageEvent)
This method is used as the web socket onmessage callback.
requestTimeout(info)
Is emitted if a request didn't receive a response in time.
sendMessage(message)
Sends the given message to the connected MeVisLab process via the web socket.
handleDisconnected()
This method is called directly after the remote manager is disconnected and emits the disconnected si...
connected(ev)
Is emitted from the onopen method of the WebSocket.
openConnection(connectionSettings)
Establishes the web socket connection to MeVisLab on the server.
messageReceived(message)
Is emitted when a message is received.
connectionTimeout()
Is emitted when no message was received from the server for some time.
handleConnectionTimeout()
Called when no messages were received from the server for some time.
closeConnection()
Closes the web socket connection.
This is the base class for messages that are sent and received via a web socket to and from a MeVisLa...
isBaseFieldMessage()
Returns true if this is a base field message, i.e.
typeName()
Returns the type name of the message.
write(stream)
Writes the message to the data stream.
read(stream)
Reads the message from the data stream.
addRenderingSlaves()
Adds rendering slaves to the rendering process.
getRenderSettings()
returns the current render settings, which initially are a copy of the global render settings.
sendRenderSettings()
sends the current rendersettings to the MeVisLab remote rendering
setEnableSmoothPlayback()
Enables/disables the smooth playback mode, which is useful for streaming cine mode like movies.
setFramesPerSecond()
Specify the desired maximum playback speed in frames per second.
setEnableStats()
Enables/disables the display of a few rendering statistics (e.g.
handleMouseEvent()
Handles the given MLAB.Core.MouseEvent.
handleWheelEvent()
Handles the given MLAB.Core.WheelEvent.
handleKeyEvent()
Handles the given MLAB.Core.KeyEvent.
getImageMimeType()
Returns the image mime type for the given image type.
add()
Adds this remote rendering slave by sending first a MLAB.Core.RenderingSlaveAddedMessage.
disable()
Disables this slave.
setEnableStats()
Enables/disables the display of a few rendering statistics (e.g.
setEnableSmoothPlayback()
Enables/disables the smooth playback mode, which is useful for streaming cine mode like movies.
remove()
Removes this slave by first sending a MLAB.Core.RenderingRenderStopStreamingMessage if streaming is e...
enable()
Enables this slave.
setFramesPerSecond()
Specify the desired maximum playback speed in frames per second.
setBaseHandler(baseHandler)
Sets the remote rendering base handler.
isStreamingEnabled()
Returns if streaming is enabled or disabled.
doesSupportHiDPI()
Returns if high dpi displays are supported.
setSupportHiDPI(A)
Enables or disables support for HiDPI displays.
getProperty()
Returns the given property, see constructor for available properties.
setProperty()
Sets the given property, see constructor for available properties.
clone()
Clones the RenderSettings.
setStreamingEnabled(A)
Enables or disables streaming.
getSettingsDictionary()
Get the settings dictionary for sending the message to MeVisLab.
This class loads resources by creating and appending DOM nodes to the HTML header.
__init__(resourceList, loadingFinishedCallback)
Creates a new MLAB.Core.ResourceLoader.
loadResources()
Loads all resources.
__init__(resourcesBaseUrl)
Creates a new MLAB.Core.ResourceManager.
loadResources(scriptModules, cssModules, loadingFinishedCallback, jsLoader, cssLoader)
Loads the given scripts and css files.
Base class for resources.
__init__(type, url, attributes, resourcesUrl)
Creates a new MLAB.Core.Resource.
handleResponse(reply)
Clears the timeout timer and calls the responser handler callback with the given arguments.
__init__(responseHandler, timeoutCallback, remoteManager)
Creates a new MLAB.Core.ResponseHandler.
__init__(url, resourcesUrl)
Creates a new MLAB.Core.ScriptResource.
_resourceLoaded(resource)
Remote the given resource from the list of pending resources and calls the loading finished callback ...
Resource class for css files.
__init__(url, resourcesUrl)
Creates a new MLAB.Core.StyleResource.
isIOS()
Returns true if the system is an IOS device by checking if one of these strings is found in the user ...
isLinux()
Returns true if the platform is Linux by checking if the string "Linux" is found in the navigator pla...
isAndroid()
Returns true if the system is an android device by checking if the string "android" is found in the u...
isWindows()
Returns true if the platform is Windows by checking if the string "Win" is found in the navigator pla...
isMacOS()
Returns true if the platform is MacOS by checking if the string "Mac" is found in the navigator platf...
isIE()
Check if the browser is Microsoft Internet Explorer.
isEdge()
Check if the browser is Microsoft Edge.
unescape(s)
Unescapes the given string.
serialize()
Serializes this message into a string and returns it.
escape(s)
Escapes the given string, so that it can be safely passed as base64 encoded string through a web sock...
getIntervalCount()
Returns how many times the interval has been elapsed/how many times the timer has already fired.
setSingleShot(isSingleShot)
Sets if this timer fires only once after the specified interval has been elapsed.
isActive()
Returns if the timer is active.
setCallback(callback)
Sets a callback function to be called when the timer fires.
setInterval()
Sets the timer interval in miliseconds.
timeout()
Is emitted when the timer fires.
setFocusRemoteRenderingOnMouseOverEnabled(enabled)
Sets if remote rendering controls should get the focus on mouseover events and loses focus on mouseou...
getCurrentEventTarget()
Returns the widget that received the last mouse event.
showIDE()
Shows the MeVisLab IDE on the server for this module.
getRenderSettings()
Returns the render quality settings.
isLetterOrNumber(charCode)
TODO: This function handles only ASCII!
getMessageTypeName(msgType)
Map message type numbers to readable names.
notifyModuleRequiresAuthentication(statusCode)
Calls MLAB.Core.emitModuleReady() with the given status code as argument.
defineClass(className, properties, staticProperties)
connect(sender, signal, receiver, slot)
Connects a signal of the sender to the slots of the receiver.
translatePath(path)
Translates a path beginning with a package variable $(MLAB_Xxxx_Yyyy) to an url beginning with MLAB_R...
disconnect(sender, signal, receiver, slot)
Disconnects a signal of the sender from the slot of the receiver.
deriveClass(className, superClass, properties, staticProperties)