Example #1
0
 private void ShowDetailStateOrScreen(string FieldName, string FieldValue)
 {
     if (FieldName.Contains("Screen"))
     {
         string screenPath = XDCUnity.eCATPath + @"\XDC\" + folderName + @"\Scripts\Screen" + XDCUnity.CurrentResourceIndex + @"\Host\000\" + FieldValue + ".txt";
         if (File.Exists(screenPath))
         {
             string           screenText       = XDCUnity.GetTxtFileText(screenPath);
             Form_ScreenParse form_ScreenParse = new Form_ScreenParse(screenText, currentProtocolType, FieldValue + ".txt");
             form_ScreenParse.Show();
         }
         else
         {
             MessageBox.Show("Do note Exists Screen File:" + screenPath);
         }
     }
     else if (FieldName.Contains("State"))
     {
         string statePath = XDCUnity.eCATPath + @"\XDC\" + folderName + @"\Scripts\State" + XDCUnity.CurrentResourceIndex + @"\Host\" + FieldValue + ".txt";
         if (File.Exists(statePath))
         {
             string        stateText  = XDCUnity.GetTxtFileText(statePath);
             Form_MsgDebug form_Debug = new Form_MsgDebug(stateText, currentProtocolType, DataType.State, FieldValue + ".txt");
             form_Debug.Show();
         }
         else
         {
             MessageBox.Show("Do note Exists State File:" + statePath);
         }
     }
 }
 private void Form_Left_SubFormEvent(object subControl, XDCProtocolType protocolType, DataType dataType)
 {
     {
         string text = XDCUnity.GetTxtFileText(subControl.ToString());
         //双击树节点,将数据传至主窗体并格式化显示
         if (dataType == DataType.Screen)
         {
             Form_ScreenParse form_ScreenParse = new Form_ScreenParse(text, protocolType, subControl.ToString());
             form_ScreenParse.Show();
         }
         else
         {
             form_MsgDebug.ParsFromSubForm(text, protocolType, dataType, subControl.ToString());
         }
     }
 }
Example #3
0
        private void DDCServerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem tmi = sender as ToolStripMenuItem;

            switch (tmi.Text)
            {
            case "ATMC":
            case "DDCServer":
            case "DDCServer-2":
            case "NDCServer":
            case "NDCServer-2":
            case "VirtualDualHost":
            {
                isAlreadyNDC_1     = false;
                isAlreadyNDC_2     = false;
                isAlareadyDualHost = false;
                isAlreadyDDC_1     = false;
                isAlreadyDDC_2     = false;
                isATMC             = false;
                foreach (DockContent dockContent in dockPanel1.Contents)
                {
                    if (dockContent.Name.Equals("Form_NDCServer"))
                    {
                        isAlreadyNDC_1 = true;
                    }
                    else if (dockContent.Name.Equals("Form_NDCServer_2"))
                    {
                        isAlreadyNDC_2 = true;
                    }
                    else if (dockContent.Name.Equals("Form_DDCServer"))
                    {
                        isAlreadyDDC_1 = true;
                    }
                    else if (dockContent.Name.Equals("Form_DDCServe2"))
                    {
                        isAlreadyDDC_2 = true;
                    }
                    else if (dockContent.Name.Equals("Form_DualHost"))
                    {
                        isAlareadyDualHost = true;
                    }
                    else if (dockContent.Name.Equals("Form_Managerment"))
                    {
                        isATMC = true;
                    }
                    if (tmi.Text.Equals(dockContent.Text))
                    {
                        dockContent.Select();
                        break;
                    }
                }
                if (tmi.Text == "NDCServer_2" && !isAlreadyNDC_2)
                {
                    Form_NDCServer_2 form_NDCServer2 = new Form_NDCServer_2();
                    form_NDCServer2.Show(this.dockPanel1, DockState.Document);
                }
                else if (tmi.Text == "NDCServer" && !isAlreadyNDC_1)
                {
                    Form_NDCServer form_NDCServer1 = new Form_NDCServer();
                    form_NDCServer1.Show(this.dockPanel1, DockState.Document);
                }
                else if (tmi.Text == "DDCServer" && !isAlreadyDDC_1)
                {
                    Form_DDCServer form_DDCServer1 = new Form_DDCServer();
                    form_DDCServer1.Show(this.dockPanel1, DockState.Document);
                }
                else if (tmi.Text == "DDCServer_2" && !isAlreadyDDC_2)
                {
                    MessageBox.Show("Comming Soon...");
                }
                else if (tmi.Text == "VirtualDualHost" && !isAlareadyDualHost)
                {
                    Form_DualHost form_DualHost = new Form_DualHost();
                    form_DualHost.Show(this.dockPanel1, DockState.Document);
                }
                else if (tmi.Text == "ATMC" && !isATMC)
                {
                    form_managerMentMain.Show(this.dockPanel1, DockState.Document);
                }
            }
            break;

            case "SuperParse":
            {
                Form_Pars form_Pars = new Form_Pars();
                form_Pars.Show();
            }
            break;

            case "ScreenParse":
            {
                Form_ScreenParse form_screenPars = new Form_ScreenParse();
                form_screenPars.Show();
            }
            break;

            case "eCAT":
            {
                From_Seeting_eCATPath form_eCAT = new From_Seeting_eCATPath();
                form_eCAT.Show();
            }
            break;

            case "KilleCAT":
            {
                KilleCATFunc();
            }
            break;

            case "StarteCAT":
            {
                StarteCATFunc();
            }
            break;

            case "eCATConfigTool":
            {
                System.Threading.Thread eCATToolThread = new System.Threading.Thread(eCATConfigToolFunc);
                eCATToolThread.IsBackground = true;
                eCATToolThread.Start();
                //eCATConfigToolFunc();
            }
            break;

            case "Open-eCAT":
            {
                //打开eCAT路径
                XDCUnity.OpenPath(XDCUnity.eCATPath);
            }
            break;

            case "Open-XDCHost":
            {
                //打开当前主机路径
                XDCUnity.OpenPath(Environment.CurrentDirectory);
            }
            break;

            case "Open-TrueBack":
            {
                //打开当前主机路径
                CheckTrueBackPath();
                string truebackPath = XDCUnity.TrueBackPath;
                truebackPath = truebackPath.Substring(0, truebackPath.LastIndexOf('\\'));
                XDCUnity.OpenPath(truebackPath);
            }
            break;

            case "ErrorCode":
            {
                Form_ErrorCodeSearch form_errorcode = new Form_ErrorCodeSearch();
                form_errorcode.Show();
            }
            break;

            case "InteractiveBuffer":
            {
                new Form_GetInteractiveMsgTextToShow("").Show();
            }
            break;

            case "About":
            {
                new Form_About().ShowDialog();
            }
            break;

            case "ImportLogsToAutoReply":
            {
                new Form_ImportLogs().Show();
            }
            break;

            case "Exit":
            {
                this.Close();
            }
            break;

            case "C09":
            {
                new Form_C09().Show();
            }
            break;

            default:
                break;
            }
        }