Commit b56fec81 authored by Stefan Dähling's avatar Stefan Dähling

send connection time for ev

parent e9609ad1
......@@ -40,7 +40,9 @@ private:
double Q_meas_last; //!< last transmitted Q measurement
double Pth_meas_last; //!< last transmitted P_th measurement
bool connected_last; //!< last transmitted connection status
double t_connected_last; //!< last transmitted connection time
double v_meas_last; //!< last transmitted voltage measurement
double v2_meas_last; //!< last transmitted voltage measurement
double t_last_sent; //!< last time a message with measurements has been sent
double P_ctrl_last; //!< last received P set point
double Q_ctrl_last; //!< last received Q set point
......@@ -57,7 +59,9 @@ public:
void set_PQ_meas(double p, double q);
void set_Pth_meas(double pth);
void set_conn(bool conn);
void set_t_conn(double t_conn);
void set_v_meas(double v_meas);
void set_v2_meas(double v_meas);
void set_PQ_ctrl(double p, double q);
void set_n_ctrl(int n);
void set_t_sent(double t);
......@@ -67,7 +71,9 @@ public:
void get_PQ_meas(double &p, double &q);
double get_Pth_meas();
bool get_conn();
double get_t_conn();
double get_v_meas();
double get_v2_meas();
void get_PQ_ctrl(double &p, double &q);
int get_n_ctrl();
double get_t_sent();
......
......@@ -44,7 +44,9 @@ void Ensure_knowledge::init(int &_id, BehaviorIO* _io)
Q_meas_last = 0;
Pth_meas_last = 0;
connected_last = false;
t_connected_last = 0;
v_meas_last = 0;
v2_meas_last = 0;
P_ctrl_last = 0;
Q_ctrl_last = 0;
n_ctrl_last = 0;
......@@ -91,6 +93,15 @@ void Ensure_knowledge::set_conn(bool conn)
return;
}
/*! \brief setter for connection time
* \param t_conn connection time
* */
void Ensure_knowledge::set_t_conn(double t_conn)
{
t_connected_last = t_conn;
return;
}
/*! \brief setter for voltage measurement
* \param v_meas voltage measurement
* */
......@@ -100,6 +111,15 @@ void Ensure_knowledge::set_v_meas(double v_meas)
return;
}
/*! \brief setter for second voltage measurement
* \param v_meas voltage measurement
* */
void Ensure_knowledge::set_v2_meas(double v_meas)
{
v2_meas_last = v_meas;
return;
}
/*! \brief setter for PQ set point
* \param p P set point
* \param q Q set point
......@@ -173,6 +193,14 @@ bool Ensure_knowledge::get_conn()
return connected_last;
}
/*! \brief getter for connection time
* \return connection time
* */
double Ensure_knowledge::get_t_conn()
{
return t_connected_last;
}
/*! \brief getter for voltage measurement
* \return voltage measurement
* */
......@@ -181,6 +209,14 @@ double Ensure_knowledge::get_v_meas()
return v_meas_last;
}
/*! \brief getter for second voltage measurement
* \return voltage measurement
* */
double Ensure_knowledge::get_v2_meas()
{
return v2_meas_last;
}
/*! \brief getter for PQ set point
* \param p [out] P set point
* \param q [out] Q set point
......@@ -231,7 +267,9 @@ void Ensure_knowledge::log_sensor_knowledge()
temp << "\t\t\tP: " << P_meas_last << "W, Q: "<< Q_meas_last << "var" << std::endl;
temp << "\t\t\tPth: " << Pth_meas_last << "W" << std::endl;
temp << "\t\t\tconnected: " << connected_last << std::endl;
temp << "\t\t\tt connected: " << t_connected_last << std::endl;
temp << "\t\t\tVoltage: " << v_meas_last << "V" << std::endl;
temp << "\t\t\tVoltage2: " << v2_meas_last << "V" << std::endl;
temp << "\t\tLast received set points at " << t_last_recv << ": " << std::endl;
temp << "\t\t\tP: " << P_ctrl_last << "W, Q: "<< Q_ctrl_last << "var" << std::endl;
......
......@@ -98,8 +98,10 @@ void Ensure_prosumer_behavior::send_measurement_message()
case TYPE_EV_INT: {
*(new_msg.SOC) = prosumer_data->SOC_el;
*(new_msg.connected) = prosumer_data->connected;
*(new_msg.t_connected) = prosumer_data->t_connected;
knowledge.set_SOC_meas(prosumer_data->SOC_el);
knowledge.set_conn(prosumer_data->connected);
knowledge.set_t_conn(prosumer_data->t_connected);
break;
}
case TYPE_HP_INT: {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment