Exemplo n.º 1
0
 /// <summary>
 /// Creates NavigationObject for all included networks (USE TRY/CATCH)
 /// </summary>
 /// <param name="listNetworks"></param>
 public NavigationObject(List <NetworkObject> listNetworks)
 {
     m_listViews = GlobalDatabaseOperations.GetViews();
     foreach (NetworkObject no in listNetworks)
     {
         NetworkNavigationObject nno = new NetworkNavigationObject(no.NetworkID);
         m_listNetworks.Add(nno);
     }
 }
Exemplo n.º 2
0
 public ImageObject UpdateNavigation(String strFacility, String strSection, String strDirection, String strYear)
 {
     m_strYear = strYear;
     m_bLinear = false;
     //Fill list of ImageObjects from
     m_listImageObjects = GlobalDatabaseOperations.GetImageObjectList(strFacility, strDirection, strYear, m_listViews);
     this.CurrentImage  = GetNearestImage(strSection);
     UpdateNetworkNavigationFacility(strFacility, strSection);
     return(this.CurrentImage);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Find current section for new Route/Direction
        /// </summary>
        /// <param name="strRoute"></param>
        /// <param name="strDirection"></param>
        /// <param name="imageObject"></param>
        public void UpdateRouteDirection(String strRoute, String strDirection, ImageObject imageObject)
        {
            bool below = true;
            bool above = true;

            m_listSections = GlobalDatabaseOperations.GetSections(strRoute, strDirection, this.NetworkID);

            if (m_listSections.Count != 0)
            {
                SectionObject minBeginSection = m_listSections[0];
                SectionObject maxEndSection   = m_listSections[0];


                //Search this list to find which section
                foreach (SectionObject so in m_listSections)
                {
                    if (imageObject.Milepost >= so.BeginStation && imageObject.Milepost <= so.EndStation)
                    {
                        this.CurrentSection = so;
                    }
                    else if (imageObject.Milepost < so.BeginStation)
                    {
                        above = false;
                    }
                    else if (imageObject.Milepost > so.EndStation)
                    {
                        below = false;
                    }

                    if (so.BeginStation < minBeginSection.BeginStation)
                    {
                        minBeginSection = so;
                    }
                    if (so.EndStation > maxEndSection.EndStation)
                    {
                        maxEndSection = so;
                    }
                }

                if (this.CurrentSection == null)                        //didn't find a match
                {
                    if (above)
                    {
                        this.CurrentSection = maxEndSection;
                    }

                    if (below)
                    {
                        this.CurrentSection = minBeginSection;
                    }
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initialize a new ImageView run. Gets all images for ROUTE/DIRECTION and determines SECTIONID for each network.
        /// </summary>
        /// <param name="strRoute">ROUTE for linear section</param>
        /// <param name="strDirection">Travel direction for linear section</param>
        /// <param name="dMilePost">Milepost to display image for</param>
        /// <param name="strYear">Year to display data for</param>
        /// <returns>Closest ImageObject for input route/Direction/Milepost.  Null is returned if ROUTE/DIRECTION is not found.</returns>
        public ImageObject UpdateNavigation(String strRoute, String strDirection, double dMilePost, String strYear)
        {
            m_strYear = strYear;
            m_bLinear = true;
            //Fill list of ImageObjects from
            m_listImageObjects = GlobalDatabaseOperations.GetImageObjectList(strRoute, strDirection, strYear, m_listViews);
            //Find closets image.
            this.CurrentImage = GetNearestImage(dMilePost);
            //Set Navigation for each network.
            UpdateNetworkNavigation(strRoute, strDirection);

            return(this.CurrentImage);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Find current section for new Route/Direction
        /// </summary>
        /// <param name="strRoute"></param>
        /// <param name="strDirection"></param>
        /// <param name="imageObject"></param>
        public void UpdateFacilitySection(String strFacility, String strSection, ImageObject imageObject)
        {
            m_listSections = GlobalDatabaseOperations.GetSections(strFacility, this.NetworkID);

            if (imageObject != null)
            {
                //Search this list to find which section
                foreach (SectionObject so in m_listSections)
                {
                    if (imageObject.Section == so.Section)
                    {
                        this.CurrentSection = so;
                    }
                }
            }
            else
            {
                if (m_listSections.Count > 0)
                {
                    this.CurrentSection = m_listSections[0];
                }
            }
        }