OxfordIonTrapGroup / oxart-devices

ARTIQ/SiPyCo-compatible laboratory device drivers
https://oxfordiontrapgroup.github.io/oxart-devices
2 stars 3 forks source link

Thorlabs mdt39xb driver saves files in working directory #4

Open ljstephenson opened 3 years ago

ljstephenson commented 3 years ago

Yikes, this is code I wrote... the thorlabs mdt39xb driver saves the pyon file containing last used setpoints in the working directory. This is obviously not good, since this makes it highly sensitive to the way in which it was started -- in our setup they ended up in C:\WINDOWS\system32 (!)

I propose adding appdirs as in artiq to save the file in a predictable location. As (unfortunately) we are burdened with Windows, I'd prefer to use the user_data_dir function for this, unless there are objections. I'll prepare a PR to fix this.

dnadlinger commented 3 years ago

appdirs looks good – I'm using the Qt standard directories functionality elsewhere, but most of these drivers don't depend on Qt, so a lightweight solution sounds good.