| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322 | /*= StarPU-Top for StarPU =Copyright (C) 2011 William BraikYann CourtoisJean-Marie CouteyenAnthony RoyThis library is free software; you can redistribute it and/ormodify it under the terms of the GNU Lesser General PublicLicense as published by the Free Software Foundation; eitherversion 2.1 of the License, or (at your option) any later version.This library is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNULesser General Public License for more details.You should have received a copy of the GNU Lesser General PublicLicense along with this library; if not, write to the Free SoftwareFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA*/#ifndef STARPU_TOP_TYPES_H#define STARPU_TOP_TYPES_H#include <QString>#include <QStringList>#include <QVector>/* -------------------------------------------------------------------------- *//* Display modes                                                              *//* -------------------------------------------------------------------------- */enum DisplayMode{    DISPLAY_FLYING_WINDOWS = 0, DISPLAY_MDI_NORMAL = 1,};/* -------------------------------------------------------------------------- *//* Widgets                                                                    *//* -------------------------------------------------------------------------- */// Typesenum DataWidgetType{    // Data widgets    /** You must pass any modification to the following functions :	 MainWindow::initDataWidgetLists(),	 DataWidget::DataWidget(),	 DataWidget::updateValue() **/    DATA_WIDGET_NONE = -1,    DATA_WIDGET_LCD = 0,    DATA_WIDGET_PLOT = 1,    DATA_WIDGET_LEVEL = 2,    DATA_WIDGET_LED = 3,    DATA_WIDGET_DIAL = 4,};enum InteractiveWidgetType{    // Interactive widgets    /** You must pass any modification to the following functions :	 MainWindow::initInteractiveWidgetLists(),	 InteractiveWidget::InteractiveWidget() **/    INTERACTIVE_WIDGET_NONE = -1,    INTERACTIVE_WIDGET_SLIDER = 0,    INTERACTIVE_WIDGET_KNOB = 1,    INTERACTIVE_WIDGET_WHEEL = 2,    INTERACTIVE_WIDGET_CHECKBOX = 3,    INTERACTIVE_WIDGET_SPINBOX = 4,    INTERACTIVE_WIDGET_DOUBLESPINBOX = 5,    INTERACTIVE_WIDGET_DIAL = 6,    INTERACTIVE_WIDGET_COMBOBOX = 7,};static const DataWidgetType DEFAULT_DATA_WIDGET_BOOL = DATA_WIDGET_LED;static const DataWidgetType DEFAULT_DATA_WIDGET_INT = DATA_WIDGET_LCD;static const DataWidgetType DEFAULT_DATA_WIDGET_FLOAT = DATA_WIDGET_LCD;static const InteractiveWidgetType DEFAULT_INTERACTIVE_WIDGET_BOOL =        INTERACTIVE_WIDGET_CHECKBOX;static const InteractiveWidgetType DEFAULT_INTERACTIVE_WIDGET_INT =        INTERACTIVE_WIDGET_SPINBOX;static const InteractiveWidgetType DEFAULT_INTERACTIVE_WIDGET_FLOAT =        INTERACTIVE_WIDGET_DOUBLESPINBOX;static const InteractiveWidgetType DEFAULT_INTERACTIVE_WIDGET_ENUM =        INTERACTIVE_WIDGET_COMBOBOX;enum DataType{    // Data    /** If types were to be added the following functions should be updated :	 PreferencesDialog::initDataWidgetLists() **/    DATA_TYPE_BOOL = 0,    DATA_TYPE_INT = 1,    DATA_TYPE_FLOAT = 2,};enum ParamType{    // Params    /** If types were to be added the following functions should be updated :	 PreferencesDialog::initInteractiveWidgetLists() **/    PARAM_TYPE_BOOL = 0,    PARAM_TYPE_INT = 1,    PARAM_TYPE_FLOAT = 2,    PARAM_TYPE_ENUM = 4,};enum starpu_top_device_type{    SERVERDEVICE_CPU = 0,    SERVERDEVICE_CUDA = 1,    SERVERDEVICE_OPENCL = 2,    SERVERDEVICE_GORDON = 3,};// Server devicestypedef struct{    int id;    starpu_top_device_type type;    QString name;} starpu_top_device;// Server taskstypedef struct{    int taskId;    int deviceId;    qlonglong timestampStart;    qlonglong timestampEnd;} starpu_top_task;// Descriptionstypedef struct{ // Certain fields must be ignored depending on type    int id;    QString descriptionString;    DataWidgetType widget;    DataType type;    double valMax;    double valMin;} DataDescription;typedef struct{ // Certain fields must be ignored depending on type    int id;    QString descriptionString;    InteractiveWidgetType widget;    ParamType type;    bool valInitBool;    int valInitInt;    double valInitDouble;    int valInitEnum;    double valMax;    double valMin;    QStringList enumValues;} ParamDescription;/* --------------------------------------------------------------------------- *//* Widget lists items data                                                     *//* --------------------------------------------------------------------------- */typedef struct{    int id;    DataWidgetType widget;} DataWidgetListItemData;typedef struct{    int id;    InteractiveWidgetType widget;} InteractiveWidgetListItemData;/* --------------------------------------------------------------------------- *//* Plot curves data                                                            *//* --------------------------------------------------------------------------- */typedef struct{    QVector<double> *xData;    QVector<double> *yData;} CurveData;/* --------------------------------------------------------------------------- *//* Communication Manager states                                                *//* --------------------------------------------------------------------------- */enum CommunicationState{    COM_STATE_INIT = 0,    COM_STATE_INIT_SERVERINFO = 1,    COM_STATE_INIT_DATA = 2,    COM_STATE_INIT_PARAMS = 3,    COM_STATE_INIT_DEV = 4,    COM_STATE_READY = 8,    COM_STATE_LOOP = 10,};/* --------------------------------------------------------------------------- *//* Communication protocol messages                                             *//* --------------------------------------------------------------------------- */enum CommunicationInMessageType{    /* Complete commands */    COM_MSG_IN_TYPE_BOOL = 0,    COM_MSG_IN_TYPE_INT = 1,    COM_MSG_IN_TYPE_FLOAT = 2,    COM_MSG_IN_TYPE_ENUM = 3,    COM_MSG_IN_SERVERINFO_BEGIN = 5,    COM_MSG_IN_SERVERINFO_END = 6,    COM_MSG_IN_DATA_BEGIN = 10,    COM_MSG_IN_DATA_END = 11,    COM_MSG_IN_PARAMS_BEGIN = 20,    COM_MSG_IN_PARAMS_END = 21,    COM_MSG_IN_DEV_BEGIN = 30,    COM_MSG_IN_DEV_END = 31,    COM_MSG_IN_DEV_CPU = 32,    COM_MSG_IN_DEV_CUDA = 33,    COM_MSG_IN_DEV_OPENCL = 34,    COM_MSG_IN_DEV_GORDON = 35,    COM_MSG_IN_READY = 40,    COM_MSG_IN_SET = 50,    COM_MSG_IN_PREV = 60,    COM_MSG_IN_START = 61,    COM_MSG_IN_END = 62,    COM_MSG_IN_UPDATE = 70,    COM_MSG_IN_DEBUG = 80,    COM_MSG_IN_DEBUG_ON = 81,    COM_MSG_IN_DEBUG_OFF = 82,    COM_MSG_IN_DEBUG_MESSAGE = 83,    COM_MSG_IN_DEBUG_LOCK = 84,    /* Shortened commands */    COM_MSG_IN_SHORT_UPDATE = 100,    COM_MSG_IN_SHORT_PREV = 110,    COM_MSG_IN_SHORT_START = 111,    COM_MSG_IN_SHORT_END = 112,};enum CommunicationOutMessageType{    /* Complete commands */    COM_MSG_OUT_GO = 0,    COM_MSG_OUT_ENABLE = 10,    COM_MSG_OUT_DISABLE = 11,    COM_MSG_OUT_SET = 20,    COM_MSG_OUT_DEBUG = 30,    COM_MSG_OUT_DEBUG_ON = 31,    COM_MSG_OUT_DEBUG_OFF = 32,    COM_MSG_OUT_DEBUG_STEP = 33,};/* --------------------------------------------------------------------------- *//* Session setup data for loading session setups                               *//* --------------------------------------------------------------------------- */typedef struct{    int id;    DataType type;    DataWidgetType widget;} DataDescriptionSetup;typedef struct{    int id;    ParamType type;    InteractiveWidgetType widget;} ParamDescriptionSetup;typedef struct{    QByteArray geometry;    DisplayMode displayMode;} MainWindowSetup;typedef struct{    bool floating;    QByteArray geometry;} ParametersDockSetup;typedef struct{    bool inside;    QByteArray geometry;    int dataId;} DataWidgetSetup;typedef struct{    bool inside;    QByteArray geometry;    QList<int> dataIds;} DataAggregatorWidgetSetup;#endif // STARPU_TOP_TYPES_H
 |