| 1 | /* |
| 2 | Copyright (C) 2008, 2009 Andres Cabrera |
| 3 | [email protected] |
| 4 | |
| 5 | This file is part of CsoundQt. |
| 6 | |
| 7 | CsoundQt is free software; you can redistribute it |
| 8 | and/or modify it under the terms of the GNU Lesser General Public |
| 9 | License as published by the Free Software Foundation; either |
| 10 | version 2.1 of the License, or (at your option) any later version. |
| 11 | |
| 12 | CsoundQt is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | GNU Lesser General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU Lesser General Public |
| 18 | License along with Csound; if not, write to the Free Software |
| 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
| 20 | 02111-1307 USA |
| 21 | */ |
| 22 | |
| 23 | #include <QtWidgets> |
| 24 | |
| 25 | #include "utilitiesdialog.h" |
| 26 | #include "options.h" |
| 27 | #include "types.h" |
| 28 | |
| 29 | UtilitiesDialog::UtilitiesDialog(QWidget *parent, Options *options/*, ConfigLists * m_configlist*/) |
| 30 | : QDialog(parent), m_options(options) |
| 31 | { |
| 32 | setupUi(this); |
| 33 | |
| 34 | helpBrowser->setAcceptRichText(true); |
| 35 | QStringList searchPaths; |
| 36 | searchPaths << m_options->csdocdir; |
| 37 | helpBrowser->setSearchPaths(searchPaths); |
| 38 | connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(changeTab(int))); |
| 39 | |
| 40 | connect(atsaInputToolButton, SIGNAL(released()), this, SLOT(browseAtsaInput())); |
| 41 | connect(atsaOutputToolButton, SIGNAL(released()), this, SLOT(browseAtsaOutput())); |
| 42 | connect(pvInputToolButton, SIGNAL(released()), this, SLOT(browsePvInput())); |
| 43 | connect(pvOutputToolButton, SIGNAL(released()), this, SLOT(browsePvOutput())); |
| 44 | connect(hetInputToolButton, SIGNAL(released()), this, SLOT(browseHetInput())); |
| 45 | connect(hetOutputToolButton, SIGNAL(released()), this, SLOT(browseHetOutput())); |
| 46 | connect(lpInputToolButton, SIGNAL(released()), this, SLOT(browseLpInput())); |
| 47 | connect(lpOutputToolButton, SIGNAL(released()), this, SLOT(browseLpOutput())); |
| 48 | connect(cvInputToolButton, SIGNAL(released()), this, SLOT(browseCvInput())); |
| 49 | connect(cvOutputToolButton, SIGNAL(released()), this, SLOT(browseCvOutput())); |
| 50 | |
| 51 | connect(atsaInputLineEdit, SIGNAL(textChanged(QString)), this, SLOT(setAtsaOutput(QString))); |
| 52 | connect(pvInputLineEdit, SIGNAL(textChanged(QString)), this, SLOT(setPvanalOutput(QString))); |
| 53 | connect(hetInputLineEdit, SIGNAL(textChanged(QString)), this, SLOT(setHetroOutput(QString))); |
| 54 | connect(lpInputLineEdit, SIGNAL(textChanged(QString)), this, SLOT(setLpanalOutput(QString))); |
| 55 | connect(cvInputLineEdit, SIGNAL(textChanged(QString)), this, SLOT(setCvanalOutput(QString))); |
| 56 | changeHelp(m_options->csdocdir + "/cvanal.html"); |
| 57 | |
| 58 | atsaInputLineEdit->setText(options->atsInputName); |
| 59 | atsaOutputLineEdit->setText(options->atsOutputName); |
| 60 | atsaBeginLineEdit->setText(options->atsBeginTime); |
| 61 | atsaEndLineEdit->setText(options->atsEndTime); |
| 62 | atsaLowestLineEdit->setText(options->atsLowestFreq); |
| 63 | atsaHighestLineEdit->setText(options->atsHighestFreq); |
| 64 | atsaDeviationLineEdit->setText(options->atsFreqDeviat); |
| 65 | atsaCycleLineEdit->setText(options->atsWinCycle); |
| 66 | atsaHopSizeLineEdit->setText(options->atsHopSize); |
| 67 | atsaMagnitudeLineEdit->setText(options->atsLowestMag); |
| 68 | atsaLengthLineEdit->setText(options->atsTrackLen); |
| 69 | atsaMinSegmentLineEdit->setText(options->atsMinSegLen); |
| 70 | atsaMinGapLineEdit->setText(options->atsMinGapLen); |
| 71 | atsaThresholdLineEdit->setText(options->atsSmrThresh); |
| 72 | atsaLastPeakLineEdit->setText(options->atsLastPkCon); |
| 73 | atsaSmrLineEdit->setText(options->atsSmrContr); |
| 74 | atsaFileTypeComboBox->setCurrentIndex(options->atsFileType); |
| 75 | atsaWindowComboBox->setCurrentIndex(options->atsWindow); |
| 76 | |
| 77 | cvInputLineEdit->setText(options->cvInputName); |
| 78 | cvOutputLineEdit->setText(options->cvOutputName); |
| 79 | cvSrLineEdit->setText(options->cvSampleRate); |
| 80 | cvBeginLineEdit->setText(options->cvBeginTime); |
| 81 | cvDurationLineEdit->setText(options->cvDuration); |
| 82 | cvChannelLineEdit->setText(options->cvChannels); |
| 83 | |
| 84 | hetInputLineEdit->setText(options->hetInputName); |
| 85 | hetOutputLineEdit->setText(options->hetOutputName); |
| 86 | hetSrLineEdit->setText(options->hetSampleRate); |
| 87 | hetChannelLineEdit->setText(options->hetChannel); |
| 88 | hetBeginLineEdit->setText(options->hetBeginTime); |
| 89 | hetDurationLineEdit->setText(options->hetDuration); |
| 90 | hetStartLineEdit->setText(options->hetStartFrequency); |
| 91 | hetPartialsLineEdit->setText(options->hetNumPartials); |
| 92 | hetMaxLineEdit->setText(options->hetMaxAmplitude); |
| 93 | hetMinLineEdit->setText(options->hetMinAplitude); |
| 94 | hetBreakpointsLineEdit->setText(options->hetNumBreakPoints); |
| 95 | hetCutoffLineEdit->setText(options->hetFilterCutoff), |
| 96 | |
| 97 | lpInputLineEdit->setText(options->lpInputName); |
| 98 | lpOutputLineEdit->setText(options->lpOutputName); |
| 99 | lpSrLineEdit->setText(options->lpSampleRate); |
| 100 | lpChannelLineEdit->setText(options->lpChannel); |
| 101 | lpBeginLineEdit->setText(options->lpBeginTime); |
| 102 | lpDurationLineEdit->setText(options->lpDuration); |
| 103 | lpPolesLineEdit->setText(options->lpNumPoles); |
| 104 | lpHopSizeLineEdit->setText(options->lpHopSize); |
| 105 | lpLowestLineEdit->setText(options->lpLowestFreq); |
| 106 | lpVerbosityComboBox->setCurrentIndex(options->lpVerbosity); |
| 107 | lpAlternateCheckBox->setChecked(options->lpAlternateStorage); |
| 108 | |
| 109 | pvInputLineEdit->setText(options->pvInputName); |
| 110 | pvOutputLineEdit->setText(options->pvOutputName); |
| 111 | pvSrLineEdit->setText(options->pvSampleRate); |
| 112 | pvChannelLineEdit->setText(options->pvChannel); |
| 113 | pvBeginLineEdit->setText(options->pvBeginTime); |
| 114 | pvDurationLineEdit->setText(options->pvDuration); |
| 115 | pvFrameLineEdit->setText(options->pvFrameSize); |
| 116 | pvOverlapLineEdit->setText(options->pvOverlap); |
| 117 | pvWindowComboBox->setCurrentIndex(options->pvWindow); |
| 118 | pvBetaLineEdit->setText(options->pvBeta); |
| 119 | } |
| 120 | |
| 121 | void UtilitiesDialog::runAtsa() |
| 122 | { |
| 123 | QString flags = "-U atsa "; |
| 124 | |
| 125 | flags += "-b" + atsaBeginLineEdit->text() + " "; |
| 126 | flags += "-e" + atsaEndLineEdit->text() + " "; |
| 127 | flags += "-l" + atsaLowestLineEdit->text() + " "; |
| 128 | flags += "-H" + atsaHighestLineEdit->text() + " "; |
| 129 | flags += "-d" + atsaDeviationLineEdit->text() + " "; |
| 130 | flags += "-c" + atsaCycleLineEdit->text() + " "; |
| 131 | flags += "-h" + atsaHopSizeLineEdit->text() + " "; |
| 132 | flags += "-m" + atsaMagnitudeLineEdit->text() + " "; |
| 133 | flags += "-t" + atsaLengthLineEdit->text() + " "; |
| 134 | flags += "-s" + atsaMinSegmentLineEdit->text() + " "; |
| 135 | flags += "-g" + atsaMinGapLineEdit->text() + " "; |
| 136 | flags += "-T" + atsaThresholdLineEdit->text() + " "; |
| 137 | flags += "-P" + atsaLastPeakLineEdit->text() + " "; |
| 138 | flags += "-S" + atsaSmrLineEdit->text() + " "; |
| 139 | flags += "-F" + QString::number(atsaFileTypeComboBox->currentIndex()+1) + " "; |
| 140 | flags += "-w" + QString::number(atsaWindowComboBox->currentIndex()) + " "; |
| 141 | |
| 142 | flags += "\"" + atsaInputLineEdit->text() + "\" "; |
| 143 | flags += "\"" + atsaOutputLineEdit->text() + "\" "; |
| 144 | |
| 145 | // qDebug(flags.toStdString().c_str()); |
| 146 | emit(runUtility(flags)); |
| 147 | } |
| 148 | |
| 149 | void UtilitiesDialog::resetAtsa() |
| 150 | { |
| 151 | atsaBeginLineEdit->setText("0.0"); |
| 152 | atsaEndLineEdit->setText("0.0"); |
| 153 | atsaLowestLineEdit->setText("20"); |
| 154 | atsaHighestLineEdit->setText("20000"); |
| 155 | atsaDeviationLineEdit->setText("0.1"); |
| 156 | atsaCycleLineEdit->setText("4"); |
| 157 | atsaHopSizeLineEdit->setText("0.25"); |
| 158 | atsaMagnitudeLineEdit->setText("-60"); |
| 159 | atsaLengthLineEdit->setText("3"); |
| 160 | atsaMinSegmentLineEdit->setText("3"); |
| 161 | atsaMinGapLineEdit->setText("3"); |
| 162 | atsaThresholdLineEdit->setText("30"); |
| 163 | atsaLastPeakLineEdit->setText("0.0"); |
| 164 | atsaSmrLineEdit->setText("0.5"); |
| 165 | atsaFileTypeComboBox->setCurrentIndex(3); |
| 166 | atsaWindowComboBox->setCurrentIndex(1); |
| 167 | } |
| 168 | |
| 169 | void UtilitiesDialog::setAtsaOutput(QString name) |
| 170 | { |
| 171 | QString out = ""; |
| 172 | if (name.contains(".")) |
| 173 | out = name.left(name.lastIndexOf(".")) + ".ats"; |
| 174 | else |
| 175 | out = name + ".ats"; |
| 176 | atsaOutputLineEdit->setText(out); |
| 177 | } |
| 178 | |
| 179 | void UtilitiesDialog::runPvanal() |
| 180 | { |
| 181 | QString flags = "-U pvanal "; |
| 182 | |
| 183 | flags += "-s" + pvSrLineEdit->text() + " "; |
| 184 | flags += "-c" + pvChannelLineEdit->text() + " "; |
| 185 | flags += "-b" + pvBeginLineEdit->text() + " "; |
| 186 | flags += "-d" + pvDurationLineEdit->text() + " "; |
| 187 | flags += "-n" + pvFrameLineEdit->text() + " "; |
| 188 | flags += "-w" + pvOverlapLineEdit->text() + " "; |
| 189 | |
| 190 | switch (pvWindowComboBox->currentIndex()) { |
| 191 | case 0: |
| 192 | break; |
| 193 | case 1: |
| 194 | flags += "-H "; |
| 195 | break; |
| 196 | case 2: |
| 197 | flags += "-K "; |
| 198 | flags += "-B" + pvBetaLineEdit->text() ; |
| 199 | break; |
| 200 | default: |
| 201 | break; |
| 202 | } |
| 203 | flags += "\"" + pvInputLineEdit->text() + "\" "; |
| 204 | flags += "\"" + pvOutputLineEdit->text() + "\" "; |
| 205 | |
| 206 | // qDebug(flags.toStdString().c_str()); |
| 207 | emit(runUtility(flags)); |
| 208 | } |
| 209 | |
| 210 | void UtilitiesDialog::resetPvanal() |
| 211 | { |
| 212 | pvSrLineEdit->setText(""); |
| 213 | pvChannelLineEdit->setText("1"); |
| 214 | pvBeginLineEdit->setText("0.0"); |
| 215 | pvDurationLineEdit->setText("0.0"); |
| 216 | pvFrameLineEdit->setText("1024"); |
| 217 | pvOverlapLineEdit->setText("4"); |
| 218 | |
| 219 | pvWindowComboBox->setCurrentIndex(0); |
| 220 | pvBetaLineEdit->setText("6.4"); |
| 221 | } |
| 222 | |
| 223 | void UtilitiesDialog::setPvanalOutput(QString name) |
| 224 | { |
| 225 | QString out = ""; |
| 226 | if (name.contains(".")) |
| 227 | out = name.left(name.lastIndexOf(".")) + ".pvx"; |
| 228 | else |
| 229 | out = name + ".pvx"; |
| 230 | pvOutputLineEdit->setText(out); |
| 231 | } |
| 232 | |
| 233 | void UtilitiesDialog::runHetro() |
| 234 | { |
| 235 | QString flags = "-U hetro "; |
| 236 | |
| 237 | flags += "-s" + hetSrLineEdit->text() + " "; |
| 238 | flags += "-c" + hetChannelLineEdit->text() + " "; |
| 239 | flags += "-b" + hetBeginLineEdit->text() + " "; |
| 240 | flags += "-d" + hetDurationLineEdit->text() + " "; |
| 241 | flags += "-f" + hetStartLineEdit->text() + " "; |
| 242 | flags += "-h" + hetPartialsLineEdit->text() + " "; |
| 243 | flags += "-M" + hetMaxLineEdit->text() + " "; |
| 244 | flags += "-m" + hetMinLineEdit->text() + " "; |
| 245 | flags += "-n" + hetBreakpointsLineEdit->text() + " "; |
| 246 | flags += "-l" + hetCutoffLineEdit->text() + " "; |
| 247 | flags += "\"" + hetInputLineEdit->text() + "\" "; |
| 248 | flags += "\"" + hetOutputLineEdit->text() + "\" "; |
| 249 | |
| 250 | // qDebug(flags.toStdString().c_str()); |
| 251 | emit(runUtility(flags)); |
| 252 | } |
| 253 | |
| 254 | void UtilitiesDialog::resetHetro() |
| 255 | { |
| 256 | hetSrLineEdit->setText("44100"); |
| 257 | hetChannelLineEdit->setText("1"); |
| 258 | hetBeginLineEdit->setText("0.0"); |
| 259 | hetDurationLineEdit->setText("0.0"); |
| 260 | hetStartLineEdit->setText("100.0"); |
| 261 | hetPartialsLineEdit->setText("10"); |
| 262 | hetMaxLineEdit->setText("32767"); |
| 263 | hetMinLineEdit->setText("64"); |
| 264 | hetBreakpointsLineEdit->setText("256"); |
| 265 | hetCutoffLineEdit->setText("0"); |
| 266 | } |
| 267 | |
| 268 | void UtilitiesDialog::setHetroOutput(QString name) |
| 269 | { |
| 270 | QString out = ""; |
| 271 | if (name.contains(".")) |
| 272 | out = name.left(name.lastIndexOf(".")) + ".het"; |
| 273 | else |
| 274 | out = name + ".het"; |
| 275 | hetOutputLineEdit->setText(out); |
| 276 | } |
| 277 | |
| 278 | void UtilitiesDialog::runLpanal() |
| 279 | { |
| 280 | QString flags = "-U lpanal "; |
| 281 | |
| 282 | flags += "-s" + lpSrLineEdit->text() + " "; |
| 283 | flags += "-c" + lpChannelLineEdit->text() + " "; |
| 284 | flags += "-b" + lpBeginLineEdit->text() + " "; |
| 285 | flags += "-d" + lpDurationLineEdit->text() + " "; |
| 286 | flags += "-p" + lpPolesLineEdit->text() + " "; |
| 287 | flags += "-h" + lpHopSizeLineEdit->text() + " "; |
| 288 | flags += "-P" + lpLowestLineEdit->text() + " "; |
| 289 | flags += "-Q" + lpMaxLineEdit->text() + " "; |
| 290 | flags += "-v" + QString::number(lpVerbosityComboBox->currentIndex()) + " "; |
| 291 | if (lpAlternateCheckBox->isChecked()) |
| 292 | flags += "-a "; |
| 293 | flags += "\"" + lpInputLineEdit->text() + "\" "; |
| 294 | flags += "\"" + lpOutputLineEdit->text() + "\" "; |
| 295 | |
| 296 | // qDebug(flags.toStdString().c_str()); |
| 297 | emit(runUtility(flags)); |
| 298 | } |
| 299 | |
| 300 | void UtilitiesDialog::resetLpanal() |
| 301 | { |
| 302 | lpSrLineEdit->setText("44100"); |
| 303 | lpChannelLineEdit->setText("1"); |
| 304 | lpBeginLineEdit->setText("0.0"); |
| 305 | lpDurationLineEdit->setText("0.0"); |
| 306 | lpPolesLineEdit->setText("34"); |
| 307 | lpHopSizeLineEdit->setText("200"); |
| 308 | lpLowestLineEdit->setText(""); |
| 309 | lpVerbosityComboBox->setCurrentIndex(0); |
| 310 | lpAlternateCheckBox->setChecked(true); |
| 311 | } |
| 312 | |
| 313 | void UtilitiesDialog::setLpanalOutput(QString name) |
| 314 | { |
| 315 | QString out = ""; |
| 316 | if (name.contains(".")) |
| 317 | out = name.left(name.lastIndexOf(".")) + ".lp"; |
| 318 | else |
| 319 | out = name + ".lp"; |
| 320 | lpOutputLineEdit->setText(out); |
| 321 | } |
| 322 | |
| 323 | void UtilitiesDialog::runCvanal() |
| 324 | { |
| 325 | QString flags = "-U cvanal "; |
| 326 | |
| 327 | flags += "-s" + cvSrLineEdit->text() + " "; |
| 328 | flags += "-b" + cvBeginLineEdit->text() + " "; |
| 329 | flags += "-d" + cvDurationLineEdit->text() + " "; |
| 330 | if (cvChannelLineEdit->text()!= "") |
| 331 | flags += "-c" + cvChannelLineEdit->text() + " "; |
| 332 | flags += "\"" + cvInputLineEdit->text() + "\" "; |
| 333 | flags += "\"" + cvOutputLineEdit->text() + "\" "; |
| 334 | |
| 335 | // qDebug(flags.toStdString().c_str()); |
| 336 | emit(runUtility(flags)); |
| 337 | } |
| 338 | |
| 339 | void UtilitiesDialog::resetCvanal() |
| 340 | { |
| 341 | cvSrLineEdit->setText("44100"); |
| 342 | cvBeginLineEdit->setText("0.0"); |
| 343 | cvDurationLineEdit->setText("0.0"); |
| 344 | cvChannelLineEdit->setText(""); |
| 345 | } |
| 346 | |
| 347 | void UtilitiesDialog::setCvanalOutput(QString name) |
| 348 | { |
| 349 | QString out = ""; |
| 350 | if (name.contains(".")) |
| 351 | out = name.left(name.lastIndexOf(".")) + ".cv"; |
| 352 | else |
| 353 | out = name + ".cv"; |
| 354 | cvOutputLineEdit->setText(out); |
| 355 | } |
| 356 | |
| 357 | void UtilitiesDialog::browseAtsaInput() |
| 358 | { |
| 359 | QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), atsaInputLineEdit->text()); |
| 360 | if (fileName != "") |
| 361 | atsaInputLineEdit->setText(fileName); |
| 362 | } |
| 363 | |
| 364 | void UtilitiesDialog::browseAtsaOutput() |
| 365 | { |
| 366 | QString fileName = QFileDialog::getSaveFileName(this, tr("Select File"), atsaOutputLineEdit->text()); |
| 367 | if (fileName != "") |
| 368 | atsaOutputLineEdit->setText(fileName); |
| 369 | } |
| 370 | |
| 371 | void UtilitiesDialog::browsePvInput() |
| 372 | { |
| 373 | QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), pvInputLineEdit->text()); |
| 374 | if (fileName != "") |
| 375 | pvInputLineEdit->setText(fileName); |
| 376 | } |
| 377 | |
| 378 | void UtilitiesDialog::browsePvOutput() |
| 379 | { |
| 380 | QString fileName = QFileDialog::getSaveFileName(this, tr("Select File"), pvOutputLineEdit->text()); |
| 381 | if (fileName != "") |
| 382 | pvOutputLineEdit->setText(fileName); |
| 383 | } |
| 384 | |
| 385 | void UtilitiesDialog::browseHetInput() |
| 386 | { |
| 387 | QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), hetInputLineEdit->text()); |
| 388 | if (fileName != "") |
| 389 | hetInputLineEdit->setText(fileName); |
| 390 | } |
| 391 | |
| 392 | void UtilitiesDialog::browseHetOutput() |
| 393 | { |
| 394 | QString fileName = QFileDialog::getSaveFileName(this, tr("Select File"), hetOutputLineEdit->text()); |
| 395 | if (fileName != "") |
| 396 | hetOutputLineEdit->setText(fileName); |
| 397 | } |
| 398 | |
| 399 | void UtilitiesDialog::browseLpInput() |
| 400 | { |
| 401 | QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), lpInputLineEdit->text()); |
| 402 | if (fileName != "") |
| 403 | lpInputLineEdit->setText(fileName); |
| 404 | } |
| 405 | |
| 406 | void UtilitiesDialog::browseLpOutput() |
| 407 | { |
| 408 | QString fileName = QFileDialog::getSaveFileName(this, tr("Select File"), lpOutputLineEdit->text()); |
| 409 | if (fileName != "") |
| 410 | lpOutputLineEdit->setText(fileName); |
| 411 | } |
| 412 | |
| 413 | void UtilitiesDialog::browseCvInput() |
| 414 | { |
| 415 | QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), cvInputLineEdit->text()); |
| 416 | if (fileName != "") |
| 417 | cvInputLineEdit->setText(fileName); |
| 418 | } |
| 419 | |
| 420 | void UtilitiesDialog::browseCvOutput() |
| 421 | { |
| 422 | QString fileName = QFileDialog::getSaveFileName(this, tr("Select File"), cvOutputLineEdit->text()); |
| 423 | if (fileName != "") |
| 424 | cvOutputLineEdit->setText(fileName); |
| 425 | } |
| 426 | |
| 427 | void UtilitiesDialog::browseFile(QString &destination, QString /*extension*/) |
| 428 | { |
| 429 | QString file = QFileDialog::getOpenFileName(this,tr("Select File"),destination); |
| 430 | if (file!="") |
| 431 | destination = file; |
| 432 | } |
| 433 | |
| 434 | void UtilitiesDialog::browseDir(QString &destination) |
| 435 | { |
| 436 | QString dir = QFileDialog::getExistingDirectory(this,tr("Select Directory"),destination); |
| 437 | if (dir!="") |
| 438 | destination = dir; |
| 439 | } |
| 440 | |
| 441 | void UtilitiesDialog::changeHelp(QString filename) |
| 442 | { |
| 443 | // qDebug() << "UtilitiesDialog::changeHelp " << filename; |
| 444 | QFile file(filename); |
| 445 | if (!file.open(QFile::ReadOnly | QFile::Text)) { |
| 446 | // QMessageBox::warning(this, tr("CsoundQt"), |
| 447 | // tr("Cannot read file %1:\n%2.") |
| 448 | // .arg(fileName) |
| 449 | // .arg(file.errorString())); |
| 450 | return; |
| 451 | } |
| 452 | #ifdef Q_OS_WIN32 |
| 453 | QTextStream in(&file); |
| 454 | in.setAutoDetectUnicode(true); |
| 455 | helpBrowser->setHtml(in.readAll()); |
| 456 | #else |
| 457 | helpBrowser->setSource(QUrl(filename)); |
| 458 | #endif |
| 459 | } |
| 460 | |
| 461 | void UtilitiesDialog::changeTab(int tab) |
| 462 | { |
| 463 | QString filename = m_options->csdocdir; |
| 464 | switch (tab) { |
| 465 | case 0: |
| 466 | filename += "/cvanal.html"; |
| 467 | changeHelp(filename); |
| 468 | break; |
| 469 | case 1: |
| 470 | filename += "/hetro.html"; |
| 471 | changeHelp(filename); |
| 472 | break; |
| 473 | case 2: |
| 474 | filename += "/lpanal.html"; |
| 475 | changeHelp(filename); |
| 476 | break; |
| 477 | case 3: |
| 478 | filename += "/pvanal.html"; |
| 479 | changeHelp(filename); |
| 480 | break; |
| 481 | case 4: |
| 482 | filename += "/UtilityAtsa.html"; |
| 483 | changeHelp(filename); |
| 484 | break; |
| 485 | default: |
| 486 | break; |
| 487 | } |
| 488 | } |
| 489 | |
| 490 | void UtilitiesDialog::closeEvent(QCloseEvent * /*event*/) |
| 491 | { |
| 492 | m_options->cvInputName = cvInputLineEdit->text(); |
| 493 | m_options->cvOutputName = cvOutputLineEdit->text(); |
| 494 | m_options->cvSampleRate = cvSrLineEdit->text(); |
| 495 | m_options->cvBeginTime = cvBeginLineEdit->text(); |
| 496 | m_options->cvDuration = cvDurationLineEdit->text(); |
| 497 | m_options->cvChannels = cvChannelLineEdit->text(); |
| 498 | |
| 499 | m_options->hetInputName = hetInputLineEdit->text(); |
| 500 | m_options->hetOutputName = hetOutputLineEdit->text(); |
| 501 | m_options->hetSampleRate = hetSrLineEdit->text(); |
| 502 | m_options->hetChannel = hetChannelLineEdit->text(); |
| 503 | m_options->hetBeginTime = hetBeginLineEdit->text(); |
| 504 | m_options->hetDuration = hetDurationLineEdit->text(); |
| 505 | m_options->hetStartFrequency = hetStartLineEdit->text(); |
| 506 | m_options->hetNumPartials = hetPartialsLineEdit->text(); |
| 507 | m_options->hetMaxAmplitude = hetMaxLineEdit->text(); |
| 508 | m_options->hetMinAplitude = hetMinLineEdit->text() ; |
| 509 | m_options->hetNumBreakPoints = hetBreakpointsLineEdit->text(); |
| 510 | m_options->hetFilterCutoff = hetCutoffLineEdit->text(); |
| 511 | |
| 512 | m_options->lpInputName = lpInputLineEdit->text(); |
| 513 | m_options->lpOutputName = lpOutputLineEdit->text(); |
| 514 | m_options->lpSampleRate = lpSrLineEdit->text(); |
| 515 | m_options->lpChannel = lpChannelLineEdit->text(); |
| 516 | m_options->lpBeginTime = lpBeginLineEdit->text(); |
| 517 | m_options->lpDuration = lpDurationLineEdit->text(); |
| 518 | m_options->lpNumPoles = lpPolesLineEdit->text(); |
| 519 | m_options->lpHopSize = lpHopSizeLineEdit->text(); |
| 520 | m_options->lpLowestFreq = lpLowestLineEdit->text(); |
| 521 | m_options->lpVerbosity = lpVerbosityComboBox->currentIndex(); |
| 522 | m_options->lpAlternateStorage = lpAlternateCheckBox->isChecked(); |
| 523 | |
| 524 | m_options->pvInputName = pvInputLineEdit->text(); |
| 525 | m_options->pvOutputName = pvOutputLineEdit->text(); |
| 526 | m_options->pvSampleRate = pvSrLineEdit->text(); |
| 527 | m_options->pvChannel = pvChannelLineEdit->text(); |
| 528 | m_options->pvBeginTime = pvBeginLineEdit->text(); |
| 529 | m_options->pvDuration = pvDurationLineEdit->text(); |
| 530 | m_options->pvFrameSize = pvFrameLineEdit->text() ; |
| 531 | m_options->pvOverlap = pvOverlapLineEdit->text(); |
| 532 | m_options->pvWindow = pvWindowComboBox->currentIndex(); |
| 533 | m_options->pvBeta = pvBetaLineEdit->text(); |
| 534 | |
| 535 | m_options->atsInputName = atsaInputLineEdit->text(); |
| 536 | m_options->atsOutputName = atsaOutputLineEdit->text(); |
| 537 | m_options->atsBeginTime = atsaBeginLineEdit->text(); |
| 538 | m_options->atsEndTime = atsaEndLineEdit->text(); |
| 539 | m_options->atsLowestFreq = atsaLowestLineEdit->text(); |
| 540 | m_options->atsHighestFreq = atsaHighestLineEdit->text(); |
| 541 | m_options->atsFreqDeviat = atsaDeviationLineEdit->text(); |
| 542 | m_options->atsWinCycle = atsaCycleLineEdit->text(); |
| 543 | m_options->atsHopSize = atsaHopSizeLineEdit->text(); |
| 544 | m_options->atsLowestMag = atsaMagnitudeLineEdit->text(); |
| 545 | m_options->atsTrackLen = atsaLengthLineEdit->text(); |
| 546 | m_options->atsMinSegLen = atsaMinSegmentLineEdit->text(); |
| 547 | m_options->atsMinGapLen = atsaMinGapLineEdit->text(); |
| 548 | m_options->atsSmrThresh = atsaThresholdLineEdit->text(); |
| 549 | m_options->atsLastPkCon = atsaLastPeakLineEdit->text(); |
| 550 | m_options->atsSmrContr = atsaSmrLineEdit->text(); |
| 551 | m_options->atsFileType = atsaFileTypeComboBox->currentIndex(); |
| 552 | m_options-> atsWindow = atsaWindowComboBox->currentIndex(); |
| 553 | |
| 554 | emit Close(false); |
| 555 | } |