76 lines
3.0 KiB
C++
76 lines
3.0 KiB
C++
// #include <eqpalg/utility/entCentExit.h>
|
|
#include <eqpalg/utility/factory_running_state.h>
|
|
|
|
int FactoryRunningState::get_factory_running_state() {
|
|
return SingletonTemplate<
|
|
GlobaltemSharedMemory>::GetInstance()[tagname_main_speed_] >
|
|
main_speed_min_;
|
|
}
|
|
|
|
bool FactoryRunningState::is_factory_running() {
|
|
// double centSpeedSet =
|
|
// SingletonTemplate<GlobaltemSharedMemory>::GetInstance()[prefix +
|
|
// cent_speed_set];
|
|
// double centSpeedAct =
|
|
// SingletonTemplate<GlobaltemSharedMemory>::GetInstance()[prefix +
|
|
// cent_speed_set];
|
|
// double entSpeed =
|
|
// SingletonTemplate<GlobaltemSharedMemory>::GetInstance()[prefix +
|
|
// ent_speed_act];
|
|
// double exitSpeed =
|
|
// SingletonTemplate<GlobaltemSharedMemory>::GetInstance()[prefix +
|
|
// exit_speed_act];
|
|
// this->logger_->Debug()<<"centSpeedSet="<<centSpeedSet<<std::endl;
|
|
// this->logger_->Debug()<<"centSpeedAct="<<centSpeedAct<<std::endl;
|
|
// this->logger_->Debug()<<"entSpeed="<<entSpeed<<std::endl;
|
|
// this->logger_->Debug()<<"exitSpeed="<<exitSpeed<<std::endl;
|
|
// SingletonTemplate<entCentExit>::GetInstance().statusDetection();
|
|
// this->logger_->Debug()
|
|
// << "cent: " << SingletonTemplate<entCentExit>::GetInstance().isCentOK()
|
|
// << std::endl;
|
|
// this->logger_->Debug()
|
|
// << "ent :" << SingletonTemplate<entCentExit>::GetInstance().isEntOK()
|
|
// << std::endl;
|
|
// this->logger_->Debug()
|
|
// << "exit:" << SingletonTemplate<entCentExit>::GetInstance().isExitOK()
|
|
// << std::endl;
|
|
|
|
// this->logger_->Debug()
|
|
// << "cent_ihd: " <<
|
|
// SingletonTemplate<entCentExit>::GetInstance().isCentOK_ihd()
|
|
// << std::endl;
|
|
// this->logger_->Debug()
|
|
// << "ent_ihd :" <<
|
|
// SingletonTemplate<entCentExit>::GetInstance().isEntOK_ihd()
|
|
// << std::endl;
|
|
// this->logger_->Debug()
|
|
// << "exit_ihd:" <<
|
|
// SingletonTemplate<entCentExit>::GetInstance().isExitOK_ihd()
|
|
// << std::endl;
|
|
|
|
// 反复启停测试
|
|
// if (std::chrono::system_clock::now() - last_time > std::chrono::minutes(1)) {
|
|
// last_time = std::chrono::system_clock::now();
|
|
// this->logger_->Info()
|
|
// << "主速度:"
|
|
// << SingletonTemplate<
|
|
// GlobaltemSharedMemory>::GetInstance()[tagname_main_speed_]
|
|
// << endl;
|
|
// return false;
|
|
// }
|
|
// return true;
|
|
|
|
// last_state_ = now_state_;
|
|
// now_state_ = this->get_factory_running_state();
|
|
// if (now_state_) {
|
|
// if (!last_state_ && std::chrono::system_clock::now() - last_time <
|
|
// std::chrono::minutes(2)) {
|
|
// now_state_ = false;
|
|
// }
|
|
// } else {
|
|
// last_time = std::chrono::system_clock::now(); ///<上次停机时刻
|
|
// }
|
|
// return now_state_;
|
|
return true;
|
|
}
|