Exemple #1
0
        private void SSerialConnect_Click(object sender, RoutedEventArgs e)
        {
            switch (SSColorModeList.SelectedIndex)
            {
            case 0: SerialManager.ColorMode = SerialManager.CMode.BPP24RGB; break;

            case 1: SerialManager.ColorMode = SerialManager.CMode.BPP16RGB; break;

            case 2: SerialManager.ColorMode = SerialManager.CMode.BPP8RGB; break;

            case 3: SerialManager.ColorMode = SerialManager.CMode.BPP8Gray; break;

            case 4: SerialManager.ColorMode = SerialManager.CMode.BPP1Mono; break;
            }
            int[] matrixDef = null;

            matrixDef = SerialManager.Connect(SSerialPortList.SelectedValue.ToString(), int.Parse(SBaudRate.Text));

            if (matrixDef != null)
            {
                MatrixFrame.SetDimensions(matrixDef[0], matrixDef[1]);
                // ((MainWindow)Application.Current.MainWindow).SetMatrixDimensions(matrixDef[0], matrixDef[1]);
                Close();
            }
            else
            {
                MessageBox.Show("Cannot establish connection on: " + SSerialPortList.SelectedValue.ToString());
            }
        }
Exemple #2
0
 private void SSerialConnect_Click(object sender, RoutedEventArgs e)
 {
     int[] matrixDef = sm.Connect(SSerialPortList.SelectedValue.ToString(), int.Parse(SBaudRate.Text));
     if (matrixDef != null)
     {
         m.SetupFrameObject(matrixDef[0], matrixDef[1]);
         Close();
     }
     else
     {
         MessageBox.Show("Cannot establish connection on: " + SSerialPortList.SelectedValue.ToString());
     }
 }