#ifndef OPERATING_RATE_H #define OPERATING_RATE_H #include "three_rates.h" #include "tr_tool.h" #include #include class operating_rate { public: // Function: Constructor operating_rate(); // Function: Destructor ~operating_rate(); // Function: Get restart mark bool get_restart() const { return m_brestart; } // Function: Get zero time mark bool get_zero() const { return m_bzero; } /* * Functon: Init drivingface and coalface vehicle * Parameters: void * Returns: int, returns 0 normally, otherwise it returns 1 * Throws: void */ int init_coaldrivingface_vehicle(); /* * Functon: Update the unprocessed record across days * Parameters: void * Returns: int, returns 0 normally, otherwise it returns 1 * Throws: void */ int zero_update_unprocess_record(time_t tCurTime); //判断是否零点 再更新 void zeroes_update(); /* * Functon: Update the unprocessed record when restarting * Parameters: tCurTime time_t * Returns: int, returns 0 normally, otherwise it returns 1 * Throws: void */ int restart_update_unprocess_record(); /* * Functon: Get the schedule startup time of vihicle * Parameters: void * Returns: void * Throws: void */ void get_schedulestartuptime(int cardType, std::string strCard, double &scheduleStartupTime,std::string strDate); double get_schedulestartuptime(int work_face_id,const std::string &strDate); /* * Functon: Get vibrate threthold of vihicle * Parameters: void * Returns: void * Throws: void */ void get_vibratethrethold(std::shared_ptr card, int& threshold); /* * Functon: Open machine * Parameters: card, coalface or drivingface card * Returns: int, returns 0 normally, otherwise it returns 1 * Throws: void */ int open_machine(std::shared_ptr card); /* * Functon: Close machine * Parameters: card, coalface or drivingface card * Returns: int, returns 0 normally, otherwise it returns 1 * Throws: void */ int close_machine(std::shared_ptr card, bool bTimeOut = true); /* * Functon: Store machine state * Parameters: card, coalface or drivingface card * Returns: int, returns 0 normally, otherwise it returns 1 * Throws: void */ int store_machine_state(std::shared_ptr card); private: bool m_bzero; bool m_brestart; public: coaldrivingface_map m_coaldrivingface_map; public: //车卡状态标记:开状态 的个数 表示开机 static const int STARTUP_STATE_COUNT = 7; //车卡状态标记:关状态 的个数 表示关机 static const int SHUTDOWN_STATE_COUNT = 3; static const int SEC_TO_HOUR = 3600; }; #endif