Exemplo n.º 1
0
 public Parser(PIC _pic)
 {
     this.pic = _pic;
     this.registerFileMap = pic.getRegisterFileMap();
     this.programMemory = pic.getProgramMemory();
     this.operationStack = pic.getOperationStack();
     this.programCounter = pic.getProgramCounter();
 }
        public PulseGeneratorForm(PIC.PIC pic)
        {
            InitializeComponent();

            portAAdapter = (PIC.Ports.IOAdapter) pic.getRegisterFileMap().getAdapter(PIC.Register.RegisterConstants.PORTA_ADDRESS);
            portBAdapter = (PIC.Ports.IOAdapter) pic.getRegisterFileMap().getAdapter(PIC.Register.RegisterConstants.PORTB_ADDRESS);

            intervalABox.Text = DEFAULT_INTERVAL.ToString();
            intervalBBox.Text = DEFAULT_INTERVAL.ToString();

            portATimer.Elapsed += portATimer_Elapsed;
            portBTimer.Elapsed += portBTimer_Elapsed;

            int i = 0;
            Label label;
            // PORT-Checkboxes dynamisch erstellen
            for (i = 0; i < 8; i++)
            {
                portACheckBoxes[7-i] = new CheckBox();
                portACheckBoxes[7-i].SetBounds(CHECKBOX_X_OFFSET + i * (CHECKBOX_WIDTH + CHECKBOX_SPACING), CHECKBOX_PORTA_Y_OFFSET, CHECKBOX_WIDTH, CHECKBOX_WIDTH);
                portACheckBoxes[7-i].Parent = this;
                portACheckBoxes[7-i].MouseClick += new MouseEventHandler(portACheckboxChanged);

                label = new Label();
                label.Text = (7 - i).ToString();
                label.SetBounds(CHECKBOX_X_OFFSET + i * (CHECKBOX_WIDTH + CHECKBOX_SPACING), LABEL_PORTA_Y_OFFSET, CHECKBOX_WIDTH, CHECKBOX_WIDTH);
                label.Parent = this;
                label.Show();
                label.BringToFront();

                portBCheckBoxes[7-i] = new CheckBox();
                portBCheckBoxes[7-i].SetBounds(CHECKBOX_X_OFFSET + i * (CHECKBOX_WIDTH + CHECKBOX_SPACING), CHECKBOX_PORTB_Y_OFFSET, CHECKBOX_WIDTH, CHECKBOX_WIDTH);
                portBCheckBoxes[7-i].Parent = this;
                portBCheckBoxes[7-i].MouseClick += new MouseEventHandler(portBCheckboxChanged);

                label = new Label();
                label.Text = (7 - i).ToString();
                label.SetBounds(CHECKBOX_X_OFFSET + i * (CHECKBOX_WIDTH + CHECKBOX_SPACING), LABEL_PORTB_Y_OFFSET, CHECKBOX_WIDTH, CHECKBOX_WIDTH);
                label.Parent = this;
                label.Show();
                label.BringToFront();
            }
        }
Exemplo n.º 3
0
        public WDT(PIC _pic)
        {
            this.pic = _pic;

            optionRegister = pic.getRegisterFileMap().getAdapter(Register.RegisterConstants.OPTION_REG_BANK1_ADDRESS);
            optionRegister.DataChanged += onOptionRegisterChange;

            wdtTimer = new System.Timers.Timer();
            wdtTimer.Interval = calculateWdtInterval();
            wdtTimer.Elapsed += onWdtTimerElapsed;
            wdtTimer.AutoReset = false;
        }