Mercurial > hg > webaudioevaluationtool
comparison ape.js @ 40:ee5ae5902574 Dev_main
Completed State Machine
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Fri, 10 Apr 2015 15:04:53 +0100 |
parents | 6653aaec3650 |
children | 86d332f77174 |
comparison
equal
deleted
inserted
replaced
39:6653aaec3650 | 40:ee5ae5902574 |
---|---|
394 } else if (currentState.substr(0,10) == 'testRunPre') | 394 } else if (currentState.substr(0,10) == 'testRunPre') |
395 { | 395 { |
396 // Start the test | 396 // Start the test |
397 var testId = currentState.substr(11,currentState.length-10); | 397 var testId = currentState.substr(11,currentState.length-10); |
398 currentState = 'testRun-'+testId; | 398 currentState = 'testRun-'+testId; |
399 } else if (currentState.substr(0,7) == 'testRun') | |
400 { | |
401 var testId = currentState.substr(8,currentState.length-7); | |
402 // Check if we have any post tests to perform | |
403 var postXML = testXMLSetups.find('PostTest')[testId]; | |
404 if (postXML.children.length > 0) | |
405 { | |
406 console.log('POST TEST') | |
407 } | |
408 // else | |
409 | |
410 | |
411 // No post tests, check if we have another test to perform instead | |
412 if (testXMLSetups.length-1 > testId) | |
413 { | |
414 // Yes we have another test to perform | |
415 currentState = 'testRun-'+Number(testId)+1; | |
416 loadTest(testId+1); | |
417 } else { | |
418 console.log('Testing Completed!'); | |
419 // Check for any post tests | |
420 var xmlSetup = projectXML.find('setup'); | |
421 var postTest = xmlSetup.find('PostTest'); | |
422 console.log(postTest); | |
423 } | |
399 } | 424 } |
400 console.log(currentState); | 425 console.log(currentState); |
426 } | |
427 | |
428 function buttonSubmitClick() | |
429 { | |
430 // This function is called when the submit button is clicked. Will check for any further tests to perform, or any post-test options | |
431 if (currentState.substr(0,7) == 'testRun') | |
432 { | |
433 advanceState(); | |
434 } | |
401 } | 435 } |
402 | 436 |
403 // Only other global function which must be defined in the interface class. Determines how to create the XML document. | 437 // Only other global function which must be defined in the interface class. Determines how to create the XML document. |
404 function interfaceXMLSave(){ | 438 function interfaceXMLSave(){ |
405 // Create the XML string to be exported with results | 439 // Create the XML string to be exported with results |