Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] [ndt] r903 committed - Added possibility to restart tests in flash client

Subject: NDT-DEV email list created

List archive

[ndt-dev] [ndt] r903 committed - Added possibility to restart tests in flash client


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] [ndt] r903 committed - Added possibility to restart tests in flash client
  • Date: Wed, 12 Feb 2014 09:51:42 +0000

Revision: 903
Author:

Date: Wed Feb 12 09:51:28 2014 UTC
Log: Added possibility to restart tests in flash client

http://code.google.com/p/ndt/source/detail?r=903

Modified:
/branches/FlashIssue113/flash-client/src/GUI.as
/branches/FlashIssue113/flash-client/src/TestResults.as

=======================================
--- /branches/FlashIssue113/flash-client/src/GUI.as Sun Feb 2 19:14:17 2014 UTC
+++ /branches/FlashIssue113/flash-client/src/GUI.as Wed Feb 12 09:51:28 2014 UTC
@@ -52,6 +52,7 @@
private var _detailsButton:Sprite;
private var _errorsButton:Sprite;
private var _debugButton:Sprite;
+ private var _restartButton:Sprite;

public function GUI(
stageWidth:int, stageHeight:int, callerObj:NDTPController) {
@@ -172,6 +173,32 @@
_startButton.removeEventListener(MouseEvent.ROLL_OUT, rollOut);
_startButton.removeEventListener(MouseEvent.CLICK, clickStart);
}
+
+ private function hideResultsScreen():void {
+ while (this.numChildren > 0)
+ this.removeChildAt(0);
+
+ _resultsButton.removeEventListener(MouseEvent.ROLL_OVER,
rollOver);
+ _detailsButton.removeEventListener(MouseEvent.ROLL_OVER,
rollOver);
+ _errorsButton.removeEventListener(MouseEvent.ROLL_OVER,
rollOver);
+ if (_debugButton)
+
_debugButton.removeEventListener(MouseEvent.ROLL_OVER, rollOver);
+ _restartButton.removeEventListener(MouseEvent.ROLL_OVER,
rollOver);
+
+ _resultsButton.removeEventListener(MouseEvent.ROLL_OUT,
rollOut);
+ _detailsButton.removeEventListener(MouseEvent.ROLL_OUT,
rollOut);
+ _errorsButton.removeEventListener(MouseEvent.ROLL_OUT,
rollOut);
+ if (_debugButton)
+ _debugButton.removeEventListener(MouseEvent.ROLL_OUT,
rollOut);
+ _restartButton.removeEventListener(MouseEvent.ROLL_OUT,
rollOut);
+
+ _resultsButton.removeEventListener(MouseEvent.CLICK,
clickResults);
+ _detailsButton.removeEventListener(MouseEvent.CLICK,
clickDetails);
+ _errorsButton.removeEventListener(MouseEvent.CLICK,
clickErrors);
+ if (_debugButton)
+ _debugButton.removeEventListener(MouseEvent.CLICK,
clickDebug);
+ _restartButton.removeEventListener(MouseEvent.CLICK,
clickRestart);
+ }

/**
* Add text to the console while the NDT test is running.
@@ -211,42 +238,49 @@
_errorsButton = new NDTButton("ERRORS", 18, 30, 0.25);
if (CONFIG::debug)
_debugButton = new NDTButton("DEBUG", 18, 30, 0.25);
+ _restartButton = new NDTButton("RESTART", 18, 30, 0.25);

- var verticalMargin:Number = _stageHeight / 4;
+ var verticalMargin:Number = _stageHeight / 5;
if (CONFIG::debug)
- verticalMargin = _stageHeight / 5;
+ verticalMargin = _stageHeight / 6;
_resultsButton.y = verticalMargin;
_detailsButton.y = _resultsButton.y + verticalMargin;
_errorsButton.y = _detailsButton.y + verticalMargin;
_debugButton.y = _errorsButton.y + verticalMargin;
+ _restartButton.y = CONFIG::debug ? _debugButton.y + 1.5 * verticalMargin : _errorsButton.y + 1.5 * verticalMargin;
_resultsButton.x += _resultsButton.width / 2;
_detailsButton.x += _detailsButton.width / 2;
_errorsButton.x += _errorsButton.width / 2;
_debugButton.x += _debugButton.width / 2;
+ _restartButton.x += _restartButton.width / 2;

this.addChild(_resultsButton);
this.addChild(_detailsButton);
this.addChild(_errorsButton);
if (_debugButton)
this.addChild(_debugButton);
+ this.addChild(_restartButton);

_resultsButton.addEventListener(MouseEvent.ROLL_OVER, rollOver);
_detailsButton.addEventListener(MouseEvent.ROLL_OVER, rollOver);
_errorsButton.addEventListener(MouseEvent.ROLL_OVER, rollOver);
if (_debugButton)
_debugButton.addEventListener(MouseEvent.ROLL_OVER, rollOver);
+ _restartButton.addEventListener(MouseEvent.ROLL_OVER, rollOver);

_resultsButton.addEventListener(MouseEvent.ROLL_OUT, rollOut);
_detailsButton.addEventListener(MouseEvent.ROLL_OUT, rollOut);
_errorsButton.addEventListener(MouseEvent.ROLL_OUT, rollOut);
if (_debugButton)
_debugButton.addEventListener(MouseEvent.ROLL_OUT, rollOut);
+ _restartButton.addEventListener(MouseEvent.ROLL_OUT, rollOut);

_resultsButton.addEventListener(MouseEvent.CLICK, clickResults);
_detailsButton.addEventListener(MouseEvent.CLICK, clickDetails);
_errorsButton.addEventListener(MouseEvent.CLICK, clickErrors);
if (_debugButton)
_debugButton.addEventListener(MouseEvent.CLICK, clickDebug);
+ _restartButton.addEventListener(MouseEvent.CLICK, clickRestart);

setSummaryResultText();
_resultsTextField.htmlText = _summaryResultText;
@@ -334,6 +368,14 @@
+ TestResults.getErrMsg();
_resultsTextField.scrollV = 0;
}
+
+ private function clickRestart(e:MouseEvent):void {
+ hideResultsScreen();
+ TestResults.clearResults();
+ _consoleText.text = "";
+ this.addChild(_consoleText);
+ _callerObj.startNDTTest();
+ }
}
}

=======================================
--- /branches/FlashIssue113/flash-client/src/TestResults.as Sun Feb 2 19:14:17 2014 UTC
+++ /branches/FlashIssue113/flash-client/src/TestResults.as Wed Feb 12 09:51:28 2014 UTC
@@ -143,5 +143,25 @@
TestResults.appendResultDetails(s2cTestResults + remoteTestResults);
// TODO(tiziana): If parsing mistake, log message "resultsParseError".
}
+
+ public static function clearResults():void {
+ _ndtTestStartTime = 0.0;
+ _ndtTestEndTime = 0.0;
+ _resultDetails = "";
+ _errMsg = "";
+ _debugMsg = "";
+
+ accessTech = null;
+ linkSpeed = 0.0;
+ ndtVariables = new Object();
+ ndtTestStatus = null;
+ ndtTestFailed = false;
+ c2sSpeed = 0.0;
+ s2cSpeed = 0.0;
+ sc2sSpeed = 0.0;
+ ss2cSpeed = 0.0;
+ s2cTestResults = "";
+ remoteTestResults = "";
+ }
}
}


  • [ndt-dev] [ndt] r903 committed - Added possibility to restart tests in flash client, ndt, 02/12/2014

Archive powered by MHonArc 2.6.16.

Top of Page