public bool EndAddFlowItem(string obj) { if (obj == null || obj.Length == 0) { return(false); } var data = JsonConvert.DeserializeObject <NewFlowDataOrg>(obj); string ret; string inputParam = null; if (data.param.Length != 0) { NewValData newVal = new NewValData(); newVal.lineNumber = -1; newVal.value = data.param; var newValParam = JsonConvert.SerializeObject(newVal); ret = ScreenClient.AddVar(stPort, newValParam); if (ret.Length == 0) { return(false); } var ret2 = JsonConvert.DeserializeObject <NewValRet>(ret); if (null == ret2 || ret2.result.code != 1) { return(false); } inputParam = JsonConvert.SerializeObject(ret2.config); } NewFlowData newFlowData = new NewFlowData(); if (inputParam != null) { newFlowData.@params = new List <string>(); [email protected](inputParam); } var newImageName = ImgMgr.Get().NewSaveImage(); if (null == newImageName) { return(false); } newFlowData.point = GlobDef.GetDevPoint(data.pt); newFlowData.type = data.type; newFlowData.preLineNumber = data.preLineNumber; newFlowData.serial = newImageName; string flowItem = JsonConvert.SerializeObject(newFlowData); string addFlowItemRetStr = ScreenClient.AddProcess(stPort, flowItem); if (addFlowItemRetStr.Length == 0) { return(false); } notifyEnanleAddFlowItem?.Invoke(); return(true); }
public bool MouseMove(string obj) { var pt = JsonConvert.DeserializeObject <Point>(obj); pt = GlobDef.GetDevPoint(pt); var ret = ScreenClient.sendPoint(stPort, pt.x, pt.y); notifyUpdateHoverRect?.Invoke(ret); return(true); }
void UpdateFlow(string rcStr) { var cmd = $"UpdateFlow(`{rcStr}`,{GlobDef.GetImgSizeStr()},{GlobDef.image_markrate})"; ExecuteJavascript(cmd); }