/// <summary> /// Updates local references incase new windows have been opened /// </summary> /// <param name="ioPortsForm"></param> /// <param name="registerForm"></param> /// <param name="memoryForm"></param> public void Update_References(IOPortsForm ioPortsForm, RegisterForm registerForm, MemoryForm memoryForm, BusForm busForm) { this.ioPortsForm = ioPortsForm; this.registerForm = registerForm; this.memoryForm = memoryForm; this.busForm = busForm; }
private void memoryToolStripMenuItem_Click(object sender, EventArgs e) { if (memoryForm == null) { memoryForm = new MemoryForm(); // Set the parent form of the child window. memoryForm.MdiParent = this; memoryForm.FormClosing += Close_FormMemory; } memoryForm.Show(); //Show memory contents memoryForm.Update_Memory(mainMemory); if (simulatorForm != null) { simulatorForm.Update_References(ioPortsForm, registerForm, memoryForm, busForm); } }
public void Close_FormMemory(object sender, EventArgs e) { memoryForm = null; }
/// <summary> /// Constructor /// </summary> /// <param name="mem"></param> /// <param name="regs"></param> /// <param name="mes"></param> /// <param name="ioPortsForm"></param> /// <param name="registerForm"></param> /// <param name="memoryForm"></param> public SimulatorForm(UInt16[] mem, int[] regs, TextBox mes, IOPortsForm ioPortsForm, RegisterForm registerForm, MemoryForm memoryForm, BusForm busForm) { InitializeComponent(); Update_References(ioPortsForm, registerForm, memoryForm, busForm); instructionWorker = new Instruction(); messages = mes; mainMemory = mem; registers = regs; firstTime = true; shouldStop = false; period = int.Parse(periodToolStripTextBox.Text); }