diff --git a/POCloud_Driver/pickle_to_class.py b/POCloud_Driver/pickle_to_class.py new file mode 100644 index 0000000..212ae2d --- /dev/null +++ b/POCloud_Driver/pickle_to_class.py @@ -0,0 +1,10 @@ +import pickle +with open("ipp_channels.p", 'rb') as picklefile: + channels = pickle.load(picklefile) + +for chname in sorted(channels): + ch = channels[chname] + if ch['data_type'] == "BOOL": + print("'{0}': Channel('{0}', '{1}', {2}, self.sendtodbJSON, writeable=True, e300_param=False),".format(chname, ch['tag'], ch['max_time_between_uploads'])) + else: + print("'{0}': Channel('{0}', '{1}', {2}, self.sendtodbJSON, writeable=True, change_threshold=1.0, e300_param=False),".format(chname, ch['tag'], ch['max_time_between_uploads']))