db_handler.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import sqlite3
  2. from pathlib import Path
  3. class CellLimits():
  4. def __init__(self, min_voltage, max_voltage, min_current, max_current, min_temperature, max_temperature):
  5. if min_voltage > max_voltage:
  6. raise ValueError("min_voltage cannot be greater than max_voltage")
  7. if min_current > max_current:
  8. raise ValueError("min_current cannot be greater than max_current")
  9. if min_temperature > max_temperature:
  10. raise ValueError("min_temperature cannot be greater than max_temperature")
  11. self.min_voltage = min_voltage
  12. self.max_voltage = max_voltage
  13. self.min_current = min_current
  14. self.max_current = max_current
  15. self.min_temperature = min_temperature
  16. self.max_temperature = max_temperature
  17. class DatabaseHandler:
  18. def __init__(self, db_path="cell_data.db"):
  19. # add code for initializing database connection
  20. pass
  21. def get_cell_capacity_nom(self, cell_id):
  22. # add code for getting nominal cell capacity from database
  23. pass
  24. def get_cell_capacity(self, cell_id):
  25. # add code for getting cell capacity from database
  26. pass
  27. def update_cell_capacity(self, cell_id, estimated_capacity_mah):
  28. # add code for updating cell capacity in database
  29. pass
  30. def get_cell_limits(self, cell_id):
  31. # add code for getting cell limits from database
  32. return None