Esempio n. 1
0
        private void dgvResults_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (WithFreewayFacilityFiles == true)
            {
                if (e.ColumnIndex > 0 && e.RowIndex >= 0)
                {
                    int link = Convert.ToInt32(dgvResults.Rows[e.RowIndex].Cells[colID.Name].Value);
                    int tp   = Convert.ToInt32(dgvResults.Rows[e.RowIndex].Cells[colTimePeriod.Name].Value);

                    if (e.ColumnIndex == 7) // Load in FreewawFacilities program
                    {
                        int freewayID = (int)dgvResults.Rows[e.RowIndex].Cells[colID.Name].Value;
                        GetLinkIndex(freewayID);
                        int numTPs = myResults.Count;
                        //numTPs-1: the last time period results contains them all
                        FreewayData fwy = myFreewayFacilities[GetFacilityID(freewayID)];
                        List <List <SegmentData> > tpsegs = fwy.TPsegs;
                        int NumOfLanes = tpsegs[0][0].NumThruLanes;
                        HCMCalc_Definitions.ProjectData FFproject = new HCMCalc_Definitions.ProjectData("Freeway Facility", AnalysisMode.HCM2016);
                        HCMCalc_Calculations.CalculationsMain.CalcResults(FFproject, NumOfLanes, ref fwy, ref tpsegs);
                        HCMCalc_FreewayFacility.mdiMain MDIform = new HCMCalc_FreewayFacility.mdiMain(FFproject, fwy, tpsegs);
                        MDIform.Show();
                    }
                }
            }
        }
Esempio n. 2
0
 private void dgvVolumeTravelTime_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0 && e.ColumnIndex == 3)
     {
         int NumOfLanes = TPSegs[0][0].NumThruLanes;
         List <List <SegmentData> > currentTPSegs = myFreewayFacilityCalculation.ApplyVolumeSteps(TPSegs, Convert.ToInt32(dgvVolumeTravelTime.Rows[e.RowIndex].Cells[colVolume.Name].Value), ProportionTimePeriodList, RampVolumeTimePeriodList, IsRampProportion);
         ProjectData Project = new ProjectData("Freeway Facility", AnalysisMode.HCM2016);
         HCMCalc_Calculations.CalculationsMain.CalcResults(Project, NumOfLanes, ref Fwy, ref currentTPSegs);
         HCMCalc_FileInputOutput.FreewayFacilityIO FileIO = new HCMCalc_FileInputOutput.FreewayFacilityIO();
         //string fileName = "C:\\Users\\w.sun2014\\Desktop\\file.xff";
         //FileIO.WriteXmlFile(fileName, false, false, Project, Fwy, currentTPSegs);
         HCMCalc_FreewayFacility.mdiMain MDIform = new HCMCalc_FreewayFacility.mdiMain(Project, Fwy, currentTPSegs);
         MDIform.Show();
     }
 }