#include "tank.h"
#include <iostream>
+#include "condition.h"
using namespace PlaQui::Model;
Tank::Tank(const std::string &_name):Source(_name),Drain(_name),Control(_name)
{
litros = 0.0f;
+
+ /* Utilizo en input como el flotante de arriba y el output como el de abajo */
+ input = new Condition(Condition::GT, 0.9, this);
+ output = new Condition(Condition::LT, 0.1, this);
}
Tank::~Tank()
{
+ delete input;
+ delete output;
}
bool Tank::get_output()
switch (msg) {
case MSG_QUERY_MAX_FLOW_OUT:
+ if (updated) {
+ who->recieve_msg(MSG_RESPONSE_MAX_FLOW, this, &actual_in_flow);
+ }
actual_in_flow = capacity - litros;
if (*((float *)data) < actual_in_flow)
actual_in_flow = *((float *)data);