private void mnuToggleBit_Click(object sender, EventArgs e) { ((Address)VisualInstruction.GetOperand(0)).Value = ((Address)VisualInstruction.GetOperand(0)).Value == true ? false : true; LadderSimulatorServices simultatorService = new LadderSimulatorServices(); simultatorService.SimulateLadder(projectForm.Program); this.Invalidate(true); }
private void mnuToggleBitPulse_Click(object sender, EventArgs e) { LadderSimulatorServices simultatorService = new LadderSimulatorServices(); Address toggleBitPulse = VisualInstruction.GetAddress(); toggleBitPulse.Value = toggleBitPulse.Value != true; simultatorService.SimulateLadder(projectForm.Program, toggleBitPulse); this.Invalidate(true); }
private void mnuClearAddress_Click(object sender, EventArgs e) { OperationCode opCode = VisualInstruction.OpCode; if ((!VisualInstruction.IsDisposed) && (opCode != OperationCode.LineBegin && opCode != OperationCode.ParallelBranchBegin && opCode != OperationCode.ParallelBranchEnd)) { VisualInstruction.SetOperand(0, null); VisualInstruction.Refresh(); } }
public void VisualInstruction_Selected(VisualInstructionUserControl visualInstruction, VisualLine visualLine) { if (VisualInstruction != null) { if (!VisualInstruction.IsDisposed) { if (!VisualInstruction.Equals(visualInstruction)) { VisualInstruction.Selected = false; VisualInstruction.Refresh(); } } } VisualInstruction = visualInstruction; SelectedVisualLine = visualLine; }