You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

703 lines
20 KiB
C

#pragma once
//ȫ<><C8AB><EFBFBD><EFBFBD><EFBFBD>Ͷ<EFBFBD><CDB6><EFBFBD>
using namespace std;/*ʹ<>ñ<EFBFBD>׼<EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿռ<D6BF>*/
//STL <20><>׼ͷ<D7BC>ļ<EFBFBD>
#include <set>
#include <vector>
#include <list>
#include <iostream>
#include <fstream>
#include <string>
#include <utility>
#include <map>
#include <deque>
#include <algorithm>
//<2F><><EFBFBD>α<EFBFBD><CEB1><EFBFBD><EBBEAF>
#pragma warning(disable : 4800)
#pragma warning(disable : 4244)
#pragma warning(disable : 4996)
#pragma warning(disable : 4018)
#pragma warning(disable : 4477)
#pragma warning(disable : 4005)
#define PI 3.14159265358979323846
#define EE 2.71828
//#define COORD_EPS 0.001 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEBEAB>(0.001 <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD>С<EFBFBD><D0A1>1um <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
#define COORD_EPS 0.00001
#define VAR_PAR_CNT 20//<2F>ɱ<EFBFBD><C9B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD>ʱʱ<CAB1><CAB1>
#define FIRST_OPEN_DELAY 5000 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ٿ<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>״̬
#define READ_INFO_FAST_DELAY 300 //<2F><>ȡ<EFBFBD><C8A1>Ϣ<EFBFBD><CFA2>ʱms (<28><><EFBFBD><EFBFBD>)
#define READ_INFO_SLOW_DELAY 2000 //<2F><>ȡ<EFBFBD><C8A1>Ϣ<EFBFBD><CFA2>ʱms (<28><><EFBFBD><EFBFBD>)
#define READ_PLC_INFO_DELAY 300 //<2F><>ȡPlc <20><>Ϣ<EFBFBD><CFA2>ʱms
#define READ_ROBOT_STATE_DELAY 3000 //<2F><>ȡ<EFBFBD><C8A1>Ƭ<EFBFBD><C6AC>״̬ <20><>Ϣ<EFBFBD><CFA2>ʱms
#define READ_TEK_INFO_DELAY 500 //<2F><>ȡTEK ʾ<><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ʱms
#define READ_LASER_POWER_TIMER_DELAY 600 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>ʵ<EFBFBD>timer <20><>ʱ
#define READ_LASER_DIS_METER_TIMER_DELAY 800 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǵ<EFBFBD>timer <20><>ʱ
#define READ_LASER_STATE_DELAY 2000 //<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ʱms
#define READ_SECS_VAR_DELAY 200 //<2F><><EFBFBD><EFBFBD>secs <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱms
#define CTRL_HOST_JOB_DELAY 500 //<2F><><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD>job <20><>ʱms
#define CTRL_CYCLIC_RUN_DELAY 3000 //<2F><><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD>job <20><>ʱms
#define RGB_WHITE RGB(255,255,255) //<2F><>ɫ
#define RGB_BLACK RGB(0,0,0) //<2F><>ɫ
#define RGB_GREEN RGB(0,255,0) //<2F><>ɫ
#define RGB_GREEN1 RGB(29,241,135) //<2F><>ɫ
#define RGB_GREEN2 RGB(228,249,157) //dz<><C7B3>ɫ
#define RGB_RED RGB(255,0,0) //<2F><>ɫ
#define RGB_PINK RGB(255,55,120) //<2F>ۺ<EFBFBD>ɫ
#define RGB_PINK1 RGB(231,61,175) //<2F>ۺ<EFBFBD>ɫ
#define RGB_YELLOW RGB(255,255,0) //<2F><>ɫ
#define RGB_BLUE RGB(0,0,255) //<2F><>ɫ
#define RGB_BLUE1 RGB(153,217,234) //<2F><><EFBFBD><EFBFBD>ɫ
#define RGB_BLUE2 RGB(49,240,243) //<2F><><EFBFBD><EFBFBD>ɫ2
#define RGB_NODE_BLUE RGB(0,63,255) //<2F>ڵ<EFBFBD><DAB5><EFBFBD>ɫ
#define RGB_PURPLE RGB(163,73,164) //<2F><>ɫ
#define RGB_GRAY RGB(240,240,240) //<2F><>ɫ
#define RGB_GRAY1 RGB(160,160,160) //<2F><><EFBFBD><EFBFBD>ɫ
#define RGB_GRAY2 RGB(217,217,217) //dz<><C7B3>ɫ
#define STR_NULL ""
#define STR_INPUT_ERROR "<22><>Чָ<D0A7><D6B8>: "
#define STR_INPUT_SYMBOL '>'
#define OK_STATE_STR "<22><><EFBFBD><EFBFBD>"
#define WARNING_STATE_STR "<22><><EFBFBD><EFBFBD>"
#define WARNING_STR "<22><><EFBFBD><EFBFBD>"
#define STATE_STR_D "״̬D"//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫʹ<D2AA>õ<EFBFBD><C3B5>Ž<EFBFBD>״̬
#define NO_USE_STR "<22><>ʹ<EFBFBD><CAB9>"
#define SEL_ALL_STR "ALL"
#define COMMUNICATION_ERR "Communication Error"
#define DEVICE_NOT_CONNECT "Device Not Conect"
#define SP_POWER_NAME "<22>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD>"
#define LIGHT_PATH_POWER_NAME "<22><><EFBFBD><EFBFBD><E2B9A6>"
#define PRODUCT_SUFACE_POWER_NAME "<22><>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>"
//<2F><><EFBFBD>ڲ<EFBFBD>ѯ<EFBFBD>ͱ<EFBFBD><CDB1><EFBFBD><EFBFBD><EFBFBD>recipe <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define RECIPE_PAR_NAME_LASER_FRE "RECIPE_PAR_NAME_LASER_FRE"
#define RECIPE_PAR_NAME_LASER2_FRE "RECIPE_PAR_NAME_LASER2_FRE"
#define RECIPE_PAR_NAME_LASER_CURR_1 "RECIPE_PAR_NAME_LASER_CURR_1"
#define RECIPE_PAR_NAME_LASER_CURR_2 "RECIPE_PAR_NAME_LASER_CURR_2"
#define RECIPE_PAR_NAME_LASER_EDI_1 "RECIPE_PAR_NAME_LASER_EDI_1"
#define RECIPE_PAR_NAME_LASER_EDI_2 "RECIPE_PAR_NAME_LASER_EDI_2"
#define RECIPE_PAR_NAME_PRF2_DELAY "RECIPE_PAR_NAME_PRF2_DELAY"
#define RECIPE_PAR_NAME_SCAN_SPEED "RECIPE_PAR_NAME_SCAN_SPEED"
#define RECIPE_PAR_NAME_OVERLAP_RATIO_X "RECIPE_PAR_NAME_OVERLAP_RATIO_X"
#define RECIPE_PAR_NAME_OVERLAP_RATIO_Y "RECIPE_PAR_NAME_OVERLAP_RATIO_Y"
#define RECIPE_PAR_NAME_FOCUS_ADJUST_VAL "RECIPE_PAR_NAME_FOCUS_ADJUST_VAL"
#define RECIPE_PAR_NAME_SCAN_AREA "RECIPE_PAR_NAME_SCAN_AREA"
#define RECIPE_PAR_NAME_AREA_IDX "RECIPE_PAR_NAME_AREA_IDX"
#define RECIPE_PAR_NAME_N2_STATE "RECIPE_PAR_NAME_N2_STATE" //<2F>Ƿ񿪹<C7B7>N2
#define RECIPE_PAR_NAME_OFFSET_TAB "RECIPE_PAR_NAME_OFFSET_TAB" //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define RECIPE_PAR_NAME_N2_VAL "RECIPE_PAR_NAME_N2_VAL"//N2<4E><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
#define RECIPE_PAR_NAME_USE_CUR_N2VAL "RECIPE_PAR_NAME_USE_CUR_N2VAL"//ʹ<>õ<EFBFBD>ǰRecipe<70><65>N2<4E><32><EFBFBD><EFBFBD>ֵ
#define RECIPE_PAR_NAME_LASER1_POW "RECIPE_PAR_NAME_LASER1_POW"
#define RECIPE_PAR_NAME_LASER2_POW "RECIPE_PAR_NAME_LASER2_POW"
#define RECIPE_PAR_NAME_ROTATO_DIMMER_ANG "RECIPE_PAR_NAME_ROTATO_DIMMER_ANG" //<2F><>ת˥<D7AA><CBA5><EFBFBD><EFBFBD>1<EFBFBD>ĽǶ<C4BD>
#define RECIPE_PAR_NAME_ROTATO_DIMMER_ANG2 "RECIPE_PAR_NAME_ROTATO_DIMMER_ANG2" //<2F><>ת˥<D7AA><CBA5><EFBFBD><EFBFBD>2<EFBFBD>ĽǶ<C4BD>
#define RECIPE_PAR_NAME_FIX_SCAN_SPEED "RECIPE_PAR_NAME_FIX_SCAN_SPEED"//<2F>̶<EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD>ٶ<EFBFBD>
#define RECIPE_PAR_NAME_FIX_SCAN_LINE_GAP "RECIPE_PAR_NAME_FIX_SCAN_LINE_GAP"//<2F>̶<EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD>߼<EFBFBD><DFBC><EFBFBD>
#define RECIPE_PAR_NAME_EDI_CHECK_SCOPE "RECIPE_PAR_NAME_EDI_CHECK_SCOPE"//<2F><><EFBFBD><EFBFBD><EFBFBD>ܶȿ<DCB6><C8BF>ؾ<EFBFBD><D8BE><EFBFBD>
#define RECIPE_PAR_NAME_SCAN_LINE_START_IDX "RECIPE_PAR_NAME_SCAN_LINE_START_IDX"//<2F><>ʼɨ<CABC><C9A8><EFBFBD>ߵ<EFBFBD><DFB5><EFBFBD><EFBFBD><EFBFBD>ֵ
#define RECIPE_PAR_NAME_LASER_EDI_OFFSET_1 "RECIPE_PAR_NAME_LASER_EDI_OFFSET_1"
#define RECIPE_PAR_NAME_LASER_EDI_OFFSET_2 "RECIPE_PAR_NAME_LASER_EDI_OFFSET_2"
#define RECIPE_PAR_NAME_ALIGNER_ANG "RECIPE_PAR_NAME_ALIGNER_ANG"//׼ֱ<D7BC>Ƕ<EFBFBD>
#define RECIPE_PAR_NAME_CASSETTE_TIER_COUNT "RECIPE_PAR_NAME_CASSETTE_TIER_COUNT" //<2F>Ϻв<CFBA><D0B2><EFBFBD>
#define RECIPE_PAR_NAME_RUNTIMES "RECIPE_PAR_NAME_RUNTIMES" //ִ<>д<EFBFBD><D0B4><EFBFBD>
#define LASER_DEVICE_PI_CLOSE_POW_VOL "LASER_DEVICE_PI_CLOSE_POW_VOL"
#define LASER_DEVICE_PI_CLOSE_POW_CURR "LASER_DEVICE_PI_CLOSE_POW_CURR"
#define RECIPE_PAR_MAX_LASER_CURR_1 "RECIPE_PAR_MAX_LASER_CURR_1"
#define RECIPE_PAR_MAX_LASER_CURR_2 "RECIPE_PAR_MAX_LASER_CURR_2"
#define RECIPE_PAR_MAX_LASER_EDI_1 "RECIPE_PAR_MAX_LASER_EDI_1"
#define RECIPE_PAR_MAX_LASER_EDI_2 "RECIPE_PAR_MAX_LASER_EDI_2"
#define RECIPE_PAR_MAX_LASER_FRE "RECIPE_PAR_MAX_LASER_FRE"
#define RECIPE_PAR_MAX_LASER_PULSE_DELAY "RECIPE_PAR_MAX_LASER_PULSE_DELAY"
#define RECIPE_PAR_MIN_FOCUS_ADJUST "RECIPE_PAR_MIN_FOCUS_ADJUST"
#define RECIPE_PAR_MAX_FOCUS_ADJUST "RECIPE_PAR_MAX_FOCUS_ADJUST"
#define RECIPE_PAR_MIN_SCAN_SPEED "RECIPE_PAR_MIN_SCAN_SPEED"
#define RECIPE_PAR_MAX_SCAN_SPEED "RECIPE_PAR_MAX_SCAN_SPEED"
#define RECIPE_PAR_MAX_FIX_SCAN_LINE_GAP "RECIPE_PAR_MAX_FIX_SCAN_LINE_GAP"
#define RECIPE_PAR_MAX_LASER_POW_1 "RECIPE_PAR_MAX_LASER_POW_1"
#define RECIPE_PAR_MAX_LASER_POW_2 "RECIPE_PAR_MAX_LASER_POW_2"
#define RECIPE_PAR_MAX_DIMMER_ANG_1 "RECIPE_PAR_MAX_DIMMER_ANG_1"
#define RECIPE_PAR_MAX_DIMMER_ANG_2 "RECIPE_PAR_MAX_DIMMER_ANG_2"
#define LAIPU_LASER_DATA_PATH _T("E:\\LaipuLaserData")
#define RECIPE_OFFSET_TBL_NULL "Empty"
#define RECIPE_OFFSET_PAR_LASER1_EDI "LASER1_EDI_OFFSET"
#define RECIPE_OFFSET_PAR_LASER2_EDI "LASER2_EDI_OFFSET"
#define RECIPE_OFFSET_PAR_LASER1_CURR "LASER1_CURR_OFFSET"
#define RECIPE_OFFSET_PAR_LASER2_CURR "LASER2_CURR_OFFSET"
#define bOPEN true
#define bCLOSE false
#define THOW_EXCEPTION true //<2F>׳<EFBFBD><D7B3>
#define COMM_BAUD_RATE_115200 115200 //<2F><><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD>115200
#define COMM_BAUD_RATE_9600 9600 //<2F><><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD>9600
#define ON_TERMINAL 5001
#define BOOL_STR_TRUE "TRUE"
#define BOOL_STR_FALSE "FALSE"
#define BOOL_STR_YES "YES"
#define BOOL_STR_NO "NO"
#define STR_LASER_1 "Laser1"
#define STR_LASER_2 "Laser2"
#define BOOL_STR_ON "ON"
#define BOOL_STR_OFF "OFF"
//<2F><><EFBFBD><EFBFBD>ߵ<EFBFBD><DFB5><EFBFBD><EFBFBD><EFBFBD>
enum MOUSE_TOOL
{
_TOOL_POINT=0,
_TOOL_RECT,
_TOOL_LINE,
_TOOL_PLINE,//<2F><><EFBFBD>߶<EFBFBD>
_TOOL_CIRCLE,
_TOOL_MOVE,
_TOOL_MOVE2,//ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD>
_TOOL_ROTATO,
_TOOL_COPY,
_TOOL_MEASURE,//<2F><><EFBFBD><EFBFBD>
_TOOL_ZOOM,//<2F><><EFBFBD><EFBFBD>
_TOOL_CUT,//<2F>޼<EFBFBD>
_TOOL_ADD_NODE,//<2F><><EFBFBD>ӽڵ<D3BD>
_TOOL_DEL_NODE,//ɾ<><C9BE><EFBFBD>ڵ<EFBFBD>
_TOOL_BREAK_NODE,//<2F><><EFBFBD>Ͻڵ<CFBD>
_TOOL_MOVE_NODE,//<2F>ƶ<EFBFBD><C6B6>ڵ<EFBFBD>
_TOOL_TEXT,//<2F><><EFBFBD><EFBFBD>
_TOOL_BARCODE,//<2F><><EFBFBD><EFBFBD>
_TOOL_ONE_POINT,//һ<><D2BB><EFBFBD><EFBFBD>
_TOOL_STRETCH,//<2F><><EFBFBD><EFBFBD><ECB9A4>
_TOOL_PT_MOVE_TO_CCD,//<2F><><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><D8B6><EFBFBD>;<EFBFBD>ĵ<EFBFBD>
_TOOL_SET_MARK_PT,//<2F>ֶ<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
_TOOL_LASER_COORD,//<2F><><EFBFBD>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
};
enum OBJ_TYPE
{
_TYPE_BASE = 0,
_TYPE_PLINE,//<2F><><EFBFBD>߶<EFBFBD>1
_TYPE_POINT,//<2F><>2
_TYPE_CIRCLE,//Բ3
_TYPE_COMPOSITE,//һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>4
_TYPE_TXT,//<2F>ַ<EFBFBD><D6B7><EFBFBD>5
_TYPE_BARCODE,//<2F><><EFBFBD><EFBFBD>6
_TYPE_STR,//string 7
_TYPE_CHAR,//<2F>ַ<EFBFBD>8
_TYPE_ARC,//Բ<><D4B2>
};
enum X_OR_Y
{
_X=0,
_Y,
_XY,
};
enum CATCH_PT_TYPE//ץȡ<D7A5><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{
_CATCH_NODE = 0,//<2F><><EFBFBD><EFBFBD>
_CATCH_INTERSECT,//<2F>߶εĽ<CEB5><C4BD><EFBFBD>
_CATCH_ORTHO,//<2F><><EFBFBD><EFBFBD>
_CATCH_CUT_TRACK,//Ԫ<><D4AA><EFBFBD>и<EFBFBD><D0B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
};
enum STATUS//<2F><><EFBFBD><EFBFBD>ߵ<EFBFBD>״ֵ̬,<2C><><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7>ÿһ<C3BF><D2BB><EFBFBD><EFBFBD>ʲô<CAB2><C3B4><EFBFBD><EFBFBD>
{
_STATUS_1 = 0,
_STATUS_2,
_STATUS_3,
_STATUS_4,
_STATUS_5,
_STATUS_6,
_STATUS_END
};
enum OBJ_OP_TYPR
{
_OP_MOVE = 0,
_OP_ROTATO,
_OP_MIRROR,
_OP_STRETCH,//<2F><><EFBFBD><EFBFBD>
_OP_REVERSE,//<2F><>ת<EFBFBD><D7AA><EFBFBD>ݵ<EFBFBD>
_OP_SCALE,//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
};
inline bool IsDbEqual(double a,double b)
{
if((abs(a-b))<COORD_EPS)
return true;
else
return false;
}
//<2F><><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>xy <20><><EFBFBD><EFBFBD>,<2C><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>
class Dbxy
{
friend bool operator==(const Dbxy &lhs, const Dbxy &rhs);
public:
Dbxy(double _x,double _y):x(_x),y(_y)
{
Reset();
};
Dbxy()
{
x= y =0;
Reset();
};
void Reset()
{
PenNum = -1;//<2F><>ʹ<EFBFBD>õıʺ<C4B1>(<28>и<EFBFBD><D0B8><EFBFBD>)
Cx = Cy = 0;
bArc = false;
bDir = false;//Բ<><D4B2><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>(<28><><EFBFBD><EFBFBD>˳ʱ<CBB3><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>)
}
bool Equal(Dbxy &pt)
{
if(IsDbEqual(x,pt.x) && IsDbEqual(y,pt.y))
return true;
else
return false;
}
void operator+=(const Dbxy &rhs)
{
(*this).x += rhs.x;
(*this).y += rhs.y;
}
void operator-=(const Dbxy &rhs)
{
(*this).x -= rhs.x;
(*this).y -= rhs.y;
}
public:
double x;
double y;
//<2F><>Ϊ<EFBFBD><CEAA><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>Ը<EFBFBD><D4B8><EFBFBD>һЩ<D2BB><D0A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
int PenNum;//<2F><>ʹ<EFBFBD>õıʺ<C4B1>(<28>и<EFBFBD><D0B8><EFBFBD>)
//Բ<><D4B2><EFBFBD><EFBFBD>Ϣ-------------------
double Cx;
double Cy;
bool bArc;
bool bDir;//Բ<><D4B2><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>(<28><><EFBFBD><EFBFBD>˳ʱ<CBB3><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>)
};
inline bool operator==(const Dbxy &lhs, const Dbxy &rhs)
{
return (IsDbEqual(lhs.x,rhs.x) && IsDbEqual(lhs.y,rhs.y));
}
//ץȡ<D7A5><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
class CCatchPoint :public Dbxy
{
public:
CCatchPoint(double _x,double _y,CATCH_PT_TYPE type):Dbxy(_x,_y),m_type(type){};
CCatchPoint()
{
Dbxy::Dbxy();
};
CATCH_PT_TYPE GetType(){return m_type;};
public:
CATCH_PT_TYPE m_type;
};
class DbSize
{
public:
DbSize(double _w,double _h):w(_w),h(_h){};
DbSize()
{
w= h =0;
};
public:
double w;
double h;
};
class IntXY
{
friend bool operator==(const IntXY &lhs, const IntXY &rhs);
public:
IntXY(int _x,int _y):x(_x),y(_y){};
IntXY()
{
x = y =0;
};
public:
int x;
int y;
};
inline bool operator==(const IntXY &lhs, const IntXY &rhs)
{
return (lhs.x == rhs.x && lhs.y == rhs.y);
}
#if 1
class DbRect
{
public:
DbRect(double _L,double _R,double _T,double _B):L(_L),R(_R),T(_T),B(_B){};
DbRect(Dbxy pt1,Dbxy pt2){Creat(pt1,pt2);}
DbRect(Dbxy pt,double size){Creat(pt,size);}//size <20><>rect <20>İ뾶
DbRect(Dbxy pt,DbSize size)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><C4B5>ͳߴ<CDB3><DFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{
Creat(pt,size);
};
DbRect(){Reset();};
void Creat(Dbxy pt1,Dbxy pt2);
void Creat(Dbxy pt,double size);
void Creat(Dbxy pt,DbSize size);
void Reset();
bool IsZero();
DbSize GetSize();
Dbxy GetCenterPt();
Dbxy GetBottomCenterPt();
double Width();
double Height();
public:
double L;
double R;
double T;
double B;
};
inline void DbRect::Reset()
{
L= B = 0.1;
R = T = 0;
}
inline void DbRect::Creat(Dbxy pt1,Dbxy pt2)
{
if(pt1.x < pt2.x)
{
L = pt1.x;
R = pt2.x;
}
else
{
L = pt2.x;
R = pt1.x;
}
if(pt2.y<pt1.y)
{
T = pt1.y;
B = pt2.y;
}
else
{
T = pt2.y;
B = pt1.y;
}
}
inline void DbRect::Creat(Dbxy pt,double size)
{
L = pt.x-size;
R = pt.x+size;
T = pt.y+size;
B = pt.y-size;
}
inline void DbRect::Creat(Dbxy pt,DbSize size)
{
L = pt.x-size.w/2;
R = pt.x+size.w/2;
T = pt.y+size.h/2;
B = pt.y-size.h/2;
}
inline bool DbRect::IsZero()
{
if(L<R || B<T)
return false;
else
return true;
}
inline Dbxy DbRect::GetCenterPt()
{
Dbxy pt;
if(L<=R)
{
pt.x = (L+R)/2;
}
if(T>=B)
{
pt.y = (T+B)/2;
}
return pt;
}
inline DbSize DbRect::GetSize()
{
DbSize size;
size.w = R - L;
size.h = T - B;
if(size.w<0)
size.w = 0;
if(size.h<0)
size.h = 0;
return size;
}
//<2F>ײ<EFBFBD><D7B2><EFBFBD><EFBFBD>ĵ<EFBFBD>
inline Dbxy DbRect::GetBottomCenterPt()
{
Dbxy pt;
pt.x = (L+R)/2;
pt.y = B;
return pt;
}
inline double DbRect::Width()
{
return R-L;
}
inline double DbRect::Height()
{
return T-B;
}
#endif
//<2F><>װ<EFBFBD><D7B0><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>,<2C><><EFBFBD><EFBFBD>ͳһ<CDB3><D2BB><EFBFBD>͸<EFBFBD>ʽ
struct SObjOperatePar{
SObjOperatePar()
{
MoveX = MoveY = 0;
Angle = 0;
OldSize = NewSize = Diff = 0;
Scale = 1;
}
OBJ_OP_TYPR OpType;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
X_OR_Y xy;//<2F><>ʶxy <20><><EFBFBD><EFBFBD>
Dbxy BasePt;//<2F><>׼<EFBFBD><D7BC>
double MoveX;//<2F>ƶ<EFBFBD><C6B6><EFBFBD>
double MoveY;
double Angle;//360 <20>Ƚ<EFBFBD>
double OldSize;
double NewSize;
double Diff;
double Scale;//<2F><><EFBFBD>ű<EFBFBD><C5B1><EFBFBD>
};
typedef pair<CPoint,bool> PointType;
//<2F><><EFBFBD><EFBFBD>Բ<EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>
class CCirclePar
{
public:
CCirclePar(void)
{
Radius = 1;
DEdgeCnt = 32;
bMerge = true;
StartAng = 0;
EndAng = 360;
bReverse = false;
}
public:
Dbxy CenterPt;//Բ<><D4B2>
double Radius;//<2F>
int DEdgeCnt;//<2F><><EFBFBD><EFBFBD>
bool bMerge;//<2F>Ƿ<EFBFBD><C7B7>ϲ<EFBFBD>
bool bReverse;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
double StartAng;//<2F><>ʼ<EFBFBD>Ƕ<EFBFBD>360 <20>Ƚ<EFBFBD>
double EndAng;//<2F><><EFBFBD><EFBFBD><EFBFBD>Ƕ<EFBFBD>
};
//״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
enum EModuleStateType
{
_ModuleStateType_OK,//<2F><><EFBFBD><EFBFBD>
_ModuleStateType_Warning,//<2F><><EFBFBD><EFBFBD>
_ModuleStateType_ERR,//<2F>
};
class CDlgItemStr
{
public:
CDlgItemStr(void)
{
m_ID = 0;
};
public:
int m_ID;//<2F><><EFBFBD><EFBFBD>
CString m_Str;//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
};
//ƫ<><C6AB><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>
class COffsetRotatoPar
{
public:
COffsetRotatoPar()
{
Reset();
};
void Reset()
{
m_Offset.x = 0;
m_Offset.y = 0;
m_RotatoAng = 0;//<2F><>ת<EFBFBD>Ƕ<EFBFBD>(30<33>Ƚ<EFBFBD>)
m_bValid = false;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>Ч
};
public:
bool m_bValid;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>Ч
Dbxy m_Offset;//ƫ<><C6AB><EFBFBD><EFBFBD>
double m_RotatoAng;//<2F><>ת<EFBFBD>Ƕ<EFBFBD>(30<33>Ƚ<EFBFBD>)
};
enum CAlamLightStateType
{
_AlamLightStateType_NULL=0,
_AlamLightStateType_Off,//<2F>ر<EFBFBD>
_AlamLightStateType_On,//<2F><><EFBFBD><EFBFBD>
_AlamLightStateType_Flash,//<2F><>˸
};
//<2F><>ʾ<EFBFBD><CABE>״̬
class CAlamLightState
{
public:
CAlamLightState(void)
{
m_LightRedState = _AlamLightStateType_NULL;//<2F><><EFBFBD><EFBFBD>״̬
m_LightYellowState = _AlamLightStateType_NULL;//<2F>Ƶ<EFBFBD>״̬
m_LightGreenState = _AlamLightStateType_NULL;//<2F>̵<EFBFBD>״̬
m_LightAlamState = _AlamLightStateType_NULL;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬
};
public:
CAlamLightStateType m_LightRedState;//<2F><><EFBFBD><EFBFBD>״̬
CAlamLightStateType m_LightYellowState;//<2F>Ƶ<EFBFBD>״̬
CAlamLightStateType m_LightGreenState;//<2F>̵<EFBFBD>״̬
CAlamLightStateType m_LightBlueState;//<2F><><EFBFBD><EFBFBD>״̬
CAlamLightStateType m_LightAlamState;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬
};
//<2F><><EFBFBD>ö<EFBFBD>ȡ<EFBFBD>ĵ<EFBFBD>λ<EFBFBD>ź<EFBFBD><C5BA><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD>Ӻ<EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>InitCommReadBitVec <20><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD><C2B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
//<2F><><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>˿<EFBFBD><CBBF><EFBFBD>ǿ<EFBFBD><C7BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>
enum eCommReadSignalType
{
_ReadSignalType_Null = 0,
_ReadSignalType_MachineGate1,//<2F><>բ<EFBFBD>ź<EFBFBD>1
_ReadSignalType_MachineGate2,//<2F><>բ<EFBFBD>ź<EFBFBD>2
_ReadSignalType_PlateVacuum,//ƽ̨wafer <20><><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>
_ReadSignalType_LaserDimmer1,//˥<><CBA5><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>1
_ReadSignalType_LaserDimmer2,//˥<><CBA5><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>2
_ReadSignalType_RedLight,//<2F><><EFBFBD><EFBFBD>
_ReadSignalType_AlamState,//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬
_ReadSignalType_ArmProduct,//<2F><>е<EFBFBD>ֲ<EFBFBD>Ʒ<EFBFBD>ź<EFBFBD>
_ReadSignalType_ArmReady,//<2F><>е<EFBFBD><D0B5>׼<EFBFBD><D7BC><EFBFBD>ź<EFBFBD>
_ReadSignalType_ArmTrasmitting,//<2F><>е<EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD>ź<EFBFBD>
_ReadSignalType_LaserPowLock,//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4>ť<EFBFBD><C5A5><EFBFBD><EFBFBD>
_ReadSignalType_ThimbleSignal1,//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>1
_ReadSignalType_ThimbleSignal2,//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>2
_ReadSignalType_ArmAutoState,//<2F><>е<EFBFBD><D0B5><EFBFBD>Զ<EFBFBD>״̬[14]
_ReadSignalType_Smif1Working,//SMIFæ<46>ź<EFBFBD>1
_ReadSignalType_Smif2Working,//SMIFæ<46>ź<EFBFBD>1
_ReadSignalType_ArmWorking,//<2F><>е<EFBFBD><D0B5>æ<EFBFBD>ź<EFBFBD>
_ReadSignalType_Port1MappingEnd,//Port1 mapping<6E><67><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>
_ReadSignalType_Port2MappingEnd,//Port2 mapping<6E><67><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>
_ReadSignalType_Pod1Signal_1,//<2F>Ϻ<EFBFBD>1 <20>ź<EFBFBD>1 [20]
_ReadSignalType_Pod2Signal_1,//<2F>Ϻ<EFBFBD>2 <20>ź<EFBFBD>1 [21]
_ReadSignalType_WaferPosAligner,//׼ֱ<D7BC><D6B1>wafer <20>ź<EFBFBD>
_ReadSignalType_WaferPosArm,//<2F><>е<EFBFBD><D0B5>wafer <20>ź<EFBFBD>1 (load <20><>arm)
_ReadSignalType_Port1MappingCommit,//Port1 Mapping ȷ<><C8B7>
_ReadSignalType_Port2MappingCommit,//Port2 Mapping ȷ<><C8B7>
_ReadSignalType_ArmAutoTransfer,//<2F>Զ<EFBFBD><D4B6><EFBFBD>Ƭ<EFBFBD><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_ReadSignalType_CassetteDoorSignal_1,//<2F>Ϻ<EFBFBD><CFBA><EFBFBD><EFBFBD>ź<EFBFBD>1 [27]
_ReadSignalType_CassetteDoorSignal_2,//<2F>Ϻ<EFBFBD><CFBA><EFBFBD><EFBFBD>ź<EFBFBD>2 [28]
_ReadSignalType_Pod1Signal_2,//<2F>Ϻ<EFBFBD>1 <20>ź<EFBFBD>2 (<28>е<EFBFBD><D0B5><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Sensor) [29]
_ReadSignalType_Pod2Signal_2,//<2F>Ϻ<EFBFBD>2 <20>ź<EFBFBD>2 (<28>е<EFBFBD><D0B5><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Sensor) [30]
_ReadSignalType_Pod1WaferOutSensor,//<2F>Ϻ<EFBFBD>1 wafer <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[31]
_ReadSignalType_Pod2WaferOutSensor,//<2F>Ϻ<EFBFBD>2 wafer <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[32]
_ReadSignalType_Pod1PushInSignal,//<2F>Ϻ<EFBFBD>1 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><CCA8>λ<EFBFBD>ź<EFBFBD>(<28><><EFBFBD>Ϻ<EFBFBD>,<2C><>wafer <20><>ʱ<EFBFBD><CAB1><EFBFBD>Ż<EFBFBD>ON)
_ReadSignalType_Pod2PushInSignal,//<2F>Ϻ<EFBFBD>2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><CCA8>λ<EFBFBD>ź<EFBFBD>
_ReadSignalType_Pod1PushOutSignal,//<2F>Ϻ<EFBFBD>1 <20>˳<EFBFBD><CBB3><EFBFBD>̨<EFBFBD><CCA8>λ<EFBFBD>ź<EFBFBD>
_ReadSignalType_Pod2PushOutSignal,//<2F>Ϻ<EFBFBD>2 <20>˳<EFBFBD><CBB3><EFBFBD>̨<EFBFBD><CCA8>λ<EFBFBD>ź<EFBFBD>
_ReadSignalType_WaferPosArm2,//<2F><>е<EFBFBD><D0B5>wafer <20>ź<EFBFBD>2 (˫<>ۻ<EFBFBD>е<EFBFBD><D0B5>Unload<61>õ<EFBFBD>arm)
_ReadSignalType_OxygenCheckSignal,//<2F><><EFBFBD><EFBFBD>Ũ<EFBFBD>ȼ<EFBFBD><C8BC><EFBFBD><EFBFBD>ź<EFBFBD>(OnΪ<6E><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><100ppm)
_ReadSignalType_Pod1Signal_3,//<2F>Ϻ<EFBFBD>1 <20>ź<EFBFBD>3 (8<><38><EFBFBD>Ϻ<EFBFBD>)
_ReadSignalType_Pod2Signal_3,//<2F>Ϻ<EFBFBD>2<EFBFBD>ź<EFBFBD>3 (8<><38><EFBFBD>Ϻ<EFBFBD>)
_ReadSignalType_Pod1Signal_4,//<2F>Ϻ<EFBFBD>1 <20>ź<EFBFBD>4 (8<><38><EFBFBD>Ϻ<EFBFBD>)
_ReadSignalType_Pod2Signal_4,//<2F>Ϻ<EFBFBD>2<EFBFBD>ź<EFBFBD>4 (8<><38><EFBFBD>Ϻ<EFBFBD>)
_ReadSignalType_Pod1WaferSensor,//<2F>Ϻ<EFBFBD>1 wafer <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϻ<EFBFBD><CFBA><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>wafer)
_ReadSignalType_Pod2WaferSensor,//<2F>Ϻ<EFBFBD>2 wafer <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϻ<EFBFBD><CFBA><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>wafer)
_ReadSignalType_Pod1WaferAdjustSensor1,////<2F>Ϻ<EFBFBD>1 wafer <20><><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>1 (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>wafer Ū<><C5AA><EFBFBD><EFBFBD>)
_ReadSignalType_Pod1WaferAdjustSensor2,////<2F>Ϻ<EFBFBD>1 wafer <20><><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>2 (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>wafer Ū<><C5AA><EFBFBD><EFBFBD>)
_ReadSignalType_Pod2WaferAdjustSensor1,////<2F>Ϻ<EFBFBD>1 wafer <20><><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>1 (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>wafer Ū<><C5AA><EFBFBD><EFBFBD>)
_ReadSignalType_Pod2WaferAdjustSensor2,////<2F>Ϻ<EFBFBD>1 wafer <20><><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>2 (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>wafer Ū<><C5AA><EFBFBD><EFBFBD>)
_ReadSignalType_Max,//<2F><><EFBFBD><EFBFBD>ֵ
};
enum eLaserDeviceType
{
_LaserDeviceType_MainLaser1=0,//<2F>̹<EFBFBD>1
_LaserDeviceType_MainLaser2,//<2F>̹<EFBFBD>2
_LaserDeviceType_RedLaser,//<2F><><EFBFBD><EFBFBD>
};
//load port <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
enum eWaferLoadPortType
{
_LoadPortType_Null = 0,
_LoadPortType_Port1,
_LoadPortType_Port2,
};
//<2F>Ϻе<CFBA><D0B5><EFBFBD><EFBFBD><EFBFBD>
enum eCassetteType
{
_CassetteType_Slot13 = 0,//13<31><33><EFBFBD>Ϻ<EFBFBD>
_CassetteType_Slot25,//25<32><35><EFBFBD>Ϻ<EFBFBD>
};
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD>ƵĿ<C6B5><C4BF><EFBFBD>״̬
enum eTwoIOPtCtrlState
{
_TwoIOPtCtrlState_Null = 0, //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>û<EFBFBD>ж<EFBFBD><D0B6><EFBFBD>
_TwoIOPtCtrlState_Off,//<2F>ر<EFBFBD>
_TwoIOPtCtrlState_On,//<2F><><EFBFBD><EFBFBD>
};