From 52a4906e2d7774fbfb4ea16f618eb7a4b6815ba7 Mon Sep 17 00:00:00 2001 From: Victor Le Roch Date: Wed, 20 May 2020 09:25:14 +0200 Subject: [PATCH] =?UTF-8?q?classe=20terrarium=20cr=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/include/Terrarium.h | 42 +++++++++++++++++++++++++++++++ app/src/Terrarium.cpp | 56 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 app/include/Terrarium.h create mode 100644 app/src/Terrarium.cpp diff --git a/app/include/Terrarium.h b/app/include/Terrarium.h new file mode 100644 index 0000000..876c24f --- /dev/null +++ b/app/include/Terrarium.h @@ -0,0 +1,42 @@ +// +// Created by Victor Le Roch on 20/05/2020. +// + +#ifndef BE_TERRARIUM_H +#define BE_TERRARIUM_H + + +class Terrarium { +private: + int id; + float temperature; + float pression; + float PH; + int radState; + int tapState; +public: + Terrarium(int id); + + float getTemperature() const; + + void setTemperature(float temperature); + + float getPression() const; + + void setPression(float pression); + + float getPh() const; + + void setPh(float ph); + + int getRadState() const; + + void setRadState(int radState); + + int getTapState() const; + + void setTapState(int tadState); +}; + + +#endif //BE_TERRARIUM_H diff --git a/app/src/Terrarium.cpp b/app/src/Terrarium.cpp new file mode 100644 index 0000000..6d62e45 --- /dev/null +++ b/app/src/Terrarium.cpp @@ -0,0 +1,56 @@ +// +// Created by Victor Le Roch on 20/05/2020. +// + +#include "../include/Terrarium.h" +#include "../../core_simulation.h" + +float Terrarium::getTemperature() const { + return temperature; +} + +void Terrarium::setTemperature(float temperature) { + Terrarium::temperature = temperature; +} + +float Terrarium::getPression() const { + return pression; +} + +void Terrarium::setPression(float pression) { + Terrarium::pression = pression; +} + +float Terrarium::getPh() const { + return PH; +} + +void Terrarium::setPh(float ph) { + PH = ph; +} + +int Terrarium::getRadState() const { + return radState; +} + +void Terrarium::setRadState(int radState) { + Terrarium::radState = radState; +} + +int Terrarium::getTapState() const { + return tapState; +} + +void Terrarium::setTapState(int tapState) { + Terrarium::tapState = tapState; +} + +Terrarium::Terrarium(int id) { + id = id; + pression = 3000; + temperature = 20; + PH = 7; + radState = LOW; + tapState = LOW; + +}