#-------------------------------------------------------------------------------
# Name:          Stop pumps
# Purpose:       Allows for stopping the pumps manually
# Authors:       Eric N
#
# Last Version:  22.09.2022
# Copyright:     (c) Institute of Technical Biocatalysis TUHH
# Licence:       GNU GPL-v3 
#-------------------------------------------------------------------------------
from pumps_new_era import pumps_new_era

class StopPumps():

    def __init__(self,pump,nPumps):

        # Stops nPumps. Works only if the continous adresses starting from 1 are used.
        for i in range(1,nPumps+1):
            if i < 10:
                adr = '0'+str(i)
            else:
                adr = str(i)
            pump.stop(adr)

if __name__ =='__main__':
    pump = pumps_new_era()
    # Pumpenanzahl
    nPumps = 4

    StopPumps(pump,nPumps)