You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

89 lines
2.5 KiB

#ifndef GRAYMAPMANAGER_H
#define GRAYMAPMANAGER_H
#include <QMetaType>
#include "viewModel/utils/UsSimpleButton.h"
#include "viewModel/utils/UsList.h"
#include "viewModel/bMode/display/gray/GrayMap.h"
#include "viewModel/bMode/display/gray/KnobManager.h"
#include "viewModel/exception/VmError.h"
class GrayMapManager : public QObject
{
Q_OBJECT
US_PROPERTY_VIEW_ONLY(QString, grayMapTitle, "Gray Map")
US_PROPERTY_CUSTOM_SETTER_INTERNAL(qint32, grayMap, 0)
US_PROPERTY_CUSTOM_SETTER_INTERNAL(bool, grayMapReset, 0)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap0, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap1, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap2, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap3, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap4, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap5, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap6, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap7, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap8, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap9, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap10, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap11, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap12, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap13, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap14, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap15, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap16, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMap17, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMapUser1, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMapUser2, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(GrayMap*, grayMapUser3, Q_NULLPTR)
US_PROPERTY_VIEW_ONLY(KnobManager*, knobManager, new KnobManager)
US_LIST(int, currentGrayMapData)
US_SIMPLE_BUTTON(grayMapSaveAs, "Save As", "", true, true)
private:
QString _userName;
GrayMap* getGrayMap(qint32 index);
void setKnobs(GrayMap* grayMap);
QList<quint8> intListToU8List(QList<int> list);
QList<int> u8ListToIntList(QList<quint8> list);
quint32 getUserId();
bool isCustomGrayMapSelected();
void initDefaultGrayMaps();
void initUserGrayMaps(bool throwExp);
public:
GrayMapManager();
void setUserName(const QString& userName);
void init();
QList<quint8> getGrayMapData();
void setIndex(qint32 index);
signals:
void grayMapReady();
//uncrustify off
public slots:
void newCustomGrayMap(const QList<quint8>& grayMap);
void saveGrayMap(int slotNumber);
//uncrustify on
};
Q_DECLARE_METATYPE(GrayMapManager*)
#endif //GRAYMAPMANAGER_H