激光器及控制通信功能添加

This commit is contained in:
wangxx1809 2024-05-15 13:38:34 +08:00
parent f3999b532b
commit 3e8d350e96
31 changed files with 1679 additions and 819 deletions

View File

@ -120,23 +120,40 @@ void Controller::Init(){
m_Purifier->Init(); m_Purifier->Init();
m_jobController.StartLoadPrepareJob(); m_jobController.StartLoadPrepareJob();
//ConfigManager::GetInstance()->SendCfgToClients(); //发送配置到客户端
//BaseCtrl::SendToClients(); //发送控制参数到客户端
} }
void Controller::StartSend() { void Controller::StartSend() {
StopSend(); StopSend();
m_sendTdExitFlag = false; m_sendTdExitFlag = false;
m_sendParamThread = std::thread([this] { m_sendParamThread = std::thread([this] {
while (!m_sendTdExitFlag) { while (!m_sendTdExitFlag) {
m_ComServer->SendToClients(); m_ComServer->SendToClients();
m_Purifier->SendToClients(); m_Purifier->SendToClients();
this_thread::sleep_for(std::chrono::milliseconds(150)); //轴参数
m_Axis->m_Mold->GetState()->SendToClients(AXISMOLD);
m_Axis->m_MoldSlave->GetState()->SendToClients(AXISMOLDSLAVE);
m_Axis->m_Clean->GetState()->SendToClients(AXISCLEAN);
m_Axis->m_CleanSlave->GetState()->SendToClients(AXISCLEANSLAVE);
m_Axis->m_Load->GetState()->SendToClients(AXISLOAD);
m_Axis->m_Arm->GetState()->SendToClients(AXISMARM);
m_Axis->m_Supply->GetState()->SendToClients(AXISMSUPPLY);
m_Axis->m_Ele->GetState()->SendToClients(AXISELE);
m_Axis->m_EleSlave->GetState()->SendToClients(AXISELESLAVE);
//扫描参数
static int count = 0;
++count;
if (count == 2) { //发送频率降低
m_ScannerCtrl->SendToClients();
count = 0;
}
this_thread::sleep_for(std::chrono::milliseconds(250));
} }
}); });

View File

@ -8,14 +8,20 @@ void DataHandle::DataCallBackProc(void* pthis, const ReadData& msg) {
p->DataCallBackHandle(msg); p->DataCallBackHandle(msg);
} }
void DataHandle::LayersDataCallBackProc(void* pthis,const ReadData& msg, ::stream::LayerData** response) { void DataHandle::LayersDataCallBackProc(void* pthis,const ReadData& msg, ::stream::ResponseAny** response) {
DataHandle* p = (DataHandle*)pthis; DataHandle* p = (DataHandle*)pthis;
int index = atoi(msg.strValue.data()); int index = atoi(msg.strValue.data());
if ((READTYPE)msg.dataType == LAYERDATAREQ) {
int size = (int)p->m_controller->m_jobController.m_PrepareJob->GetMetaData()->GetLayersVec().size();
if (!p || index<1 || index>(int)size) return;
p->m_controller->m_jobController.m_PrepareJob->GetMetaData()->GetLayerByIndex(index - 1, response);
}
//else if ((READTYPE)msg.dataType == XYSCANSTATE) {
//
//}
int size = (int)p->m_controller->m_jobController.m_PrepareJob->GetMetaData()->GetLayersVec().size();
if (!p || index<1 || index>(int)size) return;
p->m_controller->m_jobController.m_PrepareJob->GetMetaData()->GetLayerByIndex(index-1,response);
} }
DataHandle::DataHandle() DataHandle::DataHandle()
@ -93,33 +99,33 @@ void DataHandle::DataCallBackHandle(const ReadData& msg) {
printf("没有准备好哦,无法操作\n"); return; printf("没有准备好哦,无法操作\n"); return;
} }
m_controller->m_Machine->CallAxisFunc(msg); break; m_controller->m_Machine->CallAxisFunc(msg); break;
case SCANERSTART: //开始扫描 //case SCANERSTART: //开始扫描
scanners = m_controller->m_ScannerCtrl->GetScanners(); // scanners = m_controller->m_ScannerCtrl->GetScanners();
index = atoi(msg.strValue.c_str()); // index = atoi(msg.strValue.c_str());
if (index >= (*scanners).size()) return; // if (index >= (*scanners).size()) return;
if ((*scanners)[index]) (*scanners)[index]->StartDebugTest(); // if ((*scanners)[index]) (*scanners)[index]->StartDebugTest();
break; // break;
case SCANERSTOP: //停止扫描 //case SCANERSTOP: //停止扫描
scanners = m_controller->m_ScannerCtrl->GetScanners(); // scanners = m_controller->m_ScannerCtrl->GetScanners();
index = atoi(msg.strValue.c_str()); // index = atoi(msg.strValue.c_str());
if (index >= (*scanners).size()) return; // if (index >= (*scanners).size()) return;
if ((*scanners)[index]) (*scanners)[index]->StopDebugTest(); // if ((*scanners)[index]) (*scanners)[index]->StopDebugTest();
break; // break;
case STARTHEATINGSCANNERTEST: //开始振镜预热测试 //case STARTHEATINGSCANNERTEST: //开始振镜预热测试
scanners = m_controller->m_ScannerCtrl->GetScanners(); // scanners = m_controller->m_ScannerCtrl->GetScanners();
index = atoi(msg.strValue.c_str()); // index = atoi(msg.strValue.c_str());
if (index >= (*scanners).size()) return; // if (index >= (*scanners).size()) return;
if((*scanners)[index]) (*scanners)[index]->StartHeatingScannerTest(); // if((*scanners)[index]) (*scanners)[index]->StartHeatingScannerTest();
break; // break;
case STOPHEATINGSCANNERTEST: //停止振镜预热 //case STOPHEATINGSCANNERTEST: //停止振镜预热
scanners = m_controller->m_ScannerCtrl->GetScanners(); // scanners = m_controller->m_ScannerCtrl->GetScanners();
index = atoi(msg.strValue.c_str()); // index = atoi(msg.strValue.c_str());
if (index >= (*scanners).size()) return; // if (index >= (*scanners).size()) return;
if ((*scanners)[index]) (*scanners)[index]->StopHeatingScannerTest(); // if ((*scanners)[index]) (*scanners)[index]->StopHeatingScannerTest();
break; // break;
case INITERRORINFOSREQ: //初始化错误信息 //case INITERRORINFOSREQ: //初始化错误信息
msg.clientPtr->PushMsg(new WriteData(INITERRORINFOSRSP, { {string(""), m_controller->m_ScannerCtrl->GetInitErrorInfos(), iSTRING} })); // msg.clientPtr->PushMsg(new WriteData(INITERRORINFOSRSP, { {string(""), m_controller->m_ScannerCtrl->GetInitErrorInfos(), iSTRING} }));
break; // break;
case VERSIONREQ: //获取版本信息 case VERSIONREQ: //获取版本信息
msg.clientPtr->PushMsg(new WriteData(VERSIONRSP, { { string(""), g_SystemInfo->m_ProductVersion, iSTRING } })); msg.clientPtr->PushMsg(new WriteData(VERSIONRSP, { { string(""), g_SystemInfo->m_ProductVersion, iSTRING } }));
break; break;
@ -137,8 +143,16 @@ void DataHandle::DataCallBackHandle(const ReadData& msg) {
m_controller->m_ScannerCtrl->CallFunc(msg); break; m_controller->m_ScannerCtrl->CallFunc(msg); break;
case REQUEST: case REQUEST:
ConfigManager::GetInstance()->SendCfgToClients(); //发送配置到客户端 if (msg.nameKey == "36") {
printf("error,36 需要释放ScannerCtrl::Init()内部代码块...\n");
//for (int i = 0; i < 4; ++i) { //需要先打开ScannerCtrl::Init()代码块
// Scanner* p = (m_controller->m_ScannerCtrl->GetScanners())->at(i);
// p->GetScanStateXY().SendToClients(XYSCANSTATE, "_" + to_string(i));
//}
}
else {
ConfigManager::GetInstance()->SendCfgToClients(); //发送配置到客户端
}
default: break; default: break;

View File

@ -7,7 +7,7 @@
class DataHandle{ class DataHandle{
typedef void (*DataCallBack)(void* pthis, const ReadData& msg); typedef void (*DataCallBack)(void* pthis, const ReadData& msg);
typedef void (*LayersDataCallBack)(void* pthis, const ReadData& msg, ::stream::LayerData** response); typedef void (*LayersDataCallBack)(void* pthis, const ReadData& msg, ::stream::ResponseAny** response);
public: public:
DataHandle(); DataHandle();
~DataHandle(); ~DataHandle();
@ -17,7 +17,7 @@ public:
void Stop(); void Stop();
static void DataCallBackProc(void* pthis, const ReadData& msg); static void DataCallBackProc(void* pthis, const ReadData& msg);
static void LayersDataCallBackProc(void* pthis, const ReadData& msg,::stream::LayerData** response); static void LayersDataCallBackProc(void* pthis, const ReadData& msg,::stream::ResponseAny** response);
private: private:
//DataCallBack m_dataCallBack; //DataCallBack m_dataCallBack;
std::thread m_testTd; std::thread m_testTd;

View File

@ -8,11 +8,6 @@ enum READTYPE {
SET, SET,
AXISMOVEFUNC, //轴运动函数 AXISMOVEFUNC, //轴运动函数
SCANERSTART, //开始扫描
SCANERSTOP, //停止扫描
STARTHEATINGSCANNERTEST, //开始振镜预热测试
STOPHEATINGSCANNERTEST, //停止振镜预热
INITERRORINFOSREQ, //初始化错误信息
VERSIONREQ, //获取版本信息 VERSIONREQ, //获取版本信息
IOSIGNAL, //io 信号 IOSIGNAL, //io 信号
@ -62,7 +57,7 @@ struct ReadData {
enum WRITETYPE { enum WRITETYPE {
ALARM = 0, //报警 ALARM = 0, //报警
INITERRORINFOSRSP, //返回初始化错误信息 //INITERRORINFOSRSP, //返回初始化错误信息
VERSIONRSP, //返回版本信息 VERSIONRSP, //返回版本信息
IOSIGNALRSP, //io信号返回数据 IOSIGNALRSP, //io信号返回数据
SYSPARAMDATA, //系统参数 SYSPARAMDATA, //系统参数
@ -94,7 +89,7 @@ enum WRITETYPE {
AXISELESLAVE, AXISELESLAVE,
/********************配置信息******************/ /********************配置信息******************/
PARAMLIMITCFGPARAM, PARAMLIMITCFGPARAM, //paramlimit配置参数
EXTCFGPARAM, EXTCFGPARAM,
MOLDCFGPARAM, MOLDCFGPARAM,
@ -106,7 +101,10 @@ enum WRITETYPE {
LOADPARAMRSP, //装载参数 LOADPARAMRSP, //装载参数
SCANCTRLSTATE, //scanctrl参数 SCANCTRLSTATE, //BaseCtrl参数
SCANCTRLPARAM, //scanctrl参数
XYSCANSTATE, //XYScanState参数 在参数更新的时候才会发送到客户端
TEST = 1000, //test TEST = 1000, //test
}; };
@ -124,7 +122,7 @@ struct WriteData {
WriteData() {} WriteData() {}
WriteData(WRITETYPE dt,const std::list<Item>& its ) WriteData(WRITETYPE dt,const std::list<Item>& its )
: dataType(dt), items(its){} : dataType(dt), result(true), items(its){}
}; };

View File

@ -19,18 +19,22 @@ StreamServer::~StreamServer() {
//回复后连接中断 请求打印文件层 //回复后连接中断 请求打印文件层
::grpc::Status StreamServer::Simple(::grpc::ServerContext* context, const ::stream::RequestInfo* request, ::stream::LayerData* response) { ::grpc::Status StreamServer::Simple(::grpc::ServerContext* context, const ::stream::RequestInfo* request, ::stream::ResponseAny* response) {
ReadData readData; ReadData readData;
readData.dataType = (READTYPE)(request->datatype()); readData.dataType = (READTYPE)(request->datatype());
readData.nameKey = request->namekey(); readData.nameKey = request->namekey();
readData.strValue = request->strvalue(); readData.strValue = request->strvalue();
readData.valueType = (DATATYPE)request->valuetype(); readData.valueType = (DATATYPE)request->valuetype();
if ((READTYPE)(request->datatype()) == LAYERDATAREQ) { //if ((READTYPE)(request->datatype()) == LAYERDATAREQ) {
if (m_layerDataCallBack) // if (m_layerDataCallBack)
m_layerDataCallBack(m_handlePtr, readData, &response); // m_layerDataCallBack(m_handlePtr, readData, &response);
//}
} //else if((READTYPE)(request->datatype()) == XYSCANSTATE){
// if (m_layerDataCallBack)
// m_layerDataCallBack(m_handlePtr, readData, &response);
//}
if (m_layerDataCallBack)
m_layerDataCallBack(m_handlePtr, readData, &response);
return Status::OK; return Status::OK;
} }

View File

@ -19,7 +19,7 @@ using stream::ResponseInfo;
class StreamServer final : public Stream::Service { class StreamServer final : public Stream::Service {
typedef void (*DataCallBack)(void* pthis,const ReadData& msg); typedef void (*DataCallBack)(void* pthis,const ReadData& msg);
typedef void (*LayerDataCallBack)(void* pthis, const ReadData& msg, ::stream::LayerData** response); typedef void (*LayerDataCallBack)(void* pthis, const ReadData& msg, ::stream::ResponseAny** response);
public: public:
@ -38,7 +38,7 @@ public:
private: private:
Status AllStream(ServerContext* context, grpc::ServerReaderWriter<ResponseInfo, RequestInfo>* stream) override; Status AllStream(ServerContext* context, grpc::ServerReaderWriter<ResponseInfo, RequestInfo>* stream) override;
::grpc::Status Simple(::grpc::ServerContext* context, const ::stream::RequestInfo* request, ::stream::LayerData* response); ::grpc::Status Simple(::grpc::ServerContext* context, const ::stream::RequestInfo* request, ::stream::ResponseAny* response);
private: private:
std::thread m_checkCloseTd; //检测客户端关闭线程 std::thread m_checkCloseTd; //检测客户端关闭线程

View File

@ -4,191 +4,223 @@
#include "../Logger.h" #include "../Logger.h"
AxisState::AxisState() AxisState::AxisState()
: m_ServoOn(new BoolData("ServoOn", u8"轴伺服ON_RW"))
, m_ServoHomeIndexOn(new BoolData("ServoHomeIndexOn", u8"轴伺服成立原点_RW"))
, m_ServoReset(new BoolData("ServoReset", u8"轴伺服复位_RW"))
, m_MoveP(new BoolData("MoveP", u8"轴相对左运动_手动_RW"))
, m_MoveN(new BoolData("MoveN", u8"轴相对右运动_手动_RW"))
, m_MovePContinue(new BoolData("MovePContinue", u8"轴左JOG_手动_RW"))
, m_MoveNContinue(new BoolData("MoveNContinue", u8"轴右JOG_手动_RW"))
, m_MoveAbsPos(new BoolData("MoveAbsPos", u8"轴绝对值运动_手动_RW"))
, m_MotionStop(new BoolData("MotionStop", u8"轴急停_RW"))
, m_ServoRDY(new BoolData("ServoRDY", u8"轴伺服RDY状态_R"))
, m_ServoHomeDone(new BoolData("ServoHomeDone", u8"轴指令运行HOME_Done_R"))
, m_ResetDone(new BoolData("ResetDone", u8"轴指令运行RESET_Done_R"))
, m_ServoBusy(new BoolData("ServoBusy", u8"轴伺服BUSY_R"))
, m_ServoException(new BoolData("ServoException", u8"轴伺服异常_R"))
, m_Runable(new BoolData("Runable", u8"轴可运行状态_R"))
, m_ExceptionCode(new ShortData("ExceptionCode", u8"轴伺服异常字_R"))
, m_Pos(new FloatData("Pos", u8"当前位置"))
, m_Torque(new FloatData("Torque", u8"当前扭矩"))
, m_ShowPos(new FloatData("ShowPos"))
, m_RPos(new FloatData("RPos"))
{ {
size_t ptrSize = sizeof(nullptr); //指针大小
void* startPtr = &m_startFlag + 1;
size_t count = ((size_t)&m_endFlag - (size_t)startPtr) / ptrSize;
InsertMp(startPtr, count);
} }
void AxisState::GetValue(AxisStateValue& value) void AxisState::GetValue(AxisStateValue& value)
{ {
std::shared_lock<std::shared_mutex> lock(mtx); std::shared_lock<std::shared_mutex> lock(mtx);
value.ServoOn = m_ServoOn; value.ServoOn = m_ServoOn->GetValue();
value.ServoHomeIndexOn = m_ServoHomeIndexOn; value.ServoHomeIndexOn = m_ServoHomeIndexOn->GetValue();
value.ServoReset = m_ServoReset; value.ServoReset = m_ServoReset->GetValue();
value.MoveP = m_MoveP; value.MoveP = m_MoveP->GetValue();
value.MoveN = m_MoveN; value.MoveN = m_MoveN->GetValue();
value.MovePContinue = m_MovePContinue; value.MovePContinue = m_MovePContinue->GetValue();
value.MoveNContinue = m_MoveNContinue; value.MoveNContinue = m_MoveNContinue->GetValue();
value.MoveAbsPos = m_MoveAbsPos; value.MoveAbsPos = m_MoveAbsPos->GetValue();
value.MotionStop = m_MotionStop; value.MotionStop = m_MotionStop->GetValue();
value.ServoRDY = m_ServoRDY; value.ServoRDY = m_ServoRDY->GetValue();
value.ServoHomeDone = m_ServoHomeDone; value.ServoHomeDone = m_ServoHomeDone->GetValue();
value.ResetDone = m_ResetDone; value.ResetDone = m_ResetDone->GetValue();
value.ServoException = m_ServoException; value.ServoException = m_ServoException->GetValue();
value.Runable = m_Runable; value.Runable = m_Runable->GetValue();
value.ExceptionCode = m_ExceptionCode; value.ExceptionCode = m_ExceptionCode->GetValue();
value.Pos = m_Pos; value.Pos = m_Pos->GetValue();
value.Torque = m_Torque; value.Torque = m_Torque->GetValue();
value.ServoBusy = m_ServoBusy; value.ServoBusy = m_ServoBusy->GetValue();
value.ShowPos = m_ShowPos->GetValue();
value.RPos = m_RPos->GetValue();
} }
void AxisState::Update(unsigned char* addr) void AxisState::Update(unsigned char* addr)
{ {
std::unique_lock<std::shared_mutex> lock(mtx); std::unique_lock<std::shared_mutex> lock(mtx);
m_ServoOn= ((addr[0] & 0x1)>0 ? true : false); m_ServoOn->SetValue(((addr[0] & 0x1) > 0 ? true : false));
m_ServoHomeIndexOn= ((addr[0] & 0x2)>0 ? true : false); m_ServoHomeIndexOn->SetValue(((addr[0] & 0x2) > 0 ? true : false));
m_ServoReset= ((addr[0] & 0x4)>0 ? true : false); m_ServoReset->SetValue(((addr[0] & 0x4) > 0 ? true : false));
m_MoveP= ((addr[0] & 0x8)>0 ? true : false); m_MoveP->SetValue(((addr[0] & 0x8) > 0 ? true : false));
m_MoveN= ((addr[0] & 0x10)>0 ? true : false); m_MoveN->SetValue(((addr[0] & 0x10) > 0 ? true : false));
m_MovePContinue= ((addr[0] & 0x20)>0 ? true : false); m_MovePContinue->SetValue(((addr[0] & 0x20) > 0 ? true : false));
m_MoveNContinue= ((addr[0] & 0x40)>0 ? true : false); m_MoveNContinue->SetValue(((addr[0] & 0x40) > 0 ? true : false));
m_MoveAbsPos= ((addr[0] & 0x80)>0 ? true : false); m_MoveAbsPos->SetValue(((addr[0] & 0x80) > 0 ? true : false));
m_MotionStop= ((addr[1] & 0x1)>0 ? true : false); m_MotionStop->SetValue(((addr[1] & 0x1) > 0 ? true : false));
m_ServoRDY= ((addr[1] & 0x2)>0 ? true : false); m_ServoRDY->SetValue(((addr[1] & 0x2) > 0 ? true : false));
m_ServoHomeDone= ((addr[1] & 0x4)>0 ? true : false); m_ServoHomeDone->SetValue(((addr[1] & 0x4) > 0 ? true : false));
m_ResetDone= ((addr[1] & 0x8)>0 ? true : false); m_ResetDone->SetValue(((addr[1] & 0x8) > 0 ? true : false));
m_ServoBusy= ((addr[1] & 0x10)>0 ? true : false); m_ServoBusy->SetValue(((addr[1] & 0x10) > 0 ? true : false));
m_ServoException= ((addr[1] & 0x20)>0 ? true : false); m_ServoException->SetValue(((addr[1] & 0x20) > 0 ? true : false));
m_Runable= ((addr[1] & 0x40)>0 ? true : false); m_Runable->SetValue( ((addr[1] & 0x40)>0 ? true : false));
m_ExceptionCode = S7WORDDATA(addr[3], addr[2]).wValue; m_ExceptionCode ->SetValue( S7WORDDATA(addr[3], addr[2]).wValue);
} }
void AxisState::UpdatePosAndLoad(unsigned char* addr) void AxisState::UpdatePosAndLoad(unsigned char* addr)
{ {
int index = 0; int index = 0;
std::unique_lock<std::shared_mutex> lock(mtx); std::unique_lock<std::shared_mutex> lock(mtx);
m_Pos = (S7FLOATDATA(addr[index + 3], addr[index + 2], addr[index + 1], addr[index]).fValue); index += 4; m_Pos->SetValue((S7FLOATDATA(addr[index + 3], addr[index + 2], addr[index + 1], addr[index]).fValue)); index += 4;
m_Torque = (S7FLOATDATA(addr[index + 3], addr[index + 2], addr[index + 1], addr[index]).fValue); index += 4; m_Torque->SetValue((S7FLOATDATA(addr[index + 3], addr[index + 2], addr[index + 1], addr[index]).fValue)); index += 4;
if (!m_AxisCfg->m_ShowPosInv) { if (!m_AxisCfg->m_ShowPosInv) {
m_ShowPos = m_Pos - m_AxisCfg->m_ShowRefZero->GetValue(); m_ShowPos->SetValue(m_Pos->GetValue() - m_AxisCfg->m_ShowRefZero->GetValue());
} }
else { else {
m_ShowPos = -(m_Pos - m_AxisCfg->m_ShowRefZero->GetValue()); m_ShowPos->SetValue(-(m_Pos->GetValue() - m_AxisCfg->m_ShowRefZero->GetValue()));
} }
m_RPos = m_ShowPos / (m_AxisCfg->m_active_limit - m_AxisCfg->m_negactive_limit); m_RPos->SetValue(m_ShowPos->GetValue() / (m_AxisCfg->m_active_limit - m_AxisCfg->m_negactive_limit));
} }
float AxisState::GetShowPos() float AxisState::GetShowPos()
{ {
float showPos = 0.0f; float showPos = 0.0f;
std::unique_lock<std::shared_mutex> lock(mtx); std::shared_lock<std::shared_mutex> lock(mtx);
showPos = m_ShowPos; showPos = m_ShowPos->GetValue();
return showPos; return showPos;
} }
void AxisState::SetZeroPos() void AxisState::SetZeroPos()
{ {
m_AxisCfg->m_ShowRefZero ->SetValue(m_Pos); m_AxisCfg->m_ShowRefZero ->SetValue(m_Pos->GetValue());
ConfigManager::GetInstance()->UpdateZeroOffset(m_AxisCfg->m_axis_id, (long)m_AxisCfg->m_ShowRefZero->GetValue()); ConfigManager::GetInstance()->UpdateZeroOffset(m_AxisCfg->m_axis_id, (long)m_AxisCfg->m_ShowRefZero->GetValue());
} }
//void AxisState::SendToClients() {
// /*m_controller->m_Axis->m_Mold->GetState()->Update(msg);*/
//
//}
void MainAxisState::GetValue(AxisStateValue& value) void MainAxisState::GetValue(AxisStateValue& value)
{ {
std::shared_lock<std::shared_mutex> lock(mtx); std::shared_lock<std::shared_mutex> lock(mtx);
value.ServoOn = m_ServoOn; value.ServoOn = m_ServoOn->GetValue();
value.ServoHomeIndexOn = m_ServoHomeIndexOn; value.ServoHomeIndexOn = m_ServoHomeIndexOn->GetValue();
value.ServoReset = m_ServoReset; value.ServoReset = m_ServoReset->GetValue();
value.MoveP = m_MoveP; value.MoveP = m_MoveP->GetValue();
value.MoveN = m_MoveN; value.MoveN = m_MoveN->GetValue();
value.MovePContinue = m_MovePContinue; value.MovePContinue = m_MovePContinue->GetValue();
value.MoveNContinue = m_MoveNContinue; value.MoveNContinue = m_MoveNContinue->GetValue();
value.MoveAbsPos = m_MoveAbsPos; value.MoveAbsPos = m_MoveAbsPos->GetValue();
value.MotionStop = m_MotionStop; value.MotionStop = m_MotionStop->GetValue();
value.ServoRDY = m_ServoRDY; value.ServoRDY = m_ServoRDY->GetValue();
value.ServoHomeDone = m_ServoHomeDone; value.ServoHomeDone = m_ServoHomeDone->GetValue();
value.ResetDone = m_ResetDone; value.ResetDone = m_ResetDone->GetValue();
value.ServoException = m_ServoException; value.ServoException = m_ServoException->GetValue();
value.Runable = m_Runable; value.Runable = m_Runable->GetValue();
value.ExceptionCode = m_ExceptionCode; value.ExceptionCode = m_ExceptionCode->GetValue();
value.Pos = m_Pos; value.Pos = m_Pos->GetValue();
value.Torque = m_Torque; value.Torque = m_Torque->GetValue();
value.ShowPos = m_ShowPos; value.ShowPos = m_ShowPos->GetValue();
value.RPos = m_RPos; value.RPos = m_RPos->GetValue();
value.ServoBreakOn = m_ServoBreakOn; value.ServoBreakOn = m_ServoBreakOn->GetValue();
value.BindSlaveOn = m_BindSlaveOn; value.BindSlaveOn = m_BindSlaveOn->GetValue();
value.BindSlaveFinish = m_BindSlaveFinish; value.BindSlaveFinish = m_BindSlaveFinish->GetValue();
value.ServoBusy = m_ServoBusy; value.ServoBusy = m_ServoBusy->GetValue();
} }
void MainAxisState::Update(unsigned char* addr) void MainAxisState::Update(unsigned char* addr)
{ {
std::unique_lock<std::shared_mutex> lock(mtx); std::unique_lock<std::shared_mutex> lock(mtx);
m_ServoOn= ((addr[0] & 0x1)>0 ? true : false); m_ServoOn->SetValue((addr[0] & 0x1) > 0 ? true : false);
m_ServoHomeIndexOn= ((addr[0] & 0x2)>0 ? true : false); m_ServoHomeIndexOn->SetValue((addr[0] & 0x2) > 0 ? true : false);
m_ServoReset= ((addr[0] & 0x4)>0 ? true : false); m_ServoReset->SetValue((addr[0] & 0x4) > 0 ? true : false);
m_ServoBreakOn= ((addr[0] & 0x8)>0 ? true : false); m_ServoBreakOn->SetValue((addr[0] & 0x8) > 0 ? true : false);
m_BindSlaveOn= ((addr[0] & 0x10)>0 ? true : false); m_BindSlaveOn->SetValue((addr[0] & 0x10) > 0 ? true : false);
m_MoveP= ((addr[0] & 0x20)>0 ? true : false); m_MoveP->SetValue((addr[0] & 0x20) > 0 ? true : false);
m_MoveN= ((addr[0] & 0x40)>0 ? true : false); m_MoveN->SetValue((addr[0] & 0x40) > 0 ? true : false);
m_MovePContinue= ((addr[0] & 0x80)>0 ? true : false); m_MovePContinue->SetValue((addr[0] & 0x80) > 0 ? true : false);
m_MoveNContinue= ((addr[1] & 0x1)>0 ? true : false); m_MoveNContinue->SetValue((addr[1] & 0x1) > 0 ? true : false);
m_MoveAbsPos= ((addr[1] & 0x2)>0 ? true : false); m_MoveAbsPos->SetValue((addr[1] & 0x2) > 0 ? true : false);
m_MotionStop= ((addr[1] & 0x4)>0 ? true : false); m_MotionStop->SetValue((addr[1] & 0x4) > 0 ? true : false);
m_ServoRDY= ((addr[1] & 0x8)>0 ? true : false); m_ServoRDY->SetValue((addr[1] & 0x8) > 0 ? true : false);
m_ServoHomeDone= ((addr[1] & 0x10)>0 ? true : false); m_ServoHomeDone->SetValue((addr[1] & 0x10) > 0 ? true : false);
m_ResetDone= ((addr[1] & 0x20)>0 ? true : false); m_ResetDone->SetValue((addr[1] & 0x20) > 0 ? true : false);
bool lastServoBusy = m_ServoBusy; bool lastServoBusy = m_ServoBusy;
m_ServoBusy= ((addr[1] & 0x40)>0 ? true : false); m_ServoBusy->SetValue((addr[1] & 0x40) > 0 ? true : false);
// if (lastServoBusy && !m_ServoBusy) { // if (lastServoBusy && !m_ServoBusy) {
// g_log->TraceInfo("轴忙转换为:%d",m_ServoBusy?1:0); // g_log->TraceInfo("轴忙转换为:%d",m_ServoBusy?1:0);
// } // }
m_ServoException= ((addr[1] & 0x80)>0 ? true : false); m_ServoException->SetValue((addr[1] & 0x80) > 0 ? true : false);
m_BindSlaveFinish= ((addr[2] & 0x1)>0 ? true : false); m_BindSlaveFinish->SetValue((addr[2] & 0x1) > 0 ? true : false);
m_Runable= ((addr[2] & 0x2)>0 ? true : false); m_Runable->SetValue((addr[2] & 0x2) > 0 ? true : false);
m_ExceptionCode = S7WORDDATA(addr[5], addr[4]).wValue; m_ExceptionCode->SetValue(S7WORDDATA(addr[5], addr[4]).wValue);
} }
void SlaveAxisState::GetValue(AxisStateValue& value) void SlaveAxisState::GetValue(AxisStateValue& value)
{ {
std::shared_lock<std::shared_mutex> lock(mtx); std::shared_lock<std::shared_mutex> lock(mtx);
value.ServoOn = m_ServoOn; value.ServoOn = m_ServoOn->GetValue();
value.ServoHomeIndexOn = m_ServoHomeIndexOn; value.ServoHomeIndexOn = m_ServoHomeIndexOn->GetValue();
value.ServoReset = m_ServoReset; value.ServoReset = m_ServoReset->GetValue();
value.MoveP = m_MoveP; value.MoveP = m_MoveP->GetValue();
value.MoveN = m_MoveN; value.MoveN = m_MoveN->GetValue();
value.MovePContinue = m_MovePContinue; value.MovePContinue = m_MovePContinue->GetValue();
value.MoveNContinue = m_MoveNContinue; value.MoveNContinue = m_MoveNContinue->GetValue();
value.MoveAbsPos = m_MoveAbsPos; value.MoveAbsPos = m_MoveAbsPos->GetValue();
value.MotionStop = m_MotionStop; value.MotionStop = m_MotionStop->GetValue();
value.ServoRDY = m_ServoRDY; value.ServoRDY = m_ServoRDY->GetValue();
value.ServoHomeDone = m_ServoHomeDone; value.ServoHomeDone = m_ServoHomeDone->GetValue();
value.ResetDone = m_ResetDone; value.ResetDone = m_ResetDone->GetValue();
value.ServoException = m_ServoException; value.ServoException = m_ServoException->GetValue();
value.Runable = m_Runable; value.Runable = m_Runable->GetValue();
value.ExceptionCode = m_ExceptionCode; value.ExceptionCode = m_ExceptionCode->GetValue();
value.Pos = m_Pos; value.Pos = m_Pos->GetValue();
value.Torque = m_Torque; value.Torque = m_Torque->GetValue();
value.ShowPos = m_ShowPos; value.ShowPos = m_ShowPos->GetValue();
value.RPos = m_RPos; value.RPos = m_RPos->GetValue();
value.SlaveServoBreakOn = m_ServoBreakOn; value.SlaveServoBreakOn = m_ServoBreakOn->GetValue();
value.SlaveUnbind = m_Unbind; value.SlaveUnbind = m_Unbind->GetValue();
value.ServoBusy = m_ServoBusy; value.ServoBusy = m_ServoBusy->GetValue();
} }
void SlaveAxisState::Update(unsigned char* addr) void SlaveAxisState::Update(unsigned char* addr)
{ {
std::unique_lock<std::shared_mutex> lock(mtx); std::unique_lock<std::shared_mutex> lock(mtx);
m_ServoOn= ((addr[0] & 0x1)>0 ? true : false); m_ServoOn->SetValue((addr[0] & 0x1) > 0 ? true : false);
m_ServoHomeIndexOn= ((addr[0] & 0x2)>0 ? true : false); m_ServoHomeIndexOn->SetValue((addr[0] & 0x2) > 0 ? true : false);
m_ServoReset= ((addr[0] & 0x4)>0 ? true : false); m_ServoReset->SetValue((addr[0] & 0x4) > 0 ? true : false);
m_ServoBreakOn= ((addr[0] & 0x8)>0 ? true : false); m_ServoBreakOn->SetValue((addr[0] & 0x8) > 0 ? true : false);
m_Unbind= ((addr[0] & 0x10)>0 ? true : false); m_Unbind->SetValue((addr[0] & 0x10) > 0 ? true : false);
m_MoveP= ((addr[0] & 0x20)>0 ? true : false); m_MoveP->SetValue((addr[0] & 0x20) > 0 ? true : false);
m_MoveN= ((addr[0] & 0x40)>0 ? true : false); m_MoveN->SetValue((addr[0] & 0x40) > 0 ? true : false);
m_MovePContinue= ((addr[0] & 0x80)>0 ? true : false); m_MovePContinue->SetValue((addr[0] & 0x80) > 0 ? true : false);
m_MoveNContinue= ((addr[1] & 0x1)>0 ? true : false); m_MoveNContinue->SetValue((addr[1] & 0x1) > 0 ? true : false);
m_MoveAbsPos= ((addr[1] & 0x2)>0 ? true : false); m_MoveAbsPos->SetValue((addr[1] & 0x2) > 0 ? true : false);
m_MotionStop= ((addr[1] & 0x4)>0 ? true : false); m_MotionStop->SetValue((addr[1] & 0x4) > 0 ? true : false);
m_ServoRDY= ((addr[1] & 0x8)>0 ? true : false); m_ServoRDY->SetValue((addr[1] & 0x8) > 0 ? true : false);
m_ServoHomeDone= ((addr[1] & 0x10)>0 ? true : false); m_ServoHomeDone->SetValue((addr[1] & 0x10) > 0 ? true : false);
m_ResetDone= ((addr[1] & 0x20)>0 ? true : false); m_ResetDone->SetValue((addr[1] & 0x20) > 0 ? true : false);
m_ServoBusy= ((addr[1] & 0x40)>0 ? true : false); m_ServoBusy->SetValue((addr[1] & 0x40) > 0 ? true : false);
m_ServoException= ((addr[1] & 0x80)>0 ? true : false); m_ServoException->SetValue((addr[1] & 0x80) > 0 ? true : false);
m_Runable= ((addr[2] & 0x1)>0 ? true : false); m_Runable->SetValue((addr[2] & 0x1) > 0 ? true : false);
m_ExceptionCode = S7WORDDATA(addr[5], addr[4]).wValue; m_ExceptionCode->SetValue(S7WORDDATA(addr[5], addr[4]).wValue);
} }

View File

@ -1,31 +1,33 @@
#pragma once #pragma once
#include <shared_mutex> #include <shared_mutex>
#include "../config/bean/AxisCfg.h" #include "../config/bean/AxisCfg.h"
// 用于读取时返回的结构体 #include "../Controller/Base.h"
// 用于读取时返回的结构体
typedef struct { typedef struct {
bool ServoOn; //轴伺服ON_RW bool ServoOn; //轴伺服ON_RW
bool ServoHomeIndexOn; //轴伺服成立原点_RW bool ServoHomeIndexOn; //轴伺服成立原点_RW
bool ServoReset; //轴伺服复位_RW bool ServoReset; //轴伺服复位_RW
bool MoveP; //轴相对左运动_手动_RW bool MoveP; //轴相对左运动_手动_RW
bool MoveN; //轴相对右运动_手动_RW bool MoveN; //轴相对右运动_手动_RW
bool MovePContinue; //轴左JOG_手动_RW bool MovePContinue; //轴左JOG_手动_RW
bool MoveNContinue; //轴右JOG_手动_RW bool MoveNContinue; //轴右JOG_手动_RW
bool MoveAbsPos; //轴绝对值运动_手动_RW bool MoveAbsPos; //轴绝对值运动_手动_RW
bool MotionStop; //轴急停_RW bool MotionStop; //轴急停_RW
bool ServoRDY; //轴伺服RDY状态_R bool ServoRDY; //轴伺服RDY状态_R
bool ServoHomeDone; //轴指令运行HOME_Done_R bool ServoHomeDone; //轴指令运行HOME_Done_R
bool ResetDone; //轴指令运行RESET_Done_R bool ResetDone; //轴指令运行RESET_Done_R
bool ServoBusy; //轴伺服BUSY_R bool ServoBusy; //轴伺服BUSY_R
bool ServoException; //轴伺服异常_R bool ServoException; //轴伺服异常_R
bool Runable; //轴可运行状态_R bool Runable; //轴可运行状态_R
short ExceptionCode; //轴伺服异常字_R short ExceptionCode; //轴伺服异常字_R
bool ServoBreakOn; //主轴伺服刹车_RW bool ServoBreakOn; //主轴伺服刹车_RW
bool BindSlaveOn; //主轴伺服绑定从轴_RW bool BindSlaveOn; //主轴伺服绑定从轴_RW
bool BindSlaveFinish; //主从轴已经绑定_R bool BindSlaveFinish; //主从轴已经绑定_R
bool SlaveServoBreakOn; //从轴伺服刹车_RW bool SlaveServoBreakOn; //从轴伺服刹车_RW
bool SlaveUnbind; //从轴伺服解除绑定_RW bool SlaveUnbind; //从轴伺服解除绑定_RW
float Pos; float Pos;
float Torque; float Torque;
@ -34,7 +36,9 @@ typedef struct {
float RPos; float RPos;
} AxisStateValue; } AxisStateValue;
class AxisState
#pragma pack(1)
class AxisState :public Base
{ {
public: public:
AxisState(); AxisState();
@ -46,54 +50,71 @@ public:
virtual void SetZeroPos(); virtual void SetZeroPos();
virtual float GetShowPos(); virtual float GetShowPos();
public: public:
bool m_ServoOn; //轴伺服ON_RW char m_startFlag; //开始标志
bool m_ServoHomeIndexOn; //轴伺服成立原点_RW BoolData* m_ServoOn; //轴伺服ON_RW
bool m_ServoReset; //轴伺服复位_RW BoolData* m_ServoHomeIndexOn; //轴伺服成立原点_RW
bool m_MoveP; //轴相对左运动_手动_RW BoolData* m_ServoReset; //轴伺服复位_RW
bool m_MoveN; //轴相对右运动_手动_RW BoolData* m_MoveP; //轴相对左运动_手动_RW
bool m_MovePContinue; //轴左JOG_手动_RW BoolData* m_MoveN; //轴相对右运动_手动_RW
bool m_MoveNContinue; //轴右JOG_手动_RW BoolData* m_MovePContinue; //轴左JOG_手动_RW
bool m_MoveAbsPos; //轴绝对值运动_手动_RW BoolData* m_MoveNContinue; //轴右JOG_手动_RW
bool m_MotionStop; //轴急停_RW BoolData* m_MoveAbsPos; //轴绝对值运动_手动_RW
bool m_ServoRDY; //轴伺服RDY状态_R BoolData* m_MotionStop; //轴急停_RW
bool m_ServoHomeDone; //轴指令运行HOME_Done_R BoolData* m_ServoRDY; //轴伺服RDY状态_R
bool m_ResetDone; //轴指令运行RESET_Done_R BoolData* m_ServoHomeDone; //轴指令运行HOME_Done_R
bool m_ServoBusy; //轴伺服BUSY_R BoolData* m_ResetDone; //轴指令运行RESET_Done_R
bool m_ServoException; //轴伺服异常_R BoolData* m_ServoBusy; //轴伺服BUSY_R
bool m_Runable; //轴可运行状态_R BoolData* m_ServoException; //轴伺服异常_R
short m_ExceptionCode; //轴伺服异常字_R BoolData* m_Runable; //轴可运行状态_R
float m_Pos; //当前位置 ShortData* m_ExceptionCode; //轴伺服异常字_R
float m_Torque; //当前扭矩 FloatData* m_Pos; //当前位置
float m_ShowPos; FloatData* m_Torque; //当前扭矩
float m_RPos; FloatData* m_ShowPos;
FloatData* m_RPos;
char m_endFlag; //结束标志
std::shared_mutex mtx; std::shared_mutex mtx;
AxisCfg* m_AxisCfg; AxisCfg* m_AxisCfg;
}; };
#pragma pack()
class MainAxisState : public AxisState class MainAxisState : public AxisState
{ {
public: public:
MainAxisState(){} MainAxisState()
: m_ServoBreakOn(new BoolData("ServoBreakOn", u8"主轴伺服刹车_RW"))
, m_BindSlaveOn(new BoolData("BindSlaveOn", u8"主轴伺服绑定从轴_RW"))
, m_BindSlaveFinish(new BoolData("BindSlaveFinish", u8"主从轴已经绑定_R")) {
InsertMp(&m_ServoBreakOn, 1);
InsertMp(&m_BindSlaveOn, 1);
InsertMp(&m_BindSlaveFinish, 1);
}
~MainAxisState(){} ~MainAxisState(){}
void GetValue(AxisStateValue& value); void GetValue(AxisStateValue& value);
void Update(unsigned char* addr); void Update(unsigned char* addr);
public: public:
bool m_ServoBreakOn; //主轴伺服刹车_RW BoolData* m_ServoBreakOn; //主轴伺服刹车_RW
bool m_BindSlaveOn; //主轴伺服绑定从轴_RW BoolData* m_BindSlaveOn; //主轴伺服绑定从轴_RW
bool m_BindSlaveFinish; //主从轴已经绑定_R BoolData* m_BindSlaveFinish; //主从轴已经绑定_R
}; };
class SlaveAxisState : public AxisState class SlaveAxisState : public AxisState
{ {
public: public:
SlaveAxisState(){} SlaveAxisState()
: m_ServoBreakOn(new BoolData("ServoBreakOn", u8"从轴伺服刹车_RW"))
, m_Unbind(new BoolData("Unbind", u8"从轴伺服解除绑定_RW")) {
InsertMp(&m_ServoBreakOn, 1);
InsertMp(&m_Unbind, 1);
}
~SlaveAxisState(){} ~SlaveAxisState(){}
void GetValue(AxisStateValue& value); void GetValue(AxisStateValue& value);
void Update(unsigned char* addr); void Update(unsigned char* addr);
public: public:
bool m_ServoBreakOn; //从轴伺服刹车_RW BoolData* m_ServoBreakOn; //从轴伺服刹车_RW
bool m_Unbind; //从轴伺服解除绑定_RW BoolData* m_Unbind; //从轴伺服解除绑定_RW
}; };
@ -105,172 +126,172 @@ public:
~AxisState(); ~AxisState();
public: public:
bool m_MoldMainServoOn; //打印主轴伺服ON_RW bool m_MoldMainServoOn; //打印主轴伺服ON_RW
bool m_MoldMainServoHomeIndexOn; //打印主轴伺服ON_RW bool m_MoldMainServoHomeIndexOn; //打印主轴伺服ON_RW
bool m_MoldMainServoReset; //打印主轴伺服复位_RW bool m_MoldMainServoReset; //打印主轴伺服复位_RW
bool m_MoldMainServoBreakOn; //打印主轴伺服刹车_RW bool m_MoldMainServoBreakOn; //打印主轴伺服刹车_RW
bool m_MoldMainBindSlaveOn; //打印主轴伺服绑定从轴_RW bool m_MoldMainBindSlaveOn; //打印主轴伺服绑定从轴_RW
bool m_MoldMainMoveUp; //打印主轴相对上运动_手动_RW bool m_MoldMainMoveUp; //打印主轴相对上运动_手动_RW
bool m_MoldMainMoveDown; //打印主轴相对下运动_手动_RW bool m_MoldMainMoveDown; //打印主轴相对下运动_手动_RW
bool m_MoldMainMoveUpContinue; //打印主轴上JOG_手动_RW bool m_MoldMainMoveUpContinue; //打印主轴上JOG_手动_RW
bool m_MoldMainMoveDownContinue; //打印主轴下JOG_手动_RW bool m_MoldMainMoveDownContinue; //打印主轴下JOG_手动_RW
bool m_MoldMainMoveAbsPos; //打印主轴绝对值运动_手动_RW bool m_MoldMainMoveAbsPos; //打印主轴绝对值运动_手动_RW
bool m_MoldMainMotionStop; //打印主轴急停_RW bool m_MoldMainMotionStop; //打印主轴急停_RW
bool m_MoldMainServoRDY; //打印主轴伺服RDY状态_R bool m_MoldMainServoRDY; //打印主轴伺服RDY状态_R
bool m_MoldMainServoHomeDone; //打印主轴指令运行HOME_Done_R bool m_MoldMainServoHomeDone; //打印主轴指令运行HOME_Done_R
bool m_MoldMainResetDone; //打印主轴指令运行RESET_Done_R bool m_MoldMainResetDone; //打印主轴指令运行RESET_Done_R
bool m_MoldMainServoBusy; //打印主轴伺服BUSY_R bool m_MoldMainServoBusy; //打印主轴伺服BUSY_R
bool m_MoldMainServoException; //打印主轴伺服异常_R bool m_MoldMainServoException; //打印主轴伺服异常_R
bool m_MoldMainBindSlaveFinish; //打印主从轴已经绑定_R bool m_MoldMainBindSlaveFinish; //打印主从轴已经绑定_R
bool m_MoldMainRunable; //打印主轴可运行状态_R bool m_MoldMainRunable; //打印主轴可运行状态_R
short m_MoldMainServoExceptionCode; //打印主轴伺服异常字_R short m_MoldMainServoExceptionCode; //打印主轴伺服异常字_R
bool m_MoldSlaveServoOn; //打印从轴伺服ON_RW bool m_MoldSlaveServoOn; //打印从轴伺服ON_RW
bool m_MoldSlaveServoHomeIndexOn; //打印从轴伺服成立原点_RW bool m_MoldSlaveServoHomeIndexOn; //打印从轴伺服成立原点_RW
bool m_MoldSlaveServoReset; //打印从轴伺服复位_RW bool m_MoldSlaveServoReset; //打印从轴伺服复位_RW
bool m_MoldSlaveServoBreakOn; //打印从轴伺服刹车_RW bool m_MoldSlaveServoBreakOn; //打印从轴伺服刹车_RW
bool m_MoldSlaveUnbind; //打印从轴伺服解除绑定_RW bool m_MoldSlaveUnbind; //打印从轴伺服解除绑定_RW
bool m_MoldSlaveMoveUp; //打印从轴相对上运动_手动_RW bool m_MoldSlaveMoveUp; //打印从轴相对上运动_手动_RW
bool m_MoldSlaveMoveDown; //打印从轴相对下运动_手动_RW bool m_MoldSlaveMoveDown; //打印从轴相对下运动_手动_RW
bool m_MoldSlaveMoveUpContinue; //打印从轴上JOG_手动_RW bool m_MoldSlaveMoveUpContinue; //打印从轴上JOG_手动_RW
bool m_MoldSlaveMoveDownContinue; //打印从轴下JOG_手动_RW bool m_MoldSlaveMoveDownContinue; //打印从轴下JOG_手动_RW
bool m_MoldSlaveMoveAbsPos; //打印从轴绝对值运动_手动_RW bool m_MoldSlaveMoveAbsPos; //打印从轴绝对值运动_手动_RW
bool m_MoldSlaveMotionStop; //打印从轴急停_RW bool m_MoldSlaveMotionStop; //打印从轴急停_RW
bool m_MoldSlaveServoRDY; //打印从轴伺服RDY状态_R bool m_MoldSlaveServoRDY; //打印从轴伺服RDY状态_R
bool m_MoldSlaveServoHomeDone; //打印从轴指令运行HOME_Done_R bool m_MoldSlaveServoHomeDone; //打印从轴指令运行HOME_Done_R
bool m_MoldSlaveResetDone; //打印从轴指令运行RESET_Done_R bool m_MoldSlaveResetDone; //打印从轴指令运行RESET_Done_R
bool m_MoldSlaveServoBusy; //打印从轴伺服BUSY_R bool m_MoldSlaveServoBusy; //打印从轴伺服BUSY_R
bool m_MoldSlaveServoException; //打印从轴伺服异常_R bool m_MoldSlaveServoException; //打印从轴伺服异常_R
bool m_MoldSlaveRunable; //打印从轴可运行状态_R bool m_MoldSlaveRunable; //打印从轴可运行状态_R
short m_MoldSlaveServoExceptionCode; //打印从轴伺服异常字_R short m_MoldSlaveServoExceptionCode; //打印从轴伺服异常字_R
bool m_CleanMainServoOn; //清粉主轴伺服ON_RW bool m_CleanMainServoOn; //清粉主轴伺服ON_RW
bool m_CleanMainServoHomeIndexOn; //清粉主轴伺服成立原点_RW bool m_CleanMainServoHomeIndexOn; //清粉主轴伺服成立原点_RW
bool m_CleanMainServoReset; //清粉主轴伺服复位_RW bool m_CleanMainServoReset; //清粉主轴伺服复位_RW
bool m_CleanMainServoBreakOn; //清粉主轴伺服刹车_RW bool m_CleanMainServoBreakOn; //清粉主轴伺服刹车_RW
bool m_CleanMainBindSlaveOn; //清粉主轴伺服绑定从轴_RW bool m_CleanMainBindSlaveOn; //清粉主轴伺服绑定从轴_RW
bool m_CleanMainMoveUp; //清粉主轴相对上运动_手动_RW bool m_CleanMainMoveUp; //清粉主轴相对上运动_手动_RW
bool m_CleanMainMoveDown; //清粉主轴相对下运动_手动_RW bool m_CleanMainMoveDown; //清粉主轴相对下运动_手动_RW
bool m_CleanMainMoveUpContinue; //清粉主轴上JOG_手动_RW bool m_CleanMainMoveUpContinue; //清粉主轴上JOG_手动_RW
bool m_CleanMainMoveDownContinue; //清粉主轴下JOG_手动_RW bool m_CleanMainMoveDownContinue; //清粉主轴下JOG_手动_RW
bool m_CleanMainMoveAbsPos; //清粉主轴绝对值运动_手动_RW bool m_CleanMainMoveAbsPos; //清粉主轴绝对值运动_手动_RW
bool m_CleanMainMotionStop; //清粉主轴急停_RW bool m_CleanMainMotionStop; //清粉主轴急停_RW
bool m_CleanMainServoRDY; //清粉主轴伺服RDY状态_R bool m_CleanMainServoRDY; //清粉主轴伺服RDY状态_R
bool m_CleanMainServoHomeDone; //清粉主轴指令运行HOME_Done_R bool m_CleanMainServoHomeDone; //清粉主轴指令运行HOME_Done_R
bool m_CleanMainResetDone; //清粉主轴指令运行RESET_Done_R bool m_CleanMainResetDone; //清粉主轴指令运行RESET_Done_R
bool m_CleanMainServoBusy; //清粉主轴伺服BUSY_R bool m_CleanMainServoBusy; //清粉主轴伺服BUSY_R
bool m_CleanMainServoException; //清粉主轴伺服异常_R bool m_CleanMainServoException; //清粉主轴伺服异常_R
bool m_CleanMainBindSlaveFinish; //清粉主从轴已经绑定_R bool m_CleanMainBindSlaveFinish; //清粉主从轴已经绑定_R
bool m_CleanMainRunable; //清粉主轴可运行状态_R bool m_CleanMainRunable; //清粉主轴可运行状态_R
short m_CleanMainServoExceptionCode; //清粉主轴伺服异常字_R short m_CleanMainServoExceptionCode; //清粉主轴伺服异常字_R
bool m_CleanSlaveServoOn; //清粉从轴伺服ON_RW bool m_CleanSlaveServoOn; //清粉从轴伺服ON_RW
bool m_CleanSlaveServoHomeIndexOn; //清粉从轴伺服成立原点_RW bool m_CleanSlaveServoHomeIndexOn; //清粉从轴伺服成立原点_RW
bool m_CleanSlaveServoReset; //清粉从轴伺服复位_RW bool m_CleanSlaveServoReset; //清粉从轴伺服复位_RW
bool m_CleanSlaveServoBreakOn; //清粉从轴伺服刹车_RW bool m_CleanSlaveServoBreakOn; //清粉从轴伺服刹车_RW
bool m_CleanSlaveUnbind; //清粉从轴伺服解除绑定_RW bool m_CleanSlaveUnbind; //清粉从轴伺服解除绑定_RW
bool m_CleanSlaveMoveUp; //清粉从轴相对上运动_手动_RW bool m_CleanSlaveMoveUp; //清粉从轴相对上运动_手动_RW
bool m_CleanSlaveMoveDown; //清粉从轴相对下运动_手动_RW bool m_CleanSlaveMoveDown; //清粉从轴相对下运动_手动_RW
bool m_CleanSlaveMoveUpContinue; //清粉从轴上JOG_手动_RW bool m_CleanSlaveMoveUpContinue; //清粉从轴上JOG_手动_RW
bool m_CleanSlaveMoveDownContinue; //清粉从轴下JOG_手动_RW bool m_CleanSlaveMoveDownContinue; //清粉从轴下JOG_手动_RW
bool m_CleanSlaveMoveAbsPos; //清粉从轴绝对值运动_手动_RW bool m_CleanSlaveMoveAbsPos; //清粉从轴绝对值运动_手动_RW
bool m_CleanSlaveMotionStop; //清粉从轴急停_RW bool m_CleanSlaveMotionStop; //清粉从轴急停_RW
bool m_CleanSlaveServoRDY; //清粉从轴伺服RDY状态_R bool m_CleanSlaveServoRDY; //清粉从轴伺服RDY状态_R
bool m_CleanSlaveServoHomeDone; //清粉从轴指令运行HOME_Done_R bool m_CleanSlaveServoHomeDone; //清粉从轴指令运行HOME_Done_R
bool m_CleanSlaveResetDone; //清粉从轴指令运行RESET_Done_R bool m_CleanSlaveResetDone; //清粉从轴指令运行RESET_Done_R
bool m_CleanSlaveServoBusy; //清粉从轴伺服BUSY_R bool m_CleanSlaveServoBusy; //清粉从轴伺服BUSY_R
bool m_CleanSlaveServoException; //清粉从轴伺服异常_R bool m_CleanSlaveServoException; //清粉从轴伺服异常_R
bool m_CleanSlaveRunable; //清粉从轴可运行状态_R bool m_CleanSlaveRunable; //清粉从轴可运行状态_R
short m_CleanSlaveServoExceptionCode; //清粉从轴伺服异常字_R short m_CleanSlaveServoExceptionCode; //清粉从轴伺服异常字_R
bool m_LoadAxisServoOn; //移载轴伺服ON_RW bool m_LoadAxisServoOn; //移载轴伺服ON_RW
bool m_LoadAxisServoHomeIndexOn; //移载轴伺服成立原点_RW bool m_LoadAxisServoHomeIndexOn; //移载轴伺服成立原点_RW
bool m_LoadAxisServoReset; //移载轴伺服复位_RW bool m_LoadAxisServoReset; //移载轴伺服复位_RW
bool m_LoadAxisMoveLeft; //移载轴相对左运动_手动_RW bool m_LoadAxisMoveLeft; //移载轴相对左运动_手动_RW
bool m_LoadAxisMoveRight; //移载轴相对右运动_手动_RW bool m_LoadAxisMoveRight; //移载轴相对右运动_手动_RW
bool m_LoadAxisMoveLeftContinue; //移载轴左JOG_手动_RW bool m_LoadAxisMoveLeftContinue; //移载轴左JOG_手动_RW
bool m_LoadAxisMoveRightContinue; //移载轴右JOG_手动_RW bool m_LoadAxisMoveRightContinue; //移载轴右JOG_手动_RW
bool m_LoadAxisMoveAbsPos; //移载轴绝对值运动_手动_RW bool m_LoadAxisMoveAbsPos; //移载轴绝对值运动_手动_RW
bool m_LoadAxisMotionStop; //移载轴急停_RW bool m_LoadAxisMotionStop; //移载轴急停_RW
bool m_LoadAxisServoRDY; //移载轴伺服RDY状态_R bool m_LoadAxisServoRDY; //移载轴伺服RDY状态_R
bool m_LoadAxisServoHomeDone; //移载轴指令运行HOME_Done_R bool m_LoadAxisServoHomeDone; //移载轴指令运行HOME_Done_R
bool m_LoadAxisResetDone; //移载轴指令运行RESET_Done_R bool m_LoadAxisResetDone; //移载轴指令运行RESET_Done_R
bool m_LoadAxisServoBusy; //移载轴伺服BUSY_R bool m_LoadAxisServoBusy; //移载轴伺服BUSY_R
bool m_LoadAxisServoException; //移载轴伺服异常_R bool m_LoadAxisServoException; //移载轴伺服异常_R
bool m_LoadAxisRunable; //移载轴可运行状态_R bool m_LoadAxisRunable; //移载轴可运行状态_R
short m_LoadAxisServoExceptionCode; //移载轴伺服异常字_R short m_LoadAxisServoExceptionCode; //移载轴伺服异常字_R
bool m_ArmServoOn; //铺粉轴伺服ON_RW bool m_ArmServoOn; //铺粉轴伺服ON_RW
bool m_ArmServoHomeIndexOn; //铺粉轴伺服成立原点_RW bool m_ArmServoHomeIndexOn; //铺粉轴伺服成立原点_RW
bool m_ArmServoReset; //铺粉轴伺服复位_RW bool m_ArmServoReset; //铺粉轴伺服复位_RW
bool m_ArmMoveFront; //铺粉轴相对前运动_手动_RW bool m_ArmMoveFront; //铺粉轴相对前运动_手动_RW
bool m_ArmMoveBack; //铺粉轴相对后运动_手动_RW bool m_ArmMoveBack; //铺粉轴相对后运动_手动_RW
bool m_ArmMoveFrontContinue; //铺粉轴前JOG_手动_RW bool m_ArmMoveFrontContinue; //铺粉轴前JOG_手动_RW
bool m_ArmMoveBackContinue; //铺粉轴后JOG_手动_RW bool m_ArmMoveBackContinue; //铺粉轴后JOG_手动_RW
bool m_ArmMoveAbsPos; //铺粉轴绝对值运动_手动_RW bool m_ArmMoveAbsPos; //铺粉轴绝对值运动_手动_RW
bool m_ArmMotionStop; //铺粉轴急停_RW bool m_ArmMotionStop; //铺粉轴急停_RW
bool m_ArmServoRDY; //铺粉轴伺服RDY状态_R bool m_ArmServoRDY; //铺粉轴伺服RDY状态_R
bool m_ArmServoHomeDone; //铺粉轴指令运行HOME_Done_R bool m_ArmServoHomeDone; //铺粉轴指令运行HOME_Done_R
bool m_ArmResetDone; //铺粉轴指令运行RESET_Done_R bool m_ArmResetDone; //铺粉轴指令运行RESET_Done_R
bool m_ArmServoBusy; //铺粉轴伺服BUSY_R bool m_ArmServoBusy; //铺粉轴伺服BUSY_R
bool m_ArmServoException; //铺粉轴伺服异常_R bool m_ArmServoException; //铺粉轴伺服异常_R
bool m_ArmRunable; //铺粉轴可运行状态_R bool m_ArmRunable; //铺粉轴可运行状态_R
short m_ArmServoExceptionCode; //铺粉轴伺服异常字_R short m_ArmServoExceptionCode; //铺粉轴伺服异常字_R
bool m_SupplyServoOn; //供粉转轴伺服ON_RW bool m_SupplyServoOn; //供粉转轴伺服ON_RW
bool m_SupplyServoHomeIndexOn; //供粉转轴伺服成立原点_RW bool m_SupplyServoHomeIndexOn; //供粉转轴伺服成立原点_RW
bool m_SupplyServoReset; //供粉转轴伺服复位_RW bool m_SupplyServoReset; //供粉转轴伺服复位_RW
bool m_SupplyMovePositive; //供粉转轴相对正转运动_手动_RW bool m_SupplyMovePositive; //供粉转轴相对正转运动_手动_RW
bool m_SupplyMoveNegative; //供粉转轴相对反转运动_手动_RW bool m_SupplyMoveNegative; //供粉转轴相对反转运动_手动_RW
bool m_SupplyMovePositiveContinue; //供粉转轴正转JOG_手动_RW bool m_SupplyMovePositiveContinue; //供粉转轴正转JOG_手动_RW
bool m_SupplyMoveNegativeContinue; //供粉转轴反转JOG_手动_RW bool m_SupplyMoveNegativeContinue; //供粉转轴反转JOG_手动_RW
bool m_SupplyMoveAbsPos; //供粉转轴绝对值运动_手动_RW bool m_SupplyMoveAbsPos; //供粉转轴绝对值运动_手动_RW
bool m_SupplyMotionStop; //供粉转轴急停_RW bool m_SupplyMotionStop; //供粉转轴急停_RW
bool m_SupplyServoRDY; //供粉转轴伺服RDY状态_R bool m_SupplyServoRDY; //供粉转轴伺服RDY状态_R
bool m_SupplyServoHomeDone; //供粉转轴指令运行HOME_Done_R bool m_SupplyServoHomeDone; //供粉转轴指令运行HOME_Done_R
bool m_SupplyResetDone; //供粉转轴指令运行RESET_Done_R bool m_SupplyResetDone; //供粉转轴指令运行RESET_Done_R
bool m_SupplyServoBusy; //供粉转轴伺服BUSY_R bool m_SupplyServoBusy; //供粉转轴伺服BUSY_R
bool m_SupplyServoException; //供粉转轴伺服异常_R bool m_SupplyServoException; //供粉转轴伺服异常_R
bool m_SupplyRunable; //供粉转轴可运行状态_R bool m_SupplyRunable; //供粉转轴可运行状态_R
short m_SupplyServoExceptionCode; //供粉转轴伺服异常字_R short m_SupplyServoExceptionCode; //供粉转轴伺服异常字_R
bool m_MoldCylinderSeparatePosRecord; //打印升降与缸体分离位记录_RW bool m_MoldCylinderSeparatePosRecord; //打印升降与缸体分离位记录_RW
bool m_Print3RSeparateRecord; //打印3R脱离位记录__RW bool m_Print3RSeparateRecord; //打印3R脱离位记录__RW
bool m_Print3RSeparateCheckDistanceRecord; //打印3R脱离检测距离记录__RW bool m_Print3RSeparateCheckDistanceRecord; //打印3R脱离检测距离记录__RW
bool m_PrintJackupDeoxygenMinPosRecord; //打印顶升轴除氧压缩最低点记录__RW bool m_PrintJackupDeoxygenMinPosRecord; //打印顶升轴除氧压缩最低点记录__RW
bool m_PrintJackupPlatformBottomPosRecord; //打印顶升轴基板底座缸平面位置记录__RW bool m_PrintJackupPlatformBottomPosRecord; //打印顶升轴基板底座缸平面位置记录__RW
bool m_PrintJackupPlatformPlanePosRecord; //打印顶升轴基板缸平面位置记录_RW bool m_PrintJackupPlatformPlanePosRecord; //打印顶升轴基板缸平面位置记录_RW
bool m_PrintPlatformHightRecord; //打印基板厚度计算__RW bool m_PrintPlatformHightRecord; //打印基板厚度计算__RW
bool m_MoldUpLimitPosRecord; //打印轴上软限位记录_RW bool m_MoldUpLimitPosRecord; //打印轴上软限位记录_RW
bool m_MoldDownLimitPosRecord; //打印升降轴下软限位记录_RW bool m_MoldDownLimitPosRecord; //打印升降轴下软限位记录_RW
bool m_CleanTrackConnectPosRecord; //清粉升降轨道对接位记录_RW bool m_CleanTrackConnectPosRecord; //清粉升降轨道对接位记录_RW
bool m_CleanBoxCylinderConnectPosRecord; //清粉箱与缸体对接位记录_RW bool m_CleanBoxCylinderConnectPosRecord; //清粉箱与缸体对接位记录_RW
bool m_Clean3RSeparatePosRecord; //清粉升降3R对接分离位记录_RW bool m_Clean3RSeparatePosRecord; //清粉升降3R对接分离位记录_RW
bool m_Clean3RSeparateCheckDistanceRecord; //清粉升降3R分离检测距离记录_RW bool m_Clean3RSeparateCheckDistanceRecord; //清粉升降3R分离检测距离记录_RW
bool m_CleanLowestPosRecord; //清粉升降最低点记录_RW bool m_CleanLowestPosRecord; //清粉升降最低点记录_RW
bool m_CleanUpLimitRecord; //清粉升降上软限位记录_RW bool m_CleanUpLimitRecord; //清粉升降上软限位记录_RW
bool m_CleanDownLimitRecord; //清粉升降下软限位记录_RW bool m_CleanDownLimitRecord; //清粉升降下软限位记录_RW
bool m_LoadAxisTrackPrintPosRecord; //移载轴轨道打印位记录_RW bool m_LoadAxisTrackPrintPosRecord; //移载轴轨道打印位记录_RW
bool m_LoadAxisTrackCleanPosRecord; //移载轴轨道清粉位记录_RW bool m_LoadAxisTrackCleanPosRecord; //移载轴轨道清粉位记录_RW
bool m_LoadAxisTrackWaitPosRecord; //移载轴轨道等待位记录_RW bool m_LoadAxisTrackWaitPosRecord; //移载轴轨道等待位记录_RW
bool m_LoadAxisLeftLimitRecord; //移载轴轨道左软限位记录_RW bool m_LoadAxisLeftLimitRecord; //移载轴轨道左软限位记录_RW
bool m_LoadAxisRightLimitRecord; //移载轴轨道右软限位记录_RW bool m_LoadAxisRightLimitRecord; //移载轴轨道右软限位记录_RW
bool m_ArmPowderAcceptPosRecord; //铺粉轴接粉位记录_RW bool m_ArmPowderAcceptPosRecord; //铺粉轴接粉位记录_RW
bool m_ArmPowderDropFrontPosRecord; //铺粉轴前下粉位记录_RW bool m_ArmPowderDropFrontPosRecord; //铺粉轴前下粉位记录_RW
bool m_ArmPrintFrontLimitRecord; //铺粉轴打印面前限位记录_RW bool m_ArmPrintFrontLimitRecord; //铺粉轴打印面前限位记录_RW
bool m_ArmPrintBackLimitRecord; //铺粉轴打印面后限位记录_RW bool m_ArmPrintBackLimitRecord; //铺粉轴打印面后限位记录_RW
bool m_ArmFrontLimitRecord; //铺粉轴前软限位记录_RW bool m_ArmFrontLimitRecord; //铺粉轴前软限位记录_RW
bool m_ArmBackLimitRecord; //铺粉轴后软限位记录_RW bool m_ArmBackLimitRecord; //铺粉轴后软限位记录_RW
bool m_BlockMoldSoftPosLimit; //屏蔽打印轴软件位置限制_RW bool m_BlockMoldSoftPosLimit; //屏蔽打印轴软件位置限制_RW
bool m_BlockCleanSoftPosLimit; //屏蔽清粉轴软件位置限制_RW bool m_BlockCleanSoftPosLimit; //屏蔽清粉轴软件位置限制_RW
bool m_BlockLoadAxisSoftPosLimit; //屏蔽移载轴软件位置限制_RW bool m_BlockLoadAxisSoftPosLimit; //屏蔽移载轴软件位置限制_RW
bool m_BlockArmSoftPosLimit; //屏蔽铺粉轴软件位置限制_RW bool m_BlockArmSoftPosLimit; //屏蔽铺粉轴软件位置限制_RW
bool m_SupplySoftPosLimit; //屏蔽供粉转轴软件位置限制_RW bool m_SupplySoftPosLimit; //屏蔽供粉转轴软件位置限制_RW
bool m_MoldMainHomeIndexRecord; //打印主轴原点位记录_RW bool m_MoldMainHomeIndexRecord; //打印主轴原点位记录_RW
bool m_MoldMainAlignRecord; //打印主轴对齐位记录_RW bool m_MoldMainAlignRecord; //打印主轴对齐位记录_RW
bool m_MoldMainAlignHomeIndexRelRecord; //打印主轴对齐位与原点相对值记录_RW bool m_MoldMainAlignHomeIndexRelRecord; //打印主轴对齐位与原点相对值记录_RW
bool m_MoldSlaveHomeIndexRecord; //打印从轴原点位记录_RW bool m_MoldSlaveHomeIndexRecord; //打印从轴原点位记录_RW
bool m_MoldSlaveAlignRecord; //打印从轴对齐位记录_RW bool m_MoldSlaveAlignRecord; //打印从轴对齐位记录_RW
bool m_MoldSlaveAlignHomeIndexRelRecord; //打印从轴对齐位与原点相对值记录_RW bool m_MoldSlaveAlignHomeIndexRelRecord; //打印从轴对齐位与原点相对值记录_RW
bool m_CleanMainHomeIndexRecord; //清粉主轴原点位记录_RW bool m_CleanMainHomeIndexRecord; //清粉主轴原点位记录_RW
bool m_CleanMainAlignRecord; //清粉主轴对齐位记录_RW bool m_CleanMainAlignRecord; //清粉主轴对齐位记录_RW
bool m_CleanMainAlignHomeIndexRelRecord; //清粉主轴对齐位与原点相对值记录_RW bool m_CleanMainAlignHomeIndexRelRecord; //清粉主轴对齐位与原点相对值记录_RW
bool m_CleanSlaveHomeIndexRecord; //清粉从轴原点位记录_RW bool m_CleanSlaveHomeIndexRecord; //清粉从轴原点位记录_RW
bool m_CleanSlaveAlignRecord; //清粉从轴对齐位记录_RW bool m_CleanSlaveAlignRecord; //清粉从轴对齐位记录_RW
bool m_CleanSlaveAlignHomeIndexRelRecord; //清粉从轴对齐位与原点相对值记录_RW bool m_CleanSlaveAlignHomeIndexRelRecord; //清粉从轴对齐位与原点相对值记录_RW
}; };
#endif #endif

View File

@ -1,20 +1,126 @@
#pragma once #pragma once
#include "../LanguageManager.h" #include "../LanguageManager.h"
#include "../Controller/Base.h"
class IntelliScanState { struct IntelliScanStateSCT {
bool m_GalvanometerScannerTempOK; //振镜预热完成
float m_ActualPosition; //真实位置
float m_SetPosition; //设值位置
float m_PositionError; //位置误差
float m_GalvanometerScannerTemp; //振镜温度
float m_ServoBoardTemp; //伺服板卡温度
float m_PDSupplyVoltage; //PD供电电压
float m_DSPCoreSupplyVoltage; //DSP核心供电电压
float m_DSPIOVoltage; //DSP输入输出电压
float m_AnalogSectionVoltage; //模拟区电压
float m_ADConverterSupplyVoltage; //AD转换供电电压
float m_PDSupplyCurrent; //PD供电电流
bool m_IsGalvanometerScannerOutputStageOn; //振镜输出级生效
bool m_IsGalvanometerScannerHeaterOutputStageOn; //振镜加热器输出级生效
bool m_IsInternalVoltagesNormal; //内部电压正常
bool m_IsPositionErrorNormalRange; //位置误差正常
bool m_IsScannerAndServoBoradTempNormal; //振镜和伺服温度正常
bool m_IsBootingProcessCompleted; //启动处理完成
bool m_IsCriticalError; //发生严重错误
bool m_IsExternalPowderLow; //外部电压欠压
bool m_IsScanSystemTempOverLimit; //扫描系统超温
bool m_IsADConverterSuccessfullyInit; //AD转换初始化成功
bool m_IsScannerReachedCriticalEdgePos; //振镜到达临界边缘位置
bool m_IsAllControlParametersValid; //允许控制参数
bool m_IsADConverterVoltageOK; //AD转换供电正常
bool m_IsAnalogSetionVoltageOK; //模拟区电压正常
bool m_IsDSPIOVoltageOK; //DSP 输入输出电压正常
bool m_IsDSPCoreVoltageOK; //DSP核心供电正常
bool m_IsAGCVoltageOK; //AGC电压正常
bool m_IsServoBoradOperationTempNormal; //伺服板卡操作温度正常
bool m_IsGalvanometerScannerOperationTempNormal; //振镜操作温度正常
int m_LowState;
int m_HighState;
int m_StopEven;
};
#pragma pack(1)
class IntelliScanState{
public: public:
IntelliScanState() { IntelliScanState()
m_GalvanometerScannerTemp = 0.0f; : m_GalvanometerScannerTempOK(new BoolData("GalvanometerScannerTempOK", u8"振镜预热完成"))
m_ServoBoardTemp = 0.0f; , m_ActualPosition(new FloatData("m_ActualPosition", u8"真实位置"))
m_PDSupplyVoltage = 0.0f; , m_SetPosition(new FloatData("SetPosition", u8"设值位置"))
m_DSPCoreSupplyVoltage = 0.0f; , m_PositionError(new FloatData("PositionError", u8"位置误差"))
m_DSPIOVoltage = 0.0f; , m_GalvanometerScannerTemp(new FloatData("GalvanometerScannerTemp", u8"振镜温度"))
m_AnalogSectionVoltage = 0.0f; , m_ServoBoardTemp(new FloatData("ServoBoardTemp", u8"伺服板卡温度"))
m_ADConverterSupplyVoltage = 0.0f; , m_PDSupplyVoltage(new FloatData("PDSupplyVoltage", u8"PD供电电压"))
m_PDSupplyCurrent = 0.0f; , m_DSPCoreSupplyVoltage(new FloatData("DSPCoreSupplyVoltage", u8"DSP核心供电电压"))
, m_DSPIOVoltage(new FloatData("DSPIOVoltage", u8"DSP输入输出电压"))
, m_AnalogSectionVoltage(new FloatData("AnalogSectionVoltage", u8"模拟区电压"))
, m_ADConverterSupplyVoltage(new FloatData("ADConverterSupplyVoltage", u8"AD转换供电电压"))
, m_PDSupplyCurrent(new FloatData("PDSupplyCurrent", u8"PD供电电流"))
, m_IsGalvanometerScannerOutputStageOn(new BoolData("IsGalvanometerScannerOutputStageOn", u8"振镜输出级生效"))
, m_IsGalvanometerScannerHeaterOutputStageOn(new BoolData("IsGalvanometerScannerHeaterOutputStageOn", u8"振镜加热器输出级生效"))
, m_IsInternalVoltagesNormal(new BoolData("IsInternalVoltagesNormal", u8"内部电压正常"))
, m_IsPositionErrorNormalRange(new BoolData("IsPositionErrorNormalRange", u8"位置误差正常"))
, m_IsScannerAndServoBoradTempNormal(new BoolData("IsScannerAndServoBoradTempNormal", u8"振镜和伺服温度正常"))
, m_IsBootingProcessCompleted(new BoolData("IsBootingProcessCompleted", u8"启动处理完成"))
, m_IsCriticalError(new BoolData("IsCriticalError", u8"发生严重错误"))
, m_IsExternalPowderLow(new BoolData("IsExternalPowderLow", u8"外部电压欠压"))
, m_IsScanSystemTempOverLimit(new BoolData("IsScanSystemTempOverLimit", u8"扫描系统超温"))
, m_IsADConverterSuccessfullyInit(new BoolData("IsADConverterSuccessfullyInit", u8"AD转换初始化成功"))
, m_IsScannerReachedCriticalEdgePos(new BoolData("IsScannerReachedCriticalEdgePos", u8"振镜到达临界边缘位置"))
, m_IsAllControlParametersValid(new BoolData("IsAllControlParametersValid", u8"允许控制参数"))
, m_IsADConverterVoltageOK(new BoolData("IsADConverterVoltageOK", u8"AD转换供电正常"))
, m_IsAnalogSetionVoltageOK(new BoolData("IsAnalogSetionVoltageOK", u8"模拟区电压正常"))
, m_IsDSPIOVoltageOK(new BoolData("IsDSPIOVoltageOK", u8"DSP 输入输出电压正常"))
, m_IsDSPCoreVoltageOK(new BoolData("IsDSPCoreVoltageOK", u8"DSP核心供电正常"))
, m_IsAGCVoltageOK(new BoolData("IsAGCVoltageOK", u8"AGC电压正常"))
, m_IsServoBoradOperationTempNormal(new BoolData("IsServoBoradOperationTempNormal", u8"伺服板卡操作温度正常"))
, m_IsGalvanometerScannerOperationTempNormal(new BoolData("IsGalvanometerScannerOperationTempNormal", u8"振镜操作温度正常"))
, m_LowState(new IntData("LowState"))
, m_HighState(new IntData("HighState"))
, m_StopEven(new IntData("StopEven")){
} }
~IntelliScanState() {} ~IntelliScanState() {}
void GetState(IntelliScanStateSCT& intelS) {
intelS.m_GalvanometerScannerTempOK = m_GalvanometerScannerTempOK->GetValue();
intelS.m_ActualPosition = m_ActualPosition->GetValue();
intelS.m_SetPosition = m_SetPosition->GetValue();
intelS.m_PositionError = m_PositionError->GetValue();
intelS.m_GalvanometerScannerTemp = m_GalvanometerScannerTemp->GetValue();
intelS.m_ServoBoardTemp = m_ServoBoardTemp->GetValue();
intelS.m_PDSupplyVoltage = m_PDSupplyVoltage->GetValue();
intelS.m_DSPCoreSupplyVoltage = m_DSPCoreSupplyVoltage->GetValue();
intelS.m_DSPIOVoltage = m_DSPIOVoltage->GetValue();
intelS.m_AnalogSectionVoltage = m_AnalogSectionVoltage->GetValue();
intelS.m_ADConverterSupplyVoltage = m_ADConverterSupplyVoltage->GetValue();
intelS.m_PDSupplyCurrent = m_PDSupplyCurrent->GetValue();
intelS.m_IsGalvanometerScannerOutputStageOn = m_IsGalvanometerScannerOutputStageOn->GetValue();
intelS.m_IsGalvanometerScannerHeaterOutputStageOn = m_IsGalvanometerScannerHeaterOutputStageOn->GetValue();
intelS.m_IsInternalVoltagesNormal = m_IsInternalVoltagesNormal->GetValue();
intelS.m_IsPositionErrorNormalRange = m_IsPositionErrorNormalRange->GetValue();
intelS.m_IsScannerAndServoBoradTempNormal = m_IsScannerAndServoBoradTempNormal->GetValue();
intelS.m_IsBootingProcessCompleted = m_IsBootingProcessCompleted->GetValue();
intelS.m_IsCriticalError = m_IsCriticalError->GetValue();
intelS.m_IsExternalPowderLow = m_IsExternalPowderLow->GetValue();
intelS.m_IsScanSystemTempOverLimit = m_IsScanSystemTempOverLimit->GetValue();
intelS.m_IsADConverterSuccessfullyInit = m_IsADConverterSuccessfullyInit->GetValue();
intelS.m_IsScannerReachedCriticalEdgePos = m_IsScannerReachedCriticalEdgePos->GetValue();
intelS.m_IsAllControlParametersValid = m_IsAllControlParametersValid->GetValue();
intelS.m_IsADConverterVoltageOK = m_IsADConverterVoltageOK->GetValue();
intelS.m_IsAnalogSetionVoltageOK = m_IsAnalogSetionVoltageOK->GetValue();
intelS.m_IsDSPIOVoltageOK = m_IsDSPIOVoltageOK->GetValue();
intelS.m_IsDSPCoreVoltageOK = m_IsDSPCoreVoltageOK->GetValue();
intelS.m_IsAGCVoltageOK = m_IsAGCVoltageOK->GetValue();
intelS.m_IsServoBoradOperationTempNormal = m_IsServoBoradOperationTempNormal->GetValue();
intelS.m_IsGalvanometerScannerOperationTempNormal = m_IsGalvanometerScannerOperationTempNormal->GetValue();
intelS.m_LowState = m_LowState->GetValue();
intelS.m_HighState = m_HighState->GetValue();
intelS.m_StopEven = m_StopEven->GetValue();
}
static string GetStopEventInfo(int ivalue, bool& bvalue) static string GetStopEventInfo(int ivalue, bool& bvalue)
{ {
string info = _(u8"没有").c_str(); string info = _(u8"没有").c_str();
@ -52,53 +158,87 @@ public:
return info; return info;
} }
public: public:
//bool m_IsInternalVoltagesNormal; //内部电压正常 char m_startFlag; //开始标记
bool m_GalvanometerScannerTempOK; //振镜预热完成
float m_ActualPosition; //真实位置
float m_SetPosition; //设值位置
float m_PositionError; //位置误差
//float m_ActualCurrent; //真实电流
//float m_ActualVelocity; //真实速度
float m_GalvanometerScannerTemp; //振镜温度
float m_ServoBoardTemp; //伺服板卡温度
float m_PDSupplyVoltage; //PD供电电压
float m_DSPCoreSupplyVoltage; //DSP核心供电电压
float m_DSPIOVoltage; //DSP输入输出电压
float m_AnalogSectionVoltage; //模拟区电压
float m_ADConverterSupplyVoltage; //AD转换供电电压
float m_PDSupplyCurrent; //PD供电电流
bool m_IsGalvanometerScannerOutputStageOn; //振镜输出级生效
bool m_IsGalvanometerScannerHeaterOutputStageOn; //振镜加热器输出级生效
bool m_IsInternalVoltagesNormal; //内部电压正常
bool m_IsPositionErrorNormalRange; //位置误差正常
bool m_IsScannerAndServoBoradTempNormal; //振镜和伺服温度正常
bool m_IsBootingProcessCompleted; //启动处理完成
bool m_IsCriticalError; //发生严重错误
bool m_IsExternalPowderLow; //外部电压欠压
bool m_IsScanSystemTempOverLimit; //扫描系统超温
bool m_IsADConverterSuccessfullyInit; //AD转换初始化成功
bool m_IsScannerReachedCriticalEdgePos; //振镜到达临界边缘位置
bool m_IsAllControlParametersValid; //允许控制参数
bool m_IsADConverterVoltageOK; //AD转换供电正常
bool m_IsAnalogSetionVoltageOK; //模拟区电压正常
bool m_IsDSPIOVoltageOK; //DSP 输入输出电压正常
bool m_IsDSPCoreVoltageOK; //DSP核心供电正常
bool m_IsAGCVoltageOK; //AGC电压正常
bool m_IsServoBoradOperationTempNormal; //伺服板卡操作温度正常
bool m_IsGalvanometerScannerOperationTempNormal; //振镜操作温度正常
int m_LowState;
int m_HighState;
int m_StopEven;
};
class ScanStateXY { //bool m_IsInternalVoltagesNormal; //内部电压正常
BoolData* m_GalvanometerScannerTempOK; //振镜预热完成
FloatData* m_ActualPosition; //真实位置
FloatData* m_SetPosition; //设值位置
FloatData* m_PositionError; //位置误差
//FloatData* m_ActualCurrent; //真实电流
//FloatData* m_ActualVelocity; //真实速度
FloatData* m_GalvanometerScannerTemp; //振镜温度
FloatData* m_ServoBoardTemp; //伺服板卡温度
FloatData* m_PDSupplyVoltage; //PD供电电压
FloatData* m_DSPCoreSupplyVoltage; //DSP核心供电电压
FloatData* m_DSPIOVoltage; //DSP输入输出电压
FloatData* m_AnalogSectionVoltage; //模拟区电压
FloatData* m_ADConverterSupplyVoltage; //AD转换供电电压
FloatData* m_PDSupplyCurrent; //PD供电电流
BoolData* m_IsGalvanometerScannerOutputStageOn; //振镜输出级生效
BoolData* m_IsGalvanometerScannerHeaterOutputStageOn; //振镜加热器输出级生效
BoolData* m_IsInternalVoltagesNormal; //内部电压正常
BoolData* m_IsPositionErrorNormalRange; //位置误差正常
BoolData* m_IsScannerAndServoBoradTempNormal; //振镜和伺服温度正常
BoolData* m_IsBootingProcessCompleted; //启动处理完成
BoolData* m_IsCriticalError; //发生严重错误
BoolData* m_IsExternalPowderLow; //外部电压欠压
BoolData* m_IsScanSystemTempOverLimit; //扫描系统超温
BoolData* m_IsADConverterSuccessfullyInit; //AD转换初始化成功
BoolData* m_IsScannerReachedCriticalEdgePos; //振镜到达临界边缘位置
BoolData* m_IsAllControlParametersValid; //允许控制参数
BoolData* m_IsADConverterVoltageOK; //AD转换供电正常
BoolData* m_IsAnalogSetionVoltageOK; //模拟区电压正常
BoolData* m_IsDSPIOVoltageOK; //DSP 输入输出电压正常
BoolData* m_IsDSPCoreVoltageOK; //DSP核心供电正常
BoolData* m_IsAGCVoltageOK; //AGC电压正常
BoolData* m_IsServoBoradOperationTempNormal; //伺服板卡操作温度正常
BoolData* m_IsGalvanometerScannerOperationTempNormal; //振镜操作温度正常
IntData* m_LowState;
IntData* m_HighState;
IntData* m_StopEven;
char m_endFlag; //开始标记
};
#pragma pack()
class ScanStateXY :public Base {
public: public:
ScanStateXY() {} ScanStateXY() :m_IsConnected(false), m_LastError(0)
, m_ScanStateUpdateTime(new StrData("ScanStateUpdateTime","更新时间")) {
size_t ptrSize = sizeof(nullptr); //指针大小
void* startPtr = &m_X.m_startFlag + 1;
size_t count = ((size_t)&m_X.m_endFlag - (size_t)startPtr) / ptrSize;
InsertMp(startPtr, count, "_X");
startPtr = &m_Y.m_startFlag + 1;
count = ((size_t)&m_Y.m_endFlag - (size_t)startPtr) / ptrSize;
InsertMp(startPtr, count, "_Y");
startPtr = &m_Focus.m_startFlag + 1;
count = ((size_t)&m_Focus.m_endFlag - (size_t)startPtr) / ptrSize;
InsertMp(startPtr, count, "_Focus");
InsertMp(&m_ScanStateUpdateTime, 1);
}
~ScanStateXY() {} ~ScanStateXY() {}
public: public:
bool m_IsConnected; bool m_IsConnected;
UINT m_LastError; UINT m_LastError;
IntelliScanState m_X; IntelliScanState m_X;
IntelliScanState m_Y; IntelliScanState m_Y;
IntelliScanState m_Focus; IntelliScanState m_Focus;
StrData* m_ScanStateUpdateTime; //time_t用string表示
};
struct ScanStateXYSCT {
public:
IntelliScanStateSCT m_X;
IntelliScanStateSCT m_Y;
IntelliScanStateSCT m_Focus;
}; };

View File

@ -7,7 +7,8 @@
#include "../LanguageManager.h" #include "../LanguageManager.h"
#include "../PLC/SignalService.h" #include "../PLC/SignalService.h"
RTC5Scanner::RTC5Scanner(ScannerControlCfg* cfg) :Scanner(cfg) RTC5Scanner::RTC5Scanner(ScannerControlCfg* cfg,int scanIndex)
:Scanner(cfg), m_scanIndex(scanIndex)
{ {
//n_get_serial_number(); //n_get_serial_number();
@ -796,74 +797,75 @@ void RTC5Scanner::UpdateScannerInfo()
int ystopeven = n_get_value(m_ScannerControlCfg->m_ControlNo, 2); int ystopeven = n_get_value(m_ScannerControlCfg->m_ControlNo, 2);
EnterCriticalSection(&m_ScannerInfoCS); EnterCriticalSection(&m_ScannerInfoCS);
m_ScanState.m_X.m_ActualPosition = xap; m_ScanState.m_X.m_ActualPosition->SetValue(xap);
m_ScanState.m_Y.m_ActualPosition = yap; m_ScanState.m_Y.m_ActualPosition->SetValue(yap);
m_ScanState.m_X.m_SetPosition = xsp;// / m_xfactor - m_CorrectParamCfg->m_xposfix / m_xfactor; m_ScanState.m_X.m_SetPosition->SetValue(xsp);// / m_xfactor - m_CorrectParamCfg->m_xposfix / m_xfactor;
m_ScanState.m_Y.m_SetPosition = ysp;// / m_yfactor - m_CorrectParamCfg->m_xposfix / m_yfactor; m_ScanState.m_Y.m_SetPosition->SetValue(ysp);// / m_yfactor - m_CorrectParamCfg->m_xposfix / m_yfactor;
m_ScanState.m_X.m_PositionError = xpe;// / m_xfactor; m_ScanState.m_X.m_PositionError->SetValue(xpe);// / m_xfactor;
m_ScanState.m_Y.m_PositionError = ype;// / m_yfactor; m_ScanState.m_Y.m_PositionError->SetValue(ype);// / m_yfactor;
bitset<32> xstaBit(xsta); bitset<32> xstaBit(xsta);
bitset<32> ystaBit(ysta); bitset<32> ystaBit(ysta);
m_ScanState.m_X.m_GalvanometerScannerTempOK = xstaBit[18]; m_ScanState.m_X.m_GalvanometerScannerTempOK->SetValue(xstaBit[18]);
m_ScanState.m_Y.m_GalvanometerScannerTempOK = ystaBit[18]; m_ScanState.m_Y.m_GalvanometerScannerTempOK->SetValue(ystaBit[18]);
m_ScanState.m_X.m_GalvanometerScannerTemp = xgst; m_ScanState.m_X.m_GalvanometerScannerTemp->SetValue(xgst);
m_ScanState.m_Y.m_GalvanometerScannerTemp = ygst; m_ScanState.m_Y.m_GalvanometerScannerTemp->SetValue(ygst);
m_ScanState.m_X.m_ServoBoardTemp = xsbt; m_ScanState.m_X.m_ServoBoardTemp->SetValue(xsbt);
m_ScanState.m_Y.m_ServoBoardTemp = ysbt; m_ScanState.m_Y.m_ServoBoardTemp->SetValue(ysbt);
bitset<32> xlowstateBit(xlowstate); bitset<32> xlowstateBit(xlowstate);
m_ScanState.m_X.m_IsAllControlParametersValid = xlowstateBit[8]; m_ScanState.m_X.m_IsAllControlParametersValid->SetValue(xlowstateBit[8]);
m_ScanState.m_X.m_IsScannerReachedCriticalEdgePos = !xlowstateBit[9]; m_ScanState.m_X.m_IsScannerReachedCriticalEdgePos->SetValue(!xlowstateBit[9]);
m_ScanState.m_X.m_IsADConverterSuccessfullyInit = xlowstateBit[10]; m_ScanState.m_X.m_IsADConverterSuccessfullyInit->SetValue(xlowstateBit[10]);
m_ScanState.m_X.m_IsScanSystemTempOverLimit = !xlowstateBit[11]; m_ScanState.m_X.m_IsScanSystemTempOverLimit->SetValue(!xlowstateBit[11]);
m_ScanState.m_X.m_IsExternalPowderLow = !xlowstateBit[12]; m_ScanState.m_X.m_IsExternalPowderLow->SetValue(!xlowstateBit[12]);
m_ScanState.m_X.m_IsCriticalError = !xlowstateBit[13]; m_ScanState.m_X.m_IsCriticalError->SetValue(!xlowstateBit[13]);
m_ScanState.m_X.m_IsBootingProcessCompleted = xlowstateBit[14]; m_ScanState.m_X.m_IsBootingProcessCompleted->SetValue(xlowstateBit[14]);
m_ScanState.m_X.m_IsScannerAndServoBoradTempNormal = xlowstateBit[15]; m_ScanState.m_X.m_IsScannerAndServoBoradTempNormal->SetValue(xlowstateBit[15]);
m_ScanState.m_X.m_IsPositionErrorNormalRange = xlowstateBit[16]; m_ScanState.m_X.m_IsPositionErrorNormalRange->SetValue(xlowstateBit[16]);
m_ScanState.m_X.m_IsInternalVoltagesNormal = xlowstateBit[17]; m_ScanState.m_X.m_IsInternalVoltagesNormal->SetValue(xlowstateBit[17]);
m_ScanState.m_X.m_IsGalvanometerScannerHeaterOutputStageOn = xlowstateBit[18]; m_ScanState.m_X.m_IsGalvanometerScannerHeaterOutputStageOn->SetValue(xlowstateBit[18]);
m_ScanState.m_X.m_IsGalvanometerScannerOutputStageOn = xlowstateBit[19]; m_ScanState.m_X.m_IsGalvanometerScannerOutputStageOn->SetValue(xlowstateBit[19]);
bitset<32> ylowstateBit(ylowstate); bitset<32> ylowstateBit(ylowstate);
m_ScanState.m_Y.m_IsAllControlParametersValid = ylowstateBit[8]; m_ScanState.m_Y.m_IsAllControlParametersValid->SetValue(ylowstateBit[8]);
m_ScanState.m_Y.m_IsScannerReachedCriticalEdgePos = !ylowstateBit[9]; m_ScanState.m_Y.m_IsScannerReachedCriticalEdgePos->SetValue(!ylowstateBit[9]);
m_ScanState.m_Y.m_IsADConverterSuccessfullyInit = ylowstateBit[10]; m_ScanState.m_Y.m_IsADConverterSuccessfullyInit->SetValue(ylowstateBit[10]);
m_ScanState.m_Y.m_IsScanSystemTempOverLimit = !ylowstateBit[11]; m_ScanState.m_Y.m_IsScanSystemTempOverLimit->SetValue(!ylowstateBit[11]);
m_ScanState.m_Y.m_IsExternalPowderLow = !ylowstateBit[12]; m_ScanState.m_Y.m_IsExternalPowderLow->SetValue(!ylowstateBit[12]);
m_ScanState.m_Y.m_IsCriticalError = !ylowstateBit[13]; m_ScanState.m_Y.m_IsCriticalError->SetValue(!ylowstateBit[13]);
m_ScanState.m_Y.m_IsBootingProcessCompleted = ylowstateBit[14]; m_ScanState.m_Y.m_IsBootingProcessCompleted->SetValue(ylowstateBit[14]);
m_ScanState.m_Y.m_IsScannerAndServoBoradTempNormal = ylowstateBit[15]; m_ScanState.m_Y.m_IsScannerAndServoBoradTempNormal->SetValue(ylowstateBit[15]);
m_ScanState.m_Y.m_IsPositionErrorNormalRange = ylowstateBit[16]; m_ScanState.m_Y.m_IsPositionErrorNormalRange->SetValue(ylowstateBit[16]);
m_ScanState.m_Y.m_IsInternalVoltagesNormal = ylowstateBit[17]; m_ScanState.m_Y.m_IsInternalVoltagesNormal->SetValue(ylowstateBit[17]);
m_ScanState.m_Y.m_IsGalvanometerScannerHeaterOutputStageOn = ylowstateBit[18]; m_ScanState.m_Y.m_IsGalvanometerScannerHeaterOutputStageOn->SetValue(ylowstateBit[18]);
m_ScanState.m_Y.m_IsGalvanometerScannerOutputStageOn = ylowstateBit[19]; m_ScanState.m_Y.m_IsGalvanometerScannerOutputStageOn->SetValue(ylowstateBit[19]);
bitset<32> xhighstateBit(xhighstate); bitset<32> xhighstateBit(xhighstate);
m_ScanState.m_X.m_IsGalvanometerScannerOperationTempNormal = xhighstateBit[13]; m_ScanState.m_X.m_IsGalvanometerScannerOperationTempNormal->SetValue(xhighstateBit[13]);
m_ScanState.m_X.m_IsServoBoradOperationTempNormal = xhighstateBit[14]; m_ScanState.m_X.m_IsServoBoradOperationTempNormal->SetValue(xhighstateBit[14]);
m_ScanState.m_X.m_IsAGCVoltageOK = xhighstateBit[15]; m_ScanState.m_X.m_IsAGCVoltageOK->SetValue(xhighstateBit[15]);
m_ScanState.m_X.m_IsDSPCoreVoltageOK = xhighstateBit[16]; m_ScanState.m_X.m_IsDSPCoreVoltageOK->SetValue(xhighstateBit[16]);
m_ScanState.m_X.m_IsDSPIOVoltageOK = xhighstateBit[17]; m_ScanState.m_X.m_IsDSPIOVoltageOK->SetValue(xhighstateBit[17]);
m_ScanState.m_X.m_IsAnalogSetionVoltageOK = xhighstateBit[18]; m_ScanState.m_X.m_IsAnalogSetionVoltageOK->SetValue(xhighstateBit[18]);
m_ScanState.m_X.m_IsADConverterVoltageOK = xhighstateBit[19]; m_ScanState.m_X.m_IsADConverterVoltageOK->SetValue(xhighstateBit[19]);
bitset<32> yhighstateBit(yhighstate); bitset<32> yhighstateBit(yhighstate);
m_ScanState.m_Y.m_IsGalvanometerScannerOperationTempNormal = yhighstateBit[13]; m_ScanState.m_Y.m_IsGalvanometerScannerOperationTempNormal->SetValue(yhighstateBit[13]);
m_ScanState.m_Y.m_IsServoBoradOperationTempNormal = yhighstateBit[14]; m_ScanState.m_Y.m_IsServoBoradOperationTempNormal->SetValue(yhighstateBit[14]);
m_ScanState.m_Y.m_IsAGCVoltageOK = yhighstateBit[15]; m_ScanState.m_Y.m_IsAGCVoltageOK->SetValue(yhighstateBit[15]);
m_ScanState.m_Y.m_IsDSPCoreVoltageOK = yhighstateBit[16]; m_ScanState.m_Y.m_IsDSPCoreVoltageOK->SetValue(yhighstateBit[16]);
m_ScanState.m_Y.m_IsDSPIOVoltageOK = yhighstateBit[17]; m_ScanState.m_Y.m_IsDSPIOVoltageOK->SetValue(yhighstateBit[17]);
m_ScanState.m_Y.m_IsAnalogSetionVoltageOK = yhighstateBit[18]; m_ScanState.m_Y.m_IsAnalogSetionVoltageOK->SetValue(yhighstateBit[18]);
m_ScanState.m_Y.m_IsADConverterVoltageOK = yhighstateBit[19]; m_ScanState.m_Y.m_IsADConverterVoltageOK->SetValue(yhighstateBit[19]);
time(&m_ScanStateUpdateTime); time(&m_ScanStateUpdateTime);
m_ScanState.m_ScanStateUpdateTime->SetValue(to_string(m_ScanStateUpdateTime));
m_ScanState.m_X.m_LowState = xlowstate; m_ScanState.m_X.m_LowState->SetValue(xlowstate);
m_ScanState.m_X.m_HighState = xhighstate; m_ScanState.m_X.m_HighState->SetValue(xhighstate);
m_ScanState.m_Y.m_LowState = ylowstate; m_ScanState.m_Y.m_LowState->SetValue(ylowstate);
m_ScanState.m_Y.m_HighState = yhighstate; m_ScanState.m_Y.m_HighState->SetValue(yhighstate);
m_ScanState.m_X.m_StopEven = xstopeven; m_ScanState.m_X.m_StopEven->SetValue(xstopeven);
m_ScanState.m_Y.m_StopEven = ystopeven; m_ScanState.m_Y.m_StopEven->SetValue(ystopeven);
LeaveCriticalSection(&m_ScannerInfoCS); LeaveCriticalSection(&m_ScannerInfoCS);
if (m_ScannerControlCfg->m_ScanCfgWrapper.m_CorrectParamCfg.m_IsDynamicFocus) { if (m_ScannerControlCfg->m_ScanCfgWrapper.m_CorrectParamCfg.m_IsDynamicFocus) {
@ -909,40 +911,40 @@ void RTC5Scanner::UpdateScannerInfo()
int zstopeven = n_get_value(m_ScannerControlCfg->m_ControlNo, 4); int zstopeven = n_get_value(m_ScannerControlCfg->m_ControlNo, 4);
EnterCriticalSection(&m_ScannerInfoCS); EnterCriticalSection(&m_ScannerInfoCS);
m_ScanState.m_Focus.m_ServoBoardTemp = ysbtz; m_ScanState.m_Focus.m_ServoBoardTemp->SetValue(ysbtz);
m_ScanState.m_Focus.m_PDSupplyVoltage = pdsv; m_ScanState.m_Focus.m_PDSupplyVoltage->SetValue(pdsv);
m_ScanState.m_Focus.m_DSPCoreSupplyVoltage = dspcsv; m_ScanState.m_Focus.m_DSPCoreSupplyVoltage->SetValue(dspcsv);
m_ScanState.m_Focus.m_DSPIOVoltage = dspiov; m_ScanState.m_Focus.m_DSPIOVoltage->SetValue(dspiov);
m_ScanState.m_Focus.m_AnalogSectionVoltage = asv; m_ScanState.m_Focus.m_AnalogSectionVoltage->SetValue(asv);
m_ScanState.m_Focus.m_ADConverterSupplyVoltage = adcsv; m_ScanState.m_Focus.m_ADConverterSupplyVoltage->SetValue(adcsv);
m_ScanState.m_Focus.m_PDSupplyCurrent = pdsc; m_ScanState.m_Focus.m_PDSupplyCurrent->SetValue(pdsc);
bitset<32> ylowstatezBit(ylowstatez); bitset<32> ylowstatezBit(ylowstatez);
m_ScanState.m_Focus.m_IsAllControlParametersValid = ylowstatezBit[8]; m_ScanState.m_Focus.m_IsAllControlParametersValid->SetValue(ylowstatezBit[8]);
m_ScanState.m_Focus.m_IsScannerReachedCriticalEdgePos = !ylowstatezBit[9]; m_ScanState.m_Focus.m_IsScannerReachedCriticalEdgePos->SetValue(!ylowstatezBit[9]);
m_ScanState.m_Focus.m_IsADConverterSuccessfullyInit = ylowstatezBit[10]; m_ScanState.m_Focus.m_IsADConverterSuccessfullyInit->SetValue(ylowstatezBit[10]);
m_ScanState.m_Focus.m_IsScanSystemTempOverLimit = !ylowstatezBit[11]; m_ScanState.m_Focus.m_IsScanSystemTempOverLimit->SetValue(!ylowstatezBit[11]);
m_ScanState.m_Focus.m_IsExternalPowderLow = !ylowstatezBit[12]; m_ScanState.m_Focus.m_IsExternalPowderLow->SetValue(!ylowstatezBit[12]);
m_ScanState.m_Focus.m_IsCriticalError = !ylowstatezBit[13]; m_ScanState.m_Focus.m_IsCriticalError->SetValue(!ylowstatezBit[13]);
m_ScanState.m_Focus.m_IsBootingProcessCompleted = ylowstatezBit[14]; m_ScanState.m_Focus.m_IsBootingProcessCompleted->SetValue(ylowstatezBit[14]);
m_ScanState.m_Focus.m_IsScannerAndServoBoradTempNormal = ylowstatezBit[15]; m_ScanState.m_Focus.m_IsScannerAndServoBoradTempNormal->SetValue(ylowstatezBit[15]);
m_ScanState.m_Focus.m_IsPositionErrorNormalRange = ylowstatezBit[16]; m_ScanState.m_Focus.m_IsPositionErrorNormalRange->SetValue(ylowstatezBit[16]);
m_ScanState.m_Focus.m_IsInternalVoltagesNormal = ylowstatezBit[17]; m_ScanState.m_Focus.m_IsInternalVoltagesNormal->SetValue(ylowstatezBit[17]);
m_ScanState.m_Focus.m_IsGalvanometerScannerHeaterOutputStageOn = ylowstatezBit[18]; m_ScanState.m_Focus.m_IsGalvanometerScannerHeaterOutputStageOn->SetValue(ylowstatezBit[18]);
m_ScanState.m_Focus.m_IsGalvanometerScannerOutputStageOn = ylowstatezBit[19]; m_ScanState.m_Focus.m_IsGalvanometerScannerOutputStageOn->SetValue(ylowstatezBit[19]);
bitset<32> yhighstatezBit(yhighstatez); bitset<32> yhighstatezBit(yhighstatez);
m_ScanState.m_Focus.m_IsGalvanometerScannerOperationTempNormal = yhighstatezBit[13]; m_ScanState.m_Focus.m_IsGalvanometerScannerOperationTempNormal->SetValue(yhighstatezBit[13]);
m_ScanState.m_Focus.m_IsServoBoradOperationTempNormal = yhighstatezBit[14]; m_ScanState.m_Focus.m_IsServoBoradOperationTempNormal->SetValue(yhighstatezBit[14]);
m_ScanState.m_Focus.m_IsAGCVoltageOK = yhighstatezBit[15]; m_ScanState.m_Focus.m_IsAGCVoltageOK->SetValue(yhighstatezBit[15]);
m_ScanState.m_Focus.m_IsDSPCoreVoltageOK = yhighstatezBit[16]; m_ScanState.m_Focus.m_IsDSPCoreVoltageOK->SetValue(yhighstatezBit[16]);
m_ScanState.m_Focus.m_IsDSPIOVoltageOK = yhighstatezBit[17]; m_ScanState.m_Focus.m_IsDSPIOVoltageOK->SetValue(yhighstatezBit[17]);
m_ScanState.m_Focus.m_IsAnalogSetionVoltageOK = yhighstatezBit[18]; m_ScanState.m_Focus.m_IsAnalogSetionVoltageOK->SetValue(yhighstatezBit[18]);
m_ScanState.m_Focus.m_IsADConverterVoltageOK = yhighstatezBit[19]; m_ScanState.m_Focus.m_IsADConverterVoltageOK->SetValue(yhighstatezBit[19]);
m_ScanState.m_Focus.m_LowState = ylowstatez; m_ScanState.m_Focus.m_LowState->SetValue(ylowstatez);
m_ScanState.m_Focus.m_HighState = yhighstatez; m_ScanState.m_Focus.m_HighState->SetValue(yhighstatez);
m_ScanState.m_Focus.m_StopEven = zstopeven; m_ScanState.m_Focus.m_StopEven->SetValue(zstopeven);
LeaveCriticalSection(&m_ScannerInfoCS); LeaveCriticalSection(&m_ScannerInfoCS);
} }
} }
@ -970,6 +972,7 @@ void RTC5Scanner::ScannerInfoRun()
} }
if (updateFlag % 10 == 0) { if (updateFlag % 10 == 0) {
UpdateScannerInfo(); UpdateScannerInfo();
m_ScanState.SendToClients(XYSCANSTATE, "_" + to_string(m_scanIndex));
} }
updateFlag++; updateFlag++;
if (updateFlag > 1000) { updateFlag = 0; } if (updateFlag > 1000) { updateFlag = 0; }

View File

@ -1,10 +1,10 @@
#pragma once #pragma once
#include "Scanner.h" #include "Scanner.h"
class RTC5Scanner : public Scanner class RTC5Scanner : public Scanner
{ {
public: public:
RTC5Scanner(ScannerControlCfg* cfg); RTC5Scanner(ScannerControlCfg* cfg,int scanIndex);
~RTC5Scanner(); ~RTC5Scanner();
bool Init(); bool Init();
bool StopWork(); bool StopWork();
@ -55,6 +55,7 @@ private:
void ScanTestProc(); void ScanTestProc();
private: private:
int m_scanIndex;
const uint32_t ScanStatusAddr = 0x0500; const uint32_t ScanStatusAddr = 0x0500;
const uint32_t ActualPositionAddr = 0x0501; const uint32_t ActualPositionAddr = 0x0501;

View File

@ -1,4 +1,4 @@
#include "Scanner.h" #include "Scanner.h"
#include "../global.h" #include "../global.h"
#include "../SystemInfo.h" #include "../SystemInfo.h"
#include "../Logger.h" #include "../Logger.h"
@ -26,6 +26,7 @@ Scanner::Scanner(ScannerControlCfg* cfg)
m_ExtCfg = ConfigManager::GetInstance()->GetExtCfg(); m_ExtCfg = ConfigManager::GetInstance()->GetExtCfg();
m_ScannerIO = ConfigManager::GetInstance()->GetIoCfgWrapper()->m_Laser; m_ScannerIO = ConfigManager::GetInstance()->GetIoCfgWrapper()->m_Laser;
time(&m_ScanStateUpdateTime); time(&m_ScanStateUpdateTime);
m_ScanState.m_ScanStateUpdateTime->SetValue(to_string(m_ScanStateUpdateTime));
InitializeCriticalSection(&m_ScannerInfoCS); InitializeCriticalSection(&m_ScannerInfoCS);
m_XOffsetAssist = 0.0f; m_XOffsetAssist = 0.0f;
@ -186,12 +187,12 @@ DWORD WINAPI Scanner::ScanProc(Scanner* _this)
void Scanner::WaitFinish() void Scanner::WaitFinish()
{ {
if (m_Thread == INVALID_HANDLE_VALUE)return; if (m_Thread == INVALID_HANDLE_VALUE)return;
if (m_RunCfg->m_LogDebugInfo)g_log->TraceInfo(u8"开始等待振镜%d完成扫描", m_ScannerControlCfg->m_SeqNo); if (m_RunCfg->m_LogDebugInfo)g_log->TraceInfo(u8"开始等待振镜%d完成扫描", m_ScannerControlCfg->m_SeqNo);
WaitForSingleObject(m_Thread, INFINITE); WaitForSingleObject(m_Thread, INFINITE);
Clean(); Clean();
CloseHandle(m_Thread); CloseHandle(m_Thread);
m_Thread = INVALID_HANDLE_VALUE; m_Thread = INVALID_HANDLE_VALUE;
if (m_RunCfg->m_LogDebugInfo)g_log->TraceInfo(u8"振镜%d完成扫描", m_ScannerControlCfg->m_SeqNo); if (m_RunCfg->m_LogDebugInfo)g_log->TraceInfo(u8"振镜%d完成扫描", m_ScannerControlCfg->m_SeqNo);
} }
void Scanner::Clean() void Scanner::Clean()
@ -1082,16 +1083,19 @@ void Scanner::SetAutoUpdateScanInfo(bool isauto)
m_IsAutoInfo = isauto; m_IsAutoInfo = isauto;
} }
void Scanner::GetXYScanState(ScanStateXY* scanstate, time_t &t) void Scanner::GetXYScanState(ScanStateXYSCT* scanstate, time_t &t)
{ {
EnterCriticalSection(&m_ScannerInfoCS); EnterCriticalSection(&m_ScannerInfoCS);
t = m_ScanStateUpdateTime; t = m_ScanStateUpdateTime;
memcpy_s(&scanstate->m_X, sizeof(IntelliScanState), &m_ScanState.m_X, sizeof(IntelliScanState));
memcpy_s(&scanstate->m_Y, sizeof(IntelliScanState), &m_ScanState.m_Y, sizeof(IntelliScanState)); m_ScanState.m_X.GetState(scanstate->m_X);
m_ScanState.m_Y.GetState(scanstate->m_Y);
m_ScanState.m_Focus.GetState(scanstate->m_Focus);
//memcpy_s(&scanstate->m_X, sizeof(IntelliScanState), &m_ScanState.m_X, sizeof(IntelliScanState));
//memcpy_s(&scanstate->m_Y, sizeof(IntelliScanState), &m_ScanState.m_Y, sizeof(IntelliScanState));
LeaveCriticalSection(&m_ScannerInfoCS); LeaveCriticalSection(&m_ScannerInfoCS);
} }
/*bool Scanner::IsUpScanner() /*bool Scanner::IsUpScanner()
{ {
if (m_LaserCfg->m_Cno < 3) { if (m_LaserCfg->m_Cno < 3) {

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "../stdafx.h" #include "../stdafx.h"
#include "../job/BPBinary.h" #include "../job/BPBinary.h"
#include "../job/MetaData.h" #include "../job/MetaData.h"
@ -98,7 +98,7 @@ public:
void StartGetScanInfo(); void StartGetScanInfo();
void StopGetScanInfo(); void StopGetScanInfo();
void SetAutoUpdateScanInfo(bool isauto); void SetAutoUpdateScanInfo(bool isauto);
void GetXYScanState(ScanStateXY* scanstate, time_t &t); void GetXYScanState(ScanStateXYSCT* scanstate, time_t &t); //咋办
virtual void UpdateScannerInfo() {} virtual void UpdateScannerInfo() {}
//bool IsUpScanner(); //bool IsUpScanner();
@ -114,6 +114,9 @@ public:
void SetPairScan(Scanner* sc) { m_PairScan = sc; } void SetPairScan(Scanner* sc) { m_PairScan = sc; }
virtual void UpdateScanParamByCfg(ScanParamCfg* cfg) = 0; virtual void UpdateScanParamByCfg(ScanParamCfg* cfg) = 0;
ScanStateXY& GetScanStateXY() { return m_ScanState; }
protected: protected:
static DWORD WINAPI DebugProc(Scanner* _this); static DWORD WINAPI DebugProc(Scanner* _this);
virtual void ScanDebug() {} virtual void ScanDebug() {}

View File

@ -11,6 +11,8 @@
#include "../utils/StringHelper.h" #include "../utils/StringHelper.h"
#include "../Remote/RemoteClient.h" #include "../Remote/RemoteClient.h"
#include "../utils/TimeHelper.h" #include "../utils/TimeHelper.h"
#include "../DataManage/ClientInfo.h"
ScannerCtrl::ScannerCtrl() ScannerCtrl::ScannerCtrl()
:m_print_thread(INVALID_HANDLE_VALUE) :m_print_thread(INVALID_HANDLE_VALUE)
@ -113,10 +115,16 @@ bool ScannerCtrl::Init() {
{ {
g_log->TraceError(_(u8"没有振镜控制卡").c_str()); g_log->TraceError(_(u8"没有振镜控制卡").c_str());
m_InitErrorInfos.push_back(_(u8"没有振镜控制卡").c_str()); m_InitErrorInfos.push_back(_(u8"没有振镜控制卡").c_str());
//for (int i = 0; i < 4; ++i) { //wxxtest
// Scanner* scanner = new RTC5Scanner(nullptr, i);
// m_scan.push_back(scanner);
//}
return false; return false;
} }
int scanIndex = 0;
for (map<int, ScannerControlCfg*>::iterator sit = scannerControlCfgsMap->begin(); sit != scannerControlCfgsMap->end(); sit++) { for (map<int, ScannerControlCfg*>::iterator sit = scannerControlCfgsMap->begin(); sit != scannerControlCfgsMap->end(); sit++) {
ScannerControlCfg* cfg = sit->second; ScannerControlCfg* cfg = sit->second;
if (m_IOCfgWrapper->m_LaserIOMap.find(cfg->m_SeqNo) != m_IOCfgWrapper->m_LaserIOMap.end()) { if (m_IOCfgWrapper->m_LaserIOMap.find(cfg->m_SeqNo) != m_IOCfgWrapper->m_LaserIOMap.end()) {
@ -124,7 +132,7 @@ bool ScannerCtrl::Init() {
cfg->m_LaserStart = m_IOCfgWrapper->m_LaserIOMap[cfg->m_SeqNo]->m_LaserStart; cfg->m_LaserStart = m_IOCfgWrapper->m_LaserIOMap[cfg->m_SeqNo]->m_LaserStart;
cfg->m_LaserEnable = m_IOCfgWrapper->m_LaserIOMap[cfg->m_SeqNo]->m_LaserEnable; cfg->m_LaserEnable = m_IOCfgWrapper->m_LaserIOMap[cfg->m_SeqNo]->m_LaserEnable;
} }
Scanner* scanner = new RTC5Scanner(cfg); Scanner* scanner = new RTC5Scanner(cfg, scanIndex);
if (scanner->Init()) if (scanner->Init())
@ -742,12 +750,12 @@ void ScannerCtrl::CtrlWhenStop()
CtrlIoWhenExit(); CtrlIoWhenExit();
} }
void ScannerCtrl::GetInitErrorInfos(vector<string>& vec) //void ScannerCtrl::GetInitErrorInfos(vector<string>& vec)
{ //{
for (size_t i = 0; i < m_InitErrorInfos.size(); ++i) { // for (size_t i = 0; i < m_InitErrorInfos.size(); ++i) {
vec.push_back(m_InitErrorInfos[i]); // vec.push_back(m_InitErrorInfos[i]);
} // }
} //}
string ScannerCtrl::GetInitErrorInfos() string ScannerCtrl::GetInitErrorInfos()
{ {
@ -1163,8 +1171,9 @@ void ScannerCtrl::DispatchDataBlock()
vector<FocusStatus*> focusStatus; vector<FocusStatus*> focusStatus;
for (size_t scanIndex = 0; scanIndex < m_scan.size(); ++scanIndex) { for (size_t scanIndex = 0; scanIndex < m_scan.size(); ++scanIndex) {
m_scan[scanIndex]->UpdateScannerInfo(); m_scan[scanIndex]->UpdateScannerInfo();
m_scan[scanIndex]->GetScanStateXY().SendToClients(XYSCANSTATE,"_"+to_string(scanIndex));
ScannerStatus* sstatus = new ScannerStatus(); ScannerStatus* sstatus = new ScannerStatus();
ScanStateXY sxy; ScanStateXYSCT sxy;
m_scan[scanIndex]->GetXYScanState(&sxy, sstatus->m_InsertTime); m_scan[scanIndex]->GetXYScanState(&sxy, sstatus->m_InsertTime);
sstatus->m_ScanTempX = sxy.m_X.m_GalvanometerScannerTemp; sstatus->m_ScanTempX = sxy.m_X.m_GalvanometerScannerTemp;
sstatus->m_ScanServoTempX = sxy.m_X.m_ServoBoardTemp; sstatus->m_ScanServoTempX = sxy.m_X.m_ServoBoardTemp;
@ -1611,7 +1620,7 @@ bool ScannerCtrl::IsHeatingScannerEnable()
for (size_t scanIndex = 0; scanIndex < m_scan.size(); ++scanIndex) { for (size_t scanIndex = 0; scanIndex < m_scan.size(); ++scanIndex) {
Scanner* scanner = m_scan[scanIndex]; Scanner* scanner = m_scan[scanIndex];
if (scanner->GetConfig()->m_ScanCfgWrapper.m_ScanTestCfg.m_IsAutoHeatingScanner) if (scanner && scanner->GetConfig() && scanner->GetConfig()->m_ScanCfgWrapper.m_ScanTestCfg.m_IsAutoHeatingScanner)
{ {
rel = true; rel = true;
break; break;
@ -1778,6 +1787,24 @@ void ScannerCtrl::CallFunc(const ReadData& rd) {
case STOPHEATINGMOTION: case STOPHEATINGMOTION:
StopHeatingMotion((bool)stoi(rd.strValue)); StopHeatingMotion((bool)stoi(rd.strValue));
break; break;
case STARTDEBUGTEST:
m_scan[stoi(rd.strValue)]->StartDebugTest();
break;
case STOPDEBUGTEST:
m_scan[stoi(rd.strValue)]->StopDebugTest();
break;
case STARTHEATINGSCANNERTEST:
m_scan[stoi(rd.strValue)]->StartHeatingScannerTest();
break;
case STOPHEATINGSCANNERTEST:
m_scan[stoi(rd.strValue)]->StopHeatingScannerTest();
break;
case STARTGETSCANINFO:
m_scan[stoi(rd.strValue)]->StartGetScanInfo();
break;
case STOPGETSCANINFO:
m_scan[stoi(rd.strValue)]->StopGetScanInfo();
break;
default: default:
printf("参数不对...\n"); printf("参数不对...\n");
break; break;
@ -1785,3 +1812,27 @@ void ScannerCtrl::CallFunc(const ReadData& rd) {
} }
} }
void ScannerCtrl::SendToClients() {
std::shared_lock<std::shared_mutex> lck(m_mtx);
list<Item> lst;
lst.emplace_back(Item{ "IsTestLayerEnable", to_string(IsTestLayerEnable()), iBOOL});
lst.emplace_back(Item{ "IsHeatingScannerEnable", to_string(IsHeatingScannerEnable()), iBOOL});
lst.emplace_back(Item{ "InitErrorInfos", GetInitErrorInfos(), iSTRING});
int count = m_scan.size();
lst.emplace_back(Item{ "ScanCount", to_string(count), iINT});
for (int i = 0; i < count; ++i) {
lst.emplace_back(Item{ "IsDebugEnable_"+to_string(i), to_string(m_scan[i]->IsDebugEnable()), iBOOL});
lst.emplace_back(Item{ "IsHeatingScannerTest_"+to_string(i), to_string(m_scan[i]->IsHeatingScannerTest()), iBOOL});
}
auto iter = Scanner::m_CurrentSerio.begin();
while (iter != Scanner::m_CurrentSerio.end()) {
lst.emplace_back(Item{ to_string(iter->first), to_string(iter->second), iUINT });
++iter;
}
ClientWrapper::Instance()->PushAllClient(WriteData(SCANCTRLPARAM,lst));
}

View File

@ -21,6 +21,13 @@ enum FUNCNAME {
REMOVESCANNER, REMOVESCANNER,
STARTHEATINGMOTION, STARTHEATINGMOTION,
STOPHEATINGMOTION, STOPHEATINGMOTION,
STARTDEBUGTEST, //scanner函数
STOPDEBUGTEST,
STARTHEATINGSCANNERTEST,
STOPHEATINGSCANNERTEST,
STARTGETSCANINFO,
STOPGETSCANINFO,
}; };
@ -39,10 +46,10 @@ public:
void PauseAuto(); void PauseAuto();
bool StopWork(); bool StopWork();
bool IsTestLayerEnable(); //留着 bool IsTestLayerEnable();
void StopRedTest(); void StopRedTest();
void TestLayer(); void TestLayer();
vector<Scanner*>* GetScanners() { return &m_scan; } vector<Scanner*>* GetScanners() { return &m_scan; } //待处理
JobController* GetJobController() { return m_job_controller; } JobController* GetJobController() { return m_job_controller; }
void RemoveScanner(int seq); void RemoveScanner(int seq);
@ -50,9 +57,9 @@ public:
m_PurifierClient = purifierClient; m_PurifierClient = purifierClient;
} }
void SetScannerPowerClient(ScannerPowerClient* spc) { m_ScannerPowerClient = spc; } void SetScannerPowerClient(ScannerPowerClient* spc) { m_ScannerPowerClient = spc; }
void GetInitErrorInfos(vector<string>& vec); //void GetInitErrorInfos(vector<string>& vec);
string GetInitErrorInfos(); string GetInitErrorInfos();
bool HasInitError() { return !m_InitErrorInfos.empty(); } bool HasInitError() { return !m_InitErrorInfos.empty(); } //不需要传客户端先请求一次GetInitErrorInfos
void ModelScan(void); void ModelScan(void);
void StopModelScan(void); void StopModelScan(void);
@ -60,7 +67,7 @@ public:
m_MachineCtrl = machineCtrl; m_MachineCtrl = machineCtrl;
} }
bool IsHeatingScannerEnable(); bool IsHeatingScannerEnable(); //在客户端判断,不传客户端
void SetCamera(HBDCamera* camera) { m_Camera = camera; } void SetCamera(HBDCamera* camera) { m_Camera = camera; }
//void SetRecoatCheck(RecoatCheck* rc) { m_RecoatCheck = rc; } //void SetRecoatCheck(RecoatCheck* rc) { m_RecoatCheck = rc; }
@ -72,6 +79,8 @@ public:
void SetRemoteClient(RemoteClient* rc) { m_RemoteClient = rc; } void SetRemoteClient(RemoteClient* rc) { m_RemoteClient = rc; }
void CallFunc(const ReadData& rd); void CallFunc(const ReadData& rd);
void SendToClients();
private: private:
static DWORD WINAPI PrintProc(thisClass* _this); static DWORD WINAPI PrintProc(thisClass* _this);
static DWORD WINAPI RedPrintTestProc(thisClass* _this); static DWORD WINAPI RedPrintTestProc(thisClass* _this);
@ -140,4 +149,7 @@ private:
vector<BPBinary::BinDataBlock*> m_RedTestDBS; vector<BPBinary::BinDataBlock*> m_RedTestDBS;
vector<BPBinary::BinDataBlock*> m_ModeTestDBS; vector<BPBinary::BinDataBlock*> m_ModeTestDBS;
std::shared_mutex m_mtx;
}; };

View File

@ -1,75 +0,0 @@
#include "AxisCfg.h"
AxisCfg::AxisCfg(short id)
:m_axis_id(id)
, m_active_limit(new IntData("active_limit", u8"活性限制微米"))
, m_negactive_limit(new IntData("negactive_limit", u8"消极限制微米"))
, m_active_direct(new IntData("active_direct", u8"消极限制微米"))
, m_OverLoadLimit(new FloatData("OverLoadLimit", u8"消极限制微米"))
, m_ShowRefZero(new FloatData("ShowRefZero", u8"消极限制微米"))
, m_ShowPosInv(new BoolData("ShowPosInv", u8"消极限制微米"))
, m_IsUse(new BoolData("IsUse", u8"是否有用", true))
, m_MaxLoadValue(new FloatData("MaxLoadValue", u8"最大加载值"))
, m_SafeLimit(new BoolData("SafeLimit", u8"安全限制", false))
{
size_t ptrSize = sizeof(nullptr); //指针大小
void* startPtr = &m_startFlag + 1;
size_t count = ((size_t)&m_endFlag - (size_t)startPtr) / ptrSize;
InsertMp(startPtr, count);
}
AxisCfg::~AxisCfg()
{
}
void AxisCfg::GetUpdateSql(vector<string>& vec)
{
char buffer[2048];
sprintf_s(buffer, sizeof(buffer), "UPDATE %s SET %s=",TABLE_NAME.c_str(),FIELD_VALUE.c_str() );
string strhead = string(buffer);
sprintf_s(buffer, sizeof(buffer), " WHERE %s=%d AND %s=", FIELD_AXIS_ID.c_str(), m_axis_id,FIELD_CODE.c_str());
string strtail = string(buffer);
sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_active_limit->GetValue()).c_str(), strtail.c_str(), CODE_ACTIVE_LIMIT.c_str());
vec.push_back(buffer);
sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_negactive_limit->GetValue()).c_str(), strtail.c_str(), CODE_NEGACTIVE_LIMIT.c_str());
vec.push_back(buffer);
sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_active_direct->GetValue()).c_str(), strtail.c_str(), CODE_ACTIVE_DIRECT.c_str());
vec.push_back(buffer);
sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_OverLoadLimit->GetValue()).c_str(), strtail.c_str(), CODE_OVER_LOAD_LIMIT.c_str());
vec.push_back(buffer);
sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ShowRefZero->GetValue()).c_str(), strtail.c_str(), CODE_SHOW_REF_ZERO.c_str());
vec.push_back(buffer);
sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ShowPosInv->GetValue()).c_str(), strtail.c_str(), CODE_SHOW_POS_INV.c_str());
vec.push_back(buffer);
sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_MaxLoadValue->GetValue()).c_str(), strtail.c_str(), CODE_MAX_LOAD_VALUE.c_str());
vec.push_back(buffer);
sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), m_SafeLimit?"1":"0", strtail.c_str(), CODE_SAFE_LIMIT.c_str());
vec.push_back(buffer);
}
string AxisCfg::TABLE_NAME = "AxisConfig";
string AxisCfg::FIELD_ID = "Id";
string AxisCfg::FIELD_AXIS_ID = "Axis_Id";
string AxisCfg::FIELD_CODE = "Axis_Code";
string AxisCfg::FIELD_VALUE = "Axis_Value";
string AxisCfg::CODE_NAME= "Name";
string AxisCfg::CODE_ACTIVE_LIMIT = "Active_Limit";
string AxisCfg::CODE_NEGACTIVE_LIMIT = "Negactive_Limit";
string AxisCfg::CODE_ACTIVE_DIRECT = "acitve_direct";
string AxisCfg::CODE_OVER_LOAD_LIMIT = "OverLoadLimit";
string AxisCfg::CODE_SHOW_POS_INV="ShowPosInv"; //显示位置置反
string AxisCfg::CODE_SHOW_REF_ZERO="ShowRefZero";
string AxisCfg::CODE_MAX_LOAD_VALUE = "MaxLoadValue";
string AxisCfg::CODE_SAFE_LIMIT = "SafeLimit";

View File

@ -136,13 +136,15 @@ bool H3DMetaData::LoadLayerByIndex(unsigned int lindex)
} }
//lindex是第几层 //lindex是第几层
bool H3DMetaData::GetLayerByIndex(unsigned int lindex, ::stream::LayerData** response) bool H3DMetaData::GetLayerByIndex(unsigned int lindex, ::stream::ResponseAny** response)
{ {
bool rel = true; bool rel = true;
if (lindex >= layers->vector_layers.size())return false; if (lindex >= layers->vector_layers.size())return false;
LockMainDB(); LockMainDB();
Layer* layer = layers->vector_layers[lindex]; Layer* layer = layers->vector_layers[lindex];
ClearBlockMap(); ClearBlockMap();
stream::LayerData result;
vector<DataBlock*> datablocks = layer->data_blocks; vector<DataBlock*> datablocks = layer->data_blocks;
for (size_t i = 0; i < datablocks.size(); ++i) { for (size_t i = 0; i < datablocks.size(); ++i) {
DataBlock* db = datablocks[i]; DataBlock* db = datablocks[i];
@ -160,7 +162,8 @@ bool H3DMetaData::GetLayerByIndex(unsigned int lindex, ::stream::LayerData** res
} }
m_block_map[db] = pbindb; m_block_map[db] = pbindb;
stream::LayerDataBlock* p = (*response)->add_layerdatablock(); //stream::LayerDataBlock* p = (*response)->add_layerdatablock();
stream::LayerDataBlock* p = result.add_layerdatablock();
p->set_order(datablocks[i]->order); p->set_order(datablocks[i]->order);
p->set_blocktype(pbindb->type); p->set_blocktype(pbindb->type);
size_t count = pbindb->point_indexs.size(); size_t count = pbindb->point_indexs.size();
@ -188,7 +191,8 @@ bool H3DMetaData::GetLayerByIndex(unsigned int lindex, ::stream::LayerData** res
} }
} }
} }
(*response)->set_result(rel); result.set_result(rel);
(*response)->mutable_data()->PackFrom(result);
m_currentLayer = layer; m_currentLayer = layer;
UnLockMainDB(); UnLockMainDB();

View File

@ -10,7 +10,7 @@ public:
~H3DMetaData(); ~H3DMetaData();
bool LoadLayerByIndex(unsigned int lindex); bool LoadLayerByIndex(unsigned int lindex);
bool GetLayerByIndex(unsigned int lindex, ::stream::LayerData** response); bool GetLayerByIndex(unsigned int lindex, ::stream::ResponseAny** response);
bool LoadLayer(Layer* layer); bool LoadLayer(Layer* layer);
bool LoadPrevLayer(Layer* layer); bool LoadPrevLayer(Layer* layer);
bool LoadRemoteLayerByIndex(unsigned int index); bool LoadRemoteLayerByIndex(unsigned int index);

View File

@ -307,13 +307,14 @@ bool JobMetaData::LoadLayerByIndex(unsigned int lindex)
return rel; return rel;
} }
bool JobMetaData::GetLayerByIndex(unsigned int lindex, ::stream::LayerData** response) { bool JobMetaData::GetLayerByIndex(unsigned int lindex, ::stream::ResponseAny** response) {
bool rel = true; bool rel = true;
if (lindex >= layers->vector_layers.size())return false; if (lindex >= layers->vector_layers.size())return false;
LockMainDB(); LockMainDB();
Layer* layer = layers->vector_layers[lindex]; Layer* layer = layers->vector_layers[lindex];
ClearBlockMap(); ClearBlockMap();
vector<DataBlock*> datablocks = layer->data_blocks; vector<DataBlock*> datablocks = layer->data_blocks;
stream::LayerData result;
for (size_t i = 0; i < datablocks.size(); ++i) { for (size_t i = 0; i < datablocks.size(); ++i) {
BinaryFile* pbf = binary_files[datablocks[i]->bin->file_id]; BinaryFile* pbf = binary_files[datablocks[i]->bin->file_id];
if (!pbf)break; if (!pbf)break;
@ -329,8 +330,7 @@ bool JobMetaData::GetLayerByIndex(unsigned int lindex, ::stream::LayerData** res
m_block_map[datablocks[i]] = pbindb; m_block_map[datablocks[i]] = pbindb;
stream::LayerDataBlock* p = result.add_layerdatablock();
stream::LayerDataBlock* p = (*response)->add_layerdatablock();
p->set_order(datablocks[i]->order); p->set_order(datablocks[i]->order);
p->set_blocktype(m_block_map[datablocks[i]]->type); p->set_blocktype(m_block_map[datablocks[i]]->type);
size_t count = m_block_map[datablocks[i]]->point_indexs.size(); size_t count = m_block_map[datablocks[i]]->point_indexs.size();
@ -358,7 +358,8 @@ bool JobMetaData::GetLayerByIndex(unsigned int lindex, ::stream::LayerData** res
} }
} }
} }
(*response)->set_result(rel); result.set_result(rel);
(*response)->mutable_data()->PackFrom(result);
m_currentLayer = layer; m_currentLayer = layer;
UnLockMainDB(); UnLockMainDB();
return rel; return rel;

View File

@ -40,7 +40,7 @@ public:
~JobMetaData(); ~JobMetaData();
bool LoadFile(string path, string filename, vector<BPBinary::BFileInfo>& bfileinfos,string binpath); bool LoadFile(string path, string filename, vector<BPBinary::BFileInfo>& bfileinfos,string binpath);
bool LoadLayerByIndex(unsigned int lindex); bool LoadLayerByIndex(unsigned int lindex);
bool GetLayerByIndex(unsigned int lindex, ::stream::LayerData** response); bool GetLayerByIndex(unsigned int lindex, ::stream::ResponseAny** response);
bool LoadLayer(Layer* layer); bool LoadLayer(Layer* layer);
void SetJobContent(JobContent* job_content); void SetJobContent(JobContent* job_content);
bool LoadPrevLayer(Layer* layer); bool LoadPrevLayer(Layer* layer);

View File

@ -423,7 +423,7 @@ public:
virtual ~MetaData(); virtual ~MetaData();
static void InitTypeMap(); static void InitTypeMap();
virtual bool LoadLayerByIndex(unsigned int lindex) = 0; virtual bool LoadLayerByIndex(unsigned int lindex) = 0;
virtual bool GetLayerByIndex(unsigned int lindex, ::stream::LayerData** response) = 0; virtual bool GetLayerByIndex(unsigned int lindex, ::stream::ResponseAny** response) = 0;
virtual bool LoadLayer(Layer* layer) = 0; virtual bool LoadLayer(Layer* layer) = 0;
virtual bool LoadPrevLayer(Layer* layer) = 0; virtual bool LoadPrevLayer(Layer* layer) = 0;
virtual bool LoadPrevLayerByIndex(unsigned int lindex) = 0; virtual bool LoadPrevLayerByIndex(unsigned int lindex) = 0;

Binary file not shown.

View File

@ -41,23 +41,23 @@ Stream::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, co
, rpcmethod_AllStream_(Stream_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::BIDI_STREAMING, channel) , rpcmethod_AllStream_(Stream_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::BIDI_STREAMING, channel)
{} {}
::grpc::Status Stream::Stub::Simple(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::stream::LayerData* response) { ::grpc::Status Stream::Stub::Simple(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::stream::ResponseAny* response) {
return ::grpc::internal::BlockingUnaryCall< ::stream::RequestInfo, ::stream::LayerData, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Simple_, context, request, response); return ::grpc::internal::BlockingUnaryCall< ::stream::RequestInfo, ::stream::ResponseAny, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Simple_, context, request, response);
} }
void Stream::Stub::async::Simple(::grpc::ClientContext* context, const ::stream::RequestInfo* request, ::stream::LayerData* response, std::function<void(::grpc::Status)> f) { void Stream::Stub::async::Simple(::grpc::ClientContext* context, const ::stream::RequestInfo* request, ::stream::ResponseAny* response, std::function<void(::grpc::Status)> f) {
::grpc::internal::CallbackUnaryCall< ::stream::RequestInfo, ::stream::LayerData, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Simple_, context, request, response, std::move(f)); ::grpc::internal::CallbackUnaryCall< ::stream::RequestInfo, ::stream::ResponseAny, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Simple_, context, request, response, std::move(f));
} }
void Stream::Stub::async::Simple(::grpc::ClientContext* context, const ::stream::RequestInfo* request, ::stream::LayerData* response, ::grpc::ClientUnaryReactor* reactor) { void Stream::Stub::async::Simple(::grpc::ClientContext* context, const ::stream::RequestInfo* request, ::stream::ResponseAny* response, ::grpc::ClientUnaryReactor* reactor) {
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Simple_, context, request, response, reactor); ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Simple_, context, request, response, reactor);
} }
::grpc::ClientAsyncResponseReader< ::stream::LayerData>* Stream::Stub::PrepareAsyncSimpleRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) { ::grpc::ClientAsyncResponseReader< ::stream::ResponseAny>* Stream::Stub::PrepareAsyncSimpleRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) {
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::stream::LayerData, ::stream::RequestInfo, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_Simple_, context, request); return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::stream::ResponseAny, ::stream::RequestInfo, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_Simple_, context, request);
} }
::grpc::ClientAsyncResponseReader< ::stream::LayerData>* Stream::Stub::AsyncSimpleRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) { ::grpc::ClientAsyncResponseReader< ::stream::ResponseAny>* Stream::Stub::AsyncSimpleRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) {
auto* result = auto* result =
this->PrepareAsyncSimpleRaw(context, request, cq); this->PrepareAsyncSimpleRaw(context, request, cq);
result->StartCall(); result->StartCall();
@ -116,11 +116,11 @@ Stream::Service::Service() {
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
Stream_method_names[0], Stream_method_names[0],
::grpc::internal::RpcMethod::NORMAL_RPC, ::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< Stream::Service, ::stream::RequestInfo, ::stream::LayerData, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( new ::grpc::internal::RpcMethodHandler< Stream::Service, ::stream::RequestInfo, ::stream::ResponseAny, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](Stream::Service* service, [](Stream::Service* service,
::grpc::ServerContext* ctx, ::grpc::ServerContext* ctx,
const ::stream::RequestInfo* req, const ::stream::RequestInfo* req,
::stream::LayerData* resp) { ::stream::ResponseAny* resp) {
return service->Simple(ctx, req, resp); return service->Simple(ctx, req, resp);
}, this))); }, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod( AddMethod(new ::grpc::internal::RpcServiceMethod(
@ -158,7 +158,7 @@ Stream::Service::Service() {
Stream::Service::~Service() { Stream::Service::~Service() {
} }
::grpc::Status Stream::Service::Simple(::grpc::ServerContext* context, const ::stream::RequestInfo* request, ::stream::LayerData* response) { ::grpc::Status Stream::Service::Simple(::grpc::ServerContext* context, const ::stream::RequestInfo* request, ::stream::ResponseAny* response) {
(void) context; (void) context;
(void) request; (void) request;
(void) response; (void) response;

View File

@ -37,12 +37,12 @@ class Stream final {
class StubInterface { class StubInterface {
public: public:
virtual ~StubInterface() {} virtual ~StubInterface() {}
virtual ::grpc::Status Simple(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::stream::LayerData* response) = 0; virtual ::grpc::Status Simple(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::stream::ResponseAny* response) = 0;
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::stream::LayerData>> AsyncSimple(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) { std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::stream::ResponseAny>> AsyncSimple(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::stream::LayerData>>(AsyncSimpleRaw(context, request, cq)); return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::stream::ResponseAny>>(AsyncSimpleRaw(context, request, cq));
} }
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::stream::LayerData>> PrepareAsyncSimple(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) { std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::stream::ResponseAny>> PrepareAsyncSimple(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::stream::LayerData>>(PrepareAsyncSimpleRaw(context, request, cq)); return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::stream::ResponseAny>>(PrepareAsyncSimpleRaw(context, request, cq));
} }
std::unique_ptr< ::grpc::ClientReaderInterface< ::stream::ResponseInfo>> ServerStream(::grpc::ClientContext* context, const ::stream::RequestInfo& request) { std::unique_ptr< ::grpc::ClientReaderInterface< ::stream::ResponseInfo>> ServerStream(::grpc::ClientContext* context, const ::stream::RequestInfo& request) {
return std::unique_ptr< ::grpc::ClientReaderInterface< ::stream::ResponseInfo>>(ServerStreamRaw(context, request)); return std::unique_ptr< ::grpc::ClientReaderInterface< ::stream::ResponseInfo>>(ServerStreamRaw(context, request));
@ -74,8 +74,8 @@ class Stream final {
class async_interface { class async_interface {
public: public:
virtual ~async_interface() {} virtual ~async_interface() {}
virtual void Simple(::grpc::ClientContext* context, const ::stream::RequestInfo* request, ::stream::LayerData* response, std::function<void(::grpc::Status)>) = 0; virtual void Simple(::grpc::ClientContext* context, const ::stream::RequestInfo* request, ::stream::ResponseAny* response, std::function<void(::grpc::Status)>) = 0;
virtual void Simple(::grpc::ClientContext* context, const ::stream::RequestInfo* request, ::stream::LayerData* response, ::grpc::ClientUnaryReactor* reactor) = 0; virtual void Simple(::grpc::ClientContext* context, const ::stream::RequestInfo* request, ::stream::ResponseAny* response, ::grpc::ClientUnaryReactor* reactor) = 0;
virtual void ServerStream(::grpc::ClientContext* context, const ::stream::RequestInfo* request, ::grpc::ClientReadReactor< ::stream::ResponseInfo>* reactor) = 0; virtual void ServerStream(::grpc::ClientContext* context, const ::stream::RequestInfo* request, ::grpc::ClientReadReactor< ::stream::ResponseInfo>* reactor) = 0;
virtual void ClientStream(::grpc::ClientContext* context, ::stream::ResponseInfo* response, ::grpc::ClientWriteReactor< ::stream::RequestInfo>* reactor) = 0; virtual void ClientStream(::grpc::ClientContext* context, ::stream::ResponseInfo* response, ::grpc::ClientWriteReactor< ::stream::RequestInfo>* reactor) = 0;
virtual void AllStream(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::stream::RequestInfo,::stream::ResponseInfo>* reactor) = 0; virtual void AllStream(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::stream::RequestInfo,::stream::ResponseInfo>* reactor) = 0;
@ -84,8 +84,8 @@ class Stream final {
virtual class async_interface* async() { return nullptr; } virtual class async_interface* async() { return nullptr; }
class async_interface* experimental_async() { return async(); } class async_interface* experimental_async() { return async(); }
private: private:
virtual ::grpc::ClientAsyncResponseReaderInterface< ::stream::LayerData>* AsyncSimpleRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::stream::ResponseAny>* AsyncSimpleRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) = 0;
virtual ::grpc::ClientAsyncResponseReaderInterface< ::stream::LayerData>* PrepareAsyncSimpleRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::stream::ResponseAny>* PrepareAsyncSimpleRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) = 0;
virtual ::grpc::ClientReaderInterface< ::stream::ResponseInfo>* ServerStreamRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request) = 0; virtual ::grpc::ClientReaderInterface< ::stream::ResponseInfo>* ServerStreamRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request) = 0;
virtual ::grpc::ClientAsyncReaderInterface< ::stream::ResponseInfo>* AsyncServerStreamRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq, void* tag) = 0; virtual ::grpc::ClientAsyncReaderInterface< ::stream::ResponseInfo>* AsyncServerStreamRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq, void* tag) = 0;
virtual ::grpc::ClientAsyncReaderInterface< ::stream::ResponseInfo>* PrepareAsyncServerStreamRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncReaderInterface< ::stream::ResponseInfo>* PrepareAsyncServerStreamRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) = 0;
@ -99,12 +99,12 @@ class Stream final {
class Stub final : public StubInterface { class Stub final : public StubInterface {
public: public:
Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions());
::grpc::Status Simple(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::stream::LayerData* response) override; ::grpc::Status Simple(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::stream::ResponseAny* response) override;
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::stream::LayerData>> AsyncSimple(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) { std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::stream::ResponseAny>> AsyncSimple(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::stream::LayerData>>(AsyncSimpleRaw(context, request, cq)); return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::stream::ResponseAny>>(AsyncSimpleRaw(context, request, cq));
} }
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::stream::LayerData>> PrepareAsyncSimple(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) { std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::stream::ResponseAny>> PrepareAsyncSimple(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::stream::LayerData>>(PrepareAsyncSimpleRaw(context, request, cq)); return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::stream::ResponseAny>>(PrepareAsyncSimpleRaw(context, request, cq));
} }
std::unique_ptr< ::grpc::ClientReader< ::stream::ResponseInfo>> ServerStream(::grpc::ClientContext* context, const ::stream::RequestInfo& request) { std::unique_ptr< ::grpc::ClientReader< ::stream::ResponseInfo>> ServerStream(::grpc::ClientContext* context, const ::stream::RequestInfo& request) {
return std::unique_ptr< ::grpc::ClientReader< ::stream::ResponseInfo>>(ServerStreamRaw(context, request)); return std::unique_ptr< ::grpc::ClientReader< ::stream::ResponseInfo>>(ServerStreamRaw(context, request));
@ -136,8 +136,8 @@ class Stream final {
class async final : class async final :
public StubInterface::async_interface { public StubInterface::async_interface {
public: public:
void Simple(::grpc::ClientContext* context, const ::stream::RequestInfo* request, ::stream::LayerData* response, std::function<void(::grpc::Status)>) override; void Simple(::grpc::ClientContext* context, const ::stream::RequestInfo* request, ::stream::ResponseAny* response, std::function<void(::grpc::Status)>) override;
void Simple(::grpc::ClientContext* context, const ::stream::RequestInfo* request, ::stream::LayerData* response, ::grpc::ClientUnaryReactor* reactor) override; void Simple(::grpc::ClientContext* context, const ::stream::RequestInfo* request, ::stream::ResponseAny* response, ::grpc::ClientUnaryReactor* reactor) override;
void ServerStream(::grpc::ClientContext* context, const ::stream::RequestInfo* request, ::grpc::ClientReadReactor< ::stream::ResponseInfo>* reactor) override; void ServerStream(::grpc::ClientContext* context, const ::stream::RequestInfo* request, ::grpc::ClientReadReactor< ::stream::ResponseInfo>* reactor) override;
void ClientStream(::grpc::ClientContext* context, ::stream::ResponseInfo* response, ::grpc::ClientWriteReactor< ::stream::RequestInfo>* reactor) override; void ClientStream(::grpc::ClientContext* context, ::stream::ResponseInfo* response, ::grpc::ClientWriteReactor< ::stream::RequestInfo>* reactor) override;
void AllStream(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::stream::RequestInfo,::stream::ResponseInfo>* reactor) override; void AllStream(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::stream::RequestInfo,::stream::ResponseInfo>* reactor) override;
@ -152,8 +152,8 @@ class Stream final {
private: private:
std::shared_ptr< ::grpc::ChannelInterface> channel_; std::shared_ptr< ::grpc::ChannelInterface> channel_;
class async async_stub_{this}; class async async_stub_{this};
::grpc::ClientAsyncResponseReader< ::stream::LayerData>* AsyncSimpleRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::stream::ResponseAny>* AsyncSimpleRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) override;
::grpc::ClientAsyncResponseReader< ::stream::LayerData>* PrepareAsyncSimpleRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::stream::ResponseAny>* PrepareAsyncSimpleRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) override;
::grpc::ClientReader< ::stream::ResponseInfo>* ServerStreamRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request) override; ::grpc::ClientReader< ::stream::ResponseInfo>* ServerStreamRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request) override;
::grpc::ClientAsyncReader< ::stream::ResponseInfo>* AsyncServerStreamRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq, void* tag) override; ::grpc::ClientAsyncReader< ::stream::ResponseInfo>* AsyncServerStreamRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq, void* tag) override;
::grpc::ClientAsyncReader< ::stream::ResponseInfo>* PrepareAsyncServerStreamRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncReader< ::stream::ResponseInfo>* PrepareAsyncServerStreamRaw(::grpc::ClientContext* context, const ::stream::RequestInfo& request, ::grpc::CompletionQueue* cq) override;
@ -174,7 +174,7 @@ class Stream final {
public: public:
Service(); Service();
virtual ~Service(); virtual ~Service();
virtual ::grpc::Status Simple(::grpc::ServerContext* context, const ::stream::RequestInfo* request, ::stream::LayerData* response); virtual ::grpc::Status Simple(::grpc::ServerContext* context, const ::stream::RequestInfo* request, ::stream::ResponseAny* response);
virtual ::grpc::Status ServerStream(::grpc::ServerContext* context, const ::stream::RequestInfo* request, ::grpc::ServerWriter< ::stream::ResponseInfo>* writer); virtual ::grpc::Status ServerStream(::grpc::ServerContext* context, const ::stream::RequestInfo* request, ::grpc::ServerWriter< ::stream::ResponseInfo>* writer);
virtual ::grpc::Status ClientStream(::grpc::ServerContext* context, ::grpc::ServerReader< ::stream::RequestInfo>* reader, ::stream::ResponseInfo* response); virtual ::grpc::Status ClientStream(::grpc::ServerContext* context, ::grpc::ServerReader< ::stream::RequestInfo>* reader, ::stream::ResponseInfo* response);
virtual ::grpc::Status AllStream(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::stream::ResponseInfo, ::stream::RequestInfo>* stream); virtual ::grpc::Status AllStream(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::stream::ResponseInfo, ::stream::RequestInfo>* stream);
@ -191,11 +191,11 @@ class Stream final {
BaseClassMustBeDerivedFromService(this); BaseClassMustBeDerivedFromService(this);
} }
// disable synchronous version of this method // disable synchronous version of this method
::grpc::Status Simple(::grpc::ServerContext* /*context*/, const ::stream::RequestInfo* /*request*/, ::stream::LayerData* /*response*/) override { ::grpc::Status Simple(::grpc::ServerContext* /*context*/, const ::stream::RequestInfo* /*request*/, ::stream::ResponseAny* /*response*/) override {
abort(); abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
} }
void RequestSimple(::grpc::ServerContext* context, ::stream::RequestInfo* request, ::grpc::ServerAsyncResponseWriter< ::stream::LayerData>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { void RequestSimple(::grpc::ServerContext* context, ::stream::RequestInfo* request, ::grpc::ServerAsyncResponseWriter< ::stream::ResponseAny>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag);
} }
}; };
@ -267,25 +267,25 @@ class Stream final {
public: public:
WithCallbackMethod_Simple() { WithCallbackMethod_Simple() {
::grpc::Service::MarkMethodCallback(0, ::grpc::Service::MarkMethodCallback(0,
new ::grpc::internal::CallbackUnaryHandler< ::stream::RequestInfo, ::stream::LayerData>( new ::grpc::internal::CallbackUnaryHandler< ::stream::RequestInfo, ::stream::ResponseAny>(
[this]( [this](
::grpc::CallbackServerContext* context, const ::stream::RequestInfo* request, ::stream::LayerData* response) { return this->Simple(context, request, response); }));} ::grpc::CallbackServerContext* context, const ::stream::RequestInfo* request, ::stream::ResponseAny* response) { return this->Simple(context, request, response); }));}
void SetMessageAllocatorFor_Simple( void SetMessageAllocatorFor_Simple(
::grpc::MessageAllocator< ::stream::RequestInfo, ::stream::LayerData>* allocator) { ::grpc::MessageAllocator< ::stream::RequestInfo, ::stream::ResponseAny>* allocator) {
::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0);
static_cast<::grpc::internal::CallbackUnaryHandler< ::stream::RequestInfo, ::stream::LayerData>*>(handler) static_cast<::grpc::internal::CallbackUnaryHandler< ::stream::RequestInfo, ::stream::ResponseAny>*>(handler)
->SetMessageAllocator(allocator); ->SetMessageAllocator(allocator);
} }
~WithCallbackMethod_Simple() override { ~WithCallbackMethod_Simple() override {
BaseClassMustBeDerivedFromService(this); BaseClassMustBeDerivedFromService(this);
} }
// disable synchronous version of this method // disable synchronous version of this method
::grpc::Status Simple(::grpc::ServerContext* /*context*/, const ::stream::RequestInfo* /*request*/, ::stream::LayerData* /*response*/) override { ::grpc::Status Simple(::grpc::ServerContext* /*context*/, const ::stream::RequestInfo* /*request*/, ::stream::ResponseAny* /*response*/) override {
abort(); abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
} }
virtual ::grpc::ServerUnaryReactor* Simple( virtual ::grpc::ServerUnaryReactor* Simple(
::grpc::CallbackServerContext* /*context*/, const ::stream::RequestInfo* /*request*/, ::stream::LayerData* /*response*/) { return nullptr; } ::grpc::CallbackServerContext* /*context*/, const ::stream::RequestInfo* /*request*/, ::stream::ResponseAny* /*response*/) { return nullptr; }
}; };
template <class BaseClass> template <class BaseClass>
class WithCallbackMethod_ServerStream : public BaseClass { class WithCallbackMethod_ServerStream : public BaseClass {
@ -368,7 +368,7 @@ class Stream final {
BaseClassMustBeDerivedFromService(this); BaseClassMustBeDerivedFromService(this);
} }
// disable synchronous version of this method // disable synchronous version of this method
::grpc::Status Simple(::grpc::ServerContext* /*context*/, const ::stream::RequestInfo* /*request*/, ::stream::LayerData* /*response*/) override { ::grpc::Status Simple(::grpc::ServerContext* /*context*/, const ::stream::RequestInfo* /*request*/, ::stream::ResponseAny* /*response*/) override {
abort(); abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
} }
@ -436,7 +436,7 @@ class Stream final {
BaseClassMustBeDerivedFromService(this); BaseClassMustBeDerivedFromService(this);
} }
// disable synchronous version of this method // disable synchronous version of this method
::grpc::Status Simple(::grpc::ServerContext* /*context*/, const ::stream::RequestInfo* /*request*/, ::stream::LayerData* /*response*/) override { ::grpc::Status Simple(::grpc::ServerContext* /*context*/, const ::stream::RequestInfo* /*request*/, ::stream::ResponseAny* /*response*/) override {
abort(); abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
} }
@ -519,7 +519,7 @@ class Stream final {
BaseClassMustBeDerivedFromService(this); BaseClassMustBeDerivedFromService(this);
} }
// disable synchronous version of this method // disable synchronous version of this method
::grpc::Status Simple(::grpc::ServerContext* /*context*/, const ::stream::RequestInfo* /*request*/, ::stream::LayerData* /*response*/) override { ::grpc::Status Simple(::grpc::ServerContext* /*context*/, const ::stream::RequestInfo* /*request*/, ::stream::ResponseAny* /*response*/) override {
abort(); abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
} }
@ -601,10 +601,10 @@ class Stream final {
WithStreamedUnaryMethod_Simple() { WithStreamedUnaryMethod_Simple() {
::grpc::Service::MarkMethodStreamed(0, ::grpc::Service::MarkMethodStreamed(0,
new ::grpc::internal::StreamedUnaryHandler< new ::grpc::internal::StreamedUnaryHandler<
::stream::RequestInfo, ::stream::LayerData>( ::stream::RequestInfo, ::stream::ResponseAny>(
[this](::grpc::ServerContext* context, [this](::grpc::ServerContext* context,
::grpc::ServerUnaryStreamer< ::grpc::ServerUnaryStreamer<
::stream::RequestInfo, ::stream::LayerData>* streamer) { ::stream::RequestInfo, ::stream::ResponseAny>* streamer) {
return this->StreamedSimple(context, return this->StreamedSimple(context,
streamer); streamer);
})); }));
@ -613,12 +613,12 @@ class Stream final {
BaseClassMustBeDerivedFromService(this); BaseClassMustBeDerivedFromService(this);
} }
// disable regular version of this method // disable regular version of this method
::grpc::Status Simple(::grpc::ServerContext* /*context*/, const ::stream::RequestInfo* /*request*/, ::stream::LayerData* /*response*/) override { ::grpc::Status Simple(::grpc::ServerContext* /*context*/, const ::stream::RequestInfo* /*request*/, ::stream::ResponseAny* /*response*/) override {
abort(); abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
} }
// replace default version of method with streamed unary // replace default version of method with streamed unary
virtual ::grpc::Status StreamedSimple(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::stream::RequestInfo,::stream::LayerData>* server_unary_streamer) = 0; virtual ::grpc::Status StreamedSimple(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::stream::RequestInfo,::stream::ResponseAny>* server_unary_streamer) = 0;
}; };
typedef WithStreamedUnaryMethod_Simple<Service > StreamedUnaryService; typedef WithStreamedUnaryMethod_Simple<Service > StreamedUnaryService;
template <class BaseClass> template <class BaseClass>

View File

@ -89,6 +89,23 @@ struct ResponseInfoDefaultTypeInternal {
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ResponseInfoDefaultTypeInternal _ResponseInfo_default_instance_; PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ResponseInfoDefaultTypeInternal _ResponseInfo_default_instance_;
template <typename> template <typename>
PROTOBUF_CONSTEXPR ResponseAny::ResponseAny(::_pbi::ConstantInitialized)
: _impl_{
/*decltype(_impl_._has_bits_)*/ {},
/*decltype(_impl_._cached_size_)*/ {},
/*decltype(_impl_.data_)*/ nullptr,
} {}
struct ResponseAnyDefaultTypeInternal {
PROTOBUF_CONSTEXPR ResponseAnyDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~ResponseAnyDefaultTypeInternal() {}
union {
ResponseAny _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ResponseAnyDefaultTypeInternal _ResponseAny_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR LayerData::LayerData(::_pbi::ConstantInitialized) PROTOBUF_CONSTEXPR LayerData::LayerData(::_pbi::ConstantInitialized)
: _impl_{ : _impl_{
/*decltype(_impl_.layerdatablock_)*/ {}, /*decltype(_impl_.layerdatablock_)*/ {},
@ -183,7 +200,7 @@ struct PointDefaultTypeInternal {
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PointDefaultTypeInternal _Point_default_instance_; PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PointDefaultTypeInternal _Point_default_instance_;
} // namespace stream } // namespace stream
static ::_pb::Metadata file_level_metadata_stream_2eproto[8]; static ::_pb::Metadata file_level_metadata_stream_2eproto[9];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_stream_2eproto[1]; static const ::_pb::EnumDescriptor* file_level_enum_descriptors_stream_2eproto[1];
static constexpr const ::_pb::ServiceDescriptor** static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_stream_2eproto = nullptr; file_level_service_descriptors_stream_2eproto = nullptr;
@ -223,6 +240,16 @@ const ::uint32_t TableStruct_stream_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE
PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.datatype_), PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.datatype_),
PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.result_), PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.result_),
PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.item_), PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.item_),
PROTOBUF_FIELD_OFFSET(::stream::ResponseAny, _impl_._has_bits_),
PROTOBUF_FIELD_OFFSET(::stream::ResponseAny, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::stream::ResponseAny, _impl_.data_),
0,
~0u, // no _has_bits_ ~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::stream::LayerData, _internal_metadata_), PROTOBUF_FIELD_OFFSET(::stream::LayerData, _internal_metadata_),
~0u, // no _extensions_ ~0u, // no _extensions_
@ -289,17 +316,19 @@ static const ::_pbi::MigrationSchema
{0, -1, -1, sizeof(::stream::ParamInfo)}, {0, -1, -1, sizeof(::stream::ParamInfo)},
{11, -1, -1, sizeof(::stream::RequestInfo)}, {11, -1, -1, sizeof(::stream::RequestInfo)},
{23, -1, -1, sizeof(::stream::ResponseInfo)}, {23, -1, -1, sizeof(::stream::ResponseInfo)},
{34, -1, -1, sizeof(::stream::LayerData)}, {34, 43, -1, sizeof(::stream::ResponseAny)},
{47, -1, -1, sizeof(::stream::LayerDataBlock)}, {44, -1, -1, sizeof(::stream::LayerData)},
{61, -1, -1, sizeof(::stream::VectorDataBlock)}, {57, -1, -1, sizeof(::stream::LayerDataBlock)},
{73, -1, -1, sizeof(::stream::ChainDataBlock)}, {71, -1, -1, sizeof(::stream::VectorDataBlock)},
{83, -1, -1, sizeof(::stream::Point)}, {83, -1, -1, sizeof(::stream::ChainDataBlock)},
{93, -1, -1, sizeof(::stream::Point)},
}; };
static const ::_pb::Message* const file_default_instances[] = { static const ::_pb::Message* const file_default_instances[] = {
&::stream::_ParamInfo_default_instance_._instance, &::stream::_ParamInfo_default_instance_._instance,
&::stream::_RequestInfo_default_instance_._instance, &::stream::_RequestInfo_default_instance_._instance,
&::stream::_ResponseInfo_default_instance_._instance, &::stream::_ResponseInfo_default_instance_._instance,
&::stream::_ResponseAny_default_instance_._instance,
&::stream::_LayerData_default_instance_._instance, &::stream::_LayerData_default_instance_._instance,
&::stream::_LayerDataBlock_default_instance_._instance, &::stream::_LayerDataBlock_default_instance_._instance,
&::stream::_VectorDataBlock_default_instance_._instance, &::stream::_VectorDataBlock_default_instance_._instance,
@ -307,30 +336,32 @@ static const ::_pb::Message* const file_default_instances[] = {
&::stream::_Point_default_instance_._instance, &::stream::_Point_default_instance_._instance,
}; };
const char descriptor_table_protodef_stream_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { const char descriptor_table_protodef_stream_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
"\n\014stream.proto\022\006stream\"O\n\tParamInfo\022\017\n\007n" "\n\014stream.proto\022\006stream\032\031google/protobuf/"
"ameKey\030\001 \001(\014\022\020\n\010strValue\030\002 \001(\014\022\037\n\tvalueT" "any.proto\"O\n\tParamInfo\022\017\n\007nameKey\030\001 \001(\014\022"
"ype\030\003 \001(\0162\014.stream.TYPE\"c\n\013RequestInfo\022\020" "\020\n\010strValue\030\002 \001(\014\022\037\n\tvalueType\030\003 \001(\0162\014.s"
"\n\010dataType\030\001 \001(\r\022\017\n\007nameKey\030\002 \001(\014\022\020\n\010str" "tream.TYPE\"c\n\013RequestInfo\022\020\n\010dataType\030\001 "
"Value\030\003 \001(\014\022\037\n\tvalueType\030\004 \001(\0162\014.stream." "\001(\r\022\017\n\007nameKey\030\002 \001(\014\022\020\n\010strValue\030\003 \001(\014\022\037"
"TYPE\"Q\n\014ResponseInfo\022\020\n\010dataType\030\001 \001(\r\022\016" "\n\tvalueType\030\004 \001(\0162\014.stream.TYPE\"Q\n\014Respo"
"\n\006result\030\002 \001(\010\022\037\n\004item\030\003 \003(\0132\021.stream.Pa" "nseInfo\022\020\n\010dataType\030\001 \001(\r\022\016\n\006result\030\002 \001("
"ramInfo\"\210\001\n\tLayerData\022\023\n\013zCooldinate\030\001 \001" "\010\022\037\n\004item\030\003 \003(\0132\021.stream.ParamInfo\"1\n\013Re"
"(\002\022\016\n\006powder\030\002 \001(\002\022\026\n\016layerThickness\030\003 \001" "sponseAny\022\"\n\004data\030\001 \001(\0132\024.google.protobu"
"(\002\022.\n\016layerDataBlock\030\004 \003(\0132\026.stream.Laye" "f.Any\"\210\001\n\tLayerData\022\023\n\013zCooldinate\030\001 \001(\002"
"rDataBlock\022\016\n\006result\030\005 \001(\010\"\266\001\n\016LayerData" "\022\016\n\006powder\030\002 \001(\002\022\026\n\016layerThickness\030\003 \001(\002"
"Block\022\021\n\telementId\030\001 \001(\005\022\026\n\016elementParam" "\022.\n\016layerDataBlock\030\004 \003(\0132\026.stream.LayerD"
"Id\030\002 \001(\005\022\021\n\tblockType\030\003 \001(\r\022*\n\tvecBlocks" "ataBlock\022\016\n\006result\030\005 \001(\010\"\266\001\n\016LayerDataBl"
"\030\004 \003(\0132\027.stream.VectorDataBlock\022+\n\013chain" "ock\022\021\n\telementId\030\001 \001(\005\022\026\n\016elementParamId"
"Blocks\030\005 \003(\0132\026.stream.ChainDataBlock\022\r\n\005" "\030\002 \001(\005\022\021\n\tblockType\030\003 \001(\r\022*\n\tvecBlocks\030\004"
"order\030\006 \001(\r\"M\n\017VectorDataBlock\022\016\n\006startX" " \003(\0132\027.stream.VectorDataBlock\022+\n\013chainBl"
"\030\001 \001(\002\022\016\n\006startY\030\002 \001(\002\022\014\n\004endX\030\003 \001(\002\022\014\n\004" "ocks\030\005 \003(\0132\026.stream.ChainDataBlock\022\r\n\005or"
"endY\030\004 \001(\002\"A\n\016ChainDataBlock\022\016\n\006dotNum\030\001" "der\030\006 \001(\r\"M\n\017VectorDataBlock\022\016\n\006startX\030\001"
" \001(\r\022\037\n\010pointVec\030\002 \003(\0132\r.stream.Point\"#\n" " \001(\002\022\016\n\006startY\030\002 \001(\002\022\014\n\004endX\030\003 \001(\002\022\014\n\004en"
"\005Point\022\014\n\004xPos\030\001 \001(\002\022\014\n\004yPos\030\002 \001(\002*X\n\004TY" "dY\030\004 \001(\002\"A\n\016ChainDataBlock\022\016\n\006dotNum\030\001 \001"
"PE\022\t\n\005iBOOL\020\000\022\n\n\006iSHORT\020\001\022\013\n\007iUSHORT\020\002\022\010" "(\r\022\037\n\010pointVec\030\002 \003(\0132\r.stream.Point\"#\n\005P"
"\n\004iINT\020\003\022\t\n\005iUINT\020\004\022\n\n\006iFLOAT\020\005\022\013\n\007iSTRI" "oint\022\014\n\004xPos\030\001 \001(\002\022\014\n\004yPos\030\002 \001(\002*X\n\004TYPE"
"NG\020\0062\370\001\n\006Stream\0222\n\006Simple\022\023.stream.Reque" "\022\t\n\005iBOOL\020\000\022\n\n\006iSHORT\020\001\022\013\n\007iUSHORT\020\002\022\010\n\004"
"stInfo\032\021.stream.LayerData\"\000\022=\n\014ServerStr" "iINT\020\003\022\t\n\005iUINT\020\004\022\n\n\006iFLOAT\020\005\022\013\n\007iSTRING"
"\020\0062\372\001\n\006Stream\0224\n\006Simple\022\023.stream.Request"
"Info\032\023.stream.ResponseAny\"\000\022=\n\014ServerStr"
"eam\022\023.stream.RequestInfo\032\024.stream.Respon" "eam\022\023.stream.RequestInfo\032\024.stream.Respon"
"seInfo\"\0000\001\022=\n\014ClientStream\022\023.stream.Requ" "seInfo\"\0000\001\022=\n\014ClientStream\022\023.stream.Requ"
"estInfo\032\024.stream.ResponseInfo\"\000(\001\022<\n\tAll" "estInfo\032\024.stream.ResponseInfo\"\000(\001\022<\n\tAll"
@ -338,17 +369,21 @@ const char descriptor_table_protodef_stream_2eproto[] PROTOBUF_SECTION_VARIABLE(
"ponseInfo\"\000(\0010\001B-\n\027io.grpc.examples.stre" "ponseInfo\"\000(\0010\001B-\n\027io.grpc.examples.stre"
"amB\013StreamProtoP\001\242\002\002STb\006proto3" "amB\013StreamProtoP\001\242\002\002STb\006proto3"
}; };
static const ::_pbi::DescriptorTable* const descriptor_table_stream_2eproto_deps[1] =
{
&::descriptor_table_google_2fprotobuf_2fany_2eproto,
};
static ::absl::once_flag descriptor_table_stream_2eproto_once; static ::absl::once_flag descriptor_table_stream_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_stream_2eproto = { const ::_pbi::DescriptorTable descriptor_table_stream_2eproto = {
false, false,
false, false,
1190, 1270,
descriptor_table_protodef_stream_2eproto, descriptor_table_protodef_stream_2eproto,
"stream.proto", "stream.proto",
&descriptor_table_stream_2eproto_once, &descriptor_table_stream_2eproto_once,
nullptr, descriptor_table_stream_2eproto_deps,
0, 1,
8, 9,
schemas, schemas,
file_default_instances, file_default_instances,
TableStruct_stream_2eproto::offsets, TableStruct_stream_2eproto::offsets,
@ -1163,6 +1198,208 @@ void ResponseInfo::InternalSwap(ResponseInfo* other) {
} }
// =================================================================== // ===================================================================
class ResponseAny::_Internal {
public:
using HasBits = decltype(std::declval<ResponseAny>()._impl_._has_bits_);
static constexpr ::int32_t kHasBitsOffset =
8 * PROTOBUF_FIELD_OFFSET(ResponseAny, _impl_._has_bits_);
static const ::google::protobuf::Any& data(const ResponseAny* msg);
static void set_has_data(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
};
const ::google::protobuf::Any& ResponseAny::_Internal::data(const ResponseAny* msg) {
return *msg->_impl_.data_;
}
void ResponseAny::clear_data() {
if (_impl_.data_ != nullptr) _impl_.data_->Clear();
_impl_._has_bits_[0] &= ~0x00000001u;
}
ResponseAny::ResponseAny(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(arena) {
SharedCtor(arena);
// @@protoc_insertion_point(arena_constructor:stream.ResponseAny)
}
ResponseAny::ResponseAny(const ResponseAny& from) : ::google::protobuf::Message() {
ResponseAny* const _this = this;
(void)_this;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){from._impl_._has_bits_},
/*decltype(_impl_._cached_size_)*/ {},
decltype(_impl_.data_){nullptr},
};
_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(
from._internal_metadata_);
if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
_this->_impl_.data_ = new ::google::protobuf::Any(*from._impl_.data_);
}
// @@protoc_insertion_point(copy_constructor:stream.ResponseAny)
}
inline void ResponseAny::SharedCtor(::_pb::Arena* arena) {
(void)arena;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){},
/*decltype(_impl_._cached_size_)*/ {},
decltype(_impl_.data_){nullptr},
};
}
ResponseAny::~ResponseAny() {
// @@protoc_insertion_point(destructor:stream.ResponseAny)
_internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>();
SharedDtor();
}
inline void ResponseAny::SharedDtor() {
ABSL_DCHECK(GetArenaForAllocation() == nullptr);
if (this != internal_default_instance()) delete _impl_.data_;
}
void ResponseAny::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
}
PROTOBUF_NOINLINE void ResponseAny::Clear() {
// @@protoc_insertion_point(message_clear_start:stream.ResponseAny)
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000001u) {
ABSL_DCHECK(_impl_.data_ != nullptr);
_impl_.data_->Clear();
}
_impl_._has_bits_.Clear();
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
}
const char* ResponseAny::_InternalParse(
const char* ptr, ::_pbi::ParseContext* ctx) {
ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header);
return ptr;
}
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<0, 1, 1, 0, 2> ResponseAny::_table_ = {
{
PROTOBUF_FIELD_OFFSET(ResponseAny, _impl_._has_bits_),
0, // no _extensions_
1, 0, // max_field_number, fast_idx_mask
offsetof(decltype(_table_), field_lookup_table),
4294967294, // skipmap
offsetof(decltype(_table_), field_entries),
1, // num_field_entries
1, // num_aux_entries
offsetof(decltype(_table_), aux_entries),
&_ResponseAny_default_instance_._instance,
::_pbi::TcParser::GenericFallback, // fallback
}, {{
// .google.protobuf.Any data = 1;
{::_pbi::TcParser::FastMtS1,
{10, 0, 0, PROTOBUF_FIELD_OFFSET(ResponseAny, _impl_.data_)}},
}}, {{
65535, 65535
}}, {{
// .google.protobuf.Any data = 1;
{PROTOBUF_FIELD_OFFSET(ResponseAny, _impl_.data_), _Internal::kHasBitsOffset + 0, 0,
(0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)},
}}, {{
{::_pbi::TcParser::GetTable<::google::protobuf::Any>()},
}}, {{
}},
};
::uint8_t* ResponseAny::_InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:stream.ResponseAny)
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
cached_has_bits = _impl_._has_bits_[0];
// .google.protobuf.Any data = 1;
if (cached_has_bits & 0x00000001u) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessage(1, _Internal::data(this),
_Internal::data(this).GetCachedSize(), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target =
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:stream.ResponseAny)
return target;
}
::size_t ResponseAny::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:stream.ResponseAny)
::size_t total_size = 0;
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// .google.protobuf.Any data = 1;
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*_impl_.data_);
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::google::protobuf::Message::ClassData ResponseAny::_class_data_ = {
::google::protobuf::Message::CopyWithSourceCheck,
ResponseAny::MergeImpl
};
const ::google::protobuf::Message::ClassData*ResponseAny::GetClassData() const { return &_class_data_; }
void ResponseAny::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) {
auto* const _this = static_cast<ResponseAny*>(&to_msg);
auto& from = static_cast<const ResponseAny&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:stream.ResponseAny)
ABSL_DCHECK_NE(&from, _this);
::uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
_this->_internal_mutable_data()->::google::protobuf::Any::MergeFrom(
from._internal_data());
}
_this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_);
}
void ResponseAny::CopyFrom(const ResponseAny& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:stream.ResponseAny)
if (&from == this) return;
Clear();
MergeFrom(from);
}
PROTOBUF_NOINLINE bool ResponseAny::IsInitialized() const {
return true;
}
void ResponseAny::InternalSwap(ResponseAny* other) {
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
swap(_impl_.data_, other->_impl_.data_);
}
::google::protobuf::Metadata ResponseAny::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_stream_2eproto_getter, &descriptor_table_stream_2eproto_once,
file_level_metadata_stream_2eproto[3]);
}
// ===================================================================
class LayerData::_Internal { class LayerData::_Internal {
public: public:
}; };
@ -1483,7 +1720,7 @@ void LayerData::InternalSwap(LayerData* other) {
::google::protobuf::Metadata LayerData::GetMetadata() const { ::google::protobuf::Metadata LayerData::GetMetadata() const {
return ::_pbi::AssignDescriptors( return ::_pbi::AssignDescriptors(
&descriptor_table_stream_2eproto_getter, &descriptor_table_stream_2eproto_once, &descriptor_table_stream_2eproto_getter, &descriptor_table_stream_2eproto_once,
file_level_metadata_stream_2eproto[3]); file_level_metadata_stream_2eproto[4]);
} }
// =================================================================== // ===================================================================
@ -1792,7 +2029,7 @@ void LayerDataBlock::InternalSwap(LayerDataBlock* other) {
::google::protobuf::Metadata LayerDataBlock::GetMetadata() const { ::google::protobuf::Metadata LayerDataBlock::GetMetadata() const {
return ::_pbi::AssignDescriptors( return ::_pbi::AssignDescriptors(
&descriptor_table_stream_2eproto_getter, &descriptor_table_stream_2eproto_once, &descriptor_table_stream_2eproto_getter, &descriptor_table_stream_2eproto_once,
file_level_metadata_stream_2eproto[4]); file_level_metadata_stream_2eproto[5]);
} }
// =================================================================== // ===================================================================
@ -2090,7 +2327,7 @@ void VectorDataBlock::InternalSwap(VectorDataBlock* other) {
::google::protobuf::Metadata VectorDataBlock::GetMetadata() const { ::google::protobuf::Metadata VectorDataBlock::GetMetadata() const {
return ::_pbi::AssignDescriptors( return ::_pbi::AssignDescriptors(
&descriptor_table_stream_2eproto_getter, &descriptor_table_stream_2eproto_once, &descriptor_table_stream_2eproto_getter, &descriptor_table_stream_2eproto_once,
file_level_metadata_stream_2eproto[5]); file_level_metadata_stream_2eproto[6]);
} }
// =================================================================== // ===================================================================
@ -2289,7 +2526,7 @@ void ChainDataBlock::InternalSwap(ChainDataBlock* other) {
::google::protobuf::Metadata ChainDataBlock::GetMetadata() const { ::google::protobuf::Metadata ChainDataBlock::GetMetadata() const {
return ::_pbi::AssignDescriptors( return ::_pbi::AssignDescriptors(
&descriptor_table_stream_2eproto_getter, &descriptor_table_stream_2eproto_once, &descriptor_table_stream_2eproto_getter, &descriptor_table_stream_2eproto_once,
file_level_metadata_stream_2eproto[6]); file_level_metadata_stream_2eproto[7]);
} }
// =================================================================== // ===================================================================
@ -2513,7 +2750,7 @@ void Point::InternalSwap(Point* other) {
::google::protobuf::Metadata Point::GetMetadata() const { ::google::protobuf::Metadata Point::GetMetadata() const {
return ::_pbi::AssignDescriptors( return ::_pbi::AssignDescriptors(
&descriptor_table_stream_2eproto_getter, &descriptor_table_stream_2eproto_once, &descriptor_table_stream_2eproto_getter, &descriptor_table_stream_2eproto_once,
file_level_metadata_stream_2eproto[7]); file_level_metadata_stream_2eproto[8]);
} }
// @@protoc_insertion_point(namespace_scope) // @@protoc_insertion_point(namespace_scope)
} // namespace stream } // namespace stream

View File

@ -33,6 +33,7 @@
#include "google/protobuf/extension_set.h" // IWYU pragma: export #include "google/protobuf/extension_set.h" // IWYU pragma: export
#include "google/protobuf/generated_enum_reflection.h" #include "google/protobuf/generated_enum_reflection.h"
#include "google/protobuf/unknown_field_set.h" #include "google/protobuf/unknown_field_set.h"
#include "google/protobuf/any.pb.h"
// @@protoc_insertion_point(includes) // @@protoc_insertion_point(includes)
// Must be included last. // Must be included last.
@ -73,6 +74,9 @@ extern PointDefaultTypeInternal _Point_default_instance_;
class RequestInfo; class RequestInfo;
struct RequestInfoDefaultTypeInternal; struct RequestInfoDefaultTypeInternal;
extern RequestInfoDefaultTypeInternal _RequestInfo_default_instance_; extern RequestInfoDefaultTypeInternal _RequestInfo_default_instance_;
class ResponseAny;
struct ResponseAnyDefaultTypeInternal;
extern ResponseAnyDefaultTypeInternal _ResponseAny_default_instance_;
class ResponseInfo; class ResponseInfo;
struct ResponseInfoDefaultTypeInternal; struct ResponseInfoDefaultTypeInternal;
extern ResponseInfoDefaultTypeInternal _ResponseInfo_default_instance_; extern ResponseInfoDefaultTypeInternal _ResponseInfo_default_instance_;
@ -719,6 +723,170 @@ class ResponseInfo final :
friend struct ::TableStruct_stream_2eproto; friend struct ::TableStruct_stream_2eproto;
};// ------------------------------------------------------------------- };// -------------------------------------------------------------------
class ResponseAny final :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:stream.ResponseAny) */ {
public:
inline ResponseAny() : ResponseAny(nullptr) {}
~ResponseAny() override;
template<typename = void>
explicit PROTOBUF_CONSTEXPR ResponseAny(::google::protobuf::internal::ConstantInitialized);
ResponseAny(const ResponseAny& from);
ResponseAny(ResponseAny&& from) noexcept
: ResponseAny() {
*this = ::std::move(from);
}
inline ResponseAny& operator=(const ResponseAny& from) {
CopyFrom(from);
return *this;
}
inline ResponseAny& operator=(ResponseAny&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance);
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>();
}
static const ::google::protobuf::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::google::protobuf::Descriptor* GetDescriptor() {
return default_instance().GetMetadata().descriptor;
}
static const ::google::protobuf::Reflection* GetReflection() {
return default_instance().GetMetadata().reflection;
}
static const ResponseAny& default_instance() {
return *internal_default_instance();
}
static inline const ResponseAny* internal_default_instance() {
return reinterpret_cast<const ResponseAny*>(
&_ResponseAny_default_instance_);
}
static constexpr int kIndexInFileMessages =
3;
friend void swap(ResponseAny& a, ResponseAny& b) {
a.Swap(&b);
}
inline void Swap(ResponseAny* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::google::protobuf::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(ResponseAny* other) {
if (other == this) return;
ABSL_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
ResponseAny* New(::google::protobuf::Arena* arena = nullptr) const final {
return CreateMaybeMessage<ResponseAny>(arena);
}
using ::google::protobuf::Message::CopyFrom;
void CopyFrom(const ResponseAny& from);
using ::google::protobuf::Message::MergeFrom;
void MergeFrom( const ResponseAny& from) {
ResponseAny::MergeImpl(*this, from);
}
private:
static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg);
public:
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final;
::uint8_t* _InternalSerialize(
::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::google::protobuf::Arena* arena);
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(ResponseAny* other);
private:
friend class ::google::protobuf::internal::AnyMetadata;
static ::absl::string_view FullMessageName() {
return "stream.ResponseAny";
}
protected:
explicit ResponseAny(::google::protobuf::Arena* arena);
public:
static const ClassData _class_data_;
const ::google::protobuf::Message::ClassData*GetClassData() const final;
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kDataFieldNumber = 1,
};
// .google.protobuf.Any data = 1;
bool has_data() const;
void clear_data() ;
const ::google::protobuf::Any& data() const;
PROTOBUF_NODISCARD ::google::protobuf::Any* release_data();
::google::protobuf::Any* mutable_data();
void set_allocated_data(::google::protobuf::Any* value);
void unsafe_arena_set_allocated_data(::google::protobuf::Any* value);
::google::protobuf::Any* unsafe_arena_release_data();
private:
const ::google::protobuf::Any& _internal_data() const;
::google::protobuf::Any* _internal_mutable_data();
public:
// @@protoc_insertion_point(class_scope:stream.ResponseAny)
private:
class _Internal;
friend class ::google::protobuf::internal::TcParser;
static const ::google::protobuf::internal::TcParseTable<0, 1, 1, 0, 2> _table_;
template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
::google::protobuf::internal::HasBits<1> _has_bits_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
::google::protobuf::Any* data_;
PROTOBUF_TSAN_DECLARE_MEMBER
};
union { Impl_ _impl_; };
friend struct ::TableStruct_stream_2eproto;
};// -------------------------------------------------------------------
class LayerData final : class LayerData final :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:stream.LayerData) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:stream.LayerData) */ {
public: public:
@ -775,7 +943,7 @@ class LayerData final :
&_LayerData_default_instance_); &_LayerData_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
3; 4;
friend void swap(LayerData& a, LayerData& b) { friend void swap(LayerData& a, LayerData& b) {
a.Swap(&b); a.Swap(&b);
@ -989,7 +1157,7 @@ class LayerDataBlock final :
&_LayerDataBlock_default_instance_); &_LayerDataBlock_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
4; 5;
friend void swap(LayerDataBlock& a, LayerDataBlock& b) { friend void swap(LayerDataBlock& a, LayerDataBlock& b) {
a.Swap(&b); a.Swap(&b);
@ -1223,7 +1391,7 @@ class VectorDataBlock final :
&_VectorDataBlock_default_instance_); &_VectorDataBlock_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
5; 6;
friend void swap(VectorDataBlock& a, VectorDataBlock& b) { friend void swap(VectorDataBlock& a, VectorDataBlock& b) {
a.Swap(&b); a.Swap(&b);
@ -1417,7 +1585,7 @@ class ChainDataBlock final :
&_ChainDataBlock_default_instance_); &_ChainDataBlock_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
6; 7;
friend void swap(ChainDataBlock& a, ChainDataBlock& b) { friend void swap(ChainDataBlock& a, ChainDataBlock& b) {
a.Swap(&b); a.Swap(&b);
@ -1595,7 +1763,7 @@ class Point final :
&_Point_default_instance_); &_Point_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
7; 8;
friend void swap(Point& a, Point& b) { friend void swap(Point& a, Point& b) {
a.Swap(&b); a.Swap(&b);
@ -2095,6 +2263,102 @@ ResponseInfo::_internal_mutable_item() {
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// ResponseAny
// .google.protobuf.Any data = 1;
inline bool ResponseAny::has_data() const {
bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
PROTOBUF_ASSUME(!value || _impl_.data_ != nullptr);
return value;
}
inline const ::google::protobuf::Any& ResponseAny::_internal_data() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
const ::google::protobuf::Any* p = _impl_.data_;
return p != nullptr ? *p : reinterpret_cast<const ::google::protobuf::Any&>(::google::protobuf::_Any_default_instance_);
}
inline const ::google::protobuf::Any& ResponseAny::data() const {
// @@protoc_insertion_point(field_get:stream.ResponseAny.data)
return _internal_data();
}
inline void ResponseAny::unsafe_arena_set_allocated_data(::google::protobuf::Any* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (GetArenaForAllocation() == nullptr) {
delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.data_);
}
_impl_.data_ = reinterpret_cast<::google::protobuf::Any*>(value);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u;
} else {
_impl_._has_bits_[0] &= ~0x00000001u;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:stream.ResponseAny.data)
}
inline ::google::protobuf::Any* ResponseAny::release_data() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] &= ~0x00000001u;
::google::protobuf::Any* released = _impl_.data_;
_impl_.data_ = nullptr;
#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released);
released = ::google::protobuf::internal::DuplicateIfNonNull(released);
if (GetArenaForAllocation() == nullptr) {
delete old;
}
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
if (GetArenaForAllocation() != nullptr) {
released = ::google::protobuf::internal::DuplicateIfNonNull(released);
}
#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return released;
}
inline ::google::protobuf::Any* ResponseAny::unsafe_arena_release_data() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:stream.ResponseAny.data)
_impl_._has_bits_[0] &= ~0x00000001u;
::google::protobuf::Any* temp = _impl_.data_;
_impl_.data_ = nullptr;
return temp;
}
inline ::google::protobuf::Any* ResponseAny::_internal_mutable_data() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u;
if (_impl_.data_ == nullptr) {
auto* p = CreateMaybeMessage<::google::protobuf::Any>(GetArenaForAllocation());
_impl_.data_ = reinterpret_cast<::google::protobuf::Any*>(p);
}
return _impl_.data_;
}
inline ::google::protobuf::Any* ResponseAny::mutable_data() {
::google::protobuf::Any* _msg = _internal_mutable_data();
// @@protoc_insertion_point(field_mutable:stream.ResponseAny.data)
return _msg;
}
inline void ResponseAny::set_allocated_data(::google::protobuf::Any* value) {
::google::protobuf::Arena* message_arena = GetArenaForAllocation();
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (message_arena == nullptr) {
delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.data_);
}
if (value != nullptr) {
::google::protobuf::Arena* submessage_arena =
::google::protobuf::Arena::InternalGetOwningArena(reinterpret_cast<::google::protobuf::MessageLite*>(value));
if (message_arena != submessage_arena) {
value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena);
}
_impl_._has_bits_[0] |= 0x00000001u;
} else {
_impl_._has_bits_[0] &= ~0x00000001u;
}
_impl_.data_ = reinterpret_cast<::google::protobuf::Any*>(value);
// @@protoc_insertion_point(field_set_allocated:stream.ResponseAny.data)
}
// -------------------------------------------------------------------
// LayerData // LayerData
// float zCooldinate = 1; // float zCooldinate = 1;

View File

@ -1,8 +1,11 @@
//bytes替代string //bytes替代string
syntax = "proto3"; syntax = "proto3";
import "google/protobuf/any.proto";
package stream; package stream;
//ption cc_generic_services = true; //ption cc_generic_services = true;
option java_multiple_files = true; option java_multiple_files = true;
option java_package = "io.grpc.examples.stream"; option java_package = "io.grpc.examples.stream";
@ -44,6 +47,9 @@ message ResponseInfo {
/*==================end 通用通信结构体====================*/ /*==================end 通用通信结构体====================*/
message ResponseAny{
google.protobuf.Any data = 1;
}
/*==================begin h3d图层结构体===================*/ /*==================begin h3d图层结构体===================*/
message LayerData{ message LayerData{
@ -95,7 +101,7 @@ message Point{
service Stream { service Stream {
rpc Simple(RequestInfo) returns (LayerData) {} // rpc Simple(RequestInfo) returns (ResponseAny) {} //
rpc ServerStream (RequestInfo) returns (stream ResponseInfo) {} // rpc ServerStream (RequestInfo) returns (stream ResponseInfo) {} //
rpc ClientStream (stream RequestInfo) returns (ResponseInfo) {} // rpc ClientStream (stream RequestInfo) returns (ResponseInfo) {} //
rpc AllStream (stream RequestInfo) returns (stream ResponseInfo) {} // rpc AllStream (stream RequestInfo) returns (stream ResponseInfo) {} //

View File

@ -75,15 +75,14 @@ void DataHandle::PrintValue(const ReadData& msg){
++it; ++it;
} }
printf("共有参数%zd个...\n", msg.its.size()); printf("共有参数%zd个...\n", msg.its.size());
if (m_printIndex != 9) { if(m_printIndex == 9 || m_printIndex == 36){
m_printIndex = -1;
}
else {
static int count = 0; static int count = 0;
++count; ++count;
if (count == 4) { count = 0; m_printIndex = -1; } //激光参数默认4个 if (count == 4) { count = 0; m_printIndex = -1; } //激光参数默认4个
} }
else {
m_printIndex = -1;
}
} }
} }
@ -115,41 +114,42 @@ void DataHandle::ParamReadUsage() {
printf(" h: " COLOR_YELLOW "print this information...\n" COLOR_RESET); printf(" h: " COLOR_YELLOW "print this information...\n" COLOR_RESET);
printf(" q: " COLOR_YELLOW "return to the previous level...\n" COLOR_RESET); printf(" q: " COLOR_YELLOW "return to the previous level...\n" COLOR_RESET);
printf(" 0: " COLOR_YELLOW "print alarm param...\n" COLOR_RESET); printf(" 0: " COLOR_YELLOW "print alarm param...\n" COLOR_RESET);
printf(" 1: " COLOR_YELLOW "print init error infos rsp...\n" COLOR_RESET); printf(" 1: " COLOR_YELLOW "print version rsp...\n" COLOR_RESET);
printf(" 2: " COLOR_YELLOW "print version rsp...\n" COLOR_RESET); printf(" 2: " COLOR_YELLOW "print io signal rsp...\n" COLOR_RESET);
printf(" 3: " COLOR_YELLOW "print io signal rsp...\n" COLOR_RESET); printf(" 3: " COLOR_YELLOW "print system param data...\n" COLOR_RESET);
printf(" 4: " COLOR_YELLOW "print system param data...\n" COLOR_RESET); printf(" 4: " COLOR_YELLOW "print laserchiller data...\n" COLOR_RESET);
printf(" 5: " COLOR_YELLOW "print laserchiller data...\n" COLOR_RESET); printf(" 5: " COLOR_YELLOW "print ups param data...\n" COLOR_RESET);
printf(" 6: " COLOR_YELLOW "print ups param data...\n" COLOR_RESET); printf(" 6: " COLOR_YELLOW "print temp ctrl param data...\n" COLOR_RESET);
printf(" 7: " COLOR_YELLOW "print temp ctrl param data...\n" COLOR_RESET); printf(" 7: " COLOR_YELLOW "print oxygenparam data...\n" COLOR_RESET);
printf(" 8: " COLOR_YELLOW "print oxygenparam data...\n" COLOR_RESET); printf(" 8: " COLOR_YELLOW "print laser param data...\n" COLOR_RESET);
printf(" 9: " COLOR_YELLOW "print laser param data...\n" COLOR_RESET); printf(" 9: " COLOR_YELLOW "print simplesupplyparam_v10 data...\n" COLOR_RESET);
printf(" 10: " COLOR_YELLOW "print simplesupplyparam_v10 data...\n" COLOR_RESET); printf(" 10: " COLOR_YELLOW "print SIMPLESUPPLYPARAM_V21 data...\n" COLOR_RESET);
printf(" 11: " COLOR_YELLOW "print SIMPLESUPPLYPARAM_V21 data...\n" COLOR_RESET); printf(" 11: " COLOR_YELLOW "print SIMPLESUPPLYPARAM_V22 data...\n" COLOR_RESET);
printf(" 12: " COLOR_YELLOW "print SIMPLESUPPLYPARAM_V22 data...\n" COLOR_RESET); printf(" 12: " COLOR_YELLOW "print purifier param data...\n" COLOR_RESET);
printf(" 13: " COLOR_YELLOW "print purifier param data...\n" COLOR_RESET); printf(" 13: " COLOR_YELLOW "print power meter param data...\n" COLOR_RESET);
printf(" 14: " COLOR_YELLOW "print power meter param data...\n" COLOR_RESET); printf(" 14: " COLOR_YELLOW "print powder supply simple param data...\n" COLOR_RESET);
printf(" 15: " COLOR_YELLOW "print powder supply simple param data...\n" COLOR_RESET); printf(" 15: " COLOR_YELLOW "print scanner power param data...\n" COLOR_RESET);
printf(" 16: " COLOR_YELLOW "print scanner power param data...\n" COLOR_RESET); printf(" 16: " COLOR_YELLOW "print axismold data...\n" COLOR_RESET);
printf(" 17: " COLOR_YELLOW "print axismold data...\n" COLOR_RESET); printf(" 17: " COLOR_YELLOW "print axismold slave data...\n" COLOR_RESET);
printf(" 18: " COLOR_YELLOW "print axismold slave data...\n" COLOR_RESET); printf(" 18: " COLOR_YELLOW "print axisclean data...\n" COLOR_RESET);
printf(" 19: " COLOR_YELLOW "print axisclean data...\n" COLOR_RESET); printf(" 19: " COLOR_YELLOW "print axisclean slave data...\n" COLOR_RESET);
printf(" 20: " COLOR_YELLOW "print axisclean slave data...\n" COLOR_RESET); printf(" 20: " COLOR_YELLOW "print axisload data...\n" COLOR_RESET);
printf(" 21: " COLOR_YELLOW "print axisload data...\n" COLOR_RESET); printf(" 21: " COLOR_YELLOW "print axismarm data...\n" COLOR_RESET);
printf(" 22: " COLOR_YELLOW "print axismarm data...\n" COLOR_RESET); printf(" 22: " COLOR_YELLOW "print axismsupply data...\n" COLOR_RESET);
printf(" 23: " COLOR_YELLOW "print axismsupply data...\n" COLOR_RESET); printf(" 23: " COLOR_YELLOW "print axisele data...\n" COLOR_RESET);
printf(" 24: " COLOR_YELLOW "print axisele data...\n" COLOR_RESET); printf(" 24: " COLOR_YELLOW "print axisele slave data...\n" COLOR_RESET);
printf(" 25: " COLOR_YELLOW "print axisele slave data...\n" COLOR_RESET); printf(" 25: " COLOR_YELLOW "print paramlimitcfg param data...\n" COLOR_RESET);
printf(" 26: " COLOR_YELLOW "print paramlimitcfg param data...\n" COLOR_RESET); printf(" 26: " COLOR_YELLOW "print extcfg param data...\n" COLOR_RESET);
printf(" 27: " COLOR_YELLOW "print extcfg param data...\n" COLOR_RESET); printf(" 27: " COLOR_YELLOW "print moldcfg param data...\n" COLOR_RESET);
printf(" 28: " COLOR_YELLOW "print moldcfg param data...\n" COLOR_RESET); printf(" 28: " COLOR_YELLOW "print loadcfg param data...\n" COLOR_RESET);
printf(" 29: " COLOR_YELLOW "print loadcfg param data...\n" COLOR_RESET); printf(" 29: " COLOR_YELLOW "print armcfgparam data...\n" COLOR_RESET);
printf(" 30: " COLOR_YELLOW "print armcfgparam data...\n" COLOR_RESET); printf(" 30: " COLOR_YELLOW "print supplycfgparam data...\n" COLOR_RESET);
printf(" 31: " COLOR_YELLOW "print supplycfgparam data...\n" COLOR_RESET); printf(" 31: " COLOR_YELLOW "print cleancfgparam data...\n" COLOR_RESET);
printf(" 32: " COLOR_YELLOW "print cleancfgparam data...\n" COLOR_RESET); printf(" 32: " COLOR_YELLOW "print elecfgparam data...\n" COLOR_RESET);
printf(" 33: " COLOR_YELLOW "print elecfgparam data...\n" COLOR_RESET); printf(" 33: " COLOR_YELLOW "print loadparamrsp data...\n" COLOR_RESET);
printf(" 34: " COLOR_YELLOW "print loadparamrsp data...\n" COLOR_RESET); printf(" 34: " COLOR_YELLOW "print scan ctrl state data...\n" COLOR_RESET);
printf(" 35: " COLOR_YELLOW "print scanctrlstate data...\n" COLOR_RESET); printf(" 35: " COLOR_YELLOW "print scan ctrl Param data...\n" COLOR_RESET);
printf(" 36: " COLOR_YELLOW "print xy scan state data...\n" COLOR_RESET);
} }
@ -172,6 +172,9 @@ void DataHandle::Request(int index) {
else if(index == 34){ else if(index == 34){
SetPushMsg(LOADPARAM,""); SetPushMsg(LOADPARAM,"");
} }
else if (index == 36) {
SetPushMsg(REQUEST,to_string(index));
}
m_printIndex = index; m_printIndex = index;
while (m_printIndex >= 0) { while (m_printIndex >= 0) {
@ -217,4 +220,5 @@ void DataHandle::ScanCtrlTest() {
printf("发送请求%d成功...\n", i); printf("发送请求%d成功...\n", i);
Sleep(1000); Sleep(1000);
} }
} }

View File

@ -47,6 +47,5 @@ enum SCANCTRLFUNC {
STARTHEATINGMOTION, STARTHEATINGMOTION,
STOPHEATINGMOTION, STOPHEATINGMOTION,
END1 //结束标记 END1 //结束标记
}; };

View File

@ -4,7 +4,6 @@
enum READTYPE { enum READTYPE {
ALARM = 0, //报警 ALARM = 0, //报警
INITERRORINFOSRSP, //返回初始化错误信息
VERSIONRSP, //返回版本信息 VERSIONRSP, //返回版本信息
IOSIGNALRSP, //io信号返回数据 IOSIGNALRSP, //io信号返回数据
SYSPARAMDATA, //系统参数 SYSPARAMDATA, //系统参数
@ -21,8 +20,8 @@ enum READTYPE {
PURIFIERPARAM, //净化器参数 PURIFIERPARAM, //净化器参数
POWERMETERPARAM, //电能参数 POWERMETERPARAM, //电能参数
POWDERSUPPLYSIMPLEPARAM, //PowderSupplySimpleClient 参数 已写,还没有发送 POWDERSUPPLYSIMPLEPARAM, //PowderSupplySimpleClient 参数 已写但没用到,暂没有发送
SCANNERPOWERPARAM, //ScannerPower 参数 //配置参数是0待处理 SCANNERPOWERPARAM, //ScannerPower 参数
/*************axis相关*************/ /*************axis相关*************/
AXISMOLD, AXISMOLD,
@ -48,10 +47,12 @@ enum READTYPE {
LOADPARAMRSP, //装载参数 LOADPARAMRSP, //装载参数
SCANCTRLSTATE, //BaseCtrl参数
SCANCTRLPARAM, //scanctrl参数
XYSCANSTATE, //XYScanState参数 在参数更新的时候才会发送到客户端
SCANCTRLSTATE, //scanctrl参数 TEST = 1000, //test
}; };
enum DATATYPE { enum DATATYPE {
@ -89,41 +90,7 @@ enum WRITETYPE {
GET = 0, GET = 0,
SET, SET,
AXISMOVEFUNC, //轴运动函数 AXISMOVEFUNC, //轴运动函数
//LOADIN, //载入
//LOADOUT, //载出
//INTERCEPTLOAD, //中断载入/载出
//SUPPLYAXLEAFTER, //供粉轴后移
//SUPPLYAXLEFRONT, //供粉轴前移
//SUPPLYAXLEAFTERCONTSTART, //供粉轴后移连续开始
//SUPPLYAXLEAFTERCONTSTOP, //供粉轴后移连续停止
//SUPPLYAXLEFRONTCONTSTART, //供粉轴前移连续开始
//SUPPLYAXLEFRONTCONTSTOP, //供粉轴前移连续停止
//PAVEAXLEFRONT, // 铺粉臂前移
//PAVEAXLEFRONTCONTSTART, //铺粉臂前移连续
//PAVEAXLEFRONTCONTSTOP, //铺粉臂前移连续
//PAVEAXLEAFTER, //铺粉臂后移
//PAVEAXLEAFTERCONTSTART, //铺粉臂后移连续开始
//PAVEAXLEAFTERCONTSTOP, //铺粉臂后移连续停止
//PAVEAXLECLEAR, //铺粉臂清零
//PRINTAXLEUP, //成型缸上升
//PRINTAXLEUPCONTSTART, //成型缸连续上升开始
//PRINTAXLEUPCONTSTOP, //成型缸连续上升停止
//PRINTAXLEDOWN, //成型缸下降
//PRINTAXLEDOWNCONTSTART, //成型缸连续下降开始
//PRINTAXLEDOWNCONTSTOP, //成型缸连续下降停止
//PRINTAXLECLEAR, //成型缸清零
//TRANSFERAXIELEFT, //移载轴左移
//TRANSFERAXIELEFTCONTSTART, //移载轴连续左移开始
//TRANSFERAXIELEFTCONTSTOP, //移载轴连续左移停止
//TRANSFERAXIERIGHT, //移载轴右移
//TRANSFERAXIERIGHTCONTSTART, //移载轴连续右移开始
//TRANSFERAXIERIGHTCONTSTOP, //移载轴连续右移停止
//TRANSFERAXIECLEAR, //移载轴清零
SCANERSTART, //开始扫描
SCANERSTOP, //停止扫描
STARTHEATINGSCANNERTEST, //开始振镜预热测试
STOPHEATINGSCANNERTEST, //停止振镜预热
INITERRORINFOSREQ, //初始化错误信息
VERSIONREQ, //获取版本信息 VERSIONREQ, //获取版本信息
IOSIGNAL, //io 信号 IOSIGNAL, //io 信号
@ -140,6 +107,7 @@ enum WRITETYPE {
LOADPARAM, //装载参数 LOADPARAM, //装载参数
/********************振镜控制******************/ /********************振镜控制******************/
SCANCTRLFUNC, //振镜控制函数 SCANCTRLFUNC, //振镜控制函数

View File

@ -0,0 +1,152 @@
#pragma once
#include <winsock2.h>
#include <ws2tcpip.h>
#include<iostream>
#include<Windows.h>
#include<ipmib.h>
#include<winerror.h>
#include<iphlpapi.h>
#include<string>
#pragma comment(lib,"ws2_32.lib")
#pragma comment(lib, "iphlpapi.lib")
class LocalAddr {
private:
void FreeIpForwardTable(PMIB_IPFORWARDTABLE pIpRouteTab)
{
if (pIpRouteTab != NULL)
{
::GlobalFree(pIpRouteTab);
pIpRouteTab = NULL;
}
}
PMIB_IPFORWARDTABLE GetIpForwardTable(BOOL bOrder)
{
PMIB_IPFORWARDTABLE pIpRouteTab = NULL;
DWORD dwActualSize = 0;
// 查询所需缓冲区的大小
if (::GetIpForwardTable(pIpRouteTab, &dwActualSize, bOrder) == ERROR_INSUFFICIENT_BUFFER)
{
// 为MIB_IPFORWARDTABLE结构申请内存
pIpRouteTab = (PMIB_IPFORWARDTABLE)::GlobalAlloc(GPTR, dwActualSize);
// 获取路由表
if (::GetIpForwardTable(pIpRouteTab, &dwActualSize, bOrder) == NO_ERROR)
return pIpRouteTab;
::GlobalFree(pIpRouteTab);
}
return NULL;
}
public:
std::string GetSystemIpAddress()
{
std::string strLoalhostIp;
PMIB_IPFORWARDTABLE pIpRouteTable = GetIpForwardTable(TRUE);
if (pIpRouteTable != NULL)
{
DWORD dwCurrIndex;
struct in_addr inadDest;
struct in_addr inadMask;
struct in_addr inadGateway;
char szDestIp[128] = { 0 };
char szMaskIp[128] = { 0 };
char szGatewayIp[128] = { 0 };
DWORD IfIndex = 0;
DWORD ForwardMetric1 = 0;
if (pIpRouteTable->dwNumEntries > 0)
{
char ip[INET_ADDRSTRLEN] = {0};
for (DWORD i = 0; i < pIpRouteTable->dwNumEntries; i++){
dwCurrIndex = pIpRouteTable->table[i].dwForwardIfIndex;
// 目的地址
inadDest.s_addr = pIpRouteTable->table[i].dwForwardDest;
strcpy_s(szDestIp, sizeof(szDestIp), inet_ntop(AF_INET, &inadDest, ip, INET_ADDRSTRLEN));
// 子网掩码
inadMask.s_addr = pIpRouteTable->table[i].dwForwardMask;
strcpy_s(szMaskIp, sizeof(szDestIp), inet_ntop(AF_INET, &inadMask, ip, INET_ADDRSTRLEN));
// 网关地址
inadGateway.s_addr = pIpRouteTable->table[i].dwForwardNextHop;
strcpy_s(szGatewayIp, sizeof(szDestIp), inet_ntop(AF_INET, &inadGateway, ip, INET_ADDRSTRLEN));
if ((strcmp(szDestIp, "0.0.0.0") == 0) && (strcmp(szMaskIp, "0.0.0.0") == 0))
{
if (i == 0)
{
ForwardMetric1 = pIpRouteTable->table[i].dwForwardMetric1;
IfIndex = pIpRouteTable->table[i].dwForwardIfIndex;
struct in_addr inadDest;
inadDest.s_addr = pIpRouteTable->table[i].dwForwardDest;
}
else if (ForwardMetric1 > pIpRouteTable->table[i].dwForwardMetric1)
{
ForwardMetric1 = pIpRouteTable->table[i].dwForwardMetric1;
IfIndex = pIpRouteTable->table[i].dwForwardIfIndex;
struct in_addr inadDest;
inadDest.s_addr = pIpRouteTable->table[i].dwForwardDest;
}
}
}
}
else
{
FreeIpForwardTable(pIpRouteTable);
return "";
}
FreeIpForwardTable(pIpRouteTable);
if (IfIndex > 0)
{
DWORD ipdwSize = 0;
PBYTE m_pBuffer = new BYTE[MAX_PATH];
ULONG m_ulSize = MAX_PATH;
DWORD m_dwResult;
PMIB_IPADDRTABLE pAddrTable;
PMIB_IPADDRROW pAddrRow;
in_addr ia;
GetIpAddrTable((PMIB_IPADDRTABLE)m_pBuffer, &m_ulSize, TRUE);
delete[] m_pBuffer;
m_pBuffer = new BYTE[m_ulSize];
if (NULL != m_pBuffer)
{
m_dwResult = GetIpAddrTable((PMIB_IPADDRTABLE)m_pBuffer, &m_ulSize, TRUE);
if (m_dwResult == NO_ERROR)
{
pAddrTable = (PMIB_IPADDRTABLE)m_pBuffer;
for (DWORD x = 0; x < pAddrTable->dwNumEntries; ++x)
{
pAddrRow = (PMIB_IPADDRROW) & (pAddrTable->table[x]);
ia.S_un.S_addr = pAddrRow->dwAddr;
char IPMsg[100] = { 0 };
if (IfIndex == pAddrRow->dwIndex)
{
char ip[INET_ADDRSTRLEN] = {0};
LPCSTR psz = inet_ntop(AF_INET, &ia, ip, INET_ADDRSTRLEN);
if (psz)
{
strLoalhostIp = psz;
}
delete[] m_pBuffer;
return strLoalhostIp;
}
}
}
delete[] m_pBuffer;
}
}
}
else
{
FreeIpForwardTable(pIpRouteTable);
return "";
}
return "";
}
};