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.
|
|
#pragma once
#include "uappbase/appcfg/appcfg.hpp"
#include "uappbase/appdep.hpp"
#include "uappbase/bean/bean.hpp"
//
#include "app_protocols/ble_through/ble_proto.h"
namespace iflytop { using namespace std; #define GSM GStateMgr::ins()
#define CH_NUM 4
class GStateMgr { private: bool m_powerOn = true;
/**
* @brief �û�״̬ */ char m_loginUsr[MAX_USR_NAME_SIZE + 1]; int m_loginUsrId = -1; user_role_t m_loginUsrType = kuser; bool m_isLogin = false;
/**
* @brief ң����״̬ */ int32_t m_RemoterS; // ң����״̬ 1:����,0:����
char m_RemoterName[20];
/**
* @brief �豸����״̬ */ hand_acid_mode_t m_RunMode = khand_acid_m_jog_mode; // ����ģʽ
bool m_pumpSelectState[CH_NUM] = {false}; // ѡ���ı�
/**
* @brief ͳ������ */ float acidUsed[CH_NUM] = {0.0}; float acidRemain[CH_NUM] = {0.0};
zmutex m_mutex = {"GStateMgr"}; public: bool supperAdmin = false;
public: static GStateMgr* ins() { static GStateMgr instance; return &instance; }
void initialize();
/**
* @brief powerOn * */
void setPowerOn(bool state) { m_powerOn = state; } bool getPowerOn() { return m_powerOn; }
/**
* @brief �û�״̬ */
void setLogin(int loginUsrId, const char* usrName, user_role_t role); void setUnLogin();
bool isLogin(); user_role_t getLoginUsrType(); const char* getLoginUsr(); int getUserId();
/**
* @brief ң����״̬ */
void setRemoterS(int32_t state, const char* name); void setRemoterHeart(int32_t state, uint8_t * name); const char* getRemoterName();
/**
* @brief �豸����״̬ */ void setRunMode(hand_acid_mode_t mode); void changeToNextRunMode(); void setPumpSelectState(int32_t index, bool state);
int32_t getRemoterS(); hand_acid_mode_t getRunMode(); bool isHasPumpSelect(); bool getPumpSelectState(int32_t index);
/**
* @brief ͳ������ */
/**
* @brief * * * 1.ʣ����: * .����ʱ�� * .����ʱ�� * * 2.ʹ����: * .��¼ʱ��ʼ��Ϊ�� * .ʹ��ʱ���ģ�ʵʱ�洢 * .�dz�ʱ���㣬���洢 * * �������ݿ� * .���� * .ʹ�ü�¼ * * 1. * */
void setAcidRemain(int32_t index, float val); void setAcidUsed(int32_t index, float val);
float getAcidRemain(int32_t index); float getAcidUsed(int32_t index);
//
void placeHolder() {} };
} // namespace iflytop
|