18 #ifndef __PowerBudget__
19 #define __PowerBudget__
22 #include "BaseInput.h"
35 vector<double> input_power, radiated_power, structure_loss, network_loss, efficiency;
38 double get_power_line()
40 string line = readline();
41 if (line.length() < 2)
45 line.erase(0, line.find(
"=",0) + 1);
46 stringstream ss(line);
47 double ret = read_sci(ss);
55 string searchString(
"POWER BUDGET");
56 while (m_stream.good())
58 string line = readline();
60 if (line.find(searchString,0) != string::npos)
65 double p = get_power_line();
66 input_power.push_back(p);
69 double p = get_power_line();
70 radiated_power.push_back(p);
73 double p = get_power_line();
74 structure_loss.push_back(p);
77 double p = get_power_line();
78 network_loss.push_back(p);
81 double p = get_power_line();
82 efficiency.push_back(p);
91 if (difference(pb) > 1e-4)
101 if (n_items != pb.n_items)
106 for (
long i=0; i<n_items; i++)
108 ret += diff(pb.input_power[i],input_power[i]);
109 ret += diff(pb.radiated_power[i],radiated_power[i]);
110 ret += diff(pb.structure_loss[i],structure_loss[i]);
111 ret += diff(pb.network_loss[i],network_loss[i]);
112 ret += diff(pb.efficiency[i],efficiency[i]);
115 catch(
string message)
117 cout <<
"diff : " << message << endl;
Definition: PowerBudget.h:32