165 lines
3.4 KiB
C
165 lines
3.4 KiB
C
|
|
|
|||
|
|
#ifndef _LINE_DEFINE_H
|
|||
|
|
#define _LINE_DEFINE_H
|
|||
|
|
#include <iostream>
|
|||
|
|
#include <vector>
|
|||
|
|
|
|||
|
|
//using namespace baosight;
|
|||
|
|
|
|||
|
|
|
|||
|
|
//#define E 2.71828183
|
|||
|
|
#define PI 3.1415926 //define pi for calc
|
|||
|
|
#define WELD_ERROR_RANGE 60000 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>50mm
|
|||
|
|
#define TCMBEFOREXM 125 //<2F><><EFBFBD><EFBFBD>ǰX<C7B0><EFBFBD><D7B6>峤<EFBFBD><E5B3A4>
|
|||
|
|
#define MIN_LOOP 0 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%
|
|||
|
|
|
|||
|
|
|
|||
|
|
#define ENC_DRIVE_SCALE_S_1 14 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>S<EFBFBD><53><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1#S<><53>
|
|||
|
|
#define ENC_DRIVE_SCALE_S_2 14 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>S<EFBFBD><53><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2#S<><53>
|
|||
|
|
#define ENC_DRIVE_SCALE_S_3 14 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>S<EFBFBD><53><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 3#S<><53>
|
|||
|
|
#define ENC_DRIVE_SCALE_S_4 14 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>S<EFBFBD><53><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4#S<><53>
|
|||
|
|
#define ENC_DRIVE_SCALE_S_5 14 //11.731 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>S<EFBFBD><53><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 5#S<><53>
|
|||
|
|
|
|||
|
|
//const int ZONE_COUNT = 22;
|
|||
|
|
const int LP_COUNT = 3;
|
|||
|
|
const int WPD_COUNT = 7;
|
|||
|
|
const int ROLL_S_COUNT = 6;
|
|||
|
|
//const int WELD_MAX = 10;
|
|||
|
|
|
|||
|
|
const double roll_dima = 500; //<2F><><EFBFBD>뾶
|
|||
|
|
const double roll_dima_1 = 500;//modify 2014-2-19
|
|||
|
|
const double roll_dima_2 = 500;//modify 2014-2-19
|
|||
|
|
const double roll_dima_3 = 500;//modify 2014-2-19
|
|||
|
|
const double roll_dima_4 = 500;//modify 2014-2-19
|
|||
|
|
const double roll_dima_5 = 500;//modify 2014-2-19
|
|||
|
|
//const long ENC_MAX = (long)(2147483648);//= 2e31;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|||
|
|
const long ENC_MAX = (long)(32767);//= 2e31;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|||
|
|
//const int ENC_DRIVE_ONE_CYCLE = 4096; //<2F><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>һȦ<D2BB><C8A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>仯
|
|||
|
|
//const int ENC_DRIVE_ONE_CYCLE = 1024; //<2F><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>һȦ<D2BB><C8A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>仯
|
|||
|
|
const int ENC_DRIVE_ONE_CYCLE = 256; //<2F><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>һȦ<D2BB><C8A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>仯
|
|||
|
|
|
|||
|
|
class IHDB
|
|||
|
|
{
|
|||
|
|
public:
|
|||
|
|
static const int CACHE_BUFF = 10000;
|
|||
|
|
static const int CACHE_SIZE = 1000;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
typedef float IHDB_CACHE[IHDB::CACHE_SIZE][IHDB::CACHE_BUFF];
|
|||
|
|
|
|||
|
|
struct Roll{
|
|||
|
|
//long speed;
|
|||
|
|
long pulse;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
struct RollS{
|
|||
|
|
int BrPulse; // S<><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
int BrImp; // #S<><53>
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
struct Welder{
|
|||
|
|
float ok; // <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>ֹ<EFBFBD>ȷ<EFBFBD>ϣ<EFBFBD>
|
|||
|
|
float up; // <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>ֹ<EFBFBD>ȷ<EFBFBD>ϣ<EFBFBD>
|
|||
|
|
float down; // <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>ֹ<EFBFBD>ȷ<EFBFBD>ϣ<EFBFBD>
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
struct SCut{
|
|||
|
|
float UTailLen;
|
|||
|
|
float LHeadLen;
|
|||
|
|
float LMiddleLen;
|
|||
|
|
float LTailLen;
|
|||
|
|
float UHSampleLen;
|
|||
|
|
float UTSampleLen;
|
|||
|
|
float LHSampleLen;
|
|||
|
|
float LTSampleLen;
|
|||
|
|
float HSrapLen;
|
|||
|
|
float TSrapLen;
|
|||
|
|
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
struct TrackSign{
|
|||
|
|
float PorOn[2];
|
|||
|
|
float TorModel[2];
|
|||
|
|
float TailOff[2];
|
|||
|
|
float TrOn[2];
|
|||
|
|
float TrModel[2];
|
|||
|
|
float channel;
|
|||
|
|
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
struct Cut{
|
|||
|
|
float tr;
|
|||
|
|
float up;
|
|||
|
|
float down;
|
|||
|
|
float DCut;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
struct Len{
|
|||
|
|
float por1;
|
|||
|
|
float por2;
|
|||
|
|
float por;
|
|||
|
|
float tr;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
struct WD_COIL{
|
|||
|
|
float weld_inner;
|
|||
|
|
char weld_coil[40];
|
|||
|
|
char weld_ay[16];
|
|||
|
|
char weld_sg[32];
|
|||
|
|
char weld_code[4];
|
|||
|
|
float weld_thick;
|
|||
|
|
float weld_width;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
struct SCRAP{
|
|||
|
|
int ent_scrap_up;
|
|||
|
|
int ent_scrap_low;
|
|||
|
|
int ext_scrap_tail;
|
|||
|
|
int ext_sample_tail;
|
|||
|
|
int ext_scrap_head;
|
|||
|
|
int ext_sample_head;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
struct BR{
|
|||
|
|
float BR_GR;
|
|||
|
|
float BR_DIA;
|
|||
|
|
float BR_RUAND;
|
|||
|
|
float BR_PLG;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
struct SignData{
|
|||
|
|
BR Br[ROLL_S_COUNT]; // #S<><53>
|
|||
|
|
float loop[LP_COUNT]; //<2F><><EFBFBD><EFBFBD>n<EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD>3 10000%
|
|||
|
|
float wpd[WPD_COUNT]; //n#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>3
|
|||
|
|
Welder welder; //<2F><><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>3
|
|||
|
|
Cut cut;
|
|||
|
|
Len len;
|
|||
|
|
char por1Id[24];
|
|||
|
|
char por2Id[24];
|
|||
|
|
char tr1Id[24];
|
|||
|
|
char tr2Id[24];
|
|||
|
|
float speed[5];
|
|||
|
|
float loop_pos[LP_COUNT];
|
|||
|
|
float ti;
|
|||
|
|
|
|||
|
|
TrackSign trksign;// zmtr <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>Ž<EFBFBD>β
|
|||
|
|
};
|
|||
|
|
/* <09><><EFBFBD>ڶ<EFBFBD>1#S<><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
<EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD><EFBFBD><EFBFBD>2#S<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>4#S<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>6#S<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|||
|
|
struct OnceMove{
|
|||
|
|
float length[ROLL_S_COUNT];//ÿ<><C3BF>S<EFBFBD><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD> mm
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
struct CalcData{
|
|||
|
|
OnceMove oncemove;
|
|||
|
|
long groupstep[10]; //Length difference between groups
|
|||
|
|
long loopstep[5];
|
|||
|
|
|
|||
|
|
};// calculated data
|
|||
|
|
|
|||
|
|
|
|||
|
|
#endif
|