Example #1
0
 public ng.WiringNodeIn createNodeIn_wiring(old.RoomIndoor riItem)
 {
     ng.WiringNodeIn node = new ng.WiringNodeIn();
     node.Tooltip        = old.NodeType.IN.ToString();
     node.IsEditable     = false;
     node.Stroke         = System.Windows.Media.Brushes.Transparent;
     node.FontFamily     = new System.Windows.Media.FontFamily("Arial");
     node.FontSize       = 11;
     node.Geometry       = new RectangleGeometry(new System.Windows.Rect(0, 0, 0, 0));
     node.RoomIndoorItem = riItem;
     return(node);
 }
Example #2
0
        public void drawTextToIDUNode(ng.SystemVRF sysItem, ng.MyNodeIn nodeUnit)
        {
            //DOUBT
            //if (nodeUnit.Children != null)
            //{
            //    nodeUnit.Children.Clear();
            //}

            string text = "";

            old.RoomIndoor riItem = nodeUnit.RoomIndooItem;
            if (riItem == null)
            {
                return;
            }

            string model = riItem.IndoorItem.Model_York;

            if (isHitachi)
            {
                model = riItem.IndoorItem.Model_Hitachi;
            }
            if (sysItem.OutdoorItem.Type != null && (sysItem.OutdoorItem.Type.Contains("YVAHP") || sysItem.OutdoorItem.Type.Contains("YVAHR")))
            {
                model = riItem.IndoorItem.Model_York;
            }

            text = riItem.IndoorName + "\n" + model;
            if (!string.IsNullOrEmpty(riItem.RoomID))
            {
                string floorName = "";
                foreach (old.Floor f in thisProject.FloorList)
                {
                    foreach (old.Room rm in f.RoomList)
                    {
                        if (rm.Id == riItem.RoomID)
                        {
                            floorName = f.Name;
                            break;
                        }
                    }
                }

                text = floorName + "\n" + riItem.RoomName + ":" + text;
            }
            else
            {
                if (!string.IsNullOrEmpty(riItem.DisplayRoom))
                {
                    text = riItem.DisplayRoom + ":" + text;
                }
            }

            JCHNode label = new JCHNode();

            initTextNode(label, text);

            label.ImagePosition = ImagePosition.CenterBottom;

            if (label.Size.Width < nodeUnit.Size.Width)
            {
                label.Size = convertSize(nodeUnit.Size.Width, label.Size.Height);
            }

            //addFlowPiping.Items.Add(label);
            nodeUnit.Stroke = System.Windows.Media.Brushes.RoyalBlue;
            //nodeUnit.AddFlow.AddNode(label);
            //nodeUnit.AddFlow.Items.Add(label);

            //DOUBT
            //nodeUnit.HighlightChildren = true;

            JCHNode label2 = new JCHNode();
            string  text2  = "";

            text2  = "Cooling: " + Unit.ConvertToControl(riItem.ActualCoolingCapacity, UnitType.POWER, ut_power).ToString("n1") + ut_power;
            text2 += "\nHeating: " + Unit.ConvertToControl(riItem.ActualHeatingCapacity, UnitType.POWER, ut_power).ToString("n1") + ut_power;
            text2 += "\nSensible Cooling: " + Unit.ConvertToControl(riItem.ActualSensibleHeat, UnitType.POWER, ut_power).ToString("n1") + ut_power;
            initTextNode(label2, text2);

            label2.ImagePosition = ImagePosition.LeftMiddle;

            if (label2.Size.Width < nodeUnit.Size.Width)
            {
                label2.Size = convertSize(nodeUnit.Size.Width, label2.Size.Height);
            }
            //nodeUnit.AddFlow.AddNode(label2);
            //nodeUnit.AddFlow.Items.Add(label2);

            //addFlowPiping.AddNode(label2);         // This line show Cooling, Heating and Heating on Canvas
            //nodeUnit.AddFlow.Items.Add(label2);

            label.Location  = convertPointFToWinPoint(nodeUnit.Location.X, nodeUnit.Location.Y - label.Size.Height);
            label2.Location = convertPointFToWinPoint(nodeUnit.Location.X, nodeUnit.Location.Y + nodeUnit.Size.Height);

            if (sysItem.PipingLayoutType == old.PipingLayoutTypes.Normal)
            {
                if (!sysItem.IsPipingVertical)
                {
                    label2.Location = convertPointFToWinPoint(label2.Location.X, label2.Location.Y + 8);
                }
            }
            else if (sysItem.PipingLayoutType == old.PipingLayoutTypes.BinaryTree)
            {
                if (!sysItem.IsPipingVertical)
                {
                    label.Location  = convertPointFToWinPoint(nodeUnit.Location.X, nodeUnit.Location.Y + nodeUnit.Size.Height);
                    label2.Location = convertPointFToWinPoint(label2.Location.X, label2.Location.Y + label.Size.Height);
                }
            }
        }