Debian Codegraph @

HercUtilities/HetMap.cpp

raw symbols SCIP
1 /*
2 * File: HetMap.cpp
3 *
4 * Author: Jacob Dekel
5 * Created on: Sep 6, 2010
6 *
7 * Copyright (c) 2009-2013 Jacob Dekel
8 * $Id$
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 *
23 */
24
25 #include "HetMap.h"cxx . . $ `<file>/HercUtilities/HetMap.h`/
26 #include "HerculesStudio.h"cxx . . $ `<file>/HercStudio/HerculesStudio.h`/
27 #include "UtilityRunner.h"cxx . . $ `<file>/HercUtilities/UtilityRunner.h`/
28 #include "Preferences.h"cxx . . $ `<file>/HercStudio/Preferences.h`/
29
30 #include <QFileDialog>
31 #include <QMessageBox>
32
33 #include <csignal>
34
35 HetMapcxx . . $ HetMap#::HetMapcxx . . $ HetMap#HetMap(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget# *parent)
36 : GenericUtilitycxx . . $ GenericUtility#("hetmap"cxx . . $ QString#QString(e1217c004a86c950).,parent)
37 {
38 uicxx . . $ HetMap#ui..setupUicxx . . $ Ui_HetMapClass#setupUi(d194de0c0f68c28b).(this);
39 mInternalChangecxx . . $ HetMap#mInternalChange. = false;
40
41 connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ HetMap#ui..runButtoncxx . . $ Ui_HetMapClass#runButton., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(runClicked()));
42 connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ HetMap#ui..cancelButtoncxx . . $ Ui_HetMapClass#cancelButton., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(exitClicked()));
43 connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ HetMap#ui..allCheckBoxcxx . . $ Ui_HetMapClass#allCheckBox., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(stateChanged(int)), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(allClicked()));
44 connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ HetMap#ui..fileInfoCheckBoxcxx . . $ Ui_HetMapClass#fileInfoCheckBox., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(stateChanged(int)), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(fileInfoClicked()));
45 connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ HetMap#ui..labelInfoCheckBoxcxx . . $ Ui_HetMapClass#labelInfoCheckBox., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(stateChanged(int)), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(labelInfoClicked()));
46 connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ HetMap#ui..dataInfoCheckBoxcxx . . $ Ui_HetMapClass#dataInfoCheckBox., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(stateChanged(int)), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(dataInfoClicked()));
47 connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ HetMap#ui..tapemapCheckBoxcxx . . $ Ui_HetMapClass#tapemapCheckBox., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(stateChanged(int)), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(tapemapClicked()));
48 connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ HetMap#ui..selFilecxx . . $ Ui_HetMapClass#selFile., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(browseFileClicked()));
49 }
50
51 HetMapcxx . . $ HetMap#::~cxx . . $ HetMap#`~HetMap`(49f6e7a06ebc5aa8).HetMapcxx . . $ HetMap#()
52 {
53
54 }
55
56 void HetMapcxx . . $ HetMap#::runClickedcxx . . $ HetMap#runClicked(49f6e7a06ebc5aa8).()
57 {
58 if (!runOrStopClickedcxx . . $ GenericUtility#runOrStopClicked(c9857a73d68e59ba).())
59 {
60 uicxx . . $ HetMap#ui..runButtoncxx . . $ Ui_HetMapClass#runButton.->setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).("Run"cxx . . $ QString#QString(85c52e162fed56f9).);
61 return;
62 }
63
64 if (uicxx . . $ HetMap#ui..filenamecxx . . $ Ui_HetMapClass#filename.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).().isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).())
65 {
66 QMessageBoxcxx . . $ QMessageBox#::warningcxx . . $ QMessageBox#warning(21b6fd1dd558cc82).(this, "hetmap"cxx . . $ QString#QString(85c52e162fed56f9)., "Please specify tape file to map"cxx . . $ QString#QString(85c52e162fed56f9).,
67 QMessageBoxcxx . . $ QMessageBox#::Okcxx . . $ QMessageBox#Ok., QMessageBoxcxx . . $ QMessageBox#::NoButtoncxx . . $ QMessageBox#NoButton.);
68 return;
69 }
70 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> parameterscxx . . $ std/vector#vector(49f6e7a06ebc5aa8).;
71
72 if (uicxx . . $ HetMap#ui..dataInfoCheckBoxcxx . . $ Ui_HetMapClass#dataInfoCheckBox.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).())
73 parameters.push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).("-d"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).);
74 if (uicxx . . $ HetMap#ui..allCheckBoxcxx . . $ Ui_HetMapClass#allCheckBox.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).())
75 parameters.push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).("-a"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).);
76 if (uicxx . . $ HetMap#ui..fileInfoCheckBoxcxx . . $ Ui_HetMapClass#fileInfoCheckBox.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).())
77 parameters.push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).("-f"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).);
78 if (uicxx . . $ HetMap#ui..labelInfoCheckBoxcxx . . $ Ui_HetMapClass#labelInfoCheckBox.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).())
79 parameters.push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).("-l"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).);
80 if (uicxx . . $ HetMap#ui..tapemapCheckBoxcxx . . $ Ui_HetMapClass#tapemapCheckBox.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).())
81 parameters.push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).("-t"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).);
82 parameters.push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(uicxx . . $ HetMap#ui..filenamecxx . . $ Ui_HetMapClass#filename.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).().toStdStringcxx . . $ QString#toStdString(219584694fe2b248).());
83
84 stdcxx . . $ std/::stringcxx . . $ std/string# commandcxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f). = "hetmap"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).;
85
86 executecxx . . $ GenericUtility#execute(e5618828c763ae1e).(command, Preferencescxx . . $ Preferences#::getInstancecxx . . $ Preferences#getInstance(2e7be89de0a5bc0).().hercDircxx . . $ Preferences#hercDir(219584694fe2b248).(), parameters);
87 uicxx . . $ HetMap#ui..runButtoncxx . . $ Ui_HetMapClass#runButton.->setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).("Stop"cxx . . $ QString#QString(85c52e162fed56f9).);
88 }
89
90
91 void HetMapcxx . . $ HetMap#::exitClickedcxx . . $ HetMap#exitClicked(49f6e7a06ebc5aa8).()
92 {
93 deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).();
94 }
95
96 void HetMapcxx . . $ HetMap#::browseFileClickedcxx . . $ HetMap#browseFileClicked(49f6e7a06ebc5aa8).()
97 {
98 QStringcxx . . $ QString# s = QFileDialogcxx . . $ QString#QString(e1217c004a86c950).::getOpenFileNamecxx . . $ QFileDialog#getOpenFileName(a6b29be4bec65236).(this,"Browse for Input File"cxx . . $ QString#QString(85c52e162fed56f9).,uicxx . . $ HetMap#ui..filenamecxx . . $ Ui_HetMapClass#filename.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).());
99 if (s.sizecxx . . $ QString#size(455f465bc33b4cdf).() > 0)
100 uicxx . . $ HetMap#ui..filenamecxx . . $ Ui_HetMapClass#filename.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(s);
101 }
102
103 void HetMapcxx . . $ HetMap#::allClickedcxx . . $ HetMap#allClicked(49f6e7a06ebc5aa8).()
104 {
105 if (mInternalChangecxx . . $ HetMap#mInternalChange.) return;
106 mInternalChangecxx . . $ HetMap#mInternalChange. = true; // do not trigger signal when changing the bellow checkboxes
107
108 uicxx . . $ HetMap#ui..fileInfoCheckBoxcxx . . $ Ui_HetMapClass#fileInfoCheckBox.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(false);
109 uicxx . . $ HetMap#ui..labelInfoCheckBoxcxx . . $ Ui_HetMapClass#labelInfoCheckBox.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(false);
110 uicxx . . $ HetMap#ui..allCheckBoxcxx . . $ Ui_HetMapClass#allCheckBox.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(true);
111
112 mInternalChangecxx . . $ HetMap#mInternalChange. = false; // resume propagating signals
113 }
114
115 void HetMapcxx . . $ HetMap#::fileInfoClickedcxx . . $ HetMap#fileInfoClicked(49f6e7a06ebc5aa8).()
116 {
117 if (mInternalChangecxx . . $ HetMap#mInternalChange.) return;
118 mInternalChangecxx . . $ HetMap#mInternalChange. = true; // do not trigger signal when changing the bellow checkboxes
119
120 uicxx . . $ HetMap#ui..allCheckBoxcxx . . $ Ui_HetMapClass#allCheckBox.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(false);
121 uicxx . . $ HetMap#ui..fileInfoCheckBoxcxx . . $ Ui_HetMapClass#fileInfoCheckBox.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(true);
122
123 mInternalChangecxx . . $ HetMap#mInternalChange. = false; // resume propagating signals
124 }
125
126 void HetMapcxx . . $ HetMap#::labelInfoClickedcxx . . $ HetMap#labelInfoClicked(49f6e7a06ebc5aa8).()
127 {
128 if (mInternalChangecxx . . $ HetMap#mInternalChange.) return;
129 mInternalChangecxx . . $ HetMap#mInternalChange. = true; // do not trigger signal when changing the bellow checkboxes
130
131 uicxx . . $ HetMap#ui..allCheckBoxcxx . . $ Ui_HetMapClass#allCheckBox.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(false);
132 uicxx . . $ HetMap#ui..labelInfoCheckBoxcxx . . $ Ui_HetMapClass#labelInfoCheckBox.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(true);
133
134 mInternalChangecxx . . $ HetMap#mInternalChange. = false; // resume propagating signals
135 }
136
137 void HetMapcxx . . $ HetMap#::dataInfoClickedcxx . . $ HetMap#dataInfoClicked(49f6e7a06ebc5aa8).()
138 {
139 if (mInternalChangecxx . . $ HetMap#mInternalChange.) return;
140 mInternalChangecxx . . $ HetMap#mInternalChange. = true; // do not trigger signal when changing the bellow checkboxes
141
142 if (uicxx . . $ HetMap#ui..dataInfoCheckBoxcxx . . $ Ui_HetMapClass#dataInfoCheckBox.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).())
143 {
144 uicxx . . $ HetMap#ui..allCheckBoxcxx . . $ Ui_HetMapClass#allCheckBox.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(false);
145 uicxx . . $ HetMap#ui..fileInfoCheckBoxcxx . . $ Ui_HetMapClass#fileInfoCheckBox.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(false);
146 uicxx . . $ HetMap#ui..labelInfoCheckBoxcxx . . $ Ui_HetMapClass#labelInfoCheckBox.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(false);
147 uicxx . . $ HetMap#ui..tapemapCheckBoxcxx . . $ Ui_HetMapClass#tapemapCheckBox.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(false);
148 uicxx . . $ HetMap#ui..allCheckBoxcxx . . $ Ui_HetMapClass#allCheckBox.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false);
149 uicxx . . $ HetMap#ui..fileInfoCheckBoxcxx . . $ Ui_HetMapClass#fileInfoCheckBox.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false);
150 uicxx . . $ HetMap#ui..labelInfoCheckBoxcxx . . $ Ui_HetMapClass#labelInfoCheckBox.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false);
151 uicxx . . $ HetMap#ui..tapemapCheckBoxcxx . . $ Ui_HetMapClass#tapemapCheckBox.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false);
152 }
153 else
154 {
155 uicxx . . $ HetMap#ui..allCheckBoxcxx . . $ Ui_HetMapClass#allCheckBox.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true);
156 uicxx . . $ HetMap#ui..fileInfoCheckBoxcxx . . $ Ui_HetMapClass#fileInfoCheckBox.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true);
157 uicxx . . $ HetMap#ui..labelInfoCheckBoxcxx . . $ Ui_HetMapClass#labelInfoCheckBox.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true);
158 uicxx . . $ HetMap#ui..tapemapCheckBoxcxx . . $ Ui_HetMapClass#tapemapCheckBox.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true);
159 uicxx . . $ HetMap#ui..allCheckBoxcxx . . $ Ui_HetMapClass#allCheckBox.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(true);
160 }
161 mInternalChangecxx . . $ HetMap#mInternalChange. = false; // resume propagating signals
162 }
163
164 void HetMapcxx . . $ HetMap#::tapemapClickedcxx . . $ HetMap#tapemapClicked(49f6e7a06ebc5aa8).()
165 {
166 if (mInternalChangecxx . . $ HetMap#mInternalChange.) return;
167 mInternalChangecxx . . $ HetMap#mInternalChange. = true; // do not trigger signal when changing the bellow checkboxes
168
169 if (uicxx . . $ HetMap#ui..tapemapCheckBoxcxx . . $ Ui_HetMapClass#tapemapCheckBox.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).())
170 {
171 uicxx . . $ HetMap#ui..allCheckBoxcxx . . $ Ui_HetMapClass#allCheckBox.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(false);
172 uicxx . . $ HetMap#ui..fileInfoCheckBoxcxx . . $ Ui_HetMapClass#fileInfoCheckBox.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(false);
173 uicxx . . $ HetMap#ui..labelInfoCheckBoxcxx . . $ Ui_HetMapClass#labelInfoCheckBox.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(false);
174 uicxx . . $ HetMap#ui..dataInfoCheckBoxcxx . . $ Ui_HetMapClass#dataInfoCheckBox.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(false);
175 uicxx . . $ HetMap#ui..allCheckBoxcxx . . $ Ui_HetMapClass#allCheckBox.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false);
176 uicxx . . $ HetMap#ui..fileInfoCheckBoxcxx . . $ Ui_HetMapClass#fileInfoCheckBox.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false);
177 uicxx . . $ HetMap#ui..labelInfoCheckBoxcxx . . $ Ui_HetMapClass#labelInfoCheckBox.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false);
178 uicxx . . $ HetMap#ui..dataInfoCheckBoxcxx . . $ Ui_HetMapClass#dataInfoCheckBox.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false);
179 }
180 else
181 {
182 uicxx . . $ HetMap#ui..allCheckBoxcxx . . $ Ui_HetMapClass#allCheckBox.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true);
183 uicxx . . $ HetMap#ui..fileInfoCheckBoxcxx . . $ Ui_HetMapClass#fileInfoCheckBox.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true);
184 uicxx . . $ HetMap#ui..labelInfoCheckBoxcxx . . $ Ui_HetMapClass#labelInfoCheckBox.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true);
185 uicxx . . $ HetMap#ui..dataInfoCheckBoxcxx . . $ Ui_HetMapClass#dataInfoCheckBox.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true);
186 uicxx . . $ HetMap#ui..allCheckBoxcxx . . $ Ui_HetMapClass#allCheckBox.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(true);
187 }
188
189 mInternalChangecxx . . $ HetMap#mInternalChange. = false; // resume propagating signals
190 }
191
192 void HetMapcxx . . $ HetMap#::runnerErrorcxx . . $ HetMap#runnerError(45672f3c6961a244).(const QByteArraycxx . . $ QByteArray# &line)
193 {
194 QByteArraycxx . . $ QByteArray# lineCopy = linecxx . . $ QByteArray#QByteArray(45672f3c6961a244).;
195 if (lineCopy.endsWithcxx . . $ QByteArray#endsWith(7d4bdb1abc417636).("\n"))
196 lineCopy.chopcxx . . $ QByteArray#chop(d4f767463ce0a6b3).(1);
197 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! outputcxx . . $ GenericUtility#output(ddc4016aa177531b).(lineCopycxx . . $ QByteArray#QByteArray(45672f3c6961a244).);
198 }
199
200 void HetMapcxx . . $ HetMap#::finishedSlotcxx . . $ HetMap#finishedSlot(49f6e7a06ebc5aa8).()
201 {
202 deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).();
203 }