public void AddFlowUser() { if ((this.treeViewUser.SelectedNode.Tag != null) && (this.treeViewUser.SelectedNode.Tag.GetType() == typeof(FlowProject))) { FlowUserManagerForm form = new FlowUserManagerForm(); if (form.ShowDialog(this) == DialogResult.OK) { FlowProject tag = (FlowProject)this.treeViewUser.SelectedNode.Tag; for (int i = 0; i < tag.FlowUsers.Count; i++) { if (tag.FlowUsers[i].UserName.Trim() == form.EditUser.UserName.Trim()) { MessageBox.Show(this, "已经存在此用户名", "提示"); return; } } tag.FlowUsers.Add(form.EditUser); TreeNode node = new TreeNode { Text = form.EditUser.ToString(), Tag = form.EditUser, ImageIndex = 4, StateImageIndex = 4 }; this.treeViewUser.SelectedNode.Nodes.Add(node); } } }
public void Send() { project = new FlowProject(Config.projectId); client = new FlowClient(Config.deviceId); CommandProcessor.sendCommand(this); }
public DebugForm(FlowProject flowProject) { InitializeComponent(); Project = flowProject; this.WindowState = FormWindowState.Maximized; this.Load += DebugForm_Load; }
// Methods public FlowProjectNode(FlowProject project) { base.ImageIndex = 0; base.SelectedImageIndex = 0; this.Project = project; base.Text = project.Title; base.ToolTipText = "文件路径" + project.FileFullName; }
public void Send(FlowTObject objToSend) { obj = objToSend; project = new FlowProject(); project._id = Config.projectId; CommandProcessor.sendCommand(this); }
public void send(string username) { user = new FlowUser(); user.username = username; project = new FlowProject(Config.projectId); CommandProcessor.sendCommand(this); }
public void Send(string projectName) { project = new FlowProject(); project.projectName = projectName; user = new FlowUser(Config.userId); client = new FlowClient(Config.deviceId); CommandProcessor.sendCommand(this); }
public void Send(FlowTObject transformToSend) { transformToSend.Read(); obj = new FlowTObject(); obj.Copy(transformToSend); project = new FlowProject(Config.projectId); client = new FlowClient(Config.deviceId); CommandProcessor.sendCommand(this); }
public void initialize() { activeProject = this; if (!initialized) { initialized = true; transformsById = new Dictionary <string, FlowTransform>(); for (int g = 0; g < transforms.Count; g++) { transformsById.Add(transforms[g]._id, transforms[g]); } } }
public void Send(string id) { obj = new FlowTObject(); obj._id = id; project = new FlowProject(); project._id = Config.projectId; client = new FlowClient(); client._id = Config.deviceId; CommandProcessor.sendCommand(this); }
public void InitTreeView(FlowProject project) { TreeNodeEx ex = new TreeNodeEx(TreeNodeType.View); if (this.treeView.Nodes.Count <= 0) { ex.Text = "SCADA流程图"; this.treeView.Nodes.Add(ex); } else { ex = (TreeNodeEx)this.treeView.Nodes[0]; } FlowProjectNode node = new FlowProjectNode(project) { ToolTipText = project.FileFullName, ContextMenuStrip = this.contextMenuProject }; for (int i = 0; i < project.GraphList.Count; i++) { SCADAViewNode node2 = new SCADAViewNode { ContextMenuStrip = this.contextMenuView, View = (WorkForm)this.mediator.CreateWorkForm(project.GraphList[i].ViewTitle, project.GraphList[i].MapWidth, project.GraphList[i].MapHeight, project.GraphList[i]) }; node2.View.GraphControl.Abstract = project.GraphList[i]; node2.View.GraphControl.Abstract.Site = node2.View.GraphControl; node2.View.GraphControl.BasicLayer = project.GraphList[i].Layers[0]; for (int j = 0; j < project.GraphList[i].Shapes.Count; j++) { project.GraphList[i].Shapes[j].Layer = node2.View.GraphControl.BasicLayer; } node2.Text = node2.GraphSite.ViewTitle; node2.View.GraphControl.LoadPropertiesEvent(); node2.View.GraphControl.SaveViewResult = delegate(bool res, string msg) { if (res) { this.LoadTreeViewTemplate(); } else { MessageBox.Show(this, msg); } }; node.Nodes.Add(node2); } node.ExpandAll(); ex.Nodes.Add(node); }
public void initialize() { activeProject = this; if (!initialized) { initialized = true; transformsById = new Dictionary <string, FlowTObject>(); if (transforms == null) { transforms = new List <FlowTObject>(); } for (int g = 0; g < transforms.Count; g++) { transformsById.Add(transforms[g]._id, transforms[g]); } } //FlowObject.registerObject(); }
public void Start() { instance = this; testProject = new FlowProject(); testProject.initialize(); // loads receive functions into command processor dictionary if (CommandProcessor.receiveEvents.Count == 0) { CommandProcessor.initializeRecieveEvents(); } login(); if (LocalServer) { if ((clientType != CLIENT_RIPPLE && clientType != CLIENT_HOLOLENS) || (DebugPanel.instance.forceHolo)) { log("[unity] Connecting to " + LOCAL_SERVER); w = new WebSocket(new Uri(LOCAL_SERVER)); } else { log("[unity] Connecting to " + LAN_SERVER); w = new WebSocket(new Uri(LAN_SERVER)); } } else { log("[unity] Connecting Websocket " + REMOTE_SERVER); w = new WebSocket(new Uri(REMOTE_SERVER)); } log("Going to Websocket Connection..."); DoOnMainThread.ExecuteOnMainThread.Enqueue(() => { StartCoroutine(ConnectWebsocket()); }); log("Sent Connection Request"); }
public void InitTreeConnections(FlowProject project) { FlowProjectNode node = new FlowProjectNode(project) { Text = project.Title, Tag = project, ImageIndex = 0, StateImageIndex = 0, ContextMenuStrip = this.contextMenuConnection }; for (int i = 0; i < project.ScadaConnections.Count; i++) { ScadaConnectionNode node2 = new ScadaConnectionNode(project.ScadaConnections[i]) { ContextMenuStrip = this.contextMenuConnectionDelete }; node.Nodes.Add(node2); } this.treeViewConnections.Nodes.Add(node); }
public void EditFlowUser() { if ((this.treeViewUser.SelectedNode.Tag != null) && (this.treeViewUser.SelectedNode.Tag.GetType() == typeof(ScadaFlowUser))) { FlowUserManagerForm form = new FlowUserManagerForm { EditUser = (ScadaFlowUser)this.treeViewUser.SelectedNode.Tag }; if (form.ShowDialog(this) == DialogResult.OK) { FlowProject tag = (FlowProject)this.treeViewUser.SelectedNode.Parent.Tag; for (int i = 0; i < tag.FlowUsers.Count; i++) { if ((tag.FlowUsers[i].UserName.Trim() == form.EditUser.UserName.Trim()) && (tag.FlowUsers[i] != form.EditUser)) { MessageBox.Show(this, "已经存在此用户名", "提示"); return; } } this.treeViewUser.SelectedNode.Text = form.EditUser.ToString(); } } }
private void treeViewUser_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { if ((e.Node.Tag != null) && (e.Node.Tag.GetType() == typeof(ScadaFlowUser))) { FlowUserManagerForm form = new FlowUserManagerForm { EditUser = (ScadaFlowUser)e.Node.Tag }; if (form.ShowDialog(this) == DialogResult.OK) { FlowProject tag = (FlowProject)e.Node.Parent.Tag; for (int i = 0; i < tag.FlowUsers.Count; i++) { if ((tag.FlowUsers[i].UserName.Trim() == form.EditUser.UserName.Trim()) && (tag.FlowUsers[i] != form.EditUser)) { MessageBox.Show(this, "已经存在此用户名", "提示"); return; } } e.Node.Text = form.EditUser.ToString(); } } }
public void InitTreeUser(FlowProject project) { TreeNode node = new TreeNode { Text = project.Title, Tag = project, ImageIndex = 3, StateImageIndex = 3 }; for (int i = 0; i < project.FlowUsers.Count; i++) { TreeNode node2 = new TreeNode { Text = project.FlowUsers[i].ToString(), Tag = project.FlowUsers[i], ImageIndex = 4, StateImageIndex = 4 }; node.Nodes.Add(node2); } this.treeViewUser.Nodes.Add(node); }
public ProjectPasswordDialog(FlowProject project) { InitializeComponent(); Project = project; tbProjectName.Text = Project.Title; }
public TaskFlowViewModel() { tareas = new ObservableCollection <TaskViewModel>(); Project = new FlowProject(); }
public void Start() { _debug = debug; testProject = new FlowProject(); testProject.initialize(); if (CommandProcessor.recieveEvents.Count == 0) { CommandProcessor.initializeRecieveEvents(); } //string username = "******" + DateTime.Now.ToString(); //string password = "******" + DateTime.Now.ToString(); //string username = "******"; //string password = "******"; //UserRegisterEvent register = new UserRegisterEvent(); //register.Send(username, password, FlowClient.CLIENT_HOLOLENS); //UserLoginEvent login = new UserLoginEvent(); //login.Send(username, password, FlowClient.CLIENT_HOLOLENS); //ProjectCreateEvent createProj = new ProjectCreateEvent(); //createProj.Send("Subarus Maids2" + DateTime.Now.ToString()); //ProjectFetchEvent fetchproj = new ProjectFetchEvent(); //fetchproj.Send(); #if !UNITY_EDITOR && UNITY_WEBGL WebGLInput.captureAllKeyboardInput = false; #endif username = GetUsername(); uid = GetUID(); Application.runInBackground = true; if (clientType == CLIENT_EDITOR) { // Enable Vuforia mainGameCamera.SetActive(true); // VectorLine.SetCamera3D(FlowCameras.mainCamera); // if (login != null) // login.fetch_account_id = true; // WULogin.onLoggedIn += OnLoggedIn; } else if (clientType == CLIENT_WEB) { FlowCameras.mainCamera = mainGameCamera.GetComponent <Camera>(); //login.gameObject.SetActive(false); string loginName = GetUsername(); } else if (clientType == CLIENT_HOLOLENS) { Debug.Log("HOLOLENS!"); mainGameCamera.SetActive(true); //mainGameCamera.GetComponent<Camera>().enabled = false; //mainGameCamera.tag = "MainCamera"; //login.gameObject.SetActive(false); string loginName = GetUsername(); #if UNITY_WSA eventSystem.AddComponent <UnityEngine.EventSystems.HoloLensInputModule>(); #endif } if (LocalServer) { if ((clientType != CLIENT_RIPPLE && clientType != CLIENT_HOLOLENS) || (DebugPanel.instance.forceHolo)) { w = new WebSocket(new Uri(LOCAL_SERVER)); Debug.Log("[unity] Connecting to " + LOCAL_SERVER); } else { Debug.Log("[unity] Connecting to " + LAN_SERVER); w = new WebSocket(new Uri(LAN_SERVER)); } } else { Debug.Log("[unity] Connecting Websocket " + REMOTE_SERVER); w = new WebSocket(new Uri(REMOTE_SERVER)); } //w.Connect(); //ConnectWebsocket(); Debug.Log("Going to Websocket Connection..."); DoOnMainThread.ExecuteOnMainThread.Enqueue(() => { StartCoroutine(ConnectWebsocket()); }); Debug.Log("Sent Connection Request"); }