Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sns susptemp #143

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Sns susptemp #143

wants to merge 3 commits into from

Conversation

supermegho
Copy link
Contributor

Added Brakes and Suspension temperature sensor code.

Additional calculation added to temperature sensor code based on analogue calculation.

Shut down pod sequence added to main.cpp if we go over 85 degrees Celcius.

Copy link
Contributor

@kshxtij kshxtij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also within main.cpp, you need

  • a from file function, this can just be copy pasted with some minor changes from any of the other FromFile functions (look at this or this)
  • instantiate instances of the class from the pins
  • FakeBrakeAndSuspensionTemp


namespace hyped::sensors {

Temperature::Temperature(const uint8_t pin)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AmbientTemperature as class name and ambient_temperature.cpp for file name is probably better

#include <utils/logger.hpp>
namespace hyped::sensors {

class Temperature : public ITemperature {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AmbientTemperature

ambient_temperature.hpp


namespace hyped::sensors {

Temperature_susp::Temperature_susp(const uint8_t pin)
Copy link
Contributor

@kshxtij kshxtij Apr 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BrakeAndSuspenionTemperature for class?

brake_and_suspension_temperature.cpp for file?

Open to ideas on this, but the current naming isn't ideal

@@ -132,6 +132,19 @@ void Main::checkTemperature()
}
}

void Main::checkSuspensionTemperature()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've defined this but you aren't calling it anywhere yet

#include <utils/logger.hpp>
namespace hyped::sensors {

class Temperature_susp : public ITemperature_susp {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ITemperature_susp isn't defined anywhere + define the interface within the header instead of interface.hpp

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also same naming comment from the other file applies here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both types of temperature managers could be using the same interface ITemperature. Then it would make sense to have files temperature.cpp and temperature.hpp that contain the interface and both classes, AmbientTemperature and BrakeAndSuspsenionTemperature.


Temperature_susp::Temperature_susp(const uint8_t pin)
: pin_(pin),
log_("TEMPERATURE", utils::System::getSystem().config_.log_level_sensors)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Brakes and Suspension Temperature"


Temperature::Temperature(const uint8_t pin)
: pin_(pin),
log_("TEMPERATURE", utils::System::getSystem().config_.log_level_sensors)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Ambient Temperature"

/**
* @brief int from data structs
*/
data::Temperature_suspData temperature_susp_data_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can probably just keep data::TemperatureData and even then you'd need to define it within data

@@ -132,6 +132,19 @@ void Main::checkTemperature()
}
}

void Main::checkSuspensionTemperature()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also needs to be defined in main.hpp

@kshxtij kshxtij requested a review from SnickeyX April 8, 2022 17:25
@kshxtij kshxtij mentioned this pull request May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants