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();
        }
Esempio n. 2
0
        public MainForm()
        {
            InitializeComponent();


            spex         = new SerialPortEx();
            splashScreen = new SplashScreenForm(3);
            connectBoard = new ConnectBoardForm(spex.Port);
            scmd         = new SerialCommand();

            spex.AsyncDataReceiveHandler += new SerialPortAsyncDataReceiveHandler(ComReceiveDataEvent);

            spex.DisableSerialPortAsycnReceive();

            update_ui_delegate = new UpdateUiDelegate(UpdateUiEvent);
        }