Пример #1
0
 def __init__(self, name, rangeV, rangeI, pinEnable, activeHigh, pinInV, pinInI, pinOutV, highFreqPWM=False):
     self.activeHigh = activeHigh
     self.varEnable = SysVarDigitalArduino('enable', pinEnable, name)
     SysCompArduino.__init__(self, name,
                             (SysVarAnalogArduinoUnipolar('V', rangeV, pinInV, pinOutV, name, 'Voltage', 'kV', self.PreEditV, highFreqPWM=highFreqPWM, pinInVoltsMax=1),
                              SysVarAnalogArduinoUnipolar('I', rangeI, pinInI, None, name, 'Current', 'uA', highFreqPWM=highFreqPWM, pinInVoltsMax=1)),
                             'monitor/change High Voltage variables')
Пример #2
0
    def __init__(self, name, rangeV, rangeI, pinEnable, pinInV, pinInI, pinOutV, pinOutI=None, highFreqPWM=False, pinsVoltsMax=5, safetyMaxAbsVoltage=None, ctlV_I2cDac=None, ctlI_I2cDac=None):
        varEnable = SysVarDigitalArduino('enable', pinEnable, name)

        # Reduce maximal pin output according to security voltage
        if safetyMaxAbsVoltage != None:
            divider = safetyMaxAbsVoltage / max(abs(rangeV[0]), abs(rangeV[1]))
        else:
            divider = 1
        rangeV[0] *= divider
        rangeV[1] *= divider
        pinsVoltsMaxAdjusted = pinsVoltsMax * divider

        # set voltage variable according to the voltage range. Use methods defined in the instantiated sub-class
        if rangeV[0] * rangeV[1] >= 0:
            if ctlV_I2cDac:
                voltageVar = SysVarAnalogArduinoUnipolar('V', rangeV, pinInV, None, name, 'Voltage', 'kV', self.PreEditV, highFreqPWM=highFreqPWM, pinOutVoltsMax=pinsVoltsMaxAdjusted, pinInVoltsMax=pinsVoltsMaxAdjusted, I2cDac=ctlV_I2cDac)
            else:
                voltageVar = SysVarAnalogArduinoUnipolar('V', rangeV, pinInV, pinOutV, name, 'Voltage', 'kV', self.PreEditV, highFreqPWM=highFreqPWM, pinOutVoltsMax=pinsVoltsMaxAdjusted, pinInVoltsMax=pinsVoltsMaxAdjusted)
        else:
            if ctlV_I2cDac:
                voltageVar = SysVarAnalogArduinoBipolarWithExternalPolarity('V', rangeV, pinInV, None, self.SetPolarityPositive, self.GetPolarityPositive, name, 'Voltage', 'kV', self.PreEditV, highFreqPWM=highFreqPWM, pinOutVoltsMax=pinsVoltsMaxAdjusted, pinInVoltsMax=pinsVoltsMaxAdjusted, I2cDac=ctlV_I2cDac)
            else:
                voltageVar = SysVarAnalogArduinoBipolarWithExternalPolarity('V', rangeV, pinInV, pinOutV, self.SetPolarityPositive, self.GetPolarityPositive, name, 'Voltage', 'kV', self.PreEditV, highFreqPWM=highFreqPWM, pinOutVoltsMax=pinsVoltsMaxAdjusted, pinInVoltsMax=pinsVoltsMaxAdjusted)

        if ctlI_I2cDac:
            currentVar = SysVarAnalogArduinoUnipolar('I', rangeI, pinInI, None, name, 'Current', 'uA', highFreqPWM=highFreqPWM, pinOutVoltsMax=pinsVoltsMax, pinInVoltsMax=pinsVoltsMax, I2cDac=ctlI_I2cDac)
        else:
            currentVar = SysVarAnalogArduinoUnipolar('I', rangeI, pinInI, pinOutI, name, 'Current', 'uA', highFreqPWM=highFreqPWM, pinOutVoltsMax=pinsVoltsMax, pinInVoltsMax=pinsVoltsMax)

        SysCompArduino.__init__(self, name,
                                (voltageVar, currentVar, varEnable),
                                'monitor/change High Voltage variables')
Пример #3
0
    def __init__(self,
                 name,
                 pinInPercent,
                 pinOutPercent,
                 pinOutClose=None,
                 I2cDac=None):
        if I2cDac:
            controlVar = SysVarAnalogArduinoUnipolar('Flow', [0, 100],
                                                     pinInPercent,
                                                     None,
                                                     name,
                                                     'Flow percentage',
                                                     '%',
                                                     self.PreEditPercent,
                                                     I2cDac=I2cDac)
        else:
            controlVar = SysVarAnalogArduinoUnipolar('Flow', [0, 100],
                                                     pinInPercent,
                                                     pinOutPercent,
                                                     name,
                                                     'Flow percentage',
                                                     '%',
                                                     self.PreEditPercent,
                                                     highFreqPWM=True)

        SysCompArduino.__init__(self, name, (controlVar, ),
                                'monitor/change gas flow')

        self.pinOutClose = pinOutClose
        if self.pinOutClose != None:
            self.varClose = SysVarDigitalArduino('close', pinOutClose, name)
Пример #4
0
 def __init__(self, name, rangeT, pinInT, pinOutRelay, sensorVoltsMin, sensorVoltsMax, pidVar, windowSizeMs, kp, ki, kd):
     self.varEnable = SysVarDigitalArduino('enable', None, name, PreSetFunc=self.PreEditEnable)
     self.pidRelayVar = SysVarPidRelayArduino('T', rangeT, pidVar, windowSizeMs, kp, ki, kd, pinInT, pinOutRelay, name, 'Temperature',
                                              'C', pinInVoltsMin=sensorVoltsMin, pinInVoltsMax=sensorVoltsMax)
     SysCompArduino.__init__(self, name,
                             (self.pidRelayVar, self.varEnable), 
                             'control a heating element through a relay to keep the temperature set')
Пример #5
0
 def __init__(self,
              name,
              rangeV,
              rangeI,
              pinEnable,
              activeHigh,
              pinInV,
              pinInI,
              pinOutV,
              highFreqPWM=False):
     self.activeHigh = activeHigh
     self.varEnable = SysVarDigitalArduino('enable', pinEnable, name)
     SysCompArduino.__init__(
         self, name, (SysVarAnalogArduinoUnipolar('V',
                                                  rangeV,
                                                  pinInV,
                                                  pinOutV,
                                                  name,
                                                  'Voltage',
                                                  'kV',
                                                  self.PreEditV,
                                                  highFreqPWM=highFreqPWM,
                                                  pinInVoltsMax=1),
                      SysVarAnalogArduinoUnipolar('I',
                                                  rangeI,
                                                  pinInI,
                                                  None,
                                                  name,
                                                  'Current',
                                                  'uA',
                                                  highFreqPWM=highFreqPWM,
                                                  pinInVoltsMax=1)),
         'monitor/change High Voltage variables')
Пример #6
0
 def __init__(self, name, pinInPercent, pinOutPercent, pinOutClose=None):
     SysCompArduino.__init__(self, name, 
                             (SysVarAnalogArduinoUnipolar('Flow', [0,100], pinInPercent, pinOutPercent, name, 'Flow percentage', '%', self.PreEditPercent, highFreqPWM=True),),
                             'monitor/change gas flow')
     
     self.pinOutClose = pinOutClose
     if self.pinOutClose != None:
         self.varClose = SysVarDigitalArduino('close', pinOutClose, name)
Пример #7
0
    def __init__(self, name, rangeV, pinInV, pinOutV=None, ctlV_I2cDac=None):
        if ctlV_I2cDac:
            voltageVar = SysVarAnalogArduinoUnipolar('V', rangeV, pinInV, None, name, 'Voltage', 'V', I2cDac=ctlV_I2cDac)
        else:
            voltageVar = SysVarAnalogArduinoUnipolar('V', rangeV, pinInV, pinOutV, name, 'Voltage', 'V')

        SysCompArduino.__init__(self, name,
                                (voltageVar,),
                                'monitor/change High Voltage variables')
Пример #8
0
 def __init__(self, name, rangeP, units, pinInP, pinInVoltsMax, pinInVoltsMin):
     SysCompArduino.__init__(self, name,
                             (SysVarAnalogArduinoUnipolar(name='P',
                                                          range=rangeP,
                                                          pinAnalIn=pinInP,
                                                          pinPwmOut=None,
                                                          compName=name,
                                                          helpLine='Pressure',
                                                          units=units,
                                                          pinInVoltsMax=pinInVoltsMax,
                                                          pinInVoltsMin=pinInVoltsMin),),
                             'monitor pressure')
Пример #9
0
 def __init__(self, name, rangeP, pinInP):
     SysCompArduino.__init__(
         self, name, (SysVarAnalogArduinoUnipolar('P',
                                                  rangeP,
                                                  pinInP,
                                                  None,
                                                  name,
                                                  'Pressure',
                                                  'mbar',
                                                  pinInVoltsMax=4.5,
                                                  pinInVoltsMin=0.5), ),
         'monitor pressure')
Пример #10
0
 def __init__(self, name, rangeP, pinInP, pinOutP, highFreqPWM=False):
     SysCompArduino.__init__(
         self, name,
         (SysVarAnalogArduinoUnipolar('P',
                                      rangeP,
                                      pinInP,
                                      pinOutP,
                                      name,
                                      'Pressure',
                                      'psi',
                                      highFreqPWM=highFreqPWM), ),
         'monitor/change pressure')
Пример #11
0
 def __init__(self, name, pumpVolumeMiliLit, addressPump, addressMultivalve, pinRx=None, pinTx=None, serialPort=1):
     SysCompArduino.__init__(self, 'SIA', (), "send commands to the SIA")
     self.serialPort = serialPort
     if (pinRx != None and pinTx != None):
         self.pinRx = pinRx
         self.pinTx = pinTx
         self.useSoftSer = True
     else:
         self.useSoftSer = False
     self.pumpVolumeMiliLit = pumpVolumeMiliLit
     self.addressPump = addressPump
     self.addressMultivalve = addressMultivalve
Пример #12
0
 def __init__(self, name, rangeT, pinInT, pinInVoltsMax, pinInVoltsMin):
     SysCompArduino.__init__(
         self, name,
         (SysVarAnalogArduinoUnipolar('T',
                                      rangeT,
                                      pinInT,
                                      None,
                                      name,
                                      'Temperature',
                                      'C',
                                      pinInVoltsMax=pinInVoltsMax,
                                      pinInVoltsMin=pinInVoltsMin), ),
         'measure the temperature')
Пример #13
0
 def __init__(self, name, rangeP, units, pinInP, pinInVoltsMax,
              pinInVoltsMin):
     SysCompArduino.__init__(
         self, name,
         (SysVarAnalogArduinoUnipolar(name='P',
                                      range=rangeP,
                                      pinAnalIn=pinInP,
                                      pinPwmOut=None,
                                      compName=name,
                                      helpLine='Pressure',
                                      units=units,
                                      pinInVoltsMax=pinInVoltsMax,
                                      pinInVoltsMin=pinInVoltsMin), ),
         'monitor pressure')
Пример #14
0
    def __init__(self, name, rangeV, pinInV, pinOutV=None, ctlV_I2cDac=None):
        if ctlV_I2cDac:
            voltageVar = SysVarAnalogArduinoUnipolar('V',
                                                     rangeV,
                                                     pinInV,
                                                     None,
                                                     name,
                                                     'Voltage',
                                                     'V',
                                                     I2cDac=ctlV_I2cDac)
        else:
            voltageVar = SysVarAnalogArduinoUnipolar('V', rangeV, pinInV,
                                                     pinOutV, name, 'Voltage',
                                                     'V')

        SysCompArduino.__init__(self, name, (voltageVar, ),
                                'monitor/change High Voltage variables')
Пример #15
0
 def __init__(self,
              name,
              pumpVolumeMiliLit,
              addressPump,
              addressMultivalve,
              pinRx=None,
              pinTx=None,
              serialPort=1):
     SysCompArduino.__init__(self, 'SIA', (), "send commands to the SIA")
     self.serialPort = serialPort
     if (pinRx != None and pinTx != None):
         self.pinRx = pinRx
         self.pinTx = pinTx
         self.useSoftSer = True
     else:
         self.useSoftSer = False
     self.pumpVolumeMiliLit = pumpVolumeMiliLit
     self.addressPump = addressPump
     self.addressMultivalve = addressMultivalve
Пример #16
0
 def __init__(self, name, rangeT, pinInT, pinOutRelay, sensorVoltsMin,
              sensorVoltsMax, pidVar, windowSizeMs, kp, ki, kd):
     self.varEnable = SysVarDigitalArduino('enable',
                                           None,
                                           name,
                                           PreSetFunc=self.PreEditEnable)
     self.pidRelayVar = SysVarPidRelayArduino('T',
                                              rangeT,
                                              pidVar,
                                              windowSizeMs,
                                              kp,
                                              ki,
                                              kd,
                                              pinInT,
                                              pinOutRelay,
                                              name,
                                              'Temperature',
                                              'C',
                                              pinInVoltsMin=sensorVoltsMin,
                                              pinInVoltsMax=sensorVoltsMax)
     SysCompArduino.__init__(
         self, name, (self.pidRelayVar, self.varEnable),
         'control a heating element through a relay to keep the temperature set'
     )
Пример #17
0
    def __init__(self,
                 name,
                 rangeV,
                 rangeI,
                 pinEnable,
                 pinInV,
                 pinInI,
                 pinOutV,
                 pinOutI=None,
                 highFreqPWM=False,
                 pinsVoltsMax=5,
                 safetyMaxAbsVoltage=None,
                 ctlV_I2cDac=None,
                 ctlI_I2cDac=None):
        varEnable = SysVarDigitalArduino('enable', pinEnable, name)

        # Reduce maximal pin output according to security voltage
        if safetyMaxAbsVoltage != None:
            divider = safetyMaxAbsVoltage / max(abs(rangeV[0]), abs(rangeV[1]))
        else:
            divider = 1
        rangeV[0] *= divider
        rangeV[1] *= divider
        pinsVoltsMaxAdjusted = pinsVoltsMax * divider

        # set voltage variable according to the voltage range. Use methods defined in the instantiated sub-class
        if rangeV[0] * rangeV[1] >= 0:
            if ctlV_I2cDac:
                voltageVar = SysVarAnalogArduinoUnipolar(
                    'V',
                    rangeV,
                    pinInV,
                    None,
                    name,
                    'Voltage',
                    'kV',
                    self.PreEditV,
                    highFreqPWM=highFreqPWM,
                    pinOutVoltsMax=pinsVoltsMaxAdjusted,
                    pinInVoltsMax=pinsVoltsMaxAdjusted,
                    I2cDac=ctlV_I2cDac)
            else:
                voltageVar = SysVarAnalogArduinoUnipolar(
                    'V',
                    rangeV,
                    pinInV,
                    pinOutV,
                    name,
                    'Voltage',
                    'kV',
                    self.PreEditV,
                    highFreqPWM=highFreqPWM,
                    pinOutVoltsMax=pinsVoltsMaxAdjusted,
                    pinInVoltsMax=pinsVoltsMaxAdjusted)
        else:
            if ctlV_I2cDac:
                voltageVar = SysVarAnalogArduinoBipolarWithExternalPolarity(
                    'V',
                    rangeV,
                    pinInV,
                    None,
                    self.SetPolarityPositive,
                    self.GetPolarityPositive,
                    name,
                    'Voltage',
                    'kV',
                    self.PreEditV,
                    highFreqPWM=highFreqPWM,
                    pinOutVoltsMax=pinsVoltsMaxAdjusted,
                    pinInVoltsMax=pinsVoltsMaxAdjusted,
                    I2cDac=ctlV_I2cDac)
            else:
                voltageVar = SysVarAnalogArduinoBipolarWithExternalPolarity(
                    'V',
                    rangeV,
                    pinInV,
                    pinOutV,
                    self.SetPolarityPositive,
                    self.GetPolarityPositive,
                    name,
                    'Voltage',
                    'kV',
                    self.PreEditV,
                    highFreqPWM=highFreqPWM,
                    pinOutVoltsMax=pinsVoltsMaxAdjusted,
                    pinInVoltsMax=pinsVoltsMaxAdjusted)

        if ctlI_I2cDac:
            currentVar = SysVarAnalogArduinoUnipolar(
                'I',
                rangeI,
                pinInI,
                None,
                name,
                'Current',
                'uA',
                highFreqPWM=highFreqPWM,
                pinOutVoltsMax=pinsVoltsMax,
                pinInVoltsMax=pinsVoltsMax,
                I2cDac=ctlI_I2cDac)
        else:
            currentVar = SysVarAnalogArduinoUnipolar(
                'I',
                rangeI,
                pinInI,
                pinOutI,
                name,
                'Current',
                'uA',
                highFreqPWM=highFreqPWM,
                pinOutVoltsMax=pinsVoltsMax,
                pinInVoltsMax=pinsVoltsMax)

        SysCompArduino.__init__(self, name,
                                (voltageVar, currentVar, varEnable),
                                'monitor/change High Voltage variables')
Пример #18
0
 def __init__(self, name, digiVars=()):
     SysCompArduino.__init__(self, name, digiVars,
                             "turn on/off Arduino digital pins")
Пример #19
0
 def __init__(self, name, pin):
     SysCompArduino.__init__(
         self, name, (SysVarDigitalArduino("trigger", pin, name, PreSetFunc=self.Pause),), "trigger the e-corder"
     )
Пример #20
0
 def __init__(self, name, digiVars=()):
     SysCompArduino.__init__(self, name, digiVars, "turn on/off Arduino digital pins")
Пример #21
0
 def __init__(self, name, analogVars=()):
     SysCompArduino.__init__(self, name, analogVars,
                             "set Arduino analog pins")
Пример #22
0
 def __init__(self, name, analogVars=()):
     SysCompArduino.__init__(self, name, analogVars, "set Arduino analog pins")
Пример #23
0
 def __init__(self, name, rangeP, pinInP, pinOutP, highFreqPWM=False, units='psi'):
     SysCompArduino.__init__(self, name,
                             (SysVarAnalogArduinoUnipolar('P', rangeP, pinInP, pinOutP, name, 'Pressure', units, highFreqPWM=highFreqPWM),),
                             'monitor/change pressure')
Пример #24
0
 def __init__(self, name, rangeT, pinInT, pinInVoltsMax, pinInVoltsMin):
     SysCompArduino.__init__(self, name,
                             (SysVarAnalogArduinoUnipolar('T', rangeT, pinInT, None, name, 'Temperature', 'C', pinInVoltsMax=pinInVoltsMax, pinInVoltsMin=pinInVoltsMin),),
                             'measure the temperature')
Пример #25
0
 def __init__(self, name, rangeP, pinInP):
     SysCompArduino.__init__(self, name,
                             (SysVarAnalogArduinoUnipolar('P', rangeP, pinInP, None, name, 'Pressure', 'mbar', pinInVoltsMax=4.5, pinInVoltsMin=0.5),),
                             'monitor pressure')
Пример #26
0
 def __init__(self, name, rangeP, pinInP, pinOutP=None, highFreqPWM=False, units='psi', I2cDac=None):
     SysCompArduino.__init__(self, name,
                             (SysVarAnalogArduinoUnipolar('P', rangeP, pinInP, pinOutP, name, 'Pressure', units, highFreqPWM=highFreqPWM, I2cDac=I2cDac),),
                             'monitor/change pressure')
Пример #27
0
 def __init__(self, name, pin):
     SysCompArduino.__init__(self, name, (SysVarDigitalArduino(
         'trigger', pin, name, PreSetFunc=self.Pause), ),
                             'trigger the e-corder')
Пример #28
0
 def __init__(self, name, rangeV, pinInV, pinOutV):
     SysCompArduino.__init__(self, name,
                             (SysVarAnalogArduinoUnipolar('V', rangeV, pinInV, pinOutV, name, 'Voltage', 'V'),),
                             'monitor/change High Voltage variables')