Skip to content

Commit

Permalink
Merge pull request #55 from cornellrocketryteam/09-25-formatting_sens…
Browse files Browse the repository at this point in the history
…ors_actuators_directories_and_adding_necessary_files

Formatting sensors/actuators directories and adding necessary files. Also updating BUILD bazel files in /sensors and /actuators.
  • Loading branch information
bwz5 committed Sep 26, 2024
2 parents a7a137b + c8e26b8 commit d432dc1
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 13 deletions.
28 changes: 28 additions & 0 deletions actuators/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
cc_library(
name = "actuator",
hdrs = ["actuator.h"],
deps = [],
visibility = [
"//fill:__subpackages__",
],
)

cc_library(
name = "ball_valve",
srcs = ["ball_valve.cc"],
hdrs = ["ball_valve.h"],
deps = [":actuator"],
visibility = [
"//fill:__subpackages__",
],
)

cc_library(
name = "sol_valve",
srcs = ["sol_valve.cc"],
hdrs = ["sol_valve.h"],
deps = [":actuator"],
visibility = [
"//fill:__subpackages__",
],
)
Empty file added actuators/actuator.h
Empty file.
Empty file added actuators/ball_valve.cc
Empty file.
Empty file added actuators/ball_valve.h
Empty file.
Empty file added actuators/qd.cc
Empty file.
Empty file added actuators/sol_valve.cc
Empty file.
Empty file added actuators/sol_valve.h
Empty file.
2 changes: 1 addition & 1 deletion fill/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cc_binary(
deps = [
":telemetry_reader",
"//protos:command_cc_grpc",
"//sensors:ducer",
"//sensors:ptd",
"@abseil-cpp//absl/flags:flag",
"@abseil-cpp//absl/flags:parse",
"@abseil-cpp//absl/strings:str_format",
Expand Down
2 changes: 1 addition & 1 deletion fill/fill_station.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <thread>

#include "telemetry_reader.h"
#include "sensors/ducer.h"
#include "sensors/ptd.h"

#include "absl/flags/flag.h"
#include "absl/flags/parse.h"
Expand Down
19 changes: 13 additions & 6 deletions sensors/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,26 @@ cc_library(
deps = [],
visibility = [
"//fill:__subpackages__",
"//ground:__subpackages__",
],
)

cc_library(
name = "ducer",
srcs = ["ducer.cc"],
hdrs = ["ducer.h"],
name = "load_cell",
srcs = ["load_cell.cc"],
hdrs = ["load_cell.h"],
deps = [":sensor"],
visibility = [
"//fill:__subpackages__",
],
)

cc_library(
name = "ptd",
srcs = ["ptd.cc"],
hdrs = ["ptd.h"],
deps = [":sensor"],
visibility = [
"//fill:__subpackages__",
"//ground:__subpackages__",
],
)

Expand All @@ -28,6 +36,5 @@ cc_library(
],
visibility = [
"//fill:__subpackages__",
"//ground:__subpackages__",
],
)
Empty file added sensors/load_cell.cc
Empty file.
Empty file added sensors/load_cell.h
Empty file.
4 changes: 2 additions & 2 deletions sensors/ducer.cc → sensors/ptd.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ducer.h"
#include "ptd.h"

float Ducer::Read() {
float PTD::Read() {
float reading = 3.14;
cache_.push_back(reading);
return reading;
Expand Down
2 changes: 1 addition & 1 deletion sensors/ducer.h → sensors/ptd.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "sensor.h"

class Ducer : public Sensor {
class PTD : public Sensor {
public:
float Read();
};
4 changes: 2 additions & 2 deletions sensors/sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

class Sensor {
public:
virtual ~Sensor() {}
virtual ~Sensor() {}
virtual float Read() = 0;
protected:
// cache for rolling averages
std::vector<float> cache_;
};
#endif
#endif

0 comments on commit d432dc1

Please sign in to comment.