添加配置相关功能,FavoriteCfg
This commit is contained in:
parent
5143163d14
commit
67b2b0986a
@ -466,6 +466,7 @@ void ConfigManager::SendCfgToClients() {
|
||||
m_InfraredTempCfg.SendToClients(INFRAREDTEMPCFGPARAM);
|
||||
|
||||
m_MachineCfg.SendToClients(MACHINECFGPARAM);
|
||||
m_FavoriteCfg.SendToClients(FAVORITECFGPARAM);
|
||||
|
||||
|
||||
|
||||
|
@ -93,20 +93,20 @@ public:
|
||||
|
||||
RecoatCheckCfg* GetRecoatCheckCfg() { return &m_RecoatCheckCfg; }
|
||||
|
||||
HbdLanguage* GetLanguage(int id);
|
||||
void GetDefaultText(map<string,string>& textmap);
|
||||
HbdLanguage* GetLanguage(int id); //无用
|
||||
void GetDefaultText(map<string,string>& textmap); //无用
|
||||
|
||||
ParamSetCfg* GetParamSetCfg() { return &m_ParamSetCfg; }
|
||||
ParamSetCfg* GetParamSetCfg() { return &m_ParamSetCfg; } //传 困难
|
||||
//map<int, LaserCfg*>* GetLaserCfgMap() { return &m_pLaserCfgDao->m_LaserCfgMap; }
|
||||
//vector<LaserCfg*>* GetLaserCfgs() { return &m_pLaserCfgDao->m_LaserCfgs; }
|
||||
map<int, ScannerControlCfg*>* GetScannerControlCfg() { return &m_ScannerControlCfgDao->m_ScannerControlCfgMap; }
|
||||
vector<ScannerControlCfg*>* GetScannerControlCfgs() { return &m_ScannerControlCfgDao->m_ScannerControlCfgs; }
|
||||
vector<ScannerControlCfg*>* GetMatchScannerControlCfg() { return &m_ScannerControlCfgDao->m_MatchCfg; }
|
||||
ScannerControlCfgDao* GetScannerControlCfgDao() { return m_ScannerControlCfgDao; }
|
||||
ScannerControlCfgDao* GetScannerControlCfgDao() { return m_ScannerControlCfgDao; } //不用
|
||||
|
||||
//vector<LaserCfg*> *GetMatchLaser() { return &m_pLaserCfgDao->m_MatchLaser; }
|
||||
//LaserCfgDao* GetLaserCfgDao() { return m_pLaserCfgDao; }
|
||||
FavoriteCfg* GetFavoriteCfg() { return &m_FavoriteCfg; }
|
||||
FavoriteCfg* GetFavoriteCfg() { return &m_FavoriteCfg; } //已传
|
||||
FixPointDao* GetFixPointDao() { return m_ScannerControlCfgDao->GetFixPointDao(); }
|
||||
CameraCalibrationCfg* GetCameraCalibrationCfg() { return &m_CameraCalibrationCfg; }
|
||||
void SaveCameraCalibrationCfg() {
|
||||
|
@ -1,8 +1,11 @@
|
||||
#include "FavoriteCfg.h"
|
||||
#include "FavoriteCfg.h"
|
||||
#include "BaseConfig.h"
|
||||
|
||||
FavoriteCfg::FavoriteCfg()
|
||||
{}
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
FavoriteCfg::~FavoriteCfg()
|
||||
{}
|
||||
@ -35,4 +38,32 @@ void FavoriteCfg::Add(std::string name, std::string value)
|
||||
mFavoriteMap[name] = value;
|
||||
}
|
||||
|
||||
|
||||
void FavoriteCfg::UpdateSub(const ReadData& rd) {
|
||||
{
|
||||
std::unique_lock<std::shared_mutex> lock(m_mtx); //写锁
|
||||
if (rd.handleType == UPDATE) {
|
||||
mFavoriteMap[rd.nameKey] = rd.strValue;
|
||||
m_baseMp[rd.nameKey]->SetValue(rd.strValue);
|
||||
}
|
||||
else if (rd.handleType == ADD) {
|
||||
if (mFavoriteMap.find(rd.nameKey) == mFavoriteMap.end()) {
|
||||
mFavoriteMap[rd.nameKey] = rd.strValue;
|
||||
m_baseMp[rd.nameKey] = new StrData(rd.nameKey, u8"", rd.strValue);
|
||||
}
|
||||
else {
|
||||
mFavoriteMap[rd.nameKey] = rd.strValue;
|
||||
m_baseMp[rd.nameKey]->SetValue(rd.strValue);
|
||||
}
|
||||
}
|
||||
else if (rd.handleType == DEL) {
|
||||
if (mFavoriteMap.find(rd.nameKey) != mFavoriteMap.end()) {
|
||||
mFavoriteMap.erase(rd.nameKey);
|
||||
DelMp(rd.nameKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
SendToClients(FAVORITECFGPARAM); //客户端更新后在发送给客户端
|
||||
}
|
||||
|
||||
string FavoriteCfg::CONFIG_NAME ="Favorite";
|
||||
|
@ -1,10 +1,11 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "../Controller/Base.h"
|
||||
|
||||
class FavoriteCfg
|
||||
class FavoriteCfg :public Base
|
||||
{
|
||||
public:
|
||||
FavoriteCfg();
|
||||
@ -12,6 +13,8 @@ public:
|
||||
void GetUpdateSql(std::vector<std::string>& ups);
|
||||
void Add(std::string name, std::string value);
|
||||
|
||||
void UpdateSub(const ReadData& rd);
|
||||
|
||||
public:
|
||||
static std::string CONFIG_NAME;
|
||||
std::map<std::string, std::string> mFavoriteMap;
|
||||
|
@ -1558,6 +1558,12 @@ void BaseConfigDao::FindFavoriteCfg(FavoriteCfg& fcfg)
|
||||
{
|
||||
map<string, string> valuemap;
|
||||
FindValue(FavoriteCfg::CONFIG_NAME, fcfg.mFavoriteMap);
|
||||
|
||||
auto item = fcfg.mFavoriteMap.begin();
|
||||
while (item != fcfg.mFavoriteMap.end()) {
|
||||
BaseData* p = new StrData(item->first, u8"", item->second);
|
||||
fcfg.InsertMp(item->first,p);
|
||||
}
|
||||
}
|
||||
|
||||
void BaseConfigDao::FindPowderEstimate(PowderEstimateCfg& cfg)
|
||||
|
@ -26,7 +26,16 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
void DelMp(const std::string& key) {
|
||||
std::unique_lock<std::shared_mutex> lock(m_mtx);
|
||||
if (m_baseMp.find(key) != m_baseMp.end()) {
|
||||
m_baseMp.erase(key);
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
void InsertMp(const std::string& key, BaseData* baseData, const std::string& suff = "") {
|
||||
std::unique_lock<std::shared_mutex> lock(m_mtx);
|
||||
if (m_baseMp.find(key) != m_baseMp.end()) {
|
||||
printf("%s is repeated...\n", key.data());
|
||||
}
|
||||
|
@ -129,13 +129,16 @@ void DataHandle::DataCallBackHandle(const ReadData& msg) {
|
||||
case MACHINECFG:
|
||||
ConfigManager::GetInstance()->GetMachineCfg()->Update(msg, MACHINECFGPARAM);
|
||||
break;
|
||||
case FAVORITECFG:
|
||||
ConfigManager::GetInstance()->GetFavoriteCfg()->UpdateSub(msg);
|
||||
break;
|
||||
case REQUEST:
|
||||
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));
|
||||
//}
|
||||
if (ConverType::TryToI( msg.nameKey) == XYSCANSTATE) {
|
||||
printf("error,40 需要释放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(); //发送配置到客户端
|
||||
|
@ -26,6 +26,7 @@ enum READTYPE {
|
||||
RUNCFG,
|
||||
INFRAREDTEMPCFG,
|
||||
MACHINECFG,
|
||||
FAVORITECFG,
|
||||
|
||||
LOADPARAM, //装载参数
|
||||
|
||||
@ -51,12 +52,19 @@ enum DATATYPE {
|
||||
UNKNOW,
|
||||
};
|
||||
|
||||
enum DATAHANDLE {
|
||||
UPDATE = 0,
|
||||
ADD,
|
||||
DEL,
|
||||
};
|
||||
|
||||
class ClientInfo;
|
||||
struct ReadData {
|
||||
READTYPE dataType;
|
||||
std::string nameKey; //参数key
|
||||
std::string strValue; //value
|
||||
DATATYPE valueType;
|
||||
DATAHANDLE handleType; //增删改
|
||||
ClientInfo* clientPtr;
|
||||
};
|
||||
|
||||
@ -98,6 +106,7 @@ enum WRITETYPE {
|
||||
RUNCFGPARAM, //runcfg 参数
|
||||
INFRAREDTEMPCFGPARAM, //InfraredTempCfg 参数
|
||||
MACHINECFGPARAM, //MachineCfg 参数
|
||||
FAVORITECFGPARAM, //FavoriteCfg 参数
|
||||
|
||||
MOLDCFGPARAM,
|
||||
LOADCFGPARAM,
|
||||
|
@ -52,6 +52,7 @@ Status StreamServer::AllStream(ServerContext* context, grpc::ServerReaderWriter<
|
||||
readData.nameKey = request.namekey();
|
||||
readData.strValue = request.strvalue();
|
||||
readData.valueType = (DATATYPE)request.valuetype();
|
||||
readData.handleType = (DATAHANDLE)request.handletype();
|
||||
readData.clientPtr = cinfo;
|
||||
|
||||
printf("客户端消息:dataType:%d,nameKey:%s, strValue:%s,valueType:%d\n",
|
||||
|
@ -41,7 +41,7 @@ void HBDSystem::Init() {
|
||||
#ifdef _DEBUG
|
||||
g_isDebug = true;
|
||||
#else
|
||||
g_isDebug = false;
|
||||
g_isDebug = true;
|
||||
#endif
|
||||
|
||||
g_LngManager = new LanguageManager();
|
||||
|
@ -149,12 +149,6 @@
|
||||
<ClCompile Include="DataManage\DataHandle.cpp">
|
||||
<Filter>DataManage</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="protobuf\stream.grpc.pb.cc">
|
||||
<Filter>protobuf</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="protobuf\stream.pb.cc">
|
||||
<Filter>protobuf</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PLC\CoreCommunication.cpp">
|
||||
<Filter>PLC</Filter>
|
||||
</ClCompile>
|
||||
@ -762,6 +756,12 @@
|
||||
<ClCompile Include="Communication\PowderCarClient.cpp">
|
||||
<Filter>Communication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="protobuf\stream.grpc.pb.cc">
|
||||
<Filter>protobuf</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="protobuf\stream.pb.cc">
|
||||
<Filter>protobuf</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="protobuf\stream.proto">
|
||||
@ -781,12 +781,6 @@
|
||||
<ClInclude Include="DataManage\DataHandle.h">
|
||||
<Filter>DataManage</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="protobuf\stream.grpc.pb.h">
|
||||
<Filter>protobuf</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="protobuf\stream.pb.h">
|
||||
<Filter>protobuf</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="PLC\CoreCommunication.h">
|
||||
<Filter>PLC</Filter>
|
||||
</ClInclude>
|
||||
@ -1897,6 +1891,12 @@
|
||||
<ClInclude Include="Communication\PowderCarClient.h">
|
||||
<Filter>Communication</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="protobuf\stream.grpc.pb.h">
|
||||
<Filter>protobuf</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="protobuf\stream.pb.h">
|
||||
<Filter>protobuf</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="说明.txt" />
|
||||
|
@ -76,7 +76,7 @@ bool ScannerCtrl::Init() {
|
||||
bool rel = false;
|
||||
unsigned int card_num = 0;
|
||||
|
||||
if (!RTC5Scanner::PreInit(card_num))
|
||||
if (!g_isDebug && !RTC5Scanner::PreInit(card_num))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -120,10 +120,10 @@ bool ScannerCtrl::Init() {
|
||||
g_log->TraceError(g_LngManager->Log_NoScannerCtrl->ShowText());
|
||||
m_InitErrorInfos.push_back(g_LngManager->Log_NoScannerCtrl->ShowText());
|
||||
|
||||
//for (int i = 0; i < 4; ++i) { //wxxtest
|
||||
// Scanner* scanner = new RTC5Scanner(nullptr, i);
|
||||
// m_scan.push_back(scanner);
|
||||
//}
|
||||
for (int i = 0; i < 4; ++i) { //wxxtest
|
||||
Scanner* scanner = new RTC5Scanner(nullptr, i);
|
||||
m_scan.push_back(scanner);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Binary file not shown.
@ -58,6 +58,7 @@ PROTOBUF_CONSTEXPR RequestInfo::RequestInfo(::_pbi::ConstantInitialized)
|
||||
},
|
||||
/*decltype(_impl_.datatype_)*/ 0u,
|
||||
/*decltype(_impl_.valuetype_)*/ 0,
|
||||
/*decltype(_impl_.handletype_)*/ 0,
|
||||
/*decltype(_impl_._cached_size_)*/ {},
|
||||
} {}
|
||||
struct RequestInfoDefaultTypeInternal {
|
||||
@ -235,7 +236,7 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
|
||||
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ImgInfoResponceDefaultTypeInternal _ImgInfoResponce_default_instance_;
|
||||
} // namespace stream
|
||||
static ::_pb::Metadata file_level_metadata_stream_2eproto[11];
|
||||
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_stream_2eproto[1];
|
||||
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_stream_2eproto[2];
|
||||
static constexpr const ::_pb::ServiceDescriptor**
|
||||
file_level_service_descriptors_stream_2eproto = nullptr;
|
||||
const ::uint32_t TableStruct_stream_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
|
||||
@ -263,6 +264,7 @@ const ::uint32_t TableStruct_stream_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE
|
||||
PROTOBUF_FIELD_OFFSET(::stream::RequestInfo, _impl_.namekey_),
|
||||
PROTOBUF_FIELD_OFFSET(::stream::RequestInfo, _impl_.strvalue_),
|
||||
PROTOBUF_FIELD_OFFSET(::stream::RequestInfo, _impl_.valuetype_),
|
||||
PROTOBUF_FIELD_OFFSET(::stream::RequestInfo, _impl_.handletype_),
|
||||
~0u, // no _has_bits_
|
||||
PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _internal_metadata_),
|
||||
~0u, // no _extensions_
|
||||
@ -369,15 +371,15 @@ static const ::_pbi::MigrationSchema
|
||||
schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
|
||||
{0, -1, -1, sizeof(::stream::ParamInfo)},
|
||||
{11, -1, -1, sizeof(::stream::RequestInfo)},
|
||||
{23, -1, -1, sizeof(::stream::ResponseInfo)},
|
||||
{34, 43, -1, sizeof(::stream::ResponseAny)},
|
||||
{44, -1, -1, sizeof(::stream::LayerData)},
|
||||
{57, -1, -1, sizeof(::stream::LayerDataBlock)},
|
||||
{71, -1, -1, sizeof(::stream::VectorDataBlock)},
|
||||
{83, -1, -1, sizeof(::stream::ChainDataBlock)},
|
||||
{93, -1, -1, sizeof(::stream::Point)},
|
||||
{103, -1, -1, sizeof(::stream::RegResponce)},
|
||||
{112, -1, -1, sizeof(::stream::ImgInfoResponce)},
|
||||
{24, -1, -1, sizeof(::stream::ResponseInfo)},
|
||||
{35, 44, -1, sizeof(::stream::ResponseAny)},
|
||||
{45, -1, -1, sizeof(::stream::LayerData)},
|
||||
{58, -1, -1, sizeof(::stream::LayerDataBlock)},
|
||||
{72, -1, -1, sizeof(::stream::VectorDataBlock)},
|
||||
{84, -1, -1, sizeof(::stream::ChainDataBlock)},
|
||||
{94, -1, -1, sizeof(::stream::Point)},
|
||||
{104, -1, -1, sizeof(::stream::RegResponce)},
|
||||
{113, -1, -1, sizeof(::stream::ImgInfoResponce)},
|
||||
};
|
||||
|
||||
static const ::_pb::Message* const file_default_instances[] = {
|
||||
@ -397,38 +399,41 @@ const char descriptor_table_protodef_stream_2eproto[] PROTOBUF_SECTION_VARIABLE(
|
||||
"\n\014stream.proto\022\006stream\032\031google/protobuf/"
|
||||
"any.proto\"O\n\tParamInfo\022\017\n\007nameKey\030\001 \001(\014\022"
|
||||
"\020\n\010strValue\030\002 \001(\014\022\037\n\tvalueType\030\003 \001(\0162\014.s"
|
||||
"tream.TYPE\"c\n\013RequestInfo\022\020\n\010dataType\030\001 "
|
||||
"\001(\r\022\017\n\007nameKey\030\002 \001(\014\022\020\n\010strValue\030\003 \001(\014\022\037"
|
||||
"\n\tvalueType\030\004 \001(\0162\014.stream.TYPE\"Q\n\014Respo"
|
||||
"nseInfo\022\020\n\010dataType\030\001 \001(\r\022\016\n\006result\030\002 \001("
|
||||
"\010\022\037\n\004item\030\003 \003(\0132\021.stream.ParamInfo\"1\n\013Re"
|
||||
"sponseAny\022\"\n\004data\030\001 \001(\0132\024.google.protobu"
|
||||
"f.Any\"\210\001\n\tLayerData\022\023\n\013zCooldinate\030\001 \001(\002"
|
||||
"\022\016\n\006powder\030\002 \001(\002\022\026\n\016layerThickness\030\003 \001(\002"
|
||||
"\022.\n\016layerDataBlock\030\004 \003(\0132\026.stream.LayerD"
|
||||
"ataBlock\022\016\n\006result\030\005 \001(\010\"\266\001\n\016LayerDataBl"
|
||||
"ock\022\021\n\telementId\030\001 \001(\005\022\026\n\016elementParamId"
|
||||
"\030\002 \001(\005\022\021\n\tblockType\030\003 \001(\r\022*\n\tvecBlocks\030\004"
|
||||
" \003(\0132\027.stream.VectorDataBlock\022+\n\013chainBl"
|
||||
"ocks\030\005 \003(\0132\026.stream.ChainDataBlock\022\r\n\005or"
|
||||
"der\030\006 \001(\r\"M\n\017VectorDataBlock\022\016\n\006startX\030\001"
|
||||
" \001(\002\022\016\n\006startY\030\002 \001(\002\022\014\n\004endX\030\003 \001(\002\022\014\n\004en"
|
||||
"dY\030\004 \001(\002\"A\n\016ChainDataBlock\022\016\n\006dotNum\030\001 \001"
|
||||
"(\r\022\037\n\010pointVec\030\002 \003(\0132\r.stream.Point\"#\n\005P"
|
||||
"oint\022\014\n\004xPos\030\001 \001(\002\022\014\n\004yPos\030\002 \001(\002\"\033\n\013RegR"
|
||||
"esponce\022\014\n\004data\030\001 \001(\005\"D\n\017ImgInfoResponce"
|
||||
"\022\022\n\nlevelImage\030\001 \001(\r\022\r\n\005width\030\002 \001(\005\022\016\n\006h"
|
||||
"eight\030\003 \001(\005*X\n\004TYPE\022\t\n\005iBOOL\020\000\022\n\n\006iSHORT"
|
||||
"\020\001\022\013\n\007iUSHORT\020\002\022\010\n\004iINT\020\003\022\t\n\005iUINT\020\004\022\n\n\006"
|
||||
"iFLOAT\020\005\022\013\n\007iSTRING\020\0062\372\001\n\006Stream\0224\n\006Simp"
|
||||
"le\022\023.stream.RequestInfo\032\023.stream.Respons"
|
||||
"eAny\"\000\022=\n\014ServerStream\022\023.stream.RequestI"
|
||||
"nfo\032\024.stream.ResponseInfo\"\0000\001\022=\n\014ClientS"
|
||||
"tream\022\023.stream.RequestInfo\032\024.stream.Resp"
|
||||
"onseInfo\"\000(\001\022<\n\tAllStream\022\023.stream.Reque"
|
||||
"stInfo\032\024.stream.ResponseInfo\"\000(\0010\001B-\n\027io"
|
||||
".grpc.examples.streamB\013StreamProtoP\001\242\002\002S"
|
||||
"Tb\006proto3"
|
||||
"tream.TYPE\"\213\001\n\013RequestInfo\022\020\n\010dataType\030\001"
|
||||
" \001(\r\022\017\n\007nameKey\030\002 \001(\014\022\020\n\010strValue\030\003 \001(\014\022"
|
||||
"\037\n\tvalueType\030\004 \001(\0162\014.stream.TYPE\022&\n\nhand"
|
||||
"leType\030\005 \001(\0162\022.stream.DATAHANDLE\"Q\n\014Resp"
|
||||
"onseInfo\022\020\n\010dataType\030\001 \001(\r\022\016\n\006result\030\002 \001"
|
||||
"(\010\022\037\n\004item\030\003 \003(\0132\021.stream.ParamInfo\"1\n\013R"
|
||||
"esponseAny\022\"\n\004data\030\001 \001(\0132\024.google.protob"
|
||||
"uf.Any\"\210\001\n\tLayerData\022\023\n\013zCooldinate\030\001 \001("
|
||||
"\002\022\016\n\006powder\030\002 \001(\002\022\026\n\016layerThickness\030\003 \001("
|
||||
"\002\022.\n\016layerDataBlock\030\004 \003(\0132\026.stream.Layer"
|
||||
"DataBlock\022\016\n\006result\030\005 \001(\010\"\266\001\n\016LayerDataB"
|
||||
"lock\022\021\n\telementId\030\001 \001(\005\022\026\n\016elementParamI"
|
||||
"d\030\002 \001(\005\022\021\n\tblockType\030\003 \001(\r\022*\n\tvecBlocks\030"
|
||||
"\004 \003(\0132\027.stream.VectorDataBlock\022+\n\013chainB"
|
||||
"locks\030\005 \003(\0132\026.stream.ChainDataBlock\022\r\n\005o"
|
||||
"rder\030\006 \001(\r\"M\n\017VectorDataBlock\022\016\n\006startX\030"
|
||||
"\001 \001(\002\022\016\n\006startY\030\002 \001(\002\022\014\n\004endX\030\003 \001(\002\022\014\n\004e"
|
||||
"ndY\030\004 \001(\002\"A\n\016ChainDataBlock\022\016\n\006dotNum\030\001 "
|
||||
"\001(\r\022\037\n\010pointVec\030\002 \003(\0132\r.stream.Point\"#\n\005"
|
||||
"Point\022\014\n\004xPos\030\001 \001(\002\022\014\n\004yPos\030\002 \001(\002\"\033\n\013Reg"
|
||||
"Responce\022\014\n\004data\030\001 \001(\005\"D\n\017ImgInfoResponc"
|
||||
"e\022\022\n\nlevelImage\030\001 \001(\r\022\r\n\005width\030\002 \001(\005\022\016\n\006"
|
||||
"height\030\003 \001(\005*\223\001\n\004TYPE\022\t\n\005iBOOL\020\000\022\n\n\006iSHO"
|
||||
"RT\020\001\022\013\n\007iUSHORT\020\002\022\010\n\004iINT\020\003\022\t\n\005iUINT\020\004\022\n"
|
||||
"\n\006iFLOAT\020\005\022\013\n\007iSTRING\020\006\022\t\n\005iCHAR\020\007\022\n\n\006iU"
|
||||
"CHAR\020\010\022\t\n\005iWORD\020\t\022\013\n\007iDOUBLE\020\n\022\n\n\006iTIMET"
|
||||
"\020\013**\n\nDATAHANDLE\022\n\n\006UPDATE\020\000\022\007\n\003ADD\020\001\022\007\n"
|
||||
"\003DEL\020\0022\372\001\n\006Stream\0224\n\006Simple\022\023.stream.Req"
|
||||
"uestInfo\032\023.stream.ResponseAny\"\000\022=\n\014Serve"
|
||||
"rStream\022\023.stream.RequestInfo\032\024.stream.Re"
|
||||
"sponseInfo\"\0000\001\022=\n\014ClientStream\022\023.stream."
|
||||
"RequestInfo\032\024.stream.ResponseInfo\"\000(\001\022<\n"
|
||||
"\tAllStream\022\023.stream.RequestInfo\032\024.stream"
|
||||
".ResponseInfo\"\000(\0010\001B-\n\027io.grpc.examples."
|
||||
"streamB\013StreamProtoP\001\242\002\002STb\006proto3"
|
||||
};
|
||||
static const ::_pbi::DescriptorTable* const descriptor_table_stream_2eproto_deps[1] =
|
||||
{
|
||||
@ -438,7 +443,7 @@ static ::absl::once_flag descriptor_table_stream_2eproto_once;
|
||||
const ::_pbi::DescriptorTable descriptor_table_stream_2eproto = {
|
||||
false,
|
||||
false,
|
||||
1369,
|
||||
1514,
|
||||
descriptor_table_protodef_stream_2eproto,
|
||||
"stream.proto",
|
||||
&descriptor_table_stream_2eproto_once,
|
||||
@ -484,6 +489,25 @@ bool TYPE_IsValid(int value) {
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
const ::google::protobuf::EnumDescriptor* DATAHANDLE_descriptor() {
|
||||
::google::protobuf::internal::AssignDescriptors(&descriptor_table_stream_2eproto);
|
||||
return file_level_enum_descriptors_stream_2eproto[1];
|
||||
}
|
||||
bool DATAHANDLE_IsValid(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@ -760,6 +784,7 @@ RequestInfo::RequestInfo(const RequestInfo& from) : ::google::protobuf::Message(
|
||||
decltype(_impl_.strvalue_){},
|
||||
decltype(_impl_.datatype_){},
|
||||
decltype(_impl_.valuetype_){},
|
||||
decltype(_impl_.handletype_){},
|
||||
/*decltype(_impl_._cached_size_)*/ {},
|
||||
};
|
||||
_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(
|
||||
@ -779,8 +804,8 @@ RequestInfo::RequestInfo(const RequestInfo& from) : ::google::protobuf::Message(
|
||||
_this->_impl_.strvalue_.Set(from._internal_strvalue(), _this->GetArenaForAllocation());
|
||||
}
|
||||
::memcpy(&_impl_.datatype_, &from._impl_.datatype_,
|
||||
static_cast<::size_t>(reinterpret_cast<char*>(&_impl_.valuetype_) -
|
||||
reinterpret_cast<char*>(&_impl_.datatype_)) + sizeof(_impl_.valuetype_));
|
||||
static_cast<::size_t>(reinterpret_cast<char*>(&_impl_.handletype_) -
|
||||
reinterpret_cast<char*>(&_impl_.datatype_)) + sizeof(_impl_.handletype_));
|
||||
|
||||
// @@protoc_insertion_point(copy_constructor:stream.RequestInfo)
|
||||
}
|
||||
@ -791,6 +816,7 @@ inline void RequestInfo::SharedCtor(::_pb::Arena* arena) {
|
||||
decltype(_impl_.strvalue_){},
|
||||
decltype(_impl_.datatype_){0u},
|
||||
decltype(_impl_.valuetype_){0},
|
||||
decltype(_impl_.handletype_){0},
|
||||
/*decltype(_impl_._cached_size_)*/ {},
|
||||
};
|
||||
_impl_.namekey_.InitDefault();
|
||||
@ -825,8 +851,8 @@ PROTOBUF_NOINLINE void RequestInfo::Clear() {
|
||||
_impl_.namekey_.ClearToEmpty();
|
||||
_impl_.strvalue_.ClearToEmpty();
|
||||
::memset(&_impl_.datatype_, 0, static_cast<::size_t>(
|
||||
reinterpret_cast<char*>(&_impl_.valuetype_) -
|
||||
reinterpret_cast<char*>(&_impl_.datatype_)) + sizeof(_impl_.valuetype_));
|
||||
reinterpret_cast<char*>(&_impl_.handletype_) -
|
||||
reinterpret_cast<char*>(&_impl_.datatype_)) + sizeof(_impl_.handletype_));
|
||||
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
|
||||
}
|
||||
|
||||
@ -838,23 +864,21 @@ const char* RequestInfo::_InternalParse(
|
||||
|
||||
|
||||
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
|
||||
const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = {
|
||||
const ::_pbi::TcParseTable<3, 5, 0, 0, 2> RequestInfo::_table_ = {
|
||||
{
|
||||
0, // no _has_bits_
|
||||
0, // no _extensions_
|
||||
4, 24, // max_field_number, fast_idx_mask
|
||||
5, 56, // max_field_number, fast_idx_mask
|
||||
offsetof(decltype(_table_), field_lookup_table),
|
||||
4294967280, // skipmap
|
||||
4294967264, // skipmap
|
||||
offsetof(decltype(_table_), field_entries),
|
||||
4, // num_field_entries
|
||||
5, // num_field_entries
|
||||
0, // num_aux_entries
|
||||
offsetof(decltype(_table_), field_names), // no aux_entries
|
||||
&_RequestInfo_default_instance_._instance,
|
||||
::_pbi::TcParser::GenericFallback, // fallback
|
||||
}, {{
|
||||
// .stream.TYPE valueType = 4;
|
||||
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(RequestInfo, _impl_.valuetype_), 63>(),
|
||||
{32, 63, 0, PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.valuetype_)}},
|
||||
{::_pbi::TcParser::MiniParse, {}},
|
||||
// uint32 dataType = 1;
|
||||
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(RequestInfo, _impl_.datatype_), 63>(),
|
||||
{8, 63, 0, PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.datatype_)}},
|
||||
@ -864,6 +888,14 @@ const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = {
|
||||
// bytes strValue = 3;
|
||||
{::_pbi::TcParser::FastBS1,
|
||||
{26, 63, 0, PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.strvalue_)}},
|
||||
// .stream.TYPE valueType = 4;
|
||||
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(RequestInfo, _impl_.valuetype_), 63>(),
|
||||
{32, 63, 0, PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.valuetype_)}},
|
||||
// .stream.DATAHANDLE handleType = 5;
|
||||
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(RequestInfo, _impl_.handletype_), 63>(),
|
||||
{40, 63, 0, PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.handletype_)}},
|
||||
{::_pbi::TcParser::MiniParse, {}},
|
||||
{::_pbi::TcParser::MiniParse, {}},
|
||||
}}, {{
|
||||
65535, 65535
|
||||
}}, {{
|
||||
@ -879,6 +911,9 @@ const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = {
|
||||
// .stream.TYPE valueType = 4;
|
||||
{PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.valuetype_), 0, 0,
|
||||
(0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)},
|
||||
// .stream.DATAHANDLE handleType = 5;
|
||||
{PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.handletype_), 0, 0,
|
||||
(0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)},
|
||||
}},
|
||||
// no aux_entries
|
||||
{{
|
||||
@ -918,6 +953,13 @@ const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = {
|
||||
4, this->_internal_valuetype(), target);
|
||||
}
|
||||
|
||||
// .stream.DATAHANDLE handleType = 5;
|
||||
if (this->_internal_handletype() != 0) {
|
||||
target = stream->EnsureSpace(target);
|
||||
target = ::_pbi::WireFormatLite::WriteEnumToArray(
|
||||
5, this->_internal_handletype(), target);
|
||||
}
|
||||
|
||||
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
|
||||
target =
|
||||
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
|
||||
@ -959,6 +1001,12 @@ const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = {
|
||||
::_pbi::WireFormatLite::EnumSize(this->_internal_valuetype());
|
||||
}
|
||||
|
||||
// .stream.DATAHANDLE handleType = 5;
|
||||
if (this->_internal_handletype() != 0) {
|
||||
total_size += 1 +
|
||||
::_pbi::WireFormatLite::EnumSize(this->_internal_handletype());
|
||||
}
|
||||
|
||||
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
|
||||
}
|
||||
|
||||
@ -989,6 +1037,9 @@ void RequestInfo::MergeImpl(::google::protobuf::Message& to_msg, const ::google:
|
||||
if (from._internal_valuetype() != 0) {
|
||||
_this->_internal_set_valuetype(from._internal_valuetype());
|
||||
}
|
||||
if (from._internal_handletype() != 0) {
|
||||
_this->_internal_set_handletype(from._internal_handletype());
|
||||
}
|
||||
_this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_);
|
||||
}
|
||||
|
||||
@ -1013,8 +1064,8 @@ void RequestInfo::InternalSwap(RequestInfo* other) {
|
||||
::_pbi::ArenaStringPtr::InternalSwap(&_impl_.strvalue_, lhs_arena,
|
||||
&other->_impl_.strvalue_, rhs_arena);
|
||||
::google::protobuf::internal::memswap<
|
||||
PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.valuetype_)
|
||||
+ sizeof(RequestInfo::_impl_.valuetype_)
|
||||
PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.handletype_)
|
||||
+ sizeof(RequestInfo::_impl_.handletype_)
|
||||
- PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.datatype_)>(
|
||||
reinterpret_cast<char*>(&_impl_.datatype_),
|
||||
reinterpret_cast<char*>(&other->_impl_.datatype_));
|
||||
|
@ -104,6 +104,11 @@ enum TYPE : int {
|
||||
iUINT = 4,
|
||||
iFLOAT = 5,
|
||||
iSTRING = 6,
|
||||
iCHAR = 7,
|
||||
iUCHAR = 8,
|
||||
iWORD = 9,
|
||||
iDOUBLE = 10,
|
||||
iTIMET = 11,
|
||||
TYPE_INT_MIN_SENTINEL_DO_NOT_USE_ =
|
||||
std::numeric_limits<::int32_t>::min(),
|
||||
TYPE_INT_MAX_SENTINEL_DO_NOT_USE_ =
|
||||
@ -112,8 +117,8 @@ enum TYPE : int {
|
||||
|
||||
bool TYPE_IsValid(int value);
|
||||
constexpr TYPE TYPE_MIN = static_cast<TYPE>(0);
|
||||
constexpr TYPE TYPE_MAX = static_cast<TYPE>(6);
|
||||
constexpr int TYPE_ARRAYSIZE = 6 + 1;
|
||||
constexpr TYPE TYPE_MAX = static_cast<TYPE>(11);
|
||||
constexpr int TYPE_ARRAYSIZE = 11 + 1;
|
||||
const ::google::protobuf::EnumDescriptor*
|
||||
TYPE_descriptor();
|
||||
template <typename T>
|
||||
@ -126,13 +131,46 @@ const std::string& TYPE_Name(T value) {
|
||||
template <>
|
||||
inline const std::string& TYPE_Name(TYPE value) {
|
||||
return ::google::protobuf::internal::NameOfDenseEnum<TYPE_descriptor,
|
||||
0, 6>(
|
||||
0, 11>(
|
||||
static_cast<int>(value));
|
||||
}
|
||||
inline bool TYPE_Parse(absl::string_view name, TYPE* value) {
|
||||
return ::google::protobuf::internal::ParseNamedEnum<TYPE>(
|
||||
TYPE_descriptor(), name, value);
|
||||
}
|
||||
enum DATAHANDLE : int {
|
||||
UPDATE = 0,
|
||||
ADD = 1,
|
||||
DEL = 2,
|
||||
DATAHANDLE_INT_MIN_SENTINEL_DO_NOT_USE_ =
|
||||
std::numeric_limits<::int32_t>::min(),
|
||||
DATAHANDLE_INT_MAX_SENTINEL_DO_NOT_USE_ =
|
||||
std::numeric_limits<::int32_t>::max(),
|
||||
};
|
||||
|
||||
bool DATAHANDLE_IsValid(int value);
|
||||
constexpr DATAHANDLE DATAHANDLE_MIN = static_cast<DATAHANDLE>(0);
|
||||
constexpr DATAHANDLE DATAHANDLE_MAX = static_cast<DATAHANDLE>(2);
|
||||
constexpr int DATAHANDLE_ARRAYSIZE = 2 + 1;
|
||||
const ::google::protobuf::EnumDescriptor*
|
||||
DATAHANDLE_descriptor();
|
||||
template <typename T>
|
||||
const std::string& DATAHANDLE_Name(T value) {
|
||||
static_assert(std::is_same<T, DATAHANDLE>::value ||
|
||||
std::is_integral<T>::value,
|
||||
"Incorrect type passed to DATAHANDLE_Name().");
|
||||
return DATAHANDLE_Name(static_cast<DATAHANDLE>(value));
|
||||
}
|
||||
template <>
|
||||
inline const std::string& DATAHANDLE_Name(DATAHANDLE value) {
|
||||
return ::google::protobuf::internal::NameOfDenseEnum<DATAHANDLE_descriptor,
|
||||
0, 2>(
|
||||
static_cast<int>(value));
|
||||
}
|
||||
inline bool DATAHANDLE_Parse(absl::string_view name, DATAHANDLE* value) {
|
||||
return ::google::protobuf::internal::ParseNamedEnum<DATAHANDLE>(
|
||||
DATAHANDLE_descriptor(), name, value);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
|
||||
@ -465,6 +503,7 @@ class RequestInfo final :
|
||||
kStrValueFieldNumber = 3,
|
||||
kDataTypeFieldNumber = 1,
|
||||
kValueTypeFieldNumber = 4,
|
||||
kHandleTypeFieldNumber = 5,
|
||||
};
|
||||
// bytes nameKey = 2;
|
||||
void clear_namekey() ;
|
||||
@ -517,13 +556,23 @@ class RequestInfo final :
|
||||
::stream::TYPE _internal_valuetype() const;
|
||||
void _internal_set_valuetype(::stream::TYPE value);
|
||||
|
||||
public:
|
||||
// .stream.DATAHANDLE handleType = 5;
|
||||
void clear_handletype() ;
|
||||
::stream::DATAHANDLE handletype() const;
|
||||
void set_handletype(::stream::DATAHANDLE value);
|
||||
|
||||
private:
|
||||
::stream::DATAHANDLE _internal_handletype() const;
|
||||
void _internal_set_handletype(::stream::DATAHANDLE value);
|
||||
|
||||
public:
|
||||
// @@protoc_insertion_point(class_scope:stream.RequestInfo)
|
||||
private:
|
||||
class _Internal;
|
||||
|
||||
friend class ::google::protobuf::internal::TcParser;
|
||||
static const ::google::protobuf::internal::TcParseTable<2, 4, 0, 0, 2> _table_;
|
||||
static const ::google::protobuf::internal::TcParseTable<3, 5, 0, 0, 2> _table_;
|
||||
template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
|
||||
typedef void InternalArenaConstructable_;
|
||||
typedef void DestructorSkippable_;
|
||||
@ -532,6 +581,7 @@ class RequestInfo final :
|
||||
::google::protobuf::internal::ArenaStringPtr strvalue_;
|
||||
::uint32_t datatype_;
|
||||
int valuetype_;
|
||||
int handletype_;
|
||||
mutable ::google::protobuf::internal::CachedSize _cached_size_;
|
||||
PROTOBUF_TSAN_DECLARE_MEMBER
|
||||
};
|
||||
@ -2513,6 +2563,28 @@ inline void RequestInfo::_internal_set_valuetype(::stream::TYPE value) {
|
||||
_impl_.valuetype_ = value;
|
||||
}
|
||||
|
||||
// .stream.DATAHANDLE handleType = 5;
|
||||
inline void RequestInfo::clear_handletype() {
|
||||
_impl_.handletype_ = 0;
|
||||
}
|
||||
inline ::stream::DATAHANDLE RequestInfo::handletype() const {
|
||||
// @@protoc_insertion_point(field_get:stream.RequestInfo.handleType)
|
||||
return _internal_handletype();
|
||||
}
|
||||
inline void RequestInfo::set_handletype(::stream::DATAHANDLE value) {
|
||||
_internal_set_handletype(value);
|
||||
// @@protoc_insertion_point(field_set:stream.RequestInfo.handleType)
|
||||
}
|
||||
inline ::stream::DATAHANDLE RequestInfo::_internal_handletype() const {
|
||||
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
|
||||
return static_cast<::stream::DATAHANDLE>(_impl_.handletype_);
|
||||
}
|
||||
inline void RequestInfo::_internal_set_handletype(::stream::DATAHANDLE value) {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
;
|
||||
_impl_.handletype_ = value;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// ResponseInfo
|
||||
@ -3350,6 +3422,12 @@ template <>
|
||||
inline const EnumDescriptor* GetEnumDescriptor<::stream::TYPE>() {
|
||||
return ::stream::TYPE_descriptor();
|
||||
}
|
||||
template <>
|
||||
struct is_proto_enum<::stream::DATAHANDLE> : std::true_type {};
|
||||
template <>
|
||||
inline const EnumDescriptor* GetEnumDescriptor<::stream::DATAHANDLE>() {
|
||||
return ::stream::DATAHANDLE_descriptor();
|
||||
}
|
||||
|
||||
} // namespace protobuf
|
||||
} // namespace google
|
||||
|
@ -20,6 +20,17 @@ enum TYPE{
|
||||
iUINT = 4;
|
||||
iFLOAT = 5;
|
||||
iSTRING = 6;
|
||||
iCHAR = 7;
|
||||
iUCHAR = 8;
|
||||
iWORD = 9;
|
||||
iDOUBLE = 10;
|
||||
iTIMET = 11;
|
||||
}
|
||||
|
||||
enum DATAHANDLE {
|
||||
UPDATE = 0;
|
||||
ADD = 1;
|
||||
DEL = 2;
|
||||
}
|
||||
|
||||
/*==================begin 通用通信结构体====================*/
|
||||
@ -32,11 +43,11 @@ message ParamInfo{
|
||||
}
|
||||
|
||||
message RequestInfo {
|
||||
|
||||
uint32 dataType = 1; //信息类型
|
||||
bytes nameKey = 2; //参数key
|
||||
bytes strValue = 3; //value值
|
||||
TYPE valueType = 4; //value数据类型
|
||||
DATAHANDLE handleType = 5; //增删改
|
||||
}
|
||||
|
||||
message ResponseInfo {
|
||||
@ -47,6 +58,7 @@ message ResponseInfo {
|
||||
|
||||
/*==================end 通用通信结构体====================*/
|
||||
|
||||
|
||||
message ResponseAny{
|
||||
google.protobuf.Any data = 1;
|
||||
}
|
||||
|
@ -58,13 +58,14 @@ void DataHandle::Stop() {
|
||||
DELP(m_streamClient);
|
||||
}
|
||||
|
||||
void DataHandle::PushMsg(WRITETYPE dataType, const string& nameKey, const string& strValue, DATATYPE valueType) {
|
||||
void DataHandle::PushMsg(WRITETYPE dataType, const string& nameKey, const string& strValue, DATATYPE valueType, DATAHANDLE handleType) {
|
||||
if (m_streamClient) {
|
||||
WriteData msg;
|
||||
msg.dataType = dataType;
|
||||
msg.nameKey = nameKey;
|
||||
msg.strValue = strValue;
|
||||
msg.valueType = valueType;
|
||||
msg.handleType = handleType;
|
||||
m_streamClient->PushMsg(msg);
|
||||
}
|
||||
}
|
||||
@ -80,7 +81,7 @@ void DataHandle::PrintValue(const ReadData& msg){
|
||||
++it;
|
||||
}
|
||||
printf("共有参数%zd个...\n", msg.its.size());
|
||||
if(m_printIndex == 9 || m_printIndex == 36){
|
||||
if(m_printIndex == LASERPARAM || m_printIndex == XYSCANSTATE){
|
||||
static int count = 0;
|
||||
++count;
|
||||
if (count == 4) { count = 0; m_printIndex = -1; } //激光参数默认4个
|
||||
@ -99,6 +100,7 @@ void DataHandle::DataCallBackHandle(const ReadData& msg) {
|
||||
m_printIndex = -1;
|
||||
}
|
||||
else {
|
||||
if (msg.dataType == 40) printf("recv 40 data...\n");
|
||||
PrintValue(msg);
|
||||
}
|
||||
|
||||
@ -151,18 +153,19 @@ void DataHandle::ParamReadUsage() {
|
||||
printf(" 27: " COLOR_YELLOW "print runcfg param data...\n" COLOR_RESET);
|
||||
printf(" 28: " COLOR_YELLOW "print infraredtemp cfg param data...\n" COLOR_RESET);
|
||||
printf(" 29: " COLOR_YELLOW "print machine cfg param data...\n" COLOR_RESET);
|
||||
printf(" 30: " COLOR_YELLOW "print favorite cfg param data...\n" COLOR_RESET);
|
||||
|
||||
printf(" 30: " COLOR_YELLOW "print moldcfg param data...\n" COLOR_RESET);
|
||||
printf(" 31: " COLOR_YELLOW "print loadcfg param data...\n" COLOR_RESET);
|
||||
printf(" 32: " COLOR_YELLOW "print armcfgparam data...\n" COLOR_RESET);
|
||||
printf(" 33: " COLOR_YELLOW "print supplycfgparam data...\n" COLOR_RESET);
|
||||
printf(" 34: " COLOR_YELLOW "print cleancfgparam data...\n" COLOR_RESET);
|
||||
printf(" 35: " COLOR_YELLOW "print elecfgparam data...\n" COLOR_RESET);
|
||||
printf(" 36: " COLOR_YELLOW "print loadparamrsp data...\n" COLOR_RESET);
|
||||
printf(" 37: " COLOR_YELLOW "print scan ctrl state data...\n" COLOR_RESET);
|
||||
printf(" 38: " COLOR_YELLOW "print scan ctrl Param data...\n" COLOR_RESET);
|
||||
printf(" 39: " COLOR_YELLOW "print xy scan state data...\n" COLOR_RESET);
|
||||
printf(" 40: " COLOR_YELLOW "print camera param data...\n" COLOR_RESET);
|
||||
printf(" 31: " COLOR_YELLOW "print moldcfg param data...\n" COLOR_RESET);
|
||||
printf(" 32: " COLOR_YELLOW "print loadcfg param data...\n" COLOR_RESET);
|
||||
printf(" 33: " COLOR_YELLOW "print armcfgparam data...\n" COLOR_RESET);
|
||||
printf(" 34: " COLOR_YELLOW "print supplycfgparam data...\n" COLOR_RESET);
|
||||
printf(" 35: " COLOR_YELLOW "print cleancfgparam data...\n" COLOR_RESET);
|
||||
printf(" 36: " COLOR_YELLOW "print elecfgparam data...\n" COLOR_RESET);
|
||||
printf(" 37: " COLOR_YELLOW "print loadparamrsp data...\n" COLOR_RESET);
|
||||
printf(" 38: " COLOR_YELLOW "print scan ctrl state data...\n" COLOR_RESET);
|
||||
printf(" 39: " COLOR_YELLOW "print scan ctrl Param data...\n" COLOR_RESET);
|
||||
printf(" 40: " COLOR_YELLOW "print xy scan state data...\n" COLOR_RESET);
|
||||
printf(" 41: " COLOR_YELLOW "print camera param data...\n" COLOR_RESET);
|
||||
}
|
||||
|
||||
int DataHandle::Request(int index) {
|
||||
@ -239,10 +242,10 @@ void DataHandle::ParamRequest(int index) {
|
||||
m_printIndex = index;
|
||||
|
||||
while (m_printIndex >= 0) {
|
||||
Sleep(100);
|
||||
Sleep(20);
|
||||
static int count = 0;
|
||||
++count;
|
||||
if (count == 10 && m_printIndex >= 0) { //等待1s,没用收到消息,判断为服务器没用发送
|
||||
if (count == 50 && m_printIndex >= 0) { //等待1s,没用收到消息,判断为服务器没用发送
|
||||
count = 0;
|
||||
printf("服务器没有发送此参数...\n");
|
||||
break;
|
||||
@ -269,6 +272,9 @@ void DataHandle::UpdateParam(const string& input) {
|
||||
case MACHINECFGPARAM:
|
||||
PushMsg(MACHINECFG, "lastStartTime", to_string(time(nullptr)), iTIMET); //machinecfg test
|
||||
break;
|
||||
case FAVORITECFGPARAM:
|
||||
PushMsg(FAVORITECFG, "lastStartTime", to_string(time(nullptr)), iSTRING,ADD); //machinecfg test
|
||||
break;
|
||||
case ELECFGPARAM:
|
||||
break;
|
||||
case LOADPARAMRSP:
|
||||
|
@ -19,7 +19,7 @@ public:
|
||||
|
||||
static void DataCallBackProc(void* pthis, const ReadData& msg);
|
||||
|
||||
void PushMsg(WRITETYPE dataType, const string& nameKey = "", const string& strValue = "", DATATYPE valueType = UNKNOW);
|
||||
void PushMsg(WRITETYPE dataType, const string& nameKey = "", const string& strValue = "", DATATYPE valueType = UNKNOW, DATAHANDLE handleType = UPDATE);
|
||||
|
||||
string GetVersion()const {return m_version;}
|
||||
|
||||
|
@ -42,6 +42,7 @@ enum READTYPE {
|
||||
RUNCFGPARAM, //runcfg 参数
|
||||
INFRAREDTEMPCFGPARAM, //InfraredTempCfg 参数
|
||||
MACHINECFGPARAM, //MachineCfg 参数
|
||||
FAVORITECFGPARAM, //FavoriteCfg 参数
|
||||
|
||||
MOLDCFGPARAM,
|
||||
LOADCFGPARAM,
|
||||
@ -54,7 +55,7 @@ enum READTYPE {
|
||||
LOADPARAMRSP, //装载参数
|
||||
SCANCTRLSTATE, //BaseCtrl参数
|
||||
SCANCTRLPARAM, //scanctrl参数
|
||||
XYSCANSTATE, //XYScanState参数 在参数更新的时候才会发送到客户端
|
||||
XYSCANSTATE, //XYScanState参数 服务端g_isDebug = true && 放开代码才能测试
|
||||
CAMERAPARAM, //相机参数
|
||||
|
||||
|
||||
@ -117,7 +118,7 @@ enum WRITETYPE {
|
||||
RUNCFG,
|
||||
INFRAREDTEMPCFG,
|
||||
MACHINECFG,
|
||||
|
||||
FAVORITECFG,
|
||||
|
||||
LOADPARAM, //装载参数
|
||||
|
||||
@ -126,9 +127,16 @@ enum WRITETYPE {
|
||||
REQUEST = 100, //获取配置信息 test用
|
||||
};
|
||||
|
||||
enum DATAHANDLE {
|
||||
UPDATE = 0,
|
||||
ADD = 1,
|
||||
DEL = 2,
|
||||
};
|
||||
|
||||
struct WriteData {
|
||||
WRITETYPE dataType;
|
||||
std::string nameKey; //参数key
|
||||
std::string strValue; //value
|
||||
DATATYPE valueType;
|
||||
DATAHANDLE handleType = UPDATE;
|
||||
};
|
||||
|
@ -94,6 +94,7 @@ void StreamClient::AllStream() {
|
||||
request.set_datatype(writeData.dataType);
|
||||
request.set_strvalue(writeData.strValue);
|
||||
request.set_valuetype((::stream::TYPE)writeData.valueType);
|
||||
request.set_handletype((::stream::DATAHANDLE)writeData.handleType);
|
||||
stream->Write(request);
|
||||
}
|
||||
else {
|
||||
|
@ -58,6 +58,7 @@ PROTOBUF_CONSTEXPR RequestInfo::RequestInfo(::_pbi::ConstantInitialized)
|
||||
},
|
||||
/*decltype(_impl_.datatype_)*/ 0u,
|
||||
/*decltype(_impl_.valuetype_)*/ 0,
|
||||
/*decltype(_impl_.handletype_)*/ 0,
|
||||
/*decltype(_impl_._cached_size_)*/ {},
|
||||
} {}
|
||||
struct RequestInfoDefaultTypeInternal {
|
||||
@ -235,7 +236,7 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
|
||||
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ImgInfoResponceDefaultTypeInternal _ImgInfoResponce_default_instance_;
|
||||
} // namespace stream
|
||||
static ::_pb::Metadata file_level_metadata_stream_2eproto[11];
|
||||
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_stream_2eproto[1];
|
||||
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_stream_2eproto[2];
|
||||
static constexpr const ::_pb::ServiceDescriptor**
|
||||
file_level_service_descriptors_stream_2eproto = nullptr;
|
||||
const ::uint32_t TableStruct_stream_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
|
||||
@ -263,6 +264,7 @@ const ::uint32_t TableStruct_stream_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE
|
||||
PROTOBUF_FIELD_OFFSET(::stream::RequestInfo, _impl_.namekey_),
|
||||
PROTOBUF_FIELD_OFFSET(::stream::RequestInfo, _impl_.strvalue_),
|
||||
PROTOBUF_FIELD_OFFSET(::stream::RequestInfo, _impl_.valuetype_),
|
||||
PROTOBUF_FIELD_OFFSET(::stream::RequestInfo, _impl_.handletype_),
|
||||
~0u, // no _has_bits_
|
||||
PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _internal_metadata_),
|
||||
~0u, // no _extensions_
|
||||
@ -369,15 +371,15 @@ static const ::_pbi::MigrationSchema
|
||||
schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
|
||||
{0, -1, -1, sizeof(::stream::ParamInfo)},
|
||||
{11, -1, -1, sizeof(::stream::RequestInfo)},
|
||||
{23, -1, -1, sizeof(::stream::ResponseInfo)},
|
||||
{34, 43, -1, sizeof(::stream::ResponseAny)},
|
||||
{44, -1, -1, sizeof(::stream::LayerData)},
|
||||
{57, -1, -1, sizeof(::stream::LayerDataBlock)},
|
||||
{71, -1, -1, sizeof(::stream::VectorDataBlock)},
|
||||
{83, -1, -1, sizeof(::stream::ChainDataBlock)},
|
||||
{93, -1, -1, sizeof(::stream::Point)},
|
||||
{103, -1, -1, sizeof(::stream::RegResponce)},
|
||||
{112, -1, -1, sizeof(::stream::ImgInfoResponce)},
|
||||
{24, -1, -1, sizeof(::stream::ResponseInfo)},
|
||||
{35, 44, -1, sizeof(::stream::ResponseAny)},
|
||||
{45, -1, -1, sizeof(::stream::LayerData)},
|
||||
{58, -1, -1, sizeof(::stream::LayerDataBlock)},
|
||||
{72, -1, -1, sizeof(::stream::VectorDataBlock)},
|
||||
{84, -1, -1, sizeof(::stream::ChainDataBlock)},
|
||||
{94, -1, -1, sizeof(::stream::Point)},
|
||||
{104, -1, -1, sizeof(::stream::RegResponce)},
|
||||
{113, -1, -1, sizeof(::stream::ImgInfoResponce)},
|
||||
};
|
||||
|
||||
static const ::_pb::Message* const file_default_instances[] = {
|
||||
@ -397,38 +399,41 @@ const char descriptor_table_protodef_stream_2eproto[] PROTOBUF_SECTION_VARIABLE(
|
||||
"\n\014stream.proto\022\006stream\032\031google/protobuf/"
|
||||
"any.proto\"O\n\tParamInfo\022\017\n\007nameKey\030\001 \001(\014\022"
|
||||
"\020\n\010strValue\030\002 \001(\014\022\037\n\tvalueType\030\003 \001(\0162\014.s"
|
||||
"tream.TYPE\"c\n\013RequestInfo\022\020\n\010dataType\030\001 "
|
||||
"\001(\r\022\017\n\007nameKey\030\002 \001(\014\022\020\n\010strValue\030\003 \001(\014\022\037"
|
||||
"\n\tvalueType\030\004 \001(\0162\014.stream.TYPE\"Q\n\014Respo"
|
||||
"nseInfo\022\020\n\010dataType\030\001 \001(\r\022\016\n\006result\030\002 \001("
|
||||
"\010\022\037\n\004item\030\003 \003(\0132\021.stream.ParamInfo\"1\n\013Re"
|
||||
"sponseAny\022\"\n\004data\030\001 \001(\0132\024.google.protobu"
|
||||
"f.Any\"\210\001\n\tLayerData\022\023\n\013zCooldinate\030\001 \001(\002"
|
||||
"\022\016\n\006powder\030\002 \001(\002\022\026\n\016layerThickness\030\003 \001(\002"
|
||||
"\022.\n\016layerDataBlock\030\004 \003(\0132\026.stream.LayerD"
|
||||
"ataBlock\022\016\n\006result\030\005 \001(\010\"\266\001\n\016LayerDataBl"
|
||||
"ock\022\021\n\telementId\030\001 \001(\005\022\026\n\016elementParamId"
|
||||
"\030\002 \001(\005\022\021\n\tblockType\030\003 \001(\r\022*\n\tvecBlocks\030\004"
|
||||
" \003(\0132\027.stream.VectorDataBlock\022+\n\013chainBl"
|
||||
"ocks\030\005 \003(\0132\026.stream.ChainDataBlock\022\r\n\005or"
|
||||
"der\030\006 \001(\r\"M\n\017VectorDataBlock\022\016\n\006startX\030\001"
|
||||
" \001(\002\022\016\n\006startY\030\002 \001(\002\022\014\n\004endX\030\003 \001(\002\022\014\n\004en"
|
||||
"dY\030\004 \001(\002\"A\n\016ChainDataBlock\022\016\n\006dotNum\030\001 \001"
|
||||
"(\r\022\037\n\010pointVec\030\002 \003(\0132\r.stream.Point\"#\n\005P"
|
||||
"oint\022\014\n\004xPos\030\001 \001(\002\022\014\n\004yPos\030\002 \001(\002\"\033\n\013RegR"
|
||||
"esponce\022\014\n\004data\030\001 \001(\005\"D\n\017ImgInfoResponce"
|
||||
"\022\022\n\nlevelImage\030\001 \001(\r\022\r\n\005width\030\002 \001(\005\022\016\n\006h"
|
||||
"eight\030\003 \001(\005*X\n\004TYPE\022\t\n\005iBOOL\020\000\022\n\n\006iSHORT"
|
||||
"\020\001\022\013\n\007iUSHORT\020\002\022\010\n\004iINT\020\003\022\t\n\005iUINT\020\004\022\n\n\006"
|
||||
"iFLOAT\020\005\022\013\n\007iSTRING\020\0062\372\001\n\006Stream\0224\n\006Simp"
|
||||
"le\022\023.stream.RequestInfo\032\023.stream.Respons"
|
||||
"eAny\"\000\022=\n\014ServerStream\022\023.stream.RequestI"
|
||||
"nfo\032\024.stream.ResponseInfo\"\0000\001\022=\n\014ClientS"
|
||||
"tream\022\023.stream.RequestInfo\032\024.stream.Resp"
|
||||
"onseInfo\"\000(\001\022<\n\tAllStream\022\023.stream.Reque"
|
||||
"stInfo\032\024.stream.ResponseInfo\"\000(\0010\001B-\n\027io"
|
||||
".grpc.examples.streamB\013StreamProtoP\001\242\002\002S"
|
||||
"Tb\006proto3"
|
||||
"tream.TYPE\"\213\001\n\013RequestInfo\022\020\n\010dataType\030\001"
|
||||
" \001(\r\022\017\n\007nameKey\030\002 \001(\014\022\020\n\010strValue\030\003 \001(\014\022"
|
||||
"\037\n\tvalueType\030\004 \001(\0162\014.stream.TYPE\022&\n\nhand"
|
||||
"leType\030\005 \001(\0162\022.stream.DATAHANDLE\"Q\n\014Resp"
|
||||
"onseInfo\022\020\n\010dataType\030\001 \001(\r\022\016\n\006result\030\002 \001"
|
||||
"(\010\022\037\n\004item\030\003 \003(\0132\021.stream.ParamInfo\"1\n\013R"
|
||||
"esponseAny\022\"\n\004data\030\001 \001(\0132\024.google.protob"
|
||||
"uf.Any\"\210\001\n\tLayerData\022\023\n\013zCooldinate\030\001 \001("
|
||||
"\002\022\016\n\006powder\030\002 \001(\002\022\026\n\016layerThickness\030\003 \001("
|
||||
"\002\022.\n\016layerDataBlock\030\004 \003(\0132\026.stream.Layer"
|
||||
"DataBlock\022\016\n\006result\030\005 \001(\010\"\266\001\n\016LayerDataB"
|
||||
"lock\022\021\n\telementId\030\001 \001(\005\022\026\n\016elementParamI"
|
||||
"d\030\002 \001(\005\022\021\n\tblockType\030\003 \001(\r\022*\n\tvecBlocks\030"
|
||||
"\004 \003(\0132\027.stream.VectorDataBlock\022+\n\013chainB"
|
||||
"locks\030\005 \003(\0132\026.stream.ChainDataBlock\022\r\n\005o"
|
||||
"rder\030\006 \001(\r\"M\n\017VectorDataBlock\022\016\n\006startX\030"
|
||||
"\001 \001(\002\022\016\n\006startY\030\002 \001(\002\022\014\n\004endX\030\003 \001(\002\022\014\n\004e"
|
||||
"ndY\030\004 \001(\002\"A\n\016ChainDataBlock\022\016\n\006dotNum\030\001 "
|
||||
"\001(\r\022\037\n\010pointVec\030\002 \003(\0132\r.stream.Point\"#\n\005"
|
||||
"Point\022\014\n\004xPos\030\001 \001(\002\022\014\n\004yPos\030\002 \001(\002\"\033\n\013Reg"
|
||||
"Responce\022\014\n\004data\030\001 \001(\005\"D\n\017ImgInfoResponc"
|
||||
"e\022\022\n\nlevelImage\030\001 \001(\r\022\r\n\005width\030\002 \001(\005\022\016\n\006"
|
||||
"height\030\003 \001(\005*\223\001\n\004TYPE\022\t\n\005iBOOL\020\000\022\n\n\006iSHO"
|
||||
"RT\020\001\022\013\n\007iUSHORT\020\002\022\010\n\004iINT\020\003\022\t\n\005iUINT\020\004\022\n"
|
||||
"\n\006iFLOAT\020\005\022\013\n\007iSTRING\020\006\022\t\n\005iCHAR\020\007\022\n\n\006iU"
|
||||
"CHAR\020\010\022\t\n\005iWORD\020\t\022\013\n\007iDOUBLE\020\n\022\n\n\006iTIMET"
|
||||
"\020\013**\n\nDATAHANDLE\022\n\n\006UPDATE\020\000\022\007\n\003ADD\020\001\022\007\n"
|
||||
"\003DEL\020\0022\372\001\n\006Stream\0224\n\006Simple\022\023.stream.Req"
|
||||
"uestInfo\032\023.stream.ResponseAny\"\000\022=\n\014Serve"
|
||||
"rStream\022\023.stream.RequestInfo\032\024.stream.Re"
|
||||
"sponseInfo\"\0000\001\022=\n\014ClientStream\022\023.stream."
|
||||
"RequestInfo\032\024.stream.ResponseInfo\"\000(\001\022<\n"
|
||||
"\tAllStream\022\023.stream.RequestInfo\032\024.stream"
|
||||
".ResponseInfo\"\000(\0010\001B-\n\027io.grpc.examples."
|
||||
"streamB\013StreamProtoP\001\242\002\002STb\006proto3"
|
||||
};
|
||||
static const ::_pbi::DescriptorTable* const descriptor_table_stream_2eproto_deps[1] =
|
||||
{
|
||||
@ -438,7 +443,7 @@ static ::absl::once_flag descriptor_table_stream_2eproto_once;
|
||||
const ::_pbi::DescriptorTable descriptor_table_stream_2eproto = {
|
||||
false,
|
||||
false,
|
||||
1369,
|
||||
1514,
|
||||
descriptor_table_protodef_stream_2eproto,
|
||||
"stream.proto",
|
||||
&descriptor_table_stream_2eproto_once,
|
||||
@ -484,6 +489,25 @@ bool TYPE_IsValid(int value) {
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
const ::google::protobuf::EnumDescriptor* DATAHANDLE_descriptor() {
|
||||
::google::protobuf::internal::AssignDescriptors(&descriptor_table_stream_2eproto);
|
||||
return file_level_enum_descriptors_stream_2eproto[1];
|
||||
}
|
||||
bool DATAHANDLE_IsValid(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@ -760,6 +784,7 @@ RequestInfo::RequestInfo(const RequestInfo& from) : ::google::protobuf::Message(
|
||||
decltype(_impl_.strvalue_){},
|
||||
decltype(_impl_.datatype_){},
|
||||
decltype(_impl_.valuetype_){},
|
||||
decltype(_impl_.handletype_){},
|
||||
/*decltype(_impl_._cached_size_)*/ {},
|
||||
};
|
||||
_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(
|
||||
@ -779,8 +804,8 @@ RequestInfo::RequestInfo(const RequestInfo& from) : ::google::protobuf::Message(
|
||||
_this->_impl_.strvalue_.Set(from._internal_strvalue(), _this->GetArenaForAllocation());
|
||||
}
|
||||
::memcpy(&_impl_.datatype_, &from._impl_.datatype_,
|
||||
static_cast<::size_t>(reinterpret_cast<char*>(&_impl_.valuetype_) -
|
||||
reinterpret_cast<char*>(&_impl_.datatype_)) + sizeof(_impl_.valuetype_));
|
||||
static_cast<::size_t>(reinterpret_cast<char*>(&_impl_.handletype_) -
|
||||
reinterpret_cast<char*>(&_impl_.datatype_)) + sizeof(_impl_.handletype_));
|
||||
|
||||
// @@protoc_insertion_point(copy_constructor:stream.RequestInfo)
|
||||
}
|
||||
@ -791,6 +816,7 @@ inline void RequestInfo::SharedCtor(::_pb::Arena* arena) {
|
||||
decltype(_impl_.strvalue_){},
|
||||
decltype(_impl_.datatype_){0u},
|
||||
decltype(_impl_.valuetype_){0},
|
||||
decltype(_impl_.handletype_){0},
|
||||
/*decltype(_impl_._cached_size_)*/ {},
|
||||
};
|
||||
_impl_.namekey_.InitDefault();
|
||||
@ -825,8 +851,8 @@ PROTOBUF_NOINLINE void RequestInfo::Clear() {
|
||||
_impl_.namekey_.ClearToEmpty();
|
||||
_impl_.strvalue_.ClearToEmpty();
|
||||
::memset(&_impl_.datatype_, 0, static_cast<::size_t>(
|
||||
reinterpret_cast<char*>(&_impl_.valuetype_) -
|
||||
reinterpret_cast<char*>(&_impl_.datatype_)) + sizeof(_impl_.valuetype_));
|
||||
reinterpret_cast<char*>(&_impl_.handletype_) -
|
||||
reinterpret_cast<char*>(&_impl_.datatype_)) + sizeof(_impl_.handletype_));
|
||||
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
|
||||
}
|
||||
|
||||
@ -838,23 +864,21 @@ const char* RequestInfo::_InternalParse(
|
||||
|
||||
|
||||
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
|
||||
const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = {
|
||||
const ::_pbi::TcParseTable<3, 5, 0, 0, 2> RequestInfo::_table_ = {
|
||||
{
|
||||
0, // no _has_bits_
|
||||
0, // no _extensions_
|
||||
4, 24, // max_field_number, fast_idx_mask
|
||||
5, 56, // max_field_number, fast_idx_mask
|
||||
offsetof(decltype(_table_), field_lookup_table),
|
||||
4294967280, // skipmap
|
||||
4294967264, // skipmap
|
||||
offsetof(decltype(_table_), field_entries),
|
||||
4, // num_field_entries
|
||||
5, // num_field_entries
|
||||
0, // num_aux_entries
|
||||
offsetof(decltype(_table_), field_names), // no aux_entries
|
||||
&_RequestInfo_default_instance_._instance,
|
||||
::_pbi::TcParser::GenericFallback, // fallback
|
||||
}, {{
|
||||
// .stream.TYPE valueType = 4;
|
||||
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(RequestInfo, _impl_.valuetype_), 63>(),
|
||||
{32, 63, 0, PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.valuetype_)}},
|
||||
{::_pbi::TcParser::MiniParse, {}},
|
||||
// uint32 dataType = 1;
|
||||
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(RequestInfo, _impl_.datatype_), 63>(),
|
||||
{8, 63, 0, PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.datatype_)}},
|
||||
@ -864,6 +888,14 @@ const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = {
|
||||
// bytes strValue = 3;
|
||||
{::_pbi::TcParser::FastBS1,
|
||||
{26, 63, 0, PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.strvalue_)}},
|
||||
// .stream.TYPE valueType = 4;
|
||||
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(RequestInfo, _impl_.valuetype_), 63>(),
|
||||
{32, 63, 0, PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.valuetype_)}},
|
||||
// .stream.DATAHANDLE handleType = 5;
|
||||
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(RequestInfo, _impl_.handletype_), 63>(),
|
||||
{40, 63, 0, PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.handletype_)}},
|
||||
{::_pbi::TcParser::MiniParse, {}},
|
||||
{::_pbi::TcParser::MiniParse, {}},
|
||||
}}, {{
|
||||
65535, 65535
|
||||
}}, {{
|
||||
@ -879,6 +911,9 @@ const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = {
|
||||
// .stream.TYPE valueType = 4;
|
||||
{PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.valuetype_), 0, 0,
|
||||
(0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)},
|
||||
// .stream.DATAHANDLE handleType = 5;
|
||||
{PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.handletype_), 0, 0,
|
||||
(0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)},
|
||||
}},
|
||||
// no aux_entries
|
||||
{{
|
||||
@ -918,6 +953,13 @@ const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = {
|
||||
4, this->_internal_valuetype(), target);
|
||||
}
|
||||
|
||||
// .stream.DATAHANDLE handleType = 5;
|
||||
if (this->_internal_handletype() != 0) {
|
||||
target = stream->EnsureSpace(target);
|
||||
target = ::_pbi::WireFormatLite::WriteEnumToArray(
|
||||
5, this->_internal_handletype(), target);
|
||||
}
|
||||
|
||||
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
|
||||
target =
|
||||
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
|
||||
@ -959,6 +1001,12 @@ const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = {
|
||||
::_pbi::WireFormatLite::EnumSize(this->_internal_valuetype());
|
||||
}
|
||||
|
||||
// .stream.DATAHANDLE handleType = 5;
|
||||
if (this->_internal_handletype() != 0) {
|
||||
total_size += 1 +
|
||||
::_pbi::WireFormatLite::EnumSize(this->_internal_handletype());
|
||||
}
|
||||
|
||||
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
|
||||
}
|
||||
|
||||
@ -989,6 +1037,9 @@ void RequestInfo::MergeImpl(::google::protobuf::Message& to_msg, const ::google:
|
||||
if (from._internal_valuetype() != 0) {
|
||||
_this->_internal_set_valuetype(from._internal_valuetype());
|
||||
}
|
||||
if (from._internal_handletype() != 0) {
|
||||
_this->_internal_set_handletype(from._internal_handletype());
|
||||
}
|
||||
_this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_);
|
||||
}
|
||||
|
||||
@ -1013,8 +1064,8 @@ void RequestInfo::InternalSwap(RequestInfo* other) {
|
||||
::_pbi::ArenaStringPtr::InternalSwap(&_impl_.strvalue_, lhs_arena,
|
||||
&other->_impl_.strvalue_, rhs_arena);
|
||||
::google::protobuf::internal::memswap<
|
||||
PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.valuetype_)
|
||||
+ sizeof(RequestInfo::_impl_.valuetype_)
|
||||
PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.handletype_)
|
||||
+ sizeof(RequestInfo::_impl_.handletype_)
|
||||
- PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.datatype_)>(
|
||||
reinterpret_cast<char*>(&_impl_.datatype_),
|
||||
reinterpret_cast<char*>(&other->_impl_.datatype_));
|
||||
|
@ -104,6 +104,11 @@ enum TYPE : int {
|
||||
iUINT = 4,
|
||||
iFLOAT = 5,
|
||||
iSTRING = 6,
|
||||
iCHAR = 7,
|
||||
iUCHAR = 8,
|
||||
iWORD = 9,
|
||||
iDOUBLE = 10,
|
||||
iTIMET = 11,
|
||||
TYPE_INT_MIN_SENTINEL_DO_NOT_USE_ =
|
||||
std::numeric_limits<::int32_t>::min(),
|
||||
TYPE_INT_MAX_SENTINEL_DO_NOT_USE_ =
|
||||
@ -112,8 +117,8 @@ enum TYPE : int {
|
||||
|
||||
bool TYPE_IsValid(int value);
|
||||
constexpr TYPE TYPE_MIN = static_cast<TYPE>(0);
|
||||
constexpr TYPE TYPE_MAX = static_cast<TYPE>(6);
|
||||
constexpr int TYPE_ARRAYSIZE = 6 + 1;
|
||||
constexpr TYPE TYPE_MAX = static_cast<TYPE>(11);
|
||||
constexpr int TYPE_ARRAYSIZE = 11 + 1;
|
||||
const ::google::protobuf::EnumDescriptor*
|
||||
TYPE_descriptor();
|
||||
template <typename T>
|
||||
@ -126,13 +131,46 @@ const std::string& TYPE_Name(T value) {
|
||||
template <>
|
||||
inline const std::string& TYPE_Name(TYPE value) {
|
||||
return ::google::protobuf::internal::NameOfDenseEnum<TYPE_descriptor,
|
||||
0, 6>(
|
||||
0, 11>(
|
||||
static_cast<int>(value));
|
||||
}
|
||||
inline bool TYPE_Parse(absl::string_view name, TYPE* value) {
|
||||
return ::google::protobuf::internal::ParseNamedEnum<TYPE>(
|
||||
TYPE_descriptor(), name, value);
|
||||
}
|
||||
enum DATAHANDLE : int {
|
||||
UPDATE = 0,
|
||||
ADD = 1,
|
||||
DEL = 2,
|
||||
DATAHANDLE_INT_MIN_SENTINEL_DO_NOT_USE_ =
|
||||
std::numeric_limits<::int32_t>::min(),
|
||||
DATAHANDLE_INT_MAX_SENTINEL_DO_NOT_USE_ =
|
||||
std::numeric_limits<::int32_t>::max(),
|
||||
};
|
||||
|
||||
bool DATAHANDLE_IsValid(int value);
|
||||
constexpr DATAHANDLE DATAHANDLE_MIN = static_cast<DATAHANDLE>(0);
|
||||
constexpr DATAHANDLE DATAHANDLE_MAX = static_cast<DATAHANDLE>(2);
|
||||
constexpr int DATAHANDLE_ARRAYSIZE = 2 + 1;
|
||||
const ::google::protobuf::EnumDescriptor*
|
||||
DATAHANDLE_descriptor();
|
||||
template <typename T>
|
||||
const std::string& DATAHANDLE_Name(T value) {
|
||||
static_assert(std::is_same<T, DATAHANDLE>::value ||
|
||||
std::is_integral<T>::value,
|
||||
"Incorrect type passed to DATAHANDLE_Name().");
|
||||
return DATAHANDLE_Name(static_cast<DATAHANDLE>(value));
|
||||
}
|
||||
template <>
|
||||
inline const std::string& DATAHANDLE_Name(DATAHANDLE value) {
|
||||
return ::google::protobuf::internal::NameOfDenseEnum<DATAHANDLE_descriptor,
|
||||
0, 2>(
|
||||
static_cast<int>(value));
|
||||
}
|
||||
inline bool DATAHANDLE_Parse(absl::string_view name, DATAHANDLE* value) {
|
||||
return ::google::protobuf::internal::ParseNamedEnum<DATAHANDLE>(
|
||||
DATAHANDLE_descriptor(), name, value);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
|
||||
@ -465,6 +503,7 @@ class RequestInfo final :
|
||||
kStrValueFieldNumber = 3,
|
||||
kDataTypeFieldNumber = 1,
|
||||
kValueTypeFieldNumber = 4,
|
||||
kHandleTypeFieldNumber = 5,
|
||||
};
|
||||
// bytes nameKey = 2;
|
||||
void clear_namekey() ;
|
||||
@ -517,13 +556,23 @@ class RequestInfo final :
|
||||
::stream::TYPE _internal_valuetype() const;
|
||||
void _internal_set_valuetype(::stream::TYPE value);
|
||||
|
||||
public:
|
||||
// .stream.DATAHANDLE handleType = 5;
|
||||
void clear_handletype() ;
|
||||
::stream::DATAHANDLE handletype() const;
|
||||
void set_handletype(::stream::DATAHANDLE value);
|
||||
|
||||
private:
|
||||
::stream::DATAHANDLE _internal_handletype() const;
|
||||
void _internal_set_handletype(::stream::DATAHANDLE value);
|
||||
|
||||
public:
|
||||
// @@protoc_insertion_point(class_scope:stream.RequestInfo)
|
||||
private:
|
||||
class _Internal;
|
||||
|
||||
friend class ::google::protobuf::internal::TcParser;
|
||||
static const ::google::protobuf::internal::TcParseTable<2, 4, 0, 0, 2> _table_;
|
||||
static const ::google::protobuf::internal::TcParseTable<3, 5, 0, 0, 2> _table_;
|
||||
template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
|
||||
typedef void InternalArenaConstructable_;
|
||||
typedef void DestructorSkippable_;
|
||||
@ -532,6 +581,7 @@ class RequestInfo final :
|
||||
::google::protobuf::internal::ArenaStringPtr strvalue_;
|
||||
::uint32_t datatype_;
|
||||
int valuetype_;
|
||||
int handletype_;
|
||||
mutable ::google::protobuf::internal::CachedSize _cached_size_;
|
||||
PROTOBUF_TSAN_DECLARE_MEMBER
|
||||
};
|
||||
@ -2513,6 +2563,28 @@ inline void RequestInfo::_internal_set_valuetype(::stream::TYPE value) {
|
||||
_impl_.valuetype_ = value;
|
||||
}
|
||||
|
||||
// .stream.DATAHANDLE handleType = 5;
|
||||
inline void RequestInfo::clear_handletype() {
|
||||
_impl_.handletype_ = 0;
|
||||
}
|
||||
inline ::stream::DATAHANDLE RequestInfo::handletype() const {
|
||||
// @@protoc_insertion_point(field_get:stream.RequestInfo.handleType)
|
||||
return _internal_handletype();
|
||||
}
|
||||
inline void RequestInfo::set_handletype(::stream::DATAHANDLE value) {
|
||||
_internal_set_handletype(value);
|
||||
// @@protoc_insertion_point(field_set:stream.RequestInfo.handleType)
|
||||
}
|
||||
inline ::stream::DATAHANDLE RequestInfo::_internal_handletype() const {
|
||||
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
|
||||
return static_cast<::stream::DATAHANDLE>(_impl_.handletype_);
|
||||
}
|
||||
inline void RequestInfo::_internal_set_handletype(::stream::DATAHANDLE value) {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
;
|
||||
_impl_.handletype_ = value;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// ResponseInfo
|
||||
@ -3350,6 +3422,12 @@ template <>
|
||||
inline const EnumDescriptor* GetEnumDescriptor<::stream::TYPE>() {
|
||||
return ::stream::TYPE_descriptor();
|
||||
}
|
||||
template <>
|
||||
struct is_proto_enum<::stream::DATAHANDLE> : std::true_type {};
|
||||
template <>
|
||||
inline const EnumDescriptor* GetEnumDescriptor<::stream::DATAHANDLE>() {
|
||||
return ::stream::DATAHANDLE_descriptor();
|
||||
}
|
||||
|
||||
} // namespace protobuf
|
||||
} // namespace google
|
||||
|
@ -20,6 +20,17 @@ enum TYPE{
|
||||
iUINT = 4;
|
||||
iFLOAT = 5;
|
||||
iSTRING = 6;
|
||||
iCHAR = 7;
|
||||
iUCHAR = 8;
|
||||
iWORD = 9;
|
||||
iDOUBLE = 10;
|
||||
iTIMET = 11;
|
||||
}
|
||||
|
||||
enum DATAHANDLE {
|
||||
UPDATE = 0;
|
||||
ADD = 1;
|
||||
DEL = 2;
|
||||
}
|
||||
|
||||
/*==================begin 通用通信结构体====================*/
|
||||
@ -32,11 +43,11 @@ message ParamInfo{
|
||||
}
|
||||
|
||||
message RequestInfo {
|
||||
|
||||
uint32 dataType = 1; //信息类型
|
||||
bytes nameKey = 2; //参数key
|
||||
bytes strValue = 3; //value值
|
||||
TYPE valueType = 4; //value数据类型
|
||||
DATAHANDLE handleType = 5; //增删改
|
||||
}
|
||||
|
||||
message ResponseInfo {
|
||||
@ -47,6 +58,7 @@ message ResponseInfo {
|
||||
|
||||
/*==================end 通用通信结构体====================*/
|
||||
|
||||
|
||||
message ResponseAny{
|
||||
google.protobuf.Any data = 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user