Esempio n. 1
0
        public ConfigurationRecord(MOE.Common.Models.Detector gd)
        {
            MOE.Common.Models.Repositories.IDetectorRepository        gdr = MOE.Common.Models.Repositories.DetectorRepositoryFactory.Create();
            MOE.Common.Models.Repositories.IDetectorCommentRepository dcr = MOE.Common.Models.Repositories.DetectorCommentRepositoryFactory.Create();

            string comment = "";

            Models.DetectorComment c = dcr.GetMostRecentDetectorCommentByDetectorID(gd.ID);

            if (c != null)
            {
                comment = c.CommentText;
            }

            this.Comment             = comment;
            this.DecisionPoint       = gd.DecisionPoint.ToString();
            this.DetectorChannel     = gd.DetChannel.ToString();
            this.DetectorID          = gd.DetectorID;
            this.Direction           = gd.Approach.DirectionType.Abbreviation;
            this.DistanceFromStopBar = gd.DistanceFromStopBar.ToString();
            this.Enabled             = gd.Approach.Signal.Enabled.ToString();
            this.MinSpeedFilter      = gd.MinSpeedFilter.ToString();
            this.MovementDelay       = gd.MovementDelay.ToString();
            this.MPH     = gd.Approach.MPH.ToString();
            this.Overlap = gd.Approach.IsProtectedPhaseOverlap.ToString();
            this.PermissivePhaseNumber = gd.Approach.PermissivePhaseNumber.ToString();
            this.ProtectedPhaseNumber  = gd.Approach.ProtectedPhaseNumber.ToString();
            this.DetectionHardware     = gd.DetectionHardware.Name;

            if (gd.LaneType != null)
            {
                this.LaneType = gd.LaneType.Description;
            }
            if (gd.LaneNumber != null)
            {
                this.LaneNumber = gd.LaneNumber.ToString();
            }
            if (gd.MovementType != null)
            {
                this.MovementType = gd.MovementType.Description;
            }
            foreach (MOE.Common.Models.DetectionType dt in gd.DetectionTypes)
            {
                this.DetectionTypes += dt.Description + "<br/>";
            }
        }
Esempio n. 2
0
        public ConfigurationRecord(MOE.Common.Models.Graph_Detectors gd)
        {
            MOE.Common.Models.Repositories.IGraphDetectorRepository   gdr = MOE.Common.Models.Repositories.GraphDetectorRepositoryFactory.Create();
            MOE.Common.Models.Repositories.IDetectorCommentRepository dcr = MOE.Common.Models.Repositories.DetectorCommentRepositoryFactory.Create();

            string comment = "";

            Models.DetectorComment c = dcr.GetMostRecentDetectorCommentByDetectorID(gd.DetectorID);

            if (c != null)
            {
                comment = c.CommentText;
            }



            this.Comment             = comment;
            this.DecisionPoint       = gd.LaneGroup.Approach.Decision_Point.ToString();
            this.DetectorChannel     = gd.Det_Channel.ToString();
            this.DetectorID          = gd.DetectorID;
            this.Direction           = gd.LaneGroup.Approach.DirectionType.Description;
            this.DistanceFromStopBar = gd.DistanceFromStopBar.ToString();
            this.Enabled             = gd.LaneGroup.Approach.Signal.Enabled.ToString();
            this.LaneType            = gd.LaneGroup.MovementType.Abbreviation + gd.LaneNumber.ToString();
            this.MinSpeedFilter      = gd.Min_Speed_Filter.ToString();
            this.MovementDelay       = gd.LaneGroup.Approach.Movement_Delay.ToString();
            this.MPH                   = gd.LaneGroup.Approach.MPH.ToString();
            this.Overlap               = gd.LaneGroup.IsProtectedPhaseOverlap.ToString();
            this.PCDEnabled            = gdr.CheckReportAvialbility(gd.DetectorID, 6).ToString();
            this.PermissivePhaseNumber = gd.LaneGroup.PermissivePhaseNumber.ToString();
            this.ProtectedPhaseNumber  = gd.LaneGroup.ProtectedPhaseNumber.ToString();
            this.SpeedEnabled          = gdr.CheckReportAvialbility(gd.DetectorID, 10).ToString();
            this.SplitFailEnabled      = gdr.CheckReportAvialbility(gd.DetectorID, 12).ToString();
            this.TMCEnabled            = gdr.CheckReportAvialbility(gd.DetectorID, 5).ToString();
            this.YRAEnabled            = gdr.CheckReportAvialbility(gd.DetectorID, 11).ToString();
        }