public bool BeginYdToGwConfig(string content) { ListenVModel vm = new ListenVModel(); vm.cfun = ListenCFun.addvar.ToString(); vm.content = content; CacheMgr.BeginSend(vm); return(true); }
public bool YdToGwConfig(string content) { ListenVModel vm = new ListenVModel(); vm.cfun = ListenCFun.addvar.ToString(); vm.content = content; string msg = ""; return(CacheMgr.SendCollectVal(vm, out msg)); }
public bool SendCmd(CommandVModel cmd, bool backgroup = true) { string msg = ""; if (cmd == null) { throw new Exception("远程控制为空"); } //目的适应NB表 if (cmd.TransferType == 4 && !string.IsNullOrEmpty(cmd.DataValue)) { string fs = cmd.FunType + cmd.DataValue; string tagName = "", dataValue = ""; tagName = bll.GetYdToFun_idIOService(cmd.Module_id, fs, out dataValue); if (!string.IsNullOrEmpty(tagName) && !string.IsNullOrEmpty(dataValue)) { cmd.LpszDbVarName = tagName; cmd.DataValue = dataValue; } } // cmd.IsUI = true; ListenVModel vm = new ListenVModel(); cmd.IsUI = true; vm.cfun = ListenCFun.cmd.ToString(); vm.content = JsonHelper.Serialize(cmd); lock (ydToGwlock) { if (backgroup == true) { CacheMgr.BeginSend(vm); } else { CacheMgr.SendCollectVal(vm, out msg); } } return(true); }