Beispiel #1
0
        public void sendDataToServer()
        {
            if (tempIndex == -1)
            {
                errorMessage tempError = new errorMessage("설계안을 먼저 선택하세요.");
                return;
            }

            ///출력 할 ApartmentGeneratorOutput

            ApartmentGeneratorOutput tempAGOutput = MainPanel_AGOutputList[tempIndex];

            ///현재 대지에 대한 DesignMaster입력 << 중복될 시 입력 안함

            if (!CommonFunc.checkDesignMasterPresence(CurrentDataIdName.ToList(), CurrentDataId.ToList()))
            {
                List <Point3d> tempBoundaryPts = new List <Point3d>();

                foreach (Curve i in MainPanel_AGOutputList[tempIndex].Plot.Boundary.DuplicateSegments())
                {
                    tempBoundaryPts.Add(i.PointAt(i.Domain.T0));
                }

                CommonFunc.AddTdDesignMaster(CurrentDataIdName.ToList(), CurrentDataId.ToList(), USERID, (int)TuringAndCorbusierPlugIn.InstanceClass.page1Settings.MaxFloorAreaRatio, (int)TuringAndCorbusierPlugIn.InstanceClass.page1Settings.MaxBuildingCoverage, TuringAndCorbusierPlugIn.InstanceClass.page1Settings.MaxFloors, CommonFunc.GetPlotBoundaryVector(tempBoundaryPts), CommonFunc.ListToCSV(MainPanel_AGOutputList[tempIndex].Plot.Surroundings.ToList()), MainPanel_AGOutputList[tempIndex].Plot.GetArea());
            }


            ///가장 마지막 DESIGN_NO 다음 번호로 DesignDetail(설계 전체에 관한 내용) 입력

            int temp_REGI_PRE_DESIGN_NO;

            CommonFunc.AddDesignDetail(CurrentDataIdName.ToList(), CurrentDataId.ToList(), USERID, MainPanel_AGOutputList[tempIndex], out temp_REGI_PRE_DESIGN_NO);

            ///각 세대 타입별 정보 입력

            for (int i = 0; i < MainPanel_AGOutputList[tempIndex].HouseholdStatistics.Count; i++)
            {
                HouseholdStatistics tempHouseholdStatistics = MainPanel_AGOutputList[tempIndex].HouseholdStatistics[i];
                double tempExclusiveAreaSum = tempAGOutput.GetExclusiveAreaSum();
                double tempExclusiveArea    = tempHouseholdStatistics.GetExclusiveArea();

                double GroundCoreAreaPerHouse = tempAGOutput.GetCoreAreaOnEarthSum() / (tempExclusiveAreaSum + tempAGOutput.GetCommercialArea()) * tempExclusiveArea;
                double coreAreaPerHouse       = GroundCoreAreaPerHouse + (tempAGOutput.GetCoreAreaSum() - tempAGOutput.GetCoreAreaOnEarthSum()) / tempExclusiveAreaSum * tempExclusiveArea;
                double parkingLotAreaPerHouse = tempAGOutput.ParkingLotUnderGround.GetAreaSum() / (tempExclusiveAreaSum + tempAGOutput.GetCommercialArea()) * tempExclusiveArea;
                double plotAreaPerHouse       = tempAGOutput.Plot.GetArea() / (tempExclusiveAreaSum + tempAGOutput.GetCommercialArea()) * tempExclusiveArea;
                double welfareAreaPerHouse    = tempAGOutput.GetPublicFacilityArea() / tempExclusiveAreaSum * tempExclusiveArea;
                double facilitiesAreaPerHouse = 0 / tempExclusiveAreaSum * tempExclusiveArea;

                CommonFunc.AddTdDesignArea(CurrentDataIdName.ToList(), CurrentDataId.ToList(), temp_REGI_PRE_DESIGN_NO, USERID, tempAGOutput.AreaTypeString()[i], coreAreaPerHouse, welfareAreaPerHouse, facilitiesAreaPerHouse, parkingLotAreaPerHouse, plotAreaPerHouse, tempHouseholdStatistics);
            }

            CommonFunc.AddDesignModel(CurrentDataIdName.ToList(), CurrentDataId.ToList(), USERID, temp_REGI_PRE_DESIGN_NO, tempAGOutput.AGtype, CommonFunc.ListToCSV(tempAGOutput.ParameterSet.Parameters.ToList()), tempAGOutput.ParameterSet.CoreType.ToString(), tempAGOutput.Target.TargetArea, tempAGOutput.Target.TargetRatio);
            //CommonFunc.AddDesignReport(CurrentDataIdName.ToList(), CurrentDataId.ToList(),temp_REGI_PRE_DESIGN_NO);
        }
Beispiel #2
0
        public void AddButton(string AGName, ApartmentGeneratorOutput AGOutput)
        {
            string[] stackPannelButtonStyle = { "stackPannelButtonStyle1", "stackPannelButtonStyle2" };

            System.Windows.Controls.Button btn = new System.Windows.Controls.Button();

            string tempStyle = stackPannelButtonStyle[stackPanel.Children.Count % 2];

            System.Windows.Style style = FindResource(tempStyle) as System.Windows.Style;

            Grid tempGrid = new Grid();

            tempGrid.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            tempGrid.Width = ((Rhino.UI.Panels.GetPanel(TuringHost.PanelId) as RhinoWindows.Controls.WpfElementHost).Width) - 34;

            for (int j = 0; j < 3; j++)
            {
                ColumnDefinition tempColDef = new ColumnDefinition();
                tempColDef.Width = new GridLength(1, GridUnitType.Star);
                tempGrid.ColumnDefinitions.Add(tempColDef);
            }

            ColumnDefinition lastColDef = new ColumnDefinition();

            lastColDef.Width = new GridLength(17, GridUnitType.Pixel);
            tempGrid.ColumnDefinitions.Add(lastColDef);

            TextBlock calculateNumsTextBlock = createTextBlock(CommonFunc.GetApartmentType(AGOutput));

            tempGrid.Children.Add(calculateNumsTextBlock);
            Grid.SetColumn(calculateNumsTextBlock, 0);

            TextBlock FloorAreaRatioTextBlock = createTextBlock((System.Math.Round(AGOutput.GetGrossAreaRatio(), 2)).ToString() + "%");

            tempGrid.Children.Add(FloorAreaRatioTextBlock);
            Grid.SetColumn(FloorAreaRatioTextBlock, 1);

            TextBlock BuildingCoverageTextBlock = createTextBlock((System.Math.Round(AGOutput.GetBuildingCoverage(), 2)).ToString() + "%");

            tempGrid.Children.Add(BuildingCoverageTextBlock);
            Grid.SetColumn(BuildingCoverageTextBlock, 2);

            btn.FontSize = 10;
            btn.Style    = style;
            btn.Content  = tempGrid;
            btn.Height   = 21;
            btn.Click   += MainPaenl_StackButton_Click;

            stackPanel.Children.Add(btn);
            MainPanel_AGOutputList.Add(AGOutput);
        }