Ejemplo n.º 1
0
        private IntersectionPresetInfo GetIntersectionPresetInformation(IList <DataRow> PhaseData)
        {
            IntersectionPresetInfo info             = new IntersectionPresetInfo();
            IList <string>         phaseNameStrings = new List <string>(new string[] { "Phase 1", "Phase 2", "Phase 3", "Phase 4", "Phase 5", "Phase 6", "Phase 7", "Phase 8", "Phase 9", "Phase 10", "Phase 11", "Phase 12", "Phase 13", "Phase 14", "Phase 15", "Phase 16" });

            IDictionary <string, double> walkDic      = new Dictionary <string, double>();
            IDictionary <string, double> pedClearDic  = new Dictionary <string, double>();
            IDictionary <string, double> yellowCtrDic = new Dictionary <string, double>();
            IDictionary <string, double> redCtrDic    = new Dictionary <string, double>();

            for (int i = 0; i < 16; i++)
            {
                double walkValue      = Convert.ToDouble(PhaseData[0][i + 1].ToString());
                double pedValue       = Convert.ToDouble(PhaseData[1][i + 1].ToString());
                double yellowCtrValue = Convert.ToDouble(PhaseData[2][i + 1].ToString());
                double redCtrValue    = Convert.ToDouble(PhaseData[3][i + 1].ToString());

                walkDic.Add(phaseNameStrings[i], walkValue);
                pedClearDic.Add(phaseNameStrings[i], pedValue);
                yellowCtrDic.Add(phaseNameStrings[i], yellowCtrValue);
                redCtrDic.Add(phaseNameStrings[i], redCtrValue);
            }

            info.WalkInfo     = walkDic;
            info.PedClearance = pedClearDic;
            info.YellowCtl    = yellowCtrDic;
            info.RedCtr       = redCtrDic;

            return(info);
        }
Ejemplo n.º 2
0
        public Intersection(DataSet ds)
        {
            IDictionary <string, string> headerDic = GetIntersectionInfo(ds.Tables[0]);

            _id                = Convert.ToInt32(headerDic["ID"]);
            _name              = replaceIllegalCharInString(headerDic["Name"]);
            _config            = headerDic["Configuration"];
            _wholeWeeksDayPlan = GetWholeWeekDayPlans(ds);
            _presetInfo        = GetIntersectionPresetInformation(PhaseTimeOptionsData);
            _allTimings        = GetAllTimingInformationOfIntersection();
        }