-
Hi, We would like to add new laser module. We already operate the module using a standalone python script. Next stage to wrap it correctly according to qudi convention - however we are not sure about it. looking at Coherent obis as an example we see the following:
can you please explain the name ( BR, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
The entry in the config file you can name as you like ("obis_laser" could
be "obis_laser_serial_num123" or what you like.
In essence if my understading is correct qudi needs to find the hardware
class.
Therefore your config entry needs to be under the hardware level i.e.
hardware:
my_hardware_module:
module.Class:
'relative.path.to.hardwarefile.from.hardware.folder.NameOfHardwareClass'
options:
var: "Internal variable used by the hardware class"
Hope this helps you.
Regards,
Gerhard
Am Do., 9. Nov. 2023 um 13:44 Uhr schrieb AItah ***@***.***>:
… Hi,
We would like to add new laser module. We already operate the module using
a standalone python script. Next stage to wrap it correctly according to
qudi convention - however we are not sure about it.
looking at Coherent obis as an example we see the following:
Example config for copy-paste:
obis_laser:
module.Class: 'laser.coherent_obis_laser.OBISLaser'
options:
com_port: 'COM3'
can you please explain the name (obis_laser:) and module.Class convention?
Does the naming need to be similar to the filename we will create and/or
class name, etc?
BR,
Amir
—
Reply to this email directly, view it on GitHub
<#111>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACVMTIJJM75JCVNFF5R3B7LYDTFZFAVCNFSM6AAAAAA7EP6YVOVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZVHAZTEMJYG4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thank you.
|
Beta Was this translation helpful? Give feedback.
-
EDIT: You can actually ignore this. I realised you were doing something much simpler than what I thought you were doing :) See my reply :) It's slightly more complicated than that. It'll load the module (and class) with a prefixed "qudi.hardware" module name. So what I suggest is that you make a package like this:
The important thing here is that your package contains two namespace modules "qudi" and inside that, "hardware". So now if you Then in your config file, you say:
Of course your You might get better value out of having the functionality to drive the laser in one class (what you have already), and writing your cobolt_laser.py to contain just the adapter to make it work with Qudi. Better from a software engineering perspective anyway in case you ever need to drive it from other things or software (e.g. notebooks). |
Beta Was this translation helpful? Give feedback.
Thank you.
So if my class is COBOLTLaser and the file is located under ../HW/laser/cobolt_06_mld_laser.py the following should be the config settings?