Skip to content

Sns susptemp - #143

Open
supermegho wants to merge 3 commits into
masterfrom
sns_susptemp
Open

Sns susptemp#143
supermegho wants to merge 3 commits into
masterfrom
sns_susptemp

Conversation

@supermegho

Copy link
Copy Markdown
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.

@supermegho
supermegho requested a review from mifrandir April 8, 2022 13:15
@supermegho
supermegho requested a review from kshxtij as a code owner April 8, 2022 13:15

@kshxtij kshxtij left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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)

@kshxtij kshxtij Apr 8, 2022

Copy link
Copy Markdown
Contributor

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

Comment thread src/sensors/main.cpp
}
}

void Main::checkSuspensionTemperature()

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Comment thread src/sensors/main.cpp
}
}

void Main::checkSuspensionTemperature()

Copy link
Copy Markdown
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 ishmis 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