eis/inc/cda/MtrDefine.h

207 lines
4.6 KiB
C++

#ifndef _MTR_DEFINE_H
#define _MTR_DEFINE_H
#include <common/BasicStruct.h>
#include <map>
using namespace baosight;
using namespace std;
class Location;
#define CS_N_PORLENREMAIN 50
#define CS_N_EXIT_LENGTH_MIN 100
#define LENGTH_CUT 0
#define WELD_CUT 1
#define COMBINE_WELD_CUT 2
#define COMBINE_LENGTH_CUT 3
//占位信息
#define EntryUpNum 5 //入口上通道位置数目
#define EntryDownNum 5 //入口上通道位置数目
#define E1SKID1 1
#define E1SKID2 2
#define E1SKID3 3
#define E1SKID4 4
#define E1POR1 5
#define E2SKID1 11
#define E2SKID2 12
#define E2SKID3 13
#define E2SKID4 14
#define E2POR2 15
#define L1ImageBit 8 //L1映像的二进制数
// 0, 1,2, 3,4, 5, 6, 7,8,9, 10 11 12 13 14 15 16
const short iBitPos[17] = {-1,1,2,-1,3,-1,-1,-1,4,-1,-1,-1,-1,-1,-1,-1,5};
const short iEntryPosition[2][5]={ \
{E1SKID1,E1SKID2,E1SKID3,E1SKID4,E1POR1}, \
{E2SKID1,E2SKID2,E2SKID3,E2SKID4,E2POR2}};
//const short iExitPosition[2][5]={ \
//{E1SKID1,E1SKID2,E1SKID3,E1SKID4,POR1}, \
//{E2SKID1,E2SKID2,E2SKID3,E2SKID4,POR2}};
struct S_L2_TRACK_IMAGE_S
{
short pos_no;
short intercoilid;
char coil_id[21];
char pos_name[21];
char spe0[20];
int channel;//通道号
int flag;//是否有钢卷
};
enum ChannelEnum
{
ENTRY_UP, //入口上通道
ENTRY_DOWN,//入口下通道
ENTRY_WALKBEAM,
EXIT_UP,
EXIT_DOWN, //出口
EXIT_WALKBEAM
};
class PosNo
{
public:
static const int ENSKID1 = 1;
static const int ENSKID3 = 11;
static const int POR1 = 5;
static const int POR2 = 15;
static const int TR1 = 81;
static const int EXCAR3 = 82;
static const int EXRCVCAR1 = 83;
static const int TR2 = 101;
static const int EXCAR4 = 102;
static const int EXRCVCAR2 = 103;
static const int WEIGHT = 85;
static const int PRODUCTIONPOS = 86;
static const int ENTRYENDPOS = 30;//map
static const int EXITSTARTPOS = 100;//map
static const int EXITENDPOS = 250;//map
static const int EXITWBSTARTPOS = 202;//CCYC步进梁移动开始位置
static const int EXITWBENDPOS = 209; //CCYC步进梁移动结束位置
};
class TrackEvent
{
public:
static const int LoadCoil = 1000;//
static const int UnLoadCoil = 1003;//
static const int EntryWalkBeamMove = 1002;//
static const int RequestCoil = 1100;
static const int EntryBook = 1110;
static const int EntryCoilMove = 1005;//
static const int EntryLeave = 1104;
static const int EntryCut = 1106;
static const int ExitFirstCut = 1116;
static const int ExitFinalCut = 1118;
static const int ExitCoilMove = 1200;
static const int ExitWalkBeamMove = 1202;
static const int ExitWeight = 1216;
static const int EntrySyn = 1218;
static const int ExitSyn = 1219;
static const int ExitSimCut = 1220;
static const int ExitUnload = 1222;
static const int EntryConfirm = 1230;
};
class MTREvent
{
public:
static const int EntryScrap = 2000;
static const int ExitScrap = 2100;
static const int ExitScrapSta = 2200;
};
//钢卷请求
struct S_RequstCoil
{
short PORNo;//开卷机号
short InterCoilID;//内部钢卷ID
};
//钢卷进入机组
struct S_EntryBook
{
short InterCoilID;//内部钢卷ID
short LastInterCoilID;//前一卷内部钢卷ID
};
//钢卷入口剪切
struct S_EntryCut
{
short InterCoilID;//内部钢卷Id
short CutFlag;//剪切类型
short LengthRemain;//入口剪刀后剩余钢卷长度
short OutDiaRemain;//开卷机上剩余钢卷外径
short EntryLength;//入口卷进入机组的带钢长度
short CutCount;//头部废料剪切刀数
short CutLength;//入口卷头部/尾部废料剪切长度
};
//入口甩尾
struct S_EntryOffPOR
{
short PORNo;//开卷机号
};
//第一刀剪切的结构体
struct S_FirstCut
{
short FirstInterCoilID;//第一卷入口卷内部钢卷ID
short SecondInterCoilID;//第二卷入口卷内部钢卷ID
short TRNo;//卷取机号
short TrimWidth;//卷取机号
short CutMode;//切边宽度
short SPMMode;//平整机使用模式
short Length;//出口卷长度
short OuterDia;//出口卷外径
short InnerDia;//出口卷内径
short SleeveCode;//出口套筒代码
short CoilingType;//卷取方式
DEFECTS defectData;
S_COMBI combi; //并卷信息
};
//最后一刀剪切的结构体
struct S_FinalCut
{
short CutMode;//前一卷剪切模式
short InterCoilID;//新钢卷的内部钢卷ID
short ActHeadSampleNum;//新钢卷头部取样数
short ActHeadCutLength;//新钢卷头部剪切长度
short TRNo;//新钢卷TR ON的卷取机号
short ActLengthPrimaryCoil;//入口卷通过出口剪刀的入口卷长度
short LastInterCoilID;//前一卷的内部钢卷ID
short ActLastTailSampleNum;//前一卷钢卷尾部样品数
short ActLastTailCutLength;//前一卷钢卷尾部剪切长度
};
struct S_MOVE
{
int from;
int to;
int direction;
};
struct S_ENTRY_CONFIRM
{
int posNo;
char coilId[21];
};
#endif