public xmlBuildingReport(Apartment AGoutput)
 {
     InitializeComponent();
     this.projectName.Text              = TuringAndCorbusierPlugIn.InstanceClass.page1Settings.ProjectName;
     this.address.Text                  = TuringAndCorbusierPlugIn.InstanceClass.page1Settings.Address;
     this.plotType.Text                 = TuringAndCorbusierPlugIn.InstanceClass.page1Settings.PlotType;
     this.plotArea_Manual.Text          = Math.Round(TuringAndCorbusierPlugIn.InstanceClass.page1Settings.PlotArea, 2).ToString() + "m\xB2";
     this.plotArea_Manual_Py.Text       = Math.Round(TuringAndCorbusierPlugIn.InstanceClass.page1Settings.PlotArea / 3.3, 2).ToString() + "평";
     this.plotArea_Unusable.Text        = (0).ToString() + "m\xB2";
     this.plotArea_Unusable_Py.Text     = (0 / 3.3).ToString() + "평";
     this.plotArea_Usable.Text          = Math.Round(AGoutput.Plot.GetArea() / 1000000, 2).ToString() + "m\xB2";
     this.plotArea_Usable_Py.Text       = Math.Round(AGoutput.Plot.GetArea() / 1000000 / 3.3, 2).ToString() + "평";
     this.buildingType.Text             = "공동주택(" + CommonFunc.GetApartmentType(AGoutput) + ")";
     this.buildingScale.Text            = buildingScaleForReport(AGoutput);
     this.buildingArea.Text             = Math.Round(AGoutput.GetBuildingArea() / 1000000, 2).ToString() + "m\xB2";
     this.buildingArea_Py.Text          = Math.Round(AGoutput.GetBuildingArea() / 1000000 / 3.3, 2).ToString() + "평";
     this.grossArea_UnderGround.Text    = Math.Round(AGoutput.ParkingLotUnderGround.ParkingArea / 1000000, 2).ToString() + "m\xB2";   //////////////////////////////////////////////////////////////
     this.grossArea_UnderGround_Py.Text = Math.Round(AGoutput.ParkingLotUnderGround.ParkingArea / 1000000 / 3.3, 2).ToString() + "평"; //////////////////////////////////////////////////////////////
     this.grossArea_OverGround.Text     = Math.Round(AGoutput.GetGrossArea() / 1000000, 2).ToString() + "m\xB2";
     this.grossArea_OverGround_Py.Text  = Math.Round(AGoutput.GetGrossArea() / 1000000 / 3.3, 2).ToString() + "평";
     this.grossArea.Text                = Math.Round((AGoutput.GetGrossArea() + 1) / 1000000, 2).ToString() + "m\xB2";   //////////////////////////////////////////////////////////////
     this.grossArea_Py.Text             = Math.Round((AGoutput.GetGrossArea() + 1) / 1000000 / 3.3, 2).ToString() + "평"; //////////////////////////////////////////////////////////////
     this.BPR.Text                    = Math.Round((AGoutput.GetBalconyArea() + AGoutput.ParkingLotUnderGround.ParkingArea + AGoutput.GetCoreAreaOnEarthSum()) / 1000000, 2).ToString() + "m\xB2";
     this.BPR_Py.Text                 = Math.Round((AGoutput.GetBalconyArea() + AGoutput.ParkingLotUnderGround.ParkingArea + AGoutput.GetCoreAreaOnEarthSum()) / 1000000 / 3.3, 2).ToString() + "평";
     this.ConstructionArea.Text       = Math.Round((AGoutput.GetGrossArea() + AGoutput.GetBalconyArea() + AGoutput.ParkingLotUnderGround.ParkingArea + AGoutput.GetCoreAreaOnEarthSum()) / 1000000, 2).ToString() + "m\xB2";
     this.ConstructionArea_Py.Text    = Math.Round((AGoutput.GetGrossArea() + AGoutput.GetBalconyArea() + AGoutput.ParkingLotUnderGround.ParkingArea + AGoutput.GetCoreAreaOnEarthSum()) / 1000000 / 3.3, 2).ToString() + "평";
     this.buildingCoverage.Text       = Math.Round(AGoutput.GetBuildingCoverage(), 2).ToString() + "%";
     this.buildingCoverage_legal.Text = "(법정 : " + Math.Round(TuringAndCorbusierPlugIn.InstanceClass.page1Settings.MaxBuildingCoverage) + "%)";
     this.floorAreaRatio.Text         = Math.Round(AGoutput.GetGrossAreaRatio(), 2).ToString() + "%";
     this.floorAreaRatio_legal.Text   = "(법정 : " + Math.Round(TuringAndCorbusierPlugIn.InstanceClass.page1Settings.MaxFloorAreaRatio) + "%)";
     this.numOfHouseHolds.Text        = AGoutput.GetHouseholdCount().ToString() + "세대";
     this.NumOfPakringLots.Text       = (AGoutput.ParkingLotOnEarth.GetCount() + AGoutput.ParkingLotUnderGround.Count).ToString() + "대";
     this.ParkingLotArea.Text         = "(주차장면적 : " + (AGoutput.ParkingLotUnderGround.ParkingArea / 1000000).ToString() + "m\xB2)";
 }
Exemplo n.º 2
0
        public void UpdateSummary(Apartment agOutput)
        {
            BuildingType.Text = "공동주택(" + agOutput.BuildingType.ToString() + ")";

            BuildingScale.Text = "지상 1층 ~ " + (agOutput.ParameterSet.Stories + 1).ToString() + "층";

            BuildingArea.Text          = Math.Round(agOutput.GetBuildingArea() / 1000000, 2).ToString() + " m\xB2";
            BuildingArea_Py.Text       = "(" + Math.Round(agOutput.GetBuildingArea() / 1000000 / 3.3, 2).ToString() + " 평)";
            BuildingCoverage.Text      = ((int)agOutput.GetBuildingCoverage()).ToString() + " %";
            LegalBuildingCoverage.Text = "(법정 : " + TuringAndCorbusierPlugIn.InstanceClass.page1Settings.MaxBuildingCoverage.ToString() + " %)";

            GrossArea.Text      = Math.Round(agOutput.GetGrossArea() / 1000000, 2).ToString() + " m\xB2";
            GrossArea_Py.Text   = "(" + Math.Round(agOutput.GetGrossArea() / 1000000 / 3.3, 2).ToString() + " 평)";
            FloorAreaRatio.Text = ((int)agOutput.GetGrossAreaRatio()).ToString() + " %";

            int numberOfHousing = 0;

            foreach (List <List <Household> > i in agOutput.Household)
            {
                foreach (List <Household> j in i)
                {
                    numberOfHousing += j.Count();
                }
            }
            NumOfHousing.Text = numberOfHousing.ToString() + "세대";

            NumOfParking.Text = (agOutput.ParkingLotOnEarth.GetCount() + agOutput.ParkingLotUnderGround.Count).ToString() + "대";


            List <double> firstFloorHHArea = new List <double>();

            for (int i = 0; i < agOutput.Household[0].Count; i++)
            {
                for (int j = 0; j < agOutput.Household[0][i].Count; j++)
                {
                    double round = Math.Round(agOutput.Household[0][i][j].ExclusiveArea / 1000000);
                    if (!firstFloorHHArea.Contains(round))
                    {
                        firstFloorHHArea.Add(round);
                    }
                }
            }
            var ta = firstFloorHHArea.OrderBy(n => n).ToList();

            int[] type = new int[ta.Count];
            type = type.Select(n => 0).ToArray();
            foreach (var hh in agOutput.Household)
            {
                foreach (var h in hh)
                {
                    foreach (var x in h)
                    {
                        for (int i = 0; i < ta.Count; i++)
                        {
                            double round = Math.Round(x.ExclusiveArea / 1000000);
                            if (round == ta[i])
                            {
                                type[i]++;
                                break;
                            }
                        }
                    }
                }
            }

            TextBlock[] title = new TextBlock[] { most1, most2, most3, most4, most5 };
            TextBlock[] count = new TextBlock[] { nummost1, nummost2, nummost3, nummost4, nummost5 };


            for (int i = 0; i < title.Length; i++)
            {
                if (i < ta.Count)
                {
                    title[i].Text = ta[i].ToString() + " m2 형";
                    count[i].Text = type[i].ToString();
                }

                else
                {
                    title[i].Text = "";
                    count[i].Text = "";
                }
            }
        }