26 lines
680 B
C++
26 lines
680 B
C++
#include <eqpalg/utility/equip_prod.h>
|
|
#include <T_PDO_RULE.h>
|
|
#include <base/TCMTime.h>
|
|
#include <eqpalg/utility/build_alarm_info.h>
|
|
#include <mix_cc/type/mix_time.h>
|
|
|
|
using std::string;
|
|
namespace utility {
|
|
int equip_prod(const string& ruleId, const string& entId, const int start,
|
|
const int end, const float speed) {
|
|
T_PDO_RULE pdo;
|
|
pdo.initInsertKeys(ruleId.c_str(),
|
|
(char*)(baosight::TCMTime::Now().ToString().c_str()));
|
|
pdo.set_entId(entId.c_str());
|
|
pdo.set_speed(speed);
|
|
pdo.set_start(start);
|
|
pdo.set_end(end);
|
|
if (pdo.insertDB() != NULL) {
|
|
pdo.dbRollback();
|
|
}
|
|
pdo.dbCommit();
|
|
|
|
return 0;
|
|
}
|
|
} // namespace utility
|