private void btnChangeDevName_Click(object sender, RoutedEventArgs e)
        {
            var cDevDlg = new CNewDeveName();

            cDevDlg.Tag = "devChangeName";
            cDevDlg.onsubmitNewDeviceChangedEvent += new CNewDeveName.submitNewDeviceChanged(onsubmitNewDevname);
            cDevDlg.ShowDialog();
        }
        private void cgDevNameBtn_Click(object sender, RoutedEventArgs e)
        {
            // if (moduleType == Module_Type.Mod_RIO100) return;
            // CMDSender.sendMsgWithoutData(MatrixCMD.RVAGUIClass, MatrixCMD.RVA200_MSG_Transfer, 89, 0);
            var cDevDlg = new CNewDeveName();

            Debug.WriteLine("popup device name change dialog now..............");
            cDevDlg.onsubmitNewDeviceChangedEvent += new CNewDeveName.submitNewDeviceChanged(onsubmitNewDevname);
            cDevDlg.setBackground(this.Background as SolidColorBrush);
            cDevDlg.ShowDialog();
        }
        private void saveBtn_Click(object sender, RoutedEventArgs e)
        {
            if (itemRadio_0.IsChecked.HasValue && itemRadio_0.IsChecked.Value) //save to device with name
            {
                if (pLstBox.SelectedIndex >= 0)
                {
                    var cnew = new CNewDeveName();
                    cnew.onsubmitNewDeviceChangedEvent += new CNewDeveName.submitNewDeviceChanged(onsubmitNewDevname);
                    cnew.Tag   = "presetChangeName";
                    cnew.Title = "Change Preset Name";
                    cnew.setSubTitle("Please input presetname:");
                    cnew.ShowDialog();
                }
                else
                {
                    edCpyPreStatus.Text = "You should select a position first.";
                }
            }
            else  //save current sence to local PC
            {
                saveDlg.InitialDirectory = System.AppDomain.CurrentDomain.BaseDirectory;
                saveDlg.Filter           = "MatrixPresets File|*.MCSP";//matrix Current Scene presetfile
                saveDlg.OverwritePrompt  = true;
                if (saveDlg.ShowDialog() == true)
                {
                    string strp     = saveDlg.FileName;
                    string fileName = System.IO.Path.GetFileNameWithoutExtension(strp);
                    // MessageBox.Show(fileName);
                    CMatrixData.matrixData.setPresetName(0, fileName);
                    _parentWin.onLineCheckCounter = 0;
                    CMatrixData.matrixData.resetCommunicateStatus();
                    byte[] mPData  = CMatrixData.matrixData.getPackageOfCurrentScene();
                    bool   resload = (IOBinaryOperation.writeBinaryToFile(strp, mPData));
                    edCpyPreStatus.Text = (resload ? "Sucessful saved to file!" : "Fail to save to file!");

                    // BitConverter.ToString(mFactoryData);//for show...
                }
            }
        }