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.

86 lines
2.1 KiB
C++

#pragma once
/////////////////////////////////////////////////////////////////////////////
// CMotorRS recordset
#include <string>
#include "structure.h"
#include "ado2.h"
#include "DllDefines.h"
class MCCTRDLLCLASS CMotorRS
{
public:
CMotorRS();
virtual ~CMotorRS();
// Field/Param Data
BOOL m__EL;
long m__ve_Dir;
double m_Acce;
BOOL m_ALM;
long m_CardType;
long m_Clk;
BOOL m_CLR;
double m_Const;
double m_Cruise;
double m_Dec;
BOOL m__EL2;
double m_EPPR;
BOOL m_EZ;
long m_Home_Mode;
long m_ID;
BOOL m_Index_Logic;
BOOL m_INP;
std::string m_Motor_Name;
long m_Motor_No;
BOOL m_ORGI;
double m_PPR;
BOOL m_RDY;
double m_SAcce;
double m_SDec;
BOOL m_SON;
double m_StartUp;
long m_Type;
double m_UPR;
double m_HomeLeaveSteps;
long m_Home_Dir;
long m_EncoderType;
double m_Negative_Soft_Limit;
double m_Positive_Soft_Limit;
long m_CardNo;
long m_SlaveId;
// Overrides
public:
virtual std::string GetDefaultDBName(); // Default database name
virtual std::string GetDefaultSQL(); // Default SQL for Recordset
// Close Recordset and close database
virtual void Close();
// read motor profile table from mitmc.mdb and write to stModule struct
void InitMtrProfile(std::vector<stModule>& modules);
// get the module and motor index
void GetModuleAndMtrIndex(std::vector<stModule>& modules, int& iModule, int& iMtrNo);
// assign motor profile values
void AssignMtrProfileValues(std::vector<stModule>& modules, int iMotorPosArrayIndex);
// Implementation
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
private:
CADODatabase m_db;
CADORecordset m_rs;
void GetAllFieldsValue();
bool Open(const std::string& sqlQuery);
};