单元测试中
void BusinessStateMachine::NotifyStart(BusinessState state)
347 : {
348 : static std::map<BusinessState, std::string> msgMap{
349 0 : {RT_RM_CHECK_RETICLE, "Scan RM start"},
350 0 : {RT_RM_TAKE_RETICLE, "Robot start take reticle from Reticle memory"},
351 0 : {RT_RM_PUT_RETICLE, "Robot start put reticle to Reticle memory"},
352 : // PRE
353 0 : {RT_PRE_TAKE_RETICLE, "Robot start take reticle from PreAlign"},
354 0 : {RT_PRE_PUT_RETICLE, "Robot start put reticle to PreAlign"},
355 0 : {RT_PRE_ALIGN_RETICLE, "Align Retcile start"},
356 0 : {RT_PRE_CHECK_RETICLE, "Scan Reticle code start"},
357 0 : {RT_PRE_CHECK_WAIT, "Wait user check Reticle id"},
358 : // CS
359 0 : {RT_CS_TAKE_RETICLE, "Robot start take reticle from CS"},
360 0 : {RT_CS_PUT_RETICLE, "Robot start put reticle to CS"},
361 : // RS
362 0 : {RT_RS_COARSE_ALIGN, "Start search align"},
363 0 : {RT_RS_COARSE_ALIGN_WAIT, "Search align waiting"},
364 0 : {RT_RS_TAKE_RETICLE, "Robot start take reticle from RS"},
365 0 : {RT_MOVE_RS_AND_ROBOT_TO_UNLOADPOS, "Robot start move RS and robot to unload position"},
366 0 : {RT_MOVE_RS_AND_ROBOT_TO_LOADPOS, "Robot start move RS and robot to load position"},
367 0 : {RT_MOVE_ROBOT_TO_LOADPOS, "Robot start move robot to load position"},
368 0 : {RT_MOVE_ROBOT_TO_UNLOADPOS, "Robot start move robot to unload position"},
369 0 : {RT_LOAD_RETICLE_TO_RS, "Robot start load reticle to RS"},
370 0 : {RT_UNLOAD_RETICLE_FROM_RS, "Robot start unload reticle from RS"},
371 :
372 0 : {RT_RS_PUT_RETICLE, "Robot start put reticle to RS"},
373 0 : {RT_ROBOT_ROTATION_CONTROL, "Robot start move"},
374 : // user process
375 0 : {RT_PAUSE, "RH start pause"},
376 0 : {RT_STOP, "RH start stop"},
377 0 : {RT_RESET, "RH start reset"},
378 0 : {RT_CALIBRATE_SLOTS, "RH start calibrate Reticle Memory slot pos"},
379 0 : {RT_EMO, "RH start EMO"},
380 0 : {RT_TERMINAL, "RH start terminate"},
381 112 : };
382 58 : if (msgMap.find(state) == msgMap.end()) {
383 2 : return;
384 : }
385 56 : auto notify = NotifyMessage::NewProcessNotify(msgMap[state]);
386 56 : service_.lock()->Notify(std::move(notify));
387 56 : }
388 :
389 78 : BNEStatus BusinessStateMachine::ExecPause()
390 : {
391 78 : if (bm_.lock()->HasUnexecutedTask()) {
392 39 : return entry_->Pause(); // 通知Entry暂停
393 : }
394 39 : NotifyService(NotifyMessageType::RTC_PAUSE_RESULT, BNE_RTC_PAUSE_NO_TASK);
395 39 : BNELogWarn("RTC BusinessManager Queue is empty, no need to exec Pause.\n");
396 39 : setState_(RT_IDLE);
397 39 : return BNE_SUCCESS;
398 : }里的map如何覆盖