Exemple #1
0
        /// <summary>
        ///  Method to process the Isolation Scenario feature.
        /// </summary>
        /// <param name="gtComps">IGTKeyObject of the Isolation Scenario feature</param>
        /// <param name="isolationScenarioType">Type of Isolation Scenario</param>
        /// <returns>Boolean indicating method execution status</returns>
        private bool ProcessIsoScenarioFeature(IGTKeyObject gtKO, IsolationScenarios isolationScenarioType)
        {
            try
            {
                IsoScenarioFeature activeFeature = new IsoScenarioFeature();
                activeFeature.GtKeyObject = gtKO;

                short numberofNodes = 0;
                GetNumberOfNodes(activeFeature.GtKeyObject, ref numberofNodes);

                activeFeature.RelatedFeaturesNode1 = GetRelatedFeatures(activeFeature.GtKeyObject, m_cRNO, "NODE1");

                if (numberofNodes == 2)
                {
                    activeFeature.RelatedFeaturesNode2 = GetRelatedFeatures(activeFeature.GtKeyObject, m_cRNO, "NODE2");
                }

                Recordset connRS = activeFeature.GtKeyObject.Components.GetComponent(11).Recordset;
                if (connRS.RecordCount > 0)
                {
                    connRS.MoveFirst();
                    activeFeature.Phase = connRS.Fields["PHASE_ALPHA"].Value.ToString();
                }

                Recordset commRS = activeFeature.GtKeyObject.Components.GetComponent(1).Recordset;
                if (commRS.RecordCount > 0)
                {
                    commRS.MoveFirst();
                    activeFeature.FeatureState = commRS.Fields["FEATURE_STATE_C"].Value.ToString();
                }

                IsoCommon isoCommon = new IsoCommon();
                isoCommon.ActiveFNO       = m_ActiveFNO;
                isoCommon.ActiveFID       = m_ActiveFID;
                isoCommon.InteractiveMode = m_InteractiveMode;
                isoCommon.DataContext     = m_GTDataContext;

                // ISOSINGLE
                if (isolationScenarioType == IsolationScenarios.ISOSINGLE)
                {
                    IProcessIsolationScenario isoSingle = new IsoSingleScenario(m_GTDataContext, activeFeature, isoCommon);
                    isoSingle.ValidateIsolationScenario();
                }
                // ISODUAL
                else if (isolationScenarioType == IsolationScenarios.ISODUAL)
                {
                    IProcessIsolationScenario isoDual = new IsoDualScenario(m_GTDataContext, activeFeature, isoCommon);
                    isoDual.ValidateIsolationScenario();
                }
                // ISOELBOW
                else if (isolationScenarioType == IsolationScenarios.ELBOW)
                {
                    IProcessIsolationScenario isoElbow = new ElbowScenario(m_GTDataContext, activeFeature, isoCommon);
                    isoElbow.ValidateIsolationScenario();
                }
                // ISOELBOW
                else if (isolationScenarioType == IsolationScenarios.BYPASS)
                {
                    IProcessIsolationScenario isoBypass = new ByPassScenario(m_GTDataContext, activeFeature, isoCommon);
                    isoBypass.ValidateIsolationScenario();
                }

                return(true);
            }
            catch (Exception ex)
            {
                throw new Exception("Error from Isolation Scenario FI:ProcessIsoScenarioFeature: " + ex.Message);
            }
        }
Exemple #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="dataContext">IGTDataContext object</param>
 /// <param name="isolationScenarioFeature">Isolation Scenario feature</param>
 /// <param name="isoCommon">IsoCommon object</param>
 public IsoDualScenario(IGTDataContext dataContext, IsoScenarioFeature isolationScenarioFeature, IsoCommon isoCommon)
 {
     m_dataContext = dataContext;
     m_IsolationScenarioFeature = isolationScenarioFeature;
     m_IsoCommon = isoCommon;
 }
Exemple #3
0
        /// <summary>
        /// Sets attributes for the virtual point to keep in sync with the associated feature
        /// </summary>
        /// <param name="isoScenarioFeature">The associated feature from which to get attribute values.</param>
        /// <param name="gtKeyObject">Feature key object to validate and set attribute values.</param>
        /// <returns>Boolean indicating status</returns>
        public bool SetVirtualPointAttributes(IsoScenarioFeature isoScenarioFeature, IGTKeyObject gtKeyObject, out string message)
        {
            bool returnValue = false;

            try
            {
                message = "";

                Recordset isoPtRS = gtKeyObject.Components.GetComponent(4).Recordset;
                if (isoPtRS.RecordCount > 0)
                {
                    isoPtRS.MoveFirst();

                    string associatedFID = isoPtRS.Fields["ASSOCIATED_FID"].Value.ToString();
                    if (associatedFID != isoScenarioFeature.GtKeyObject.FID.ToString())
                    {
                        isoPtRS.Fields["ASSOCIATED_FID"].Value = isoScenarioFeature.GtKeyObject.FID;
                    }
                }

                string commFeatureState = string.Empty;

                isoPtRS = gtKeyObject.Components.GetComponent(1).Recordset;
                if (isoPtRS.RecordCount > 0)
                {
                    isoPtRS.MoveFirst();

                    commFeatureState = isoPtRS.Fields["FEATURE_STATE_C"].Value.ToString();
                    if (commFeatureState != isoScenarioFeature.FeatureState)
                    {
                        isoPtRS.Fields["FEATURE_STATE_C"].Value = isoScenarioFeature.FeatureState;
                        commFeatureState = isoScenarioFeature.FeatureState;
                    }
                }

                isoPtRS = gtKeyObject.Components.GetComponent(11).Recordset;
                if (isoPtRS.RecordCount > 0)
                {
                    isoPtRS.MoveFirst();

                    string phase = isoPtRS.Fields["PHASE_ALPHA"].Value.ToString();
                    if (phase != isoScenarioFeature.Phase)
                    {
                        isoPtRS.Fields["PHASE_ALPHA"].Value = isoScenarioFeature.Phase;
                    }

                    string connFeatureState = isoPtRS.Fields["FEATURE_STATE_C"].Value.ToString();
                    if (connFeatureState != commFeatureState)
                    {
                        isoPtRS.Fields["FEATURE_STATE_C"].Value = commFeatureState;
                    }
                }

                returnValue = true;
            }
            catch (Exception ex)
            {
                message     = ex.Message;
                returnValue = false;
            }
            return(returnValue);
        }