public bool signal(TFSMSignal s, TFSMWorkingData wData) { if (wData._currentState != null) { string id = TFSMLink.LINK_NAME_GENERATOR(wData._currentState.name, s.targetState); TFSMLink link; if (!_stateLinks.TryGetValue(id, out link)) { TLogger.WARNING("no link found."); return(false); } if (link.getStartState() != wData._currentState) { TLogger.WARNING("connot use this link for current state:" + wData._currentState.name + ":" + id); return(false); } wData._stimulus = link; } else { if (wData._isFirstUpdate == false) { setDefaultState(wData, s.targetState); } else { TLogger.WARNING("state fatal error:" + s.targetState); return(false); } } return(true); }
public bool signal(TFSMSignal s, TFSMWorkingData wData) { if (wData._currentState != null) { string id = TFSMLink.LINK_NAME_GENERATOR(wData._currentState.name, s.targetState); TFSMLink link; if (!_stateLinks.TryGetValue(id, out link)) { TLogger.WARNING("no link found."); return false; } if (link.getStartState() != wData._currentState) { TLogger.WARNING("connot use this link for current state:" + wData._currentState.name + ":" + id); return false; } wData._stimulus = link; } else { if (wData._isFirstUpdate == false) { setDefaultState(wData, s.targetState); } else { TLogger.WARNING("state fatal error:" + s.targetState); return false; } } return true; }