Beispiel #1
0
 /// <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;
 }
Beispiel #2
0
 /// <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);
 }
Beispiel #3
0
        private void iOPortsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ioPortsForm == null)
            {
                ioPortsForm = new IOPortsForm(mainMemory);

                // Set the parent form of the child window.
                ioPortsForm.MdiParent = this;
                // Display the new form.
                ioPortsForm.Text = "IO Ports";

                ioPortsForm.FormClosing += Close_FormIO;
            }

            ioPortsForm.Show();
            if (simulatorForm != null)
            {
                simulatorForm.Update_References(ioPortsForm, registerForm, memoryForm, busForm);
            }
        }
Beispiel #4
0
 public void Close_FormIO(object sender, EventArgs e)
 {
     ioPortsForm = null;
 }