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.

74 lines
2.6 KiB
C++

#pragma once
#include "module.h"
class CPIAK10Motor
{
public:
CPIAK10Motor()
{
m_CurPos = 0;//当前的位置坐标(脉冲位置)
m_BindingPathMotorIdx = 0;//绑定光路上电机的索引值(1~8)
m_ChannelIdx = 1;//在控制器中的通道编号(1~4)
};
public:
int m_CurPos;//当前的位置坐标(脉冲位置)
int m_BindingPathMotorIdx;//绑定光路上电机的序号(1~8)
int m_ChannelIdx;//在控制器中的通道编号(1~4)
int m_SerialNoVal;
};
//光路微调电机控制
class CKCubeIMotorCtrl
{
public:
CKCubeIMotorCtrl()
{
m_SerialNoVal = 55165114;//设备序列号(每个控制器都不一样)
//一个控制器对应4个电机
for(int k=0;k<4;k++)
{
CPIAK10Motor PIAK10Motor;
PIAK10Motor.m_ChannelIdx = k+1;
m_PIAK10MotorVec.push_back(PIAK10Motor);
}
};
void KCubeMoveJog(bool bDir,int MoveVal);
public:
int m_SerialNoVal;//设备序列号(每个控制器都不一样)
vector<CPIAK10Motor> m_PIAK10MotorVec;//一个控制器对应4个电机
};
//Thorlabs 电机控制器
class CThorlabsKCubeIMotorCtrlMgr :public CModule
{
friend class CSemiSecsCommMgr;
public:
CThorlabsKCubeIMotorCtrlMgr(void);
~CThorlabsKCubeIMotorCtrlMgr(void);
virtual CMFCPropertyGridProperty *CreatGridProperty();
virtual MODULE GetModuleType(){return _PATH_MOTOR_CTRL_PORP;};
virtual CString GetParDirName(){return "KCubeIMotorCtrlMgr";};
virtual void OnAppInitialize();//软件打开时
void SetJogMovePar(int PathMotorIdx,bool bDir,int MoveVal);
void JogMove();
CPIAK10Motor *GetPIAK10Motor(int PathMotorIdx);
int GetPathMotorPos(int PathMotorIdx);
private:
CMFCPropertyGridProperty* CreatKCubeGridProperty(CKCubeIMotorCtrl &KCubeInertialMotor,CString MotorName,CString ValName);
void UpdatePathMotorPos();
void SavePathMotorPosToFile();
void ReadPathMotorPosFromFile();
private:
vector<CKCubeIMotorCtrl> m_KCubeIMotorCtrlVec;//电机控制器容器
vector<int> m_PathMotorPosVec;//当前电机的坐标
//当前Jog move 的参数
int m_JogMove_MotorIdx;//转动电机编号(1~8)
bool m_JogMove_bDir;//移动的方向
int m_JogMove_MoveVal;//转动脉冲数
};
extern CThorlabsKCubeIMotorCtrlMgr *gThorlabsKCubeIMotorCtrlMgr;