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.
53 lines
1.0 KiB
C++
53 lines
1.0 KiB
C++
#pragma once
|
|
#include <string>
|
|
#include <vector>
|
|
#include "CommMgr.h"
|
|
class _declspec(dllexport) TransformerExport
|
|
{
|
|
public:
|
|
typedef struct {
|
|
uint8_t bytes[2];
|
|
}TwoBytes;
|
|
|
|
enum TransformerPos {
|
|
PT_TRANSFORMER,
|
|
SAPARATE_PT_TRANSFORMER,
|
|
LEFT_TOP_TRANSFORMER,
|
|
RIGHT_TOP_TRANSFORMER,
|
|
LEFT_BUTTOM_TRANSFORMER,
|
|
RIGHT_BUTTOM_TRANSFORMER,
|
|
};
|
|
|
|
public:
|
|
TransformerExport();
|
|
~TransformerExport();
|
|
|
|
public:
|
|
//大寰MCEA电缸初始化
|
|
bool InitDahuanTransformer();
|
|
|
|
bool TransformerAbsMove(TransformerPos transformerType, double distance);
|
|
private:
|
|
bool CommonOperator(short distance);
|
|
unsigned char GetCheckSum(unsigned char* buf, int len);
|
|
|
|
int GetCommNum(TransformerPos transformerType);
|
|
|
|
uint16_t CRC16_MudBus(uint8_t *puchMsg, uint8_t usDataLen);
|
|
|
|
//查询单个电缸是否回原
|
|
bool QueryOneIsReturn(int comm);
|
|
private:
|
|
int m_debondingPTComm = 1;
|
|
int m_saparatePTComm = 1;
|
|
int m_leftTopComm = 1;
|
|
int m_rightTopComm = 1;
|
|
int m_leftButtomComm = 1;
|
|
int m_rightButtomComm = 1;
|
|
|
|
int m_nComBaduRate = 115200;
|
|
|
|
CCommMgr m_transformer;
|
|
};
|
|
|