21 #include <QMessageBox>
23 #include "RoadEmissionNMPB08.h"
30 #define TR(id) OLocalizator::getString("TYRouteWidget", (id))
36 } RoadSurfaceFormulationMap[] = {{
"BBUM 0/6", BBUM_0_6},
37 {
"BBDr 0/10", BBDR_0_10},
38 {
"BBTM 0/6 - type 2", BBTM_0_6_type2},
39 {
"BBTM 0/6 - type 1", BBTM_0_6_type1},
40 {
"BBTM 0/10 - type 2", BBTM_0_10_type2},
41 {
"BBSG 0/10", BBSG_0_10},
42 {
"BBTM 0/10 - type 1", BBTM_0_10_type1},
43 {
"BBUM 0/10", BBUM_0_10},
45 {
"BBSG 0/14", BBSG_0_14},
46 {
"BBTM 0/14", BBTM_0_14},
49 {
"ES 10/14", ES_10_14}};
55 bool connect_ok =
false;
59 QTabWidget* qTabW = findChild<QTabWidget*>(
"tabWidget");
60 assert(qTabW &&
"Check name consistency with the UI file");
61 qTabW->insertTab(0,
_elmW,
"Source");
62 qTabW->setCurrentIndex(0);
104 void (QComboBox::*_qComboBox_RoadSurfaceType_currentIndexChanged)(int) = &QComboBox::currentIndexChanged;
105 void (QComboBox::*_qComboBox_RoadSurfaceFormulation_activated)(int) = &QComboBox::activated;
107 void (QButtonGroup::*_qButtonGroup_clicked)(int) = &QButtonGroup::idClicked;
111 assert(connect_ok &&
"Qt signal connection failed");
115 assert(connect_ok &&
"Qt signal connection failed");
117 q_AADT_Push = findChild<QPushButton*>(
"bouton_tmja");
121 assert(connect_ok &&
"Qt signal connection failed");
124 QRadioButton* q_check_box =
nullptr;
125 q_check_box = findChild<QRadioButton*>(
"radio_spectres");
128 q_check_box = findChild<QRadioButton*>(
"radio_debits");
131 q_check_box = findChild<QRadioButton*>(
"radio_tmja");
139 assert(connect_ok &&
"Qt signal connection failed");
144 assert(connect_ok &&
"Qt signal connection failed");
149 assert(connect_ok &&
"Qt signal connection failed");
154 assert(connect_ok &&
"Qt signal connection failed");
187 index += RoadSurface_DR1 - 1;
189 assert(index >= 0 && index < RoadSurface_UserDefined);
190 RoadSurfaceType surf_type =
static_cast<RoadSurfaceType
>(index);
203 assert(index >= 0 && index < RoadSurface_UserDefined);
204 if (index >= RoadSurface_DR1)
207 index -= RoadSurface_DR1 - 1;
226 "The traffic flow type for all componenets are expected to be the same for now.");
247 RoadFlowType flow_type =
static_cast<RoadFlowType
>(index);
283 int status = dlg.exec();
284 if (status == QDialog::Accepted)
286 QSpinBox* q_lv_Spin = findChild<QSpinBox*>(
"tmja_debit_vl");
288 QSpinBox* q_hgv_Spin = findChild<QSpinBox*>(
"tmja_debit_pl");
290 QComboBox* q_RoadType_Combo = findChild<QComboBox*>(
"tmja_type_route");
291 assert(q_RoadType_Combo);
292 QComboBox* q_RoadFunction_Combo = findChild<QComboBox*>(
"tmja_fonction_route");
293 assert(q_RoadFunction_Combo);
295 double lv_aadt = q_lv_Spin->value();
296 double hgv_aadt = q_hgv_Spin->value();
303 ok = road.
setFromAADT(hgv_aadt, lv_aadt, road_type, road_function, &msg);
313 msg.replace(
"\n",
"<br/>");
315 QString::fromUtf8(
"<p>Les valeurs du TMJA spécifiées sont hors du domaine "
316 "de validité de la <i>Note 77</i>. Merci de les rectifier :</p>");
317 QMessageBox::information(
this,
"TMJA invalide !", text + msg,
318 QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton,
319 QMessageBox::NoButton);
390 assert(
false &&
"mode should be in 0..2");
409 assert(index >= 0 && index < RoadSurface_UserDefined);
419 int surf_type_no = RoadSurfaceFormulationMap[index - 1].id;
420 RoadSurfaceType surf_type =
static_cast<RoadSurfaceType
>(surf_type_no);
virtual void setCurRegime(int regimeNumber)
size_t getNbRegimes() const
virtual void updateCurrentRegime()
void setTypeDistribution(int typeDistri)
void setSurfaceAge(double age)
Setter for the surface age.
bool setFromAADT(double aadt_hgv, double aadt_lv, RoadType road_type, RoadFunction road_function, QString *out_msg=NULL)
Apply Note77 from Setra to estimate trafic from AADT and road kind.
const RoadTrafficComponent & getNMPB08RoadTrafficComponent(enum TrafficRegimes regime, enum TYTrafic::VehicleTypes vehic_type) const
void setSurfaceType(RoadSurfaceType type)
Setter for the road surface type.
double surfaceAge() const
Getter for the surface age.
RoadSurfaceType surfaceType() const
Getter for the road surface type.
void setRoadTrafficComponent(enum TrafficRegimes regime, enum TYTrafic::VehicleTypes vehic_type, double flow, double speed, RoadFlowType type=FlowType_CONST)
Set the traffic parameter for a given regime and type of vehicles.
virtual TYSpectre * getCurrentSpectre() const