Commit 6421ce9d authored by Augustin Degomme's avatar Augustin Degomme

add possibility to enter values greater than max_trace in interval selection,...

add possibility to enter values greater than max_trace in interval selection, and removes a bug with variables and split files for containers' size computation
parent b8bdfff3
......@@ -71,6 +71,8 @@
#include "interface/Interval_select.hpp"
#include "limits.h"
using namespace std;
Interval_select::Interval_select(Interface_graphic * console,QWidget *parent) : QDialog(parent), _trace(NULL),_console(console) {
......@@ -99,9 +101,9 @@ void Interval_select::set_trace(Trace *trace) {
min_value->setText(QString().setNum (Info::Entity::x_min));
max_value->setText(QString().setNum (Info::Entity::x_max));
minSpinBox->setMinimum(Info::Entity::x_min);
minSpinBox->setMaximum(Info::Entity::x_max);
minSpinBox->setMaximum(std::numeric_limits<double>::max());
maxSpinBox->setMinimum(Info::Entity::x_min);
maxSpinBox->setMaximum(Info::Entity::x_max);
maxSpinBox->setMaximum(std::numeric_limits<double>::max());
//the slider stays in int, we will translate its values
/*interval_slider->setMinimum(0);
interval_slider->setMaximum(99);*/
......@@ -139,9 +141,9 @@ if(Info::Splitter::preview==true){
bool v = minSpinBox->blockSignals(true);
bool v2 = maxSpinBox->blockSignals(true);
bool v3 = interval_slider->blockSignals(true);
int maxvalue=int(_max*(interval_slider->maximum() - interval_slider->minimum())/(minSpinBox->maximum() - minSpinBox->minimum()));
int maxvalue=int(_max*(interval_slider->maximum() - interval_slider->minimum())/(_trace->get_max_date() - minSpinBox->minimum()));
interval_slider->setUpperValue(maxvalue);
interval_slider->setLowerValue(int(_min*(interval_slider->maximum() - interval_slider->minimum())/(minSpinBox->maximum() - minSpinBox->minimum())));
interval_slider->setLowerValue(int(_min*(interval_slider->maximum() - interval_slider->minimum())/(_trace->get_max_date() - minSpinBox->minimum())));
maxSpinBox->setValue(_max);
minSpinBox->setValue(_min);
minSpinBox->blockSignals(v);
......@@ -159,7 +161,7 @@ void Interval_select::minSpinBoxValueChanged( double _value )
if(_value < maxSpinBox->value()){
bool v = interval_slider->blockSignals(true);
interval_slider->setLowerValue( int(_value *(interval_slider->maximum() - interval_slider->minimum())/(minSpinBox->maximum() - minSpinBox->minimum())) );
interval_slider->setLowerValue( int(_value *(interval_slider->maximum() - interval_slider->minimum())/(_trace->get_max_date() - minSpinBox->minimum())) );
interval_slider->blockSignals(v);
emit( minValueChanged( minSpinBox->value() ) );
......@@ -186,7 +188,7 @@ void Interval_select::minSliderValueChanged( int _value )
{
if(_value < interval_slider->upperValue()){
bool v = minSpinBox->blockSignals(true);
minSpinBox->setValue( _value *(minSpinBox->maximum() - minSpinBox->minimum())/(interval_slider->maximum() - interval_slider->minimum()));
minSpinBox->setValue( _value *(_trace->get_max_date() - minSpinBox->minimum())/(interval_slider->maximum() - interval_slider->minimum()));
minSpinBox->blockSignals(v);
emit( minValueChanged( minSpinBox->value() ) );
if(_auto_refresh)apply_settings();
......@@ -199,7 +201,7 @@ void Interval_select::maxSpinBoxValueChanged( double _value )
QPalette myPalette(minSpinBox->palette());
if(_value > minSpinBox->value()){
bool v = interval_slider->blockSignals(true);
interval_slider->setUpperValue( int(_value* (interval_slider->maximum() - interval_slider->minimum())/(maxSpinBox->maximum() - maxSpinBox->minimum())));
interval_slider->setUpperValue( int(_value* (interval_slider->maximum() - interval_slider->minimum())/(_trace->get_max_date() - maxSpinBox->minimum())));
interval_slider->blockSignals(v);
emit( maxValueChanged( maxSpinBox->value() ) );
myPalette.setColor(QPalette::Active, QPalette::Text, Qt::black);
......@@ -222,7 +224,7 @@ void Interval_select::maxSliderValueChanged( int _value )
if(_value > interval_slider->lowerValue()){
bool v = maxSpinBox->blockSignals(true);
maxSpinBox->setValue( _value * (maxSpinBox->maximum() - maxSpinBox->minimum())/(interval_slider->maximum() - interval_slider->minimum()));
maxSpinBox->setValue( _value * (_trace->get_max_date() - maxSpinBox->minimum())/(interval_slider->maximum() - interval_slider->minimum()));
maxSpinBox->blockSignals(v);
emit( maxValueChanged( maxSpinBox->value() ) );
if(_auto_refresh)apply_settings();
......@@ -275,8 +277,8 @@ void Interval_select::on_reset_button_clicked(){
//minValueChanged( interval_slider->minimum() );
interval_slider->setUpperValue(interval_slider->maximum());
interval_slider->setLowerValue(interval_slider->minimum());
//maxSliderValueChanged( interval_slider->maximum() );
//minSliderValueChanged( interval_slider->minimum() );
maxSliderValueChanged( interval_slider->maximum() );
minSliderValueChanged( interval_slider->minimum() );
}
......
......@@ -41,9 +41,9 @@
<widget class="QDoubleSpinBox" name="minSpinBox">
<property name="geometry">
<rect>
<x>140</x>
<x>80</x>
<y>80</y>
<width>101</width>
<width>151</width>
<height>22</height>
</rect>
</property>
......@@ -51,9 +51,9 @@
<widget class="QDoubleSpinBox" name="maxSpinBox">
<property name="geometry">
<rect>
<x>350</x>
<x>300</x>
<y>80</y>
<width>101</width>
<width>151</width>
<height>22</height>
</rect>
</property>
......@@ -87,35 +87,41 @@
<widget class="QLabel" name="min_value">
<property name="geometry">
<rect>
<x>10</x>
<x>0</x>
<y>160</y>
<width>46</width>
<height>13</height>
<width>131</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="max_value">
<property name="geometry">
<rect>
<x>460</x>
<x>390</x>
<y>160</y>
<width>46</width>
<height>13</height>
<width>121</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_5">
<property name="geometry">
<rect>
<x>60</x>
<y>80</y>
<width>81</width>
<x>100</x>
<y>60</y>
<width>121</width>
<height>16</height>
</rect>
</property>
......@@ -126,9 +132,9 @@
<widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
<x>270</x>
<y>80</y>
<width>81</width>
<x>320</x>
<y>60</y>
<width>111</width>
<height>16</height>
</rect>
</property>
......@@ -194,9 +200,9 @@
</property>
<property name="geometry">
<rect>
<x>350</x>
<y>180</y>
<width>171</width>
<x>250</x>
<y>190</y>
<width>241</width>
<height>17</height>
</rect>
</property>
......
......@@ -725,6 +725,7 @@ void Container::finish(const Date &time) {
if(_event_tree)delete _event_tree;
if(_state_tree!=NULL)delete _state_tree;
_n_variables=0;
_event_tree=NULL;
_state_tree=NULL;
......@@ -740,6 +741,7 @@ _state_tree=NULL;
delete _events;
_n_states=0;
_n_events=0;
_n_variables=0;
_events=NULL;
}
......
......@@ -88,7 +88,6 @@ using namespace boost::serialization;
template<class Archive>
void load(Archive &ar, ContainerType& l, const unsigned int )
{
printf("Type 1\n");
Name _name;
ContainerType *_parent;
......
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