getdarkmode

This commit is contained in:
Ian Gulliver
2016-04-08 11:24:02 -07:00
parent 75a3b7b125
commit c5226faa13
2 changed files with 14 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ LINES = [
('Transmission', ilt.GetTransmissionPercent, '%'), ('Transmission', ilt.GetTransmissionPercent, '%'),
('Optical density', ilt.GetOpticalDensity, '%'), ('Optical density', ilt.GetOpticalDensity, '%'),
('100% percent setting', ilt.Get100PercentVoltage, 'V'), ('100% percent setting', ilt.Get100PercentVoltage, 'V'),
('Dark mode', lambda: ilt.DARK_NAMES[ilt.GetDarkMode()], ''),
] ]

View File

@@ -57,6 +57,16 @@ class Saturated(Error):
class ILT1000(object): class ILT1000(object):
DARK_NONE = 0
DARK_FACTORY = 1
DARK_USER = 2
DARK_NAMES = {
0: 'None',
1: 'Factory',
2: 'User',
}
# ILT1000 presents two FTDI serial devices, which become ttyUSB0 and ttyUSB1 # ILT1000 presents two FTDI serial devices, which become ttyUSB0 and ttyUSB1
# if nothing else is attached. ttyUSB0 seems to be completely non-responsive. # if nothing else is attached. ttyUSB0 seems to be completely non-responsive.
# We default to ttyUSB1 # We default to ttyUSB1
@@ -144,3 +154,6 @@ class ILT1000(object):
# Spec says microvolts, but actual values appear to be in volts. # Spec says microvolts, but actual values appear to be in volts.
ret = self._SendCommand('get100perc') ret = self._SendCommand('get100perc')
return float(ret) return float(ret)
def GetDarkMode(self):
return int(self._SendCommand('getdarkmode'))