static public void Create() { BusySets = new UlBinSets(1); State = EClientState.Openning; //Ini = new UlIniFile(csConfigIniFName); Ip = GetLocalIP(); UserNo = -1; Authority = EUserAuthority.Viewer; Tag = new NameTag(Ini); //TLog = new UlLogger(); //TLog.Path = Ini.GetString("Log", "TotalPath"); //TLog.FName = Ini.GetString("Log", "TotalFileName"); //TLog.AddHead("NOTE"); //TLog.AddHead("ERROR"); //TLog.AddHead("EXCEPTION"); Client = new CalorimeterClient(Ini); Settings = new TestSettings(Ini); Settings.Load(); TestDB = new List <CalorimeterTestDatabase>(); TestDB.Add(new CalorimeterTestDatabase()); TestDB.Add(new CalorimeterTestDatabase()); TestDB.Add(new CalorimeterTestDatabase()); TestDB.Add(new CalorimeterTestDatabase()); for (int i = 0; i < 4; i++) { TestDB[i].Database = Ini.GetString("Database", "FileName"); TestDB[i].Open(); } ViewDB = new CalorimeterViewDatabase(); ViewDB.Database = Ini.GetString("Database", "FileName"); ViewDB.Open(); ConfigDB = new CalorimeterConfigDatabase(); ConfigDB.Database = Ini.GetString("Database", "FileName"); ConfigDB.Open(); }
private void Initialize() { db = Resource.ConfigDB; mode = EDataSetMode.View; bookmark = new GridBookmark(scheduleGridView); viewEdits = new List <TextEdit>(); viewEdits.Add(standardEdit); viewEdits.Add(nameEdit); viewEdits.Add(noSteadyEdit); viewEdits.Add(preparationEdit); viewEdits.Add(judgementEdit); viewEdits.Add(repeatEdit); id1Edits = new List <TextEdit>(); id1Edits.Add(id1EdbSetupEdit); id1Edits.Add(id1EdbAvgEdit); id1Edits.Add(id1EdbDevEdit); id1Edits.Add(id1EwbSetupEdit); id1Edits.Add(id1EwbAvgEdit); id1Edits.Add(id1EwbDevEdit); id1Edits.Add(id1Ldb1DevEdit); id1Edits.Add(id1Lwb1DevEdit); id1Edits.Add(id1Airflow1DevEdit); id1Edits.Add(id1Ldb2DevEdit); id1Edits.Add(id1Lwb2DevEdit); id1Edits.Add(id1Airflow2DevEdit); id1Edits.Add(id1Cdp1SetupEdit); id1Edits.Add(id1Cdp1AvgEdit); id1Edits.Add(id1Cdp1DevEdit); id1Edits.Add(id1Cdp2SetupEdit); id1Edits.Add(id1Cdp2AvgEdit); id1Edits.Add(id1Cdp2DevEdit); id2Edits = new List <TextEdit>(); id2Edits.Add(id2EdbSetupEdit); id2Edits.Add(id2EdbAvgEdit); id2Edits.Add(id2EdbDevEdit); id2Edits.Add(id2EwbSetupEdit); id2Edits.Add(id2EwbAvgEdit); id2Edits.Add(id2EwbDevEdit); id2Edits.Add(id2Ldb1DevEdit); id2Edits.Add(id2Lwb1DevEdit); id2Edits.Add(id2Airflow1DevEdit); id2Edits.Add(id2Ldb2DevEdit); id2Edits.Add(id2Lwb2DevEdit); id2Edits.Add(id2Airflow2DevEdit); id2Edits.Add(id2Cdp1SetupEdit); id2Edits.Add(id2Cdp1AvgEdit); id2Edits.Add(id2Cdp1DevEdit); id2Edits.Add(id2Cdp2SetupEdit); id2Edits.Add(id2Cdp2AvgEdit); id2Edits.Add(id2Cdp2DevEdit); odEdits = new List <TextEdit>(); odEdits.Add(odEdbSetupEdit); odEdits.Add(odEdbAvgEdit); odEdits.Add(odEdbDevEdit); odEdits.Add(odEwbSetupEdit); odEdits.Add(odEwbAvgEdit); odEdits.Add(odEwbDevEdit); odEdits.Add(odEdpSetupEdit); odEdits.Add(odEdpAvgEdit); odEdits.Add(odEdpDevEdit); odEdits.Add(odVolt1SetupEdit); odEdits.Add(odVolt1AvgEdit); odEdits.Add(odVolt1DevEdit); odEdits.Add(odVolt2SetupEdit); odEdits.Add(odVolt2AvgEdit); odEdits.Add(odVolt2DevEdit); viewGrids = new List <AdvBandedGridView>(); viewGrids.Add(indoor1GridView); viewGrids.Add(indoor2GridView); viewGrids.Add(outdoorGridView); chamberParams = new List <ChamberParams>(); chamberParams.Add(new ChamberParams()); indoor1Grid.DataSource = chamberParams; indoor2Grid.DataSource = chamberParams; outdoorGrid.DataSource = chamberParams; NameValue <EIndoorUse>[] inUseItems = EnumHelper.GetNameValues <EIndoorUse>(); indoor1UseLookUp.DataSource = inUseItems; indoor1UseLookUp.DisplayMember = "Name"; indoor1UseLookUp.ValueMember = "Value"; indoor1UseLookUp.KeyMember = "Value"; indoor2UseLookUp.DataSource = inUseItems; indoor2UseLookUp.DisplayMember = "Name"; indoor2UseLookUp.ValueMember = "Value"; indoor2UseLookUp.KeyMember = "Value"; NameValue <EIndoorMode>[] modeItems = EnumHelper.GetNameValues <EIndoorMode>(); indoor1ModeLookUp.DataSource = modeItems; indoor1ModeLookUp.DisplayMember = "Name"; indoor1ModeLookUp.ValueMember = "Value"; indoor1ModeLookUp.KeyMember = "Value"; indoor2ModeLookUp.DataSource = modeItems; indoor2ModeLookUp.DisplayMember = "Name"; indoor2ModeLookUp.ValueMember = "Value"; indoor2ModeLookUp.KeyMember = "Value"; NameValue <EIndoorDuct>[] ductItems = EnumHelper.GetNameValues <EIndoorDuct>(); indoor1DuctLookUp.DataSource = ductItems; indoor1DuctLookUp.DisplayMember = "Name"; indoor1DuctLookUp.ValueMember = "Value"; indoor1DuctLookUp.KeyMember = "Value"; indoor2DuctLookUp.DataSource = ductItems; indoor2DuctLookUp.DisplayMember = "Name"; indoor2DuctLookUp.ValueMember = "Value"; indoor2DuctLookUp.KeyMember = "Value"; NameValue <EOutdoorUse>[] outUseItems = EnumHelper.GetNameValues <EOutdoorUse>(); outdoorUseLookUp.DataSource = outUseItems; outdoorUseLookUp.DisplayMember = "Name"; outdoorUseLookUp.ValueMember = "Value"; outdoorUseLookUp.KeyMember = "Value"; NameValue <EEtcUse>[] etcUseItems = EnumHelper.GetNameValues <EEtcUse>(); outdoorEtcUseLookUp.DataSource = etcUseItems; outdoorEtcUseLookUp.DisplayMember = "Name"; outdoorEtcUseLookUp.ValueMember = "Value"; outdoorEtcUseLookUp.KeyMember = "Value"; string format; string devFormat; foreach (TextEdit edit in id1Edits) { switch (int.Parse(((string)edit.Tag).ToString())) { // Temperature Edit case 0: format = Resource.Variables.Measured["ID11.Entering.DB"].Format; devFormat = ToDevFormat(format); break; // Air Flow Edit case 1: format = Resource.Variables.Calcurated["ID11.Air.Flow.Lev"].Format; devFormat = ToDevFormat(format); break; // Diff. Pressure Edit case 2: format = Resource.Variables.Measured["ID11.Nozzle.Diff.Pressure"].Format; devFormat = ToDevFormat(format); break; default: format = "0.0"; devFormat = "f1"; break; } edit.EditValue = 0f; edit.Properties.Mask.EditMask = devFormat; edit.Properties.DisplayFormat.FormatString = devFormat; edit.Properties.EditFormat.FormatString = devFormat; } foreach (TextEdit edit in id2Edits) { switch (int.Parse(((string)edit.Tag).ToString())) { // Temperature Edit case 0: format = Resource.Variables.Measured["ID21.Entering.DB"].Format; devFormat = ToDevFormat(format); break; // Air Flow Edit case 1: format = Resource.Variables.Calcurated["ID21.Air.Flow.Lev"].Format; devFormat = ToDevFormat(format); break; // Diff. Pressure Edit case 2: format = Resource.Variables.Measured["ID21.Nozzle.Diff.Pressure"].Format; devFormat = ToDevFormat(format); break; default: format = "0.0"; devFormat = "f1"; break; } edit.EditValue = 0f; edit.Properties.Mask.EditMask = devFormat; edit.Properties.DisplayFormat.FormatString = devFormat; edit.Properties.EditFormat.FormatString = devFormat; } foreach (TextEdit edit in odEdits) { switch (int.Parse(((string)edit.Tag).ToString())) { // Temperature Edit case 0: format = Resource.Variables.Measured["OD.Entering.DB"].Format; devFormat = ToDevFormat(format); break; // Air Flow Edit case 1: format = Resource.Variables.Calcurated["ID1.IDU.Voltage"].Format; devFormat = ToDevFormat(format); break; default: format = "0.0"; devFormat = "f1"; break; } edit.EditValue = 0f; edit.Properties.Mask.EditMask = devFormat; edit.Properties.DisplayFormat.FormatString = devFormat; edit.Properties.EditFormat.FormatString = devFormat; } }
private void Initialize() { Color evenColor = Color.FromArgb(244, 244, 236); db = Resource.ConfigDB; mode = EDataSetMode.View; bookmark = new GridBookmark(conditionGridView); int length = Resource.Tag.ThermoLength / 3; id1TCs = new List <MeasureRow>(); id2TCs = new List <MeasureRow>(); odTCs = new List <MeasureRow>(); for (int i = 0; i < length; i++) { id1TCs.Add(new MeasureRow(null, "", "", i + 1)); id2TCs.Add(new MeasureRow(null, "", "", i + length + 1)); odTCs.Add(new MeasureRow(null, "", "", i + length * 2 + 1)); } presses = new List <MeasureRow>(); for (int i = 0; i < Resource.Tag.PressLength; i++) { presses.Add(new MeasureRow(null, "", "", i + 1)); } thermo1Grid.DataSource = id1TCs; thermo1GridView.Appearance.EvenRow.BackColor = evenColor; thermo1GridView.OptionsView.EnableAppearanceEvenRow = true; thermo2Grid.DataSource = id2TCs; thermo2GridView.Appearance.EvenRow.BackColor = evenColor; thermo2GridView.OptionsView.EnableAppearanceEvenRow = true; thermo3Grid.DataSource = odTCs; thermo3GridView.Appearance.EvenRow.BackColor = evenColor; thermo3GridView.OptionsView.EnableAppearanceEvenRow = true; thermoTagGrid.DataSource = Resource.Tag.Thermos; thermoTagGridView.Appearance.EvenRow.BackColor = evenColor; thermoTagGridView.OptionsView.EnableAppearanceEvenRow = true; pressureGrid.DataSource = presses; pressureGridView.Appearance.EvenRow.BackColor = evenColor; pressureGridView.OptionsView.EnableAppearanceEvenRow = true; pressureTagGrid.DataSource = Resource.Tag.Presses; pressureTagGridView.Appearance.EvenRow.BackColor = evenColor; pressureTagGridView.OptionsView.EnableAppearanceEvenRow = true; methodCapaCoolingUnitCombo.DisplayMember = "Name"; methodCapaCoolingUnitCombo.ValueMember = "Value"; methodCapaCoolingUnitCombo.DataSource = EnumHelper.GetNameValues <EUnitCapacity>(); methodCapaHeatingUnitCombo.DisplayMember = "Name"; methodCapaHeatingUnitCombo.ValueMember = "Value"; methodCapaHeatingUnitCombo.DataSource = EnumHelper.GetNameValues <EUnitCapacity>(); foreach (TabPage page in ratedTab.TabPages) { EConditionRated index = (EConditionRated)int.Parse(page.Tag.ToString()); CtrlTestRated ctrl = new CtrlTestRated(index, Resource.Variables.Graph); ctrl.CalcCapacity += DoCalcCapacity; ctrl.ChangedPowerMeter += DoChangedPowerMeter; page.Controls.Add(ctrl); } noteEdits = new List <TextEdit>(); noteEdits.Add(noteCompanyEdit); noteEdits.Add(noteTestNameEdit); noteEdits.Add(noteTestNoEdit); noteEdits.Add(noteObserverEdit); noteEdits.Add(noteMakerEdit); noteEdits.Add(noteModel1Edit); noteEdits.Add(noteSerial1Edit); noteEdits.Add(noteModel2Edit); noteEdits.Add(noteSerial2Edit); noteEdits.Add(noteModel3Edit); noteEdits.Add(noteSerial3Edit); noteEdits.Add(noteExpDeviceEdit); noteEdits.Add(noteRefChargeEdit); noteEdits.Add(noteMemoEdit); gridViews = new List <GridView>(); gridViews.Add(thermo1GridView); gridViews.Add(thermo2GridView); gridViews.Add(thermo3GridView); gridViews.Add(thermoTagGridView); gridViews.Add(pressureGridView); gridViews.Add(pressureTagGridView); SetPanelActive(true); }