Skip to content

Commit

Permalink
Add functionality for 'heating fluid' temp measurement (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrudd2 committed Jul 26, 2023
1 parent 5f285a0 commit d709d4e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ika/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ class HotplateProtocol:
READ_ACTUAL_PROCESS_TEMP = "IN_PV_1"
READ_ACTUAL_SURFACE_TEMP = "IN_PV_2"
READ_ACTUAL_SPEED = "IN_PV_4"
READ_ACTUAL_FLUID_TEMP = "IN_PV_7" # for double temp probe "PT1000"
READ_VISCOSITY_TREND_VALUE = "IN_PV_5"
READ_PROCESS_TEMP_SETPOINT = "IN_SP_1"
READ_SURFACE_TEMP_SETPOINT = "IN_SP_2"
Expand Down Expand Up @@ -204,6 +205,7 @@ async def get(self, include_surface_control=False):
speed_sp = await self.query(self.READ_SPEED_SETPOINT)
process_temp = await self.query(self.READ_ACTUAL_PROCESS_TEMP)
process_temp_sp = await self.query(self.READ_PROCESS_TEMP_SETPOINT)
fluid_temp = await self.query(self.READ_ACTUAL_FLUID_TEMP)
shaker_status = await self.query(self.READ_SHAKER_STATUS)
process_heater_status = await self.query(self.READ_PROCESS_HEATER_STATUS)
surface_data = {
Expand All @@ -226,6 +228,9 @@ async def get(self, include_surface_control=False):
'active': process_heater_status,
},
'surface_temp': surface_data,
'fluid_temp': {
'actual': fluid_temp,
}
}
return response

Expand Down
5 changes: 5 additions & 0 deletions ika/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ def __init__(self, *args, **kwargs):
"setpoint": 300,
"active": False,
},
"fluid_temp": {
"actual": 100,
}
}

async def query(self, command):
Expand All @@ -127,6 +130,8 @@ async def query(self, command):
return round(uniform(15, 100), 2)
elif command == self.READ_ACTUAL_SURFACE_TEMP:
return round(uniform(80, 120), 2)
elif command == self.READ_ACTUAL_FLUID_TEMP:
return round(uniform(20, 110), 2)
elif command == self.READ_SURFACE_TEMP_SETPOINT:
return self.state["surface_temp"]["setpoint"]
elif command == self.READ_PROCESS_TEMP_SETPOINT:
Expand Down

0 comments on commit d709d4e

Please sign in to comment.