// Adds a machine (located in path) to this GAIA_Manager // Returns: // 1 if OK //-1 if an GAIA_Parser is required to use this method //-2 if cannot be added (wrong parameters or repeated FA) //-3 if there are errors parsing file located in path public int addFSM(string path) { if (this.parser == null) { return(-1); } else { //Invoke parser with path FA_Classic parsedfsm = parser.ParsePath(path); if (parsedfsm != null) { try { FSM_dic.Add(new Tuple(parsedfsm.getTag(), parsedfsm.getFAid()), parsedfsm); return(1); } catch (Exception e) { return(-2); } } else { return(-3); } } }
// Removes a machine that had been added to this GAIA_Manager // Returns: // 1 if OK //-1 if cannot remove that machine (corrupted fsm object or it does not exist) public int deleteFSM(FA_Classic fsm) { try { FSM_dic.Remove(new Tuple(fsm.getTag(), fsm.getFAid())); return(1); } catch (Exception e) { return(-1); } }
// Add a machine (passed as FA parameter) to this GAIA_Manager // Returns: // 1 if OK //-1 if cannot be added public int addFSM(FA_Classic fsm) { try { //Add the FA to the attribute FSM_dic FSM_dic.Add(new Tuple(fsm.getTag(), fsm.getFAid()), fsm); return(1); } catch (Exception e) { return(-1); } }