Bug Summary

File:OMOptim/OMOptim/build/../GUI/Widgets/WidgetTableRecVar.cpp
Warning:line 53, column 19
Value stored to 'problem' during its initialization is never read

Annotated Source Code

[?] Use j/k keys for keyboard navigation

1// $Id$
2/**
3 * This file is part of OpenModelica.
4 *
5 * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC),
6 * c/o Linköpings universitet, Department of Computer and Information Science,
7 * SE-58183 Linköping, Sweden.
8 *
9 * All rights reserved.
10 *
11 * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR
12 * THIS OSMC PUBLIC LICENSE (OSMC-PL).
13 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
14 * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE.
15 *
16 * The OpenModelica software and the Open Source Modelica
17 * Consortium (OSMC) Public License (OSMC-PL) are obtained
18 * from OSMC, either from the above address,
19 * from the URLs: http://www.ida.liu.se/projects/OpenModelica or
20 * http://www.openmodelica.org, and in the OpenModelica distribution.
21 * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
22 *
23 * This program is distributed WITHOUT ANY WARRANTY; without
24 * even the implied warranty of MERCHANTABILITY or FITNESS
25 * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
26 * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL.
27 *
28 * See the full OSMC Public License conditions for more details.
29 *
30 * Main contributor 2010, Hubert Thierot, CEP - ARMINES (France)
31 * Main contributor 2010, Hubert Thierot, CEP - ARMINES (France)
32
33 @file WidgetTableRecVar.cpp
34 @brief Comments for file documentation.
35 @author Hubert Thieriot, hubert.thieriot@mines-paristech.fr
36 Company : CEP - ARMINES (France)
37 http://www-cep.ensmp.fr/english/
38 @version
39*/
40
41#include "Widgets/WidgetTableRecVar.h"
42#include "ui_WidgetTableRecVar.h"
43#include "Optimization.h"
44
45
46WidgetTableRecVar::WidgetTableRecVar(OptimResult* result,QWidget *parent) :
47 QDialog(parent),
48 _ui(new Ui::WidgetTableRecVarClass)
49{
50 _ui->setupUi(this);
51
52 _result = result;
53 Optimization* problem = dynamic_cast<Optimization*>(_result->problem());
Value stored to 'problem' during its initialization is never read
54
55 // recomputed table
56 _tableVariables = new MOTableView(this);
57 _ui->layoutTableVar->addWidget(_tableVariables);
58 GuiTools::ModelToViewWithFilter(_result->recomputedVariables(),_tableVariables,_ui->lineVariableFilter);
59 GuiTools::minimizeTableSize(_tableVariables);
60
61
62 //slide
63 connect(_ui->spinScan,SIGNAL(valueChanged(int))"2""valueChanged(int)",_ui->sliderScan,SLOT(setValue(int))"1""setValue(int)");
64 connect(_ui->sliderScan,SIGNAL(valueChanged(int))"2""valueChanged(int)",_ui->spinScan,SLOT(setValue(int))"1""setValue(int)");
65 connect(_ui->spinScan,SIGNAL(valueChanged(int))"2""valueChanged(int)",this,SLOT(onCurScanChanged(int))"1""onCurScanChanged(int)");
66
67 updateFromNbScan();
68
69 bool show = _result->recomputedVariables()->getUseScan();
70 _ui->groupBox->setVisible(show);
71}
72
73
74WidgetTableRecVar::~WidgetTableRecVar()
75{
76 delete _tableVariables;
77 delete _ui;
78}
79
80
81
82void WidgetTableRecVar::onExtSelectionChanged(QList<int>& list)
83{
84 if(list.size()==1)
85 {
86 _result->setCurPoint(list.at(0));
87 }
88 else
89 {
90 _result->setCurPoint(-1);
91 }
92
93 _tableVariables->viewport()->update();
94}
95
96void WidgetTableRecVar::onCurScanChanged(int _curScan )
97{
98 int newScan = _curScan;
99 _result->setCurScan(newScan);
100
101 _tableVariables->viewport()->update();
102}
103
104void WidgetTableRecVar::onPointsRecomputed()
105{
106 _tableVariables->viewport()->update();
107 updateFromNbScan();
108}
109
110void WidgetTableRecVar::updateFromNbScan()
111{
112 _ui->sliderScan->setMinimum(0);
113 _ui->sliderScan->setMaximum(_result->recomputedVariables()->nbScans()-1);
114 _ui->spinScan->setMinimum(0);
115 _ui->spinScan->setMaximum(_result->recomputedVariables()->nbScans()-1);
116}