itom
1.0.13
|
Public Types | |
enum | tPropertyFlags { propValid = 0x0001, propConstant = 0x0002, propFinal = 0x0004, propReadable = 0x0008, propWritable = 0x0010, propResettable = 0x0020 } |
enum | tErrorCode { errorUiHandleInvalid = 0x1001, errorObjDoesNotExist = 0x1002, errorObjPropWrite = 0x1003, errorObjPropRead = 0x1004, errorObjPropDoesNotExist = 0x1005, errorUnregisteredType = 0x1006, errorSlotDoesNotExist = 0x1007, errorSignalDoesNotExist = 0x1008, errorConnectionError = 0x1009 } |
enum | tWinType { typeDialog = 0x0000, typeMainWindow = 0x0001, typeDockWidget = 0x0002 } |
enum | tObjectInfo { infoShowNoInheritance = 0x0001, infoShowItomInheritance = 0x0002, infoShowAllInheritance = 0x0004 | infoShowItomInheritance } |
Public Slots | |
void | pythonKeyboardInterrupt (bool checked) |
RetVal | loadPluginWidget (void *algoWidgetFunc, QVector< ito::ParamBase > *paramsMand, QVector< ito::ParamBase > *paramsOpt, QSharedPointer< unsigned int >dialogHandle, QSharedPointer< unsigned int >initSlotCount, QSharedPointer< unsigned int > objectID, QSharedPointer< QByteArray > className, ItomSharedSemaphore *semaphore=NULL) |
RetVal | addWidgetToOrganizer (QWidget *widget, QSharedPointer< unsigned int >dialogHandle, QSharedPointer< unsigned int >initSlotCount, QWidget *parent=NULL, ItomSharedSemaphore *semaphore=NULL) |
RetVal | createNewDialog (QString filename, int uiDescription, StringMap dialogButtons, QSharedPointer< unsigned int > dialogHandle, QSharedPointer< unsigned int > initSlotCount, QSharedPointer< unsigned int > objectID, QSharedPointer< QByteArray > className, ItomSharedSemaphore *semaphore=NULL) |
RetVal | deleteDialog (unsigned int handle, ItomSharedSemaphore *semaphore=NULL) |
RetVal | showDialog (unsigned int handle, int modalLevel, QSharedPointer< int > retCodeIfModal, ItomSharedSemaphore *semaphore=NULL) |
RetVal | hideDialog (unsigned int handle, ItomSharedSemaphore *semaphore=NULL) |
RetVal | setAttribute (unsigned int handle, Qt::WidgetAttribute attribute, bool on=true, ItomSharedSemaphore *semaphore=NULL) |
RetVal | isVisible (unsigned int handle, QSharedPointer< bool > visible, ItomSharedSemaphore *semaphore=NULL) |
RetVal | getDockedStatus (unsigned int uiHandle, QSharedPointer< bool > docked, ItomSharedSemaphore *semaphore=NULL) |
RetVal | setDockedStatus (unsigned int uiHandle, bool docked, ItomSharedSemaphore *semaphore=NULL) |
RetVal | showInputDialogGetDouble (QString title, QString label, double defaultValue, QSharedPointer< bool > ok, QSharedPointer< double > value, double min=-2147483647, double max=2147483647, int decimals=1, ItomSharedSemaphore *semaphore=NULL) |
RetVal | showInputDialogGetInt (QString title, QString label, int defaultValue, QSharedPointer< bool > ok, QSharedPointer< int > value, int min=-2147483647, int max=2147483647, int step=1, ItomSharedSemaphore *semaphore=NULL) |
RetVal | showInputDialogGetItem (QString title, QString label, QStringList stringList, QSharedPointer< bool > ok, QSharedPointer< QString > value, int currentIndex=0, bool editable=false, ItomSharedSemaphore *semaphore=NULL) |
RetVal | showInputDialogGetText (QString title, QString label, QString defaultString, QSharedPointer< bool > ok, QSharedPointer< QString > value, ItomSharedSemaphore *semaphore=NULL) |
RetVal | showMessageBox (unsigned int uiHandle, int type, QString title, QString text, int buttons, int defaultButton, QSharedPointer< int > retButton, QSharedPointer< QString > retButtonText, ItomSharedSemaphore *semaphore=NULL) |
RetVal | showFileDialogExistingDir (unsigned int uiHandle, QString caption, QSharedPointer< QString > directory, int options=QFileDialog::ShowDirsOnly, ItomSharedSemaphore *semaphore=NULL) |
RetVal | showFileOpenDialog (unsigned int uiHandle, QString caption, QString directory, QString filter, QSharedPointer< QString > file, int selectedFilterIndex=0, int options=0, ItomSharedSemaphore *semaphore=NULL) |
RetVal | showFileSaveDialog (unsigned int uiHandle, QString caption, QString directory, QString filter, QSharedPointer< QString > file, int selectedFilterIndex=0, int options=0, ItomSharedSemaphore *semaphore=NULL) |
RetVal | getPropertyInfos (unsigned int objectID, QSharedPointer< QVariantMap > retPropertyMap, ItomSharedSemaphore *semaphore=NULL) |
RetVal | readProperties (unsigned int objectID, QSharedPointer< QVariantMap > properties, ItomSharedSemaphore *semaphore=NULL) |
RetVal | writeProperties (unsigned int objectID, QVariantMap properties, ItomSharedSemaphore *semaphore=NULL) |
RetVal | readProperties (unsigned int handle, QString widgetName, QSharedPointer< QVariantMap > properties, ItomSharedSemaphore *semaphore=NULL) |
RetVal | writeProperties (unsigned int handle, QString widgetName, QVariantMap properties, ItomSharedSemaphore *semaphore=NULL) |
RetVal | getAttribute (unsigned int objectID, int attributeNumber, QSharedPointer< bool > value, ItomSharedSemaphore *semaphore=NULL) |
RetVal | setAttribute (unsigned int objectID, int attributeNumber, bool value, ItomSharedSemaphore *semaphore=NULL) |
RetVal | getWindowFlags (unsigned int objectID, QSharedPointer< int > flags, ItomSharedSemaphore *semaphore=NULL) |
RetVal | setWindowFlags (unsigned int objectID, int flags, ItomSharedSemaphore *semaphore=NULL) |
RetVal | widgetMetaObjectCounts (unsigned int objectID, QSharedPointer< int > classInfoCount, QSharedPointer< int > enumeratorCount, QSharedPointer< int > methodCount, QSharedPointer< int > propertyCount, ItomSharedSemaphore *semaphore=NULL) |
RetVal | getChildObject (unsigned int uiHandle, QString objectName, QSharedPointer< unsigned int > objectID, ItomSharedSemaphore *semaphore=NULL) |
RetVal | getChildObject2 (unsigned int parentObjectID, QString objectName, QSharedPointer< unsigned int > objectID, ItomSharedSemaphore *semaphore=NULL) |
RetVal | getChildObject3 (unsigned int parentObjectID, QString objectName, QSharedPointer< unsigned int > objectID, QSharedPointer< QByteArray > widgetClassName, ItomSharedSemaphore *semaphore=NULL) |
RetVal | getSignalIndex (unsigned int objectID, QString signalSignature, QSharedPointer< int > signalIndex, QSharedPointer< QObject * > objPtr, QSharedPointer< IntList > argTypes, ItomSharedSemaphore *semaphore=NULL) |
RetVal | callSlotOrMethod (bool slotNotMethod, unsigned int objectID, int slotOrMethodIndex, QSharedPointer< FctCallParamContainer > args, ItomSharedSemaphore *semaphore=NULL) |
RetVal | getObjectInfo (unsigned int objectID, int type, QSharedPointer< QVariantMap > infoMap, ItomSharedSemaphore *semaphore=NULL) |
RetVal | connectWithKeyboardInterrupt (unsigned int objectID, QString signalSignature, ItomSharedSemaphore *semaphore=NULL) |
RetVal | getMethodDescriptions (unsigned int objectID, QSharedPointer< MethodDescriptionList > methodList, ItomSharedSemaphore *semaphore=NULL) |
RetVal | getObjectInfo (unsigned int objectID, QSharedPointer< QByteArray > objectName, QSharedPointer< QByteArray > widgetClassName, ItomSharedSemaphore *semaphore=NULL) |
RetVal | createFigure (QSharedPointer< QSharedPointer< unsigned int > > guardedFigureHandle, QSharedPointer< unsigned int > initSlotCount, QSharedPointer< unsigned int > objectID, QSharedPointer< int > rows, QSharedPointer< int > cols, ItomSharedSemaphore *semaphore=NULL) |
RetVal | getSubplot (QSharedPointer< unsigned int > figHandle, unsigned int subplotIndex, QSharedPointer< unsigned int > objectID, QSharedPointer< QByteArray > objectName, QSharedPointer< QByteArray > widgetClassName, ItomSharedSemaphore *semaphore=NULL) |
RetVal | figurePlot (QSharedPointer< ito::DataObject > dataObj, QSharedPointer< unsigned int > figHandle, QSharedPointer< unsigned int > objectID, int areaRow, int areaCol, QString className, ItomSharedSemaphore *semaphore=NULL) |
RetVal | figureLiveImage (AddInDataIO *dataIO, QSharedPointer< unsigned int > figHandle, QSharedPointer< unsigned int > objectID, int areaRow, int areaCol, QString className, ItomSharedSemaphore *semaphore=NULL) |
RetVal | figureRemoveGuardedHandle (unsigned int figHandle, ItomSharedSemaphore *semaphore=NULL) |
RetVal | figureClose (unsigned int figHandle, ItomSharedSemaphore *semaphore=NULL) |
RetVal | figurePickPoints (unsigned int objectID, QSharedPointer< ito::DataObject > coords, int maxNrPoints, ItomSharedSemaphore *semaphore) |
void | figureDestroyed (QObject *obj) |
Public Member Functions | |
UiOrganizer () | |
constructor | |
~UiOrganizer () | |
destructor | |
void | showDialog (QWidget *parent) |
QObject * | getPluginReference (unsigned int objectID) |
RetVal | getNewPluginWindow (QString pluginName, unsigned int &objectID, QWidget **newWidget, QWidget *parent=NULL) |
QWidget * | loadDesignerPluginWidget (const QString &name, RetVal &retValue, AbstractFigure::WindowMode winMode, QWidget *parent=NULL) |
Static Public Member Functions | |
static void | parseUiDescription (int uiDescription, int *uiType=NULL, int *buttonBarType=NULL, bool *childOfMainWindow=NULL, bool *deleteOnClose=NULL) |
static int | createUiDescription (int uiType, int buttonBarType, bool childOfMainWindow, bool deleteOnClose) |
Static Protected Member Functions | |
static void | threadSafeDeleteUi (unsigned int *handle) |
Private Slots | |
void | watcherThreadFinished () |
Private Member Functions | |
UiContainer * | getUiDialogByHandle (unsigned int uiHandle) |
void | execGarbageCollection () |
executes the garbage collection process | |
unsigned int | addObjectToList (QObject *objPtr) |
adds a given QObject* pointer to m_objectList if not yet available. | |
QObject * | getWeakObjectReference (unsigned int objectID) |
void | timerEvent (QTimerEvent *event) |
method, called by garbage collection timer, in order to regularly start the garbage collection process | |
ito::RetVal | scanPlugins (QString path, QHash< QString, PluginInfo > &pluginInfoList) |
void | setApiPointersToWidgetAndChildren (QWidget *widget) |
Private Attributes | |
WidgetWrapper * | m_widgetWrapper |
QHash< unsigned int, UiContainerItem > | m_dialogList |
QHash< unsigned int, QWeakPointer< QObject > > | m_objectList |
int | m_garbageCollectorTimer |
QMap< QObject *, QThread * > | m_watcherThreads |
QUiLoader | m_uiLoader |
Static Private Attributes | |
static unsigned int | autoIncUiDialogCounter = 1 |
static unsigned int | autoIncObjectCounter = 1 |
< enumeration with error numbers for different errors which may occure within the class UiOrganizer
< enumeration describing possible attributes of a property of type QMetaProperty
< enumeration describing the desired type of the user interface
UiOrganizer::UiOrganizer | ( | ) |
constructor
creates the singleton instance of WidgetWrapper. The garbage collection timer is not started yet, since this is done if the first user interface becomes being organized by this class.
UiOrganizer::~UiOrganizer | ( | ) |
destructor
Deletes all remaining user interfaces, by deleting the corresponding instances of UiDialogSet. Stops a possible garbage collection timer.
unsigned int UiOrganizer::addObjectToList | ( | QObject * | objPtr | ) | [private] |
adds a given QObject* pointer to m_objectList if not yet available.
If objPtr already exists in m_objectList, the existing key (handle) is returned, else objPtr is added as new value in the hash table and an new, auto incremented handle is created and returned.
The hash table m_objectList is available, in order to increase the access to objects, which already have been used.
[in] | objPtr | is the pointer to an existing instance, which inherits QObject |
void UiOrganizer::execGarbageCollection | ( | ) | [private] |
executes the garbage collection process
both m_dialogList and m_objectList contain weak references to dialog, main windows or even widgets, which are contained in a dialog or something else. Since these widgets or windows can also be destroyed by the user, the UiOrganizer will not directly informed about this. Therefore, the garbage collection process will check both m_dialogList and m_objectList for objects, which already have been destroyed and delete these entries. Of course, we could also have established a connection to every widgets destroy-signal and delete the corresponding entry, when the destroy event will be fired. But these needs lots of connections in the Qt system, which is slower than checking for destroyed objects every 5 seconds or less. Due to the use of weak references, it is not dangerous to access an object which already has been destroyed.
void UiOrganizer::timerEvent | ( | QTimerEvent * | event | ) | [private] |
method, called by garbage collection timer, in order to regularly start the garbage collection process
unsigned int UiOrganizer::autoIncObjectCounter = 1 [static, private] |
auto incrementing counter for elements in m_objectList
unsigned int UiOrganizer::autoIncUiDialogCounter = 1 [static, private] |
auto incrementing counter for elements in m_dialogList
QHash<unsigned int, UiContainerItem> ito::UiOrganizer::m_dialogList [private] |
Hash-Table mapping a handle to an user interface to its corresponding instance of UiDialogSet
int ito::UiOrganizer::m_garbageCollectorTimer [private] |
ID of the garbage collection timer. This timer regularly calls timerEvent in order to check m_dialogList and m_objectList for objects, which already have been destroyed.
QHash<unsigned int, QWeakPointer<QObject> > ito::UiOrganizer::m_objectList [private] |
Hash-Table containing weak references to child-objects of any user interface which have recently been accessed. This hash-table helps for faster access to these objects
QMap<QObject*, QThread*> ito::UiOrganizer::m_watcherThreads [private] |
map with opened watcher threads and their containing objects (e.g. UserInteractionWatcher)
WidgetWrapper* ito::UiOrganizer::m_widgetWrapper [private] |
singleton instance to WidgetWrapper in order to access some public methods of several widgets by python