Download SpecClient user's guide

Transcript
Contents
1. Introduction......................................................................................................................................................... 3
1.1 History.......................................................................................................................................... 3
1.2 Features......................................................................................................................................... 3
2. Getting started..................................................................................................................................................... 4
2.1 Importing SpecClient.................................................................................................................. 4
2.2 Moving a motor........................................................................................................................... 5
2.3 Counting....................................................................................................................................... 5
2.4 Executing commands................................................................................................................. 6
2.4.1 Executing macros....................................................................................... 6
2.4.2 Executing macro functions......................................................................... 7
2.4.3 Executing arbitrary strings..........................................................................7
2.5 Spec objects.................................................................................................................................. 7
2.6 Reading and writing Spec variables.......................................................................................... 8
3. Embedding SpecClient in a GUI................................................................................................................... 10
3.1 Dispatching events.................................................................................................................... 10
3.2 The asynchronous motor class................................................................................................ 10
3.3 Asynchronous SpecCounter.................................................................................................... 11
3.4 Executing commands asynchronously................................................................................... 11
3.5 Watching variables.................................................................................................................... 11
4. SpecServer......................................................................................................................................................... 13
5. Logging.............................................................................................................................................................. 14
5.1 What happens when importing SpecClient........................................................................... 14
5.2 Set logging on / off................................................................................................................... 14
5.3Log to rotating files.................................................................................................................... 14
Figures
FIG. 1: files in the SpecClient package................................................................................................................ 4
FIG. 2 : importing an element from the SpecClient package........................................................................... 4
FIG. 3 : creating a new SpecMotor object.......................................................................................................... 5
FIG. 4 : getting a motor position and moving.................................................................................................... 5
FIG. 5 : creating a SpecCounter object............................................................................................................... 5
FIG. 6 : counting..................................................................................................................................................... 6
FIG. 7 : obtaining a counter's value..................................................................................................................... 6
FIG. 8: defining a new command and executing it with arguments................................................................ 6
FIG. 9: executing a function.................................................................................................................................. 7
FIG. 10: executing a command string.................................................................................................................. 7
FIG. 11 : creating a Spec object............................................................................................................................ 7
FIG. 12: executing commands with Spec objects.............................................................................................. 8
FIG. 13: the getMotorsMne() method................................................................................................................. 8
FIG. 14 : creating a SpecVariable object............................................................................................................. 8
FIG. 15 : installing the SpecClient dispatcher in a GUI loop........................................................................ 10
FIG. 16 : turn logging off.................................................................................................................................... 14
FIG. 17 : log to rotating files............................................................................................................................... 14