mirror of
				http://172.16.0.230/r/SIF/TowerOptoSifAndSpectral.git
				synced 2025-10-25 13:59:44 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			109 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			109 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| #pragma once
 | ||
| #include "ZZ_Types.h"
 | ||
| #define  MAXBUFFER			10240
 | ||
| #include<qstring.h>
 | ||
| using namespace ZZ_MISCDEF;
 | ||
| 
 | ||
| typedef struct tagTransportLayerInfomation
 | ||
| {
 | ||
| 	//Serial
 | ||
| 	int iPortType;
 | ||
| 	int iPortNumber;
 | ||
| 	int indexBaudRate;
 | ||
| 	int iBaudRate;
 | ||
| 	int	indexParity, indexBytesize, indexStopBits; //Mode
 | ||
| 	bool    Hw;		
 | ||
| 	bool	Sw;		
 | ||
| 	bool    Dtr, Rts;
 | ||
| 	QString FullPortName;
 | ||
| 	tagTransportLayerInfomation() {
 | ||
| 		iPortType = 0;
 | ||
| 		indexParity = 0;
 | ||
| 		iPortNumber = 8;
 | ||
| 		iBaudRate = 9600;
 | ||
| 		indexBytesize = 3;
 | ||
| 		indexStopBits = 0;
 | ||
| 		FullPortName = "";
 | ||
| 	}
 | ||
| 	 
 | ||
| 	  //Bit
 | ||
| 	  //Stop
 | ||
| 	  //MODEM CONTROL setting
 | ||
| 	  //MODEM LINE STATUS
 | ||
| 
 | ||
| 	//TCP UDP
 | ||
| 
 | ||
| }PortInfo;
 | ||
| 
 | ||
| typedef struct tagMotorStatusInfo
 | ||
| {
 | ||
| 	float fVelocity;
 | ||
| 	int   iPosition;
 | ||
| 	ZZ_U32  uiFlags;
 | ||
| }MSInfo;
 | ||
| 
 | ||
| typedef struct tagControllerParams
 | ||
| {
 | ||
| 	int bdr;     //baud
 | ||
| 	int mcs;     //microsteps 0:full 1:half 2:4 3:8 4:16 5:32 6:64 7:128 8:256
 | ||
| 	float spd;   //velocity
 | ||
| 	float acc;   //acceleration
 | ||
| 	float dec;   //deceleration
 | ||
| 	float cra;   //acc state current
 | ||
| 	float crn;   //normal state current
 | ||
| 	float crh;   //hold state current
 | ||
| 	ZZ_U8 s1f;
 | ||
| 	ZZ_U8 s1r;
 | ||
| 	ZZ_U8 s2f;
 | ||
| 	ZZ_U8 s2r;
 | ||
| 	ZZ_U8 zmd;   //zero mode
 | ||
| 	ZZ_U8 osv;   //open state sensor value
 | ||
| 	ZZ_U8 snr;   //zero sensor
 | ||
| 	ZZ_U8 zsp;   //zero safe position
 | ||
| 	float zsd;   //zero velocity
 | ||
| 	tagControllerParams() {
 | ||
| 		bdr = 9600;
 | ||
| 
 | ||
| 		cra = 0.8;
 | ||
| 		crh = 0.1;
 | ||
| 		crn = 0.8;
 | ||
| 
 | ||
| 		acc = 100000;
 | ||
| 		dec = 100000;
 | ||
| 		spd = 64000;
 | ||
| 
 | ||
| 		osv = 0;
 | ||
| 		snr = 0;
 | ||
| 		zmd = 3;
 | ||
| 		zsp = 20;
 | ||
| 		zsd = 50000;
 | ||
| 
 | ||
| 		mcs = 6;
 | ||
| 	}
 | ||
| }ControllerParams;
 | ||
| 
 | ||
| typedef union
 | ||
| {
 | ||
| 	ZZ_U8    byteValue[4];
 | ||
| 	short   i16Value[2];
 | ||
| 	ZZ_U16  u16Value[2];
 | ||
| 	int     i32Value;
 | ||
| 	float   fValue;
 | ||
| 	ZZ_U32    u32Value;
 | ||
| }unValue;
 | ||
| 
 | ||
| enum emVSMDTriggerEvent
 | ||
| {
 | ||
| 	NoAction =0,        //<2F><EFBFBD><DEB6><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB>״̬λ S1 <20>仯֪ͨ<CDA8><D6AA>
 | ||
| 	ResetZeroPosition,  //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>λ<EFBFBD><CEBB>
 | ||
| 	DecSpdStop,         //<2F><><EFBFBD><EFBFBD>ֹͣ
 | ||
| 	DecSpdStopRZP,      //<2F><><EFBFBD><EFBFBD>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>λ<EFBFBD><CEBB>
 | ||
| 	Stop,               //<2F><><EFBFBD><EFBFBD>ֹͣ
 | ||
| 	StopRZP,            //<2F><><EFBFBD><EFBFBD>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>λ<EFBFBD><CEBB>
 | ||
| 	RunningPosDirect,   //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD>ٶȣ<D9B6>
 | ||
| 	RunningNegDirect,   //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD>ٶȣ<D9B6>
 | ||
| 	OfflineModeOn,      //<2F><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD>
 | ||
| 	OfflineModeOff      //<2F><><EFBFBD><EFBFBD>ģʽֹͣ
 | ||
| };
 | ||
| 
 |