Files
TowerOptoSifAndSpectral/othersoft/shuttercali/source/LinearShutter/VSMD12XMiscDefines.h

109 lines
2.1 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.4;
crn = 0.6;
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, //无动作(只有状态位 S1 变化通知)
ResetZeroPosition, //重新设置原点位置
DecSpdStop, //减速停止
DecSpdStopRZP, //减速停止,并在停止后重新设置原点位置
Stop, //立刻停止
StopRZP, //立刻停止,并在停止后重新设置原点位置
RunningPosDirect, //正向连续运转(正速度)
RunningNegDirect, //反向连续运转(负速度)
OfflineModeOn, //离线模式启动
OfflineModeOff //离线模式停止
};