/// <summary> /// Anmelden der Befehle für diesn Modul /// </summary> public static void sSubscribeCommands() { CCommandTemplate.CommandsAdd("StartBeverage", typeof(CCoffeeMaschineCommand)); CCommandTemplate.CommandsAdd("WaitBeverage", typeof(CCoffeeMaschineCommand)); CCommandTemplate.CommandsAdd("SetLight", typeof(CCoffeeMaschineCommand)); CCommandTemplate.CommandsAdd("WMFConnect", typeof(CCoffeeMaschineCommand)); }
/// <summary> /// Vordefinition der Parameternamen. /// </summary> /// <param name="pCmd">Befehlsentwurf für diesen Befehl</param> /// <returns></returns> public override CCommandTemplate SetParName(CCommandTemplate pCmd) { try { String name = pCmd.code[0].ToString(); switch (name) { case "SetLight": pCmd.pName.Add("r", new CParameterTemplate() { parType = typeof(int) }); pCmd.pName.Add("g", new CParameterTemplate() { parType = typeof(int) }); pCmd.pName.Add("b", new CParameterTemplate() { parType = typeof(int) }); pCmd.nTyp = CommandType.WMF; break; case "StartBeverage": pCmd.pName.Add("BtnNbr", new CParameterTemplate() { parType = typeof(int) }); pCmd.pName.Add("Barista", new CParameterTemplate() { parType = typeof(int) }); pCmd.pName.Add("Decaf", new CParameterTemplate() { parType = typeof(int) }); pCmd.pName.Add("iSML", new CParameterTemplate() { parType = typeof(int) }); pCmd.pName.Add("iMilkType", new CParameterTemplate() { parType = typeof(int) }); pCmd.pName.Add("timeout", new CParameterTemplate() { parType = typeof(int) }); pCmd.pName.Add("simState", new CParameterTemplate() { parType = typeof(int) }); pCmd.nTyp = CommandType.WMF; break; case "WaitBeverage": pCmd.pName.Add("timeout", new CParameterTemplate() { parType = typeof(int) }); pCmd.nTyp = CommandType.WMF; break; case "WMFConnect": pCmd.pName.Add("ip", new CParameterTemplate() { parType = typeof(string) }); pCmd.pName.Add("idle", new CParameterTemplate() { parType = typeof(int) }); pCmd.nTyp = CommandType.WMF; break; } if (pCmd.Xmldoc != null) { pCmd.elem = pCmd.Xmldoc.CreateElement("Command"); } pCmd.isGroupNode = false; } catch (Exception ex) { MessageHandler.Error(null, 412, "kann keine Commandliste Auifbauen", ex); //throw; } return(pCmd); }