Esempio n. 1
0
        static void Main(string[] args)
        {
            //GetUserInputs()
            Console.WriteLine("Press Enter to Continue: ");
            DxfParser file_data = new DxfParser("file_name");

            //Console.WriteLine("Copy and Paste the input file path");
            //string IncomingFilePath = Console.ReadLine();
            //IncomingFilePath =
            file_data.ParseFile();
            file_data.ParseEntities();

            BasicDimensions BlockPerimeter = file_data.ParseBlocks();

            IFIPerimeter IFIboarder = file_data.IFIBoarder;

            List <Panel> PanelList = file_data.PanelList;

            IFIboarder.CalculateIFICenter();

            IFIboarder.SetCorners();


            foreach (Panel panel in PanelList)
            {
                panel.CalculatePanelCenter(IFIboarder.Center.Item1, IFIboarder.Center.Item2);
            }

            foreach (Panel panel in PanelList)
            {
                panel.SetPanelZones(IFIboarder);
            }

            Console.WriteLine("Input (N) radius that should be checked: ");

            string input_string = Console.ReadLine();

            int input_n = 0;

            if (string.IsNullOrEmpty(input_string))
            {
                input_n = 3;
            }
            else
            {
                input_n = Convert.ToInt32(input_string);
            }

            PanelGrid grid = new PanelGrid(BlockPerimeter, PanelList);

            IFIboarder.PrintIFIData();

            grid.PrintPanelData();
        }
Esempio n. 2
0
        // Blocks Section:
        // Contains information on Dimensions of Each Panel
        public BasicDimensions ParseBlocks()
        {
            BasicDimensions BlockPerimeter = new BasicDimensions();

            var start = BlocksStart;

            var end = BlocksEnd;

            string[] perims_section = new string[end - start];

            Array.Copy(lines, start, perims_section, 0, end - start);

            bool perm_name_condition = false;

            int index = 0;

            foreach (string x in perims_section)
            {
                if (x.Contains("JA 320W 10DEG"))
                {
                    perm_name_condition = true;
                }
                if (perm_name_condition)
                {
                    if (x.Contains("AcDbPolyline"))
                    {
                        List <Double> temp_list = new List <Double>();

                        for (int i = 8; i <= 22; i += 2)
                        {
                            temp_list.Add(Convert.ToDouble(perims_section[index + i].Trim()));
                        }

                        BlockPerimeter.Corner1 = new Tuple <double, double>(temp_list[0], temp_list[1]);
                        BlockPerimeter.Corner2 = new Tuple <double, double>(temp_list[2], temp_list[3]);
                        BlockPerimeter.Corner3 = new Tuple <double, double>(temp_list[4], temp_list[5]);
                        BlockPerimeter.Corner4 = new Tuple <double, double>(temp_list[6], temp_list[7]);

                        break;
                    }
                }
                index += 1;
            }


            return(BlockPerimeter);
        }
Esempio n. 3
0
 public PanelGrid(BasicDimensions perimeter, List <Panel> plist)
 {
     PanelList  = plist;
     IFIBoarder = perimeter;
 }