def writeCapacitor(self, openetran): grid = self.Capacitor.layout() status = 0 # Status = 1 when no widgets are left to delete while status == 0: status = Add_Delete_Widgets.deleteCapacitor(self, grid) # Number of Meters in the system num = len(openetran['capacitor']) if num > 1: for k in range(num - 1): Add_Delete_Widgets.addCapacitor(self, grid) writeWidgets(openetran, grid, 'capacitor', 2, 4, 1)
def deleteCapacitor(): Add_Delete_Widgets.deleteCapacitor(self, self.Capacitor.layout())