Tik-76.115 Individual Project: Guinea Pig
$Id: ab_scale_python_interface.html,v 1.5 1996/04/13 16:12:58 kepa Exp $

Testee UI - A/B Scale Test Python interface

This document describes the Python interface of A/B Scale Test. It is used to interface the A/B Scale Test Logic module to A/B Scale Test Testee UI. See the A/B Scale Test User Manual for a general overview. Here's a snapshot of the A/B Scale Test GUI:

[Image]

Using ab_scale_gui class

You can use the gui_client class init('ab_scale') method call to create an ab_scale_gui class GUI instance. See Testee UI Python interfaces for more information.

When you have made an ab_scale_gui class instance ab_scale, you can use the arm() method to put the GUI in idle state. (Grey buttons, useful for clearing the timeout red buttons.) The values min, max, start, tick, correspond to: the minimum value of the slider, the maximum value of the slider, the beginning value of the slider, and the tick spacing uder the slider (use 0 for no ticks). They can be specified independently for both samples.

   ab_scale.arm(amin=1, amax=5, astart=1, atick=0,
   bmin=1, bmax=5, bstart=1, btick=0)
With the playing('A') or playing('B') method calls you can change the colour of the bar on top of A or B button blue.
   ab_scale.playing('A')
With the stopped('A') or stopped('B') method calls you can change the colour of the bar on top of A or B button grey.
   ab_scale.stopped('A')
With the enable(warnTO=5.0, answerTO=10.0) method call you enable the testee to give his/her answer. It also enables the warning timeout, specified in seconds, after which the GUI warns the user that the answering time is running out by changing the bars on top of the buttons yellow. The answer timeout is a timeout after which the user is no longer able to give an answer, and both bars on top of the buttons turn red. If the answer timeout is specified as 0.0, the GUI will wait forever to the testee to give an answer.
   ab_scale.enable(warnTO=5.0, answerTO=10.0)
You can receive the grades user gave, or timeout indication with the get_answer() method. It returns a tuple that contains two values: a list followed by a float. The first item on the list is a string which tells if answering time ran out. In this case it is TIMEOUT, otherwise it is the grade given to the A sample and the second value is the grade given for the B sample. The float returned is the system clock time at the time of the answer was given or time ran out (as returned by the python time.time() method).
   answer, timestamp = ab_scale.get_answer()
When the test is over, the GUI is closed with the close() method. You should not access the object after calling this method.
   ab_scale.close()
   ab_scale = None


. Testee UI Python interfaces · Testee UI Architecture · Testee UI Index · Document index · Guinea Pig ·