def test_getHvdcLineCktsForDisplay(self) -> None:
     """tests the function that gets elements for display from outage software
     """
     pwcDbConnStr = self.appConf['pwcDbConnStr']
     eRepo = ElementsRepo(pwcDbConnStr)
     elems = eRepo.getHvdcLineCktsForDisplay()
     self.assertFalse(len(elems) == 0)
Exemplo n.º 2
0
def getElementsByType(elType: str) -> dict:
    elObjs: List[dict] = []
    appConf = getConfig()
    eRepo = ElementsRepo(appConf['pwcDbConnStr'])
    if elType == 'Bay':
        bays = eRepo.getBaysForDisplay()
        elObjs = bays
    if elType == 'AC_TRANSMISSION_LINE_CIRCUIT':
        elems = eRepo.getTranLineCktsForDisplay()
        elObjs = elems
    if elType == 'BUS':
        elems = eRepo.getBusesForDisplay()
        elObjs = elems
    if elType == 'BUS REACTOR':
        elems = eRepo.getBusReactorsForDisplay()
        elObjs = elems
    if elType == 'Filter Bank':
        elems = eRepo.getFilterBanksForDisplay()
        elObjs = elems
    if elType == 'FSC':
        elems = eRepo.getFscsForDisplay()
        elObjs = elems
    if elType == 'GENERATING_UNIT':
        elems = eRepo.getGeneratingUnitsForDisplay()
        elObjs = elems
    if elType == 'HVDC_LINE_CIRCUIT':
        elems = eRepo.getHvdcLineCktsForDisplay()
        elObjs = elems
    if elType == 'HVDC POLE':
        elems = eRepo.getHvdcPolesForDisplay()
        elObjs = elems
    if elType == 'LINE_REACTOR':
        elems = eRepo.getLineReactorsForDisplay()
        elObjs = elems
    if elType == 'SVC':
        elems = eRepo.getSvcsForDisplay()
        elObjs = elems
    if elType == 'TCSC':
        elems = eRepo.getTcscsForDisplay()
        elObjs = elems
    if elType == 'TRANSFORMER':
        elems = eRepo.getTransformersForDisplay()
        elObjs = elems
    return {"elements": elObjs}