-
-
Save hgrecco/6486889 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SampleRateUnit = {'Seconds': '0', 'Minutes': '1', 'Hours': '2', | |
'Days': '3', '%': '4'} | |
SamplePeriodUnit = {'Seconds': '0', 'Minutes': '1', 'Hours': '2', | |
'Days': '3', 'Weeks': '4', 'Pulses': '5'} | |
TotalDurationUnit = {'Period': '0', 'Seconds': '1', 'Minutes': '2', | |
'Hours': '3', 'Days': '4', 'Weeks': '5', 'Continuous': '6', | |
'predefinded': '7'} | |
TimeStampEnabled = {False: 0, True: 1} | |
@Feat(values=(None, SampleRateUnit, None, SamplePeriodUnit, None, | |
TotalDurationUnit, TimeStampEnabled,)) | |
def sampling(self): | |
"""This command is used to read the current data sampling settings. | |
(rds) | |
""" | |
return self.parse_query('*rds', format='Sample Rate: {:f} / {}\t' | |
'Sample Period: {:f} / {}\t' | |
'Total Duration: {:f} {}\t' | |
'Time Stamp: {}') | |
@sampling.setter | |
def sampling(self, value): | |
"""This command provides the data sampling parameters for the logging | |
and statistics environments. (dsu) | |
""" | |
self.query('*dsu {} {} {} {} {} {} {}'.format(*value)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I see now. Sorry for the confusion. In this cases where the instrument programming code is not designed in a simmetrical way, you can still use getter and setter but just avoid the automatic conversion using values.
By the way, are you sure that the numbers are always integers?