338 void Render(
bool* p_open);
342 void RenderMenuBar();
343 void RenderStudyBar();
344 void RenderTestsTab();
345 void RenderChainsTab();
347 void RenderQuickLaunchTab();
348 void RenderOutputPanel();
351 void RenderTestsInStudy();
352 void RenderAddTestPanel();
353 void RenderBatteryBrowser();
354 void RenderScaleBrowser();
355 void RenderFileImport();
356 void RenderNewTestTemplate();
359 void ShowAboutDialog();
360 void ShowParameterEditor();
361 void ShowVariantNameDialog();
362 void ShowSettingsDialog();
363 void ShowPageEditor();
364 void ShowTestEditor();
365 void ShowNewStudyDialog();
366 void ShowNewChainDialog();
367 void ShowStudySettingsDialog();
368 void ShowFirstRunDialog();
369 void ShowGettingStartedDialog();
370 void ShowDuplicateSubjectWarning();
371 void ShowEditParticipantCodeDialog();
372 void ShowCodeEditor();
373 void ShowTranslationEditorDialog();
374 void ShowSnapshotCreatedDialog();
377 void ShowScaleBuilder();
378 void RenderScaleList();
379 void RenderScaleInfoEditor();
380 void RenderQuestionsEditor();
381 void RenderScoringEditor();
382 void RenderTranslationsEditor();
383 void RenderSectionsTab();
384 void RenderParametersEditor();
385 void ShowQuestionEditor();
386 void RenderSectionEditorForm();
388 void ShowBatchImportDialog();
389 void ShowDimensionEditor();
390 void ShowCreateStudyFromScaleDialog();
391 void ShowCorrectAnswersEditor();
392 void ShowNormsEditor();
393 void TestCurrentScale();
396 void LoadParameterEditorForVariant();
399 void RenderFilePanel();
400 void RenderDetailsPanel();
401 void RenderDetailsTab();
402 void RenderStudyTab();
403 void RenderChainTab();
405 void ScanExperimentDirectory(
const std::string& path);
406 void LoadExperimentInfo(
const std::string& scriptPath);
407 void LoadScreenshot(
const std::string& imagePath);
408 void FreeScreenshot();
410 void OpenDirectoryInFileBrowser(
const std::string& path);
411 void OpenFileInTextEditor(
const std::string& filePath);
414 void LaunchTranslationEditor();
415 void LaunchDataCombiner(
const std::string& workingDirectory =
"");
418 void CreateNewStudy();
419 void ImportSnapshotFromPath(
const std::string& snapshotPath);
420 void LoadStudy(
const std::string& studyPath);
421 void AddTestToStudy();
422 void AddTestFromFile(
const std::string& filePath);
423 void CreateTestFromTemplate(
const std::string& testName,
int templateType);
424 void CreateTestFromGenericStudy(
const std::string& testName);
425 void RemoveTestFromStudy(
const std::string& testName);
426 void ScanTemplates();
427 void EditTestParameters(
int testIndex);
428 void ScanParameterVariants(
int testIndex);
429 bool SyncScaleSchema(
const std::string& testDir,
const std::string& scaleCode);
432 void CreateNewChain();
433 void LoadChain(
const std::string& chainPath);
434 void SaveCurrentChain();
435 void AddInstructionPage();
436 void AddConsentPage();
437 void AddCompletionPage();
438 void AddTestToChain();
439 void RemoveChainItem(
int index);
440 void MoveChainItemUp(
int index);
441 void MoveChainItemDown(
int index);
442 void MoveChainItemTo(
int from,
int to);
443 void EditChainItem(
int index);
444 void TestChainItem(
int index);
446 void RunChainConfirmed();
447 void ExecuteChainItem(
int index);
448 std::vector<std::string> CheckExistingSubjectCodes();
449 std::vector<std::string> BuildAdditionalArguments();
452 std::string OpenDirectoryDialog(
const std::string& title =
"Select Directory",
const std::string& startDir =
"");
453 std::string OpenFileDialog(
const std::string& title =
"Select File",
const std::string& filter =
"",
const std::string& initialDir =
"");
454 std::string SaveFileDialog(
const std::string& title =
"Save File",
const std::string& defaultName =
"");
457 SDL_Renderer* mRenderer;
458 std::vector<ExperimentInfo> mExperiments;
459 int mSelectedExperiment;
462 char mSubjectCode[256];
463 char mParticipantCode[256];
465 char mLanguageCode[16];
467 int mScreenResolution;
469 char mGraphicsDriver[256];
470 char mCustomArguments[512];
472 char mExperimentDir[512];
475 std::vector<std::string> mAvailableLanguages;
478 SDL_Texture* mScreenshotTexture;
479 int mScreenshotWidth;
480 int mScreenshotHeight;
485 bool mOutputExpanded;
488 std::string mChainAccumulatedStdout;
489 std::string mChainAccumulatedStderr;
492 std::shared_ptr<Study> mCurrentStudy;
493 std::shared_ptr<Chain> mCurrentChain;
494 std::shared_ptr<WorkspaceManager> mWorkspace;
495 std::shared_ptr<SnapshotManager> mSnapshots;
498 std::vector<std::string> mStudyList;
499 int mSelectedStudyIndex;
500 std::vector<std::string> mChainList;
501 int mSelectedChainIndex;
504 int mSelectedStudyTestIndex;
505 std::string mStudyTestDescription;
506 SDL_Texture* mStudyTestScreenshot;
507 int mStudyTestScreenshotW;
508 int mStudyTestScreenshotH;
509 void LoadStudyTestPreview(
int testIndex);
510 void FreeStudyTestScreenshot();
514 int mCurrentChainItemIndex;
515 std::vector<int> mChainExecutionOrder;
518 bool mShowParameterEditor;
519 bool mShowVariantNameDialog;
520 char mVariantName[256];
521 int mEditingTestIndex;
522 bool mEditingDefaultParams;
523 std::vector<Parameter> mParameters;
524 std::string mParameterFile;
527 bool mShowDuplicateSubjectWarning;
528 std::vector<std::string> mDuplicateWarningCodes;
531 bool mShowSnapshotCreated;
532 char mLastSnapshotName[512];
533 char mLastSnapshotPath[1024];
537 bool mShowNewStudyDialog;
538 bool mShowNewChainDialog;
539 bool mShowStudySettingsDialog;
540 bool mShowFirstRunDialog;
541 bool mShowGettingStartedDialog;
542 bool mShowEditParticipantCodeDialog;
552 char mNewStudyName[256];
553 char mNewStudyDescription[1024];
554 char mNewStudyAuthor[256];
555 char mNewChainName[256];
556 char mNewChainDescription[1024];
559 char mQuickLaunchPath[512];
560 char mQuickLaunchParamFile[512];
561 std::string mQuickLaunchDirectory;
562 std::vector<std::string> mQuickLaunchFiles;
563 int mQuickLaunchSelectedFile;
566 std::vector<std::string> mTemplateNames;
567 std::vector<std::string> mTemplateFiles;
568 std::string mBatteryPath;
571 bool mShowCodeEditor;
572 std::string mCodeEditorFilePath;
576 bool mShowScaleBuilder;
577 std::shared_ptr<ScaleManager> mScaleManager;
579 std::shared_ptr<ScaleDefinition> mCurrentScale;
580 std::vector<std::string> mScaleList;
581 int mSelectedScaleIndex;
582 int mNextSectionId = 1;
583 int mDeleteConfirmIndex = -1;
584 int mSelectedBranchGroupIndex = -1;
585 int mSelectedDimensionIndex;
594 SDL_Texture* mScaleBrowserScreenshot;
595 int mScaleBrowserScreenshotW, mScaleBrowserScreenshotH;
596 int mScaleBrowserScreenshotForIndex;
599 char mScaleTransLanguage[16];
600 int mScaleTransSelectedKey;
603 std::vector<ScaleManager::LooseOSDEntry> mLooseOSDEntries;
604 bool mLooseOSDEntriesLoaded =
false;
607 struct InstallOSDDialogState {
610 char errorMessage[256] = {};