private void btnExecute_Click(object sender, EventArgs e) { monitor = new Monitor_operations(this); string Value = ""; string[] lines = richtxtCode.Lines; thread = new Thread(() => { if (loadData != null) { this.Invoke((MethodInvoker) delegate { btnExecute.Enabled = false; btnStop.Enabled = true; statusStrip1.BackColor = Color.Orange; lblStat.Text = "Processing..."; this.monitor.Show(); }); Value = execute(lines); this.Invoke((MethodInvoker) delegate { monitor.Numberheaders(); lblStat.Text = "Done"; statusStrip1.BackColor = Color.Green; monitor.txtOutput.Text = loadData.Get_RegArray(1).ToString(); }); } else { MessageBox.Show("You must Load a Code First", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }); thread.Start(); }
private void btnNext_Click(object sender, EventArgs e) { if (loadData != null) { if (monitor == null || monitor.txtOutput.Text == string.Empty) { if (!monitor_obj_IsCreated) { if (monitor != null) { monitor = null; } if (monitor == null) { monitor = new Monitor_operations(this); this.btnExecute.Enabled = false; this.btnStop.Enabled = false; monitor.Show(); monitor.BringToFront(); } monitor_obj_IsCreated = true; } //richtxtCode.Enabled = false; if (loadData.next < this.richtxtCode.Lines.Length) { StringOperations.Highlight(richtxtCode, richtxtCode.Lines[this.loadData.next], Color.Green); string values = executeCode.Manipulate_Code(this.loadData.Get_CodeArray(this.loadData.next)); this.executeCode.Execute(values, ref this.loadData, ref grpbxRegisters, ref this.loadData.next); monitor.CurrentLineResult(); } else { // richtxtCode.Enabled = true; this.monitor.txtOutput.Text = this.loadData.Get_RegArray(1).ToString();//Get the final value for the applied URM Code } loadData.next++; } else { MessageBox.Show("Operation is done , Close the monitor window to be able to execute again !", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); monitor_obj_IsCreated = false; } } else { MessageBox.Show("You must load a code first", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnLoad_Click(object sender, EventArgs e) { if (monitor != null) { monitor = null; } if (richtxtCode.Text == string.Empty) { MessageBox.Show("There is nothing to Load !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { lblStat.Text = "Loading..."; Load_Data();//Load Data lblStat.Text = "Ready"; statusStrip1.BackColor = Color.Orange; } }
private void btnExecute_Click(object sender, EventArgs e) { monitor = new Monitor_operations(this); string Value = ""; string[] lines = richtxtCode.Lines; thread = new Thread(() => { if (loadData != null) { this.Invoke((MethodInvoker)delegate { btnExecute.Enabled = false; btnStop.Enabled = true; statusStrip1.BackColor = Color.Orange; lblStat.Text = "Processing..."; this.monitor.Show(); }); Value = execute(lines); this.Invoke((MethodInvoker)delegate { monitor.Numberheaders(); lblStat.Text = "Done"; statusStrip1.BackColor = Color.Green; monitor.txtOutput.Text = loadData.Get_RegArray(1).ToString(); }); } else MessageBox.Show("You must Load a Code First", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }); thread.Start(); }
private void btnNext_Click(object sender, EventArgs e) { if(loadData!=null) { if (monitor == null || monitor.txtOutput.Text == string.Empty) { if (!monitor_obj_IsCreated) { if (monitor != null) monitor = null; if (monitor == null) { monitor = new Monitor_operations(this); this.btnExecute.Enabled = false; this.btnStop.Enabled = false; monitor.Show(); monitor.BringToFront(); } monitor_obj_IsCreated = true; } //richtxtCode.Enabled = false; if (loadData.next < this.richtxtCode.Lines.Length) { StringOperations.Highlight(richtxtCode, richtxtCode.Lines[this.loadData.next], Color.Green); string values = executeCode.Manipulate_Code(this.loadData.Get_CodeArray(this.loadData.next)); this.executeCode.Execute(values, ref this.loadData, ref grpbxRegisters, ref this.loadData.next); monitor.CurrentLineResult(); } else { // richtxtCode.Enabled = true; this.monitor.txtOutput.Text = this.loadData.Get_RegArray(1).ToString();//Get the final value for the applied URM Code } loadData.next++; } else { MessageBox.Show("Operation is done , Close the monitor window to be able to execute again !", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); monitor_obj_IsCreated = false; } } else { MessageBox.Show("You must load a code first", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnLoad_Click(object sender, EventArgs e) { if (monitor != null) monitor = null; if (richtxtCode.Text == string.Empty) MessageBox.Show("There is nothing to Load !","Error",MessageBoxButtons.OK,MessageBoxIcon.Error); else { lblStat.Text = "Loading..."; Load_Data();//Load Data lblStat.Text = "Ready"; statusStrip1.BackColor = Color.Orange; } }