eis/inc/cda/RollDefine.h

102 lines
2.0 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef _ROLL_DEFINE_H_
#define _ROLL_DEFINE_H_
#include <string>
#include <vector>
#include "dbinc/T_ROL_DATA.h"
//2010年6月24日徐长盛初建
using namespace std;
namespace baosight
{
const int ROLLNOLENGTH = 10;
const int MAX_STAND = 40;//最多的机架数
enum ChangeRollModeEnum{
WORK_ROLL = 0x2000,
MID_ROLL = 0x4000,
BUR_ROLL = 0x8000,
UP_B_ROLL = 0x1000,
DN_B_ROLL = 0x0800
};
//轧辊统计数的数据
struct RollProdData
{
int length;//轧制长度
int weight; //轧制重量
int time; //轧制时间
string coilId; //最后轧制的钢卷号
};
class RollInfo
{
public:
RollInfo(T_ROL_DATA& dbData)
{
dataFromDb = dbData;
m_status = dbData.RollStatus();
m_rollno = dbData.RollNo();
m_pos = dbData.RollPosition();
string type = dbData.RollType();
m_type = type;
}
RollInfo()
{
}
virtual ~RollInfo()
{
}
void SetRollData(const T_ROL_DATA& dbData)
{
dataFromDb = dbData;
m_status = dbData.RollStatus();
m_rollno = dbData.RollNo();
m_pos = dbData.RollPosition();
string type = dbData.RollType();
m_type = type;
m_stand = dbData.StandNo(); //need change type
}
void SetRollData(const T_ROL_DATA& dbData,short standNo)
{
dataFromDb = dbData;
m_status = dbData.RollStatus();
m_rollno = dbData.RollNo();
m_pos = dbData.RollPosition();
string type = dbData.RollType();
m_type = type;
m_stand = standNo; //need change type
}
string ToString()
{
return "rollNo:"+m_rollno+",status:"+m_status;+",type:"+m_type;
}
string GetRollNo(){return m_rollno;}
string GetRollStatus(){return m_status;}
string GetRollPos(){return m_pos;}
int GetRollStand(){return m_stand;}
string GetRollType(){ return m_type; }
T_ROL_DATA GetDataFromDB(){return dataFromDb;}
private:
string m_rollno;
string m_type;//轧辊类型
string m_status;//轧辊状态
string m_pos;//轧辊位置
int m_stand; //机架号从1开始
T_ROL_DATA dataFromDb;//详细的轧辊数据
};
typedef vector<RollInfo>VecRoll;
};
#endif