From e7ae690bafddf495d7193e147ba5e0ed267ac618 Mon Sep 17 00:00:00 2001 From: Rob van Son Date: Sun, 21 Dec 2014 14:23:15 +0100 Subject: [PATCH] Rewriting performance evaluation --- Config.praat | 29 ++++++++++++++++++++++++----- InitialiseSGC2.praat | 10 ++++++++-- sgc2.praat | 4 ++-- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/Config.praat b/Config.praat index bf6f4ab..02defcd 100644 --- a/Config.praat +++ b/Config.praat @@ -642,6 +642,22 @@ procedure processConfigPerfSummary .clickX .clickY .pressed$ endif endproc +# Wipe current performance table and initialize a new one +procedure processConfigClearSummary .clickX .clickY .pressed$ + .table$ = "Config" + .label$ = "ClearSummary" + + call Draw_button '.table$' '.label$' 1 + + + config.savePerf$ = "" + call initialize_toneevaluation_tables + + call Draw_button '.table$' '.label$' 0 + call Draw_config_page + +endproc + procedure processConfigListPerf .clickX .clickY .pressed$ .table$ = "Config" .label$ = "ListPerf" @@ -649,7 +665,6 @@ procedure processConfigListPerf .clickX .clickY .pressed$ select Table 'initialiseSGC2.toneevaluation_table$' View & Edit - # call write_tabbed_table 'initialiseSGC2.toneevaluation_table$' Evaluation_'config.language$' demoWaitForInput() call Draw_button '.table$' '.label$' 0 @@ -668,11 +683,15 @@ procedure processConfigSavePerf .clickX .clickY .pressed$ .openDialogue$ = Get value... '.row' Helptext call convert_praat_to_latin1 '.openDialogue$' .openDialogue$ = convert_praat_to_latin1.text$ - - .wordlist_Name$ = chooseWriteFile$ (.openDialogue$, "Performance.Table") - if .wordlist_Name$ <> "" + .defaultName$= "Performance.tsv" + if config.savePerf$ <> "" + .defaultName$= config.savePerf$ + endif + .performance_Name$ = chooseWriteFile$ (.openDialogue$, .defaultName$) + if .performance_Name$ <> "" select Table 'initialiseSGC2.toneevaluation_table$' - Write to table file... '.wordlist_Name$' + Write to table file... '.performance_Name$' + config.savePerf$ = .performance_Name$ endif call Draw_button '.table$' '.label$' 0 diff --git a/InitialiseSGC2.praat b/InitialiseSGC2.praat index 8ddc04e..f7e930d 100644 --- a/InitialiseSGC2.praat +++ b/InitialiseSGC2.praat @@ -72,6 +72,7 @@ config.input$ = "Microphone" config.showBackground = 1 sgc2.noiseThresshold = -30 config.strict = 0 +config.savePerf$ = "" sgc_ToneProt.minimumPitch = 40 sgc_ToneProt.maximumPitch = 600 @@ -418,8 +419,13 @@ procedure initialize_toneevaluation_tables endif initialiseSGC2.toneevaluation_table$ = "" - # Create new table - Create Table with column names... Performance 0 Tones Correct Wrong Total High Low Wide Narrow Unknown Commented + if config.savePerf$ <> "" and fileReadable(config.savePerf$) + sgc2.performanceTable = Read from file: config.savePerf$ + Rename: "Performance" + else + # Create new table + sgc2.performanceTable = Create Table with column names... Performance 0 Tones Correct Wrong Total High Low Wide Narrow Unknown Commented + endif initialiseSGC2.toneevaluation_table$ = "Performance" call get_toneevaluation_row Total endproc diff --git a/sgc2.praat b/sgc2.praat index 9d8d09d..ff75e5e 100644 --- a/sgc2.praat +++ b/sgc2.praat @@ -79,7 +79,7 @@ buttonbevel = 0 # Define canvas viewportMargin = 5 defaultFontSize = 12 -defaultFont$ = "Palatino" +defaultFont$ = "Helvetica" defaultLineWidth = 1 # Set up system @@ -1260,7 +1260,7 @@ procedure loadTable .tableName$ elsif variableExists("procCreate'.tableVariableName$'$") call Create'.tableVariableName$' else - call write_text_popup defaultFont$ 14 '.tableName$' cannot be found + call write_text_popup 'defaultFont$' 14 '.tableName$' cannot be found demoWaitForInput() exit '.tableName$' cannot be found endif -- 2.11.4.GIT