Example #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            isRunning = false;

            /// Initialize the form controls
            ///

            maximStatusStrip1.Items[0].Width     = 310;
            maximStatusStrip1.Items[0].TextAlign = ContentAlignment.MiddleCenter;
            maximStatusStrip1.Items[0].Text      = "No MAX17261 SN";

            maximStatusStrip1.Items[1].Width     = 130;
            maximStatusStrip1.Items[1].TextAlign = ContentAlignment.MiddleCenter;
            maximStatusStrip1.Items[1].Text      = "No Hardware";

            maximStatusStrip1.Items[2].Width     = 170;
            maximStatusStrip1.Items[2].TextAlign = ContentAlignment.MiddleCenter;
            maximStatusStrip1.Items[2].Text      = "No COM Port Connected";

            PartSelection.Items.AddRange(PartList);
            PartSelection.SelectedIndex = 0;



            BatRegulationThreshold.Items.AddRange(BatRegulationThresholdList);
            BatRegulationThreshold.SelectedIndex = 0;

            PrechargeThreshold.Items.AddRange(PrechargeThresholdList);
            PrechargeThreshold.SelectedIndex = 0;

            BatRechargeThreshold.Items.AddRange(BatRechargeThresholdList);
            BatRechargeThreshold.SelectedIndex = 0;

            ChargeDoneThreshold.Items.AddRange(ChargeDoneThresholdList);
            ChargeDoneThreshold.SelectedIndex = 0;

            DisableGuiControls();


            //Show splash screen if not disabled
            splashScreen.maximSplashScreen1.Checked = Properties.Settings.Default.DisableSplashScreen;
            if (!Properties.Settings.Default.DisableSplashScreen)
            {
                splashScreen.ShowDialog();
            }

            //Show connect board form
            connectBoard.theMainForm = this;
            connectBoard.ShowDialog();



            timer1.Enabled  = true;
            timer1.Interval = 500;
            timer1.Stop();
        }
        private void MainForm_Load(object sender, EventArgs e)
        {
            mSerialPort  = new SerialPort();
            splashScreen = new SplashScreenForm(3);
            connectBoard = new ConnectBoardForm(mSerialPort);

            SerialCommand = new byte[8];



            /// Initialize the form controls
            serialPortDelegate        = new SerialPortDelegate(SerialPortReceiveIsr);
            mSerialPort.DataReceived += new SerialDataReceivedEventHandler(SerialPortAsyncReceive);

            maximStatusStrip1.Items[0].TextAlign = ContentAlignment.MiddleCenter;
            maximStatusStrip1.Items[0].Text      = "Messages";

            PartSelection.Items.AddRange(PartList);
            PartSelection.SelectedIndex = 0;



            //Show splash screen if not disabled
            splashScreen.maximSplashScreen1.Checked = Properties.Settings.Default.DisableSplashScreen;
            if (!Properties.Settings.Default.DisableSplashScreen)
            {
                splashScreen.ShowDialog();
            }

            //Show connect board form
            connectBoard.ShowDialog();
        }
 private void connectToolStripMenuItem_Click(object sender, EventArgs e)
 {
     connectBoard.ShowDialog();
 }