Bug Summary

File:OMSens_Qt/OMSensDialog.cpp
Warning:line 388, column 21
Called C++ object pointer is null

Annotated Source Code

[?] Use j/k keys for keyboard navigation

1#include "OMSensDialog.h"
2#include <QProcess>
3#include <QProgressDialog>
4#include <QVBoxLayout>
5#include <QPushButton>
6#include <QFileDialog>
7#include <QDateTime>
8#include <QTextStream>
9
10#include "OMSensPlugin.h"
11#include "dialogs/indiv/IndivSensAnalTypeDialog.h"
12#include "dialogs/indiv/IndivParamSensAnalysisDialog.h"
13#include "dialogs/indiv/IndivSensResultsDialog.h"
14#include "dialogs/sweep/MultiParamSweepDialog.h"
15#include "dialogs/sweep/SweepResultDialog.h"
16#include "dialogs/vect/VectorialParamSensAnalysisDialog.h"
17#include "dialogs/vect/VectorialResultsDialog.h"
18#include "dialogs/general/ImageViewerDialog.h"
19#include "dialogs/general/CSVViewerDialog.h"
20#include "dialogs/BaseRunSpecsDialog.h"
21#include "dialogs/BaseResultsDialog.h"
22#include "dialogs/help/HelpBrowser.h"
23#include "specs/IndivSpecs.h"
24#include "specs/SweepSpecs.h"
25#include "specs/VectSpecs.h"
26
27QString osName()
28{
29#if defined(Q_OS_ANDROID)
30 return QLatin1String("android");
31#elif defined(Q_OS_BLACKBERRY)
32 return QLatin1String("blackberry");
33#elif defined(Q_OS_IOS)
34 return QLatin1String("ios");
35#elif defined(Q_OS_MACOS)
36 return QLatin1String("macos");
37#elif defined(Q_OS_TVOS)
38 return QLatin1String("tvos");
39#elif defined(Q_OS_WATCHOS)
40 return QLatin1String("watchos");
41#elif defined(Q_OS_WINCE)
42 return QLatin1String("wince");
43#elif defined(Q_OS_WIN)
44 return QLatin1String("windows");
45#elif defined(Q_OS_LINUX)
46 return QLatin1String("linux");
47#elif defined(Q_OS_UNIX)
48 return QLatin1String("unix");
49#else
50 return QLatin1String("unknown");
51#endif
52}
53
54
55
56QString OMSensDialog::omsensBackendPath()
57{
58 // Get environment var value
59 QString envVarVal = qgetenv("OMSENSBACKEND");
60 // Check if it's empty
61 QString backendPath;
62 if(envVarVal.size() == 0)
63 {
64 backendPath = "?";
65 }
66 else
67 {
68 backendPath=envVarVal;
69 }
70 return backendPath;
71}
72
73QString OMSensDialog::pythonExecPath()
74{
75 // Define command to call depending on platform
76 QString system = osName();
77 QString command;
78 if(system == "linux") command = "which python";
79 else if(system == "windows") command = "where python";
80 else command = "invalid command to call";
81 // Call command
82 QProcess sysProcc;
83 sysProcc.start(command);
84 sysProcc.waitForFinished(); // sets current thread to sleep and waits for pingProcess end
85 // Check that it's was a sucessful call
86 int retCode = sysProcc.exitCode();
87 // Define python path
88 QString pythonPath;
89 if (retCode == 0)
90 {
91 // Get STDOUT
92 QString sysCallSTDOUT(sysProcc.readAllStandardOutput());
93 // Sanitize output
94 QStringList paths = sysCallSTDOUT.split("\n");
95 QString firstPath = paths.at(0);
96 pythonPath = firstPath;
97 }
98 else
99 {
100 pythonPath = "?";
101 }
102 return pythonPath;
103}
104
105OMSensDialog::OMSensDialog(Model model, QWidget *parent) : QDialog(parent), mActiveModel(model)
106{
107 // Dialog settings
108 setMinimumWidth(400);
109 setWindowTitle("OMSens");
110
111 helpTextPath = "qrc:/OMSens/help/help.html";
112 exp_specs_file_name = "experiment_specs.json";
113 model_specs_file_name = "model_info.json";
114 analysis_results_info_file_name = "result.json";
115
116 // OMSens python backend path
117 mOMSensPath = QDir::cleanPath(OMSensPlugin::OpenModelicaHome + "/OMSens")/*omsensBackendPath()*/;
118 // Python executable path
119 mPythonBinPath = QDir::cleanPath(pythonExecPath());
120 // Initialize dialogs
121 mpVectSensDialog = new VectorialSensAnalysisDialog(mActiveModel,this);
122 mpSweepDialog = new MultiParamSweepDialog(mActiveModel,this);
123 mpIndivSensDialog = new IndivParamSensAnalysisDialog(mActiveModel,this);
124 // Initialize paths
125 mpOMSensPathLabel = new QLabel("OMSens python backend folder:");
126 mpOMSensPathValue = new QLabel(mOMSensPath);
127 mpOMSensPathValue->setFrameStyle(QFrame::Panel | QFrame::Sunken);
128 mpOMSensPathBrowseButton = new QPushButton("Browse");
129 mpOMSensPathBrowseButton->setAutoDefault(true);
130 mpOMSensPathBrowseButton->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
131 connect(mpOMSensPathBrowseButton, SIGNAL(clicked())"2""clicked()", this, SLOT(launchOMSensBackendChooseFolderDialog())"1""launchOMSensBackendChooseFolderDialog()");
132
133 mpPythonBinLabel = new QLabel("Python executable:");
134 mpPythonBinValue = new QLabel(mPythonBinPath);
135 mpPythonBinValue->setFrameStyle(QFrame::Panel | QFrame::Sunken);
136 mpPythonBinBrowseButton = new QPushButton("Browse");
137 mpPythonBinBrowseButton->setAutoDefault(true);
138 mpPythonBinBrowseButton->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
139 connect(mpPythonBinBrowseButton, SIGNAL(clicked())"2""clicked()", this, SLOT(launchPythonBinChooseFolderDialog())"1""launchPythonBinChooseFolderDialog()");
140
141 // Division between paths and buttons
142 mpHorizontalLineOne= new QFrame;
143 mpHorizontalLineOne->setFrameShape(QFrame::HLine);
144 mpHorizontalLineOne->setFrameShadow(QFrame::Sunken);
145
146
147 // Initialize features
148 mpIndivButton = new QPushButton(tr("Individual Parameter Based Sensitivity Analysis"));
149 mpIndivButton->setAutoDefault(true);
150 mpIndivButton->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
151 connect(mpIndivButton, SIGNAL(clicked())"2""clicked()", SLOT(runIndivSensAnalysis())"1""runIndivSensAnalysis()");
152
153 mpSweepButton = new QPushButton(tr("Multi-parameter Sweep"));
154 mpSweepButton->setAutoDefault(true);
155 mpSweepButton->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
156 connect(mpSweepButton, SIGNAL(clicked())"2""clicked()", SLOT(runMultiParameterSweep())"1""runMultiParameterSweep()");
157
158 mpVectButton = new QPushButton(tr("Vectorial Parameter Based Sensitivity Analysis"));
159 mpVectButton->setAutoDefault(true);
160 mpVectButton->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
161 connect(mpVectButton, SIGNAL(clicked())"2""clicked()", SLOT(runVectorialSensAnalysis())"1""runVectorialSensAnalysis()");
162
163 // Division between features and help
164 mpHorizontalLineTwo= new QFrame;
165 mpHorizontalLineTwo->setFrameShape(QFrame::HLine);
166 mpHorizontalLineTwo->setFrameShadow(QFrame::Sunken);
167
168 // Help (not shown for now)
169 mpHelpButton = new QPushButton(tr("Help"));
170 mpHelpButton->setAutoDefault(true);
171 mpHelpButton->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
172 connect(mpHelpButton, SIGNAL(clicked())"2""clicked()", SLOT(helpDialog())"1""helpDialog()");
173
174 // Load experiment
175 mpLoadExperimentButton = new QPushButton(tr("Load"));
176 mpLoadExperimentButton->setAutoDefault(true);
177 mpLoadExperimentButton->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
178 connect(mpLoadExperimentButton, SIGNAL(clicked())"2""clicked()", SLOT(loadExperimentFileDialog())"1""loadExperimentFileDialog()");
179
180 // Layout
181 QVBoxLayout *mainLayout = new QVBoxLayout;
182 // OMSens folder
183 mainLayout->addWidget(mpOMSensPathLabel, 0, Qt::AlignLeft);
184 QHBoxLayout *pOMSensValueLayout = new QHBoxLayout;
185 pOMSensValueLayout->addWidget(mpOMSensPathValue);
186 pOMSensValueLayout->addWidget(mpOMSensPathBrowseButton);
187 mainLayout->addLayout(pOMSensValueLayout);
188 // Python bin
189 mainLayout->addWidget(mpPythonBinLabel, 0, Qt::AlignLeft);
190 QHBoxLayout *pPythonBinValueLayout = new QHBoxLayout;
191 pPythonBinValueLayout->addWidget(mpPythonBinValue);
192 pPythonBinValueLayout->addWidget(mpPythonBinBrowseButton);
193 mainLayout->addLayout(pPythonBinValueLayout);
194 // Division
195 mainLayout->addWidget(mpHorizontalLineOne);
196 // Buttons
197 mainLayout->addWidget(mpIndivButton, 0, Qt::AlignCenter);
198 mainLayout->addWidget(mpSweepButton, 0, Qt::AlignCenter);
199 mainLayout->addWidget(mpVectButton , 0, Qt::AlignCenter);
200 mainLayout->addWidget(mpHorizontalLineTwo);
201 // Don't show the help for now
202 // mainLayout->addWidget(mpHelpButton , 0, Qt::AlignCenter);
203 mainLayout->addWidget(mpLoadExperimentButton , 0, Qt::AlignLeft);
204
205 // Layout settings
206 mainLayout->setAlignment(Qt::AlignCenter);
207 setLayout(mainLayout);
208}
209
210
211void OMSensDialog::runIndivSensAnalysis()
212{
213 RunType runType = Individual;
214 runAnalysisAndShowResult(mpIndivSensDialog, runType, mActiveModel);
215}
216void OMSensDialog::runMultiParameterSweep()
217{
218 RunType runType = Sweep;
219 runAnalysisAndShowResult(mpSweepDialog, runType, mActiveModel);
220}
221void OMSensDialog::runVectorialSensAnalysis()
222{
223 RunType runType = Vectorial;
224 runAnalysisAndShowResult(mpVectSensDialog, runType, mActiveModel);
225}
226
227QJsonDocument OMSensDialog::readJsonFile(QString analysisResultsJSONPath)
228{
229 // Read JSON file into string
230 QString val;
231 QFile jsonPathsQFile;
232 jsonPathsQFile.setFileName(analysisResultsJSONPath);
233 jsonPathsQFile.open(QIODevice::ReadOnly | QIODevice::Text);
234 val = jsonPathsQFile.readAll();
235 jsonPathsQFile.close();
236 // Parse string into json document
237 QJsonDocument jsonPathsDocument = QJsonDocument::fromJson(val.toUtf8());
238
239 return jsonPathsDocument;
240}
241
242QString OMSensDialog::progressDialogTextForCurrentTime()
243{
244 QDateTime currentTime = QDateTime::currentDateTime();
245 QString date = currentTime.toString("dd/MM/yyyy");
246 QString h_m_s = currentTime.toString("H:m:s");
247 QString scriptRunStartString = "(started on " + date + " at " + h_m_s + ")";
248 QString progressDialogText = "Running python script... " + scriptRunStartString;
249
250 return progressDialogText;
251}
252
253bool OMSensDialog::runProcessAndShowProgress(QString scriptDirPath, QString command, QString resultsFolderPath)
254{
255 QProcess pythonScriptProcess;
256 // Set working dir path
257 pythonScriptProcess.setWorkingDirectory(scriptDirPath);
258 // Initialize dialog showing progress
259 QString progressDialogText = progressDialogTextForCurrentTime();
260 QProgressDialog *dialog = new QProgressDialog(progressDialogText, "Cancel", 0, 0, this);
261 dialog->setAttribute(Qt::WA_DeleteOnClose);
262 // Connect command "close" with dialog close
263 connect(&pythonScriptProcess, SIGNAL(finished(int))"2""finished(int)", dialog, SLOT(close())"1""close()");
264 // Connect dialog "cancel" with command kill
265 connect(dialog, SIGNAL(canceled())"2""canceled()", &pythonScriptProcess, SLOT(kill())"1""kill()");
266
267 // Start process
268 pythonScriptProcess.start(command);
269 // Show dialog with progress
270 dialog->exec();
271 // Wait for the process to finish in the case that we cancel the process and it doesn't have time to finish correctly
272 pythonScriptProcess.waitForFinished(3000);
273 //
274 // See if the process ended correctly
275 QProcess::ExitStatus exitStatus = pythonScriptProcess.exitStatus();
276 int exitCode = pythonScriptProcess.exitCode();
277 // Prepare python call log
278 QString python_log_header = QString("full command:%1\n-------\n").arg(command);
279 QString python_call_stdout(pythonScriptProcess.readAllStandardOutput());
280 QString python_log_full_str = python_log_header + python_call_stdout;
281 // Write log to file
282 QString python_log_file_name = "python_log.txt";
283 QString python_log_file_path = QDir::cleanPath(resultsFolderPath + QDir::separator() + python_log_file_name);;
284 QFile logFile(python_log_file_path);
285 if ( logFile.open(QIODevice::ReadWrite) )
286 {
287 QTextStream out(&logFile);
288 out << python_log_full_str;
289 logFile.close();
290 }
291
292 bool processEndedCorrectly = (exitStatus == QProcess::NormalExit) && (exitCode == 0);
293
294 return processEndedCorrectly;
295}
296
297QString OMSensDialog::createTimestampDir(QString destFolderPath)
298{
299 QDateTime currentTime = QDateTime::currentDateTime();
300 QString date = currentTime.toString("yyyy-MM-dd");
301 QString h_m_s = currentTime.toString("H_m_s");
302 QString timeStampFolderPath = QDir::cleanPath(destFolderPath + QDir::separator() + date + QDir::separator() + h_m_s);;
303 QDir timestampFolderPathDir(timeStampFolderPath);
304 if (!timestampFolderPathDir.exists()){
305 timestampFolderPathDir.mkpath(".");
306 }
307
308 return timeStampFolderPath;
309}
310
311QString OMSensDialog::writeJsonToDisk(QString file_path, QJsonDocument runSpecificationsDoc)
312{
313 // Save analysis specifications to disk
314 QFile runSpecificationsFile(file_path);
315 if ( runSpecificationsFile.open(QIODevice::ReadWrite) )
316 {
317 runSpecificationsFile.write(runSpecificationsDoc.toJson());
318 runSpecificationsFile.close();
319 }
320
321 return file_path;
322}
323
324QString OMSensDialog::createResultsFolder(QString timeStampFolderPath)
325{
326 QString resultsFolderPath = QDir::cleanPath(timeStampFolderPath + QDir::separator() + "results");;
327 QDir resultsFolderPathDir(resultsFolderPath);
328 if (!resultsFolderPathDir.exists()){
329 resultsFolderPathDir.mkpath(".");
330 }
331
332 return resultsFolderPath;
333}
334
335QString OMSensDialog::dirPathForFilePath(QString scriptPath)
336{
337 QFileInfo scriptFileInfo = QFileInfo(scriptPath);
338 QDir scriptDir = scriptFileInfo.canonicalPath();
339 QString scriptDirPath = scriptDir.canonicalPath();
340
341 return scriptDirPath;
342}
343
344QString OMSensDialog::commandCallFromPaths(QString scriptPath, QString pythonBinPath, QString jsonSpecsPath, QString resultsFolderPath)
345{
346 QString scriptDestPathFlag = "--dest_folder_path";
347 QString scriptDestPathFlagAndArg = scriptDestPathFlag + " \"" + resultsFolderPath + "\"";
348 QString command = "\"" + pythonBinPath + "\" \"" + scriptPath + "\" \"" + jsonSpecsPath + "\" " + scriptDestPathFlagAndArg;
349
350 return command;
351}
352
353bool OMSensDialog::defineAndRunCommand(QString scriptDirPath, QString jsonSpecsPath, QString resultsFolderPath, QString scriptPath, QString pythonBinPath)
354{
355 // Define command
356 QString command = commandCallFromPaths(scriptPath, pythonBinPath, jsonSpecsPath, resultsFolderPath);
357 // Call process
358 bool processEndedCorrectly = runProcessAndShowProgress(scriptDirPath, command, resultsFolderPath);
359
360 return processEndedCorrectly;
361}
362
363BaseResultsDialog* OMSensDialog::showResultsDialog(RunType runType, QString resultsFolderPath)
364{
365 QString analysisResultsJSONPath = QDir::cleanPath(resultsFolderPath + QDir::separator() + analysis_results_info_file_name);
366 QJsonDocument jsonPathsDocument = readJsonFile(analysisResultsJSONPath);
367 // Initialize results instance with JSON document
368 BaseResultsDialog *resultsDialog = 0;
369 switch (runType)
370 {
371 case Vectorial:
372 resultsDialog = new VectorialResultsDialog(jsonPathsDocument, resultsFolderPath, this);
373 break;
374 case Sweep:
375 resultsDialog = new SweepResultsDialog(jsonPathsDocument, resultsFolderPath, this);
376 break;
377 case Individual:
378 resultsDialog = new IndivSensResultsDialog(jsonPathsDocument, resultsFolderPath, this);
379 break;
380 }
381 return resultsDialog;
382}
383
384void OMSensDialog::runAnalysisAndShowResult(BaseRunSpecsDialog *runSpecsDialog, RunType runType, Model model)
385{
386 // Hide this dialog before opening the new one
387 this->hide();
388 int dialogCode = runSpecsDialog->exec();
15
Called C++ object pointer is null
389 // If the dialog was accepted by the user, run the analysis
390 BaseResultsDialog* resultDialog = 0;
391 if(dialogCode == QDialog::Accepted)
392 {
393 // Get script path from OMSens dir and script file name
394 QString scriptFileName = runSpecsDialog->pythonScriptName();
395 QString scriptPath = QDir::cleanPath(mOMSensPath + QDir::separator() + scriptFileName);
396 // python executable path from class member
397 QString pythonBinPath = mPythonBinPath;
398
399 QJsonDocument exp_specs = runSpecsDialog->getRunSpecifications();
400 QString destFolderPath = runSpecsDialog->getDestFolderPath();
401 // Make timestamp subfolder in dest folder path
402 QString timeStampFolderPath = createTimestampDir(destFolderPath);
403 // Make sub-folder where the results will be written
404 QString resultsFolderPath = createResultsFolder(timeStampFolderPath);
405 // Write Exp specs to disk
406 QString exp_specs_path = QDir::cleanPath(timeStampFolderPath + QDir::separator() + exp_specs_file_name);
407 writeJsonToDisk(exp_specs_path, exp_specs);
408 // Write model specs to disk
409 QString model_specs_path = QDir::cleanPath(timeStampFolderPath + QDir::separator() + model_specs_file_name);
410 QJsonDocument model_specs = model.toJson();
411 writeJsonToDisk(model_specs_path, model_specs);
412 // Run command
413 QString scriptDirPath = dirPathForFilePath(scriptPath);
414 bool processEndedCorrectly = defineAndRunCommand(scriptDirPath, exp_specs_path, resultsFolderPath, scriptPath, pythonBinPath);
415 // If the process ended correctly, show the results dialog
416 if (processEndedCorrectly) {
417 // Read JSON in results folder with the paths to the results of the script
418 resultDialog = showResultsDialog(runType, resultsFolderPath);
419 }
420 }
421 // If the user pressed the "Cancel" button, do nothing for now
422 if(dialogCode == QDialog::Rejected) {
423 // Cancel button clicked
424 }
425
426 // First show OMSens main dialog
427 this->show();
428
429 if(resultDialog)
430 {
431 // If a result dialog was initialized, show it
432 resultDialog->show();
433 }
434
435}
436
437// OLD FUNCTIONS THAT HAVE BEEN REPLACED:
438void OMSensDialog::openSensAnalysisResult()
439{
440 //ADAPTAR:
441 // Ask for file path using dialog
442 QString filePath = QFileDialog::getOpenFileName(this,tr("Open Sensitivity Analysis Results"), "", tr("Comma Separated Values file(*.csv)"));
443 // Check if the user selected a file or if they clicked cancel
444 if (!filePath.isNull()){
445 // Initialize Results dialog
446 CSVViewerDialog *pSensResult = new CSVViewerDialog(filePath, this);
447 pSensResult->exec();
448 }
449 //ADAPTAR^
450}
451void OMSensDialog::openSensAnalysisImage()
452{
453 //ADAPTAR:
454 //Get the valid types supported by the image viewer
455 QStringList mimeTypeFilters =ImageViewerDialog::compatibleMIMETypes();
456 // Initialize the QFileDialog instance to ask the user for a file
457 QFileDialog dialog(this, tr("Open File"));
458 dialog.setMimeTypeFilters(mimeTypeFilters);
459 dialog.selectMimeTypeFilter("image/png");
460 // Ask for file path using dialog
461 dialog.exec();
462 QString filePath = dialog.selectedFiles().first();
463
464 // Check if the user selected a file or if they clicked cancel
465 if (!filePath.isNull()){
466 // Initialize Results dialog
467 ImageViewerDialog *pImageViewer = new ImageViewerDialog(filePath, this);
468 pImageViewer->exec();
469 }
470 // open sens analysis Image
471 //ADAPTAR^
472}
473
474void OMSensDialog::launchOMSensBackendChooseFolderDialog()
475{
476 // Launch dialog
477 QString path = QFileDialog::getExistingDirectory(this, tr("Choose Destination Folder"),
478 "/home",
479 QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
480 if(!path.isEmpty() && !path.isNull())
481 {
482 // Save path into member variable
483 mOMSensPath = path;
484 mpOMSensPathValue->setText(mOMSensPath);
485 }
486}
487
488void OMSensDialog::launchPythonBinChooseFolderDialog()
489{
490 // Launch dialog
491 QString path = QFileDialog::getOpenFileName(this, tr("Choose python interpreter"),
492 "/home",
493 tr("Python interpreter(*)"));
494 if(!path.isEmpty() && !path.isNull())
495 {
496 // Save path into member variable
497 mPythonBinPath = path;
498 mpPythonBinValue->setText(mPythonBinPath);
499 }
500}
501
502void OMSensDialog::helpDialog()
503{
504 HelpBrowser *helpBrowser = new HelpBrowser(helpTextPath);
505 helpBrowser->show();
506}
507
508
509void OMSensDialog::loadExperimentFileDialog()
510{
511 // Launch
512 QString exp_specs_path = QFileDialog::getOpenFileName(this, tr("Open File"),
513 "/home",
514 tr("Experiments (*.json)"));
515 if(!exp_specs_path.isEmpty() && !exp_specs_path.isNull())
1
Assuming the condition is true
2
Assuming the condition is true
3
Taking true branch
516 {
517 // Load file
518 QJsonDocument json_specs_doc = readJsonFile(exp_specs_path);
519 // Get object from top
520 QJsonObject json_specs = json_specs_doc.object();
521 // Check if contains key specifying analysis type
522 QString analysis_type_key = "analysis_type";
523 if(json_specs.contains(analysis_type_key))
4
Assuming the condition is true
5
Taking true branch
524 {
525 // Get analysis type
526 QString analysis_type = json_specs.value(QString(analysis_type_key)).toString();
527 // Find the corresponding analysis type
528 BaseRunSpecsDialog *runSpecsDialog = 0;
6
'runSpecsDialog' initialized to a null pointer value
529 RunType runType = Individual;
530 // Get specs file folder path
531 QFileInfo exp_specs_file_info = QFileInfo(exp_specs_path);
532 QDir exp_specs_dir = exp_specs_file_info.absoluteDir();
533 // We assume that the model information is available in the same folder as the experiment specifications
534 QString model_specs_path = QDir::cleanPath(exp_specs_dir.absolutePath() + QDir::separator() + model_specs_file_name);
535 // Read model info from file
536 QJsonDocument model_info_json = readJsonFile(model_specs_path);
537 Model model = Model(model_info_json);
538 if (analysis_type == IndivSpecs::analysis_id_str)
7
Assuming the condition is false
8
Taking false branch
539 {
540 IndivSpecs runSpecs = IndivSpecs(json_specs_doc);
541 runSpecsDialog = new IndivParamSensAnalysisDialog(model, runSpecs, this);
542 runType = Individual;
543
544 }
545 else if (analysis_type == SweepSpecs::analysis_id_str)
9
Assuming the condition is false
10
Taking false branch
546 {
547 SweepSpecs runSpecs = SweepSpecs(json_specs_doc);
548 runSpecsDialog = new MultiParamSweepDialog(model, runSpecs, this);
549 runType = Sweep;
550 }
551 else if (analysis_type == VectSpecs::analysis_id_str)
11
Assuming the condition is false
12
Taking false branch
552 {
553 VectSpecs runSpecs = VectSpecs(json_specs_doc);
554 runSpecsDialog = new VectorialSensAnalysisDialog(model, runSpecs, this);
555 runType = Vectorial;
556 }
557
558 runAnalysisAndShowResult(runSpecsDialog,runType,model);
13
Passing null pointer value via 1st parameter 'runSpecsDialog'
14
Calling 'OMSensDialog::runAnalysisAndShowResult'
559 }
560 }
561}