eis/inc/zlib/zoneDef.h

226 lines
8.0 KiB
C
Raw Normal View History

#ifndef _H_ZONE_DEF_H_
#define _H_ZONE_DEF_H_
#ifdef WIN32
#pragma warning(disable : 4996)
#endif
#include <sstream>
#include <string>
using namespace std;
#define ROLLBACK 1 /*Allow the strip to retreat*/
const int COIL_LEN_MAX = 21; /* coil id max length */
// const int COIL_LEN_MIN = 100; /* min coil length m */
const int ZONE_ROW_MAX = 20000; /* zone memery max rows */
const int ZONE_DATA_SIZE = 64; /* zone memery float or bool data size */
const int TRK_COIL_MAX = 8; /* track coil max */
const int TRK_CUT_MAX = 20; /* track coil cut max */
const int COIL_CUT_MAX = 30; /* track coil cut max */
const int TRK_PASS_MAX = 20; /* track coil pass max */
const int PASS_LIST_MAX = 100; /* pass list cached max */
// const int COLLECT_LEN_MIN = 1; /* collect length min */
const int CANCEL_WELD_MIN = 50000; /* cancel weld min length mm */
const int TEL_CACHE_SIZE = 10; /* the size of tel cached*/
// const int FDA_SIZE=8192; /* the size of fda*/
const int FDA_SIZE = 5000; /* the size of fda*/
// const int PLC_SIZE=10240; /* the size of fda*/
// const int TI_CYC_COUNT = 999; /* the size of fda*/
const int TRK_ALARM_MAX = 10000; /* track coil alarms max */
const int ALARM_LIST_MAX = 20; /* alarm list cached max */
const int TAG_NAME_MAX = 100;
const string CS_ENTIDBOOK = "ENTIDBOOK"; /* the size of fda*/
// const string UNIT_NO="708";
namespace baosight {
typedef float FDA_DATA[FDA_SIZE];
typedef int IDA_DATA[FDA_SIZE];
typedef char PLC_DATA[FDA_SIZE * 4];
struct GLB_CONST {
float BrDia[10]; // <20><><EFBFBD><EFBFBD>
float BrGr[10]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int pulseMax; /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ*/
int pulseChange; /*<2A><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>һȦ<D2BB><C8A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>仯*/
int coilLenMin; /*min coil length m*/
float collectLen; /*collect length min m*/
int cycleTi; /*cycle ti max*/
int weld_adjust_range; /*wpd adjust range */
int ecut_zone; /*entry shear cut zone pos*/
int dcut_zone; /*exit shear cut zone pos*/
int event_start_znode; /* eventno start znode */
int event_end_znode; /* eventno end znode */
int event_start_L1tele; /* eventno start L1tele */
int event_end_L1tele; /* eventno end L1tele */
int pdo_length_L2mode; /* pdo length is use l2 length mode*/
char UnitNo[10]; /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
char PreVar[10]; /*0-8 store wpd pos */
char cspare[10][10];
int nspare[68]; /* 0-5 storce BR<42>ֱ<EFBFBD><D6B1><EFBFBD>*/
char printTel[10];
float loop_min; /*loop min % */
int multi_pass; /*Multipass unit*/
int tsdb_post; /*<2A>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD>ݵ<EFBFBD>TSDB*/
char tsdb_etl_pdi[10]; /*TSDB<44><42><EFBFBD>ݳ<EFBFBD>ȡPDI<44>¼<EFBFBD>*/
char tsdb_etl_pdo[10]; /*TSDB<44><42><EFBFBD>ݳ<EFBFBD>ȡPDO<44>¼<EFBFBD>*/
int event_eis_start; /* eventno start eis */
int event_eis_end; /* eventno end eis */
char eis_tagname_main_speed[20]; /*main speed tag name*/
char ent_main_speed[20]; /*<2A><>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٶ<EFBFBD>*/
char acd_main_speed[20]; /*<2A><>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٶ<EFBFBD>*/
char axt_main_speed[20]; /*<2A><>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٶ<EFBFBD>*/
char tcm_main_speed[20]; /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٶ<EFBFBD>*/
char ent_run_state[20]; /*<2A><>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
char acd_run_state[20]; /*<2A><>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
char axt_run_state[20]; /*<2A><>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
char tcm_run_state[20]; /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
int eis_qihd_interval_time; /* ihd<68><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯʱ<D1AF><CAB1> */
int AlarmIntervalHours; /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>*/
bool is_print_eqpalg_mon_threading_info; /*eqpalg-mon<6F><6E>־<EFBFBD><D6BE>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>*/
char auto_entId[20];
char printRuleid[50]; /*<2A><>Ҫ<EFBFBD><D2AA>ӡDebugcheck<63><6B>־<EFBFBD><D6BE>ruleid*/
};
struct GLB_TRK {
int ti; /* current new index TI */
int prechannel; /* before welder channel */
int extchannel; /* exit channel */
long trlength; /* tr coil length mm */
int zoneSize; /* track zone size */
int spare[126]; /*0-8 store wpd pos */
char cspare[10][10];
};
struct GLB_VAR {
GLB_TRK gbtrk;
GLB_CONST gbconst;
};
class CS_TRK {
public:
static const int CURRENT = 0; // current track data
static const int PREVIOUS = 1; // before cycle track data
static const int BEFORE = 2; // before coil track data
};
class CS_CUT {
public:
static const int ENTHEAD = 0; // head of shear
static const int ENTDIVIDE = 1; // entry divide
static const int ENTTAIL = 2; // tail shear
static const int EXTDIVIDE = 3; // exit divide
static const int EXTHSCRAP = 4; // exit head scrap
static const int EXTCSCRAP = 5; // exit centet scrap
static const int EXTTSCRAP = 6; // exit tail scrap
static const int EXTHSAMPLE = 7; // exit head sampling
static const int EXTCSAMPLE = 8; // exit center sampling
static const int EXTTSAMPLE = 9; // exit tail sampling
};
struct ZONE_ROW {
int index; /* index */
// char time[16]; /* time */
float offset; /* offset length */
int ti; /* coil index TI */
// char entId[COIL_LEN_MAX]; /* entry coil id */
// char extId[COIL_LEN_MAX]; /* exit coil id */
short count; /* float datas count */
short bcount; /* bool datas count */
float data[ZONE_DATA_SIZE]; /* zone collect datas */
char bdata[ZONE_DATA_SIZE]; /*0:ture ,1:false*/
};
typedef ZONE_ROW ZONE[ZONE_ROW_MAX];
struct CUT_UNIT {
int ti; /* coil index TI */
int mode; /* 0:head of shear, 1:entry divide 2:tail shear 3:exit scrap 4: exit
sampling 5:exit divide*/
long length; /* length [mm] */
int start; /* The start position in the parent coil[mm] */
int end; /* The end position in the parent coil [mm] */
char entId[COIL_LEN_MAX]; /* entry coil id */
char extId[COIL_LEN_MAX]; /* exit coil id */
};
typedef CUT_UNIT COIL_CUT[COIL_CUT_MAX];
typedef COIL_CUT TRK_CUTS[TRK_CUT_MAX];
struct WPD_UNIT {
char entId[COIL_LEN_MAX]; /*entry coil */
char prentId[COIL_LEN_MAX]; /* before entry coil*/
char wpdname[COIL_LEN_MAX];
int wpdnum; /*the position of wpd*/
int distance; /*the distance of wpd*/
long pwplen;
int L1wplen;
};
struct TRK_UNIT {
int ti; /* coil index TI */
char entId[COIL_LEN_MAX]; /* entry coil id */
char extId[COIL_LEN_MAX]; /* exit coil id */
int start; /* start point for zone */
int end; /* end point for zone */
long wplen; /* wpdx to weld pos len [mm] */
float distance; /* zone distance [mm] */
float distanceLoopFix; /* zone loop 0% fixed distance [mm] */
float distanceLoopVar; /* zone loop 0% ~ 100% variable distance [mm] */
short groupno; /* same speed range */
short loopno; /* looping number */
int step; /* One cycle step [mm]*/
int shift; /* coil shift flag*/
int shiftlength; /* coil shift length*/
int eventno; /* coil eventno */
int plczone; /* plc track zone */
float elgfactor;
char time[16]; /* entry zone begin time */
};
typedef TRK_UNIT TRK_ZONE[TRK_COIL_MAX];
struct PASS_UNIT {
int start; /* start point for zone */
int end; /* end point for zone */
long length; /* the pass length [mm] */
};
struct PASS_COIL {
int ti; /* coil index TI */
char entId[COIL_LEN_MAX]; /* entry coil id */
int passno; /* pass num ,index from 0 */
PASS_UNIT pass[TRK_PASS_MAX];
};
typedef PASS_COIL PASS_COILS[PASS_LIST_MAX];
// struct TAG_CAL
//{
// char tagName[TAG_NAME_MAX];
// double avg;
// time_t start;
// time_t end;
//};
struct ALARM_UNIT {
char item[50];
float up;
float down;
int start; /* start wplen mm */
int end; /* end wplen mm */
};
struct ALARM_COIL {
int ti; /* coil index TI */
int num; /* alarm num ,index from 0 */
char entId[COIL_LEN_MAX]; /* entry coil id */
ALARM_UNIT alarm[TRK_ALARM_MAX];
};
typedef ALARM_COIL ALARM_COILS[ALARM_LIST_MAX];
}; // namespace baosight
#endif