h3d文件通讯功能添加
This commit is contained in:
parent
21152455aa
commit
c03395579f
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,4 +1,5 @@
|
||||
#include "FileProcessor.h"
|
||||
#include "FileProcessor.h"
|
||||
#include "../Logger.h"
|
||||
|
||||
FileProcessor::FileProcessor()
|
||||
:m_StartIndex(0)
|
||||
@ -80,4 +81,129 @@ void FileProcessor::UpdateJobBeanWhenStop()
|
||||
m_Jobbean.m_LastPauseTime = 0;
|
||||
m_FirstStartTime = 0;
|
||||
m_Jobbean.m_PrintSecond = 0;
|
||||
}
|
||||
|
||||
|
||||
void FileProcessor::UpdateParameterSet(const ReadData& rd,const list<Item>& lst) {
|
||||
std::string type = rd.strValue;
|
||||
if (type == "speed") { //速度
|
||||
string set_type;
|
||||
float laser_speed = 0.f;
|
||||
int partId = 0, parameterSetId = 0;
|
||||
for (auto it = lst.begin(); it != lst.end(); ++it) {
|
||||
if (it->nameKey == "set_type") set_type = it->strValue;
|
||||
if (it->nameKey == "laser_speed") laser_speed = ConverType::TryToF(it->strValue);
|
||||
if (it->nameKey == "partId") partId = ConverType::TryToI(it->strValue);
|
||||
if (it->nameKey == "parameterSetId") parameterSetId = ConverType::TryToI(it->strValue);
|
||||
}
|
||||
|
||||
if (GetMetaData()->GetPart(partId)) {
|
||||
for (auto start = GetMetaData()->GetPart(partId)->paramSet.begin(); start != GetMetaData()->GetPart(partId)->paramSet.end(); ++start) {
|
||||
if ((*start)->id == parameterSetId) {
|
||||
(*start)->laser_speed = laser_speed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_SetParamType == SameParam) {
|
||||
for (auto it = GetMetaData()->GetParameterMap()->begin(); it != GetMetaData()->GetParameterMap()->end(); it++) {
|
||||
auto tempset = it->second;
|
||||
if (tempset->set_type == set_type) {
|
||||
tempset->laser_speed = laser_speed;
|
||||
}
|
||||
}
|
||||
g_log->TraceInfo(g_LngManager->Log_UpdateAllPartParamLaserSpeed->ShowText(), set_type, laser_speed);
|
||||
}
|
||||
else if (m_SetParamType == AllParam) {
|
||||
for (auto it = GetMetaData()->GetParameterMap()->begin(); it != GetMetaData()->GetParameterMap()->end(); it++) {
|
||||
auto tempset = it->second;
|
||||
tempset->laser_speed = laser_speed;
|
||||
}
|
||||
g_log->TraceInfo(g_LngManager->Log_UpdateAllParamLaserSpeed->ShowText(), set_type, laser_speed);
|
||||
}
|
||||
else {
|
||||
g_log->TraceInfo(g_LngManager->Log_UpdatePartParamLaserSpeed->ShowText(), partId, set_type, laser_speed);
|
||||
}
|
||||
}
|
||||
else if(type == "power") { //功率
|
||||
string set_type;
|
||||
float laser_power = 0.f;
|
||||
int partId = 0, parameterSetId = 0;
|
||||
for (auto it = lst.begin(); it != lst.end(); ++it) {
|
||||
if (it->nameKey == "set_type") set_type = it->strValue;
|
||||
if (it->nameKey == "laser_power") laser_power = ConverType::TryToF(it->strValue);
|
||||
if (it->nameKey == "partId") partId = ConverType::TryToI(it->strValue);
|
||||
if (it->nameKey == "parameterSetId") parameterSetId = ConverType::TryToI(it->strValue);
|
||||
}
|
||||
|
||||
if (GetMetaData()->GetPart(partId)) {
|
||||
for (auto start = GetMetaData()->GetPart(partId)->paramSet.begin(); start != GetMetaData()->GetPart(partId)->paramSet.end(); ++start) {
|
||||
if ((*start)->id == parameterSetId) {
|
||||
(*start)->laser_set->laser_real_power = laser_power;
|
||||
(*start)->laser_set->laser_power = laser_power;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_SetParamType == SameParam) {
|
||||
for (auto it = GetMetaData()->GetParameterMap()->begin(); it != GetMetaData()->GetParameterMap()->end(); ++it) {
|
||||
auto tempset = it->second;
|
||||
if (tempset->set_type == set_type) {
|
||||
tempset->laser_set->laser_power = laser_power;
|
||||
tempset->laser_set->laser_real_power = laser_power;
|
||||
}
|
||||
}
|
||||
g_log->TraceInfo(g_LngManager->Log_UpdateAllPartParamLaserPower->ShowText(), set_type, laser_power);
|
||||
}
|
||||
else if (m_SetParamType == AllParam) {
|
||||
for (auto it = GetMetaData()->GetParameterMap()->begin(); it != GetMetaData()->GetParameterMap()->end(); ++it) {
|
||||
auto tempset = it->second;
|
||||
tempset->laser_set->laser_power = laser_power;
|
||||
tempset->laser_set->laser_real_power = laser_power;
|
||||
}
|
||||
g_log->TraceInfo(g_LngManager->Log_UpdateAllParamLaserPower->ShowText(), set_type, laser_power);
|
||||
}
|
||||
else {
|
||||
g_log->TraceInfo(g_LngManager->Log_UpdatePartParamLaserPower->ShowText(), partId, set_type, laser_power);
|
||||
}
|
||||
}
|
||||
else if (type == "diameter") {
|
||||
string set_type;
|
||||
float laser_diameter = 0.f;
|
||||
int partId = 0, parameterSetId = 0;
|
||||
for (auto it = lst.begin(); it != lst.end(); ++it) {
|
||||
if (it->nameKey == "set_type") set_type = it->strValue;
|
||||
if (it->nameKey == "laser_diameter") laser_diameter = ConverType::TryToF(it->strValue);
|
||||
if (it->nameKey == "partId") partId = ConverType::TryToI(it->strValue);
|
||||
}
|
||||
|
||||
if (GetMetaData()->GetPart(partId)) {
|
||||
for (auto start = GetMetaData()->GetPart(partId)->paramSet.begin(); start != GetMetaData()->GetPart(partId)->paramSet.end(); ++start) {
|
||||
if ((*start)->id == parameterSetId) {
|
||||
(*start)->laser_set->laser_diameter = laser_diameter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_SetParamType == SameParam) {
|
||||
for (auto it = GetMetaData()->GetParameterMap()->begin(); it != GetMetaData()->GetParameterMap()->end(); ++it) {
|
||||
auto* tempset = it->second;
|
||||
if (tempset->set_type == set_type) {
|
||||
tempset->laser_set->laser_diameter = laser_diameter;
|
||||
}
|
||||
}
|
||||
g_log->TraceInfo(g_LngManager->Log_UpdateAllPartParamLaserDiameter->ShowText(), set_type, laser_diameter);
|
||||
}
|
||||
else if (m_SetParamType == AllParam) {
|
||||
for (auto it = GetMetaData()->GetParameterMap()->begin(); it != GetMetaData()->GetParameterMap()->end(); ++it) {
|
||||
auto tempset = it->second;
|
||||
tempset->laser_set->laser_diameter = laser_diameter;
|
||||
}
|
||||
g_log->TraceInfo(g_LngManager->Log_UpdateAllParamLaserDiameter->ShowText(), set_type, laser_diameter);
|
||||
}
|
||||
else {
|
||||
g_log->TraceInfo(g_LngManager->Log_UpdatePartParamLaserDiameter->ShowText(), partId, set_type, laser_diameter);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
@ -10,7 +10,7 @@ public:
|
||||
~H3DMetaData();
|
||||
|
||||
bool LoadLayerByIndex(unsigned int lindex);
|
||||
bool GetLayerByIndex(unsigned int lindex, ::stream::ResponseAny** response);
|
||||
bool GetLayerByIndex(unsigned int lindex, ::stream::ResponseAny** response); //真实层数据
|
||||
bool LoadLayer(Layer* layer);
|
||||
bool LoadPrevLayer(Layer* layer);
|
||||
bool LoadRemoteLayerByIndex(unsigned int index);
|
||||
|
||||
@ -5,6 +5,13 @@
|
||||
#include "../LanguageManager.h"
|
||||
#include "../global.h"
|
||||
#include <fstream>
|
||||
#include "../protobuf/stream.pb.h"
|
||||
|
||||
JobController::LoadProgressInfoFlag JobController::m_LoadProgressInfoFlag = CkeckingJobData;
|
||||
//vector<string> JobController::m_LoadErrorInfo = vector<string>();
|
||||
CRITICAL_SECTION JobController::m_LoadInfoCS;
|
||||
|
||||
float JobController::m_LoadProgress = 0.0f;
|
||||
|
||||
JobController::JobController()
|
||||
:m_CurrentJob(NULL)
|
||||
@ -81,6 +88,7 @@ bool JobController::LoadJob(string filepath)
|
||||
delete m_CurrentJob;
|
||||
m_CurrentJob = NULL;
|
||||
m_TempJob = NULL;
|
||||
printf("m_CurrentJob:%p", m_CurrentJob);
|
||||
}
|
||||
m_LoadFlag = true;
|
||||
LeaveCriticalSection(&m_cs);
|
||||
@ -122,6 +130,7 @@ void JobController::LoadRun()
|
||||
EnterCriticalSection(&m_cs);
|
||||
m_CurrentJob = m_TempJob;
|
||||
m_CurrentJob->GetMetaData()->ResetIfs();
|
||||
printf("m_CurrentJob:%p\n", m_CurrentJob);
|
||||
// 根据工艺参数设置层的默认供粉量
|
||||
ParamSetCfg::ParamSet* ps = ConfigManager::GetInstance()->GetParamSetCfg()->ParamSetVec[0];
|
||||
std::vector<MetaData::Layer*>& layers = m_CurrentJob->GetMetaData()->GetLayersVec();
|
||||
@ -172,6 +181,7 @@ void JobController::RemoveJob(string job_titel)
|
||||
delete m_CurrentJob;
|
||||
m_CurrentJob = NULL;
|
||||
m_TempJob = NULL;
|
||||
printf("m_CurrentJob:%p", m_CurrentJob);
|
||||
}
|
||||
LeaveCriticalSection(&m_cs);
|
||||
}
|
||||
@ -183,6 +193,7 @@ void JobController::RemoveAllJob()
|
||||
delete m_CurrentJob;
|
||||
m_CurrentJob = NULL;
|
||||
m_TempJob = NULL;
|
||||
printf("m_CurrentJob:%p", m_CurrentJob);
|
||||
}
|
||||
LeaveCriticalSection(&m_cs);
|
||||
}
|
||||
@ -225,8 +236,212 @@ bool JobController::IsSavingPrepareJob() {
|
||||
}
|
||||
|
||||
|
||||
JobController::LoadProgressInfoFlag JobController::m_LoadProgressInfoFlag = CkeckingJobData;
|
||||
//vector<string> JobController::m_LoadErrorInfo = vector<string>();
|
||||
CRITICAL_SECTION JobController::m_LoadInfoCS;
|
||||
void JobController::LoadJob(const list<Item>& lst, ::stream::ResponseAny** response) {
|
||||
string path;
|
||||
for (auto it = lst.begin(); it != lst.end(); ++it) {
|
||||
if (it->nameKey == "path") path = it->strValue;
|
||||
}
|
||||
stream::ComResponce result;
|
||||
result.set_res(LoadJob(path));
|
||||
(*response)->mutable_data()->PackFrom(result);
|
||||
}
|
||||
|
||||
float JobController::m_LoadProgress = 0.0f;
|
||||
|
||||
void JobController::GeneralInfoReq(::stream::ResponseAny** response) {
|
||||
stream::GeneralInfo result;
|
||||
if (m_CurrentJob && m_CurrentJob->GetMetaData()) {
|
||||
result.set_isok(true);
|
||||
result.set_material(m_CurrentJob->GetMetaData()->GetMaterial());
|
||||
result.set_job_name(m_CurrentJob->GetMetaData()->GetJobTitle()); //任务名
|
||||
auto jobDim = result.mutable_jobdimensions();
|
||||
jobDim->set_xmax(m_CurrentJob->GetMetaData()->GetJobDimensions()->xmax);
|
||||
jobDim->set_xmin(m_CurrentJob->GetMetaData()->GetJobDimensions()->xmin);
|
||||
jobDim->set_ymax(m_CurrentJob->GetMetaData()->GetJobDimensions()->ymax);
|
||||
jobDim->set_ymin(m_CurrentJob->GetMetaData()->GetJobDimensions()->ymin);
|
||||
jobDim->set_zmax(m_CurrentJob->GetMetaData()->GetJobDimensions()->zmax);
|
||||
jobDim->set_zmin(m_CurrentJob->GetMetaData()->GetJobDimensions()->zmin);
|
||||
}
|
||||
else {
|
||||
result.set_isok(false);
|
||||
}
|
||||
(*response)->mutable_data()->PackFrom(result);
|
||||
}
|
||||
|
||||
|
||||
void JobController::PartInfoReq(::stream::ResponseAny** response) {
|
||||
stream::Parts result;
|
||||
if (m_CurrentJob && m_CurrentJob->GetMetaData()) {
|
||||
result.set_isok(true);
|
||||
for (auto it = m_CurrentJob->GetMetaData()->GetPartVec().begin();
|
||||
it != m_CurrentJob->GetMetaData()->GetPartVec().end(); ++it) {
|
||||
::stream::Part* part = result.add_ps();
|
||||
part->set_id((*it)->id);
|
||||
part->set_name((*it)->name);
|
||||
part->set_sourceid((*it)->sourceId);
|
||||
auto dim = part->mutable_dimensions();
|
||||
dim->set_xmax((*it)->dimensions->xmax);
|
||||
dim->set_xmin((*it)->dimensions->xmin);
|
||||
dim->set_ymax((*it)->dimensions->ymax);
|
||||
dim->set_ymin((*it)->dimensions->ymin);
|
||||
dim->set_zmax((*it)->dimensions->zmax);
|
||||
dim->set_zmin((*it)->dimensions->zmin);
|
||||
|
||||
auto layerdim = part->mutable_layerdimensions();
|
||||
layerdim->set_xmax((*it)->dimensions->xmax);
|
||||
layerdim->set_xmin((*it)->dimensions->xmin);
|
||||
layerdim->set_ymax((*it)->dimensions->ymax);
|
||||
layerdim->set_ymin((*it)->dimensions->ymin);
|
||||
layerdim->set_zmax((*it)->dimensions->zmax);
|
||||
layerdim->set_zmin((*it)->dimensions->zmin);
|
||||
|
||||
auto partPosBean = part->mutable_partposbean();
|
||||
partPosBean->set_jobid((*it)->partPosBean.m_JobId);
|
||||
partPosBean->set_isselect((*it)->partPosBean.m_IsSelect);
|
||||
partPosBean->set_partid((*it)->partPosBean.m_PartId);
|
||||
partPosBean->set_xoffset((*it)->partPosBean.m_XOffset);
|
||||
partPosBean->set_yoffset((*it)->partPosBean.m_YOffset);
|
||||
partPosBean->set_rotateangle((*it)->partPosBean.m_RotateAngle);
|
||||
partPosBean->set_radians((*it)->partPosBean.m_Radians);
|
||||
partPosBean->set_srcpartcenterx((*it)->partPosBean.m_SrcPartCenterX);
|
||||
partPosBean->set_srcpartcentery((*it)->partPosBean.m_SrcPartCenterY);
|
||||
partPosBean->set_partcenterx((*it)->partPosBean.m_PartCenterX);
|
||||
partPosBean->set_partcentery((*it)->partPosBean.m_PartCenterY);
|
||||
|
||||
for (auto ps = (*it)->paramSet.begin(); ps != (*it)->paramSet.end(); ++ps) {
|
||||
auto paramSet = part->add_paramset();
|
||||
paramSet->set_id((*ps)->id);
|
||||
paramSet->set_name((*ps)->name);
|
||||
paramSet->set_set_type((*ps)->set_type);
|
||||
paramSet->set_laser_speed((*ps)->laser_speed);
|
||||
paramSet->set_scan_field((*ps)->scan_field);
|
||||
auto ls = paramSet->mutable_laser_set();
|
||||
ls->set_id((*ps)->laser_set->id);
|
||||
ls->set_laser_diameter((*ps)->laser_set->laser_diameter);
|
||||
ls->set_laser_power((*ps)->laser_set->laser_power);
|
||||
ls->set_laser_real_power((*ps)->laser_set->laser_real_power);
|
||||
}
|
||||
|
||||
part->set_print_enable((*it)->print_enable);
|
||||
part->set_param_pos((*it)->param_pos);
|
||||
part->set_iscopy((*it)->isCopy);
|
||||
}
|
||||
}
|
||||
else {
|
||||
result.set_isok(false);
|
||||
}
|
||||
(*response)->mutable_data()->PackFrom(result);
|
||||
}
|
||||
|
||||
void JobController::LayersReq(::stream::ResponseAny** response) {
|
||||
stream::Layers result;
|
||||
if (m_CurrentJob && m_CurrentJob->GetMetaData()) {
|
||||
for (auto layer = m_CurrentJob->GetMetaData()->GetLayersVec().begin();
|
||||
layer != m_CurrentJob->GetMetaData()->GetLayersVec().end(); ++layer) {
|
||||
auto ly = result.add_layer();
|
||||
ly->set_index((*layer)->index);
|
||||
ly->set_isok(true);
|
||||
ly->set_powder((*layer)->powder);
|
||||
ly->set_layer_thickness((*layer)->layer_thickness);
|
||||
ly->set_scan_times((*layer)->scan_times);
|
||||
}
|
||||
}
|
||||
else {
|
||||
result.set_isok(false);
|
||||
}
|
||||
|
||||
(*response)->mutable_data()->PackFrom(result);
|
||||
}
|
||||
|
||||
void JobController::LayerInfoReq(JCONTROLLERFUNC type, ::stream::ResponseAny** response) {
|
||||
stream::LayerInfo result;
|
||||
MetaData::Layer* p = nullptr;
|
||||
if (type == CURRLAYERINFO && m_CurrentJob) {
|
||||
p = m_CurrentJob->GetMetaData()->GetCurrentLayer();
|
||||
}
|
||||
else if (type == PREVLAYERINFO && m_CurrentJob) {
|
||||
p = m_CurrentJob->GetMetaData()->GetPreviewLayer();
|
||||
}
|
||||
if (p) {
|
||||
result.set_isok(true);
|
||||
result.set_index(p->index);
|
||||
result.set_powder(p->powder);
|
||||
result.set_layer_thickness(p->layer_thickness);
|
||||
result.set_scan_times(p->scan_times);
|
||||
}
|
||||
else {
|
||||
result.set_isok(false);
|
||||
}
|
||||
(*response)->mutable_data()->PackFrom(result);
|
||||
}
|
||||
|
||||
void JobController::MachineTypeReq(::stream::ResponseAny** response) {
|
||||
stream::MachineType result;
|
||||
|
||||
for (auto it = m_CurrentJob->GetMetaData()->GetScanFields()->begin();
|
||||
it != m_CurrentJob->GetMetaData()->GetScanFields()->end(); ++it) {
|
||||
auto sf = result.add_sf();
|
||||
sf->set_id((*it)->id);
|
||||
sf->set_id((*it)->reference);
|
||||
auto dim = sf->mutable_dimension();
|
||||
dim->set_xmax((*it)->dimension->xmax);
|
||||
dim->set_xmin((*it)->dimension->xmax);
|
||||
dim->set_ymax((*it)->dimension->ymax);
|
||||
dim->set_ymin((*it)->dimension->ymin);
|
||||
}
|
||||
(*response)->mutable_data()->PackFrom(result);
|
||||
}
|
||||
|
||||
|
||||
void JobController::CallFuncs(const ReadData & rd, const list<Item>&lst, ::stream::ResponseAny **response) {
|
||||
stream::ComResponce result;
|
||||
JCONTROLLERFUNC jfunc = (JCONTROLLERFUNC)ConverType::TryToI(rd.nameKey);
|
||||
switch (jfunc)
|
||||
{
|
||||
case LOADJOB:
|
||||
LoadJob(lst, response); break;
|
||||
case REMOVEALLJOB:
|
||||
RemoveAllJob(); break;
|
||||
case GENERALINFO:
|
||||
GeneralInfoReq(response); break;
|
||||
case MACHINETYPE:
|
||||
MachineTypeReq(response); break;
|
||||
case PARTINFO:
|
||||
PartInfoReq(response); break;
|
||||
case LAYERS:
|
||||
LayersReq(response); break;
|
||||
case CURRLAYERINFO:
|
||||
LayerInfoReq(CURRLAYERINFO,response); break;
|
||||
case PREVLAYERINFO:
|
||||
LayerInfoReq(PREVLAYERINFO,response); break;
|
||||
case RECALCEVATIME:
|
||||
m_CurrentJob->GetMetaData()->ReCalcEvaTime(); break;
|
||||
case UPDATEPARAMETERSET:
|
||||
m_CurrentJob->UpdateParameterSet(rd,lst); break;
|
||||
case ERRORINFO:
|
||||
result.set_data(m_CurrentJob->GetMetaData()->GetErrorInfo());
|
||||
(*response)->mutable_data()->PackFrom(result);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void JobController::SendToClients() {
|
||||
list<Item> lst;
|
||||
lst.emplace_back(Item{ "LoadProgress", to_string(GetLoadProgress()), iFLOAT });
|
||||
lst.emplace_back(Item{ "LoadInfo", GetLoadInfo(), iSTRING });
|
||||
lst.emplace_back(Item{ "IsLoadFinished", to_string(IsLoadFinished()), iBOOL });
|
||||
if (m_CurrentJob) {
|
||||
lst.emplace_back(Item{ "LayerCount", to_string(m_CurrentJob->GetLayerCount()), iUINT });
|
||||
lst.emplace_back(Item{ "ComponentCount", to_string(m_CurrentJob->GetComponentCount()), iINT });
|
||||
lst.emplace_back(Item{ "JobUid",m_CurrentJob->GetJobUid(), iSTRING });
|
||||
lst.emplace_back(Item{ "JobFileName", m_CurrentJob->GetJobFileName(), iSTRING });
|
||||
lst.emplace_back(Item{ "LayerInherit", to_string(m_CurrentJob->IsLayerInherit()), iBOOL });
|
||||
lst.emplace_back(Item{ "StartIndex", to_string(m_CurrentJob->GetStartIndex()), iBOOL });
|
||||
lst.emplace_back(Item{ "SetParamType", to_string(m_CurrentJob->m_SetParamType), iINT });
|
||||
}
|
||||
|
||||
ClientWrapper::Instance()->PushAllClient(WriteData(JOBCONTROLLER, lst));
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -103,7 +103,7 @@ message LayerDataBlock
|
||||
|
||||
message VectorDataBlock{
|
||||
float startX = 1; // 始点 X 位置 : Float //单位 mm
|
||||
float startY=2; // 始点 Y 位置 : Float //单位 mm
|
||||
float startY=2; // 始点 Y 位置 : Float //单位 mm
|
||||
float endX = 3; // 终点 X 位置 : Float //单位 mm
|
||||
float endY = 4; // 终点 Y 位置 : Float //单位 mm
|
||||
}
|
||||
@ -120,6 +120,99 @@ message Point{
|
||||
float yPos = 2; // Y 位置 : Float //单位 mm
|
||||
}
|
||||
|
||||
//任务信息区
|
||||
message GeneralInfo{
|
||||
bool isOk = 1;
|
||||
bytes job_name = 2; //任务名
|
||||
JobDimensions jobDimensions = 3; //打印尺寸
|
||||
bytes material = 4; //打印材料
|
||||
//repeated Property properties = 4;
|
||||
}
|
||||
|
||||
message MachineType{
|
||||
message Dimension {
|
||||
float xmin = 1;
|
||||
float ymin = 2;
|
||||
float xmax = 3;
|
||||
float ymax = 4;
|
||||
}
|
||||
message ScanField{
|
||||
int32 id = 1;
|
||||
int32 reference = 2;
|
||||
Dimension dimension = 3;
|
||||
}
|
||||
repeated ScanField sf = 1;
|
||||
bool isOk = 2;
|
||||
}
|
||||
|
||||
|
||||
message JobDimensions {
|
||||
float xmin = 1;
|
||||
float ymin = 2;
|
||||
float zmin = 3;
|
||||
float xmax = 4;
|
||||
float ymax = 5;
|
||||
float zmax = 6;
|
||||
}
|
||||
|
||||
message PartPosBean{
|
||||
bytes jobId = 1;
|
||||
int32 partId = 2;
|
||||
float xOffset = 3;
|
||||
float yOffset = 4;
|
||||
float rotateAngle = 5;
|
||||
float radians = 6;
|
||||
float srcPartCenterX = 7;
|
||||
float srcPartCenterY = 8;
|
||||
float partCenterX = 9;
|
||||
float partCenterY = 10;
|
||||
|
||||
float selectDataPoint1_1 = 11;
|
||||
float selectDataPoint1_2 = 12;
|
||||
float selectDataPoint2_1 = 13;
|
||||
float selectDataPoint2_2 = 14;
|
||||
float selectImagePoint1_1 = 15;
|
||||
float selectImagePoint1_2 = 16;
|
||||
float selectImagePoint2_1 = 17;
|
||||
float selectImagePoint2_2 = 18;
|
||||
bool isSelect = 19;
|
||||
}
|
||||
|
||||
message ParameterSet {
|
||||
message LaserSet{
|
||||
int32 id = 1;
|
||||
float laser_diameter = 2;
|
||||
float laser_power = 3;
|
||||
float laser_real_power = 4;
|
||||
}
|
||||
|
||||
int32 scan_field = 1;
|
||||
int32 id = 2; //key id
|
||||
bytes name = 3; //<EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD><EFBFBD>ӻ<EFBFBD>
|
||||
bytes set_type = 4;
|
||||
float laser_speed = 5; //Speed in mm/s
|
||||
LaserSet laser_set = 6;
|
||||
}
|
||||
|
||||
message Parts{
|
||||
repeated Part ps = 1;
|
||||
bool isOk = 2;
|
||||
}
|
||||
|
||||
message Part{ //传
|
||||
int32 id = 1;
|
||||
int32 sourceId = 2;
|
||||
bytes name = 3;
|
||||
JobDimensions dimensions = 4;
|
||||
PartPosBean partPosBean = 5;
|
||||
bool print_enable = 6;
|
||||
uint64 param_pos = 7;
|
||||
repeated ParameterSet paramSet = 8;
|
||||
bool isCopy = 9; //是否复制的
|
||||
JobDimensions layerDimensions = 10;
|
||||
}
|
||||
|
||||
|
||||
//注册功能返回信息
|
||||
message RegResponce{
|
||||
int32 data = 1;
|
||||
@ -136,14 +229,28 @@ message ComResponce{
|
||||
bytes data = 1;
|
||||
bytes directory = 2;
|
||||
|
||||
message FileInfoStruct
|
||||
{
|
||||
message FileInfoStruct{
|
||||
bytes type = 1; //类型
|
||||
bytes filePath = 2;
|
||||
bytes fileName = 3;
|
||||
bytes ext = 4; //后缀
|
||||
}
|
||||
repeated FileInfoStruct fileInfo = 3;
|
||||
bool res = 4;
|
||||
bool isOk = 5;
|
||||
}
|
||||
|
||||
message Layers{
|
||||
repeated LayerInfo layer = 1;
|
||||
bool isOk = 2;
|
||||
}
|
||||
|
||||
message LayerInfo{
|
||||
int32 index = 1;
|
||||
uint32 powder = 2; //供粉量 传
|
||||
uint32 layer_thickness = 3; //传
|
||||
int32 scan_times = 4; //传
|
||||
bool isOk = 5;
|
||||
}
|
||||
|
||||
//ScannerCrtlCfg结构体
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,22 +0,0 @@
|
||||
#include "FuncTest.h"
|
||||
#include "FunC.h"
|
||||
#include "../utils/ConverType.h"
|
||||
#include "../utils/StringHelper.h"
|
||||
|
||||
void FuncTest::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);
|
||||
}
|
||||
}
|
||||
|
||||
void FuncTest::PushMsg(const WriteData& wd) {
|
||||
if (m_streamClient) {
|
||||
m_streamClient->PushMsg(wd);
|
||||
}
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
#pragma once
|
||||
#include "FunC.h"
|
||||
|
||||
class FuncTest {
|
||||
public:
|
||||
FuncTest();
|
||||
~FuncTest();
|
||||
|
||||
|
||||
private:
|
||||
void PushMsg(WRITETYPE dataType, const string& nameKey, const string& strValue, DATATYPE valueType, DATAHANDLE handleType);
|
||||
void PushMsg(const WriteData& wd);
|
||||
|
||||
|
||||
|
||||
};
|
||||
@ -254,15 +254,15 @@
|
||||
<ClCompile Include="config\bean\HbdLanguage.cpp">
|
||||
<Filter>config\bean</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DataManage\FuncTest.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="DataManage\FuncTest.cpp">
|
||||
<Filter>DataManage</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="utils\LocalAddr.h">
|
||||
@ -518,15 +518,15 @@
|
||||
<ClInclude Include="utils\ConverType.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DataManage\FuncTest.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="DataManage\FuncTest.h">
|
||||
<Filter>DataManage</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="protobuf\stream.proto">
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -103,7 +103,7 @@ message LayerDataBlock
|
||||
|
||||
message VectorDataBlock{
|
||||
float startX = 1; // 始点 X 位置 : Float //单位 mm
|
||||
float startY=2; // 始点 Y 位置 : Float //单位 mm
|
||||
float startY=2; // 始点 Y 位置 : Float //单位 mm
|
||||
float endX = 3; // 终点 X 位置 : Float //单位 mm
|
||||
float endY = 4; // 终点 Y 位置 : Float //单位 mm
|
||||
}
|
||||
@ -120,6 +120,99 @@ message Point{
|
||||
float yPos = 2; // Y 位置 : Float //单位 mm
|
||||
}
|
||||
|
||||
//任务信息区
|
||||
message GeneralInfo{
|
||||
bool isOk = 1;
|
||||
bytes job_name = 2; //任务名
|
||||
JobDimensions jobDimensions = 3; //打印尺寸
|
||||
bytes material = 4; //打印材料
|
||||
//repeated Property properties = 4;
|
||||
}
|
||||
|
||||
message MachineType{
|
||||
message Dimension {
|
||||
float xmin = 1;
|
||||
float ymin = 2;
|
||||
float xmax = 3;
|
||||
float ymax = 4;
|
||||
}
|
||||
message ScanField{
|
||||
int32 id = 1;
|
||||
int32 reference = 2;
|
||||
Dimension dimension = 3;
|
||||
}
|
||||
repeated ScanField sf = 1;
|
||||
bool isOk = 2;
|
||||
}
|
||||
|
||||
|
||||
message JobDimensions {
|
||||
float xmin = 1;
|
||||
float ymin = 2;
|
||||
float zmin = 3;
|
||||
float xmax = 4;
|
||||
float ymax = 5;
|
||||
float zmax = 6;
|
||||
}
|
||||
|
||||
message PartPosBean{
|
||||
bytes jobId = 1;
|
||||
int32 partId = 2;
|
||||
float xOffset = 3;
|
||||
float yOffset = 4;
|
||||
float rotateAngle = 5;
|
||||
float radians = 6;
|
||||
float srcPartCenterX = 7;
|
||||
float srcPartCenterY = 8;
|
||||
float partCenterX = 9;
|
||||
float partCenterY = 10;
|
||||
|
||||
float selectDataPoint1_1 = 11;
|
||||
float selectDataPoint1_2 = 12;
|
||||
float selectDataPoint2_1 = 13;
|
||||
float selectDataPoint2_2 = 14;
|
||||
float selectImagePoint1_1 = 15;
|
||||
float selectImagePoint1_2 = 16;
|
||||
float selectImagePoint2_1 = 17;
|
||||
float selectImagePoint2_2 = 18;
|
||||
bool isSelect = 19;
|
||||
}
|
||||
|
||||
message ParameterSet {
|
||||
message LaserSet{
|
||||
int32 id = 1;
|
||||
float laser_diameter = 2;
|
||||
float laser_power = 3;
|
||||
float laser_real_power = 4;
|
||||
}
|
||||
|
||||
int32 scan_field = 1;
|
||||
int32 id = 2; //key id
|
||||
bytes name = 3; //<EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD><EFBFBD>ӻ<EFBFBD>
|
||||
bytes set_type = 4;
|
||||
float laser_speed = 5; //Speed in mm/s
|
||||
LaserSet laser_set = 6;
|
||||
}
|
||||
|
||||
message Parts{
|
||||
repeated Part ps = 1;
|
||||
bool isOk = 2;
|
||||
}
|
||||
|
||||
message Part{ //传
|
||||
int32 id = 1;
|
||||
int32 sourceId = 2;
|
||||
bytes name = 3;
|
||||
JobDimensions dimensions = 4;
|
||||
PartPosBean partPosBean = 5;
|
||||
bool print_enable = 6;
|
||||
uint64 param_pos = 7;
|
||||
repeated ParameterSet paramSet = 8;
|
||||
bool isCopy = 9; //是否复制的
|
||||
JobDimensions layerDimensions = 10;
|
||||
}
|
||||
|
||||
|
||||
//注册功能返回信息
|
||||
message RegResponce{
|
||||
int32 data = 1;
|
||||
@ -136,14 +229,28 @@ message ComResponce{
|
||||
bytes data = 1;
|
||||
bytes directory = 2;
|
||||
|
||||
message FileInfoStruct
|
||||
{
|
||||
message FileInfoStruct{
|
||||
bytes type = 1; //类型
|
||||
bytes filePath = 2;
|
||||
bytes fileName = 3;
|
||||
bytes ext = 4; //后缀
|
||||
}
|
||||
repeated FileInfoStruct fileInfo = 3;
|
||||
bool res = 4;
|
||||
bool isOk = 5;
|
||||
}
|
||||
|
||||
message Layers{
|
||||
repeated LayerInfo layer = 1;
|
||||
bool isOk = 2;
|
||||
}
|
||||
|
||||
message LayerInfo{
|
||||
int32 index = 1;
|
||||
uint32 powder = 2; //供粉量 传
|
||||
uint32 layer_thickness = 3; //传
|
||||
int32 scan_times = 4; //传
|
||||
bool isOk = 5;
|
||||
}
|
||||
|
||||
//ScannerCrtlCfg结构体
|
||||
@ -314,6 +421,4 @@ service Stream {
|
||||
rpc ServerStream (RequestInfo) returns (stream ResponseInfo) {} // 服务端数据流模式
|
||||
rpc ClientStream (stream RequestInfo) returns (ResponseInfo) {} // 客户端数据流模式
|
||||
rpc AllStream (stream RequestInfo) returns (stream ResponseInfo) {} // 双向数据流模式
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user