Skip to content

Commit

Permalink
Merge pull request #239 from simonzihlmann/feat_add_support_old_bluef…
Browse files Browse the repository at this point in the history
…ors_lgos

BlueFors: make driver compatible with old and new log files
  • Loading branch information
astafan8 committed Aug 24, 2023
2 parents 51db4fd + b24f0d8 commit 76e17c3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions qcodes_contrib_drivers/drivers/BlueFors/BlueFors.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,12 @@ def get_temperature(self, channel: int) -> float:
names = ['date', 'time', 'y'],
header = None)

# There is no space before the day with BlueFors Control Software v2.2
df.index = pd.to_datetime(df['date']+'-'+df['time'], format='%d-%m-%y-%H:%M:%S')
try:
# There is a space before the day for old BlueFors Control Sofware versions
df.index = pd.to_datetime(df['date']+'-'+df['time'], format=' %d-%m-%y-%H:%M:%S')
except:
# There is no space before the day with BlueFors Control Software v2.2
df.index = pd.to_datetime(df['date']+'-'+df['time'], format='%d-%m-%y-%H:%M:%S')

return df.iloc[-1]['y']
except (PermissionError, OSError) as err:
Expand Down

0 comments on commit 76e17c3

Please sign in to comment.