Example #1
0
        private void ValidateVoltages(Common.FeatureInfo p_affected, Common.FeatureInfo p_related)
        {
            try
            {
                List <string> statesProposedUpdate = new List <string> {
                    "PPI", "ABI", "INI", "CLS"
                };
                bool isAffectedProposedUpdate = statesProposedUpdate.Contains(p_affected.FeatureState);
                bool isRelatedProposedUpdate  = statesProposedUpdate.Contains(p_related.FeatureState);

                string affectedVoltage = null;
                string relatedVoltage  = null;

                if (isAffectedProposedUpdate && isRelatedProposedUpdate && !String.IsNullOrEmpty(m_sProposedAffectedVoltage))
                {
                    affectedVoltage = m_sProposedAffectedVoltage;
                }
                else
                {
                    affectedVoltage = m_sActualAffectedVoltage;
                }

                if (isAffectedProposedUpdate && isRelatedProposedUpdate && !String.IsNullOrEmpty(m_sProposedRelatedVoltage))
                {
                    relatedVoltage = m_sProposedRelatedVoltage;
                }
                else
                {
                    relatedVoltage = m_sActualRelatedVoltage;
                }

                if ((affectedVoltage != null || relatedVoltage != null) && !affectedVoltage.Equals(relatedVoltage))
                {
                    ValidationRuleManager validateMsg = new ValidationRuleManager();

                    validateMsg.Rule_Id = "VOLT01";
                    validateMsg.BuildRuleMessage(GTClassFactory.Create <IGTApplication>(), null);

                    m_lstErrorPriority.Add(m_errorPriority);
                    m_lstErrorMessage.Add(validateMsg.Rule_MSG);
                }
            }
            catch
            {
                throw;
            }
        }
Example #2
0
        /// <summary>
        /// Sets voltage attributes when establishing connectivity,based on the voltage attributes corresponding to the connected nodes.
        /// <summary>
        /// <param name="p_errorPriority">Error Priority</param>
        private void ProcessEstablish(string p_errorPriority = null)
        {
            Common.FeatureInfo featureActive  = null;
            Common.FeatureInfo featureRelated = null;

            short activeNode;
            short relatedNode;

            try
            {
                m_activeConnectivityRS = m_rgiBase.ActiveFeature.Components.GetComponent(11).Recordset;
                featureActive          = new Common.FeatureInfo(m_activeConnectivityRS);

                foreach (IGTKeyObject relatedFeature in m_rgiCommon.GetRelatedFeatures())
                {
                    activeNode  = 0;
                    relatedNode = 0;

                    m_relatedConnectivityRS = relatedFeature.Components.GetComponent(11).Recordset;
                    featureRelated          = new Common.FeatureInfo(m_relatedConnectivityRS);

                    m_rgiCommon.GetActiveRelatedNodes(m_activeConnectivityRS, m_relatedConnectivityRS, ref activeNode, ref relatedNode);

                    if (activeNode != 0 && relatedNode != 0)
                    {
                        if (m_transmissionDevicesFNOs.Contains(m_rgiCommon.ActiveFNO) && !m_rgiCommon.Validation && activeNode == 2)
                        {
                            break;
                        }
                        else
                        {
                            SetAffectedRelatedNodeVoltages(activeNode, relatedNode);
                        }
                    }

                    if (m_rgiCommon.Validation)
                    {
                        ValidateVoltages(featureActive, featureRelated);
                    }
                }
            }
            catch
            {
                throw;
            }
        }