public NodeElement_Wiring GetNodeElement_Wiring_CH(string model, string powerSupply, string powerLineType, double powerCurrent) { string strPowerLineType = "//"; string strPower = ""; string strPowerPhaseNumber = ""; if (!string.IsNullOrEmpty(powerSupply)) { strPower = powerSupply; string[] strs1 = powerSupply.Split(new string[] { "=>" }, StringSplitOptions.None); if (strs1.Length > 1) { strPowerPhaseNumber = strs1[0].Trim(); strPower = strs1[1].Trim(); } } if (!string.IsNullOrEmpty(powerLineType)) { if (powerLineType == "2") { strPowerLineType = "//"; } else if (powerLineType == "3") { strPowerLineType = "///"; } else if (powerLineType == "4") { strPowerLineType = "////"; } } if (powerCurrent > 0) { strPower += "/" + powerCurrent.ToString() + "A"; } string brandCode = "H"; NodeElement_Wiring item = new NodeElement_Wiring("CH", model, 1, model, strPowerPhaseNumber, strPower, strPowerLineType, brandCode); return(item); }
private void DoDrawingWiring(ng.SystemVRF sysItem, ng.WiringNodeOut nodeOut, string imgDir) { Node textNode; drawing.Point ptText = new drawing.Point(); drawing.PointF nodeOutPointF = new drawing.PointF(); NodeElement_Wiring item_wiring = utilWiring.GetNodeElement_Wiring_ODU(sysItem.OutdoorItem, thisProject.BrandCode); nodeOut.Location = new Point(10f, UtilPiping.HeightForNodeText + UtilPiping.OutdoorOffset_Y_wiring + 36f); string imgFile = System.IO.Path.Combine(imgDir, item_wiring.KeyName + ".png"); utilWiring.setNode_wiring(nodeOut, imgFile, addFlowWiring); drawing.PointF ptf1 = new drawing.PointF((float)(nodeOut.Location.X + 140), (float)(nodeOut.Location.Y + 20)); drawing.PointF ptf2 = new drawing.PointF(ptf1.X + 74, ptf1.Y + 4); drawing.PointF ptf3 = new drawing.PointF(ptf2.X - 10, ptf2.Y); ptArrayList_ground.Add(new drawing.PointF[] { ptf1, ptf2, ptf3 }); string text = ""; ptText = item_wiring.PtNodeNames[0]; text = sysItem.Name; utilWiring.createTextNode_wiring(text, ptText, nodeOut); if (item_wiring.UnitCount > 1) { text = sysItem.OutdoorItem.AuxModelName; utilWiring.createTextNode_wiring(text, item_wiring.PtNodeNames[1], nodeOut); } utilWiring.createTextNode_wiring(item_wiring.Str1, item_wiring.PtStr1, nodeOut); nodeOutPointF = utilWiring.convertSystemPointToDrawingPoint(nodeOut.Location); for (int i = 0; i < item_wiring.UnitCount; ++i) { ptf1 = UtilEMF.OffsetLocation(item_wiring.PtStrGroupLine2L[i], nodeOutPointF); ptf2 = UtilEMF.OffsetLocation(item_wiring.PtStrGroupLine2R[i], nodeOutPointF); ptArrayList_power.Add(new drawing.PointF[] { ptf1, ptf2 }); if (i < item_wiring.ModelGroup.Length) { utilWiring.createTextNode_wiring(item_wiring.ModelGroup[i], item_wiring.PtModelGroup[i], nodeOut); } if (item_wiring.ModelGroup.Length > 1 && i < item_wiring.StrGroup1.Length) { utilWiring.createTextNode_wiring(item_wiring.StrGroup1[i], item_wiring.PtStrGroup1[i], nodeOut); } if (i < item_wiring.StrGroup2.Length) { utilWiring.createTextNode_wiring(item_wiring.StrGroup2[i], item_wiring.PtStrGroup2[i], nodeOut); } if (i < item_wiring.StrGroup3.Length) { utilWiring.createTextNode_wiring(item_wiring.StrGroup3[i], item_wiring.PtStrGroup3[i], nodeOut); } if (i < item_wiring.StrGroup4.Length) { utilWiring.createTextNode_wiring(item_wiring.StrGroup4[i], item_wiring.PtStrGroup4[i], nodeOut, true); } } drawing.PointF ptf4 = new drawing.PointF(0, 0); drawing.PointF ptf5 = new drawing.PointF(0, 0); ptText = item_wiring.PtNodeNames[0]; ptText.Y += Convert.ToInt32(UtilPiping.HeightForNodeText / 2); List <ng.WiringNodeIn> sortNodeInList = getSortNodeInList(nodeOut); if (sortNodeInList == null) { return; } List <ng.WiringNodeIn> wiringNodeInList = new List <ng.WiringNodeIn>(); DrawWiringNodes(nodeOut, sortNodeInList.ToList <ng.WiringNode>(), wiringNodeInList, imgDir, false); DrawWiringRemoteControllers(wiringNodeInList, imgDir); for (int i = 0; i < strArrayList_powerType.Count; i++) { ptArrayList_power.Add(ptArrayList_mainpower[i]); ptf4 = ptArrayList_mainpower[i][1]; text = strArrayList_powerVoltage[i] + "/" + dArrayList_powerCurrent[i].ToString() + "A"; textNode = utilWiring.createTextNode_wiring(text, new drawing.PointF(ptf4.X + 122, ptf4.Y + 2)); addFlowWiring.AddNode(textNode); text = strArrayList_powerType[i]; textNode = utilWiring.createTextNode_wiring(text, new drawing.PointF(ptf4.X + 166, ptf4.Y - 12)); addFlowWiring.AddNode(textNode); } DrawWiringLegend(nodeOut); foreach (drawing.PointF[] pt in ptArrayList) { Node nd1 = utilWiring.createLinePoint(pt[0]); addFlowWiring.AddNode(nd1); Node nd2 = utilWiring.createLinePoint(pt[pt.Length - 1]); addFlowWiring.AddNode(nd2); //Link lnk1 = utilWiring.createLine(); Link lnk1 = utilWiring.createLine(nd1, nd2, "", addFlowWiring); //nd1.OutLinks.Add(lnk1, nd2); addFlowWiring.AddLink(lnk1); if (pt.Length > 2) { var pt1 = utilWiring.convertPointFToWinPoint(pt[1]); lnk1.AddPoint(pt1); } } foreach (drawing.PointF[] pt in ptArrayList_power) { Node nd1 = utilWiring.createLinePoint(pt[0]); //addFlowWiring.Nodes.Add(nd1); addFlowWiring.AddNode(nd1); Node nd2 = utilWiring.createLinePoint(pt[pt.Length - 1]); Link lnk1 = utilWiring.createLine(nd1, nd2, "", addFlowWiring); if (pt.Length > 2) { lnk1.LineStyle = LineStyle.VH; } //lnk1.Jump = Jump.Arc; //lnk1.DrawWidth = 1; lnk1.StrokeThickness = 1; //lnk1.DrawColor = Color.Red; lnk1.Stroke = System.Windows.Media.Brushes.Red; //nd1.OutLinks.Add(lnk1, nd2); addFlowWiring.AddLink(lnk1); } foreach (drawing.PointF[] pt in ptArrayList_ground) { if (pt.Length > 2) { ng.MyNodeGround_Wiring nodeground = new ng.MyNodeGround_Wiring(); nodeground.Location = new Point(pt[2].X, pt[2].Y); imgFile = System.IO.Path.Combine(imgDir, "Ground.png"); utilWiring.setNode_wiring(nodeground, imgFile, addFlowWiring); //nodeground.DrawColor = Color.Transparent; } Node nd1 = utilWiring.createLinePoint(pt[0]); //addFlowWiring.Nodes.Add(nd1); addFlowWiring.AddNode(nd1); Node nd2 = utilWiring.createLinePoint(pt[1]); Link lnk1 = utilWiring.createLine(nd1, nd2, "", addFlowWiring); lnk1.DashStyle = DashStyles.Dash; //nd1.OutLinks.Add(lnk1, nd2); addFlowWiring.AddLink(lnk1); } }
public NodeElement_Wiring GetNodeElement_Wiring_IDU(old.Indoor inItem, string brandCode, string outType, ref List <string> strArrayList_powerType, ref List <string> strArrayList_powerVoltage, ref List <double> dArrayList_powerCurrent, ref int powerIndex, ref bool isNewPower) { string model = inItem.Model_York; if (inItem.Model_York == "-") { model = inItem.ModelFull; } if (brandCode == "H") { model = inItem.Model_Hitachi; } if (outType.Contains("YVAHP") || outType.Contains("YVAHR")) { if (inItem.Model_York == "-") { model = inItem.ModelFull; } else { model = inItem.Model_York; } } string powerSupplyCode = inItem.ModelFull.Substring(inItem.ModelFull.Length - 4, 1); JCHVRF.DAL.MyDictionaryDAL dicdal = new JCHVRF.DAL.MyDictionaryDAL(); old.MyDictionary dic = dicdal.GetItem(old.MyDictionary.DictionaryType.PowerSupply, powerSupplyCode); string strPowerLineType = "//"; string strPowerPhaseNumber = "R S"; if (dic.Name.Contains("3Ph")) { strPowerLineType = "////"; strPowerPhaseNumber = "L1L2L3N"; } if (powerSupplyCode == "R") { strPowerLineType = "///"; strPowerPhaseNumber = "R S T"; } string strPower = dic.Name; bool isFound = false; for (int i = 0; i < strArrayList_powerType.Count; i++) { string compatPower = GetCompatiblePowerVoltage(strPower, strArrayList_powerVoltage[i]); if (!string.IsNullOrEmpty(compatPower)) { strPower = compatPower; isFound = true; powerIndex = i; break; } } if (!isFound) { string strPowerPhaseNumber1 = "R S"; if (strPower.Contains("3Ph")) { strPowerPhaseNumber1 = "L1L2L3N"; } if (powerSupplyCode == "R") { strPowerPhaseNumber1 = "R S T"; } isNewPower = true; powerIndex = strArrayList_powerType.Count; strArrayList_powerType.Add(strPowerPhaseNumber1); strArrayList_powerVoltage.Add(strPower); dArrayList_powerCurrent.Add(0); } else { strArrayList_powerVoltage[powerIndex] = strPower; } strPower = strPower.Replace("/1Ph/", "/").Replace("/3Ph/", "/"); double current = inItem.RatedCurrent; dArrayList_powerCurrent[powerIndex] += current; strPower += "/" + current.ToString() + "A"; NodeElement_Wiring item = new NodeElement_Wiring("Ind", model, 1, model, strPowerPhaseNumber, strPower, strPowerLineType, brandCode); return(item); }
public NodeElement_Wiring GetNodeElement_Wiring_ODU(old.Outdoor outItem, string brandCode) { string [] strs1 = outItem.FullModuleName.Split(new char[] { '+' }, StringSplitOptions.RemoveEmptyEntries); List <string> unitFullName = new List <string>(); foreach (string str1 in strs1) { if (str1.Contains("*")) { string[] strs2 = str1.Split(new char[] { '*' }, StringSplitOptions.RemoveEmptyEntries); if (strs2.Length == 2) { int num = 0; if (int.TryParse(strs2[1].Trim(), out num)) { for (int i = 0; i < num; i++) { unitFullName.Add(strs2[0].Trim()); } } } } else { unitFullName.Add(str1.Trim()); } } int count = unitFullName.Count; old.Outdoor[] outItems = new old.Outdoor[count]; if (count > 1) { for (int i = 0; i < count - 1; i++) { for (int j = i + 1; j < count; j++) { if (unitFullName[i].CompareTo(unitFullName[j]) == -1) { string largemodel = unitFullName[j]; unitFullName[j] = unitFullName[i]; unitFullName[i] = largemodel; } } } JCHVRF.DAL.OutdoorDAL dal = new JCHVRF.DAL.OutdoorDAL(outItem.RegionCode, brandCode, ProjectLegacy.RegionCode); for (int i = 0; i < count; i++) { string modelname = (unitFullName[i]).Trim(); old.Outdoor coutItem = null; if (((outItem.RegionCode == "MAL" || outItem.RegionCode == "LA_BV") && brandCode == "Y") || (outItem.Series == "Commercial VRF HP, YVAHP") || (outItem.Series == "Commercial VRF HR, YVAHR")) //马来西亚的YORK品牌以及北美机型需要这样处理 20170323 by Yunxiao Lin { coutItem = dal.GetYorkItemBySeries(modelname, outItem.Series); } else if (brandCode == "H") { coutItem = dal.GetHitachiItemBySeries(modelname, outItem.Series); } else { coutItem = dal.GetItemBySeries(modelname, outItem.Series); } if (coutItem != null) { outItems[i] = coutItem; } } } else { outItems[0] = outItem; } JCHVRF.DAL.MyDictionaryDAL dicdal = new JCHVRF.DAL.MyDictionaryDAL(); string strGroup2 = ""; string strGroup3 = ""; string strGroup4 = ""; string modelGroup = ""; foreach (old.Outdoor coutItem in outItems) { if (coutItem != null) { if (outItem.Type.Contains("YVAHP") || outItem.Type.Contains("YVAHR")) { if (modelGroup != "") { modelGroup += "," + coutItem.Model_York; } else { modelGroup += coutItem.Model_York; } } old.MyDictionary dic = dicdal.GetItem(old.MyDictionary.DictionaryType.PowerSupply, coutItem.ModelFull.Substring(coutItem.ModelFull.Length - 4, 1)); string strPowerLineType = "//"; string strPowerPhaseNumber = "R S"; if (dic.Name.Contains("3Ph")) { strPowerLineType = "////"; strPowerPhaseNumber = "L1L2L3N"; } if (coutItem.ModelFull.Substring(coutItem.ModelFull.Length - 4, 1) == "R") { strPowerPhaseNumber = "R S T"; strPowerLineType = "///"; } string strPower = dic.Name.Replace("1Ph/", "").Replace("3Ph/", ""); double current = coutItem.MaxCurrent; strPower += "/" + current.ToString() + "A"; if (strGroup2 != "") { strGroup2 += "|" + strPowerPhaseNumber; } else { strGroup2 += strPowerPhaseNumber; } if (strGroup3 != "") { strGroup3 += "|" + strPower; } else { strGroup3 += strPower; } if (strGroup4 != "") { strGroup4 += "," + strPowerLineType; } else { strGroup4 += strPowerLineType; } } } string model = outItem.Model_York; if (!outItem.Type.Contains("YVAHP") && !outItem.Type.Contains("YVAHR")) { if (brandCode == "H") { model = outItem.Model_Hitachi; } modelGroup = string.Join(",", unitFullName); } else { model = outItem.Model_York; } NodeElement_Wiring item = new NodeElement_Wiring("Out" + count.ToString(), model, count, modelGroup, strGroup2, strGroup3, strGroup4, brandCode); return(item); }