Commit 89e5e82d authored by Johnny Jazeix's avatar Johnny Jazeix
Browse files

Les boutons dans la barre d'export ne servent plus que pour la

décoration.

Correction de trucs pour que ce soit pedantic (^^ sauf que qt il aime 
pas donc j'ai fais ce quej'ai pu sur ce que j'ai vu).

Ajout correction des CR_livrables pour la compilation.
parent f632b55c
......@@ -261,13 +261,13 @@ int Interface_console::get_state(int argc, char** argv){
for(int i = 1 ; i < argc ; i ++){
for(int i = 1 ; i < argc ; i ++) {
if((string)argv[i] == "-h"){
if((string)argv[i] == "-h") {
// display the help message
return _STATE_DISPLAY_HELP;
}
else if((string)argv[i] == "-f" || (string)argv[i] == "-a"){
else if((string)argv[i] == "-f" || (string)argv[i] == "-a") {
// We want to open the file which follow this argument
i ++;
if(i < argc) {
......@@ -410,7 +410,7 @@ void Interface_console::extract_times(const char *name) {
if(name[0] == '['){
has_time_start = true;
}
if(name[strlen(name)-1] == ']'){
if(name[strlen(name)-1] == ']') {
has_time_end = true;
}
......@@ -433,7 +433,7 @@ void Interface_console::extract_times(const char *name) {
}
}
void Interface_console::launch_action(int state, void* arg){
void Interface_console::launch_action(int state, void* arg) {
DrawTrace<Render_opengl> buf;
......
......@@ -98,10 +98,19 @@ void Interface_graphic::load_windows(){
// Export window
CKFP(_ui_export_ok_button = qFindChild<QPushButton*>(_ui_time_selection_export, "option_export_ok"), "Cannot find the ok push button in the export dialog .ui file");
CKFP(_ui_min_time_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "min_time"), "Cannot find the ok push button in the export dialog .ui file");
CKFP(_ui_max_time_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "max_time"), "Cannot find the ok push button in the export dialog .ui file");
CKFP(_ui_wide_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "wide"), "Cannot find the ok push button in the export dialog .ui file");
CKFP(_ui_grow_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "grow"), "Cannot find the ok push button in the export dialog .ui file");
CKFP(_ui_min_time_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "min_time"), "Cannot find the ok push button in the export dialog .ui file");
CKFP(_ui_max_time_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "max_time"), "Cannot find the ok push button in the export dialog .ui file");
CKFP(_ui_CheckBox_time_export = qFindChild<QCheckBox*>(_ui_time_selection_export, "export_all"), "Cannot find the Line text \"export_all\" in the export dialog .ui file");
CKFP(_ui_wide_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "wide"), "Cannot find the Line text \"wide\" in the export dialog .ui file");
CKFP(_ui_grow_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "grow"), "Cannot find the Line text \"grow\" in the export dialog .ui file");
CKFP(_ui_accuracy_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "accuracy"), "Cannot find the Line text \"accuracy\" in the export dialog .ui file");
CKFP(_ui_CheckBox_wide_export = qFindChild<QCheckBox*>(_ui_time_selection_export, "checkBox_wide"), "Cannot find the Line text \"wide\" in the export dialog .ui file");
CKFP(_ui_CheckBox_grow_export = qFindChild<QCheckBox*>(_ui_time_selection_export, "checkBox_grow"), "Cannot find the Line text \"grow\" in the export dialog .ui file");
CKFP(_ui_CheckBox_accuracy_export = qFindChild<QCheckBox*>(_ui_time_selection_export, "checkBox_accuracy"), "Cannot find the Line text \"accuracy\" in the export dialog .ui file");
CKFP(_ui_more_options_export = qFindChild<QCommandLinkButton*>(_ui_time_selection_export, "more_options"), "Cannot find the button \"more_options\" in the export dialog .ui file");
......@@ -361,9 +370,9 @@ void Interface_graphic::on_export_file_triggered(){
return;
char temp[10];
sprintf(temp, "%9lf", Info::Render::_x_min_visible);
sprintf(temp, "%9f", Info::Render::_x_min_visible);
_ui_min_time_export->setText(temp);
sprintf(temp, "%9lf", Info::Render::_x_max_visible);
sprintf(temp, "%9f", Info::Render::_x_max_visible);
_ui_max_time_export->setText(temp);
_ui_time_selection_export->show();
}
......@@ -387,22 +396,51 @@ void Interface_graphic::option_export_ok_pressed(){
_core->set_path_to_export(filename.toStdString());
// _core->draw_trace(_trace_path, Interface_console::_DRAW_SVG);
_core->set_min_value_for_export(convert_to_double(_ui_min_time_export->text().toStdString()));
_core->set_max_value_for_export(convert_to_double(_ui_max_time_export->text().toStdString()));
if(_ui_CheckBox_time_export->isChecked()){
_core->set_min_value_for_export(convert_to_double(_ui_min_time_export->text().toStdString()));
_core->set_max_value_for_export(convert_to_double(_ui_max_time_export->text().toStdString()));
}
else{
_core->set_min_value_for_export(0);
_core->set_max_value_for_export(1000);//TO DO TODO max_size de la trace?
}
// We configure the svg exporter
double accuracy = convert_to_double(_ui_accuracy_export->text().toStdString());
double height = convert_to_double(_ui_grow_export->text().toStdString());
if(height != -1.)
Svg::set_height_factor(height);
double wide = convert_to_double(_ui_wide_export->text().toStdString());
if(wide != -1.)
Svg::set_wide_factor(wide);
if(_ui_more_options_export->isChecked()) {
if(accuracy >= 0. && _ui_CheckBox_accuracy_export->isChecked())
Svg::set_accuracy(accuracy);
else { // Default value
Svg::set_accuracy(0.);
}
if(height >= 0. && _ui_CheckBox_grow_export->isChecked())
Svg::set_height_factor(height);
else { // Default value
Svg::set_height_factor(20.);
}
if(wide >= 0. && _ui_CheckBox_wide_export->isChecked())
Svg::set_wide_factor(wide);
else { // Default value
Svg::set_wide_factor(100.);
}
}
else{ // Default values
Svg::set_accuracy(0.);
Svg::set_height_factor(20.);
Svg::set_wide_factor(100.);
}
_core->launch_action(Interface_console::_STATE_EXPORT_FILE_IN_INTERVAL);
}
else
else {
error("No file specified for exportation");
}
}
......
......@@ -84,26 +84,57 @@ class Interface_graphic : public QMainWindow, protected Ui::main_window, public
*/
QScrollBar* _ui_y_scroll;
/*!
/*!
* \brief Define for export
*/
QLineEdit *_ui_min_time_export;
/*!
/*!
* \brief Define for export
*/
QLineEdit *_ui_max_time_export;
/*!
/*!
* \brief Define for export
*/
QLineEdit *_ui_wide_export;
/*!
/*!
* \brief Define for export
*/
QLineEdit *_ui_grow_export;
/*!
* \brief Define for export
*/
QLineEdit *_ui_accuracy_export;
/*!
* \brief Define for export
*/
QCheckBox *_ui_CheckBox_time_export;
/*!
* \brief Define for export
*/
QCheckBox *_ui_CheckBox_wide_export;
/*!
* \brief Define for export
*/
QCheckBox *_ui_CheckBox_grow_export;
/*!
* \brief Define for export
*/
QCheckBox *_ui_CheckBox_accuracy_export;
/*!
* \brief Define for export
*/
QCommandLinkButton *_ui_more_options_export;
/*!
* \brief Contains the Interface_console parent instance.
*/
......
......@@ -6,7 +6,7 @@
<x>0</x>
<y>0</y>
<width>283</width>
<height>349</height>
<height>426</height>
</rect>
</property>
<property name="windowTitle" >
......@@ -126,7 +126,7 @@
</layout>
</item>
<item>
<widget class="QCommandLinkButton" name="more_option" >
<widget class="QCommandLinkButton" name="more_options" >
<property name="enabled" >
<bool>true</bool>
</property>
......@@ -198,7 +198,36 @@
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBox" >
<widget class="QCheckBox" name="checkBox_accuracy" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>accuracy</string>
</property>
<property name="checked" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="accuracy" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>0.1</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_wide" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
<horstretch>0</horstretch>
......@@ -214,24 +243,20 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" >
<item>
<widget class="QLineEdit" name="wide" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>200.0</string>
</property>
<property name="frame" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
<widget class="QLineEdit" name="wide" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>200.0</string>
</property>
<property name="frame" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
......@@ -244,14 +269,14 @@
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>0</height>
<width>448</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBox_2" >
<widget class="QCheckBox" name="checkBox_grow" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
<horstretch>0</horstretch>
......@@ -267,21 +292,17 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3" >
<item>
<widget class="QLineEdit" name="grow" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>15.0</string>
</property>
</widget>
</item>
</layout>
<widget class="QLineEdit" name="grow" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>15.0</string>
</property>
</widget>
</item>
</layout>
</item>
......@@ -373,7 +394,7 @@
</hints>
</connection>
<connection>
<sender>more_option</sender>
<sender>more_options</sender>
<signal>clicked(bool)</signal>
<receiver>options_developped</receiver>
<slot>setVisible(bool)</slot>
......@@ -388,38 +409,6 @@
</hint>
</hints>
</connection>
<connection>
<sender>checkBox</sender>
<signal>clicked(bool)</signal>
<receiver>wide</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>66</x>
<y>160</y>
</hint>
<hint type="destinationlabel" >
<x>73</x>
<y>195</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkBox_2</sender>
<signal>clicked(bool)</signal>
<receiver>grow</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>58</x>
<y>234</y>
</hint>
<hint type="destinationlabel" >
<x>57</x>
<y>269</y>
</hint>
</hints>
</connection>
<connection>
<sender>export_all</sender>
<signal>clicked(bool)</signal>
......@@ -484,5 +473,53 @@
</hint>
</hints>
</connection>
<connection>
<sender>checkBox_grow</sender>
<signal>clicked(bool)</signal>
<receiver>grow</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>58</x>
<y>234</y>
</hint>
<hint type="destinationlabel" >
<x>57</x>
<y>269</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkBox_wide</sender>
<signal>clicked(bool)</signal>
<receiver>wide</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>66</x>
<y>160</y>
</hint>
<hint type="destinationlabel" >
<x>73</x>
<y>195</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkBox_accuracy</sender>
<signal>clicked(bool)</signal>
<receiver>accuracy</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>141</x>
<y>129</y>
</hint>
<hint type="destinationlabel" >
<x>141</x>
<y>159</y>
</hint>
</hints>
</connection>
</connections>
</ui>
......@@ -2,7 +2,7 @@
Entity::Entity(Container *container, map<std::string, Value *> opt): _container(container), _extra_fields(opt) {
};
}
const Container *Entity::get_container() const {
return _container;
......
......@@ -3,5 +3,5 @@
EventType::EventType(Name name, ContainerType *container_type, map<std::string, Value *> opt):
EntityType(name, container_type, opt) {
};
}
......@@ -3,5 +3,5 @@
StateType::StateType(Name name, ContainerType *container_type, map<std::string, Value *> opt):
EntityType(name, container_type, opt) {
};
}
......@@ -9,7 +9,7 @@ Hex::Hex(int n) {
}
bool Hex::instantiate(const std::string &in, Hex &out) {
int n;
unsigned int n;
if(sscanf(in.c_str(), "%X", &n) != 1)
return false;
out = Hex(n);
......
......@@ -21,7 +21,7 @@
*/
class Hex: public Value {
private:
int _value;
unsigned int _value;
public:
/*!
*
......
Supports Markdown
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