eis/inc/glob/GlobDefine.h

151 lines
5.0 KiB
C++

#ifndef GLOB_DEFINE_H
#define GLOB_DEFINE_H
#include <stdio.h>
#include <string>
using namespace std;
#define CS_TABLE_MU "T_MU"
#define CS_TABLE_PHYSICAL "T_PDI_PH"
#define CS_TABLE_LOGICAL "T_PDI_LO"
#define CS_TABLE_ORDER "T_PDI_OR"
#define CS_TABLE_ROLL "T_ROL_DATA"
#define CS_TABLE_DEFECT "T_DEF_ENT"
#define CS_TABLE_PDOPHYSICAL "T_PDO_PH"
#define CS_TABLE_PDOLOGICAL "T_PDO_LO"
#define CS_TABLE_PDOORDER "T_PDO_OR"
#define CS_TABLE_ROLL "T_ROL_DATA"
#define CS_TABLE_DEFECT "T_DEF_ENT"
#define CS_TABLE_SHIFT "T_SFT_DATA"
#define CS_TABLE_REJECT "T_TRK_REJECT"
#define CN_PHYSICAL 0 //物理卷的数量
#define CN_LOGICAL 1 //逻辑卷的数量
#define CN_ORDER_0 0 //合同卷数量
#define CN_ORDER_1 1
#define CN_ORDER_2 2
#define CN_ORDER_3 3
#define CS_COLUMN_OK "ok" // Telegram attribute for OK Values
#define CS_COLUMN_OKALL "okAll"
#define MAX_0RDER 10 // Max number of order
#define MIN_CUT_WEIGHT 7500 // Min caculation weight
//#define STATUS_PLAN 0 // material status = is planed
#define STATUS_PLAN -1 // material status = is planed
#define STATUS_REQUESTED 0 // material status = is requested
#define STATUS_ENTRY 1 // material status = is in entry section
#define STATUS_PROD 2 // material status = is in production
#define STATUS_PRODUCED 3 // material status = is produced
#define STATUS_FINISH 4 // material status = is finish
#define STATUS_OUTLINE 5 // material status = is outline
#define APPVERSION "20120501"
#define DIVIDER_CHAR '_'
#define DIVIDER_POS 3
#define NOORDER_POS 2
#define MAT_TYPE_PHYSICAL "PH\0"
#define MAT_TYPE_LOGICAL "LO\0"
#define MAT_TYPE_ORDER "OR\0"
#define SOURCE_TYPE_CALC "C" // source type calculation global
#define SOURCE_TYPE_EFF "E" // source type effective global
#define SOURCE_TYPE_LEV3 "L" // source type level 3 global
#define MAT_CREATOR_L3 "L3\0" // material creator level 3
#define MAT_CREATOR_OD "OD" // material creator order division
#define MAT_CREATOR_L2 "PC" // material creator process computer
#define CUT_POS_HEAD "H" // definition for cutting position head
#define CUT_POS_TAIL "T" // definition for cutting position tail
#define CUT_POS_MID "M" // definition for cutting position middle
#define MAX_NO_DEFECTS 50 // maximum number of defects
#define SOURCE_TYPE_DEF_DEFA "DA" // source type automatic generated defects from the ADH
#define SOURCE_TYPE_DEF_I1 "I1" // source type defects from inspection Place 1 (dependent on the project)
#define SOURCE_TYPE_DEF_I2 "I2" // source type defects from inspection Place 2 (dependent on the project)
#define SOURCE_TYPE_DEF_L3 "L3" // source type defects from level 3
#define CN_MU_CURMUSID -1
#define CN_MU_ENTMUSID 1
#define CN_MU_OUTMUSID 2
#define MAX_NO_UNITS_PRODMAT 6
#define ZI_VALUE_NOT_AVAILABLE (short)-1
const int MTR_MAX_NO_LOG_UNITS = 3;
const int MTR_MAX_NO_ORDERS = 20;
const int MTR_MAX_NO_PROD_ORD = 20;
const int MAX_NO_ORDERS = 20;
const int MAX_NO_LOGICALS = 3;
const int MAX_UNITS = 10;
const int MAX_DEFECTS = 20;
const int MAX_TAB_PAPSND = 5;
#define CN_RETURAL_INSERT 10 //返回插入
#define CN_RETURAL_UPDATE 20 //返回更新
namespace baosight
{
struct MU_STRUCT
{
long muId;
char muCreator[3];
short musId;
};
struct MU_CODE
{
char extId[21];
char muTyp[3]; // material type
MU_STRUCT actual;
MU_STRUCT original;
short basId; // Identification for basic automation
inline string ToString()
{
char temp[256];
sprintf( temp, "extId-%.21s meTyp-%.3s basId-%d actual.muId-%d actual.muCreator-%.3s actual.musId-%d original.muId-%d original.muCreator-%.3s original.musId-%d ", extId, muTyp, basId, actual.muId, actual.muCreator, actual.musId, original.muId, original.muCreator, original.musId);
return string( temp);
}
};
//代表一个钢卷
struct MAT_STRUCTURE
{
short actLogicalIndex;
short actOrderIndex;
MU_CODE phyMuCode;
short countLogicals;
MU_CODE logMuCode[MAX_NO_LOGICALS];
short countOrders[MAX_NO_LOGICALS];
MU_CODE ordMuCode[MAX_NO_LOGICALS][MAX_NO_ORDERS];
};
struct DB_MAT_DIVISION {
MU_CODE matMC;
short flagEntryExit; // entry = 0 ; exit = 1
short passNo;
float OuterDiam; //added by fxd 2008-09-23
double divLength1; // measured in production direction
double divLength2;
MU_CODE matMCPart1;
MU_CODE matMCPart2;
short storeOri; // 0 = no part , 1=1.part , 2=2.part , 3=both
short useBasIdPart1; // 1 = actual , 2 = original
short useBasIdPart2; // 1 = actual , 2 = original
short reasonCode; // division reason code
char reasonText[60]; // division reason text
};
}
#endif