Example #1
0
        private void LoadSerVolsProject(string Filename)
        {
            Project = new ProjectData(AnalysisMode.Operations);
            Art     = new ArterialData();

            SerVolTables     = FileInputOutput2.DeserializeSerVolTables(Filename);
            Project.FileName = Filename;
        }
Example #2
0
        private void btnWriteFile_Click(object sender, EventArgs e)
        {
            //Project.FileName = @"X:\OneDrive\Software Projects\HCM-CALC\_DataFiles\HCM\Urban Streets\ArterialTest.xml";
            //FileIO.WriteXmlFile(Filename, false, Project, Art, Ints, Segs, null, false, true);

            if (Project.FileName != "No Filename" && Project.FileName != "")
            {
                FileInputOutput2.SerializeArterialData(Project.FileName, Art);
            }
        }
Example #3
0
        private void btnCreateIntersection_Click(object sender, EventArgs e)
        {
            Project = new ProjectData();
            //IntersectionData Intx = CreateSignalizedIntx.NewIntersection();

            //Change file path/name as appropriate
            //Project.FileName = @"X:\OneDrive\Software Projects\HCM-CALC\_DataFiles\HCM\Urban Streets\HCMExample1.xml";
            //Project.FileName = @"C:\Users\Christian\source\repos\HCMCalc_UrbanStreets\bin\Output\HCMExample1.xml";
            Project.FileName = OutputFilesFolder + "\\HCMExample1.xml";
            FileInputOutput2.SerializeArterialData(Project.FileName, Art);
        }
Example #4
0
        private void btnCreateArterial_Click(object sender, EventArgs e)
        {
            Project = new ProjectData();
            //ArterialData newArterial = CreateArterial.NewArterial();

            //Art = CreateArterial2.NewArterial();
            Art = CreateArterial_HCMExample1.NewArterial(Project.AnalMode, 800);

            //Change file path/name as appropriate
            //Project.FileName = @"X:\OneDrive\Software Projects\HCM-CALC\_DataFiles\HCM\Urban Streets\HCMExample1.xml";
            //Project.FileName = @"C:\Users\Christian\source\repos\HCMCalc_UrbanStreets\bin\Output\HCMExample1.xml";
            if (OutputFilesFolder == "")
            {
                Project.FileName = "HCMExample1.xml";
            }
            else
            {
                Project.FileName = OutputFilesFolder + "\\HCMExample1.xml";
            }
            FileInputOutput2.SerializeArterialData(Project.FileName, Art);
        }
Example #5
0
        private void ProcessBatchFiles()  //(BackgroundWorker backWorker)
        {
            if (BatchInputFilesFolder != "")
            {
                string   FilenameExtension = "";
                string[] fileEntries       = Directory.GetFiles(BatchInputFilesFolder); // "*.*", SearchOption.AllDirectories);
                int      totalFiles        = 0;                                         // = fileEntries.Length;
                int      processingFile    = 0;

                foreach (string fileName in fileEntries)
                {
                    FilenameExtension = Path.GetExtension(fileName);
                    if (FilenameExtension == ".xml")
                    {
                        totalFiles++;
                    }
                }

                foreach (string fileName in fileEntries)
                {
                    FilenameExtension = Path.GetExtension(fileName);
                    if (FilenameExtension == ".xml")
                    {
                        LoadProject(fileName);
                        CalcsArterial.CalcResults(Project, ref Art);
                        FileInputOutput2.SerializeArterialData(Project.FileName, Art);

                        processingFile++;
                        int PctProgress = (int)((Single)processingFile / totalFiles * 100);
                        bgwReadBatchFiles.ReportProgress(PctProgress);
                    }
                }
            }
            else
            {
                MessageBox.Show("The input and/or output source path is empty.", "Folder Path Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }