//设置设备状态 private void dbxEquipStatus_TextChanged(object sender, EventArgs e) { if (sender.GetType().Name.ToString() != "L3DataBox") { return; } AppSvrHMI.L3DataBox c = (AppSvrHMI.L3DataBox)sender; switch (c.Tag.ToString()) { //case "B1": // lbEquStaB1.Text = Set_BOF_EquipLableText(dbxEquStaBOF1.Text); // break; case "B2": lbEquStaB2.Text = Set_BOF_EquipLableText(dbxEquStaBOF2.Text); break; case "B3": lbEquStaB3.Text = Set_BOF_EquipLableText(dbxEquStaBOF3.Text); break; case "B4": lbEquStaB4.Text = Set_BOF_EquipLableText(dbxEquStaBOF4.Text); break; case "L1": lbEquStaL1.Text = Set_LF_EquipLableText(dbxEquStaLF1.Text); break; case "L2": lbEquStaL2.Text = Set_LF_EquipLableText(dbxEquStaLF2.Text); break; case "L3": lbEquStaL3.Text = Set_LF_EquipLableText(dbxEquStaLF3.Text); break; //Modify By HuYunHai BEGIN 2011-02-15 (新建5#LF炉) case "L5": lbEquStaL5.Text = Set_LF_EquipLableText((dbxEquStaLF5.Text)); break; //Modify By HuYunHai BEGIN 2011-02-15 //add by hyh 2012-05-10 case "L4": lbEquStaL4.Text = Set_LF_EquipLableText((dbxEquStaLF4.Text)); break; //end case "R1": lbEquStaR1.Text = Set_RH_EquipLableText(dbxEquStaRH1.Text); break; // Modify By HuYunHai Begin 2011-02-14 (1#连铸机修改为7#连铸机,删除2#连铸机) case "C7": lbEquStaC7.Text = Set_CCM_EquipLableText(dbxEquStaCCM7.Text); break; //case "C2": // lbEquStaC2.Text = Set_CCM_EquipLableText(dbxEquStaCCM2.Text); // break; // Modify By HuYunHai End 2011-02-14 case "C3": lbEquStaC3.Text = Set_CCM_EquipLableText(dbxEquStaCCM3.Text); break; case "C4": lbEquStaC4.Text = Set_CCM_EquipLableText(dbxEquStaCCM4.Text); break; case "C5": lbEquStaC5.Text = Set_CCM_EquipLableText(dbxEquStaCCM5.Text); break; //add by hyh 2012-05-10 case "C6": lbEquStaC6.Text = Set_CCM_EquipLableText(dbxEquStaCCM6.Text); break; //end case "D1": lbEquStaD1.Text = Set_DeS_EquipLableText(dbxEquStaDeS1.Text); break; case "D2": lbEquStaD2.Text = Set_DeS_EquipLableText(dbxEquStaDeS2.Text); break; case "D1T": txtDeSIDeSType.Text = Set_DeS_DeSType(txtDeSType1.Text); break; case "D2T": txtDeSIIDeSType.Text = Set_DeS_DeSType(txtDeSType2.Text); break; default: break; } }
private void ReCalculateMix() { try { double Weight = 0, Mn = 0, P = 0, S = 0, Ti = 0, Si = 0, C = 0; //add by hyh 2012-4-7 double Sn = 0, Sb = 0, As = 0, Pb = 0; //end //add by hyh 2012-08-13 Ó¦ÒµÎñ·½ÒªÇóÐÂÔö£ºNi(Äø)¡¢Mo(îâ)¡¢Cu(Í) ¡¢Cr(¸õ)¡¢B(Åð)¡¢V(·°)¡¢Al(ÂÁ)¡¢Nb(îê)¡¢Zn(п)¡¢W(ÎÙ) double Ni = 0, Mo = 0, Cu = 0, Cr = 0, B = 0, V = 0, Al = 0, Nb = 0, Zn = 0, W = 0; // The exist data if (dsMixInfos.Tables.Count < 1 || dsMixInfos.Tables[0].Rows.Count < 1) { return; } foreach (Control ctrl in tabPageMIF.Controls) { if (!(ctrl is AppSvrHMI.L3DataBox)) { continue; } AppSvrHMI.L3DataBox tx = ctrl as AppSvrHMI.L3DataBox; tx.LoadData(); } Weight = double.Parse(txWeight.Text); Mn = Weight * double.Parse(txMn.Text); if (Mn == 0) { Mn = Weight * double.Parse(txMn_Cal.Text); } P = Weight * double.Parse(txP.Text); if (P == 0) { P = Weight * double.Parse(txP_Cal.Text); } S = Weight * double.Parse(txS.Text); if (S == 0) { S = Weight * double.Parse(txS_Cal.Text); } Ti = Weight * double.Parse(txTi.Text); if (Ti == 0) { Ti = Weight * double.Parse(txTi_Cal.Text); } Si = Weight * double.Parse(txSi.Text); if (Si == 0) { Si = Weight * double.Parse(txSi_Cal.Text); } C = Weight * double.Parse(txC.Text); if (C == 0) { C = Weight * double.Parse(txC_Cal.Text); } //add by hyh 2012-4-7 Sn = Weight * double.Parse(txSn.Text); if (Sn == 0) { Sn = Weight * double.Parse(txSn_Cal.Text); } Sb = Weight * double.Parse(txSb.Text); if (Sb == 0) { Sb = Weight * double.Parse(txSb_Cal.Text); } As = Weight * double.Parse(txAs.Text); if (As == 0) { As = Weight * double.Parse(txAs_Cal.Text); } Pb = Weight * double.Parse(txPb.Text); if (Pb == 0) { Pb = Weight * double.Parse(txPb_Cal.Text); } //end //add by hyh 2012-08-13 Ó¦ÒµÎñ·½ÒªÇóÐÂÔö£ºNi(Äø)¡¢Mo(îâ)¡¢Cu(Í) ¡¢Cr(¸õ)¡¢B(Åð)¡¢V(·°)¡¢Al(ÂÁ)¡¢Nb(îê)¡¢Zn(п)¡¢W(ÎÙ) Ni = Weight * double.Parse(txNi.Text); if (Ni == 0) { Ni = Weight * double.Parse(txNi_Cal.Text); } Mo = Weight * double.Parse(txMo.Text); if (Mo == 0) { Mo = Weight * double.Parse(txMo_Cal.Text); } Cu = Weight * double.Parse(txCu.Text); if (Cu == 0) { Cu = Weight * double.Parse(txCu_Cal.Text); } Cr = Weight * double.Parse(txCr.Text); if (Cr == 0) { Cr = Weight * double.Parse(txCr_Cal.Text); } B = Weight * double.Parse(txB.Text); if (B == 0) { B = Weight * double.Parse(txB_Cal.Text); } V = Weight * double.Parse(txV.Text); if (V == 0) { V = Weight * double.Parse(txV_Cal.Text); } Al = Weight * double.Parse(txAl.Text); if (Al == 0) { Al = Weight * double.Parse(txAl_Cal.Text); } Nb = Weight * double.Parse(txNb.Text); if (Nb == 0) { Nb = Weight * double.Parse(txNb_Cal.Text); } Zn = Weight * double.Parse(txZn.Text); if (Zn == 0) { Zn = Weight * double.Parse(txZn_Cal.Text); } W = Weight * double.Parse(txW.Text); if (W == 0) { W = Weight * double.Parse(txW_Cal.Text); } //end // New mix data foreach (DataRow rowMix in dsMixInfos.Tables[0].Rows) { if (rowMix.RowState == DataRowState.Deleted) { continue; } double fWeight = (float)rowMix["Net_Weight"]; double fMn = (float)rowMix["Mn"]; double fP = (float)rowMix["P"]; double fS = (float)rowMix["S"]; double fTi = (float)rowMix["Ti"]; double fSi = (float)rowMix["Si"]; double fC = (float)rowMix["C"]; //add by hyh 2012-4-7 double fSn = (float)rowMix["Sn"]; double fSb = (float)rowMix["Sb"]; double fAs = (float)rowMix["As"]; double fPb = (float)rowMix["Pb"]; //end //add by hyh 2012-08-13 Ó¦ÒµÎñ·½ÒªÇóÐÂÔö£ºNi(Äø)¡¢Mo(îâ)¡¢Cu(Í) ¡¢Cr(¸õ)¡¢B(Åð)¡¢V(·°)¡¢Al(ÂÁ)¡¢Nb(îê)¡¢Zn(п)¡¢W(ÎÙ) double fNi = (float)rowMix["Ni"]; double fMo = (float)rowMix["Mo"]; double fCu = (float)rowMix["Cu"]; double fCr = (float)rowMix["Cr"]; double fB = (float)rowMix["B"]; double fV = (float)rowMix["V"]; double fAl = (float)rowMix["Al"]; double fNb = (float)rowMix["Nb"]; double fZn = (float)rowMix["Zn"]; double fW = (float)rowMix["W"]; //end Weight += fWeight; Mn += fWeight * fMn; P += fWeight * fP; S += fWeight * fS; Ti += fWeight * fTi; Si += fWeight * fSi; C += fWeight * fC; //add by hyh 2012-4-7 Sn += fWeight * fSn; Sb += fWeight * fSb; As += fWeight * fAs; Pb += fWeight * fPb; //end //add by hyh 2012-08-13 Ó¦ÒµÎñ·½ÒªÇóÐÂÔö£ºNi(Äø)¡¢Mo(îâ)¡¢Cu(Í) ¡¢Cr(¸õ)¡¢B(Åð)¡¢V(·°)¡¢Al(ÂÁ)¡¢Nb(îê)¡¢Zn(п)¡¢W(ÎÙ) Ni += fWeight * fNi; Mo += fWeight * fMo; Cu += fWeight * fCu; Cr += fWeight * fCr; B += fWeight * fB; V += fWeight * fV; Al += fWeight * fAl; Nb += fWeight * fNb; Zn += fWeight * fZn; W += fWeight * fW; //end } Mn = Mn / Weight; P = P / Weight; S = S / Weight; Ti = Ti / Weight; Si = Si / Weight; C = C / Weight; txWeight_Cal.Text = Weight.ToString(); txMn_Cal.Text = Mn.ToString(); txP_Cal.Text = P.ToString(); txS_Cal.Text = S.ToString(); txTi_Cal.Text = Ti.ToString(); txSi_Cal.Text = Si.ToString(); txC_Cal.Text = C.ToString(); //add by hyh 2012-4-7 Sn = Sn / Weight; Sb = Sb / Weight; As = As / Weight; Pb = Pb / Weight; txSn_Cal.Text = Sn.ToString(); txSb_Cal.Text = Sb.ToString(); txAs_Cal.Text = As.ToString(); txPb_Cal.Text = Pb.ToString(); //end //add by hyh 2012-08-13 Ó¦ÒµÎñ·½ÒªÇóÐÂÔö£ºNi(Äø)¡¢Mo(îâ)¡¢Cu(Í) ¡¢Cr(¸õ)¡¢B(Åð)¡¢V(·°)¡¢Al(ÂÁ)¡¢Nb(îê)¡¢Zn(п)¡¢W(ÎÙ) Ni = Ni / Weight; Mo = Mo / Weight; Cu = Cu / Weight; Cr = Cr / Weight; B = B / Weight; V = V / Weight; Al = Al / Weight; Nb = Nb / Weight; Zn = Zn / Weight; W = W / Weight; txNi_Cal.Text = Ni.ToString(); txMo_Cal.Text = Mo.ToString(); txCu_Cal.Text = Cr.ToString(); txCr_Cal.Text = Sn.ToString(); txB_Cal.Text = B.ToString(); txV_Cal.Text = V.ToString(); txAl_Cal.Text = Al.ToString(); txNb_Cal.Text = Nb.ToString(); txZn_Cal.Text = Zn.ToString(); txW_Cal.Text = W.ToString(); //END } catch { } }