Skip to content

Commit

Permalink
formalized THPM100TDS, author/date missing
Browse files Browse the repository at this point in the history
  • Loading branch information
lucabar committed Jun 21, 2020
1 parent 92ee496 commit 16388c5
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions ThorlabsPM100.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
from ThorlabsPM100 import ThorlabsPM100, USBTMC
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


from tango import AttrQuality, AttrWriteType, DispLevel, DevState, DebugIt
from tango.server import Device, attribute, command, pipe, device_property
# Copyright (C) DATE MBI-Division-B
# MIT License, refer to LICENSE file
# Author: / Email: (set year in DATE above please)

class ThorlabsPM100(Device):
from ThorlabsPM100 import ThorlabsPM100, USBTMC

wavelength = attribute(label="Wavelength (nm)", dtype=float,
display_level=DispLevel.OPERATOR,
access=AttrWriteType.READ_WRITE,
doc="Correction wavelength")
from tango import AttrWriteType, DispLevel, DevState
from tango.server import Device, attribute

power = attribute(label="Power (W)", dtype=float,
display_level=DispLevel.OPERATOR,
access=AttrWriteType.READ,
doc="Measured power")

class ThorlabsPM100TDS(Device):

wavelength = attribute(label="Wavelength (nm)",
dtype=float,
display_level=DispLevel.OPERATOR,
access=AttrWriteType.READ_WRITE,
doc="Correction wavelength")

power = attribute(label="Power (W)",
dtype=float,
display_level=DispLevel.OPERATOR,
access=AttrWriteType.READ,
doc="Measured power")

def init_device(self):
Device.init_device(self)
Expand All @@ -25,7 +34,7 @@ def init_device(self):

def read_wavelength(self):
return self.power_meter.sense.correction.wavelength

def write_wavelength(self, wav):
self.wavelength = wav
self.power_meter.sense.correction.wavelength = wav
Expand All @@ -35,4 +44,4 @@ def read_power(self):


if __name__ == "__main__":
ThorlabsPM100.run_server()
ThorlabsPM100TDS.run_server()

0 comments on commit 16388c5

Please sign in to comment.