public static bool PhaseExistInPhaseCode(EPhaseCode ePhaseCode, EPhaseIndex phaseIndex)
 {
     if (((uint)ePhaseCode & (uint)Math.Pow(2, 3 - (byte)phaseIndex)) != 0)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
        public static EPhaseCode PhaseIndexToPhaseCode(EPhaseIndex phaseIndex)
        {
            switch (phaseIndex)
            {
            case EPhaseIndex.A:
                return(EPhaseCode.A);

            case EPhaseIndex.B:
                return(EPhaseCode.B);

            case EPhaseIndex.C:
                return(EPhaseCode.C);

            default:
                return(EPhaseCode.UNKNOWN);
            }
        }
Exemplo n.º 3
0
        public void UpdateTopologyAfterOpeningPhaseOfSwitch(long branch, EPhaseCode phaseToClose)
        {
            MPBranch stateBranch = internalModel.Branches[branch];

            if (stateBranch.Marker != EEnergizationStatus.TA_UNENERGIZED)
            {
                FindRootsToUpdate(branch);

                EPhaseIndex phaseIndex = PhaseHelper.PhaseCodeToIndex(phaseToClose);

                long nodeLid = stateBranch.DownNode[(long)phaseIndex];
                bfScanner.Init();
                bfScanner.Add(new ActiveNodeInfo(LIDtoIND[nodeLid] + (long)phaseIndex, (long)phaseIndex));

                ProcessIsland();

                AnalyzeTopology(internalModel.Roots);
            }
        }