diff --git a/src/pMotionControler/MotionControler.cpp b/src/pMotionControler/MotionControler.cpp index fbc7d91..45a3eb2 100755 --- a/src/pMotionControler/MotionControler.cpp +++ b/src/pMotionControler/MotionControler.cpp @@ -1,8 +1,8 @@ /* * @Author: zjk 1553836110@qq.com * @Date: 2023-10-12 09:52:27 - * @LastEditors: zjk 1553836110@qq.com - * @LastEditTime: 2023-11-07 12:01:57 + * @LastEditors: zhaojingkui 1553836110@qq.com + * @LastEditTime: 2023-11-30 11:05:18 * @FilePath: /moos-ivp-pi/src/pMotionControler/MotionControler.cpp * @Description: * @@ -29,19 +29,33 @@ bool MotionControler::OnNewMail(MOOSMSG_LIST &NewMail) if((key == "MOOS_MANUAL_OVERIDE") || (key == "MOOS_MANUAL_OVERRIDE")) pengine.overrived(sval); else if(key == "DESIRED_HEADING") + { pengine.setDesHeading(dval, MOOSTime()); + } else if(key == "DESIRED_SPEED") pengine.setDesSpeed(dval, MOOSTime()); else if(key == "DESIRED_DEPTH") pengine.setDesDepth(dval, MOOSTime()); else if(key == "NAV_HEADING") + { pengine.setCurHeading(angle360(dval), MOOSTime()); + RepList["NAV"]["Heading"] = dval; + } else if(key == "NAV_SPEED") + { pengine.setCurSpeed(dval, MOOSTime()); + RepList["NAV"]["Speed"] = dval; + } else if(key == "NAV_DEPTH") + { pengine.setCurDepth(dval, MOOSTime()); + RepList["NAV"]["Depth"] = dval; + } else if(key == "NAV_PITCH") - pengine.setCurPitch(dval, MOOSTime()); + { + pengine.setCurPitch(dval, MOOSTime()); + RepList["NAV"]["Pitch"] = dval; + } else if(key == MSG_ReadConfig) //重新读取配置参数可以清除故障码 { int e = pengine.setParam(configFilePath); @@ -159,7 +173,7 @@ bool MotionControler::buildReport() << intToString(pengine.hasDphCtrl())+" |" << endl; RepList["to BS"] = colVar; - RepList["PID"] = pengine.getReport()["W"]; + // RepList["PID"] = pengine.getReport()["W"]; string rep = Json::writeString(RepJsBuilder, RepList); m_msgs << rep << endl;