21 #include <QMessageBox>
23 #include "RoadEmissionNMPB08.h"
29 #define TR(id) OLocalizator::getString("TYRouteWidget", (id))
35 } RoadSurfaceFormulationMap[] = {{
"BBUM 0/6", BBUM_0_6},
36 {
"BBDr 0/10", BBDR_0_10},
37 {
"BBTM 0/6 - type 2", BBTM_0_6_type2},
38 {
"BBTM 0/6 - type 1", BBTM_0_6_type1},
39 {
"BBTM 0/10 - type 2", BBTM_0_10_type2},
40 {
"BBSG 0/10", BBSG_0_10},
41 {
"BBTM 0/10 - type 1", BBTM_0_10_type1},
42 {
"BBUM 0/10", BBUM_0_10},
44 {
"BBSG 0/14", BBSG_0_14},
45 {
"BBTM 0/14", BBTM_0_14},
48 {
"ES 10/14", ES_10_14}};
54 bool connect_ok =
false;
58 QTabWidget* qTabW = findChild<QTabWidget*>(
"tabWidget");
59 assert(qTabW &&
"Check name consistency with the UI file");
60 qTabW->insertTab(0,
_elmW,
"Source");
61 qTabW->setCurrentIndex(0);
103 void (QComboBox::*_qComboBox_RoadSurfaceType_currentIndexChanged)(int) = &QComboBox::currentIndexChanged;
104 void (QComboBox::*_qComboBox_RoadSurfaceFormulation_activated)(int) = &QComboBox::activated;
106 void (QButtonGroup::*_qButtonGroup_clicked)(int) = &QButtonGroup::idClicked;
110 assert(connect_ok &&
"Qt signal connection failed");
114 assert(connect_ok &&
"Qt signal connection failed");
116 q_AADT_Push = findChild<QPushButton*>(
"bouton_tmja");
120 assert(connect_ok &&
"Qt signal connection failed");
123 QRadioButton* q_check_box =
nullptr;
124 q_check_box = findChild<QRadioButton*>(
"radio_spectres");
127 q_check_box = findChild<QRadioButton*>(
"radio_debits");
130 q_check_box = findChild<QRadioButton*>(
"radio_tmja");
138 assert(connect_ok &&
"Qt signal connection failed");
143 assert(connect_ok &&
"Qt signal connection failed");
148 assert(connect_ok &&
"Qt signal connection failed");
153 assert(connect_ok &&
"Qt signal connection failed");
186 index += RoadSurface_DR1 - 1;
188 assert(index >= 0 && index < RoadSurface_UserDefined);
189 RoadSurfaceType surf_type =
static_cast<RoadSurfaceType
>(index);
202 assert(index >= 0 && index < RoadSurface_UserDefined);
203 if (index >= RoadSurface_DR1)
206 index -= RoadSurface_DR1 - 1;
225 "The traffic flow type for all componenets are expected to be the same for now.");
246 RoadFlowType flow_type =
static_cast<RoadFlowType
>(index);
282 int status = dlg.exec();
283 if (status == QDialog::Accepted)
285 QSpinBox* q_lv_Spin = findChild<QSpinBox*>(
"tmja_debit_vl");
287 QSpinBox* q_hgv_Spin = findChild<QSpinBox*>(
"tmja_debit_pl");
289 QComboBox* q_RoadType_Combo = findChild<QComboBox*>(
"tmja_type_route");
290 assert(q_RoadType_Combo);
291 QComboBox* q_RoadFunction_Combo = findChild<QComboBox*>(
"tmja_fonction_route");
292 assert(q_RoadFunction_Combo);
294 double lv_aadt = q_lv_Spin->value();
295 double hgv_aadt = q_hgv_Spin->value();
302 ok = road.
setFromAADT(hgv_aadt, lv_aadt, road_type, road_function, &msg);
312 msg.replace(
"\n",
"<br/>");
314 QString::fromUtf8(
"<p>Les valeurs du TMJA spécifiées sont hors du domaine "
315 "de validité de la <i>Note 77</i>. Merci de les rectifier :</p>");
316 QMessageBox::information(
this,
"TMJA invalide !", text + msg,
317 QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton,
318 QMessageBox::NoButton);
389 assert(
false &&
"mode should be in 0..2");
408 assert(index >= 0 && index < RoadSurface_UserDefined);
418 int surf_type_no = RoadSurfaceFormulationMap[index - 1].id;
419 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