#ifndef M_JSON_H #define M_JSON_H #include #include #include #include #include #include #include #include class JsonFunc : public QObject { Q_OBJECT public: QByteArray MotorPosInit(); //每次对焦前,电机位置初始化 QByteArray MotorMove(QString select,QString setup,QString speed); QByteArray Autofocus(); QByteArray ImageFunc(double m_focus); QByteArray BoardMessage(); QByteArray ReadBoardData(); QByteArray MakeJsonWarn(const QString &status,const QString &type); QByteArray WillMessage(); QByteArray setLedState(bool sw); QByteArray CollectFan_ctr(bool sw); QByteArray Jiaodai_ctr(bool sw); QByteArray AutoTest(bool sw); QByteArray CmdUpdate(); QByteArray CmdReboot(); QByteArray CmdParamconf(int sh1,int eh1,int sh2,int eh2,int sh3,int eh3); QByteArray CmdParamconf_min(int sh1,int eh1,int sh2,int eh2,int sh3,int eh3); QByteArray CmdParamconf_xy_dis(int x_dis,int y_dis); QByteArray CmdParamconf_temp(int tpl,int tph); QByteArray CmdFocus(); QByteArray WarnPhoto(QString err); QByteArray MakeJsonRPC(const QString &methord,const QString &value); signals: void motor_initsuccess(); void motor_movesuccess(); public slots: void setmqttState_d(); void setmqttState_c(); private: QString getLteRsrp() { auto qtContext = QJniObject(QNativeInterface::QAndroidApplication::context()); //activity jint rsrp = QJniObject::callStaticMethod("com/yfkj/cb/Q6iot/StatusBarCtr", "getRsrp", "(Landroid/content/Context;)I", qtContext.object()); LOG("信号强度:{}",rsrp); if(rsrp==4){ return "优秀"; }else if(rsrp==3){ return "良好"; }else if (rsrp==2) { return "一般"; } else if (rsrp==1){ return "差"; }else if (rsrp==0){ return "NoSignal"; // 无效值 } return "NoSignal"; // 无效值 } }; #endif // M_JSON_H