示例#1
0
文件: FrmMain.cs 项目: rwlamont/GLEON
        private void setBoxesFromGLEONCoding(int index, string input)
        {
            HeaderRecgonition hRec = new HeaderRecgonition();
            if(hRec.isHeaderInStandardVariableFormat(input))
            {
                string comboMainName = index + "ComboMain";
                Control comboMaintemp = panelVariableControls.Controls[comboMainName];
                ComboBox comboMain = comboMaintemp as ComboBox;
                string combo2Name = index + "Combo2";
                Control combo2temp = panelVariableControls.Controls[combo2Name];
                ComboBox combo2 = combo2temp as ComboBox;
                string combo3Name = index + "Combo3";
                Control combo3temp = panelVariableControls.Controls[combo3Name];
                ComboBox combo3 = combo3temp as ComboBox;
                string combo4Name = index + "Combo4";
                Control combo4temp = panelVariableControls.Controls[combo4Name];
                ComboBox combo4 = combo4temp as ComboBox;
                string Text1Name = index + "Text1";
                Control Text1temp = panelVariableControls.Controls[Text1Name];
                TextBox Text1 = Text1temp as TextBox;
                string temp = "";
                comboMain.Text = "Variable";
                foreach(testTypeUnits tTU in GLEONCodeData)
                {
                    if(tTU.testCode == input.Substring(0,input.IndexOf("_")))
                    {
                        combo2.Text = tTU.testName;
                    }
                }
                combo3.Text = input.Substring(input.IndexOf("(") + 1, (input.IndexOf(")") - (input.IndexOf("(") + 1)));
                foreach (string displacement in combo4.Items)
                {
                    if (input.Substring(input.IndexOf("_") + 1, 1) == displacement.Substring(0,1))
                    {
                        combo4.Text = displacement;
                        temp = input.Substring(input.IndexOf("_") + 1, 1);
                        if (hRec.getHeaderType(input) == "dhem")
                        {
                            Text1.Text = input.Substring(input.IndexOf(temp) + 1, input.IndexOf("(") - input.IndexOf(temp) + 1);
                        }
                        if(hRec.getHeaderType(input) == "i")
                        {
                            Text1.Text = input.Substring(input.IndexOf(temp) + 1, input.IndexOf("-") - input.IndexOf(temp) + 1);
                        }

                    }
                }

            }
        }
示例#2
0
文件: FrmMain.cs 项目: rwlamont/GLEON
 private void autoDetectHeadersForPanel()
 {
     HeaderRecgonition hRec = new HeaderRecgonition();
     foreach(DataGridCell header in dataViewer.Rows[0].Cells)
     {
             int index = Convert.ToInt16(header.ColumnNumber);
             string comboMainName = index + "ComboMain";
             Control comboMaintemp = panelVariableControls.Controls[comboMainName];
             ComboBox comboMain = comboMaintemp as ComboBox;
             string combo2Name = index + "Combo2";
             Control combo2temp = panelVariableControls.Controls[combo2Name];
             ComboBox combo2 = combo2temp as ComboBox;
             string combo3Name = index + "Combo3";
             Control combo3temp = panelVariableControls.Controls[combo3Name];
             ComboBox combo3 = combo3temp as ComboBox;
            string combo4Name = index + "Combo4";
             Control combo4temp = panelVariableControls.Controls[combo4Name];
             ComboBox combo4 = combo4temp as ComboBox;
             string Text1Name = index + "Text1";
             Control Text1temp = panelVariableControls.Controls[Text1Name];
             TextBox Text1 = Text1temp as TextBox;
             if(hRec.getHeaderType(header.ToString()) == "DateTime")
             {
                 comboMain.Text = "DateTime";
             }
             else if(hRec.getHeaderType(header.ToString()) == "dhem" || hRec.getHeaderType(header.ToString()) == "i" || hRec.getHeaderType(header.ToString()) == "vn")
             {
                 comboMain.Text = "Variable";
             }
     }
 }