2019-02-10 14:32:15 +01:00
|
|
|
#ifndef HPDATA_H
|
|
|
|
#define HPDATA_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2019-02-10 14:43:00 +01:00
|
|
|
#include <QString>
|
|
|
|
#include "hpusb.h"
|
2019-02-10 14:32:15 +01:00
|
|
|
|
2019-02-10 14:43:00 +01:00
|
|
|
enum DataType {
|
|
|
|
HP_MAIN=0,
|
|
|
|
HP_APP=1,
|
|
|
|
HP_CAS=2,
|
|
|
|
HP_COMPLEX=3,
|
|
|
|
HP_LIST=4,
|
|
|
|
HP_MATRIC=5,
|
|
|
|
HP_NOTE=6,
|
|
|
|
HP_PROG=7,
|
|
|
|
HP_REAL=8,
|
2019-02-17 17:24:52 +01:00
|
|
|
HP_VAR=9,
|
|
|
|
HP_SCREEN=10
|
2019-02-10 14:43:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct hp_Information {
|
|
|
|
QString name="---";
|
|
|
|
QString serialnum="---";
|
|
|
|
QString appver="-";
|
|
|
|
QString osver="-";
|
|
|
|
};
|
|
|
|
|
2019-02-12 21:48:35 +01:00
|
|
|
struct hp_Settings {
|
|
|
|
int angle_measure=0;
|
|
|
|
int number_format=0;
|
|
|
|
int precision=5;
|
|
|
|
int digit_grouping=0;
|
|
|
|
int entry=2;
|
|
|
|
int integers=3;
|
|
|
|
int bits=32;
|
|
|
|
bool signed_int=false;
|
|
|
|
int complex=0;
|
|
|
|
int language =1;
|
|
|
|
int font_size=2;
|
|
|
|
int theme=1;
|
|
|
|
bool textbook=true;
|
|
|
|
bool menu=false;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-02-10 14:43:00 +01:00
|
|
|
struct hpDataStruct {
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2019-02-17 17:24:52 +01:00
|
|
|
class hpCalcData;
|
|
|
|
|
|
|
|
struct hp_ScreenShot {
|
|
|
|
QPixmap * image;
|
|
|
|
hp_screenshot_format format;
|
|
|
|
hpCalcData * calc;
|
|
|
|
};
|
|
|
|
|
2019-02-10 14:43:00 +01:00
|
|
|
struct hp_Change {
|
|
|
|
DataType dataChange=HP_MAIN;
|
2019-02-17 17:24:52 +01:00
|
|
|
hpCalcData * calc;
|
2019-02-10 14:43:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class hpCalcData: public QObject
|
2019-02-10 14:32:15 +01:00
|
|
|
{
|
2019-02-10 14:43:00 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
|
|
|
const static QString func_list[][2];
|
|
|
|
const static DataType func_type[];
|
2019-02-17 17:24:52 +01:00
|
|
|
QPixmap * screenShot=nullptr;
|
2019-02-10 14:43:00 +01:00
|
|
|
DataType type;
|
|
|
|
hpusb * hp_api;
|
|
|
|
hp_Handle hp_handle;
|
|
|
|
hp_Information hp_info;
|
2019-02-12 21:48:35 +01:00
|
|
|
hp_Settings hp_homesettings;
|
2019-02-10 14:43:00 +01:00
|
|
|
|
2019-02-10 14:32:15 +01:00
|
|
|
public:
|
2019-02-10 14:43:00 +01:00
|
|
|
hpCalcData(hpusb * hpapi);
|
|
|
|
~hpCalcData();
|
|
|
|
hp_Handle * getHandle();
|
|
|
|
hpusb * getAPI();
|
|
|
|
void setInfo(hp_Information);
|
|
|
|
void readInfo();
|
2019-02-12 21:48:35 +01:00
|
|
|
void readSettings();
|
2019-02-17 17:24:52 +01:00
|
|
|
void readScreen();
|
|
|
|
hp_ScreenShot getScreenShot();
|
2019-02-10 14:43:00 +01:00
|
|
|
hp_Information getInfo();
|
|
|
|
QString getName();
|
2019-02-12 21:48:35 +01:00
|
|
|
hp_Settings getSettings();
|
|
|
|
int setSettings(hp_Settings set);
|
2019-02-10 14:43:00 +01:00
|
|
|
void vpkt_send_experiments(int );
|
2019-02-17 17:24:52 +01:00
|
|
|
void emitChange(DataType type);
|
2019-02-10 14:43:00 +01:00
|
|
|
|
|
|
|
//public slots:
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void dataChanged(hp_Change datachange);
|
2019-02-10 14:32:15 +01:00
|
|
|
};
|
|
|
|
|
2019-02-10 14:43:00 +01:00
|
|
|
#endif // HPDATA_H
|
|
|
|
|
|
|
|
|