ProcSee Reference Manual

Institute for Energy Technology
OECD Halden Reactor Project
REFERENCE MANUAL
3.9
Graphical User Interface Management System
Institute for Energy Technology
OECD Halden Reactor Project
This document will be subjected to revisions in the future as the development of
ProcSee continues. New versions will be issued at new releases of the ProcSee system.
The information in this document is subject to change without notice and should not be construed as a commitment by Institute for Energy Technology.
Institute for Energy Technology, OECD Halden Reactor Project, assumes no responsibility for any errors that
may appear in this document.
Published by
: Institute for Energy Technology, OECD Halden Reactor Project
Date
: June 2014
Revision
: 3.9
PROCSEE
DOCUMENTATION
Table of Contents
Installation .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
Before starting ProcSee . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Requirements . . . . . . . . . . . . . . . . . . . .
Differences between UNIX and Windows version
Installation from CD-ROM . . . . . . . . . . . . .
User Environment . . . . . . . . . . . . . . . . .
The Services Database . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
3
4
5
7
7
Related Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
ProcSee Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Software Bus Documentation . . . . . . . . . . . . . . . . . . . . . . . . . 9
ProcSee Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Languages and File Formats
. . . . . . . . . . . . . . . . . . . . . . . . . 13
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
pTALK Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Keywords . . . . . . . . .
Comments . . . . . . . .
Identifiers . . . . . . . . .
Literals . . . . . . . . . .
Expressions . . . . . . . .
Primary Expressions . . .
Postfix Expressions . . . .
Unary Operators . . . . .
Explicit Type Conversion
Multiplicative Operators .
Additive Operators . . . .
Shift Operators . . . . . .
Relational Operators . . .
Equality Operators . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
ProcSee Reference Manual
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
17
18
18
18
20
20
20
22
23
23
24
24
24
25
i
Bitwise Operators . . . . . . . . . .
Logical Operators . . . . . . . . . .
Conditional Operator . . . . . . . .
Assignment Operators . . . . . . .
Lookup Operator . . . . . . . . . .
Comma Operator . . . . . . . . . .
Operator Precedence and Grouping.
Statements. . . . . . . . . . . . . .
Labeled Statement . . . . . . . . .
Expression Statement . . . . . . . .
Compound Statement . . . . . . . .
Selection Statements . . . . . . . .
Iteration Statements . . . . . . . . .
Jump Statements . . . . . . . . . .
Declaration Statement . . . . . . .
Declarations. . . . . . . . . . . . .
Function Definitions . . . . . . . .
Constructors and Destructors . . . .
What is code? . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
25
25
26
26
27
27
28
29
29
29
29
30
31
32
32
32
35
37
37
The Configuration Language . . . . . . . . . . . . . . . . . . . . . . . . 39
Introduction . .
Comments. . .
Identifiers . . .
Literals . . . .
pTALK Code .
Values . . . . .
Assignments .
Libraries. . . .
Processes . . .
Windows . . .
Display . . . .
Layers . . . . .
Colours . . . .
Patterns . . . .
Fonts . . . . .
Cursors . . . .
Line Styles . .
ResourceStyles
Attributes . . .
Functions . . .
Dialogues . . .
Enums . . . . .
Classes . . . .
Pictures . . . .
Groups . . . .
Instances . . .
Shapes. . . . .
Circles. . . . .
ii
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
ProcSee Reference Manual
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
39
40
41
41
42
43
43
46
47
48
49
50
52
54
56
56
58
59
59
61
62
63
64
68
70
72
74
76
Circle Arcs and Slices . . . . . .
Dialogue Areas . . . . . . . . . .
Ellipses . . . . . . . . . . . . . .
Ellipse Arcs . . . . . . . . . . . .
Images . . . . . . . . . . . . . .
Lines . . . . . . . . . . . . . . .
Polygons . . . . . . . . . . . . .
Rectangles . . . . . . . . . . . .
RoundRects . . . . . . . . . . . .
Text . . . . . . . . . . . . . . . .
Scales . . . . . . . . . . . . . . .
Trend . . . . . . . . . . . . . . .
Internal Trend Log . . . . . . . .
External Trend Log . . . . . . . .
Trend Variable Configuration File
COM Configuration . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 77
. 78
. 79
. 81
. 81
. 83
. 85
. 87
. 88
. 89
. 90
. 92
. 99
.101
.103
. 106
The ProcSee database file format (.pdat) . . . . . . . . . . . . . . . . . 111
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
The database file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114
Windows to UNIX mapping file . . . . . . . . . . . . . . . . . . . . . . 119
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120
Manual pages .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
ProcSee Executables Manual pages . . . . . . . . . . . . . . . . . . . . 123
control - a server for service management. . . . . . . . . . . .
controlutil - a utility program for sending messages to control.
Execute - A ProcSee utility to remotely execute pTALK code.
ged - The ProcSee editor. . . . . . . . . . . . . . . . . . . . .
p3sim - create small test applications . . . . . . . . . . . . . .
p3simTalk - send commands to p3sim . . . . . . . . . . . . .
pcc - The ProcSee configuration language compiler . . . . . .
rtm - The ProcSee Run-Time Manager . . . . . . . . . . . . .
Timer - a ProcSee cron(1M)/at(1) utility . . . . . . . . . . . .
TrPrint - The ProcSee trend print program . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
125
127
129
130
134
134
145
149
154
156
Application Programmers Interface Manual pages . . . . . . . . . . 159
apilib - ProcSee Application Programmer’s Interface . . . . . . . . . . . 161
ENVIRONMENT VARIABLES . . . . . . . . . . . . . . . . . . . . . . 161
COMPILING AND LINKING . . . . . . . . . . . . . . . . . . . . . . . 161
Windows - Microsoft Visual Studio . . . . . . . . . . . . . . . . . . . . . 162
Windows - Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Unix including Linux and Mac . . . . . . . . . . . . . . . . . . . . . . . . 167
API EXAMPLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
ProcSee Reference Manual
iii
List of Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .285
Standard pTALK Functions Manual pages . . . . . . . . . . . . . . .287
List of Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .501
APPENDIX A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .509
Example Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .509
Example Colours . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .510
Example Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .511
APPENDIX B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .513
Example Classes
Example Classes
Example Classes
Example Classes
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.513
.514
.515
.516
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I
iv
ProcSee Reference Manual
PART
1
Installation
1
2
ProcSee Reference Manual
Before starting ProcSee
Requirements
Before starting ProcSee
This chapter describes the system requirements, the differences between
the UNIX and the Windows NT version of ProcSee and the installation
procedure.
Requirements
The following table is a list of the platforms ProcSee supports and the operating systems needed in order to run the system.
Platform
Arch
Operating system
Sun workstations (Sun SPARC) sunArch
Solaris 7, SunOS 5.7
Hewlett Packard workstations
(HP 9000/700)
hpArch
HP-UX 11
Apple Mac with Intel processor
macX86Arch
Mac OS X 10.6
Personal Computers,
x86 Compatible
linuxX86Arch
Linux 2.6 (Ubuntu 10.04)
winArch
Windows 7, Vista, XP
If only one architecture of the ProcSee system is installed, the hard disk
space needed is approximately 100 Mb and an additional of 25 Mb is needed if another architecture is installed.
For the linux and mac installations, additional libraries may be needed on
the computer, especially the OpenMotif run-time library is needed to be
able to run the Graphics Editor. These can normally be downloaded from
the internet and installed using the systems package manager.
ProcSee Reference Manual
3
Before starting ProcSee
Differences between UNIX and Windows version
Differences between UNIX and Windows version
ProcSee was originally developed on UNIX platforms running X-Windows. As the market for Microsoft Windows more and more became a central part in modern control room activity in the late 90’s the ProcSee system
was ported to this architecture as well.
However, UNIX and Windows are two completely different systems
which imply certain incompatibility. This chapter will focus on these differences. Despite this, the main functionality in ProcSee is remarkably
equal regardless of architectures.
The X-Windows version of ProcSee offers functionality to display pictures
on 16 different displays. This is the nature of the X-Windows protocol
which is run on UNIX and linux platforms. The Windows version supports
one display only, but has functionality which makes it possible to display
pictures on more than one screen. This is done by setting the coordinates
of the windows accordingly.
The utility program p3simTalk is not available on the Windows platform.
The utility program P3RegAdmin.exe (for setting up the ProcSee file
types) is only available on the Windows platform (2000 and XP).
On Windows the new graphics editor GED supports editing of several pictures or classes simultaneously.
The API function PfAddInput with the first argument set to the value
PfCKeyboardFd is not available on Windows platforms. The API’s main
loop waits in the select(2) system call. This function accepts file descriptors on UNIX platforms and SOCKETs on Windows platforms. Standard
input is a file descriptor on UNIX but it is not available on Windows as a
SOCKET.
All examples throughout the entire documentation where environment variables are referred uses the UNIX style format. When the UNIX style is
used the character $ is used in front of the environment variable. To access
the same environment variable on Windows platforms another syntax is
used, where the character % surrounds the variable. The variable ARCH,
which is used by ProcSee, can be written as $ARCH on a UNIX platform
or as %ARCH% on Windows. Note that some programs running on Windows platforms accepts the UNIX way of accessing environment variables.
The pTALK function system() accepts environment variables only on the
UNIX style format. See the paragraph above for more information about
the differences between UNIX and Windows environment variables.
It is recommended that UNIX file names is used as arguments to pTALK
functions accepting file names or directories (internally in ProcSee UNIX
file names are also referred to as normal files). Normal files uses the ’/’ to
separate directories instead of the ’\\’. When Windows file names are used
it is very easy to forget to add the extra ’\’ when entering file names or di-
4
ProcSee Reference Manual
Before starting ProcSee
Installation from CD-ROM
rectories. ProcSee has functionality to convert Windows file names to normal file names. Refer to the pTALK functions fileNameHost(),
fileNameNormal(), strquote() and strunquote().
The libraries distributed with ProcSee are delivered in optimized and debug versions. The naming convention used on UNIX platforms is, <alib>.a for an optimized library and <alib>_debug.a for a debug version.
On the Windows platforms the libraries are compiled with different compiler options producing six different libraries. The following naming convention is used.
• ML - single threaded (default compiler option).
• MD - multi threaded DLL.
• MT - multi threaded version of the run time library.
If it is followed by a lowercase d it means that it is a debug version of the
library.
The naming conventions are the same as the options used when compiling
the libraries. For more information about the compiler options see Microsoft Visual C++ on-line help (/MT, /MD, /ML and the debug options /
MTd, /MDd, /MLd).
The libraries distributed with ProcSee have been compiled with Microsoft
Visual C++ 6, 8 (=Visual Studio 2005), 9 (=Visual Studio 2008), and 10
(=Visual Studio 2010). We can make no warranty that these libraries will
work if they are linked with a compiler from another vendor. But if the
compiler used is compatible with Microsoft Visual C++ there should not
be any problem using the libraries delivered with ProcSee.
Installation from CD-ROM
The cd-rom contains the entire distribution of the ProcSee system for all
platforms.
Unix/Linux installation
The ProcSee file hierarchy should be placed on a disk at a suitable location.
The environment variable PROCSEE_DIR must be set to a directory
where to install the ProcSee system. The following example will step by
step explain how this installation can be done.
First, find a directory where to install ProcSee. If it does not exist, create it
(this example uses /usr/local/procsee as the install directory). The syntax
of environment variable assignment depends on the shell which is used. In
the example below, Bourne Shell sh(1) syntax is used.
> PROCSEE_DIR=/usr/local/procsee
> export PROCSEE_DIR
> mkdir $PROCSEE_DIR
ProcSee Reference Manual
5
Before starting ProcSee
Installation from CD-ROM
After the cd has been mounted, go to the directory procsee on the cd-rom,
and run the install.sh script. This script copies the files from the cdrom to
the PROCSEE_DIR location.
> cd /cdrom/procsee
> install.sh
After the script has copied the files the services database have to be updated and environment variables must be set. How this is done is explained
later in this chapter.
The install.sh script accepts the architectures to install as arguments. Running this script without options will install the architecture of the machine
running the script. To install all architectures, run the script with the option
’all’.
E.g.: to install ProcSee for HP and Sun, run:
> install.sh hpArch sunArch
To install all supported UNIX architectures run:
> install.sh all
Windows installation
To begin the installation insert the CD into the CD-ROM drive. If the autorun feature is enabled in Windows the installation will start automatically,
otherwise start the installation by running startup.exe located on the CDROM. If ProcSee is downloaded from the web or the ftp-server, run the setup.exe.
The installation program extracts all the files and start the installation automatically. The first dialogue displayed is the welcome screen, see the figure below. Follow the instructions to install ProcSee.
6
ProcSee Reference Manual
Before starting ProcSee
User Environment
User Environment
Before running ProcSee, several environment variables have to be set. This
applies to both UNIX and Windows platforms. When using the installation
on Windows these environment variables are set automatically. Use the
utility program p3regadmin to modify the environment variables after
completing the installation. On UNIX platforms the environment variables
must be set in a configuration file, e.g. .profile, .login, etc, or globally for
all users.
The following environment variables must be set:
PROCSEE_DIR
The location of the ProcSee files.
ARCH
The architecture of the computer.
At the moment the following values of ARCH are available:
hpArch, sunArch, macX86Arch, linuxX86Arch and winArch.
This variable should be set in a script that is run by the unix shell at startup (on each login and each rlogin and remsh command).
CONTROLHOST
The computer where CONTROL is running.
BUSTIMEOUT
The number of milli-seconds for SWBus messages to wait for response.
The default value is 30 seconds.
PATH
add $PROCSEE_DIR/bin/$ARCH to the path.
The X resources that can be set are listed on the man pages for RTM and
GED.
The Services Database
The communication system (SWBus) used by the ProcSee API expects
some entries found in the /etc/services file on UNIX and in the <windir>\system32\drivers\etc\services file on Windows. On Windows the installer program adds these entries. On Unix/Linux, these entries have to be
added manually.
One entry for the control server and two entries defining a range of ports
available for SWBus applications. The control program uses an entry
called "softbus_name". The other two entries are "comix_minfreeport" and
"comix_maxfreeport". The range between these two entries must be large
enough to cover all processes utilizing the SWBus as a communication
protocol (that is, ProcSee application programs as well as the ProcSee executables). If these services are not present in the services file, the default
values shown below will be used. The system administrator can add these
entries to the /etc/services file. The following example illustrates a services
file where the entries used by the SWBus are added:
softbus_name
17000/tcp
comix_minfreeport
17100/tcp
comix_maxfreeport
17499/tcp
ProcSee Reference Manual
7
Before starting ProcSee
8
The Services Database
ProcSee Reference Manual
Related Documents
ProcSee Documentation
Related Documents
This chapter lists the related ProcSee user documentation.
ProcSee Documentation
The ProcSee Tutorial - a brief introduction to the ProcSee system. The tutorial contains detailed examples of how to build a complete application,
including a small simulator program.
The ProcSee User’s Guide - a comprehensive guide to defining user interfaces in the ProcSee system.
Software Bus Documentation
The Software Bus Reference Manual - a detailed reference to the communication functions provided by the Software Bus.
The Software Bus User’s Guide - a description of how the functionality of
the Software Bus should be used.
ProcSee Reference Manual
9
Related Documents
10
Software Bus Documentation
ProcSee Reference Manual
ProcSee Release Notes
ProcSee Release Notes
The Release Notes document contains last minute updates, and is therefore
not included in this manual. The document is included in the ProcSee distribution, in the text file doc/ReleaseNotes.
11
ProcSee Release Notes
12
ProcSee Reference Manual
PART
2
Languages and File
Formats
13
14
ProcSee Reference Manual
Introduction
Introduction
This chapter briefly describes the two languages used in the ProcSee
system.
The ProcSee system uses two programming languages:
• pTALK
• The ProcSee Configuration Language
pTALK
pTALK is used to express dynamic behaviour in the user interface. The
language is based on C/C++ constructs, and support definition of functions.
If a graphic element is connected to data in an application program, e.g.
MyRectangle.foregroundColour = �MyProgram.state�;
pTALK source code
this is expressed in pTALK. pTALK code is compiled by the pTALK compiler included in the rtm(1), and executed by the virtual machine in rtm(1).
15
Introduction
The ProcSee Configuration Language
The ProcSee Configuration Language is the document format (human
readable) of the graphic user interfaces created in ProcSee. An example of
the configuration language code is given below:
function `void MyFunc()
{
MyVar = 0;
MyAttribute = 0;
update();
}`
rectangle MyRectangle
{
x = 276;
y = 135;
width = 78;
height = 6;
pTALK code enclosed
in � �.
configuration
language
visibility = 1;
foregroundFillColour = 20;
backgroundFillColour = -1;
foregroundColour = 20;
backgroundColour = -1;
lineWidth = 2;
linePattern = 1;
fillPattern = 1;
Since the configuration language describes all of the user interface,
pTALK code is also contained in a configuration language document. This
is indicated by the backquotes �<pTALK code>�. (The backquote is the
character with ASCII code 96, found above the TAB key on US-keyboards.) Note however that the pTALK syntax is not part of the configuration language.
A configuration language document (often referred to as Tdoc format) is
compiled to binary format using the pcc(1) program. The pcc program
checks the syntax of the configuration language document, but pcc does
not check the syntax of the pTALK code.
16
ProcSee Reference Manual
pTALK Reference
Keywords
pTALK Reference
The ProcSee pTALK language will be a subset of ANSI C, with some
additional constructs from C++. Where the language definition differs
from C/C++, this is marked in the text.
Keywords
The table below shows the reserved keywords in the pTALK language. All
AT&T C++ 2.0 keywords are reserved, and some keywords in the configuration language (marked with ††) are also reserved in the pTALK language. Keywords specific to ProcSee are marked with †††. Those marked
with †are C++ keywords reserved for future use.
any †††asm †attribute ††auto †break
case
catch †char
class ††const †continue
database ††default
delete †dialogue ††do
double
dynamic ††else
enum †extern †float
for
friend †function ††goto †if
inline †int
long †new †operator †plugin ††private †protected †public †register †return
short
signed
sizeof †statement ††static †struct †switch
template †this †throw †try †typedef †union †unsigned
use ††virtual †void
volatile †while
17
pTALK Reference
Comments
Comments
pTALK accepts comments in both C style and C++ style:
1) The characters /* start a comment, which terminates with the characters
*/. The comment may span several lines.
2) The characters // start a comment, which terminates at the end of the
line on which they occur.
Comments cannot be nested, but the two kinds of comments can be used to
comment each other out.
Identifiers
An identifier is a sequence of letters and digits. The first character must be
a letter; the underscore _ counts as a letter. Identifiers are case-sensitive.
Identifiers longer than 31 characters are truncated by the lexical analyser.
Reserved keywords are not legal identifiers.
To make it possible to handle variables with special names, identifier can
also be a string of any characters surrounded by ’$’ characters. To include
a ’$’ character in such a name, it must be escaped with a back-slash ’\$’.
Backslash in the name is written as ’\\’. The variable with the special name
’34-XYZ 1290’ has to be written as $34-XYZ 1290$ in the pTALK code
because it starts with a digit, and contains a ’-’ and a ’ ’ (space) character.
A more extreme case: �0-$s\q� becomes: $0-\$s\\q$.
Literals
literal:
integer-constant
character-constant
floating-constant
string-literal
There are four kinds of literals, also called constants.
Integer Constants
An integer constant consisting of a sequence of digits is taken to be decimal base, unless it begins with 0, which is taken to be octal base. The digits
8 and 9 are not legal octal digits. A sequence of digits preceded by 0x or
0X is taken to be a hexadecimal integer. The hexadecimal digits include a
or A through f or F. A sequence of digits preceded by 0b or 0B is taken to
be a binary integer. Only 0 and 1 are legal binary digits. A sequence of digits preceded by 0o or 0O explicitly indicates octal base, and a sequence of
digits preceded by 0d or 0D explicitly indicates decimal base1. Constants
1. The 0b, 0B, 0o, 0O, 0d, and 0D prefixes are not defined in C/C++
18
ProcSee Reference Manual
pTALK Reference
Literals
may have any number of separators (_) in any position except as the first
character or within the prefix. Separators are allowed purely for readability
and are ignored1.
An integer constant is of type int if it can be represented by a 32 bit signed
integer, otherwise the constant is of type unsigned int (if the value is larger
than or equal to 0x80000000).
Integer constants can be suffixed with the following letters: L or l for long,
U or u for unsigned, and s, S, h, or H for short2. This makes it possible to
create integer constants of type short or unsigned short.
The following are all integer constants:
2134
054
0xf02c 0XABC 0
0b1101110 0D__2_134 0o54 0b_1101_0110_0011
100_000u 123s
198us
Character Constants
A character constant is a character enclosed in single quotes. Some characters have special meanings when preceded by a backslash, and some
characters must be preceded by a backslash. These escape sequences are
listed in the table below.
new-line
horizontal tab
form feed
backslash
single quote
back quote
double quote
octal number
hexadecimal number
NL (LF)
HT
FF
\
’
�
"
ooo
hh
\n
\t
\f
\\
\’
\�
\"
\ooo
\xhh
The escape \ooo consists of a backslash followed by one, two, or three octal
digits that are taken to specify the value of the desired character. The escape \xhh consists of a backslash followed by the letter x, followed by one
or two hexadecimal digits. The following are all character constants:
’n’ ’\n’ ’\\’ ’\’’ ’\"’ ’\0’ ’\245’ ’\x41’
A character constant is of type unsigned char.
1. Underscore as separator is inspired from ADA and is not allowed in C/C++
2. The s, S, h, and H suffixes are not defined in C/C++
ProcSee Reference Manual
19
pTALK Reference
Expressions
Floating Constants
A floating constant consist of an integer part, a decimal point, a fraction
part, an e or E, and an optionally signed integer exponent. Either the integer part or the fraction part (not both) may be missing; either the decimal
point or the letter e (or E) and the exponent (not both) may be missing. An
optional f or F suffix may also be added. The following are all floating constants:
2.0 2. .2 0.2e2 .2E-2 20e2 12.34f
A floating constant is of type double.
String Literals
A string literal is a sequence of characters enclosed in double quotes. Escape sequences are supported as for character constants. All string literals
are implicitly terminated by a ’\0’ character. The following are all string
constants:
"Hello world\n" "A\tB\tC" "I\’m \"cute\""
A string literal is of type char*. Multi-line strings are not supported.
Expressions
All expressions have a value and a type. The type may however be void, in
which case the value is undefined. An expression can also be an lvalue,
which means that the result refers to the location of some modifiable object
in memory.
The different kinds of expressions are presented in order of decreasing
precedence.
Primary Expressions
primary-expression:
literal
( expression )
identifier
:: identifier
The type and value of a primary expression is the type and value of the literal, identifier, or the expression enclosed in the parentheses. The primary
expression is an lvalue if the identifier or the enclosed expression is.
The scope resolution operator :: followed by an identifier indicates a global
identifier, i.e. an identifier that is not part of an application.
Postfix Expressions
Postfix expressions group left-to-right.
20
ProcSee Reference Manual
pTALK Reference
Postfix Expressions
postfix-expression:
primary-expression
postfix-expression [ expression ]
postfix-expression ( expression-listopt )
postfix-expression . identifier
postfix-expression -> identifier
postfix-expression ++
postfix-expression -expression-list:
lookup-expression
expression-list , lookup-expression
Array Subscripts
A postfix expression followed by an expression enclosed in square brackets
is a postfix expression indicating an array subscript. One of the expressions
must have the type "pointer to T", and the other must be of integral type.
The type of the result is "T". The expression E1[E2] is by definition equal
to *((E1)+(E2)), and it follows that E1[E2] is equal to E2[E1]. An array
subscript is an lvalue. A couple of examples follows:
names[10] 10[names] panel.switches[i+4]
Array bounds are checked at compile-time if the left operand is an array
whose size is known. Array bounds are always checked at run-time since
the actual size of the object pointed to by the left operand is then known. If
the left operand is a null pointer a run-time error will also occur.
Function Calls
A postfix expression followed by an optional expression list enclosed in
parentheses is a function call. The postfix expression must be of type
"function returning T", and the result is of type "T". When a function is
called, each formal argument is initialized with its actual argument, standard conversions are used to match types. The order of evaluation of arguments are undefined. A function call is an lvalue if the result type is a
reference. A couple of examples follows:
display() valve.close( 10, i )
Object Member Access
A postfix expression followed by a dot (.) or arrow (->) followed by an
identifier is a postfix expression1. The first expression must be a class object or a pointer to a class object, and the identifier must be a member of
that class. The result is the member of the object, and it is an lvalue if the
member is. Some examples follows:
valve.state startup->menu.quitButton
Class objects can in pTALK be almost any user interface component, i.e.
pictures, applications, windows, record variables, instances, shapes, colours, and fonts.
1. Unlike C/C++, the left operand of a dot operator might be a pointer, and the left operand of an arrow operator might
be an object. The two operators have identical behaviour.
ProcSee Reference Manual
21
pTALK Reference
Unary Operators
If the left operand is a null pointer, a run-time error occurs.
Increment and Decrement
A postfix expression followed by the ++ or -- operator is a postfix expression. The operand must be an lvalue and of arithmetic type or a pointer
type. The type and value of the expression is the type and value of the operand, and after the result is noted, the operand is incremented (or decremented) by 1. The result is not an lvalue.
Unary Operators
Expressions with unary operators group right-to-left.
unary-expression:
postfix-expression
++ unary-expression
-- unary-expression
unary-operator cast-expression
unary-operator: one of
* & - ! ~ @
Increment and Decrement
One of the operators ++ or -- followed by an unary expression is an unary
expression. The operand must be an lvalue of arithmetical type or a pointer
type. The operand is incremented (or decremented) by 1, and the result is
the new value of the operand, which is an lvalue.
The Unary * Operator
The unary * operator means indirection. The expression must be of type
"pointer to T", and the result is an lvalue referring to the object pointed to
by the operand. The type of the result is "T". If the operand is a null pointer,
a run-time error occurs
The Unary & Operator
The result of the unary & operator is a pointer to its operand. The operand
must be an lvalue, and if the operand is of type "T", the result is of type
"pointer to T".
The Unary - Operator
The unary - operator must have an arithmetic operand, and the result is the
negation of the operand.
The Logical NOT Operator
The unary ! operator must have an operand whose type is arithmetic or
pointer. The result is 1 if the value of its operand is 0, and 0 if the value of
its operand is nonzero. The result is of type int.
22
ProcSee Reference Manual
pTALK Reference
Explicit Type Conversion
The Bitwise NOT Operator
The operand of the unary ~ operator must be of integral type, and the result
is the bitwise complement of the operand. The type of the result is the type
of the operand.
The Dynamics Operator1
The operand of the unary @ operator must be an lvalue of an attribute, and
the result is a pointer to a string containing the source code of the dynamic
definition; or an empty string, "", if the attribute is not dynamic2. The type
of the result is char[].
{ char* dynString = @ valve5.state; .... }
Explicit Type Conversion
cast-expression:
unary-expression
( type-name ) cast-expression
Cast expression group right-to-left. The cast notation is used to explicitly
convert the operand expression to the type enclosed in parentheses. If the
type is arithmetic (char, int, float...) the operand is converted to the given
type. For all other types the type of the operand is checked against the type
given, and 0 is returned if the types are incompatible, the value is returned
unaltered if the types are compatible. This runtime type check can be used
in e.g. if tests to have different code for different types.
Examples:
float a = 3.14;
int b = (int)a;
MyClass* p = (MyClass*)instPtr;
if (p) p.func();
Multiplicative Operators
multiplicative-expression:
cast-expression
multiplicative-expression * cast-expression
multiplicative-expression / cast-expression
multiplicative-expression % cast-expression
1. The @ operator is not defined in C/C++
2. The result of the dynamics operator when the attribute is not dynamic, can be changed from "" to NULL in the future.
Please test both cases, like:
{ char* d = @attr; if ( !d || !*d ) { printf("No dynamics"); } else { printf("Dynamics: %s", d ); } }
ProcSee Reference Manual
23
pTALK Reference
Additive Operators
The operators *, /, and % group left-to-right. The operands of * and / must
have arithmetic type; the operands of % must have integral type. Division
by zero generates a run-time error.
Additive Operators
additive-expression:
multiplicative-expression
additive-expression + multiplicative-expression
additive-expression - multiplicative-expression
The additive operators + and - group left-to-right. The operands must be of
arithmetic or pointer type.
A pointer to an object and a value n of any integral type may be added. The
result is a pointer of the same type as the operand, pointing n objects beyond the object pointed to by the operand. The - operator works the same
way in the sense that an integral value may be subtracted from a pointer to
indicate a negative offset. Adding two pointers has no meaning and is thus
prohibited.
Two pointers to objects of the same type may be subtracted; the result is an
int representing the offset between the two objects.
Pointer arithmetic should only be performed on objects being part of the
same array.
Shift Operators
shift-expression:
additive-expression
shift-expression << additive-expression
shift-expression >> additive-expression
The shift operators << (shift left) and >> (shift right) group left-to-right.
The operands must be of integral type, and the type of the result is the same
as the left operand’s type.
The operators shift the bits of the left operand a number of positions to the
left (<<) or right (>>) given by the right operand. 0-filling is used to fill
vacant positions. The result is undefined if the right operand is negative.
Relational Operators
relational-expression:
shift-expression
relational-expression < shift-expression
relational-expression > shift-expression
relational-expression <= shift-expression
relational-expression >= shift-expression
24
ProcSee Reference Manual
pTALK Reference
Equality Operators
The relational operators < (less than), > (greater than), <= (less than or
equal to), and >= (greater than or equal to) group left-to-right, but grouping
them does not normally give useful constructs in the first place.
The operands must be of arithmetic or pointer type. The type of the result
is int, and the result is 1 if the given relational expression evaluates to true,
0 otherwise.
Pointers of the same type may be compared, and any pointer may be compared to a constant expression of value 0. Any pointer may be compared to
a pointer of type void*.
Equality Operators
equality-expression:
relational-expression
equality-expression == relational-expression
equality-expression != relational-expression
The equality operators == (equal to) and != (not equal to) behave exactly
like the relational operators except for their lower precedence.
Bitwise Operators
and-expression:
equality-expression
and-expression & equality-expression
exclusive-or-expression:
and-expression
exclusive-or-expression ^ and-expression
inclusive-or-expression:
exclusive-or-expression
inclusive-or-expression | exclusive-or-expression
The bitwise operators & (bitwise AND), ^ (bitwise exclusive OR), and |
(bitwise inclusive OR) apply only to integral operands.
Logical Operators
logical-and-expression:
inclusive-or-expression
logical-and-expression && inclusive-or-expression
logical-or-expression:
logical-and-expression
logical-or-expression || logical-and-expression
The logical operators && (AND), and || (OR) group left-to-right. The result is 1 if the expression evaluates to true, 0 otherwise. Short circuit evaluation is used, i.e. the right operand is not evaluated if the left operand
evaluates to 0 (AND) or 1 (OR). The type of the result is int.
ProcSee Reference Manual
25
pTALK Reference
Conditional Operator
Conditional Operator
conditional-expression:
logical-or-expression
logical-or-expression ? expression : conditional-expression
Conditional expressions group right-to-left. The first expression must have
arithmetic or pointer type. If it evaluates to a nonzero value, the result of
the conditional expression is taken to be the result of the second expression, otherwise the result is taken to be that of the third expression. The second and third expressions must be of the same type1, and the result is an
lvalue if the second and third operands are both lvalues.
Assignment Operators
assignment-expression:
conditional-expression
unary-expression assignment-operator assignment-expression
assignment-operator: one of
= := *= /= %= += -= >>= <<= &= ^= |=
Assignment operators group right-to-left. The left operand must be an lvalue. The result of an assignment expression is the value of the left operand
after the assignment has taken place. The type of the result is that of the left
operand, and it is an lvalue.
The = operator assigns the value of the right operand to the object given by
the left operand.
The := operator2 performs dynamic assignment. The value of the right operand must be a character string, i.e. of type char[], and the left operand is
made dynamic using the right operand as source code for the dynamic connection.
valve5.state := "2.3 * simulator.v5.s - 1.0";
The character array aDynExpr is assigned the string "MyVar * 5.1"
char[20] aDynExpr = "MyVar * 5.1";
The content of the string aDynExpr is copied into valve5.state as a dynamic
dependency
valve5.state := aDynExpr;
If aDynExpr is assigned a new value, valve5.state is still dynamically connected to "MyVar * 5.1"
strcpy( aDynExpr, "YourVar * 1.1 " );
1. C/C++ allows the second and third expression to be of different types.
2. The := dynamic assignment operator is not defined in C/C++.
26
ProcSee Reference Manual
pTALK Reference
Lookup Operator
The other assignment operators are of the form op=, and the expression E1
op= E2 is equal to E1 = E1 op (E2), except that E1 is evaluated only once.
Lookup Operator1
lookup-expression:
assignment-expression
complete-class-name @ assignment-expression
The lookup operator groups right-to-left. The left operand is a user defined
or predefined class name T2. The right operand must be of type char[], and
it is interpreted as the name of an object of type T. The result of the expression is a pointer to this object, or NULL if the object does not exist. The
type of the result is pointer to T.
Colour @ "sapri.red"
(Picture@::sim.currentPicture)->iconify()
Comma Operator
expression:
lookup-expression
expression , lookup-expression
The comma operator groups left-to-right. Two expressions separated by a
comma are evaluated from left to right, and the result of the expression is
taken to be the type and value of the right operand. The result is an lvalue
if the right operand is.
1. The @ lookup operator is not defined in C/C++.
2. See section "Declarations" on page 32 for a description of these types.
ProcSee Reference Manual
27
pTALK Reference
Operator Precedence and Grouping
Operator Precedence and Grouping
The table below shows all operators in order of decreasing precedence. R
in the left most column means right-to-left associatively, L means left-toright associatively. The number specifies the precedence level; higher
numbers means higher precedences.
Level
28
Operator
Function
18R
::
scope resolution
17L
17L
17L
17L
-> .
[]
()
++ --
member selectors
array index
function call
postfix increment and decrement
16R
16R
16R
16R
16R
16R
++ -~
!
* &
@
unary increment and decrement
bitwise NOT
logical NOT
unary minus
dereference and address-of
get dynamics
15R
()
14L
* / %
13L
+ -
12L
<< >>
11L
< <= > >=
10L
== !=
9L
&
bitwise AND
8L
^
bitwise XOR
7L
|
bitwise OR
6L
&&
logical AND
5L
||
4R
? :
3R
3R
3R
= *= /= %=
+= -= <<= >>=
&= |= ^= :=
2R
@
lookup operator
1L
,
comma operator
type conversion (cast)
multiplicative operators
arithmetic operators
bitwise shift
relational operators
equality operators
logical OR
arithmetic if
assignment operators
ProcSee Reference Manual
pTALK Reference
Statements
Statements
statement:
labeled-statement
expression-statement
compound-statement
selection-statement
iteration-statement
jump-statement
declaration-statement
Labeled Statement
labeled-statement:
case constant-expression : statement
case [ constant-expression , constant-expression ] : statement
default : statement
Case labels and default labels may occur only in switch statements. The
variant with one expression is called a simple case or just a case. The variant with two expressions is called an interval case1, and the last form is
called a default case. The behaviour is discussed in section "Selection
Statements" on page 30.
Expression Statement
expression-statement:
expressionopt ;
An expression statement is simply any legal expression followed by a semicolon. The expression may be omitted, in which case the statement is
called a null statement.
Compound Statement
compound-statement:
{ statement-listopt }
statement-list:
statement
statement-list statement
A compound statement, also called a block, is a list of statements enclosed
in curly braces.
1. Interval case statements are not defined in C/C++
ProcSee Reference Manual
29
pTALK Reference
Selection Statements
Selection Statements
selection-statement:
switch ( expression ) switch-body
if ( expression ) statement else-clauseopt
else-clause:
else statement
switch-body:
statement
switch-operator compound-statement
switch-operator: one of
== != < <= > >= & | ^
The switch Statement
The switch expression can at the most be of arithmetic type, but is still limited by the type permitted by the switch operator, if any. Any statement
within the switch statement may be labeled with one or more case using
one of the following forms1:
case constant-expression :
case [ constant-expression , constant-expression ] :
There may be at most one label of the form
default :
within a switch statement.
Switch statements may be nested; a case or default label is associated with
the smallest switch enclosing it.
When the switch statement is executed, its expression is evaluated and
tried against each case. If one of the cases produces a match, control is
passed to the statement following the matched case label. If no cases produces a match, and if there is a default label, control passes to the statement
labeled by the default label, if no default label exists, none of the statements in the switch are executed.
The value V of the switch expression is tried against a simple case expression E by applying the switch operator, or the == operator if no switch operator is given2:
V switch-operator E
/*or == if switch-operator isn’t given*/
The value V of the switch expression is tried against an interval case
[E1,E2] by evaluating
V >= E1 && V <= E2
A match is defined as the expression returning true, i.e. non-zero.
1. The interval case construct is not defined in C/C++.
2. The switch operator construct is not defined in C/C++.
30
ProcSee Reference Manual
pTALK Reference
Iteration Statements
Case expressions can also be of arithmetic type1 but is still limited by the
type permitted by the switch operator, if any.
To exit from a switch, see section "Jump Statements" on page 32.
The if Statement
The if-expression must be of arithmetic or pointer type. If the expression
evaluates to nonzero the first substatement is executed. If the expression
evaluates to zero the last substatement is executed if it exists.
The ’dangling else’ ambiguity is resolved by connecting an else with the
last encountered else-less if.
Iteration Statements
iteration-statement:
while ( expression ) statement
do statement while ( expression ) ;
for ( for-init-statement expressionopt ; expressionopt ) statement
for-init-statement:
expression-statement
declaration-statement
The while Statement
The substatement is executed repeatedly, but only as long as the expression
does not evaluate to zero. The expression, which must be of arithmetic or
pointer type is evaluated before each execution of the substatement.
The do Statement
The substatement is executed repeatedly until the expression evaluates to
zero. The expression, which must be of arithmetic or pointer type, is evaluated after each execution of the substatement.
The for Statement
The for-init-statement, which may be an expression statement or a declaration statement, is executed first, and only once. Then the last substatement and the second expression is executed repeatedly as long as the first
expression evaluates to nonzero. The first expression is evaluated before
each iteration.
The first expression must have arithmetic or pointer type, and if it is omitted, the value 1 is used for all iterations, creating an infinite loop.
If the for-init-statement is a declaration statement, the scope of the declarations extends to the end of the scope enclosing the for-statement.
1. Arithmetic switch and case expressions are not allowed in C/C++.
ProcSee Reference Manual
31
pTALK Reference
Jump Statements
Jump Statements1
jump-statement:
break ;
continue ;
return expressionopt ;
The break Statement
The break statement may only occur within an iteration-statement or a
switch-statement, in which case the iteration- or switch-statement is terminated and control is transferred to the statement following the iteration- or
switch-statement.
The continue Statement
The continue statement may only occur within an iteration-statement, in
which case the control is transferred to the enclosing statement’s loop control expression.
The return Statement
The return statement causes the function in which it occurs to return control to its caller. If the function is of type void, the expression must be omitted; if the function is not of type void, the expression must be included, and
be of the same type as the function.
Declaration Statement
declaration-statement:
declaration
The declaration statement introduces one or more identifiers in the scope
(block) enclosing the declaration statement. Declarations will be covered
in the following.
Declarations
declaration:
decl-specifiers declarator-list ;
attribute-definition:
decl-specifiers declarator initializeropt ;
decl-specifiers:
decl-specifier
decl-specifiers decl-specifier
decl-specifier:
type-specifier
1. The goto statement as defined in C/C++ is not allowed.
32
ProcSee Reference Manual
pTALK Reference
Declarations
type-specifier:
simple-type-name
class-name
simple-type-name:
char
short
int
long
signed
unsigned
float
double
void
any
class-name:
identifier
declarator-list:
init-declarator
declarator-list init-declarator
init-declarator:
declarator initializeropt
declarator:
decl-name
* decl-name
decl-name [ integer-constant ]
decl-name:
identifier
initializer:
= initializer-expression
= { initializer-list }
initializer-expression:
constant-expression
dynamic-string
initializer-list:
initializer-expression
initializer-list , initializer-expression
Type Specifiers
The first part of a declaration consists of one or more type specifiers. A
type specifier is currently a simple type name, or a class name.
One of the words long or short may be specified together with the word int.
If they appear on their own, int is understood. The word unsigned may be
specified together with one of the words char, short, int and long. If it appear on its own, int is understood. The signed keyword is not supported for
now, and is ignored (a warning is issued). All types are signed except for
ProcSee Reference Manual
33
pTALK Reference
Declarations
char which is unsigned. The unsigned keyword is redundant together with
char. The void type is only legal as return type for functions that do not return any value, and as an unspecified pointer type.
Unlike C/C++, the ProcSee language defines the length of each data type;
they are listed in the table below1:
type
char
short
int
long
float
double
bits
8
16
32
32
32
64
Some examples of legal declaration specifiers are:
char
short int
unsigned short int
int
unsigned int
float
double
Declarator
After the type specifiers there is a declarator or a declarator list. Each declarator consists of the variable/attribute name declared, eventually preceded by a pointer operator. After an attribute name square brackets around
an integer constant indicates declaration of an array. It is not possible to
have arrays as local variables in functions and compound statements.
When the type is a class-name, only pointers of this type is legal.
Initializer
Every attribute or local variable may be initialized by an initializer following the declarator. An initializer begins with =, and continues with a constant expression of the required type. For arrays the initializer can be a
single constant expression, in which case every element in the array are initialized to the same value as the value of this constant expression. Arrays
can also be initialized by a list of constant expressions inside curly braces,
or by the value of a string constant if the attribute is of type char array.
Attributes can also be initialized to dynamic expressions. This is done by
using a dynamic-string. A dynamic-string is a pTALK expression surrounded by back quotes(�).
1. The use of the long type is not recommended because it will probably be redefined to 64 bits in the future.
34
ProcSee Reference Manual
pTALK Reference
Function Definitions
Examples of declarations of local variables:
Example
int
localVar;
// A variable named localVar of type int.
float
tankPressure;
double
myEpsilon = 0.00001; // An initialized variable.
short int smallData = 12300; // the type short int is 2 words.
MyRecord * recPtr;
// Only pointers to classes/structs.
ValveClass * valvePtr = 0;
// Pointers may be initialized to 0.
Examples of declarations of attributes:
Example
int
localVar;
int
stateArray[15]; // Attributes can be arrays.
int
states[15] = { 1, 4, 7, 2, 5, 8, 3, 6, 9, 0, 0, 0, 2, 3, 5 };
float
tankPressure;
float
tankLevel[10] = 35; // 10 tanks initialized to same level.
float
anotherEpsilon = 0.001;
short int smallData = 12300;
MyRecord *recPtr;
ValveClass *valvePtr = 0;
char
*theString;
char
stringBuffer[100];
char
myStr[20] = "Hello world"; // Initialization of char array.
int
state = �valve_19_state�; // Dynamic attribute.
Function Definitions
function-definition:
decl-specifiers function-declarator function-body
function-declarator:
decl-name formal-arguments
* decl-name formal-arguments
formal-arguments:
( argument-listopt )
argument-list:
argument
argument-list , argument
argument:
decl-specifiers declarator
function-body:
compound-statement
ProcSee Reference Manual
35
pTALK Reference
Function Definitions
Function definitions are composed of a type specification (the type of the
value returned by the function, or void if nothing is returned) followed by
the name of the function, followed by the formal arguments, followed by
the function body. A function can return a simple type, or a pointer to any
of the simple types, or a pointer to a struct or class.
The formal arguments is a comma separated list of simple declarations.
The types allowed in this list is one of the simple types, or pointers to any
of the simple types, or pointers to structs or classes.
The function body is a compound statement, as described in section "Compound Statement" on page 29. Inside the function body the formal arguments can be used. Functions can also contain a return statement, as
described in section "The return Statement" on page 32.
Examples of function definitions:
EXAMPLE
int myFunc( int arg1, int arg2 )
{
return arg1 * 10 + arg2;
}
void freeze()
{
Simulator.Running = 0;
}
char* helpString( int msgNo )
{
switch ( msgNo )
{
case WhatToDo: return "Click on OK button to continue";
case WhatIsIt: return "This is the Wait for user window";
default: return "Sorry, no help available on this msgNo";
}
}
int fact(int x)
{
if (x <= 1) return 1;
else return x * fact(x-1);
}
MyRec* changeData( MyRec* aRecArray, int anArrayIndex, float dTemp)
{
MyRec* theRec = aRecArray[anArrayIndex];
theRec->temp += dTemp;
return theRec
}
36
ProcSee Reference Manual
pTALK Reference
Constructors and Destructors
Constructors and Destructors
function-definition:
void constructor ( ) function-bodyopt function-body
void destructor ( ) function-body function-bodyopt
In ProcSee functions named constructor and destructor have special meanings1. They are called automatically when objects are created or deleted,
and constructors or destructors on child objects are called automatically
when a constructor/destructor is executed. Normally constructors are
called after the constructors of the child objects are called, and destructors
are normally called before the destructors of the child objects. Constructors
and destructors can have an optional body2. The constructors or destructors
of child objects are then called between the two bodies of these functions.
Se also "constructor,destructor" manual page on page 303
What is code?
code:
expression
compound-statement
function-definition
attribute-definition
In ProcSee the pTALK language is used to express dynamics, to express
dialogues, to define functions, and to define attributes.
To express dynamics, expressions are used. Expressions are described in
section "Expressions" on page 20. Dialogues are combined of expressions
for the event/trigger, and compound-statements for the action part. Compound statements are also used in the execute function. Compound statements are described in section "Compound Statement" on page 29.
Definitions of attributes and functions are typically done from the ProcSee
editor ged. Attributes, functions, and dialogues can also be defined using
the pTALK functions newAttribute, newFunction, and newDialogue. Declaration of attributes are described in section "Declarations" on page 32.
Definition of functions are described in section "Function Definitions" on
page 35.
1. This is different from C++, where constructor and destructor functions are named the same as the class they are in.
2. Double body on (constructor/destructor) functions is not defined in C/C++.
ProcSee Reference Manual
37
pTALK Reference
38
What is code?
ProcSee Reference Manual
The Configuration Language
Introduction
The Configuration Language
This chapter describes the ProcSee configuration language. This language
can be used to generate a User Interface Configuration Database using the
pcc compiler.
Introduction
An application’s user interface can be described in its entirety, using the
configuration language. The components of the interface, such as pictures,
libraries, and global resources can be described in a series of text files.
The table below shows the keywords in the configuration language. Those
marked with a dagger (†) are reserved for future use.
action
application
argument
attribute
blend
blob †char
circle
circleArc
circleSlice
class
classGUI †classGUICategory †classGUIInstance †classGUIPage †colour
comClass
comEnum
comEventObject
comInterface
comInterfaceObject
comLibrary
comObject
comShape
const
cursor
database
dialogue
dialogueArea
double
dynamic †element
ellipse
ellipseArc
ellipseSlice
enum
errorObject †eventPlot
eventVar
extern †float
font
function
group
image
instance
int
library
line
linestyle
long †pattern
picture
plugin
pluginObject †pluginShape †point †polygon
process
rectangle
resourceStyle
rgb
roundRect
scale
short
signed
startPicture
statement
static †text
trend
trendGrid
trendLabels
trendLog
trendLogExternal
trendLogInternal
trendPlot
trendRuler
trendVar
trendVarConfig
unsigned
use
window
39
The Configuration Language
Comments
Comments
The configuration language accepts comments in both C style and C++
style:
1) The characters /* start a comment, which terminates with the characters
*/. The comment may span several lines.
2) The characters // start a comment, which terminates at the end of the
line on which they occur.
Comments cannot be nested. If a // comment contains the /* comment characters, they are treated as any other characters inside the comment. Inside
a /* */ comment, the // comment characters are treated like any other characters in the comment.
From release 3.8, the comments are stored as part of the objects as follows:
When PCC reads the file:
•
Comments before the object are part of the object.
•
Comments on same line as the object are part of the object.
•
Comments right after the object are part of the object.
•
The first empty line after an object separates comments after an object from comments before an object. If no empty line is found, the comments are part of the object
after the comments.
•
The first comment of a file before any empty lines, if followed by an empty line, is
not part of the first object in the file. This comment is generated by the RTM when
documenting, and contains meta-data about the file, like file version.
•
If the file has an empty line followed by comments at the end of the file these comments are also ignored.
Example:
// File comment, file version or ProcSee version is read by PCC.
// Second line of file comment.
// App comment 1
// App comment 2
application App // App comment 3
{
// App comment 4
// Attr comment 1
int Attr = 5; // Attr comment 2
// Attr comment 3
// App end comment 1
} // App end comment 2
// App end comment 3
// File end comment, ignored.
40
ProcSee Reference Manual
The Configuration Language
Identifiers
When RTM writes the file (document):
•
A predefined file comment is placed at the top.
•
The comment for each object is placed in front of the object.
In the RTM, only direct elements in the symbol table can hold comments.
This means that e.g. the attributes of shapes can not hold comments. PCC
merges all comments on attributes (and other places that exists in the document file that are not in the RTM symboltable) into its parent object comment.
In the RTM comments are accessed using pTalk functions getComment
and setComment.
When pasting copied/cut objects and some other times, like renaming a
picture, or changing the save-path of the picture file, the comments in the
new/changed object can be modified by the RTM1: lines of the comment
that matches /^\s*_#\S*\s*=/ will have the initial ’_#’ replaced with ’__#’.
This can be used to have meta-data in the comment, that is unique for the
initial object it is attached to.
Identifiers
An identifier is a sequence of letters and digits. The first character must be
a letter; An underscore _ counts as a letter. Identifiers are case-sensitive.
Reserved keywords are not legal identifiers.
Literals
literal:
integer-constant
character-constant
floating-constant
string-literal
There are four kinds of literals, also called constants.
Integer Constants
An integer constant consisting of a sequence of digits is taken to be decimal base, unless it begins with 0x or 0X in which case it is taken to be a
hexadecimal integer. The hexadecimal digits include a or A through f or F.
The following are all integer constants:
2134
0xf02c
0XABC
0
An integer constant is of type int if it can be represented by a 32 bit signed
integer, otherwise the constant is of type unsigned int.
1. Functionality added in ProcSee version 3.8.5.
ProcSee Reference Manual
41
The Configuration Language
pTALK Code
Character Constants
A character constant is a character enclosed in single quotes. Some characters have special meanings when preceded by a backslash, and some
characters must be preceded by a backslash. These escape sequences are
listed in the table below.
new-line
horizontal tab
form feed
backslash
single quote
double quote
octal number
NL (LF)
HT
FF
\
’
"
ooo
\n
\t
\f
\\
\’
\"
\ooo
The escape \ooo consists of a backslash followed by one, two, or three octal digits that are taken to specify the value of the desired character. The
following are all character constants:
’n’
’\N’
’\n’
’\\’
’\’’
’\"’
’\0’
’\245’
A character constant is of type char.
Floating Constants
A floating constant consist of an integer part, a decimal point, a fraction
part, an e or E, and an optionally signed integer exponent. Either the integer part or the fraction part (not both) may be missing; either the decimal
point or the letter e (or E) and the exponent (not both) may be missing. The
following are all floating constants:
2.0
2.
.2
0.2e2
.2E-2
20e2
A floating constant is of type double.
String Literals
A string literal is a sequence of characters enclosed in double quotes. Escape sequences are supported as for character constants. All string literals
are implicitly terminated by a ’\0’ character. The following are all string
literals:
"Hello world\n"
"A\tB\tC"
"I\’m \"cute\""
A string literal is of type char[]. Multi-line strings are not supported.
pTALK Code
A pTALK code sequence is any legal pTALK code enclosed in backquotes
(�). The following are examples of pTALK code:
�fact(4)+x�
42
�{ printf("Hello World"); }�
ProcSee Reference Manual
The Configuration Language
Values
Values
In this chapter on the configuration language, reference is often made to a
generic value in the example code. A value is an integer constant, a float
constant or pTALK code, and in some cases may also be a string literal or
a character constant.
Assignments
assignment-statement:
identifier = value;
In special cases the following are also assignment statements:
argument[ integer-constant ] = value;
element[ integer-constant ] = value;
point[ integer-constant ] = ( value, value );
point[] = ( pTALK-code, pTALK-code );
Many of the components that are used to construct a description of a user
interface using the configuration language consists of either other components or of assignment statements. The most commonly used assignment
statement is of the type:
identifier = value;
e.g.
foregroundColour = �Red�;
Several components also require assignment statements that vary from the
one above and are shown in the grammar at the beginning of this section.
The individual sections that follow make clear the type of assignment
statement that is required for each component.
The components where the special cases are used are linestyle, dialogue,
line, polygon, and text. Note that argument, element, point, and action
are not reserved keywords.
Warning: In some cases a value may be required to be of a specific type.
The configuration language compiler is not always able to check the type
of a value, so care should be taken to avoid frustration. This is particularly
the case where a value can be assigned pTALK code, since the configuration language compiler is not capable of evaluating pTALK code and cannot check that the code is valid. The compiler may therefore accept and
compile code that is actually incorrect. Errors in code that has been accepted will be reported by the Run-Time Manager when a configuration containing errors is run.
Configurations
configuration:
configuration-item
configuration configuration-item
ProcSee Reference Manual
43
The Configuration Language
Assignments
configuration-item:
application-definition
picture-definition
trendvarconfig-definition
library-definition
A configuration is the highest level in the configuration language, and is a
complete description of an application’s user interface. A configuration
may be spread over several text files, or be stored in a single file. Each file
will usually contain at least one picture, library, or application definition.
Applications
application-definition:
application identifier { application-bodyopt }
application-body:
application-item
application-body application-item
application-item:
font-definition
process-definition
colour-definition
window-definition
linestyle-definition
pattern-definition
cursor-definition
attribute-definition
dialogue-definition
function-definition
start-picture-definition
library-declaration
database-declaration
class-definition
trendlog-definition
layer-definition
A complete user interface configuration will need, in addition to pictures
and (optionally) a library, an application context file that contains global
information about the configuration.
An application is identified by an identifier, which must be given. The binary file is named identifier.pctx
The body of an application should contain definitions of the resources
used. These include windows, fonts, colours, cursors, line styles, and fill
patterns. Global attributes, functions and dialogues should also be placed
in the body of an application, as should the pictures that are to be displayed when the user interface is started up, and the libraries that are used.
A user interface configuration may contain one or more processes which
should be declared in the application body. If the configuration uses a global database then the database should also be declared here.
44
ProcSee Reference Manual
The Configuration Language
Assignments
It is also possible to define classes in the application body rather than in a
library. This can be useful if a class is not intended for reuse in other user
interface configurations.
A simple example application is shown below:
application System
{
use "./SystemLibrary.plib";
// use a library
database "./RecordDefs.pdat";
// usually contains record type definitions only
process extraProcess
{
// this database is local to the process:
database "./ProcessVariables.pdat";
}
colour Red { red = oxffff; green = 0; blue = 0; }
colour Blue { red = 0; green = 0; blue = 0xffff; }
colour Green { red = 0; green = 0xffff; blue = 0; }
font Helvetica
font Times
{ name = "-adobe-helvetica-..."; }
{ name = "-adobe-times-..."; }
display MainDisplay
{
connection = "";
width = 1280;
height = 1024;
resizeMode = 0;
}
window MainWindow // a window definition
{
parent = "MainDisplay";
x = 20; y = 20;
width = 640; height = 512;
}
dialogue // a global dialogue
{
event = �buttonPressed(1)�; // left mouse button
action = �{
// pTALK code to do something useful
}�;
}
}
ProcSee Reference Manual
45
The Configuration Language
Libraries
Libraries
Defining Libraries
library-definition:
library identifier { library-body }
library-body:
library-item
library-body library-item
library-item:
attribute-definition
function-definition
class-definition
colour-definition
font-definition
linestyle-definition
pattern-definition
layer-definition
A library is primarily a collection of classes and functions. A library must
always be given an identifier.
A Library can currently contain attributes, classes, and functions, as well
as resources. In order for an instance of a class to be displayed correctly in
a picture, the Run-Time Manager needs to have information about resources such as colours, fonts, and patterns. These resources can be defined either in the application body itself, or in the library.
Example:
library SystemLibrary
{
int MyAttribute;
int MyFunc()
{
// function body
}
class simpleValve
{
// class body
}
class simpleSwitch
{
// class body
Using Libraries
46
ProcSee Reference Manual
The Configuration Language
Processes
library-declaration:
use string-literal;
If classes or functions stored in a library are to be used as part of a userinterface configuration, then the library files containing the definitions that
are to be used must be declared in the application body. The required library is declared using the keyword use, followed by a string containing
the name of the library file. A semi-colon is required at the end of the declaration.
Note that the filename given is that of a compiled library, and not the configuration language file containing the library definition.
A file containing a compiled library has the postfix ".plib" appended to the
library’s identifier.
Example:
use "./SystemLibrary.plib";
A library declaration is global to the configuration, and may hence appear
in an application body only.
Processes
database-declaration:
database string-literal;
database = string-literal;
// deprecated
process-definition:
process identifier { process-bodyopt }
process-body:
database-declaration
process-body database-declaration
A process has an identifier and, optionally, a body containing declaration
of the databases that is used by the process. A database placed in a process body should contain variable definitions (since record definitions are
always global), whereas a database placed in an application body should
contain the global record definitions. Variable definitions in a database
placed in an application body will be placed in a default process named after the application and are, hence, not global.
From ProcSee 3.8, the ’=’ in the database declaration is optional, and will
no longer be part of the database declarations documented by the RTM.
The reason for this is that the database declaration is more like a library
declaration than an attribute value. Libraries, plugins and databases can appear more than once in a given scope, attributes can not.
ProcSee Reference Manual
47
The Configuration Language
Windows
Example:
process myProcess
{
database "./processDatabase.pdat";
}
A process is global to the configuration, and may appear in an application
body only.
If a configuration uses a database file then it must be declared either global
to an application, in an application body, or local to a process, in a process
body.
Example:
database "./SystemDatabase.pdat";
A database is a text file containing definitions of records and variables.
The syntax and semantics of a database file are described in the next chapter (The ProcSee database file format).
Windows
window-definition:
window identifier {window-body }
window-body:
assignment-statement
window-body assignment-statement
The Run-Time Manager needs to know about the windows that are to be
used by a user-interface configuration. The keyword is window, and is followed by the window’s identifier and a window body. Within the body are
usually six attributes (see the example definition of window "Win0" below).
The parent must always be defined. The parent should be the name of a
display or window defined in the same configuration file.
If the dimensions of the window and the background colour are not given,
then default values will be used for these (see the definition of window
"Win1" below).
48
ProcSee Reference Manual
The Configuration Language
Display
Examples:
window Win0
{
parent = "myDisplay";
x = 0; y = 0; width = 1024; height = 725;
backgroundColour = 0;
}
window Win1 { parent = "Win0"; x = 10; y = 10; }
Windows are global to the configuration and may be defined in an application body only.
Display
display-definition:
display identifier {display-body }
display-body:
assignment-statement
display-body assignment-statement
The Display object represents a drawing surface used by the RTM. It defines a display, virtual display area or a virtual display (all monitors). Normally the pictures (windows) are displayed inside the bounds of the
Display object.
A description of the attributes provided by the Display class follows next.
The attribute connection specifies the scheme and the connection device
string, i.e. which device to open a connection to. For instance WIN:0,
WIN:1, X:gandalf:0.0, X::0.0, etc. The WIN: and X: are the scheme
names. WIN: is the default scheme on the Microsoft Windows platforms
and X: is the default scheme name on Unix, Linux, and Mac (indicating the
X-Window System).
It is possible to specify several display devices with the connection string
attribute. Use the semicolon character ';' to separate the display device entries. For instance, the string "WIN:1;X::0.1;" defines two display device
entries. WIN: will be used on the Windows platforms, while X: will be
used on Unix/Linux platforms running X-Windows. Notice that the RTM
will try each entry from the connection attribute string until successful. Inserting a semicolon at the very end of the connection attribute string ensures that the display-object will open on the computer's default display if
all other items fail.
The attributes width and height defines the design time size of the display,
i.e. target display size.
The attribute resizeMode determines whether the Display object is rescaled to fit the display or not. The value 0 means, no rescaling. Setting this
value to 2, rescales the display and maintains the aspect ratio of the display
ProcSee Reference Manual
49
The Configuration Language
Layers
size (the attributes width and height). The value 1 means rescale the display to fit the display even if it means that the aspect ratio is different from
the design time size.
The attributes virtualX, virtualY, virtualWidth and virtualHeight defines a virtual display area, which can be smaller or larger than the display
size. Note that these attributes are not documented by the RTM if they are
equal to the Display object’s default values.
Examples:
display Display0
{
connection = "";
width = 1280;
height = 1024
virtualX = 1280;
virtualY = 1024;
virtualWidth = 1560;
virtualHeight = 2048;
}
Notice that displays can only be defined in an application body.
Layers
layer-definition:
layer identifier { layer-body }
layer-body:
assignment-statement
layer-body assignment-statement
When using layers, the application or library contains a series of layer definitions. The order of these defines the order of the layers, used when drawing pictures. A layer definition mainly gives the name of the layer, and its
position among the other layers. The layer that is used for shapes not assigned to a layer, is marked with the flags attribute of the layer having the
"default" string as value.
50
ProcSee Reference Manual
The Configuration Language
Layers
Example:
layer BgLayer
{
}
layer DefaultLayer
{
flags = "default";
}
layer FgLayer
{
}
Layers used in libraries define the name of the layers that the shapes of
classes will use. These layers only contain the name of the layer, and the
order, with one of the layers marked as default, like in the example above.
When a library with layers are used in an application, the layers of the library are assigned to layers in the application. This is performed by checking the application layers aliases attributes. If a library layer is found in an
aliases attribute of an application layer, this connects the library layer to
this application layer. If no alias is found, but there exists a layer in the application with the same name as the library layer, the library layer is connected to this layer. If no layer to connect to is found, a layer is created in
the application, with the same name as the layer in the library. If this name
is already used for something else, another name is used. When creating
new layers in the application, the order of the layers in the library will be
used for the order of the new layers.
Layers can contain the following attributes:
visibility - Draw the shapes of this layer or not. Default value is 1 = visible.
Only for application layers.
aliases - Names of library layers to connect to this application layer. Only
for application layers. Contains a string of alias names, each alias name on
the form libName.layerName, and each separated by comma ’,’, or bar ’|’.
flags - Can contain the string "default", to say that this is the default layer
(the layer to use for shapes not connected to a layer). Can contain "originalName=’name’" if the layer was created automatically, but the name
wanted was already in use, this is so that other libraries with layers should
connect to the same layer if the name matches. The originalName is only
for application layers.
ProcSee Reference Manual
51
The Configuration Language
Colours
Colours
colour-definition:
colour identifier { colour-body }
colour-body:
rgb-statement
colour-body rgb-statement
rgb-statement:
assignment-statement
rgb { rgb-body }
rgb-body:
assignment-statement
rgb-body assignment-statement
A colour definition has four predefined attributes that determine its colour.
The attributes red, green, and blue should be used to set the colour’s intensities of red, green, and blue. The values should be given as integers or
hexadecimal numbers in the range 0 to 65535 (or 0xffff). The transparency attribute determines the colour’s transparency. The value range for this
attribute is the same as for the red, green and blue attributes. The value 0
defines an opaque colour, while the value 65535 defines a transparent colour. Any value between these limits determines the transparency of the colour.
Example of normal (shared) colour:
colour red
{
red
= 0xffff;
green = 0;
blue
= 0;
transparency = 0;
}
A blink colour definition is composed of one or several rgb statements,
where each rgb definition has five attributes. The attributes red, green,
blue and transparency determines the colour and the transparency of the
colour, respectively. For more information about these attributes, see the
colour defintion described above. The attribute time specifies the time in
milliseconds that the actual rgb colour will be visible on the screen, before
the next rgb colour in the sequence is displayed.
52
ProcSee Reference Manual
The Configuration Language
Colours
Example of a blink colour:
colour cyan_red_green
{
rgb {
red=0;
green=65535;
blue=65535;
transparency = 32333;
time=500;
}
rgb {
red=65535;
green=0;
blue=0;
transparency = 0;
time=300;
}
rgb {
red=0;
green=65535;
blue=0;
transparency=10000;
time=300;
}
}
A colour definition can have a type attribute as well. This attribute has a
default value of 0 for colours with only one set of rgb values, and a default
value of number of rgb values for colours with several rgb values. Type =
0 indicates a shared colour, type = 1 indicates a private colour, and type
>= 2 indicates a blink colour. The type attribute should normally not be
used, unless a private colour is needed. For pseudo-colour displays shared
colours are preferred, because they don’t consume extra colours in the colour map if the colour already exist in the colour map. Private colours
should only be used when the colour has to be changed at run-time. Blink
colours on pseudo-colour displays are private colours that periodically
change their rgb components at specified intervals. On true-colour displays
blinking is implemented by redrawing the area covered with the blinking
colour, and the type attribute is ignored.
Example of a private colour:
colour myPrivateColour
{
type = 1;
rgb {
red = 0x7f7f;
green = 0x7f7f;
blue = 0x7f7f;
transparency = 0;
}
}
A colour definition may appear in an application body or a library body.
ProcSee Reference Manual
53
The Configuration Language
Patterns
Patterns
pattern-definition:
pattern identifier { pattern-body | gradient-pattern-body }
pattern-body:
assignment-statement
pattern-body assignment-statement
gradient-pattern-body:
assignment-statement
gradient-pattern-body assignment-statement
In ProcSee, Patterns are separated in two categories. These are regular patterns and gradient patterns, each category having different set of attributes.
Therefore, it is naturally that these categories are described in turn in the
next two sections. The first section describes regular patterns, while the
second section describes gradient patterns.
A pattern definition may appear in an application body or a library body.
Regular Patterns
Regular patterns can be defined in the Tdoc (pctx, plib) file or in a separate
X11 bitmap file or a pixmap file (.png, .bmp, .tiff ). Pattern definitions on
a separate file have a single attribute, called patternFile (or patternBitmap). The attribute is a text string giving the path to the X11 bitmap file
to be used as a pattern. Patterns defined in the Tdoc files have three attributes, these are: width and height (integer) and patternData as a string.
patternData is a string of hexadecimal digits defining the pattern.
Example:
pattern patSmiley
{
patternFile = "smileyFace.bm";
}
pattern patRaster
{
width = 8;
height = 8;
patternData = "8800885588008855";
}
Patterns, just like colours, are global to the configuration. Two predefined
patterns NoPattern and SolidPattern are always available and do not,
therefore, need to be defined. The X11 application bitmap(1) can be used
to create and modify bitmaps.
54
ProcSee Reference Manual
The Configuration Language
Patterns
Gradient Patterns
Gradient patterns are defined in the Tdoc (pctx, plib) file. The attribute
type is an integer specifying the default gradient type, and the default repeated and the reflected flags. Legal values for the gradient type are:
• Linear
=0
• Elliptical
=1
• Circular
=2
• Square
=3
• Rectangular = 4
The repeated and reflected modifiers are flags added to the gradient type to
produce the final attribute type. The flags have the following values:
• Repeated
= 256 (0x100)
• Reflected
= 512 (0x200)
The value of the attribute type, when creating a square pattern with the repeated and reflected flags on, is: 0x100 | 0x200 | 3 = 0x303.
The attributes x1, y1, x2, y2, x3, y3 are of type real and specifies the length
and direction of the vectors. ProcSee uses one vector (x1, y1) to (x2, y2) if
linear, square or circular gradient type is specified, and two vectors, (x1,
y1) to (x2, y2) and (x1, y1) to (x3, y3), for rectangular and elliptical gradient type. Normally, are these vectors in the value range [0, 1].
A gradient pattern may have zero or more blend definitions:
blend-definition:
blend { blend-body }
blend-body:
assignment-statement
blend-body assignment-statement
The blend definition is either a blend factor or a blend colour, also called a
blend stop. One attribute is common for the different types. The name of
this attribute is position, and is of type real and must be in the range [0, 1].
Values outside this range or duplicated positions are illegal and will issue
errors in ProcSee.
The blend factor has a single attribute factor of type real. This attribute determines the ratio between the previous- and next blend stop. This value
must be in the range [0, 1]. A value of 0 means, use the value of the previous blend stop, while a value of 1 means, use the next blend stop. Values
between these limits produce a blending of the colours at these blend stops.
The blend colour has three attributes of type integer which specifies the
RGB component of the colour, that is red, green and blue. These attributes
must be in the range [0, 65535]. The transparency attribute determines
whether the colour is opaque, transparent or semi-transparent. A value of
ProcSee Reference Manual
55
The Configuration Language
Fonts
0 means opaque, while a value of 65535 means transparent. Any value between these limits produces a semi-transparent colour. The attributes foreground and background are used when creating a colour based on the
colours of a shape or a picture, i.e. the colours are got from the object the
gradient is assigned to. These attributes must be in the range [0, 1]. Note
that the sum of these attributes must not exceed the value 1, otherwise an
error will be issued in ProcSee. If the sum of these attributes is less than 1,
the colour produced is a blending of the foreground and/or background and
the colour specified with the red, green and blue attributes.
Example:
pattern patternGradient
{
type = 0;
x1 = 0; y1 = 0;
x2 = 1; y2 = 1;
blend { position = 0; factor = 0; }
blend { position = 0.25; red = 65535; green = 0; blue = 0; }
blend { position = 0.5; red = 0; green = 0; blue = 65535;
transparency = 32768; foreground = 0.25; background = 0.25; }
blend { position = 0.75; foreground = 0.5; background = 0.5; }
blend { position = 1; factor = 1; }
}
Fonts
font-definition:
font identifier { font-body }
font-body:
assignment-statement
font-body assignment-statement
A Font has a single attribute, called name, which is used to specify which
X11 font is to be associated with the given identifier.
Example:
font Font0
{
name = "-adobe-helvetica-...";
}
The font can be any X11 font (both 8 bits and 16 bits fonts are supported).
A Font may be defined in an application body or a library body.
Cursors
cursor-definition:
cursor identifier { cursor-body }
56
ProcSee Reference Manual
The Configuration Language
Cursors
cursor-body:
assignment-statement
cursor-body assignment-statement
A cursor can be defined by
• using standard cursor shapes as defined in <X11/cursorfont.h>
• using userdefined cursor shapes defined in cursor files for the following
format: .xbm in both UNIX and Windows. In Windows also for the following formats: .cur and .ani.
• define a cursor in the Tdoc (pctx, plib) file.
If a font cursor is requested, the fontCursor attribute should be assigned
an integer corresponding to the desired cursor as defined in <X11/cursorfont.h>.
If a bitmap cursor is requested, the cursorFile (or bitmapCursor) attribute
should be assigned a text string giving the path to the X11 bitmap file
(.xbm) to be used as a cursor. (On MSWindows, the file can also be a native
Windows cursor file (.cur or .ani)).
The following attributes must be specified for the cursor when defined in
the Tdoc file. cursorShape, a text string of hexadecimal digits defining the
shape of the cursor. cursorMask, a text string of hexadecimal digits defining the cursor mask. width and height are the size of the cursor. xHotSpot
and yHotSpot define the cursor hotspot.
The two attributes backgroundColour and foregroundColour can be
used to set the background and foreground colour of the cursor. The default
values are black and white.
Twelve cursors are predefined. They are: NoHit, UpperLeft, UpperSide,
UpperRight, RightSide, LowerRight, LowerSide, LowerLeft, LeftSide,
OnBoundary, Linebox, and TextEdit.
Examples::
cursor WristWatch
{
fontCursor = 150; // the cursor font index
}
cursor MyCursor
{
cursorFile = "Cursorfile.xbm";
}
cursor BitmapCursor
{
cursorShape = "0008000FE000...00000000";
cursorMask = "0018801FF01F...03F0C011";
width
= 16;
height
= 16;
xHotSpot = 12;
yHotSpot = 1;
}
ProcSee Reference Manual
57
The Configuration Language
Line Styles
All cursor definitions are global to the configuration and may be defined in
an application body or in a library body.
Line Styles
linestyle-definition:
linestyle identifier { style-body }
style-body:
assignment-statement
style-body assignment-statement
A linestyle is defined as a sequence of integers specifying a dash pattern.
A maximum of 8 integer values may be specified. The element attribute is
an array where each entry must be given individually. The attribute numberOfElements is an integer specifying how many entries the element array is to have.
Example:
linestyle dashDot
{
element[0] = 4; element[1] = 2;
element[2] = 1; element[3] = 2;
numberOfElements = 4;
}
If only one element is given, the resulting linestyle is one where the dashes
and gaps between them are of equal length. If two elements are given, the
first element defines the length of the dashes and the second element the
length of the gaps. In general, if the number of elements is even, the dashgap pattern is repeated (e.g. element[0], element[2], element[4], etc., are
always dashes) but if the number of elements is odd, then the dash-gap sequence is alternately repeated as a gap-dash sequence. This is probably
best illustrated using graphical examples:
First pixel in line
{4}
{ 4, 2 }
{ 4, 2, 1 }
{ 4, 2, 1, 2 }
4
4
4
4
2
4
4
2
1
4
2
1 2
elements
Last pixel in line
4
2
4
4
2
4
4
1
2
4
2
4
1 2
4
2
1
4
4
2
4
4
2
2
1 2 4
1
pixels
Note that the dash is displayed in the foreground colour and the gap in the
background colour.
58
ProcSee Reference Manual
The Configuration Language
ResourceStyles
The predefined line styles NoStyle and SolidStyle are always available.
linestyle definitions may appear in an application body or a library body
only.
Note that the �s’ in linestyle is small, unlike the assignment label used in a
line shape where the �s’ is a capital �S’ (for example, in a line shape, one
can write lineStyle = �SolidStyle�;).
ResourceStyles
resource-style-definition:
resourceStyle identifier { resource-style-body }
resource-style-body:
resource-style-elem
resource-style-body resource-style-elem
resource-style-elem:
use string-literal ;
colour-definition
A resource style is used to define resources that can be used to override the
global resources defined in the application or library that the resource style
is placed in. Resource styles can use other resource styles, by specifying
the name of the resource styles to use in use statements. When a resource
is needed, the current resource style in use will be searched first for this resource, if not found, each of the resource styles specified with use statements is searched in the same order as the use statements. The first match
will be used, or if no match, the global resource will be used.
Example:
resourceStyle myStyle
{
use "myOtherStyle";
use "myLib.myLibStyle";
colour myColour1
{
rgb { red=0x4B4b; green=0xB4B4; blue=0x7A7A; }
}
colour myColour2
{
rgb { red=0; green=0x5858; blue=0x8383; }
}
}
Attributes
attribute definition:
ProcSee Reference Manual
59
The Configuration Language
Attributes
type *opt identifier;
type identifier = attribute-value;
char identifier [] = string-literal;
char identifier [ integer-constant] = string-literal;
type identifier[ integer-constant];
type identifier[ integer-constant] = arrayOfValues;
identifier *opt identifier;
identifier []opt identifier;
arrayOfValues:
{ anArray }
value
anArray:
arrayValue
anArray , arrayValue
attributeValue:
arrayValue
pTALK-code
arrayValue:
float-constant
integer-constant
character-constant
type:
float
char
unsignedopt short
unsignedopt int
An attribute is defined using at least a type and identifier followed by a
semi-colon. An attribute may optionally be given a value. Non-initialised
attributes implicitly default to zero. Some examples of attribute definitions
are given below. Values given to attributes should be of the same type as
the attribute.
Pointer types can be declared but can not be initialised.
Examples:
int i;
int i2
= 123;
float ftArray[5] = 5.4321;
float ftArray2[5]= { 1.1, 2.2, 3.3, 4.4 };
char aString[]= "Hello World";
float liquidLevel= �level()�; // dynamic
float fluidRatio= �liquidLevel/i�;
int* ip; float* fp; rec* rp;
Note that the only legal types other than int, float, and char, is pointer to
struct and pointer to ProcSee classes (Picture, Window, and user defined
classes).
If an array is declared and a single value is given (see float ftArray[5] in
the above example) then all the elements of the array will be given that value. If an array is declared that is larger than the number of elements given
(see float ftArray2[5] in the above example) then the remaining elements
will be given null values. It is an error to give more elements to an array
than the size of the array declared.
60
ProcSee Reference Manual
The Configuration Language
Functions
Using an initialiser in an attribute definition does not only mean to assign
an initial value to that attribute. The liquidLevel attribute is assigned a
function call as value, and that means that liquidLevel will change dynamically as the function returns different values. Dynamic values are created
by assigning function calls or non-constant expressions to an attribute in a
definition statement - as for fluidRatio and liquidLevel in the above examples. Remember to put backquotes (�) around the pTALK code for the
dynamic value.
Attribute definitions may be global to the configuration, or local to a class,
picture, pr library.
In an instance of a class the following syntax is used:
attribute-assignment:
attribute assignment-statement
assignment-statement
// deprecated
An attribute can be set in an instance of a class by using the keyword attribute.
The keyword attribute for instance attributes have been redundant since
version 3.0. From ProcSee 3.8 the keyword attribute is not documented by
the RTM when documenting instance attributes. PCC is still accepting the
attribute keyword.
Examples of the deprecated attribute assignments:
attribute anIdentifier = 123.456;
attribute anotherAttr = "another attribute";
This notation with attribute keyword can only be used in an instance.
Functions
function-definition:
function pTALK-code
A function is defined using the function keyword, followed by the complete function definition, in the pTALK language, within backquotes.
ProcSee Reference Manual
61
The Configuration Language
Dialogues
Examples:
function �int level( void )
{
int theLevel = 0;
if ( ! isEmpty() )
theLevel = (int)(volume / crossSection());
return theLevel;
}�
function �double crossSection( void )
{
Function elements may be global to the configuration, or they may be local
to a class or picture. The pTALK language itself is discussed in the previous chapter (pTALK Reference on page 17).
Dialogues
dialogue-definition:
dialogue { dialogue-body }
dialogue-body:
event = pTALK-code;
action = statement pTALK-code;
action = pTALK-code;
// deprecated
A dialogue is an interaction between a user and a computer system. The
user makes the selection, by, for example, pressing a key on a computer
keyboard, or performing a mouse action, and the computer system responds by changing its state or requiring new user actions.
A dialogue consists of an event and an action to perform when the event
occurs. Events are generated by user input, side effects of previous user input, internal ProcSee messages, or messages passed between external applications and ProcSee.
The pTALK code for the event should be an expression, that will call at
least one of the event trigger pTALK functions listed on page 333.
The pTALK code for the action should be a statement; that is you would
normally use a compound-statement ’{...}’ for this value, see example below.
The keyword statement used in the action attribute of the dialogue, have
been redundant since version 3.0. From ProcSee 3.8 the statement keyword
is not documented when documenting dialogues. PCC still accepts the
statement keyword.
62
ProcSee Reference Manual
The Configuration Language
Enums
Example:
dialogue
{
event = �buttonPressed(0)�;
action = �{ displayPicture( "win0", "start.ppic" ); }�;
}
Dialogue definitions may be global to the configuration, or they may be local to a class or picture, or a shape in a class or picture.
Enums
enum-definition:
enum enum-typeopt identifier { enum-bodyopt enum-sepopt }
enum-type:
"int"
"short int"
"unsigned int"
"unsigned short int"
"float"
"double"
"char*"
enum-body:
enum-item
enum-body enum-sep enum-item
enum-sep:
;
,
enum-item:
identifier enum-initopt
enum-init:
= value
Enums are used to define a group of constants. If no value is given for a
numeric enum element, the value will be the previous elements value + 1.
If no enum-type is given, the default is int.
ProcSee Reference Manual
63
The Configuration Language
Classes
Examples:
enum numbers
{
one = 1; two; three; four; five,
six, seven, eight, nine, zero=0
}
enum "char*" myStrings
{
str1 = "abc";
str2 = "xyz";
}
Classes
class-definition:
class identifier { class-bodyopt }
class-body:
class-item
class-body class-item
class-item:
attribute-definition
function-definition
dialogue-definition
instance-definition
shape-definition
group-definition
assignment-statement
A class is a collection of objects (shapes, instances, groups,...), functions,
attributes, and dialogues that make up a type. This type can later be instantiated to form an instance of that type. This mechanism allows for easy reuse of complex collections of objects, which might have their own
complex behaviour as defined by the functions in the class. In the following example a class for a simple valve has been defined.
The class contains the following attributes (they are used when the class is
edited in the graphics editor only).
xSnap
ySnap
angleSnap
radiusSnap
worldX
64
The snap interval in the x-direction
The snap interval in the y-direction
The snap interval for angles (ellipse/circle arc/slice)
The snap interval for radius (ellipse/circle and corresponding arc/slice
The x-coordinate of the upper left corner of the class’ world coordinate
system
ProcSee Reference Manual
The Configuration Language
Classes
worldY
The y-coordinate of the upper left corner of the class’ world coordinate
system
worldWidth
The width of the class’ world coordinate system.
The width of the class’ world coordinate system.
The world coordinate to screen coordinate ratio. A value of 2 means that
there are 2 screen coordinates to each world coordinate
The background colour used when the class is edited in the graphics editor.
The foreground colour used when the class is edited in the graphics editor.
worldHeight
oneToOne
backgroundColour
foregroundColour
pattern
xReference
yReference
xScaleFactor
yScaleFactor
rotationAngle
The background pattern used when the class is edited in the graphics editor.
The x-coordinate of the reference point used in rotation and scaling operations
The y-coordinate of the reference point used in rotation and scaling operations
The scale factor in the x-direction. The class is scaled around the reference point.
The scale factor in the y-direction. The class is scaled around the reference point.
The rotation angle of the class, specified in degrees.
ProcSee Reference Manual
65
The Configuration Language
Classes
Example:
class simpleValve
{
int Closed = 0;
int ValveColour = �Green�;
function �void switchValve()
{
if (Closed==0)
{ Closed = 1; ValveColour = �Green�; }
else
{ Closed = 0; ValveColour = �Red�; }
update(); // updates the picture
}�
dialogue
{ // event is any mouse button pressed:
event = �buttonPressed(0)�;
action = �{ switchValve(); }�;
}
polygon
{
numberOfPoints = 4;
point[0] = (0,0); point[1] = (20,10);
point[2] = (20,0); point[3] = (0,10);
foregroundFillColour = �ValveColour�;
}
xSnap
= 1;
ySnap
= 1;
angleSnap
= 2;
radiusSnap
= 2;
worldX
= -100;
worldY
= -100;
worldWidth
= 100;
worldHeight
= 100;
oneToOne
= 1;
backgroundColour = 0;
xReference
= -10;
yReference
= -10;
xScaleFactor
= 1.5;
yScaleFactor
= 1.5;
rotationAngle = 45.0;
}
This simpleValve class has two attributes, a function, a dialogue, and a
shape, which together define the class’s behaviour and appearance.
66
ProcSee Reference Manual
The Configuration Language
Classes
When an instance of this class is created, the attributes Closed and ValveColour will be set to the initial values as defined in the class definition
above ( 0 and Green). The fill colour of the polygon, which is used to represent the simple valve graphically, is dependent on the value of the attribute valveColour, and so will change colour if ValveColour changes.
The class contains a dialogue which specifies that if an instance of the
simpleValve is clicked on with a mouse, then the function switchValve()
will be called.
The function switchValve sets the attribute closed to 1 if it was 0 and to 0
if it was 1 and also changes the value of the ValveColour accordingly. It
then calls a function defined globally ( update() ).
The net result is that if an instance of the switchValve class is clicked on
with the mouse, it will switch colour, switching between green and red, and
its Closed attribute will switch between 0 and 1.
Class definitions are global to the configuration. They can be placed in an
application body or a library body.
classElementFlag
Attribute values of shapes and instances within a class are normally controlled by the class and should normally not be modified in the class' instances. Therefore, such values are by default not saved or loaded when
instances of the class are saved and loaded. Instead, the values specified in
the class are used. This ensures that the class can modify internal shapes
and instances and the modifications will influence all instances of the class.
However, in certain situations class designers may choose to make the attributes of internal shapes and instances configurable for each instance. To
enable this feature, a field called classElementFlag is available for all
named shapes and instances within a class. classElementFlag is a text
string specifying the name of the attributes for which values should be
saved and loaded for each instance of the containing class. By default, classElementFlag is an empty string. Note that the internal shape or instance
must have a name for this feature to be available.
The example below specifies that the attributes attr1 and attr2 of internal
instance c2 should be saved and loaded pr instance of class C1, while attribute attr3 should not.
class C1
{
instance C2 c2
{
attr1 = 123;
attr2 = 45;
attr3 = 67;
...
classElementFlag ="attr1, attr2";
}
}
ProcSee Reference Manual
67
The Configuration Language
Pictures
For a picture where class C1 is used, entries will exist for attributes attr1
and attr2, but not for attr3.
picture P1
{
instance C1 c1
{
c2.attr1 = 56;
c2.attr2 = 789;
}
}
The text string classElementFlag contains attribute names separated by
comma, and optional white-space. Attribute names may include subshapes nested to any depth, like "anInstance.aCircle.radius".
If no classElementFlag entry is found, the RTM inserts classElementFlag
settings with appropriate values to ensure backward compatibility with
versions prior to the introduction of classElementFlag.
Pictures
picture-definition:
picture identifier { picture-bodyopt }
picture-body:
picture-item
picture-body picture-item
picture-item:
attribute-definition
function-definition
dialogue-definition
instance-definition
shape-definition
group-definition
assignment-statement
The binary file is named identifier.ppic. A picture is very similar to a class
in the sense that it can contain objects, functions, attributes, shapes and dialogues. A picture contains some additional attributes. These allow the
user to set such things as a picture’s backgroundColour or updateMode.
The following attributes are available for a picture:
backgroundColour
foregroundColour
pattern
xSnap
ySnap
angleSnap
radiusSnap
68
The background colour of the picture. If this picture is displayed in a
window with a background colour of its own, the picture background
colour will override that of the window.
The foreground colour of the picture. Unused if this value is -1.
The pattern used in the picture. Unused if this value is -1.
The snap interval in the x-direction
The snap interval in the y-direction
The snap interval for angles (ellipse/circle arc/slice)
The snap interval for radius (ellipse/circle and corresponding arc/slice
ProcSee Reference Manual
The Configuration Language
Pictures
worldX
The x-coordinate of the upper left corner of The picture’s world coordinate system
worldY
The y-coordinate of the upper left corner of The picture’s world coordinate system
The width of the picture’s world coordinate system.
The height of the picture’s world coordinate system.
The world coordinate to screen coordinate ratio. A value of 2 means that
there are 2 screen coordinates to each world coordinate
This attribute defines how the picture is resized in the window. If this
value is set to the value 0 (default), the picture is clipped to the window.
Setting this attribute to the value 1, it means that the picture is resized
to fit inside the window. The picture’s aspect ratio is not maintained. To
maintain the aspect ratio but resize the picture to fit inside the window,
set this attribute to the value 2.
This attribute defines how a picture should be updated. Eight different
update modes are supported by ProcSee (Note, if the update modes 0 or
1 are used, it will automatically be set to split buffering mode, 3). It is
recommended to use a buffering update mode where the picture is
drawn into a double buffer and copied to the screen. This eliminates
flicker. One non-buffering mode is however supported by ProcSee (set
the attribute to the value 10). The best update mode to use cannot be predicted in advance, because it depends on several factors, like the
number of shapes, number of instances, number of overlapping shapes,
etc. in the picture. In most cases will split buffering mode (value 3,
which is the default) give an acceptable update frequence. However, if
the picture contain lots of static shapes it can be advantageous to use one
of the static buffering update modes (7, 8 or 9).
worldWidth
worldHeight
oneToOne
resizeMode
updateMode
crosshairStyle
crosshairLength
crosshairFollowSnap
crosshairVisibility
xReference
yReference
xScaleFactor
yScaleFactor
rotationAngle
Not used in the current version
This attribute specifies the size/length (in screen/pixel coordinates) of
the crosshair cursor.
This attribute specifies whether the crosshair cursor should follow the
snap intervals or not.
This attribute controls whether the crosshair cursor is visible or not.
The x-coordinate of the reference point used in rotation and scaling operations
The y-coordinate of the reference point used in rotation and scaling operations
The scale factor in the x-direction. The picture is scaled around the reference point.
The scale factor in the y-direction. The picture is scaled around the reference point.
The rotation angle of the picture, specified in degrees.
ProcSee Reference Manual
69
The Configuration Language
Groups
A special "attribute" is pictureFlags. It typically is used for marking the
picture as a drag and drop target. The pictureFlags should only be present
if it is set, and it can not have a dynamic value.
Example: pictureFlags = "dndDropCopy";
Example:
picture StartUp
{
function �void letsGo( int* aVal ) { ... }�
instance Valve ValveA {...}
instance Valve ValveB {...}
rectangle myRect1{ ... }
rectangle myRect2{ ... }
int anArray[5] = {1,2,3,4,5};
backgroundColour = �darkBlue�;
xSnap
= 5;
ySnap
= 5;
angleSnap
= 0;
radiusSnap
= 0;
worldX
= 0;
worldY
= 0;
worldWidth
= 1280;
worldHeight
= 1024;
oneToOne
= 1;
resizeMode
= 0;
updateMode
= 1;
crosshairStyle
= 1;
crosshairLength = 0;
crosshairFollowSnap = `isInEditMode()`;
crosshairVisibility = `isInEditMode()`;
xReference
= 50;
yReference
= 100;
Picture definitions are global to the configuration.
Groups
group-definition:
group identifieropt { group-body }
group-body:
group-item
group-body group-item
group-item:
instance-definition
shape-definition
group-definition
assignment-statement
70
ProcSee Reference Manual
The Configuration Language
Groups
A group is no more than a collection of objects and other groups that can
be treated (selected, moved, made visible/invisible, rotated, or scaled) like
a single object. A group can be used to arrange objects in a hierarchical
manner.
A group should contain two or more items.
A group has the same scope rules as objects, and can be placed within pictures, classes, or other groups in the same way as any other single shape or
instance of a class
Since a group is a collection of instances, groups, or shapes, it cannot be
connected to dialogues of its own. Dialogues connected to shapes within a
group continue to function even though the shape is part of a group, so if it
is necessary to connect a dialogue to a group then a dialogueArea shape
can be placed in the group, containing the required dialogue.
A group contains the following attributes:
visibility
xReference
yReference
xScaleFactor
yScaleFactor
rotationAngle
Specifies whether the group is visible or not. A value of 0 means invisible, a value of 1 visible.
The x-coordinate of the reference point used in rotation and scaling operations
The y-coordinate of the reference point used in rotation and scaling operations
The scale factor in the x-direction. The group is scaled around the reference point.
The scale factor in the y-direction. The group is scaled around the reference point.
The rotation angle of the group, specified in degrees.
The example below shows a group containing three objects and another
group. The inner group contains two more objects.
Example:
group outerGroup
{
rectangle{ ... }
circle{ ... }
group innerGroup
{
polygon{ ... }
instance Pipe { ... }
}
instance Valve { .. }
visibility = 1;
xReference = 50;
yReference = 100;
xScaleFactor = 1.5;
yScaleFactor = 1.5;
ProcSee Reference Manual
71
The Configuration Language
Instances
A group can be placed in a class, picture, or another group. It does not have
a position of its own, since the objects within it dictate its position.
Instances
instance-definition:
instance identifier identifieropt instance-initializer
instance-initializer:
{ instance-bodyopt }
instance-body:
instance-item
instance-body instance-item
instance-item:
assignment-statement
attribute-assignment
Instances are instances of classes. They are defined by specifying the class
name and optionally an identifier and an instance-body, with eight predefined attributes, as well as assignments of attributes that are local to the
class used.
An instance contains the following attributes:
x
y
visibility
xReference
yReference
xScaleFactor
yScaleFactor
rotationAngle
72
The x-coordinate of the instance.
The y-coordinate of the instance. The x and y attributes specifies the origo position of the coordinate system inside the instance.
If the attribute is 0 then the instance will be invisible. If the attribute is
set to 1 then the instance will be visible. The value can also be evaluated
using pTALK-code if a dynamic visibility is required.
The x-coordinate of the reference point used in rotation and scaling operations
The y-coordinate of the reference point used in rotation and scaling operations
The scale factor in the x-direction. The instance is scaled around the reference point.
The scale factor in the y-direction. The instance is scaled around the reference point.
The rotation angle of the instance, specified in degrees.
ProcSee Reference Manual
The Configuration Language
Instances
The layout of an instance is as follows:
instance classIdentifier identifier{}
instance classIdentifier identifier
{
attribute ... ;
attribute ... ;
attribute ... ;
...
x = value;
y = value;
visibility = 1; // can also be 0 or pTALK-code
xReference = value;
yReference = value;
xScaleFactor = value;
yScaleFactor = value;
rotationAngle = value;
}
It is not necessary to give all of these values for each instance as can be
seen in the first of the two instances in the following example, where scaling factors, etc. will be assigned default values.
Examples:
instance valve valveNrOne{}
instance valve valveNrTwo
{
closed = �true�;
x = 500;
y = 500;
visibility = 1; // can also be 0 or pTALK-code
xScaleFactor = 1;
yScaleFactor = 1;
rotationAngle = 30;
xReference = 100;
yReference = 100;
}
The two instances valveNrOne and valveNrTwo are both instances of the
class valve. The first valve is instantiated without further adjustments of attributes, but the second valve’s attribute named closed is initially set to
true, and its position and visibility are assigned.
ProcSee Reference Manual
73
The Configuration Language
Shapes
Function calls and other non-constant expressions assigned to attributes
can be used to give an instance dynamic behaviour. In the example below,
the attribute Rad, which is defined in the class definition for a circularObject, has been set to equal the value returned from a function called radius() in another object called anotherObject.
Example:
instance circularObject
{
Rad = �anotherObject.radius()�;
x = 100;
y = 400;
}
Instances cannot be global to a configuration. They must occur within the
scope of a class, group, or picture definition.
Shapes
shape-definition:
shape-keyword identifieropt { shape-body}
shape-body:
shape-item
shape-body shape-item
shape-item:
assignment-statement
dialogue-definitionopt
shape-keyword:
circle
circleArc
circleSlice
dialogueArea
ellipse
ellipseArc
ellipseSlice
image
line
rectangle
polygon
text
trend
A Shape consist of a keyword and a shape body. It can, optionally, have an
identifier. A shape has a number of predefined attributes that are used to
set its position, size, colour, etc.
A shape can have dialogues associated with them. A dialogue definition
placed anywhere within a shape body will connect the dialogue to the
shape. An unlimited number of dialogues can be placed within a shapebody.
74
ProcSee Reference Manual
The Configuration Language
Shapes
Examples:
circle littleCircle { x = 10; y = 20; }
circle // without an identifier
{
dialogue // this dialogue is connected to the circle
{
event = �buttonPressed(1);�;
action = �{simpleValve.Closed = 1;}�;
}
x = 100;
y = 100;
radius = 20;
foregroundFillColour = �Green�;
visibility = 1;
}
Many of the predefined attributes have default values that are allocated if
no value is given. Some shapes require that certain attributes are allocated
values.
There are essentially two kinds of attributes; those that define the geometry
of a shape and those that define other features such as colours, fill patterns,
and so on. Most of the geometric attributes vary from shape to shape,
whereas the non-geometric attributes are the same for almost all of the
shapes.
Geometric attributes contained in all shapes are:
visibility
xReference
yReference
xScaleFactor
yScaleFactor
rotationAngle
foregroundColour
backgroundColour
foregroundFillColour
backgroundFillColour
If the visibility attribute is assigned a value of 0 then the shape will not
be visible. If the visibility is set to 1 then the shape will be visible. The
value can also be dependent on pTALK-code if the visibility of a shape
is to be dynamic.
The x-coordinate of the reference point used in rotation and scaling operations
The y-coordinate of the reference point used in rotation and scaling operations
The scale factor in the x-direction. The shape is scaled around the reference point. A negative value will mirror the shape around the x-axis.
The scale factor in the y-direction. The shape is scaled around the reference point. A negative value will mirror the shape around the y-axis.
The rotation angle of the shape, specified in degrees.
The non-geometric attributes that most shapes have are the following:
The foreground colour of the shape’s border, line, or text.
The background colour of the shape’s border, line or text.
The foreground colour of the shape’s fill.
The background colour of the shape’s fill.
ProcSee Reference Manual
75
The Configuration Language
fillPattern
lineWidth
linePattern
Circles
The pattern to be used for filled shapes.
The width (in the coordinate system units) of the border surrounding the
shape, or the width of the line. If a negative value is used, then the
lineWidth will be unchanged when x and yScaleFactor are different
from 1.
Similar to the fill pattern, but for the line or border rather than the fill.
Notable exceptions are the text, trend, line, image, and dialogue area
shapes. Text, line and trend shapes do not have all of the above attributes
available. Dialogue area and image shapes do not have any of the non-geometric attributes above. The entries for each shape that follow this general
description show which attributes each kind of shape has.
Colours, fonts, fill patterns, or line styles used should be defined in the application body or library body, unless a predefined value is used (such as
NoFill or SolidFill for fill patterns). If the value assigned to an attribute
does not exist, then the RTM will assign a default value when an attempt
is made to display the shape. The default value assigned will probably not
produce exactly the result intended, so it is important to check that all of
the resources that are required have been defined.
All attributes can be assigned to constants or to a dynamic pTALK expression:
visibility = � (RoomTemperature > 25) ? 1 : 0 �;
The above code defines that if a variable called RoomTemperature is
greater then 25 then the visibility is 1 (visible) otherwise the visibility is 0
(invisible). As the value of RoomTemperature changes, the visibility of
the shape containing this assignment will be adjusted accordingly.
A special "attribute" is shapeFlags which may be placed in any shape. It
typically is used for marking the shape as a drag and drop target. The
shapeFlags should only be present if it is set, and it can not have a dynamic
value.
Example: shapeFlags = "dndDropCopy,enterLeaveArea";
A shape can be placed in a class, picture, or group. The coordinates given
use the world coordinate system of the class or picture that the shape is
placed in.
Circles
The non-geometric attributes of a circle are similar to those of a rectangle,
ellipse, or polygon. A circle definition differs from other shape definitions
in that it has the following three geometric attributes:
x
y
radius
76
The centre x-coordinate.
The centre y-coordinate.
The radius.
ProcSee Reference Manual
The Configuration Language
Circle Arcs and Slices
circle
{
x = value;
y = value;
radius = value;
visibility = 1; // or 0 or pTALK-code
foregroundFillColour = value;
backgroundFillColour = value;
foregroundColour = value;
backgroundColour = value;
lineWidth = value;
linePattern = value;
fillPattern = value;
}
Example:
circle
{
x = 300;
y = 200;
radius = 150;
visibility = 1;
forgroundFillColour = �Red�;
}
In the example above, a circle will be drawn at the position 300, 200 with
a radius of 150. It will be visible and filled with the colour Red.
Circle Arcs and Slices
The non-geometric attributes of a circleArc are similar to those of a circle.
A Circle arc definition differs from that of a circle in that it has two additional geometric attributes:
startAngle
openingAngle
The angle of the point where the arc starts.
The opening angle of the arc.
ProcSee Reference Manual
77
The Configuration Language
Dialogue Areas
circleArc
{
x = value;
y = value;
radius = value;
startAngle = value;
openingAngle = value;
visibility = 1; // or 0 or pTALK-code
foregroundFillColour = value;
backgroundFillColour = value;
foregroundColour = value;
backgroundColour = value;
lineWidth = value;
linePattern = value;
fillPattern value;
}
Example:
circleArc
{
x = 300;
y = 200;
radius = 150;
startAngle = 30;
openingAngle = 60;
visibility = 1;
forgroundFillColour = �Red�;
}
This will draw a circular arc similar to the circle in the circle example, except that a start angle of 30 degrees has been set, and the arc has an opening
angle of 60 degree.
To draw circle slices, use the identifier circleSlice instead of circleArc.
Dialogue Areas
A dialogueArea is an invisible rectangle that has a position, height and
width. In practice it is identical to a rectangle with visibility permanently
set to 0. It is not a requirement that dialogues must be placed in a dia-
78
ProcSee Reference Manual
The Configuration Language
Ellipses
logueArea as it is a shape like all the others, but it is of little use when empty. The main reason for the existence of this shape is to aid migration from
Picasso-2 to ProcSee.
dialogueArea
{
dialogue { dialogue-body }
x = value;
y = value;
width = value;
height = value;
}
See the description of dialogues for a description of the layout of the dialogue body. In common with all shapes, there is no limit to the number of
dialogues that can be connected to a dialogueArea.
Example:
dialogueArea
{
dialogue
{
event = �buttonPressed(1)�;
action = �{ soundAlarm(); }�;
}
x = 500;
y = 500;
width = 200;
height = 100;
}
In above example, a dialogue has been placed in a dialogue area 200 wide
and 100 high at the position 500, 500.
Ellipses
The non-geometric attributes of an ellipse are the same as those of a circle.
An Ellipse definition differs from that of a circle in that an ellipse has two
geometric attributes to describe its radii whereas a circle has only a single
radius attribute:
xRadius
yRadius
The horizontal semi axis length
The vertical semi axis length
ProcSee Reference Manual
79
The Configuration Language
Ellipses
ellipse
{
x = value;
y = value;
xRadius = value;
yRadius = value;
visibility = 1; // or 0 or pTALK-code
foregroundFillColour = value;
backgroundFillColour = value;
foregroundColour = value;
backgroundColour = value;
lineWidth = value;
linePattern = value;
fillPattern = value;
}
Example:
ellipse
{
x = 300;
y = 200;
xRadius = 150;
yRadius = 250;
visibility = 1;
forgroundFillColour = �Red�;
}
This example will draw an ellipse with a horizontal radius of 150 and a vertical radius of 250 with its centre at the position 300, 200. It will be visible
and filled with the colour Red.
80
ProcSee Reference Manual
The Configuration Language
Ellipse Arcs
Ellipse Arcs
An ellipseArc is similar to a circle arc, but with two radii attributes.
ellipseArc
{
x = value;
y = value;
xRadius = value;
yRadius = value;
startAngle = value;
openingAngle = value;
visibility = 1; // or 0 or pTALK-code
foregroundFillColour = value;
backgroundFillColour = value;
foregroundColour = value;
backgroundColour = value;
lineWidth = value;
linePattern = value;
fillPattern = value;
}
Example:
ellipseArc
{
x = 300;
y = 200;
xRadius = 150;
yRadius = 250;
startAngle = 30;
openingAngle = 60;
visibility = 1;
forgroundFillColour = �Red�;
}
This will draw a elliptical arc similar to the ellipse in the ellipse example,
except that a start angle of 30 degrees has been set, and the arc has an opening angle of 60 degree.
To draw ellipse slices, use the identifier ellipseSlice instead of ellipseArc.
Images
A graphical image is a picture file of one of the following formats1:
bmp - Windows Bitmap
gif
- Compuserve Graphics Interchange
1. Unix versions of ProcSee does not support the bmp or wmf image formats.
ProcSee Reference Manual
81
The Configuration Language
Images
jpg
- Joint Picture Group
png - Portable Network Graphics
pcx - Zsoft PaintBrush
tiff
- Tagged Image File Format
tga
- Truevision Targa
wmf - Windows Meta File
xwd - X-Windows Bitmap
All these file formats can be inserted as a ProcSee shape.
Images attributes:
x
y
filename
visibility
xReference
yReference
xScaleFactor
xScaleFactor
rotationAngle
The top left corner x-coordinate.
The top left corner y-coordinate.
The filename for the image file.
The image shapes visibility.
The x-coordinate of the reference point used in rotation and scaling operations.
The y-coordinate of the reference point used in rotation and scaling operations.
The scale factor in the x-direction. The shape is scaled around the reference point.
The scale factor in the y-direction. The shape is scaled around the reference point.
The rotation angle of the shape, specified in degrees.
The image can be rotated at any angle, and it can even be flipped in any
direction by using the xScaleFactor and yScaleFactor attributes.
82
ProcSee Reference Manual
The Configuration Language
Lines
Example:
image
{
x = value;
y = value;
filename = string-literal;
visibility = 1; // or 0 or pTALK-code
rotationAngle = value;
xScaleFactor = value;
yScaleFactor = value;
}
image
{
x = 300;
y = 200;
filename = "myImage";
visibility = 1;
rotationAngle = 47;
xScaleFactor = 2;
yScaleFactor = 2;
}
The example above will position the image stored in the image file "myImage" at the position 300, 200, the image will be visible, rotated 47 degrees, and zoomed to twice the size in both directions.
RotationAngle are default 0, and xScaleFactor / yScaleFactor are default
1, so these do not have to be specified unless you want other values.
Lines
A line has a number of points, pairs of coordinates, and five non-geometric
attributes.
The foregroundColour is always used, but the backgroundColour only
has any significance if a lineStyle other than SolidStyle is used. The
lineWidth defines the thickness of the line.
The number of points, and the point coordinates must always be given. Default values exist for a line’s visibility, colours, line width and line style.
The points are defined using an array-like notation:
point[ pointNumber ] = ( x-coordinate, y-coordinate );
where the pointNumber is between 0 and the value assigned to the attribute
numberOfPoints. The coordinates may be assigned either numerical values or dynamic values (values dependent on a numerical value returned
from some pTALK code).
ProcSee Reference Manual
83
The Configuration Language
Lines
There is a special case for lines where the values of the points are stored in
a pair of arrays (usually defined in a database file, declared in the application body). Given two arrays of numerical values, of equal length (or at
least the same or longer length as the value assigned to numberOfPoints),
the points are defined using the following notation:
point[] = ( �ArrayOfXpoints�, �ArrayOfYpoints� );
where ArrayOfXpoints and ArrayOfYpoints are the identifiers for the two
arrays. Note that in this case there is no point index number between the
brackets ’[]’ after point.
line
{
numberOfPoints = n; // n is an integer-constant
point[0] = ( value, value );
point[1] = ( value, value );
point[...] = ( value, value );
point[n-1] = ( value, value );
visibility = 1; // or 0 or pTALK-code
foregroundColour = value;
backgroundColour = value;
lineWidth = value;
lineStyle = value; // NOTE: capital S !
}
line
{
mode = 1;
numberOfPoints = n; // n is an integer-constant
point[] = ( �pTALK-code�,�pTALK-code� );
// non-geometric attributes are the same as above.
}
The lineStyle can be set to NoStyle or SolidStyle, or to a style defined in
the application body or in a library that has been declared in the application
body.
84
ProcSee Reference Manual
The Configuration Language
Polygons
Example:
line
{
numberOfPoints = 4;
point[0] = ( 100, 100 );
point[1] = ( 200, 200 );
point[2] = ( 300, 300 );
point[3] = ( 400, 100 );
lineStyle = �myStyle�;
}
line
{
The first example above draws a line with four points, with default non-geometric attribute values for all of the values except the line style, where a
style called myStyle has been used, which should have been defined in the
application body or in a library body.
The second example draws a line with ten points, whose values are contained in two arrays, one called xPoints and the other called yPoints.
Polygons
A polygon has the same geometric attributes as a line, and the same nongeometric attributes to those of rectangles, circles, and ellipses. Unlike a
line, a polygon is a closed shape, and so the last point and first point given
will be joined together.
A polygon has a declared number of points, the points themselves, and
eight non-geometric attributes.
A fill pattern can be assigned using the attribute fillPattern and the foreground fill colour and background fill colour can be set using the foregroundFillColour and backgroundFillColour attributes. If there is no
fill pattern then neither of the fill colour values will be used. If the fill pattern is set to SolidPattern then only the foreground fill colour will be used.
The lineWidth attribute is for setting the width of the border around the
polygon. The border may also have a pattern and its own foreground and
background colours, which can be set using the foregroundColour and
backgroundColour attributes.
ProcSee Reference Manual
85
The Configuration Language
Polygons
The number of points, and the point coordinates must always be given. See
the explanation of how to define points in the section on lines.
polygon
{
numberOfPoints = n; // n is an integer-constant
point[0] = ( value, value );
point[1] = ( value, value );
point[2] = ( value, value );
point[...] = ( value, value );
point[n-1] = ( value, value );
visibility = 1; // or 0 or pTALK-code
foregroundFillColour = value;
backgroundFillColour = value;
foregroundColour = value;
backgroundColour = value;
lineWidth = value;
linePattern = value;
fillPattern = value;
}
polygon
{
numberOfPoints = n; // n is an integer-constant
point[] = ( �pTALK-code�,�pTALK-code� );
visibility = 1; // or 0 or pTALK-code
foregroundFillColour = value;
backgroundFillColour = value;
foregroundColour = value;
backgroundColour = value;
Example:
polygon
{
numberOfPoints = 3;
point[0] = ( 100, 100 );
point[1] = ( 200, 200 );
point[2] = ( 300, 300 );
}
polygon
{
numberOfPoints = 10;
point[] = ( �xPoints�, �yPoints� );
86
ProcSee Reference Manual
The Configuration Language
Rectangles
In the first example a three sided polygon will be drawn with three points
at the positions given. The non-geometric attributes will be set to default
values.
In the second example a ten sided polygon will be drawn with ten points,
whose coordinates are in two arrays, xPoints and yPoints. The polygon
will be filled with the colour Red.
Rectangles
A rectangle has four geometric attributes:
x
y
width
height
The top left corner x-coordinate.
The top left corner y-coordinate.
The width of the rectangle.
The height of the rectangle.
A rectangle also has eight non-geometric attributes.
A fill pattern can be assigned using the attribute fillPattern and the foreground fill colour and background fill colour can be set using the foregroundFillColour and backgroundFillColour attributes. If there is no
fill pattern then neither of the fill colour values will be used. If the fill pattern is set to SolidPattern then only the foreground fill colour will be used.
The line width gives the thickness of the border around a rectangle. The
border may also have a pattern and its own foreground and background
colours. The width of the border is set by assigning a value to the attribute
lineWidth and the fill pattern of the border is set by assigning a value to
the attribute linePattern. Its colours are set using the foregroundColour
and backgroundColour attributes.
rectangle
{
x = value;
y = value;
width = value;
height = value;
visibility = 1; // or 0 or pTALK-code
foregroundFillColour = value;
backgroundFillColour = value;
foregroundColour = value;
backgroundColour = value;
lineWidth = value;
linePattern = value;
fillPattern = value;
}
ProcSee Reference Manual
87
The Configuration Language
RoundRects
Example:
rectangle
{
x =10;
y = 20;
width = 100;
height = 100;
foregroundFillColour = �Red�;
In the example above a rectangle will be drawn at position 10, 20 with a
width of 100 and a height of 100 (this will, of course, be a square). The rectangle will be filled with the colour Red.
RoundRects
A roundRect has six geometric attributes:
x
The top left corner x-coordinate.
y
The top left corner y-coordinate.
The width of the roundRect.
The height of the roundRect.
Specifies additional properties for the RoundRect shape.
The x radius of the roundRect corners.
The y radius of the roundRect corners.
width
height
flags
xRadiusCorner
yRadiusCorner
A roundRect also has eight non-geometric attributes.
A fill pattern can be assigned using the attribute fillPattern and the foreground fill colour and background fill colour can be set using the foregroundFillColour and backgroundFillColour attributes. If there is no
fill pattern then neither of the fill colour values will be used. If the fill pattern is set to SolidPattern then only the foreground fill colour will be used.
The line width gives the thickness of the border around a roundRect. The
border may also have a pattern and its own foreground and background
colours. The width of the border is set by assigning a value to the attribute
lineWidth and the fill pattern of the border is set by assigning a value to
the attribute linePattern. Its colours are set using the foregroundColour
and backgroundColour attributes.
88
ProcSee Reference Manual
The Configuration Language
Text
roundRect
{
x = value;
y = value;
width = value;
height = value;
xRadiusCorner = value;
yRadiusCorner = value;
flags = "value";
visibility = 1; // or 0 or pTALK-code
foregroundFillColour = value;
backgroundFillColour = value;
foregroundColour = value;
backgroundColour = value;
lineWidth = value;
linePattern = value;
fillPattern = value;
Example:
roundRect
{
x =10;
y = 20;
width = 100;
height = 200;
xRadiusCorner = 20;
yRadiusCorner = 20;
foregroundFillColour = �Red�;
}
In the example above a roundRect will be drawn at position 10, 20 with a
width of 100 and a height of 200. The radius of the corners will be (20,20).
The roundRect will be filled with the colour Red.
Text
A text shape has four main attributes (i.e. not including its colours and visibility). In addition to the text’s position are:
format
theText
theFont
alignment
The format of the text.
The actual text to be written.
The font to be used.
The alignment of the text.
The foreground colour is the colour of the actual text, whereas the background colour is the colour of the rectangular area that surrounds the text.
ProcSee Reference Manual
89
The Configuration Language
Scales
The fonts used should be defined in a library or in the application body.
Both 8 bits and 16 bits fonts are supported.
Note that even though a text has rotation and scaling attributes (as described for shapes in section "Shapes" on page 74), the text itself cannot be
rotated or scaled, only its position.
The format is a string that is equivalent to the format used in a printf call.
The theText attribute is the only argument for this format. If the format includes a length, the string is shown with this number of ’*’-characters instead of the value when the value requires more space than this length. The
most commonly used formats are "%s" which declares that the text is a
string of characters, and "%d" which declares that an integer number is to
be written.
text
{
x = value;
y = value;
format = string-literal;
theText = string-literal; // or a value
alignment = value;
visibility = 1; // or 0 or pTALK-code
foregroundColour = value;
backgroundColour = value;
theFont = value;
}
Example:
text
{
x = 200;
y = 250;
format = "%s";
theText = "Hello World";
alignment = 0;
foregroundColour = �White�;
theFont = �Times�;
In the above example, the phrase Hello World will be written using the
font Times in the colour White. The format has been set to %s to declare
that the text is a string. The text will be written at the position 200, 250.
Scales
A scale has five geometric attributes:
x
y
length
90
The top left corner x-coordinate.
The top left corner y-coordinate.
The length of the scale shape.
ProcSee Reference Manual
The Configuration Language
lengthMajorTicks
lengthMinorTicks
Scales
The length of the major ticks.
The length of the minor ticks.
The scale shape has three label attributes:
format
offset
theFont
alignment
flags
majorTickStepValue
minorTickSteps
maxValue
minValue
The format of the labels.
The offset to the labels.
The font to be used.
The alignment of the text.
The scale shape has scale attributes:
Specifies additional properties for the scale shape.
Value between the major tick steps.
Number of minor tick steps between two major ticks.
Maximum value.
Minimum value.
A scale shape also has four colour and pattern attributes.
The line width gives the thickness of the line used by the scale shape. The
border may also have a pattern and its own foreground and background
colours. The width of the border is set by assigning a value to the attribute
lineWidth and the line pattern of the border is set by assigning a value to
the attribute linePattern. Its colours are set using the foregroundColour
and backgroundColour attributes.
scale
{
backgroundColour = value;
flags = string-literal;
foregroundColour = value;
format = string-literal;
length = value;
lengthMajorTicks = value;
lengthMinorTicks = value;
linePattern = value;
lineWidth = value;
majorTickStepValue = value;
minorTickSteps = value;
offset = value;
theFont = value;
visibility = 1; // or 0 or pTALK-code
x = value;
y = value;
alignment = value;
}
ProcSee Reference Manual
91
The Configuration Language
Trend
Example:
scale
{
backgroundColour = ВґwhiteВґ;
flags = "startAt=none, labelOverlap=hide";
foregroundColour = ВґblueВґ;
format = "%.2f";
length = 100;
lengthMajorTicks = 5;
lengthMinorTicks = 2;
majorTickStepValue = 10;
minorTickSteps = 4;
offset = 20;
visibility = 1; // or 0 or pTALK-code
x = 100;
y = 100;
alignment = 33;
}
Trend
trend-definition:
trend identifieropt { trend-body }
trend-body:
trend-item
trend-body trend-item
trend-item:
trendplot-definition
trendlabels-definition
trendruler-definition
trendgrid-definition
eventplot-definition
assignment-statement
trendplot-definition:
trendPlot identifieropt { trendplot-body }
trendplot-body:
trendplot-assignment-statement
trendplot-body trendplot-assignment-statement
trendplot-assignment-statement:
assignment-statement
tr-assignment-statement
tr-assignment-statement:
identifier = tr( value );
trendlabels-definition:
trendLabels identifieropt { trendlabels-body }
trendlabels-body:
assignment-statement
trendlabels-body assignment-statement
92
ProcSee Reference Manual
The Configuration Language
Trend
trendruler-definition:
trendRuler identifieropt { trendruler-body }
trendruler-body:
assignment-statement
trendruler-body assignment-statement
trendgrid-definition:
trendGrid identifieropt { trendgrid-body }
trendgrid-body:
assignment-statement
trendgrid-body assignment-statement
eventplot-definition:
eventPlot identifieropt { eventplot-body }
eventplot-body:
assignment-statement
eventplot-body assignment-statement
Trend defines the position, height, width, colours, fonts, and other user definable attributes of the area in which trend plots are to be displayed.
The trendPlot, trendLabels, trendRuler, trendGrid and eventPlot themselves are defined within the scope of the trend. Any number of trendPlot,
trenbels, trendRuler, trendGrid and eventPlot can be defined within a trend
shape’s body.
ProcSee Reference Manual
93
The Configuration Language
Trend
trend anOptionalName
{
trLog = string-literal;
x = value;
y = value;
height = value;
width = value;
visibility = 1; // or 0 or pTALK-code
backgroundColour = value;
foregroundColour = value;
backgroundFillColour = value;
foregroundFillColour = value;
lineWidth = value;
linePattern = value;
fillPattern = value;
timespan = value;
orientation = value;
scroll = value;
updateMode = value;
trendPlot anOptionalName
{
variable = string-literal;
presentation = value;
upperLimit = value;
lowerLimit = value;
visibility = value;
logFrequency = value;
foregroundFillColour = value;
backgroundFillColour = value;
foregroundColour = value;
backgroundColour = value;
lineWidth = value;
linePattern = value;
fillPattern = value;
autoScale = value;
upperBand = value;
lowerBand = value;
visibility = 1; // or 0 or pTALK-code
}
94
ProcSee Reference Manual
The Configuration Language
Trend
trendLabels anOptionalName
{
offset = value;
alignment = value;
interval = value;
theFont = value;
format = string-literal;
visibility = 1; // or 0 or pTALK-code
foregroundColour = value;
backgroundColour = value;
}
trendRuler anOptionalName
{
visibility = 1; // or 0 or pTALK-code
foregroundColour = value;
backgroundColour = value;
lineWidth = value;
linePattern = value;
rulerIsSelected = value;
} // end of trendRuler
trendGrid anOptionalName
{
depthPosition = value;
noOfLines = value;
timeInterval = value;
timeOffset = value;
visibility = 1; // or 0 or pTALK-code
lineWidth = value;
linePattern = value;
foregroundColour = value;
backgroundColour = value;
} // end of trendGrid
eventPlot anOptionalName
{
event = value;
offset = value;
shape = value;
theTrendPres = value;
visibility = 1; // or 0 or pTALK-code
} // end of eventPlot
}
// end of trend
ProcSee Reference Manual
95
The Configuration Language
Trend
Trend Attributes
The attributes specific to the trend shape are described below.
trLog
timespan
orientation
scroll
updateMode
The name of the trend log from where it is to receive its historic trend
data.
The number of seconds for which the trend. diagram is to show data.
Whether to plot the trend curves from left to right, right to left or circular.
Scrolls this percentage when one of the curves reaches the trend diagram’s last time.
The update mode to use for the trend.
TrendPlot Attributes
The attributes specific to the trendPlot shape is described below:
variable
Either the name of the variable to trend as a string ("MyVar1"), or a
pTALK expression containing a pointer to a variable to be trended (�aVarPointer�, assuming that aVarPointer is of pointer type).
presentation
Nine trend presentation forms are available. These are line, layer, step
with fill, step as line, layer and step with fill to offset, layer difference
which fills the area between two trend plots, layer and step which fills
the area above the trend plot.
The largest value that will be shown in the trend diagram.
The smallest value that will be shown in the trend diagram. The upperLimit and lowerLimit attributes define the value range of the trended
variable.
The number of seconds between each time the variable is logged. This
should be equal to the lCycle attribute defined for the corresponding
variable in the trend log variable file (see section "Trend Variable Configuration File" on page 103)
Turn auto scaling of the curve on or off.
Defines a band between the trend curve’s highest value and the trend.
Only used when autoscale is on.
Defines a band between the trend curve’s lowest value and the trend.
Only used when atuoscale is on.
upperLimit
lowerLimit
logFrequency
autoScale
upperBand
lowerBand
TrendLabelsAttributes
The attributes specific to the trendLabels shape are described below:
offset
alignment
interval
96
The relative position of the trendLabels in relation to the trend diagram.
A negative value will position the trendLabels above the trend diagram,
a positive value below.
The trend labels can be left, centred or right aligned.
The number of seconds between each label. If a trend is defined with a
timespan of 240 seconds, and a corresponding timeLabel is defined with
interval of 60 seconds, the trendLabel will consist of 5 texts.
ProcSee Reference Manual
The Configuration Language
format
Trend
The text format of the labels. The formats supported are the same as
those of the strftime(3C) function.
TrendRuler Attributes
The attributes specific to the trendRuler shape are described below:
rulerIsSelected
This attribute is used to set whether the ruler is active or not. A value of
1 means that it is active, whereas a value of 0 means that it is not selected.
TrendGrid Attributes
The attributes specific to the trendGrid shape are described below:
timeInterval
The grid can be placed behind any other trend shape, above any trend
shape but behind the rulers or above the rulers as well.
This attribute determines the number of horizontal lines the grid consists of.
Number of seconds between two vertical grid lines.
timeOffset
Number of seconds to the first vertical grid line.
depthPosition
noOfLines
EventPlot Attributes
The attributes specific to the eventPlot shape are described below:
event
shape
theTrendPres
offset
The name of an event type. This name must be specified in the trend variable configuration file.
Either a name of a class or a pTALK function with the following prototype: Shape* (*func)( char* owner, int theTime, void* data ). If setting
this attribute equal to a class then the eventPlot class will create instances of this class for all events. If it points to a pTALK function, then the
pTALK function can determine the shape to create based on the parameters theTime and/or data. The data passed as argument to the pTALK
function is a pointer to the data sent when the event was added.
This attribute is the name of a trend presentation in the same trend diagram as the eventPlot shape, or it is null. If it is set equal to a trend presentation then the shapes will be positioned on the trend curve. If set to
null all the shapes will be position in the middle of the trend diagram.
See also description of the attribute offset.
An offset added to current position. If the attribute theTrendPres is null
the position is half the height of the trend diagram, otherwise the position is the trend curve at the timestamp when the event occured.
ProcSee Reference Manual
97
The Configuration Language
Trend
Example
trend TrendDiagram1
{
trLog ="MyTrendLogger";
x = 10;
y = 20;
height = 300;
width = 500;
visibility = 1;
backgroundColour = �DarkGrey�;
foregroundColour = �LightGrey�;
backgroundFillColour = �DarkGrey�;
foregroundFillColour = �LightGrey�;
lineWidth = 1;
linePattern = 2;
fillPattern = 1;
timespan = 240;
orientation = 0;
scroll = 0;
updateMode = 2;
trendPlot plot1
{
variable = "SimVar1";
presentation = 0;
upperLimit = �Sim.HighValue�;
lowerLimit = �Sim.LowValue�;
visibility = 1;
logFrequency = 10;
foregroundFillColour = 0;
backgroundFillColour = 0;
foregroundColour = �Red�;
backgroundColour = �Green�;
lineWidth = 2;
linePattern = 1;
fillPattern = 0;
autoScale = 0;
upperBand = 0;
lowerBand = 0;
visibility = 1;
}
trendLabels label1
{
offset = 15;
alignment = 0;
interval = 0;
theFont = �Helvetica�;
format = "%M:%S";
visibility = 1;
foregroundColour = �Black�;
backgroundColour = �LightGrey�;
}
98
ProcSee Reference Manual
The Configuration Language
Internal Trend Log
trendRuler Ruler1
{
visibility = 1; // or 0 0r pTALK-code
foregroundColour = �Black�;
backgroundColour = -1;
lineWidth = 1;
linePattern = 1;
rulerIsSelected = 1;
} // end of trendRuler
trendGrid Grid1
{
visibility = 1; // or 0 0r pTALK-code
depthPosition = 0;
noOfLines = 5;
timeInterval = 60;
timeOffset = 0;
lineWidth = 0;
linePattern = 1;
foregroundColour = �Black�;
backgroundColour = -1;
} // end of trendGrid
eventPlot Event1
{
event = "MyEvent";
offset = 0;
shape = "MyLib.MyClass";
theTrendPres = �plot1�;
visibility = 1; // or 0 or pTALK-code
} // end of eventPlot
dialogue
{
event = `cursorMoved() `;
action = `{
Ruler1.moveRuler();
theWindow().update();
}`;
}
}
In this example a trend area of size 500 by 300 will be drawn at the position
10,20. The trend will plot the value of the variable SimVar1 (note that in
this example the variable is given as a string literal) within the limits defined in the trendPlot body.
Internal Trend Log
trendlog-definition:
trendLogInternal identifieropt { trendloginternal-body }
ProcSee Reference Manual
99
The Configuration Language
Internal Trend Log
trendloginternal-body:
trendloginternal-item
trendloginternal-body trendloginternal-item
trendloginternal-item:
assignment-statement
function-definition
The Trend object described above only handles the display of the historic
trend data. A separate part of the system, the trend log, takes care of logging the actual values of the variables specified for trending.
trendLogInternal anOptionalName
{
diskLogLimIntvl = value;
timeTickIntvl = value;
timeMaster = value;
timeVariable = string-literal;
trendVariableFile = string-literal;
logDirectory = string-literal;
eventPlotFile = string-literal;
diskFlushIntvl = value;
diskBufferSize = value;
diskForceWrite = value;
}
TrendLogInternal Attributes
diskLogLimIntvl
timeTickIntvl
timeMaster
timeVariable
trendVariableFile
100
The limit for logging to disk in number of seconds. Variables that are
logged more frequently will be logged in memory instead of disk.
The interval with which the trend log will be 'ticked' by the source indicated in the timeMaster attribute. A value of 10 means that the trend log
will be run (and possibly log variable) every 10 seconds.
The source that is responsible for updating the time. A value of 1 indicates the SWBus Library, a value of 2 indicates an external task, a value
of 3 indicates that the user is updating the time through the pTALK language, and a value of 4 indicates an external task but automatically
switching to SWBus Library when the task does not send updates. If the
timeMaster attribute is not present the SWBus Library will update the
time.
The name of a variable created by the external process providing the
time tick. The external process is responsible for updating the variable
with the current time for each interval specified by the timeTickIntvl parameter. This attribute is only valid if timeMaster is set to an external
task (2 or 4).
The name of the file (including path if necessary) where the trend variables are specified.
ProcSee Reference Manual
The Configuration Language
eventPlotFile
logDirectory
diskBufferSize
diskForceWrite
diskFlushIntvl
External Trend Log
Writing variables to disk (lcycle in the trend variable specification file
is greater than or equal to diskLogLimIntvl in trend logger) can be time
consuming because disk is a slow medium compared to memory. For
this reason, the trend logger has optional parameters that can be used to
tune performance according to the demands of different applications.
Reasonable default values are supplied.
The name of the configuration file (including path if necessary) where
events are specified.
The directory where to store the trend log files (.dir, .log and .elog files).
This directory will be created if it does not exist.
A buffer is used to store a set of values in memory before writing to file.
This reduces the number of disk accesses. The value of diskBufferSize
is the number of values stored in memory before writing to disk. Default
is set to 30 values.
Used together with diskBufferSize to control writing to disk. Buffered
disk writing works well if a variable is logged on a frequent interval, say
every 10 second. However, if a trend variable is set up to be logged on
disk every hour, it would take 30 hours before the values was actually
stored on disk because there are 30 values in disk buffer. The variable
can be forced written to disk say every 5 hour by setting diskForceWrite
to 18000 (note value in seconds). Default is set to 120 seconds.
When logging data to disk, the operating system does not regularly
write your log file to the physical disk device. The diskFlushIntvl parameter states in seconds the interval at which the file will be guaranteed
written physically to disk. Flushing disk buffers may add additional
CPU load to your system, but it will minimize data loss if the system
halts for some reason. Default is no flushing.
Example:
trendLogInternal myTrendLogger
{
diskLogLimIntvl = 60;
timeTickIntvl = 5;
timeMaster = 2; // external task
timeVariable = "globalTime";
trendVariableFile = "TrendVarSpecs.ptrv";
eventPlotFile = "EventSpecs.pevl";
logDirectory
= "../LOG";
}
External Trend Log
trendlog-definition:
trendLogExternal identifieropt { trendlogexternal-body }
trendlogexternal-body:
trendlogexternal-item
trendlogexternal-body trendlogexternal-item
ProcSee Reference Manual
101
The Configuration Language
External Trend Log
trendlogexternal-item:
assignment-statement
function-definition
The trend log system in an application can be set up such that one central
trend logger is serving one or several RTM’s with historical data. This is
referred to as an external trend logger. An internal trend logger is a
trend log system where one RTM is both displaying trend curves and logging historical data.
In case of an external trend logger, the central trend logger requires a trend
log specification as described above. The RTM’s that is responsible of displaying trend curves in such a system needs a special trend log specification. Hence, separate application Tdoc files are required in such a system.
If the process variables in all RTM’s in the external trend log system is updated by one external application, then the name of the application and the
process where the variables reside must be the same in all RTM’s. Optionally both name of the application and process can be specified
trendLogExternal anOptionalName
{
extLogRTM = string-literal;
extLogApp = string-literal;
extLogProc = string-literal;
}
TrendLogExternal Attributes
extLogRTM
extLogApp
extLogProc
This is the name of the central trend logger specified by the -n option
when starting the RTM. Default name is rtm.
Optionally the name of the application where trend variables reside can
be specified
Name of process in external application if different from current RTM
(Optional)
Example:
trendLogExternal myTrendLogger
{
extLogRTM = "Logger";
extLogApp = "System";
extLogProc = "PAgent";
}
102
ProcSee Reference Manual
The Configuration Language
Trend Variable Configuration File
Notice that these attributes also support enviroment variables. The attribute
values will be expanded with the shell environment settings before connecting to the external trend logger, for instance:
trendLogExternal myTrendLogger
{
extLogRTM = "$(EXTLOGRTM)";
extLogApp = "System";
extLogProc = "Agent$(NUM)";
}
Trend Variable Configuration File
trendvarconfig-definition:
trendVarConfig identifier { trendvarconfig-body }
trendvarconfig-body:
trendvar-definition
trendvarconfig-body trendvar-definition
trendvar-definition:
trendVar identifier { trendvar-body }
trendvar-body:
assignment-statement
trendvar-body assignment-statement
eventvar-definition:
eventVar identifier { eventvar-body }
eventvar-body:
assignment-statement
eventvar-body assignment-statement
The trend variable configuration file constis of a list of trend variables and
event types that are to be trended in the system. Each entry in this list has
a description of the attributes associated with trending a variable or event.
A single trend log in the RTM can load different configuration files for
trend variables and events.
When compiling the configuration file by pcc, two binary files are created:
identifier.ptrv and identifier.pevl. Note that trend variables and event types
can also be added using the pTALK functions TrendLog::addVariable
and TrendLog::addEvent.
A trend variable can be either a process variable or an attribute. Each trend
variable has 5 attributes associated with it.
ProcSee Reference Manual
103
The Configuration Language
Trend Variable Configuration File
Syntax:
trendVarConfig aFileName
{
trendVar aVarName
{
lCycle=value;
hist=value;
type=value;
lo=-value;
hi=value;
}
}
TrendVariable Attributes
lCycle
hist
type
lo
hi
The log cycle (in seconds) of the variable. That is how often the variable
is logged in memory or disk. Note that this log cycle should not be faster
than the timeTickInterval specified in the trend log directive.
The size of the history (in seconds) for the trend variable.
How the variable is to be logged:
1 - log average value
2 - log min value
3 - log max value
4 - alternate log between max/min
5 - log actual value
6 - log as often as possible; at every time
tick. Note that the log frequency of the trend variable in this mode must
be equal to the timeTickIntvl in the trend logger. Otherwise they will be
forced equal and a warning will be issued.
7 - predictive variable; only work for set of data. Variables of predictive
type will not be updated at each time tick.
The smallest value that will be logged.
The largest value that will be logged.
Example:
trendVarConfig TrendVarSpecs
{
trendVar SimVar1
{
lCycle=10;
hist=3600;
type=5;
lo=-999999;
hi=999999;
}
}
104
ProcSee Reference Manual
The Configuration Language
Trend Variable Configuration File
An event is specified using a data type and a history. The data type can be
any predifined or user defined data type as long as they do not contain
pointers. Pointer data types are not supported. To view an event an eventPlot must be created in a trend diagram. Each event has 2 attributes associated with it in the trend configuration file.
Syntax:
trendVarConfig aFileName
{
eventVar eventName
{
datatype=string-literal;
hist=value;
}
}
TrendEvent Attributes
datatype
hist
The data type for the event. This data type must be either a predefined
data type or an user-defined struct declaration. The predefined data
types are int, float, double etc. All user-defined data types must be declared in pdat files and loaded into the rtm using the database "myFile.pdat"; statement. Pointer data types are not legal as a data type for
an event. Struct declarations used in events can not contain fields of type
pointer. Arrays can be specified using either the syntax datatype[num]
or datatype#num.
The size of the history (in seconds) for the event variable. Events will
be autmatically deleted from the log when their history expires.
Example:
trendVarConfig EventVarSpecs
{
eventVar Event1
{
datatype="int32";
hist=3600;
}
eventVar Event2
{
datatype="float[10]";
hist=7200;
}
}
ProcSee Reference Manual
105
The Configuration Language
COM Configuration
COM Configuration
COM is only supported on the Windows platform. Loading an application
into the RTM on a Unix platform will fail if it contains COM definitions.
The declarations for the COM types follow here:
comLibrary
comLib-decl:
comLibrary identifier { comLib-body }
comLib-body:
comLib-item
comLib-body comLib-item
comLib-item:
assignment-statement
comClass-decl
comInterface-decl
comEnum-decl
ComLibraries are used as a container for the declarations of the comClasses, comInterfaces, and comEnums which should be available to the user
when using COM components. It must include a LIBID, which is used to
find the comLibrary.
Example:
comLibrary myComLib
{
LIBID = "TheComLibGUID ";
majorVersion = 1;
minorVersion = 0;
}
comClass
comClass-decl:
comClass identifier { comClass-body }
comClass-body:
assignment-statement
ComClasses are used to declare the COM component definitions which
should be available to the user. It must include a CLSID, which is used to
find the comClass. comClass is normally not specified, unless the comClass is renamed.
Example:
comClass myComClass
{
CLSID = "TheComClassGUID ";
}
106
ProcSee Reference Manual
The Configuration Language
COM Configuration
comInterface
comInterface-decl:
comInterface identifier { comInterface-body }
comInterface-body:
assignment-statement
ComInterfaces are used to declare the COM interface definitions which
should be available to the user when using COM components. It must include an IID, which is used to find the comInterface. comInterface is normally not specified, unless the comInterface is renamed.
Example:
comInterface myComInterface
{
IID = "TheComInterfaceGUID ";
}
comEnum
comEnum-decl:
comEnum identifier { comEnum-body }
comEnum-body:
assignment-statement
ComEnums are used to declare the constants available when using COM
components. It must include an ENUMID, which is used to find the
comEnum. comEnum is normally not specified, unless the comEnum is renamed. However, not all comEnums have ENUMIDs. These can not be renamed, and can not be specified in the .Tdoc file.
Example:
comEnum myComEnum
{
ENUMID = "TheComEnumGUID ";
}
ProcSee Reference Manual
107
The Configuration Language
COM Configuration
comObject
comObj-def:
comObject comClassId identifier { comObj-body }
comClassId:
identifier
longName
fullName
comObj-body:
comObj-item
comObj-body comObj-item
comObj-item:
comInterfaceObj-def
comEventObj-def
attribute-definition
function-definition
ComObjects are used to define the COM objects that should be running in
the RTM.
comShape
comShape-def:
comShape comClassId identifieropt { comShape-body }
comClassId:
identifier
longName
fullName
comShape-body:
comShape-item
comShape-body comShape-item
comShape-item:
comInterfaceObj-def
comEventObj-def
attribute-definition
function-definition
ComShapes are used to define COM objects that should be running in the
RTM, that may have a visible appearance. (Often called ActiveX controls.)
ComShapes have x, y, width, and height, and other attributes and functions
related to the display of the comShape.
comInterfaceObject
comInterfaceObj-def:
comInterfaceObject comInterfaceId identifier { comItfObj-body }
comInterfaceId:
identifier
longName
fullName
comItfObj-body:
comItfObj-item
comItfObj-body comItfObj-item
comItfObj-item:
assignment-statement
108
ProcSee Reference Manual
The Configuration Language
COM Configuration
ComInterfaceObjects are used to access the COM objects running in the
RTM. Assignment-statements in the comInterfaceObject are used for dynamics.
comEventObject
comEventObj-def:
comEventObject comInterfaceId identifier { comEventObj-body }
comInterfaceId:
identifier
longName
fullName
comEventObj-body:
comEventObj-item
comEventObj-body comEventObj-item
comEventObj-item:
function-definition
ComEventObjects are used to get callbacks from the COM objects running
in the RTM. A function in the comEventObject is called by the COM object if the function name matches the name of a function in the interface.
ProcSee Reference Manual
109
The Configuration Language
COM Configuration
Example:
comObject myComLib.myComClass myComObj
{
persist = 1;
data = "3242323233423213424164312391242..."
"903234234234234304324253043552358";
comInterfaceObject myComLib.myComItf itf {}
comEventObject myComLib.myComItf ev {}
}
comShape MSForms.CheckBox
{
x = 100; y = 105;
width = 145; height = 20;
visibility = 1;
foregroundColour = `white`;
backgroundColour = -1;
theFont = `helv_12`;
persist = 1;
data = "003204312312321412412412391242..."
"90324324820395230423048230482308";
comEventObject MSForms.MdcCheckBoxEvents dei
{
function `void Change()
{
printf("Toggled: %d", di.Value);
}`
}
comInterfaceObject MSForms.IMdcCheckBox di
{
ForeColor = `myComColFunc()`;
}
function `void onUpdate()
{
sprintf(buf,"abc %d", random(10000));
di.Caption = buf;
}`
}
110
ProcSee Reference Manual
The ProcSee database file format (.pdat)
Introduction
The ProcSee database file format (.pdat)
The ProcSee database files are used to define variables and struct data
types in RTMs and applications.
Introduction
A database file used by ProcSee is a text file containing definitions of
struct data types, variables, forward declarations, and pragma directives.
ProcSee accepts one or several database files to be loaded into a process in
the RTM.
A good guideline for developing ProcSee applications, are to separate the
variables and struct definitions in several files. The struct definitions
should normally be located in a dedicated file, separating them from the
variable definitions and variable initialization. Since the syntax of the
struct definitions resembles the "C" programming language (except for the
struct field initialization), these database files can be more or less included
directly into application source code (#include in a "C" language source
file).
A database file can, and will in most cases, be used both by the RTM and
the application program (loaded into the application using PfReadScript).
To be able to transfer variable values between an application and a RTM,
the variables and their data types have to be known and be of the same data
type in both processes. The easiest and least error prone method to achieve
this is to use database files. Struct definitions are a lot easier to specify in
a database file compared to using API functions.
ProcSee uses process variables to transfer updated data values between an
application and a RTM. These process variables can be linked dynamically
to GUI components, which automatically will be update by the RTM. In
many cases when designing a ProcSee application, the GUI is created
without the application program running. To be able to link process variables to GUI components, these variables must exist and be loaded into a
process in the RTM using one or several database files.
ProcSee Reference Manual
111
The ProcSee database file format (.pdat)
The database file
To load a database file into the RTM, insert the following entry in the application resource file (<applicationName>.Tdoc):
database "./filename.pdat";
The database files can also be read by the application using the API function PfReadScript(3c).
In the ProcSee documentation the terms structures and records may be
used interchangeably. Both refer to the type specified struct.
The database file
The database file should have .pdat as file extension. The database file is
a human readable ascii file, defining structs, and variables, including default values for the variables. The file contains six types of constructs:
struct definitions, struct declarations, variable definitions, variable initialization, function declarations and pragma directives.
Structure Definitions and Declarations
Structure definitions start with the keyword struct, followed by the name
of the type name that we want to use for this structure. After the structure
name, the definition of the struct consists of lines of struct field definitions.
The start of these definitions is marked by a left curly brace {, and the end
of the struct definition is marked by a right curly brace } followed by a semicolon ;. Struct field definitions look exactly like variable definitions.
Possible initialization values in the struct only take effect reading the database file from the application, and are more like default values, in that the
values of the struct fields are often set later by the use of variable initialization constructs.
If a structure definition does not have the { struct-fields } part, it is called
a structure declaration, and is used in cases where a pointer to the structure
is needed before the definition of the structure.
Variable Definitions
Variable definitions start with a type name, which can be one of the following types: int32, uint32, int16, uint16, char, float, double, void, or a
struct name. After the type name a pointer operator * can be specified if
the variable is to be a pointer to the specified type. The variable name to
define follows after this. If the variable should be an array, the size of the
array is specified after the variable name. The array size is specified inside
square brackets [,]. Then there can be a possible initialization. The initialization starts with =, and consists of an integer, character, string or floating
point constant. The variable definition end with a semicolon ; .
112
ProcSee Reference Manual
The ProcSee database file format (.pdat)
The database file
Variable Initialization
Variable initialization consists of a variable name, eventually with array indexes [ integer constant ] , eventually concatenated with a dot . by one or
more struct field names with eventual array indexes. This location is then
followed by = followed by a constant as described above. The variable initialization ends with a semicolon ; .
Function Declarations
The remote functions that a process defines, can be declared in the .pdat
files, to allow the RTM to compile pTALK code containing call to remote
functions, without the process being connected. These function declarations start with the type void, followed by the name of the function and the
function arguments inside parentheses. Then a semicolon ; ends the declaration.
Pragma Directives
A pragma directive in ProcSee .pdat files provides additional information
to the RTM, or the application when reading database files using PfReadScript. The syntax of a pragma directive is #pragma followed by a string
or directive, like #pragma PpPush. The directive is interpreted by the
RTM or the API (application). Notice that if a pragma directive is unknown, it is ignored without issuing any warning. Therefore, it is important
that pragma directives are not misspelled.
All the directives used by ProcSee begins with a capital P followed by a
small p, i.e. Pp (ProcSee pragma). Some of the pragma directives accept
values indicating whether they are enabled or disabled. Use on or true to
enable a pragma directive, or off or false to disable. The syntax is as follows:
#pragma PpReceiveRtmUpdates=on
#pragma PpSendApiStringUpdates=off
The following pragma directives are known by ProcSee:
Table 1: Pragma Directives
Directive
Description
PpPush
Saves current states of all the pragma
settings. A call to PpPush should
always be followed by a corresponding call to PpPop.
PpPop
Restores the states which previously
was pushed by PpPush.
ProcSee Reference Manual
113
The ProcSee database file format (.pdat)
Examples
Table 1: Pragma Directives
Directive
Description
PpReceiveRtmUpdates
Whether updated variables in the
RTM should be transferred to the
application or not. For more information, see the API function PfReceiveRtmUpdates
PpReceiveRtmStringUpdates
Whether updated string variables or
string fields in struct variables should
be transferred from the RTM to the
application or not. For more information, see the API function PfReceiveRtmStringUpdates
PpSendApiStringUpdates
Whether string variables or string
fields in struct variables updated in the
API should be transferred to the RTM
or not. For more information, see the
API function PfSendApiStringUpdates.
The pragma directives PpReceivRtmUpdates, PpReceiveRtmStringUpdates and PpSendApiStringUpdates accept the following assignment
values: on, true, off or false.
Examples of pragma directives:
#pragma PpPush
#pragma PpSendApiStringUpdates=true
char*
aString = “This is a string”;
#pragma PpPop
Examples
Examples of definition of simple variables:
int32
int16
char
float
double
114
anInt;
aShort;
aChar;
aFloat;
aDouble;
ProcSee Reference Manual
The ProcSee database file format (.pdat)
Examples
Examples of definition of simple arrays:
int32
int16
char
float
double
anIntArray[10];
aShortArray[5];
aCharArray[100];
aFloatArray[20];
aDoubleArray[7];
Examples of definition of simple pointers:
int32*
int16*
char*
float*
double*
void*
anIntPtr;
aShortPtr;
aCharPtr;
aFloatPtr;
aDoublePtr;
aVoidPtr
Examples of definition of simple variables, with initialization:
int32 testvar = 0;
int32 counter = 0;
float level = 0;
float value = 50.0;
int32 n = 5;
int32 var1 = 5;
Declaration of structures (type declaration) :
struct Node;
struct myRec;
// After these declarations it is possible to make
// pointers to these structures.
ProcSee Reference Manual
115
The ProcSee database file format (.pdat)
Examples
Definition of structures (type definitions) :
struct ValveRec
{
char theName[32];
int32 theValue;
};
struct Vect
{
float x0;
float y0;
float x1;
float y1;
int32 col;
int32 lineWidth;
char name[16];
};
struct startRec
{
int32 F1;
};
struct inRec
{
int32 F1;
startRec* F2;
};
struct outRec
{
int32 F1;
inRec F2[3];
int32 F3[5];
startRec* F4;
int32 F5;
float F6;
float F7[5];
char F8[32];
int16 F9;
int16 F10[5];
uint16 F11;
uint16 F12[5];
uint32 F13;
uint32 F14[5];
char F15;
};
116
ProcSee Reference Manual
The ProcSee database file format (.pdat)
Examples
Example of structure declaration, and its use:
struct node;
// Declaration of node struct.
struct connect
{
int32 visited;
node* conectTo;
connect* next;
};
// Ptr to node struct.
struct node
// Definition of node struct.
{
char nodeName[32];
connect* firstConnect;
};
Definition of structures (type definitions) with default values. Note however that the default values specified here will only be used for variables
defined in a .pdat file.
struct REC1 // A structure with default values.
{
double aDouble = 5678.89;
char theName[32] = "A string initialization";
int32 theValue = 45;
char aChar = 'p';
char anotherChar = 123;
int16 aShort = 'd';
double anotherDouble = 567;
};
struct REC2
{
int32 F11 = 11;
REC1 R12;
REC1 *F12;
int32 F13 = 13;
};
Examples of definition of structure variables:
Vect vectors[100];
startRec startRecVar;
inRec inRecVar;
outRec outRecVar[3];
ValveRec RA00P901;
ValveRec YX13X801;
ProcSee Reference Manual
117
The ProcSee database file format (.pdat)
Examples
Examples of initialization of the variable structure fields:
RA00P901.theName = "RA00P901";
RA00P901.theValue = 0;
YX13X801.theName = "RA00P901";
YX13X801.theValue = 0;
startRecVar.F1 = 3;
outRecVar[1].F1 = 3;
outRecVar[1].F2[1].F1 = 3;
outRecVar[1].F3[3] = 3;
outRecVar[1].F5 = 3;
outRecVar[1].F6 = 3.0;
outRecVar[1].F7[3] = 3.0;
outRecVar[1].F8 = "Test case started var set to 3";
outRecVar[1].F9 = 3;
outRecVar[1].F10[3] = 3;
outRecVar[1].F11 = 3;
Examples of remote function declarations:
void myFunc1();
void myFunc2(int a, char* b);
void anotherRemoteFunction(float x, float y);
Examples of pragma directives:
// Disable receive RTM updates and enable API string transfers
#pragma PpReceiveRtmUpdates=off
#pragma PpSendApiStringUpdates=on
int32 v1;
char* s1=”This string will be sent to the RTM”;
...
// Store current settings and enable string and variable updates.
#pragma PpPush
#pragma PpReceiveRtmUpdates=on
#pragma PpReceiveRtmStringUpdates=on
char* s2 = “Transferred: both directions”;
...
// Note a PpPush must be followed by a PpPop.
// After this point receive RTM updates is disabled.
#pragma PpPop
int32 v2;
char* s3 = “Not transferred to the application”;
118
ProcSee Reference Manual
Windows to UNIX mapping file
Introduction
Windows to UNIX mapping file
The ProcSee mapping file is used to convert Windows drive letters to UNIX
paths.
Introduction
Since ProcSee can be running on both Windows and UNIX platforms we
have made the document, .Tdoc, files compatible. In order to achieve this
compatibility a mapping file which convert UNIX paths to Windows
drives where needed.
This mapping file is only needed if the ProcSee application should be running on both UNIX and Windows platforms. Internally in the RTM all file
paths are converted to UNIX paths. If the file windrvux.pth does not exist
file names like h:\app.pctx will be converted to /LOCALPC/H/app.pctx.
When trying to run an application referring to /LOCALPC/... on a UNIX
platform the RTM will fail. If a mapping file is used associating the drive
H: with for instance the UNIX path /prj/project1 the .Tdoc files would be
compatible.
This mapping file has a predefined name which is called windrvux.pth. It
is a plain text file which must be situated on either the $PROCSEE_DIR
directory, your $HOME directory or in current working directory.
ProcSee searches for this mapping file in the following order:
1) ./windrvux.pth
2) $HOME/windrvux.pth
3) $PROCSEE_DIR/windrvux.pth.
If the file is found in one of the above locations ProcSee stops searching
for it in the other directories.
ProcSee Reference Manual
119
Windows to UNIX mapping file
Layout
Layout
The layout of the windrvux.pth text file is as follows:
<Drive_1>: <Path_1>
<Drive_2>: <Path_2>
...
<Drive_n>: <Path_n>
, where <Drive_#>: is a letter indicating the Windows drive. An example
is C:. The next word is the full path to the disk the Windows drive is associated with. An example of a windrvux.pth file is given in the section below.
Each line in this file is separated by a new line. Multi line comments are
surrounded by /* and */, and single line comments starts with //. Observe
that forward slashes are used and not back slashes as would be expected on
a computer running Windows.
Examples
An example of a windrvux.pth file.
/**************************************************
*
* Configuration file:
*
* Mapping file from window drive to unix path.
*
**************************************************/
120
// Drive: Path:
Comment:
P:
M:
// Project directory
// Home directory
/prj
/users/gandalf
ProcSee Reference Manual
PART
3
Manual pages
121
122
ProcSee Reference Manual
ProcSee Executables Manual pages
ProcSee Executables Manual pages
ProcSee Reference Manual
123
124
ProcSee Reference Manual
ProcSee Executables Manual Pages
control (1)
NAME
control - a server for service management.
SYNOPSIS
control [ -? | -p portNumber | -d debugOpts ]
DESCRIPTION
control is a server that is used to register and unregister services. A service is a uniquely
named port on a host. Software Bus processes register themselves with control in order
to locate other processes. Users do not need to be aware of control’s existence as it should
normally be running as a service. A utility program called controlutil can be used to query
control’s state and send administrative messages to control.
OPTIONS
-?
Writes a summary of the control options to stdout.
-p
Specifies the port number control should use when listening for clients. Using
this option will override environment variable CONTROLPORT.
-d
Specifies that control should write debug output to stdout for certain conditions. <debugOpts> specifies a combination of conditions. Available conditions are: ALL, CONNECT, ARCH, REGISTER, COMIX, HOSTACCEPT,
PING. Conditions can be combined using a non-whitespace character, for instance CONNECT|PING.
NOTE
control requires a specific entry in the services database in order to start properly. See instructions on how to install the SWBus in the SWBus User’s Guide for details.
ENVIRONMENT
The host on which control is running can be specified using the environment variable
CONTROLHOST.
The port control will use when listening for clients can be specified using the environment variable CONTROLPORT.
The location of the control executable can be specified using the environment variable
CONTROLPATH, if it is not located in $BUSPATH/bin/$ARCH. This enables processes to start control automatically on the local host if one is not already running and CONTROLHOST is not set to a remote host.
See the SWBus User’s Guide for a complete list of environment variables.
ProcSee Reference Manual
125
ProcSee Executables Manual Pages (1)
FILES
$BUSPATH/bin/$ARCH/control
SEE ALSO
controlutil, SWBus
126
ProcSee Reference Manual
control (1)
ProcSee Executables Manual Pages
controlutil (1)
NAME
controlutil - a utility program for sending messages to control.
SYNOPSIS
controlutil [ -? | -d -h hostName -k -q -Q -c className -V -u -i serviceName -t timeout ]
DESCRIPTION
controlutil is used to extract information from control, to unregister all services or to tell
control to stop running.
OPTIONS
-?
Write a summary of the controlutil options to stdout.
-d
Enable debug output from controlutil to stdout.
-h
Specify the name of the host where control is running. If no hostname is
specified, the value of the environment variable CONTROLHOST is used if
set, otherwise localhost is assumed.
-k
Tell control to stop running.
-q
Write information to stdout. The output includes hostname and version number of control and a list of all registered services with service ids. Services
that are connected to control when controlutil extracts its information are
specified with processname, process class, hostname and processId. Formerly
registered services that has exited without unregistering are listed as disconnected. See below for an example output.
-Q
Like the -q option, but more informaiton about each connected process is listed. The additional information includes IP-addresses, SWBus version, and
ping information.
-c
Like the -q option, but only information about processes of class className
is listed.
-V
Write the hostname and version number of control to stdout.
-u
Unregister all services. Using this option will fail if one or more services are
currently connected to control.
-i
Get the unique identifier of the named service.
-t
Timeout in milliseconds used when connecting to control. Default=500ms.
EXAMPLES
$ controlutil -h castor -q
controlutil (SWBus Release 2.0 June 97)
Process information from control (2.0) at castor:
1: performanceServer disconnected
ProcSee Reference Manual
127
ProcSee Executables Manual Pages (1)
controlutil (1)
2: performanceClient disconnected
3: simpleServer host: castor, port: 17101, pid: 11513, version: 2.0
4: simpleClient host: castor, port: 17103, pid: 11520, version: 2.0
There are 4 processname(s) registered, 2 of these are currently connected.
ENVIRONMENT
The default host for control can be set using the environment variable CONTROLHOST.
See the SWBus User’s Guide for a complete list of environment variables.
FILES
$BUSPATH/bin/$ARCH/controlutil
SEE ALSO
control
128
ProcSee Reference Manual
ProcSee Executables Manual Pages
Execute (1)
NAME
Execute - A ProcSee utility to remotely execute pTALK code
SYNOPSIS
Execute [option...]
Options
Execute recognizes the following options:
-h <host>
- explicitly state the control server hostname. Default is
CONTROLHOST if specified or the machine where
Execute is started.
-a <application>
- explicitly state the name of the application in the RTM to
connect to. Default is “System”.
-p <process>
- explicitly state the name of the process to which Execute
will connect. Default is “Execute”.
-r <rtm>
- explicitly state the name of the RTM. Default is “rtm”.
-c <command>
- specify a pTALK command to execute. The command
should be specified as a character string of pTALK code
(pTALK compound statement).
-s <scope>
- explicitly state the scope in which to execute the command.
Default is ::<application name>
-d
debug - set Execute in debug mode.
-v
vervose - set Execute in verbose mode.
-?
help - write a summary of the Execute options to stdout.
DESCRIPTION
Execute will connect to the application given as option and execute the given pTALK
compound statement in the given scope. The scope is given as a fullname. Execute disconnects and terminates immediately when the command has been executed.
EXAMPLE
Execute -a demoSim -s “::demoSim” -c “{ freeze(); }”
ProcSee Reference Manual
129
ProcSee Executables Manual Pages (1)
ged (1)
NAME
ged - The ProcSee editor.
SYNOPSIS
ged [options]
DESCRIPTION
ged is used to interactively edit a user interface displayed by the ProcSee Run-Time Manager(RTM). ged is an X-Windows OSF/Motif program that has two main windows: the main
window, and the drawing editor window. The main window is used to edit the top-level
properties of an application or library. The drawing editor window is used to edit pictures or
classes, and the properties of the pictures or classes and all objects contained within them.
Because ged relies on the editing capabilities of the ProcSee Run-Time Manager, the control
program and the RTM have to be running for ged to be able to work. If control or RTM is
not started, ged will display a message stating that it is trying to connect.
Options
ged accepts these options:
-rtmName <RtmName>
- connect to the RTM with the given name.
-gedName <GedName>
- explicitly state the name of ged.
-controlHost <HostName> - name of computer where control/controlService is running.
On X-Windows ged accepts most of the Motif options in addition to the following options
-application <AppName> - connect to this application at startup. The application
should be running in the RTM.
-debug
- print activity information.
-extDebug
- print additional activity information.
-?
help - write a summary of the ged options to stdout.
X Resources
In addition to consulting standard locations for X resources, ged also looks for the file Ged
in the user’s home directory. This resource file has priority over the other X resource files.
130
ProcSee Reference Manual
ProcSee Executables Manual Pages
ged (1)
ged accepts the following X resources in addition to standard X and OSF/Motif resources:
Name
Class
Type
DefaultValue
Explanation
autoUpdate
AutoUpdate
Boolean
True
whether ged should automatically call update() when
commands are entered on
ged’s command line, or
when OK buttons on Attribute editors are selected
application
Application
String
"NoName"
The application to connect
to at startup.
classList
ClassList
Boolean
False
classList/classBrowser. True
means classList
controlHost
ControlHost
String
“localhost“
The computer to connect to
to find control/controlService, which is used for finding all other processes to
connect to.
debug
Debug
Boolean
False
debug information on/off.
drawEdWinGeometry
DrawEdWinGeometry
String
““
The size of the Drawing Editors main window
extDebug
ExtDebug
Boolean
False
extended debug information
on/off.
gedName
GedName
String
“___GED”
The name ged uses when
connecting to the RTM
imagePath
ImagePath
String
““
Specifies the directory
where ged will look for the
user’s images.
libPath
LibPath
String
““
Specifies the directory
where ged will look for the
user’s libraries.
mainWinGeometry
MainWinGeometry
String
““
The size of ged’s main window
overrideVueColours
OverrideVueColours
Boolean
True
Whether ged should override Vue’s way assigning
colours
pictPath
PictPath
String
““
Specifies the directory
where ged will look for the
user’s pictures.
rtmName
RtmName
String
"rtm"
The name of the RTM to
connect to. (The rtm -n
option).
startInTestMode
StartInTestMode
Boolean
True
False means to start drawing editor in select mode.
ProcSee Reference Manual
131
ProcSee Executables Manual Pages (1)
Name
toolIconSize
Class
ged (1)
Type
ToolIconSize
String
DefaultValue
LARGE
Explanation
Whether ged should use
large or small icons. Two
options available: SMALL
and LARGE.
Windows Resources
ged look for the resources in the Registry under the key
HKEY_CURRENT_USER\Software\IFE\ProcSee
It is recommended that the ProcSee utillity program p3RegAdmin which is part of the distribution, is used when changing the ged resources. Start the p3RegAdmin program and
press the ged tab. Do the changes to the resources and press the ok or apply button. The
changes will take effect next time ged is started. This utillity program is not documented.
On Windows the following resources are available:
Resource name
Type
Default value
Explanation
libPath
String
““
Specifies the directory where ged will
look for the user’s
libraries
imagePath
String
““
Specifies the directory where ged will
look for the user’s
images.
picturePath
String
““
Specifies the directory where ged will
look for the user’s
pictures.
ENVIRONMENT
PROCSEE_DIR
The path to the ProcSee installation directories, e.g.:
PROCSEE_DIR=/usr/local/procsee
ARCH
The computer hardware and software architecture; at the
moment it is one of: winArch, hpArch, sunArch, macX86Arch,
or linuxX86Arch.
FILES
$PROCSEE_DIR/bin/<ARCH>/ged The ProcSee editor executable.
$PROCSEE_DIR/etc/<ARCH>/*
The files used internally by ged.
$HOME/Ged and $HOME/.Xdefaults User specific X resources for ged.
132
ProcSee Reference Manual
ProcSee Executables Manual Pages
ged (1)
WARNINGS
In the current release, there are no warnings if you try to save or document an application,
picture, or library to an already existing file. The existing files will be overwritten unless
they have been write protected.
EXAMPLES
Below is a sample of a Ged X-resource file. This file should be located in the user’s home
directory.
ged*background:red
ged*foreground:yellow
ged*overrideVueColours:True
ged*rulersForeground:white
ged*rulersBackground:#9a9a9a
ged*XmText*fontList:-*-courier-bold-r-*-12-*-iso*
ged*XmTextField*fontList:-*-helvetica-bold-r-*-14-*-iso*
ged*fontList:-*-helvetica-bold-r-*-12-*-iso*
ged*libPath:./libraries
ged*pictPath:./pictures
ged*imagePath:./images
ged*mainWinGeometry:300x300+100+100
ged*drawEdWinGeometry:600x550-10-100
ged*autoUpdate:False
SEE ALSO
rtm, control
ProcSee Reference Manual
133
ProcSee Executables Manual Pages (1)
p3sim (1)
NAME
p3sim - create small test applications
p3simTalk - send commands to p3sim
SYNOPSIS
p3sim [ -f simFile ] [ -e errorLog ] [ -v ] [ -h host ]
p3simTalk [ -p processName ] [ -h host ]
DESCRIPTION
p3sim is a program that is used to create small test applications. The program sends updated
variables to the RTM at regular intervals. It is very easy and it is very fast to develop small
simulators to test for instance dynamics in a picture or a trend configuration. The only thing
one have to do is to create a configuration file which describes the entire simulator. This configuration file consists of one or several variable definitions.
Options
p3sim recognizes the following options:
-v
verbose - turning verbose mode on.
-f <simFile>
- name of the configuration file describing the simulator.
-e <errorLog>
- specifies the error log file where error messages will be
written.
-h <host>
- name of the host where the control server is running.
-?
help - write a summary of the p3sim options to stdout.
The configuration file can be divided into two parts. The first part describes among other
things the connection to the RTM, and the second part describes the variables and the way
these are updated. Observe that the first part must precede the second part in the configuration file. The general layout of the configuration file is as follow:
simulator “<sim>”
{
}
where simulator is a predefined keyword which must be the first word in the specification
file. The next word is the name of the simulator. This name must be surrounded by double
quotes and is only used internally in the p3sim program. Owing to this fact the simulator can
be called whatever you like. It is part of the syntax because it maybe will be used in the future. In the body which is surrounded by curly braces comes the two parts described in the
previous paragraph.
The following keywords are used in the first part:
application
134
name of the application
ProcSee Reference Manual
ProcSee Executables Manual Pages
process
name of the process
rtmName
name of the rtm
database
the database file name
timeVariable
name of the time variable
startTime
the time variable’s start time
timeTickIntvl
trend logger time tick interval
randomCycle
random cycle probability
p3sim (1)
All these keywords are not necessary to specify but some of them must be set otherwise
p3sim will use its own default settings. This setting will probably not correspond to the
names in your environment. This includes the keywords application, process and rtmName. The keywords timeVariable, startTime and timeTickIntvl is only necessary to
specify if the simulator is connected to an RTM containing trend curves. Observe that all
names in p3sim must be specified using double quotes and all statements must be terminated by a semi-colon.
With the keyword application the name of the application in the RTM to connect to is
specified. This name must correspond to the name of the application loaded into the
RTM.
The process keyword specifies the name of the process in the RTM the variables in the
configuration file used by p3sim, are defined in. This is usually the same name as the application name.
Notice that p3sim is always opened as a server. The RTMs can always take the initative
to connect to p3sim using the pTALK function connectToProcess(...). p3sim can also act
as a client to the RTMs. If the keyword rtmName is specified in the configuration file,
the p3sim application will be a client to the specified RTMs. The keyword rtmName
specifies the name of the RTM p3sim will try to establish a connection to. The name of
the RTM is specified using the option -n at start up. The default name of the RTM is rtm.
For more information about this see rtm(1). No connection will be established if these
names do not match. If the simulator is going to establish connections to more than one
RTM, specify the name of the rtms on several lines using the keyword rtmName. The
syntax is as follows:
rtmName = “rtm1”;
rtmName = “rtm2”;
.
.
rtmName = “rtm-n”;
If the variable description part of the configuration file consists of a complex variable, like
a struct or an array the database file (*.pdat) must be specified. Use the keyword database
followed by a file name to specify the RTM database file. If the RTM database is separated in several files these files can be specified on several lines using the keyword database.
The keyword timeVariable specifies the variable used as a time master for the trend logger. This variable name must correspond with the timeVariable attribute in the trend logger entry in the application. The timeMaster attribute in the same trend logger must be
ProcSee Reference Manual
135
ProcSee Executables Manual Pages (1)
p3sim (1)
set to 2 (external driven). For more information about this see the description about the configuration of the trend logger in the users guide. This attribute is not necessary to specify if
the RTM p3sim is connected to does not contain a trend logger.
With the keyword startTime you specify the start time of the timeVariable. This attribute
can be set to a non negative value or to the keyword current. If it is set to current the time
variable will be set to the current unix time every time the periodic function is called. The
periodic function will be called every second. If it is set to an integer value then the simulation will start on this time and it will be incremented 1 second ahead each time the periodic
function is called.
The next keyword to describe is timeTickIntvl. This attribute determines how often the updated time variable is sent to the connected RTMs. In the trend logger entry in the application
the value of the attribute timeTickIntvl must correspond to this attribute value. It is only necessary to specify this attribute if the simulator is connected to an RTM containing a trend
logger.
In the next section where the variable specification part is described the keyword cycle is one
of the attributes in a variable description. This attribute can be set to the value random meaning that the value will be updated not cyclic but at random intervals. The keyword randomCycle specifies the probability for the variables where the attribute cycle is set equal to the
keyword random to be updated. This attribute can be set to a floating point value between 0
and 100 percent. For more information about cycle see the description in the sections below.
This attribute can be changed from the program p3simTalk. A detailed description of
p3simTalk is given in a later section.
The second part of the configuration file consists of the variable descriptions. A variable in
this configuration file consists of a set of predefined attributes which must be set. This includes the variable name, the data type, the update cycle and the update method. The update
method must be set equal to one of the predefined functions in p3sim which will change the
variable value each time it is updated. The update functions can be combined to produce
more complex functions.
Specification of a variable in the configuration file is very easy owing to the fact that there
are a limited number of keywords and functions. A variable is specified using the keyword
update followed by the variable name and a body in curly braces. In the body the variable’s
properties are described. The syntax for a variable is as follows:
update “<variable>”
{
cycle = <theCycle>;
datatype = <dataType>;
value = <function>;
}
where <variable> must be surrounded by double quotas. The variable can be either a single
variable or a more complex variable like structs or arrays in general. If more complex variables are specified in the configuration file the database file (.pdat) for the RTM must be specified using the keyword database. For more information about this see the paragraph above
describing the database.
136
ProcSee Reference Manual
ProcSee Executables Manual Pages
p3sim (1)
The keyword cycle determines how often the variable is updated. Setting the attribute to
1 will update the variable every second. This attribute can be set to any non negative integer value or the keyword random. Setting it to random will not update the variable at
regular intervals but instead at random intervals. The probability for updating the variable
in random mode is set by the keyword randomCycle. For more information about this
mode see the paragraph above describing the randomCycle keyword. The smallest possible resolution for this attribute is 1 second.
The dataType attribute can be set equal to one of the predefined data types:
int16
- short int, 16 bit
uint16
- short unsigned int, 16 bit
int32
- int, 32 bit
uint32
- unsigned int, 32 bit
float
- float, 32 bit
double
- float double, 64 bit
The value field is maybe the most important part of the entire variable specification. The
variable can be set equal to a number of predefined set of functions. Two or more functions can be combined by addition or subtraction. As a matter of fact there are no limits
whatsoever for the number of function that can be specified in one value field.
There are two modes of operations of the function specification which in ProcSee terminology is called dynamic and static binding. With a dynamic binding the variable value
will every time it is updated also call the predefined function’s update method. It is very
likely that the value will change, off course this depends on the function. A dynamic binding is set using back quotes surrounded the function specifications.
value = `<function>`;
A syntax for a static binding is much like dynamic binding except that the back quotes
surrounding the specification is omitted. The purpose with this mode is to initialize a variable once to a specific value or to a random value. The variable value will never change
after the first update. In other words the variable will remain the same as long as p3sim is
running. This mode is hardly very useful since a variable can be set to an initial value in
the ProcSee database file. The syntax is as follows:
value = <function>;
The <function> can be as described above combined by addition or subtraction. The symbols + and - are used for addition and subtraction, respectively. The syntax is as follows.
value = `func1() +- func2() ... +- func-n()`;
value = func1() +- func2() ... +- func-n();
// dynamic
// static
Observe that p3sim recognizes everything inside /* and */ as a comment and also the rest
of the line from // as a comment.
p3sim has a set of predefined functions as described above which the value field of the
variable can be set equal. The following is a list of predefined functions in p3sim which
later can be used for easy reference. Each and every of these will be described in detail in
a later section.
ProcSee Reference Manual
137
ProcSee Executables Manual Pages (1)
p3sim (1)
aValue
const( aValue )
step( initValue, min, max, stepValue, inc )
step( initValue, max, min, stepValue, dec )
cosine( amplitude, phaseDelay, cycle, meanValue )
sine( amplitude, phaseDelay, cycle, meanValue )
random( minValue, maxValue )
noise( probability, minValue, maxValue )
probability( probability, minValue, maxValue )
gauss( meanValue, standardDeviation, minValue, maxValue )
predefined( probability, v1, v2, ..., vn )
sequence( v1, v2, ..., vn )
p3simTalk is a program when connected to p3sim can change the state of some settings in
p3sim. This includes for instance turning verbose mode on or off, turning on or off the printing of the total number of variables sent to the RTM, etc. Note that p3simTalk is not available on Windows.
Options
p3simTalk recognizes the following options:
-p <processName>
- name of the process to connect to. This name must correspond
with the name set for the attribute processName in the
configuration file used by the program p3sim.
-h <host>
- name of the host where the control server is running.
-?
help - write a summary of the p3simTalk options to stdout.
The keywords in p3simTalk are the following:
138
help
print a summary of the available keywords in p3simTalk.
verbose
turns verbose mode in p3sim on or off. The keyword verbose
can take the values on or off.
randomCycle
setting this variable will change the probability for when the
variables with cycle set equal to random will be updated. This
variable must be set to a value between 0 and 100.
updatedVariables
turns printing of the total number of variables updated in each
cycle on or off. The variable must be set to either on or off.
quit
terminates p3simTalk.
precision
setting this variable will change the limits for when to print error
outputs from p3sim. p3sim will only take notice of this setting
if p3sim is started with the -e option. It is specified in milli
seconds. The default in p3sim is 1000 (1 second). This is the
time between two calls to the periodic function in an optimal
situation. Maybe the p3sim configuration file contains to many
variables so the periodic function is not called every second. By
changing this variable the limit for when to print error messages
can be changed.
ProcSee Reference Manual
ProcSee Executables Manual Pages
runPfExecute
p3sim (1)
the variable can be set to the values on or off. If this variable
is on the api function PfExecute() will be called every time
the periodic function is called. This way it is possible to
measure how much time the RTMs connected to p3sim
spend in the update process. The default setting for this
variable is off. p3sim will only take notice of this setting if
p3sim is started with the -e option. By changing the variable
precision to a value less than 1000 a printout will be sent to
standard output and to the error log file.
FUNCTIONS
This section describes in detail the predefined functions available in p3sim.
NAME
const
SYNOPSIS
value = `aValue`;
value = �const( aValue )�;
DESCRIPTION
The value field of the variable is set equal to the specified value. It is not much point surrounding this update field in back quotes if the constant update field is not combined with
any other non constant function.
NAME
step
SYNOPSIS
value = `step( initValue, min, max, stepValue, inc )`;
value = `step( initValue, max, min, stepValue, dec )`;
DESCRIPTION
The value is changed from min to max or max to min with the given step value. The last
parameter to the step() function is the reserved keywords inc or dec which describes
whether to increment or decrement the value, respectively. The first parameter is the functions initial value.
NAME
cosine
SYNOPSIS
value = `cosine( amplitude, phaseDelay, cycle, meanValue )`;
ProcSee Reference Manual
139
ProcSee Executables Manual Pages (1)
p3sim (1)
DESCRIPTION
The variable value will be changed like a cosine curve. The function should be self explanatory so it is not much point in describing it in detail. The amplitude is the height of the curve.
This value combined with the last parameter meanValue will define the range from minimum to the maximum value the variable will get. The parameter phaseDelay defines the
number of updates there are needed before the function reaches its first maximum value. This
value should be less than the parameter cycle which defines the number of updates in one
oscillation. Small values for this parameter will give a cosine curve with a high frequency,
and a large value will produce a curve with a low frequency.
NAME
sine
SYNOPSIS
value = `sine( amplitude, phaseDelay, cycle, meanValue )`;
DESCRIPTION
This function is much like the cosine function except that the variable will be set equal to a
sine curve. The only difference between the parameters to the sine() function from the cosine() function is that phaseDelay has another meaning. In the sine() function it defines the
number of updates before the first intersection with the value of the parameter meanValue.
A detailed description of the other parameters is given in the paragraph describing the function cosine().
NAME
random
SYNOPSIS
value = `random( minValue, maxValue )`;
DESCRIPTION
The variable value will change randomly between minValue and maxValue each time it is
updated.
NAME
noise
SYNOPSIS
value = `noise( probability, minValue, maxValue )`;
DESCRIPTION
140
ProcSee Reference Manual
ProcSee Executables Manual Pages
p3sim (1)
The function noise() changes the variable to a value between minValue and maxValue
with the given probability. If the probability for changing the variable value fails in a update then the value is set to 0. This function combined with sine() or cosine() curves will
to some extent produce realistic trend curves.
NAME
probability
SYNOPSIS
value = `probability( probability, minValue, maxValue )`;
DESCRIPTIONS
This function will change the variable with the given probability to a value between minValue and maxValue. If the probability for changing the variable value fails the function
returns the same value as it did in the last update.
NAME
gauss
SYNOPSIS
value = `gauss( meanValue, standardDeviation, minValue, maxValue )`;
DESCRIPTION
The function gauss() will produce random values between minValue and maxValue
where the probability for a value will be increasing as closer the value is to meanValue.
Try not to set the parameters minValue and maxValue too far from the value of the parameter meanValue or it will loop for quite some time before the function gives up and
returns either minValue or maxValue. The value is calculated in two steps. First a random
value between minValue and maxValue is generated. Then a new random value between
0 and 1 is generated which is used to check whether the value is inside the gaussian distribution or not. This process continues until a value is found which is inside. The parameter standardDeviation is used in the gaussian distribution which defines the steepness of
the gaussion bell-shaped curve. The smaller the parameter standardDevaiation the greater the probability for returning a value in a close area around meanValue. In a gaussian
distribution 68% of the values will be inside +-1 standard deviation from the mean value,
95.5% inside +-2 and 99.7% inside +-3 standard deviations. Based on these facts there are
very little possibility that this gauss() function will return a value outside +-3 standard deviations. As a matter of fact it is only 0.3%.
NAME
predefined
SYNOPSIS
ProcSee Reference Manual
141
ProcSee Executables Manual Pages (1)
p3sim (1)
value = `predefined( probability, v1, v2, ..., vn )`;
DESCRIPTION
The function predefined() will change the variable value with the given probability to one
of the values defined in the variable parameter list. v1, v2, ..., vn is a variable number of values where a value is either a single float or int variable or an interval. An interval is two values separated by two dots, like vMin..vMax. The variable will be set to a random value
between these limits. Single variables and intervals can be combined in the variable parameter list, thus it is legal to write something like v1, v2, v3min..v3max, v4, v5min..v5max, etc.
NAME
sequence
SYNOPSIS
value = `sequence( v1, v2, ..., vn )`;
DESCRIPTION
The function sequence() changes the variable’s value in a sequence. The first time the variable is updated it gets the first value in the variable parameter list, the next time the second
parameter and so on until it reaches the last value. Then the sequence starts all over again
from the first value. A value is in this function either a single float or int value or an interval.
An interval is two numbers separated by two dots. The variable will be set to a random value
between the minimum and the maximum value in the specified interval. It is legal to specify
the variable parameter list to the function sequence() like v1, v2min..v2max, v3, v4,
v5min..v5max etc. In other words a single number and an interval can be combined in the
parameter list.
EXAMPLES
A simple simulator file may look something like this:
simulator “Sim”
{
application = “test”;
process = “test”;
rtmName = “rtm”;
update “var1”
{
cycle = 1;
datatype = float;
value = `gauss( 0, 1, -100, 100 ) + noise( 10, 1, 50 )`;
}
update “var2”
{
cycle
142
= 1;
ProcSee Reference Manual
ProcSee Executables Manual Pages
p3sim (1)
datatype = int32;
value = `step( 1, 1, 200, 1, inc )`;
}
}
This example illustrates a simulator which is connected to two RTMs with trend loggers.
simulator “trendSim”
{
application = “trTest”;
process
= “trTest”;
rtmName
= “rtm1”;
rtmName
= “rtm2”;
database
= “../trTest.pdat”;
timeVariable = “timeVar”;
startTime = current;
timeTickIntvl = 1;
randomCycle = 10;
update “trVar1”
{
cycle = 1;
datatype = float;
value = `cosine( 100, 0, 30, 50 ) + gauss( 0, 1, -100, 100 )`;
}
update “myColour”
{
cycle = 1;
datatype = int32;
value = `sequence( 10, 1, 3, 50..60, 2, 9, 12..15 )`;
}
update “isVisible”
{
cycle = 1;
datatype = int16;
value = `sequence( 1, 0, 1, 0, 0, 1 )`;
}
update “myTest.r1”
{
cycle = random;
datatype = int32;
value = `100 - sine( 10, 0, 100, 20 ) + probability( 10, 20, 30 )`;
}
update “myTest.r2”
{
cycle = random;
datatype = uint32;
ProcSee Reference Manual
143
ProcSee Executables Manual Pages (1)
value
= `1000 + noise( 10, 0, 10 ) - random( 100, 200 )`;
}
update “myTest.r3”
{
cycle = random;
datatype = float;
value = `predefined( 50, 0.1..0.5, 1, 10..20, 50, 200 ) + 256`;
}
}
WARNINGS
Observe that characters, strings and pointers are not supported by p3sim.
SEE ALSO
rtm
144
ProcSee Reference Manual
p3sim (1)
ProcSee Executables Manual Pages
pcc (1)
NAME
pcc - The ProcSee configuration language compiler
SYNOPSIS
pcc [ options ] filenames
pcc -h
DESCRIPTION
pcc generates files that can be used by the ProcSee Run-Time Manager from user interface descriptions written in the ProcSee configuration language.
Application resource configurations, picture descriptions and library descriptions are
compiled and then saved to individual files. The filenames allocated are generated from
the application, picture, or library name with the following suffixes appended:
.pctx
Application resource file.
.ppic
Picture file.
.plib
Library file.
.ptrv
Trend variable file
By convention, configuration language files have the suffix �.Tdoc’.
Options
pcc recognizes the following options:
-d
debug - provides detailed information about what pcc is
doing. This option allows the user to follow what pcc is
writing to files in detail.
-v
verbose - Provides warnings when pcc writes default values
for missing data. Each object is also listed when it is written
to file.
-s
suppress - suppresses output other than error messages and
anachronism warning generated by pcc.
-m <maxMessages>
Max number of messages to show for each file.
-n
no defaults - suppresses the use of default values when a
necessary assignment statement has not been provided. An
error message is issued if data is missing and the compilation
is terminated. This option can also be used together with the
-d, -s or -v options.
-a
anachronism - suppress anachronism warnings - suppresses
output of anachronism warnings generated by pcc. This
option should be used when compiling large applications that
have been converted from Picasso-2. This option can also be
used together with the -d, -s or -v, and/or -n options.
-o <options>
miscelaneous options, separated by comma. These are:
ProcSee Reference Manual
145
ProcSee Executables Manual Pages (1)
pcc (1)
comPersistSeparateFile - specifies that the default value of
the comShape and comObject persist mode should be 2 instead
of the normal default of 1.
textNonAntiAliased - specifies that antiAlias should not be
added to eventually existing shapeFlags for text shapes when
reading old files. (Should never be needed).
version=’a.b’ or fileVersion=’c.d’- overrides the �ProcSee
version’ and �File version’ in the .Tdoc file. a,b,c,d should be
integers. You should not use both. version is the ProcSee
version, typically 3.7. fileVersion is the internal file version,
typically 1.21. If the file contains both, the file version is used.
When reading .Tdoc files from ProcSee 3.5 or older (before the
file version was added to the .Tdoc files), you could use
-o version=’3.5’. This version number is used to automatically
add compatibility flags etc. depending on the version.
comments=none,first,all - how to handle comments: none
means to ignore all comments, first means to ignore comments
on attributes and end of block comments, all means to store all
comments found in the document file in the produced binary
file. For files documented with ProcSee RTM 3.8 or newer or
files without a version, the default is to store all comments
(except for the file header comment). For older files, the default
is to store no comments, but remember the -o version=’3.5’ for
older files.
-w
wait - wait for input on error.
-W <numLines>
wait for userinput every numLines lines of output.
-c
name - use application name in .Tdoc file to name the .pctx file.
-f <filename>
filename - specify application filename - This option’s
argument is used to create a filename for the first application
resource file generated, <name>.pctx.
-p <directory>
directory - specifies the directory where pcc will write the
output file.
-P
output - places the output file in the same directory as the .Tdoc
file.
-h
help - gives a list of the available options and a short description
of pcc.
-?
help - write a summary of the pcc options to stdout.
If a filename is provided without any options then pcc will inform the user of the type and
name of each file generated.
EXAMPLE
$ pcc myFile.Tdoc
ProcSee PCC R3.0, June 2003
myFile.Tdoc parsed OK
146
ProcSee Reference Manual
ProcSee Executables Manual Pages
pcc (1)
Saved 'picture myPicture' to file 'myPicture.ppic' OK
Saved 'application myApplication' to file 'myFile.pctx' OK
$
A user interface description in a <filename>.Tdoc file may look something like this:
picture myPicture
{
function �int fact( int n )
{ return n <= 1 ? 1 : n*fact(n-1); }�
circle
{ x = 320; y = 265; radius = �fact( 3 )�; }
rectangle
{ x = 700; y = 700; width = 50; height = 100; }
instance buttonToMenu
{ ButtonColour = �Green�; x = 50; y = 115; }
backgroundColour = �Red�;
}
application myApplication
{
font Helvetica { name = "helvetica-bold-18-*"; }
font Times { name = "times-italic-12-*"; }
colour Green { red = 0;
green = 0xffff; blue = 0; }
colour Red { red = 0xffff; green = 0;
blue = 0; }
display disp0 { connection=””; }
window win0 { parent = "disp0"; backgroundColour = 2; }
startPicture { name = "./myPicture.ppic"; targetWindow = "win0";}
}
FILES
$PROCSEE_DIR/bin/<ARCH>/pcc The pcc executable.
<filename>.Tdoc
A user interface description file.
<filename>.pctx
An application resource file.
<filename>.plib
A library file.
<filename>.ppic
A picture file.
<filename>.ptrv
A trend log definition file.
<filename>.pevl
An event log definition file.
WARNINGS
If a picture, library or application resource description is compiled, with the same name
as one saved previously to the same place, then the old files will be overwritten, unless
they have been protected.
If an error is found in a configuration language file after pcc has started to write to a file,
pcc will produce an error message and stop compilation, and the generated file will be removed.
pcc does not check the validity of pTALK code used.
ProcSee Reference Manual
147
ProcSee Executables Manual Pages (1)
pcc (1)
The size of a piece of code, a string, or an array in a configuration language file is limited to
around 65500 characters. Missing the final quote on pTALK code, or strings, can give errors
about too long code/string.
SEE ALSO
rtm
148
ProcSee Reference Manual
ProcSee Executables Manual Pages
rtm (1)
NAME
rtm - The ProcSee Run-Time Manager
SYNOPSIS
rtm [ options ]
DESCRIPTION
The ProcSee Run-Time Manager (rtm) is the main part of the ProcSee system.
Options
rtm recognizes the following options:
-t
terminal - allow terminal input to rtm.
-h <controlHostName>
- explicitly state the control server hostname.
-n <rtmName>
- explicitly state the name of rtm.
-r <appFile>
- explicitly state the name of the application resource file to
load.
-g
- use the GMT time.
-v
verbose - set rtm in verbose mode.
-F
- No Text Font scaling.
-c <behavConsDest>
- Sets default constructor and destructor behaviour used in
the rtm. The option behavConsDest can be a combination
of the following strings. Each string is separated by comma.
Add :off after the option to reverse its meaning.
descend - call constructor and destructor in descendent
shapes. This is the default.
callable - must be set if constructor and destructor should
be callable from the pTALK language.
ifCalledWarn - issues a warning message if constructor or
destructor is called from pTALK. This is the default.
dtorAutoCallWarn - issues a warning message if the
destructor is automatically called from a constructor
function.
ctorCalled:dtor - must be set if the destructor should
automatically be called from the constructor function.
The destructor will be called automatically if object is in
constructed state. This is the default.
ctorCalled:ctor - Call the constructor, but don’t
automatically call the destructor.
ctorCalled:ignore - Don’t call the constructor if object
already is in constructed state.
-M <mapOpt>
- window Mapping options.
mapOpt can be one of:
Off : Windows can be mapped everywhere. (default on X,
because window manager normally handles this)
ProcSee Reference Manual
149
ProcSee Executables Manual Pages (1)
rtm (1)
Virtual : Windows will be moved inside virtual screen when
mapped. (Default on MS Windows)
On : same as Virtual
Primary : Windows will be moved inside primary screen
when mapped.
On X there is no difference between Virtual and Primary
screen.
-o <options>
- A comma separated string of options. Can be a combination
of one or several of the following options:
focusFollowPointer => the keyboard focus follows the
mouse cursor.
comPersistSeparateFile => this option is valid only when
reading old files saved with version 3.3 or earlier of ProcSee.
It tells ProcSee how to handle the persist mode of ComShapes
and ComObjects. When set, the persist mode of each
ComShape and ComObject will be set to the value 2. The
ComShape’s and ComObject’s configuration data will be
saved in a separate COM binary file. If not set the persist
modes will be set to the value 1. The configuration data will be
saved together with the ComShapes and ComObjects.
-x <allowOpts>
- Enable/disable pTALK operations.
allowOpts is a comma-separated string of the following,
prefixed with no, since the default is to allow everything:
system => allows the pTALK system command.
save => allows saving from pTALK.
ctor => allows the constructors to run.
com
=> allows use of COM.
server => allows programs to connect to the RTM.
insecure => allows all of the above.
secure => allows none of the above.
Example: -x "nosystem,nosave" disables the pTALK system()
function, and disables saving and documenting.
The noserver option makes it impossible to connect GED to
the RTM, so this option should only be used when the editing
is completed, and the connection to the data-source is initiated
from the RTM with the pTALK function connectToProcess or
when using the OPC-plugin.
-W <warnOpts>
- Enables or disables warnings.
warnOpts is a comma-separated string of the following:
runTime => give runtime warnings.
loading => give warnings when loading.
all
=> show all warnings. (Default)
none
=> give no runtime warnings.
Example: -W noRunTime disables runtime warnings.
-?
help - write a summary of the rtm options to stdout.
MS Windows specific options
150
-S
- on fatal error terminate the rtm silently without displaying a
message box.
-L <logfile>
- store terminal output in logfile.
ProcSee Reference Manual
ProcSee Executables Manual Pages
-T <terminalOptions>
rtm (1)
- options for the RTM output window.
terminalOptions is one or more of the following values:
StayOnTop:On or StayOnTop:Off : Initial setting of Always On Top menu choice.
TrayIcon:On or TrayIcon:Off : Initial setting of Use Tray Icon menu choice.
Close or NoClose : Enables or disables the Close action on the window menu and the
close button in the window frame of the RTM output window.
AskClose or NoAskClose : Ask if user want to stop the RTM, or not, when the RTM output window is closed by the user or by the system.
AskApplicationClose : Redirect the window close action on the RTM output window to
a main window in the users application, so that the closing of the RTM can be controlled
by pTalk code. The windowClose() dialogue trigger is first tried on the mapped or iconified normal (=top-level) windows, then on the rest of the normal windows. The order of
the windows is determined by the order they are defined in the .Tdoc file. The first of these
windows that handles the windowClose() dialogue will be notified about the window
close action. The windowClose dialogue can be placed in the window (by some pTalk
code, e.g. in a constructor), in the picture displayed in the window, or in the application.
If no normal window is handling the windowClose() dialogue trigger, the first mapped or
iconified normal window is unmapped, and nothing more happens. Notice that if AskApplicationClose is specified, and no windowClose() dialogue is handling the close request,
the RTM will NOT stop. To stop the RTM, use the pTalk function shutdown().
The default is: StayOnTop:Off, TrayIcon:On, Close, AskClose
If AskApplicationClose is given, AskClose is suppressed, unless also given.
If both AskApplicationClose and AskClose is given, the sequence is as follows: first, the
dialog asking if you want to quit is displayed. If you answer No to this, closing is aborted.
If you answer Yes, the handling of the AskApplicationClose is performed.
ENVIRONMENT
CONTROLHOST
The computer on which control is running. Default is the
same computer as rtm is running on.
PROCSEE_DIR
The ProcSee installation directory. Many of the ProcSee
programs will look for different setup files in subdirectories
below this point.
PROCSEE_NB
The size of the non-blocking FIFO buffer used for
communication from the RTM to the processes connected to
the RTM via the API, like GED. This environment variable
is specified in KB. The default FIFO size is 512KB. Setting
this environment variable to the value zero will set this
communication channel to blocking mode (the default before
release 3.8.8). If the size of the non-blocking FIFO buffer is
too small, the connection will be disconnected when the
buffer is full.
PROCSEE_TREND_NB_LOGGER The size of the nonblocking FIFO buffer used
between the trend log RTM and the trend display RTMs. This
environment variable is specified in KB. The default FIFO
ProcSee Reference Manual
151
ProcSee Executables Manual Pages (1)
rtm (1)
size is 512KB. Setting this environment variable to the value
zero will set the communication channel to the trend display
RTMs in blocking modes.
PROCSEE_TREND_NB_DISPLAYThis environment variable specifies the nonblocking FIFO buffer size used between the trend display RTM
and the trend log RTMs. This is the opposite direction compared
to the PROCSEE_TREND_NB_LOGGER environment
variable. For more information, see the description above.
Resources
The following resources are recognized by the rtm:
MultiClickTimeout
The time, in tenths of a second, that differentiates a double click
from two single clicks. Default value: 3.
MarkerSize
The size, in pixels, of markers put on selected objects in a
picture. Default value: 7.
DragThreshold
The minimum distance, in pixels, that is considered a mouse
drag operation. A drag (button down, followed by move,
terminated by a release) shorter that this distance will be
considered to be a simple click. Default value: 5.
AutoRepeatDelay
The time, in tenths of a second, from a button press event, until
the first button repeat event. Default value: 5.
AutoRepeatInterval
The time, in tenths of a second, between each button repeat
event. If this value is set to 0, no button repeat events are
generated. Default value: 2.
PasteDelta
When copy/paste is done in the editor, PasteDelta tells how
much left/down the pasted shape(s) should move. Default value:
7.
X RESOURCES
X resources can be put in your ~/.Xdefaults file. The class name for all resources recognized
by the Run-Time Manager is �ProcSee’. For example, to set the resource MarkerSize to the
value 11, add the following line to your ~/.Xdefaults file:
ProcSee.MarkerSize : 11
Windows Resources
rtm look for the resources in the Registry under the key
HKEY_CURRENT_USER\Software\IFE\ProcSee
It is recommended that the ProcSee utillity program p3RegAdmin which is part of the distribution, is used when changing the rtm resources on Windows. Start the p3RegAdmin program and press the rtm tab. Do the changes to the resources and press the ok or apply button.
The changes will take effect next time rtm is started. This utillity program is not documented.
152
ProcSee Reference Manual
ProcSee Executables Manual Pages
rtm (1)
TERMINAL INPUT
If the rtm is started with the terminal input option (-t), pTALK source code can be entered
in the terminal window. The syntax of terminal input is:
<applicationName>:{pTALK-code}
To execute the pTALK code �MyPicture.MyRectangle.foregroundFillColour = 4;’ in the
application MyApplication, type the following
MyApplication:{ MyPicture.MyRectangle.foregroundFillColour = 4; }
ProcSee Reference Manual
153
ProcSee Executables Manual Pages (1)
Timer (1)
NAME
Timer - a ProcSee cron(1M)/at(1) utility
SYNOPSIS
Timer [option...]
void Timer::atIntervalDo( int reqId, int hours, int minutes,
int seconds, int millisecs,
char* scope, char* command );
void Timer::atTimeDo( int reqId, int hours, int minutes,
int seconds, int millisecs,
char* scope, char* command );
void Timer::cancel( int reqId );
void Timer::quit();
Options
Timer recognizes the following options:
-t
tty - allow tty input. In this mode, Timer allows input from the
terminal and accepts the command “:quit” (which will stop the
program) and “:lj” (which lists the currently scheduled jobs).
-h <host>
- explicitly state the control server hostname.
-p <process>
- state the name of this instance of Timer. Default is “Timer”.
-a <application>
- explicitly state the name of the application to connect to.
Default is “___rtm”.
-r <rtm>
- explicitly state the name of the rtm. Default is “rtm”.
-d
debug - set the ProcSee API to debug mode
-v
verbose - set the Timer to verbose mode
-?
help - write a summary of the Timer options to stdout.
DESCRIPTION
When started the Timer program will connect to the ProcSee rtm. If neither the -p nor the h option is used, Timer will connect to the System application in the rtm as process Timer.
The functions atIntervalDo(...), atTimeDo(...), cancel(), and quit() are then available in
pTALK.
atIntervalDo() and atTimeDo() takes the same parameters, and the only difference between
the two is that atIntervalDo() will execute the command at the given interval, while atTimeDo() will execute the command only once.
The time is given in hours, minutes, seconds and milliseconds.
154
ProcSee Reference Manual
ProcSee Executables Manual Pages
Timer (1)
The command should be a legal pTALK compound statement, and the scope must be the
fullname of a scope in which the command is to be executed. The value of the reqId argument can be freely chosen, and should be used in a call to cancel() if you want to cancel
a scheduled job.
The reqId must be unique for each scheduled job.
quit() will make the Timer program stop.
NOTES
atTimeDo() should execute the job at a given time (like at(1)), but as it is now, atTimeDo()
acts as atIntervalDo() with an automatic cancel() after the first execution.
From Picasso-3 R2.7 the RTM contains timer objects inside the RTM. We recomend that
you use these internal timers instead of the Timer program.
EXAMPLES
The following example assumes that the Timer program has been connected to the rtm as
process Timer.
MyFunc()
{
// a pTALK function
Timer.atIntervalDo( 101, 0, 0, 1, 0, “::MyApp.MyPicture”,
“calculate()” );
// Cancel a previous request
Timer.cancel( 100 );
}
SEE ALSO
In this reference manual: pTALK classes: TimerInterval and TimerAt.
ProcSee Reference Manual
155
ProcSee Executables Manual Pages (1)
TrPrint (1)
NAME
TrPrint - The ProcSee trend print program
SYNOPSIS
TrPrint [-a appname] [-P processname] [-f fromtime [-h rtmname]
[-l loggername] [-L language] [-m margins] [-n columns]
[-o outputfile] -p printername] [-s papersize] [-t timespan]
[-v varfilename | !varname]
DESCRIPTION
TrPrint requests data from the ProcSee trendLog and makes a hardcopy of the trend curve
to a postscript printer as a plot or dumps it to a file in a tabular format. The purpose of the
TrPrint program is to get data from a specified last time and timespan from the trendLog
and to display the data in a presentable form. rtm and control must be active to be able to
use the TrPrint program.
The variables to be used to request trend log data for can be specified in one of the following
ways using the -v option. If the first character is an exclamation mark it indicates that the
name is a variable, otherwise it is considered by the TrPrint program to be a file containing
the variables. The layout of the variable file is as follows:
<variable name 1> <comment for variable 1>
<variable name 2> <comment for variable 2>
.
<variable name n> <comment for variable n>
The trend variables can be specified with or without a full name If the full name is omitted
TrPrint uses the application name and the process name to create a full name of the variable.
The application and the process can be specified using the options -a and -P to TrPrint. If
the variable file contains a variable from another process or application or an attribute the
full name must be given.
If trend log data is wanted for more than one variable the output file will contain a dump of
all the trend data ordered in a tabular format separated by a heading. When dumping the trend
curve to a postscript printer there will be exactly one trend curve per sheet.
The output file containing trend data in tabular format is a text file and is therefore cannot be
sent directly to a PostScript printer. The file must be manually converted to PostScript before
sending it to the printer.
Options
TrPrint recognizes the following options:
156
-a <appname>
- specifies the name of the application. This option is required.
-P <processname>
- name of the process where the variables are defined. If this
option is omitted TrPrint sets the process name equal to the
ProcSee Reference Manual
ProcSee Executables Manual Pages
TrPrint (1)
application name.
-f <fromtime>
- indicates from time. The format of this option is either 0
meaning from current time or from a given time using the
syntax yy:mm:dd:hh:mm. The data is fetched from this point
of time and backwards in seconds specified with the -t
option. If this option is omitted current time is used as
default.
-h <rtmname>
- specifies the name of the rtm the trendLog program is
communicating with. This option is required.
-l <loggername>
- specifies the name of the trend logger. This option is
required.
-L <language>
- indicates the language to use. For the time being TrPrint
only supports two languages, English and Norwegian.
English setting is used by default. Language can also be set
in TrPrint using the environment variable
PROCSEELANG. When using Norwegian language settings
there is a mapping which converts the characters []\{}| to the
special Norwegian vowels æøåÆ�Å.
-m <margins>
- indicates the margins in cm on the printer paper. The output
is always produced in landscape format. This option has four
parameters which are separated with comma: LEFT, TOP,
RIGHT, BOTTOM.
-n <columns>
- number of columns in a row. This option is used when
dumping the data from trendLog to a file in a tabular format
and it indicates how many columns to print in one row. The
default settings is 5 columns.
-o <outputfile>
- name of the file where the data from the trendLog is put.
The data is put into this file in a tabular format. Option -n is
used by TrPrint to determine how many columns of data
there should be in a row. TrPrint will always produce an
output file. If this option is omitted an output file with the
name TREND_PRINT will be generated. There is no way to
suppress this output.
-p <printername>
- indicates the name of the printer. To get a hardcopy of the
trend curve as plot on the postscript printer this option must
be given to TrPrint.
-s <papersize>
- specifies the size of the printer paper in cm. The trend curve
will always be printed in landscape format. The format of this
option is: WIDTHxHEIGHT. The default setting is A4
landscape format.
-t <timespan>
- number of seconds back in time the TrPrint should request
data from the trendLog. The data is requested from the time
specified with the -f option. This options must be specified
otherwise no data will be requested.
-v <varname>
- name of the variable to request trend data for or a name of
a file where a collection of trend variables with comments are
specified. The character ! is used to separate whether the
argument should be considered by TrPrint to be a file or a
ProcSee Reference Manual
157
ProcSee Executables Manual Pages (1)
TrPrint (1)
variable name. An exclamation mark as the first character
indicates that the name is a variable. The layout of the variable
file is described above.
-?<
help - write a summary of the TrPrint options to stdout.
VARIABLES
PROCSEELANG will be used by TrPrint to determine the language to use. For the time being only English and Norwegian are supported.
WARNING
TrPrint is in a development phase and will probably change dramatically in the near future.
There is however a slight possibility that the functionality in the TrPrint program will be
incorporated in the rtm and that TrPrint will not be part of future releases of ProcSee.
EXAMPLES
$ TrPrint -h rtm1 -l TrendLogger -a System -v !trendvar1 -f 0 -t 3600
-p pr50
This command will request data for the variable trendvar1 from the
trend logger and make a hardcopy of the trend curve from current time and
one hour back in time on the postscript printer pr50.
$ TrPrint -h rtm1 -l TrendLogger -a System -v trendfile -f 94:07:21:12:00 -t 36000 -p pr50 -o myOutput
-m 1,2,1,2 -s 24x18
This command will setup the TrPrint program to use a paper sheet with
the format 24x18 cm and the margins 1,2,1,2. The variable to request data
from will be read from the file trendfile. The data will be requested
from the time 94:07:21:12:00 and 10 hours back in time. The data will be
written to the output file myOutput.
SEE ALSO
trendLog
158
ProcSee Reference Manual
Application Programmers Interface Manual
pages
ProcSee Reference Manual
159
160
ProcSee Reference Manual
Application Programmers Interface
apilib (3c)
MODULE
apilib - ProcSee Application Programmer’s Interface
DESCRIPTION
The ProcSee Application Programmer’s Interface(api) deals with the interface between
the application program and the Run Time Manager (rtm). api contains several high level
functions, which are used to communicate with one or more rtms.
The maximum legal length of variable names are 32 characters, including the terminating
’\0’. A size is used to indicate the number of elements for array variables, single variables
should use size = 0. All variables have a type, coded as bit patterns found in the file
$PROCSEE_DIR/include/TypeCodes.h The available types are PfCChar, PfCUnsignedChar, PfCInt, PfCUnsignedInt, PfCShortInt, PfCUnsignedShortInt, PfCFloat, PfCDouble and PfCRecord. PfCPointer can be added to (bit wise OR) all of these
types.
ENVIRONMENT VARIABLES
PROCSEE_DIR - Mandatory. The location of the ProcSee files.
ARCH - Mandatory. The architecture of the computer. Valid values are hpArch, sunArch, macX86Arch, linuxX86Arch and winArch.
CONTROLHOST - Optional. The host where the control is running. Default value is
local host.
BUSTIMEOUT - Optional. The maximum period of time (given in milliseconds) to wait
for a reply from a function call to an rtm. If there is no reply within this duration of time,
the function returns and set the value of apiError to SbFailed. Default value is 30000
milliseconds.
BUSRETRY - Optional. The period of time (given in milliseconds) between each attempt
to connect to an rtm. Default value is 4000 milliseconds.
BUSCONNECT - Optional. The maximum period of time (given in milliseconds) before
the application should give up getting connection to an rtm. Default value is -1, i.e the
application will try forever, at intervals given by BUSRETRY
COMPILING AND LINKING
The directive #include <api/api.h> must be included in the application program code
wherever the api is used. To compile the application program, the compiler must be told
where to locate the api header files, and to link you need to have the ProcSee library path
set and use the correct library. The C/C++ preprocessor also needs to have the architecture
you are on defined. Please refer to the table below to find this.
ARCH
Description
hpArch
HP 9000/700 series PA-RISC running HP-UX
ProcSee Reference Manual
161
Application Programmers Interface
apilib (3c)
ARCH
Description
linuxX86Arch
Intel 80x86 running linux
macX86Arch
Apple Mac running Mac OS X on Intel 80x86
sunArch
Sun SPARC running Solaris
winArch
Intel 80x86 running Windows 7, Vista, XP
Depending on the platform, additional libraries are also required. The minimum set of library
options required to link a ProcSee application program are listed in the table below.
ARCH
link options
hpArch
-lProcSeeApiC
linuxX86Arch
-lProcSeeApiC
macX86Arch
-lProcSeeApiC
sunArch
-lProcSeeApiC -lsocket -lnsl
winArch
<installdir>/lib/winArch/[vc8-vc10]/
ProcSeeApiC_[MD|MT|MDd|MTd].lib
WS2_32.lib
Specific instructions for Windows, and Unix is given in the following sections.
Windows - Microsoft Visual Studio
This section shows the required ProcSee C API configuration options for a Microsoft Visual
Studio. We have used Visual Studio 2010 version for the screenshots.
Remember that for Visual Studio 2010 the project needs to have a C(++) file added before
you can change the C/C++ project options.
The project need to use the ProcSee and ws2_32 libraries, the ProcSee header file include
path, as well as set the winArch define.
162
ProcSee Reference Manual
Application Programmers Interface
apilib (3c)
Figure 1
Linker Settings
This can be done by selecting the Project menu and Properties. Select and expand the entry that says Linker which should also select General. Under the General edit the Additional Library Directories field and add the path to the ProcSeelibraries.
The path suffix indicate which version of the Visual Studio Runtime the libraries are
linked. MS Visual Studio 2010 have the suffix vc10, 2008 have vc9, 2005 have vc8.
In this example we use VS 2010 and will use the ProcSee library path:
"$(PROCSEE_DIR)\lib\winArch\vc10" as shown in Figure 1.
The next we need to do is specifying which libraries we want to link into our project. Select the entry that says “Input” and then edit the field "Additional Dependencies" option
as show in Figure 2.
ProcSee Reference Manual
163
Application Programmers Interface
apilib (3c)
Add the following two libraries: ws2_32.lib, and ProcSeeApiC_MDd.lib or
ProcSeeApiC_MTd.lib for Debug or ProcSeeApiC_MD.lib or ProcSeeApiC_MT.lib for
Release. Use the MD or MT version of the ProcSee library depending on which of the compiler settings: MD, MDd, MT or MTd, that you are using.
Figure 2
Linker Input
You now need to define "winArch" as a preprocessor definition. Press the C/C++ entry and
select "Preprocessor". Edit Preprocessor Definitions" and enter "winArch" at the end of the
text area, as shown in Figure 3. Click on the OK button
Figure 3
C++ Settings
164
ProcSee Reference Manual
Application Programmers Interface
apilib (3c)
You also need to specify where the header files for ProcSee can
be found. Select General under the "C/C++" entry. Edit the "Additional include directories" field and add the ProcSee include
directory (usually "$(PROCSEE_DIR)\include"). (see Figure 4).
Click on the OK button.
Figure 4
C++ Include Directory
Windows - Command Line
This section describes the compile and linker options you will have to use to compile and
link your program against the ProcSee C Api using the basic Microsoft Visual Studio
C(++) toolchain.
ProcSee Reference Manual
165
Application Programmers Interface
apilib (3c)
Compiling
The libraries distributed with ProcSee are compiled with Microsoft Visual C++ 6.0 to 10.0. It is recommended that you use
the library compiled against the latest version of Visual Studio,
when creating applications for Windows XP, Vista and newer.
We are in no position to make any warranties that compilers
from other vendors will work, but if they are compatible with
Microsoft Visual C++ 9.0 there should be no problem.
The compiler to use is cl.exe. The following compilation options must be set.
/c
Compiles the hello.c program without
linking.
/DwinArch
Needed by api.h.
/I <path>
The compiler must be told where it can
locate the header files. The include path
for ProcSee is <installdir>/include, where <installdir> is the directory where ProcSee is installed.
/MT or /MD
Creates a multi-threaded executable file
when linking. For more information see
next section about linking the hello.c
program.
Linking
The follwing library files are needed when linking the hello.c
program on a Windows platform using Microsoft Visual C++
9.0. The cl.exe linker is used in this example to generate the hello.exe application.
<installdir>\lib\winArch\vc9\ProcSeeApiC_MD.lib
WS2_32.lib
An example of linking the hello.exe program:
cl /MD hello.obj d:\procsee\lib\winArch\vc9\ProcSeeApiC_MD.lib WS2_32.lib
166
ProcSee Reference Manual
Application Programmers Interface
apilib (3c)
Unix including Linux and Mac
Compiling
The C compiler is typically called cc on UNIX systems. If you
use C++, then the compiler is probably called CC. A GNU compiler called gcca can also be used, which is capable of compiling both C and C++ code. Irrespective of which architecture or
compiler is used, the following compilation options must be
set:
-I <path>
The compiler must be told where it can
locate the header files. The include path
for ProcSee is <installdir>/include, where <installdir> is the directory where ProcSee is installed.
If ProcSee is installed in /usr/local/procsee, then, for a
program file called hello.c, a typical compile command on a
workstation would be:
% cc -c -I/usr/local/procsee/include hello.c
a. GNU stands for ’Gnu’s Not Unix’. The Free Software Foundation (FSF) produces high quality software that can be
obtained at no charge. Emacs, bison, flex, gcc, and ghostscript are widely used GNU software.
Linkin
After the code has been compiled, it has to be linked to create an executable program.
The following options are needed when linking the hello.c program on a UNIX platform:
-L <path>
This option informs the linker about
where to find the libraries it needs. The
link path is <installdir>/lib/
<arch>, where <installdir> is the
directory where ProcSee is installed,
and <arch> is the architecture.
-lProcSeeApiC
This tells the linker to link the ProcSee
API library into the program. The linker
will search for the libraries at the path(s)
indicated by the -L option.
The cc or CC commands can also be used to link the program. A
typical link command on a workstation might look something
like this:
% cc hello.o -L/usr/local/procsee/lib/sgi -lProcSeeApiC -o hello
ProcSee Reference Manual
167
Application Programmers Interface
apilib (3c)
To link your application, use the following linker options: -L$PROCSEE_DIR/lib/$ARCH
and -lProcSeeApiC (or -lProcSeeApiC_debug for debugging purposes).
Additional libraries are required on some platforms. On sunArch the -lsocket and -lnsl options are required.
FUNCTIONS
A list of the available api functions sorted by category, follows:
Connection: PfAddRtmToCurrent, PfClose, PfGetNumAllRtms, PfGetNumCurrentRtms,
PfIsConnected, PfInit, PfInitialize, PfNonBlocking, PfSetAllRtmsCurrent, PfSetProcessClass, PfSetRtmCurrent, PfWinInit, PfWinInitialize, PfWithdrawRtmFromCurrent, PfXtInit, PfXtInitialize
Main Loop: PfDispatch, PfEndLoop, PfGetFDSet, PfMainLoop, PfPeriodic
Records: PfAddField, PfBeginRecord, PfDeleteRecord, PfEndRecord, PfPrintAllRecords,
PfReadScript
Variables: PfCreateVar, PfCreateArray, PfData, PfDeleteVar, PfDeleteVarId, PfFlushCreateVar, PfGetDefinedVars, PfGetTypeId, PfGetVarId, PfId, PfIndex, PfName, PfNextVarId, PfPrintAllVars, PfReadScript
Updating variable values: PfDisableInitialUpdate, PfEnableInitialUpdate,PfFlush, PfFlushUseFields, PfPut, PfReceiveRtmUpdates, PfReceiveRtmStringUpdates, PfSend, PfSendApiStringUpdates,
PfSendToOne,
PfSetFlushBehaviour,
PfUpdateValuesId,
PfUseField
Miscellaneous: PfAddInput, PfAddVarAction, PfDiagnosticsSubscribe, PfDiagnosticsSubscribeEx, PfEditLogBuffer, PfExecute, PfExecuteAsync, PfExportWindow, PfFlushEditLogBuffer, PfGetChanges, PfGetChildren, PfGetCurrentObject, PfGetDefinition,
PfGetDiagnosticsMessage, PfGetFuncArg, PfGetSystemError, PfGetWindowChanges, PfPrintSystemError, PfQuoteString, PfRegisterFunction,
PfRegisterFunctionEx, PfReleaseWindow,
PfRemoveAllInputs,
PfRemoveInput,
PfRemoveProcessHandler,
PfRemoveVarAction, PfSetDefinition, PfSetMaxQuotedStrings PfSetProcessHandler, Pfsor, PfUnquoteString
Events: PfEvent, PfEvents, PfClearEvents
AUTHOR
api was developed by HГҐkon Jokstad at IFE.
168
ProcSee Reference Manual
Application Programmers Interface
apiError (3c)
VARIABLE
apiError - A global variable to hold error codes returned from the api functions
SYNOPSIS
extern int32 apiError;
DESCRIPTION
The api functions assign specific values to apiError in order to reflect an error condition
that has occurred. The value of apiError should be checked after each call to an api function to verify a successful operation. Possible values for apiError are found in the file
$PROCSEE_DIR/include/ErrorCodes.h. The value OK indicates "No error".
The two functions PfGetSystemError and PfPrintSystemError converts the value of
apiError to a meaningful text.
SEE ALSO
PfGetSystemError in "ProcSee Reference Manual"on page 211
PfPrintSystemError in "ProcSee Reference Manual"on page 230
ProcSee Reference Manual
169
Application Programmers Interface
PfAddField (3c)
FUNCTION
PfAddField - Add a field to a specified record
SYNOPSIS
int32 PfAddField( recName, fieldName, fieldSize, fieldType,
fieldRecName, value)
char* recName;
char* fieldName;
int32 fieldSize;
int32 fieldType;
char* fieldRecName;
void* value;
DESCRIPTION
PfAddField adds a field to the record given by recName. fieldName is the name of the field
to be added. A fieldSize of 0 indicates a non array field, else it gives the size of the array.
fieldType should be one of the type codes specified in $PROCSEE_DIR/include/TypeCodes.h, like PfCInt, PfCFloat or PfCRecord. If fieldType is PfCRecord or PfCRecord
| PfCPointer, fieldRecName should give the name of that record, else NULL should be
used. value should point to a default value for this field. If fieldType is PfCRecord and value
is NULL, the default values in the record named fieldRecName, will be used. The value returned is apiError.
WARNING
A simpler and safer way to create records is using PfReadScript.
EXAMPLE
See man page for PfBeginRecord.
SEE ALSO
PfBeginRecord in "ProcSee Reference Manual"on page 174
PfEndRecord in "ProcSee Reference Manual"on page 187
PfReadScript in "ProcSee Reference Manual"on page 234
170
ProcSee Reference Manual
Application Programmers Interface
PfAddInput (3c)
FUNCTION
PfAddInput - Set up a call back function to be called from PfMainLoop
SYNOPSIS
int32 PfAddInput( fd, condition, func )
int32
fd;
int32
condition;
PfTInputFunc func;
typedef int32 (*PfTInputFunc) ( int32 fd );
DESCRIPTION
PfAddInput prepares PfMainLoop to listen for activity on the specified file descriptor
fd. condition should be one of the constants PfCReadCondition, PfCWriteCondition,
PfCExceptCondition or PfCAllConditions. func is the function to be called whenever
activity on that file descriptor is discovered. The value returned is apiError.
The function func should return OK, otherwise it will be suspended and never be called
again.
EXAMPLE
/* How to add a callback function for keyboard input */
int32 kbdHandler( int32 fd )
{
:
return OK;
}
PfAddInput( PfCKeyboardFd, PfCReadCondition, kbdHandler );
SEE ALSO
PfRemoveInput in "ProcSee Reference Manual"on page 242
PfRemoveAllInputs in "ProcSee Reference Manual"on page 241
PfMainLoop in "ProcSee Reference Manual"on page 223
ProcSee Reference Manual
171
Application Programmers Interface
PfAddRtmToCurrent (3c)
FUNCTION
PfAddRtmToCurrent - Add an rtm to the set of current rtms
SYNOPSIS
int32 PfAddRtmToCurrent( rtmId )
int32 rtmId;
DESCRIPTION
PfAddRtmToCurrent adds the rtm given by rtmId to the set of current rtms. The value returned is apiError. The set of current rtms is those rtms which the application program talks
to at the moment.
Within the user supplied connection call back functions (referred to as usrConnectFunc and
usrDisconnectFunc at the man page for PfInitialize) the set of current rtms by default consists of the single rtm to which connection is established or lost. Anywhere else, the set of
current rtms by default consists of all rtms for which the usrConnectFunc has finished.
The id of an rtm can be obtained by using PfId.
WARNING
Note that the application must have contact with the rtm to be added.
EXAMPLE
int32 rtmId = PfId( PfLocalProcess, "myRtmName" );
PfWithdrawRtmFromCurent( rtmId );
/* Do something that doesn’t involve rtm "myRtmName" */
:
PfAddRtmToCurrent( rtmId );
SEE ALSO
PfWithdrawRtmFromCurrent in "ProcSee Reference Manual"on page 259
PfSetAllRtmsCurrent in "ProcSee Reference Manual"on page 248
PfSetRtmCurrent in "ProcSee Reference Manual"on page 253
PfInitialize in "ProcSee Reference Manual"on page 217
PfId in "ProcSee Reference Manual"on page 215
172
ProcSee Reference Manual
Application Programmers Interface
PfAddVarAction (3c)
FUNCTION
PfAddVarAction - Set up a call back function to be called when a variable value is
changed from the rtm
SYNOPSIS
int32 PfAddVarAction( varId, func )
int32
varId;
PfTVarActionFunc func;
typedef int32 (*PfTVarActionFunc) ( int32 varId );
DESCRIPTION
PfAddVarAction registers a call back function func that is to be called whenever the variable varId is changed from the rtm. The value returned is apiError.
func should return OK.
EXAMPLE
int32 varHandler( int32 varId )
{
:
return OK;
}
int32 myVar = ...; /* Anything giving a varId */
PfAddVarAction( myVar, varHandler );
SEE ALSO
PfRemoveVarAction in "ProcSee Reference Manual"on page 244
PfMainLoop in "ProcSee Reference Manual"on page 223
ProcSee Reference Manual
173
Application Programmers Interface
PfBeginRecord (3c)
FUNCTION
PfBeginRecord - Start building a record structure
SYNOPSIS
int32 PfBeginRecord( recordName )
char* recordName;
DESCRIPTION
PfBeginRecord starts building a record structure, given the name of the record, recordName. The value of apiError is returned.
PfAddField should be called next, once for each field in the record. PfEndRecord should
be called to end the construction of the record.
WARNING
A simpler and safer way to create records is using PfReadScript.
EXAMPLES
int32 defaultInt = 45; /* Default value to use for rec1.Field1 */
PfBeginRecord( "rec1" );
PfAddField( "rec1", "Field1", 0, PfCInt, NULL, &defaultInt );
PfAddField( "rec1", "Field2", 0, PfCRecord, "rec2", NULL );
PfEndRecord( "rec1" );
SEE ALSO
PfAddField in "ProcSee Reference Manual"on page 170
PfEndRecord in "ProcSee Reference Manual"on page 187
PfReadScript in "ProcSee Reference Manual"on page 234
174
ProcSee Reference Manual
Application Programmers Interface
PfClearEvents (3c)
FUNCTION
PfClearEvents - Clears all events for one or several event types in the trend logger
SYNOPSIS
int32 PfClearEvents( logger, numEventNames, eventNames );
char* logger;
int32 numEventNames;
char* eventNames[];
DESCRIPTION
PfClearEvents clears all the events for the event types contained in the argument eventNames. The first argument logger is the name of the historic trend logger. The next argument numEventNames is the number of event type names that is passed as argument in the
character string array eventNames. This array must contain event type names.
This function can be sent to all the rtms contained in the set of current rtms. Only the rtm
that contains the actual historical trend logger will execute the function.
The value of apiError is returned.
EXAMPLES
char* eventNames[2];
eventNames[0] = "Ev321_V1";
eventNames[1] = "Ev234_V4";
PfClearEvents( "Logger", 2, eventNames );
SEE ALSO
PfEvent and PfEvents in "ProcSee Reference Manual"on page 188
ProcSee Reference Manual
175
Application Programmers Interface
PfClose (3c)
FUNCTION
PfClose - closes the connection to the rtm
SYNOPSIS
int32 PfClose();
DESCRIPTION
PfClose closes the connection to the rtms contained in the set of current rtms. The value of
apiError is returned.
Within the user supplied connection call back functions (referred to as usrConnectFunc and
usrDisconnectFunc at the man page for PfInitialize) the set of current rtms by default consists of the single rtm to which connection is established or lost. Anywhere else, the set of
current rtms by default consists of all rtms for which the usrConnectFunc has finished.
SEE ALSO
PfInitialize in "ProcSee Reference Manual"on page 217
PfAddRtmToCurrent in "ProcSee Reference Manual"on page 172
PfWithdrawRtmFromCurrent in "ProcSee Reference Manual"on page 259
176
ProcSee Reference Manual
Application Programmers Interface
PfCreateArray (3c)
FUNCTION
PfCreateArray - Create an array variable
SYNOPSIS
int32 PfCreateArray( varName, baseType, size, recordName, fix, value )
char* varName;
int32 baseType;
int32 size;
char* recordName;
int32 fix;
void* value;
DESCRIPTION
PfCreateArray creates an array variable. varName is the name of the variable. baseType
is the data type of the elements, for instance PfCInt or PfCFloat. The legal types are
found in $PROCSEE_DIR/include/TypeCodes.h and are listed at the man page for
apilib(3c). size is the number of elements in the array. If baseType is PfCRecord, recordName should specify the name of the record, otherwise NULL should be used. Argument
fix is ignored. If value is non-NULL, the api assumes that it points to a corresponding C
array where the data is stored. If value is NULL, the api will allocate memory for a corresponding C array. The value returned is the variable id if apiError is OK, else NullId
is returned.
PfCreateArray creates the variable locally in the api, and puts the variable information
into a local buffer to be used by PfFlushCreateVar. It relies on the user to call PfFlushCreateVar to create the variables in the rtm. If the buffer is full, PfCreateArray will call
PfFlushCreteVar itself in order to empty the buffer.
EXAMPLE
char charArray[100];
int32 charArrayId;
float floatArray[5];
int32 floatArrayId;
int32 recArrayId;
charArrayId = PfCreateArray( "charArray", PfCUnsignedChar, 100, NULL,
True, charArray );
floatArrayId = PfCreateArray( "floatArray", PfCFloat, 5, NULL,
True, floatArray );
recArrayId = PfCreateArray( "recArray", PfCRecord, 20, "myRecord",
True, NULL );
PfFlushCreateVar(); /* Creates the variables in the RTM */
SEE ALSO
PfCreateVar in "ProcSee Reference Manual"on page 178
PfFlushCreateVar in "ProcSee Reference Manual"on page 195
ProcSee Reference Manual
177
Application Programmers Interface
PfCreateVar (3c)
FUNCTION
PfCreateVar - Create a variable
SYNOPSIS
int32 PfCreateVar( varName, type, recordName, fix, value )
char* varName;
int32 type;
char* recordName;
int32 fix;
void* value;
DESCRIPTION
PfCreateVar creates a variable with the name varName. type is the data type of the variable,
e.g. PfCInt or PfCFloat. The legal types can be found in $PROCSEE_DIR/include/TypeCodes.h, and are listed at the man page for apilib(3c). If type is PfCRecord or PfCRecord|PfCPointer recordName should specify the name of the record, else NULL
should be used. Argument fix is ignored. If value is non-NULL, the api assumes that it points
to a corresponding C variable where the data is stored. If value is NULL, the api will allocate
memory for a corresponding C variable. The value returned is the variable id if apiError is
OK, else NullId is returned.
PfCreateVar creates the variable locally in the api, and puts the variable information into a
local buffer to be used by PfFlushCreateVar. It relies on the user to call PfFlushCreateVar
to create the variables in the rtm. However, if the buffer is full, PfCreateVar will call PfFlushCreateVar itself in order to empty the buffer.
EXAMPLES
int32
myInt;
int32
myIntId;
struct MyRec myRec;
int32
myRecId;
myIntId = PfCreateVar( "myInt", PfCInt, NULL, True, &myInt);
myRecId = PfCreateVar( "myRec", PfCRecord, "MyRec", True, &myRec);
PfFlushCreateVar();
SEE ALSO
PfFlushCreateVar in "ProcSee Reference Manual"on page 195
PfCreateArray in "ProcSee Reference Manual"on page 177
178
ProcSee Reference Manual
Application Programmers Interface
PfData (3c)
FUNCTION
PfData - Get the data pointer of an object
SYNOPSIS
void* PfData( id )
int32 id;
DESCRIPTION
PfData returns a pointer to the value of the object specified by id. The object might be a
variable, a field in a record variable or an entry of an array.
EXAMPLES
int32 myIntId, myRecId, myArrId;
int32 myRecF1Id, myArr3Id;
/* Create variables */
myIntId = PfCreateVar( "myInt", PfCInt, NULL, True, NULL );
myRecId = PfCreateVar( "myRec", PfCRecord, "MyRec", True, NULL );
myArrId = PfCreateArray( "myArr", PfCInt, 5, NULL, True, NULL );
PfFlushCreateVar();
/* Extract a field of a record variable and an entry of an array */
myRecF1Id = PfId( myRecId, "F1" );
myArr3Id = PfIndex( myArrId, 3 );
anInt = *(int32*) PfData( myIntId ); /* data pointer of a variable */
aFloat = *(float*) PfData( myRecF1Id ); /* data pointer of a field */
anInt = *(int32*) PfData( myArr3Id ); /* data pointer of array entry */
SEE ALSO
PfId in "ProcSee Reference Manual"on page 215
PfIndex in "ProcSee Reference Manual"on page 216
PfCreateVar in "ProcSee Reference Manual"on page 178
PfCreateArray in "ProcSee Reference Manual"on page 177
ProcSee Reference Manual
179
Application Programmers Interface
PfDeleteRecord (3c)
FUNCTION
PfDeleteRecord - Delete a record
SYNOPSIS
int32 PfDeleteRecord( recName )
char* recName;
DESCRIPTION
PfDeleteRecord deletes the record definition specified by recName. PfDeleteRecord fails
and returns an error status if the record is used in other record definitions or by some variable.
The value of apiError is returned.
SEE ALSO
PfBeginRecord in "ProcSee Reference Manual"on page 174
PfAddField in "ProcSee Reference Manual"on page 170
PfEndRecord in "ProcSee Reference Manual"on page 187
PfReadScript in "ProcSee Reference Manual"on page 234
180
ProcSee Reference Manual
Application Programmers Interface
PfDeleteVar (3c)
FUNCTION
PfDeleteVar, PfDeleteVarId - Delete a variable
SYNOPSIS
int32 PfDeleteVar( varName )
char* varName;
int32 PfDeleteVarId( varId )
int32 varId;
DESCRIPTION
PfDeleteVar and PfDeleteVarId delete a variable given its name or id. The value of
apiError is returned.
SEE ALSO
PfCreateVar in "ProcSee Reference Manual"on page 178
PfCreateArray in "ProcSee Reference Manual"on page 177
ProcSee Reference Manual
181
Application Programmers Interface
PfDiagnosticsSubscribe, PfDiagnosticsSub-
FUNCTION
PfDiagnosticsSubscribe, PfDiagnosticsSubscribeEx - Subscribe for messages from the
rtm
SYNOPSIS
int32 PfDiagnosticsSubscribe( scope, categories, func )
char*
scope;
int32
categories;
PfTCallback func;
int32 PfDiagnosticsSubscribeEx( scope, categories, func, PfTReqId reqId )
char*
scope;
int32
categories;
PfTCallback func;
PfTReqId reqId;
typedef int32 (*PfTCallback) ( PfTReqId reqId, void* data );
typedef long PfTReqId;
DESCRIPTION
PfDiagnosticsSubscribe and PfDiagnosticsSubscribeEx are used to subscribe for messages of different categories sent from the rtm. scope is a full name indicating the part of the
user interface for which the subscription is valid. categories is a bit mask that indicates the
categories. If bit number n in categories is set, then message category n is involved. func is
the function to be called whenever a message satisfying the required categories and scope is
received. reqId is a user supplied request identifier which is passed back as an argument in
the call back function. The value returned is apiError.
If categories is negative or func is NULL, then the subscription to those categories will be
unsubscribed. It is possible to broaden or narrow an existing subscription, and only one subscription will be registered for a given scope. Subsequent calls to PfDiagnosticsSubscribe/
PfDiagnosticsSubscribeEx for the same scope change the existing subscription rather than
create a new one.
Messages are sent from the rtm by calling message(3pTALK).
EXAMPLE
See an example at the man page for PfGetDiagnosticsMessage
SEE ALSO
PfGetDiagnosticsMessage in "ProcSee Reference Manual"on page 205
message(3pTALK) in "ProcSee Reference Manual"on page 392
182
ProcSee Reference Manual
Application Programmers Interface
PfDisableInitialUpdate (3c)
FUNCTION
PfDisableInitialUpdate - Prevent initial variable values to be transferred from application to RTM
PfEnableInitialUpdate - Enable initial variable values to be transferred from application
to RTM
SYNOPSIS
int32 PfDisableInitialUpdate()
int32 PfEnableInitialUpdate()
DESCRIPTION
By default the initial variable values are transferred from the application to the RTM when
variables are created using PfCreateVar, PfCreateArray or PfReadScript. PfDisableInitialUpdate disables this default update. PfDisableInitialupdate must be called prior to
PfCreateVar, PfCreateArray or PfReadScript to take effect. PfEnableInitialUpdate restores to the default behaviour.
EXAMPLES
/* This function is called when connection to an RTM is established */
void onRtmConnect( int32 status, const char* rtmName )
{
PfDisableInitialUpdate();
PfCreateVar( "abc", PfCInt, NULL, 0, NULL );
PfReadScript( "file1.pdat" );
}
ProcSee Reference Manual
183
Application Programmers Interface
PfDispatch (3c)
FUNCTION
PfDispatch - Receive input from rtm or other external sources
SYNOPSIS
int32 PfDispatch( r,w,e )
fd_set* r;
fd_set* w;
fd_set* e;
DESCRIPTION
PfDispatch is to be used after the select(2) function call if the application implements its
own main loop. PfDispatch performs SWBus operations for receiving input from the rtm.
Functions set by PfAddInput are executed if the specified file descriptor has been activated.
If a variable used by PfAddVarAction is changed, the corresponding function is executed.
The value of apiError is returned.
EXAMPLES
switch( select( sizefds, &r, &w, &e, interval ) )
{
case -1:
/* Error */
break;
default:
PfDispatch( &r, &w, &e );
}
SEE ALSO
PfMainLoop in "ProcSee Reference Manual"on page 223
PfPeriodic in "ProcSee Reference Manual"on page 227
PfAddVarAction in "ProcSee Reference Manual"on page 173
PfAddInput in "ProcSee Reference Manual"on page 171
184
ProcSee Reference Manual
Application Programmers Interface
PfEditLogBuffer (3c)
FUNCTION
PfEditLogBuffer - create a new, append or cancel set of data in trend logger
SYNOPSIS
int32 PfEditLogBuffer( fullName, lCycle, mode, numOfValues, tArr, vArr )
char* fullName;
int32 lCycle;
int32 mode;
int32 numOfValues;
int32* tArr;
float* vArr;
DESCRIPTION
PfEditLogBuffer is used for altering the content of the trend log buffer for a trend variable uniquely defined by fullName and lCycle. The same trend variable can be logged at
different frequencies, and this is the reason why lCycle has to be specified to uniquely define the variable. A lCycle value set to -1 can be used if the trend variable is logged at one
frequency only. The mode parameter is used for deciding the type of action that is to be
performed on the variable. Legal values for mode are PfCLogBufferNew, PfCLogBufferAppend and PfCLogBufferCancel. If mode is PfCLogBufferCancel, only the first
two parameters are required, all others should be set to 0. Data is logged in the trend logger as a time/value pair. tArr is an array containing the time stamps for the data set and
vArr is containing the corresponding values. The first element of the arrays is the oldest
time/value pair.
PfEditLogBuffer is storing the information locally in the api, and puts the variable information into a local buffer to be used by PfFlushEditLogBuffer. It relies on the user to
call PfFlushLogEditBuffer to create the variables in the RTM. If the buffer is full, PfEditLogBuffer will call PfFlushEditLogBuffer itself in order to empty the buffer.
The value of apiError is returned.
SEE ALSO
PfFlushEditLogBuffer in "ProcSee Reference Manual"on page 196
TrendLog (3pTALK) in "ProcSee Reference Manual"on page 462
ProcSee Reference Manual
185
Application Programmers Interface
PfEndLoop (3c)
FUNCTION
PfEndLoop - Terminate PfMainLoop
SYNOPSIS
int32 PfEndLoop()
DESCRIPTION
PfEndLoop makes PfMainLoop terminate. The value of apiError is returned.
SEE ALSO
PfMainLoop in "ProcSee Reference Manual"on page 223
186
ProcSee Reference Manual
Application Programmers Interface
PfEndRecord (3c)
FUNCTION
PfEndRecord - Send a record definition to the rtm
SYNOPSIS
int32 PfEndRecord( recName )
char* recName;
DESCRIPTION
PfEndRecord sends the record definition specified by recName to the rtm. After PfEndRecord is completed the record is ready to be used by variables or other records. The
value returned is the record id if apiError is OK, else NullId is returned.
WARNING
A simpler and safer way to create records is using PfReadScript.
EXAMPLE
See an example at the man page for PfBeginRecord.
SEE ALSO
PfBeginRecord in "ProcSee Reference Manual"on page 174
PfAddField in "ProcSee Reference Manual"on page 170
PfReadScript in "ProcSee Reference Manual"on page 234
ProcSee Reference Manual
187
Application Programmers Interface
PfEvent, PfEvents (3c)
FUNCTION
PfEvent, PfEvents - Sends one or several events to the historic trend logger
SYNOPSIS
int32 PfEvent( trendLogger, eventName, dataType, recordName, size,
timeStamp, data )
char* trendLogger;
char* eventName;
int32 dataType;
char* recordName;
uint32 size;
uint32 timeStamp;
void* data;
int32 PfEvents( trendLogger, numEventData, eventData )
char*
trendLogger;
uint32 numEventData;
PfTEvents* eventData;
typedef struct
{
char* eventName;
/* Name of the event type
*/
int32 dataType;
/* Data type from <TypeCodes.h> */
char* recordName; /* Name of record if PfCRecord */
uint32 size;
/* >1 array.
*/
uint32 numEvents;
/* Number of events.
*/
uint32* timeStamps; /* When the events occured.
*/
void* data;
/* The data.
*/
} PfTEvents;
DESCRIPTION
PfEvent sends a single event to an rtm containing a historic trend logger. The argument
trendLogger is the name of the trend logger in the rtm. The name of the event type is specified in the argument eventName. The name must match one of the event types specified in
the trend variable configuration file. The argument dataType is the data type of the variable,
e.g. PfCInt, PfCFloat, PfCRecord. The legal types can be found in $PROCSEE_DIR/include/TypeCodes.h, and are listed in the man page for apilib(3c). If the data type is PfCRecord, recordName should specify the name of the record, else NULL should be used. If
the data type is an array the size attribute should be specified to match the array size of the
data parameter. The time when the event occured is specified with the parameter timeStamp
and is given in seconds since 1. january 1970. The value 0 can be used if the current time of
the trend logger shold be used. The last argument is the actual data that is sent to and saved
in the historic trend logger.
PfEvents sends one or several event types each containing one or several events to an rtm
containing a historic trend logger. The first argument to this function is trendLogger which
is the same as for PfEvent. numEventData is the number of event data put in the last argument eventData. eventData is an array of type struct PfTEvents. The PfTEvents data type
structure is used to describe one event type that will be sent to the historical trend logger.
188
ProcSee Reference Manual
Application Programmers Interface
PfEvent, PfEvents (3c)
When initializing one event type in the PfTEvents structure several events can be sent in
a single function call. The fields numEvents and data are arrays of time stamps and corresponding event data, respectively. The time stamp pointer can be set to 0 if the current
time of the trend logger shold be used.
This paragraph applies to array data types only. If the PfCPointer bit is specified for the
dataType then the array will be pointers to the data and not an array of the data itself. An
example will clarify this. If the dataType is set to PfCInt and the size is 10 the data must
point to an array of 10 integers. On the other hand if the dataType is set to PfCInt | PfCPointer and the size is 10 the data field must point to an array of 10 pointers to integers.
Each cell in the array must then point to an integer variable containing the value.
Note that the data type, record name and size must match the data sent in the data argument or the data field of the PfTEvents struct. The api uses this information when sending
the data to the rtm containing the historic trend logger.
To visualize the events the class EventPlot in the rtm is used. The EventPlot is a subshape of Trend.
The value of apiError is returned.
EXAMPLES
/* Send a single event of type float to the trend logger */
float value;
value = 3.14;
PfEvent( "Logger", "Ev321_V1", PfCFloat, 0, 1, time( 0 ), &value );
/* Send the event types Ev321_V1 of type float and Ev432_S1 of */
/* type int[2] to the trend logger.
*/
PfTEvents ev[2];
float v1;
int
v2[2];
v1 = 2.71;
v2[0] = 10;
v2[1] = 20;
ev[0].eventName = "Ev321_V1";
ev[0].dataType = PfCFloat;
ev[0].recordName = 0;
ev[0].size
= 1;
ev[0].numEvents = 1;
ev[0].timeStamps = 0;
ev[0].data
= &v1;
ev[1].eventName = "Ev432_S1";
ev[1].dataType = PfCInt;
ev[1].recordName = 0;
ev[1].size
= 2;
ev[1].numEvents = 1;
ev[1].timeStamps = 0;
ProcSee Reference Manual
189
Application Programmers Interface
ev[1].data
PfEvent, PfEvents (3c)
= v2;
PfEvents( "Logger", 2, ev );
SEE ALSO
PfClearEvents in "ProcSee Reference Manual"on page 175
190
ProcSee Reference Manual
Application Programmers Interface
PfExecute, PfExecuteAsync (3c)
FUNCTION
PfExecute, PfExecuteAsync - Send pTalk code to rtm for execution
SYNOPSIS
char* PfExecute( scope, sourceCode, ... )
char* scope;
char* sourceCode;
int32 PfExecuteAsync( scope, sourceCode, ... )
char* scope;
char* sourceCode;
DESCRIPTION
PfExecute sends a pTALK(the ProcSee language) compound statement or expression
specified in sourceCode to rtm for execution. The code is compiled and executed in the
scope given as parameter. The scope is given as a fullname; if scope is NULL or an empty
string, then the code is executed in the application scope.
PfExecute accepts a variable argument list together with formatting options in the source
code, just like printf(3).
If sourceCode is an expression, then the calculated value of that expression is returned as
a character string by PfExecute. If the result is a string value, the returned string includes
the quotes around the string, The PfUnquoteString function can be used to remove these
quotes. If the sourceCode is a statement, the empty string "" is returned. NULL is returned in case of errors. The length of sourceCode must not exceed 60000 bytes.
PfExecuteAsync is identical to PfExecute except that the RTM will not return a result
from the execution of sourceCode. The value returned from PfExecuteAsync is apiError.
We recomend to use PfExecuteAsync instead of PfExecute wherever possible, refer to
the examples below.
EXAMPLES
char *win, *pic, *result, *varName;
:
PfExecuteAsync( NULL, "{ displayPicture( \"%s\", \"%s\" ); }", win, pic );
varName = "myVar";
PfExecuteAsync( NULL, "{ printf( \"%s = %%d\", %s ); }", varName, varName );
result = PfExecute( "mainPicture", "4 * xSnap" );
SEE ALSO
printf(3) in "ProcSee Reference Manual"on page 407, and PfUnquoteString on page
233.
ProcSee Reference Manual
191
Application Programmers Interface
PfExportWindow (3c)
FUNCTION
PfExportWindow - Export an X window to the rtm
SYNOPSIS
#include <api/p3xapi.h>
int32 PfExportWindow( windowName, displayName, win, mask, func, reqId )
char*
windowName;
char*
displayName;
Window
win;
int32
mask;
PfTCallback func;
PfTReqId reqId;
typedef long PfTReqId;
typedef int32 (*PfTCallback) ( PfTReqId reqId, void* data );
DESCRIPTION
PfExportWindow is a function used to integrate ProcSee into a Motif application. This is
described in detail in a separate chapter in the ProcSee Users Guide.
PfExportWindow gives the rtm an X window to manipulate. name is the name of the window. displayName is the display name used by X, e.g "hostName:0.0". win is the X windowid. mask is a bit mask specifying the events for which a call back should be received. func
is the call back function to be called when an event of the specified type occurs. reqId is a
user-defined id to be used as a parameter to the call back function. This id is used to match
the request from api and the replay from rtm. The value returned is apiError.
Legal values for mask is any combination of the constants WOpNone, WOpAll ,WOpMove, WOpResize, WOpBackgroundColor, WOpForegroundColor, WOpColor,
WOpPattern, WOpOneSelected, WOpOneUnselected, WOpAllUnselected, WOpSelection, WOpChangeSelected, WOpIconify, WOpClose, WOpRaise, WOpLower,
WOpMap, WOpUnmap, WOpZoomPan and WOpScrollBar. These constants are found
in the file $PROCSEE_DIR/include/WindowOp.h.
The data argument to the callback function is a pointer to one of the following structures defined in the header file $PROCSEE_DIR/include/WindowOp.h.
struct WOpAnyStruct
{
int32 operation;
Window window;
};
struct WOpMoveStruct
/* The application should move */
{
/* the window manager window. */
int32 operation;
Window window;
int32 x;
int32 y;
};
192
ProcSee Reference Manual
Application Programmers Interface
PfExportWindow (3c)
struct WOpResizeStruct
/* The application should resize */
{
/* the window manager window. */
int32 operation;
Window window;
int32 width;
int32 height;
float32 worldWidth;
float32 worldHeight;
};
struct WOpColorStruct /* Set the backgroundcolour of the window */
{
int32
operation;
Window
window;
unsigned long background;
unsigned long foreground;
};
struct WOpZoomPanStruct /* Move and resize the window */
{
/* Only for windows in scrolled windows */
int32
operation;
Window
window;
int32
width;
int32
height;
int32
x;
int32
y;
};
struct WOpScrollBarStruct
{
int32
operation;
gilWindowHandle window;
int32
style;
/* Scrollbars On/Off */
};
SEE ALSO
PfReleaseWindow in "ProcSee Reference Manual"on page 240
PfGetWindowChanges in "ProcSee Reference Manual"on page 214
Window(3pTALK) in "ProcSee Reference Manual"on page 488
ProcSee Reference Manual
193
Application Programmers Interface
PfFlush (3c)
FUNCTION
PfFlush - Transfer variable values, perform a display update and tick trendlogger
SYNOPSIS
int32 PfFlush();
DESCRIPTION
PfFlush performs three tasks. First it transfers any variable values put in the transfer buffer
(by PfPut, PfSend, PfSendToOne or PfUpdateValuesId) to the rtm. When the variable
values are transferred, the rtm is asked to perform a display update. Lastly the rtm is asked
to tick its trend logger if existing. PfFlush is an asynchronous function, sending data to the
rtm without waiting for an answer. The value of apiError is returned.
The behaviour of PfFlush can be modified by PfSetFlushBehaviour. PfFlush will always
transfer data values, but display update and trend log ticking can be switched off.
For a more complete description of what happens inside rtm when updating displays, see the
update(3pTALK) man page.
SEE ALSO
PfSetFlushBehaviour in "ProcSee Reference Manual"on page 250
update(3pTALK) in "ProcSee Reference Manual"on page 482
194
ProcSee Reference Manual
Application Programmers Interface
PfFlushCreateVar (3c)
FUNCTION
PfFlushCreateVar - Create variables and arrays in the rtm
SYNOPSIS
int32 PfFlushCreateVar()
DESCRIPTION
PfFlushCreateVar use the information stored by PfCreateVar and PfCreateArray to
create variables in the rtm. PfCreateVar and PfCreateArray creates variables locally in
the api, and relies on the user to call PfFlushCreateVar when all variables are created.
PfFlushCreateVar is also called internally from PfCreateVar or PfCreateArray if the
internal buffer is full.
EXAMPLE
int32 myIntId = PfCreateVar( "myInt", PfCInt, NULL, True, NULL );
int32 myArrId = PfCreateArray( "myArr", PfCInt, 10, NULL, True, NULL );
PfFlushCreateVar();
SEE ALSO
PfCreateVar in "ProcSee Reference Manual"on page 178
PfCreateArray in "ProcSee Reference Manual"on page 177
ProcSee Reference Manual
195
Application Programmers Interface
PfFlushEditLogBuffer (3c)
FUNCTION
PfFlushEditLogBuffer - execute operations on trend log buffers in the RTM
SYNOPSIS
int32 PfFlushEditLogBuffer();
DESCRIPTION
PfFlushEditLogBuffer transfers all trend variables and the corresponding values put in the
transfer buffer PfEditLogBuffer to the RTM. When the variable values are transferred, the
RTM is asked to perform the required operations. PfFlushEditLogBuffer is an asynchronous function, sending data to the RTM without waiting for an answer. The value VariableNotExist is returned if the specified variable is not a trended variable, otherwise OK.
SEE ALSO
PfEditLogBuffer in "ProcSee Reference Manual"on page 185
TrendLog (3pTALK) in "ProcSee Reference Manual"on page 462
196
ProcSee Reference Manual
Application Programmers Interface
PfFlushUseFields (3c)
FUNCTION
PfFlushUseFields - Send useField information to the rtm
SYNOPSIS
int32 PfFlushUseFields()
DESCRIPTION
PfFlushUseFields sends the information stored in an internal buffer by PfUseField to the
rtm. When PfFlushUseFields has finished successfully, PfPut, PfSend. PfSendToOne
and PfUpdateValuesId can be used for updating single fields of record variables or entries of arrays. The value returned is apiError.
SEE ALSO
PfUseField in "ProcSee Reference Manual"on page 256
PfPut in "ProcSee Reference Manual"on page 231
PfSend in "ProcSee Reference Manual"on page 245
PfUpdateValuesId in "ProcSee Reference Manual"on page 255
ProcSee Reference Manual
197
Application Programmers Interface
PfGetChanges (3c)
FUNCTION
PfGetChanges - Set up a call back function for changes in rtm’s symbol table.
SYNOPSIS
int32 PfGetChanges( scope, func, reqId )
char*
scope;
PfTChangeFunc func;
PfTReqId
reqId;
typedef int32 (*PfTChangeFunc) (PfTReqId reqId, int operation, void* data);
typedef long PfTReqId;
DESCRIPTION
PfGetChanges instructs the rtm to call function func whenever certain changes occur in
rtm’s symbol table. The scope argument is used to filter out the changes that the rtm should
send. scope is the full name of an object that exists in the symboltable. Only changes in the
symbol table at this level or in any of the child levels will result in a call of the call back function. If a lot of changes happen, only the top-level changes are reported. This means that if
both a shape and the picture that contains the shape are created in the same execution cycle
of pTALK, only the creation of the picture is reported. The application should then use PfGetChildren to get everything below the picture. The reqId argument is a user-defined argument that is passed on to the call back function. Only one function can be registered at each
scope, and if PfGetChanges is called with the func argument set to NULL, the subscription
will be removed. The rtm also removes the subscription if the object at the given scope is
removed. The subscription will also be removed if the connection between the rtm and the
api is removed. The return value is the value of apiError.
operation has the value of one of the constants PfCObjectCreated, PfCObjectRenamed,
PfCObjectRemoved, which is found in the file $PROCSEE_DIR/include/WindowOp.h.
Information about the actual change can be obtained using Pfsor functions with the data
pointer as input argument. The data will always contain the full name and the idmask of the
object that is created, renamed, or removed. For created or renamed objects, the new signature of the object is also part of the data.
The PfCObjectCreated will be used when an object is inserted into the symbol table, e.g.
when the pTALK function newRectangle() etc. is used, or when a shape is drawn.
The PfCObjectRemoved will be used when an object is removed from the symbol table, e.g.
when the pTALK function remove is used. If an object containing child objects are created
or removed, only the "parent" object is reported.
The PfCObjectRenamed will be used when an object is renamed. All calls after this will use
the new name in the full names. The data for rename also uses the Extra field of the sor data,
for the new name of the object.
EXAMPLE
int32 changeCB(PfTReqId rId, int op, void* data)
{
198
ProcSee Reference Manual
Application Programmers Interface
PfGetChanges (3c)
printf("SymbolTable change: rId=%d", rId);
// update local view of rtm’s symboltable
switch (op) {
case PfCObjectCreated:
insertObj(PfsorFullName(data));
break;
case PfCObjectRenamed:
renameObj(PfsorFullName(data), PfsorExtra(data));
break;
case PfCObjectRemoved:
removeObj(PfsorFullName(data));
break;
}
return OK;
}
connectCb()
{
:
PfGetChanges("::myApp.myPict", changeCB, 12345);
:
}
SEE ALSO
Pfsor in "ProcSee Reference Manual"on page 254
PfGetChildren in "ProcSee Reference Manual"on page 200
PfExportWindow in "ProcSee Reference Manual"on page 192
PfGetWindowChanges in "ProcSee Reference Manual"on page 214
ProcSee Reference Manual
199
Application Programmers Interface
PfGetChildren (3c)
FUNCTION
PfGetChildren - Get the children of an object
SYNOPSIS
int32 PfGetChildren( fullName, mask, func, reqId )
char*
fullName;
int32
mask;
PfTCallback func;
PfTReqId reqId;
typedef long PfTReqId;
typedef int32 (*PfTCallback) ( PfTReqId reqId, void* data );
DESCRIPTION
PfGetChildren sends a request to rtm, asking rtm to send back the children of the object
specified by fullName. mask specifies the type of the children to be returned, func is the call
back function to be called for each child and reqId is a user specified id to be used to match
the request from api and the replay from rtm. The value returned is apiError.
The legal values for mask can be found in the header file $PROCSEE_DIR/include/IdCodes.h, NullId returns all. The SelectedObjectsIdMask value is special, in that it gives
the selected objects in the picture specified by fullName, or the selected objects in any picture, if fullName is the name of any composite object other than a picture, preferably the
empty string "".
func is called once for each child, and then once more to indicate endOfChildren. The data
for each child can be extracted from the data argument by the use of Pfsor functions. To
mark endOfChildren, PfsorIdMask returns NullId. func should return the value OK.
EXAMPLE
int numChilds;
int32 childCB( PfTReqId reqId, void* data )
{
if ( PfsorIdMask(data) == NullId )
{
/* End of children */
printf( "Total number of children received for reqId %d was %d\n",
reqId, numChilds );
}
else
{
printf( "FullName:\"%s\", Signature:\"%s\".\n",
PfsorFullName(data), PfsorSignature(data) );
numChilds++;
}
return OK;
}
:
200
ProcSee Reference Manual
Application Programmers Interface
PfGetChildren (3c)
numChilds = 0;
PfGetChildren("::myApp.myPict", NullId, childCB, 45);
SEE ALSO
Pfsor in "ProcSee Reference Manual"on page 254
ProcSee Reference Manual
201
Application Programmers Interface
PfGetCurrentObject (3c)
FUNCTION
PfGetCurrentObject - Get information about the current object in rtm
SYNOPSIS
void* PfGetCurrentObject()
DESCRIPTION
The PfGetCurrentObject gets the complete name and signature of the current object in rtm
The current object is the one that is selected, the last one selected if more than one object is
selected. The value returned is a pointer to a static buffer which holds the data about the current object in the rtm until the next call to an api function. These data can be extracted by
the use of Pfsor functions.
SEE ALSO
Pfsor in "ProcSee Reference Manual"on page 254
202
ProcSee Reference Manual
Application Programmers Interface
PfGetDefinedVars (3c)
FUNCTION
PfGetDefinedVars - Get the number of variables defined in the api
SYNOPSIS
int32 PfGetDefinedVars()
DESCRIPTION
PfGetDefinedVars returns the number of variables defined in the api. This function
should be used in combination with PfNextVarId.
EXAMPLE
See an example at the man page for PfNextVarId.
SEE ALSO
PfNextVarId in "ProcSee Reference Manual"on page 225
ProcSee Reference Manual
203
Application Programmers Interface
PfGetDefinition (3c)
FUNCTION
PfGetDefinition - Get the definition of an object in rtm
SYNOPSIS
void* PfGetDefinition( fullName, defSize )
char* fullName;
int32 defSize;
DESCRIPTION
PfGetDefinition is used to get the definition of an object in the rtm. The value returned is a
pointer to a static buffer which contains the name and the definition.
The fullName parameter is the full name of the object, and the defSize parameter is the expected size of the definition, and is used as the size of the buffer for the communication of
the definition back from the RTM. (It does no harm except for heavier load on the net if this
size is larger than the definition.)
The pointer returned by PfGetDefinition points to a static buffer which is unchanged until
the next use of an api function.
SEE ALSO
PfSetDefinition in "ProcSee Reference Manual"on page 249
204
ProcSee Reference Manual
Application Programmers Interface
PfGetDiagnosticsMessage (3c)
FUNCTION
PfGetDiagnosticsMessage - Extract a diagnostics message
SYNOPSIS
void PfGetDiagnosticsMessage( buffer, category, scope, text )
void* buffer;
int32* category;
char** scope;
char** text;
DESCRIPTION
PfGetDiagnosticsMessage extracts the data received in a diagnostics message. buffer is
the pointer received in the message call back function. category is filled with the category
bit mask. scope and text are pointers to character pointers set to the actual scope and message text respectively.
EXAMPLE
int32 msgCb( PfTReqId unused, void* msg )
{
int32 category;
char* scope;
char* text;
PfGetDiagnosticsMessage( msg, &category, &scope, &text );
printf( "Message received for category %x:\n", category );
printf( "Scope: %s, Text: %s\n", scope, text );
return OK;
}
PfDiagnosticsSubscribe( "::myApp", aCategoryMask, msgCb );
SEE ALSO
PfDiagnosticsSubcribe in "ProcSee Reference Manual"on page 182
message(3pTALK) in "ProcSee Reference Manual"on page 392
ProcSee Reference Manual
205
Application Programmers Interface
PfGetFDSet (3c)
FUNCTION
PfGetFDSet - Get the file descriptors in use by the SWBus
SYNOPSIS
int32 PfGetFDSet( fdc, fds )
int32 fdc;
fd_set* fds;
DESCRIPTION
The PfGetFDSet is used to get a file descriptor set fds, given a file descriptor class fdc.The
file descriptor class can be PfCReadCondition, PfCWriteCondition, PfCExceptCondition or PfCAllConditions. The value returned is the length, in bits, of the file descriptor set.
EXAMPLES
fd_set fds;
int32 sizefds = PfGetFDSet( PfCReadCondition, &fds );
select( sizefds, &fds, NULL, NULL, interval )
206
ProcSee Reference Manual
Application Programmers Interface
PfGetFieldId (3c)
FUNCTION
PfGetFieldId - Get the id of a field of a record
SYNOPSIS
int32 PfGetFieldId( recordId, fieldName )
int32 recordId;
char* fieldName;
DESCRIPTION
PfGetFieldId is used to get a field id, given a record id, recordId, and a field name, fieldName. The value returned is the field id if apiError is OK, else NullId is returned.
WARNING
PfGetFieldId is an anachronism that will cease to exist in future releases of ProcSee. It
is only used in connection with other anachronism functions like PfLocalPutValueId,
PfPutValue(Id) and PfPutValues(Id). These anachronisms should be replaced by PfId
and PfPut.
Be aware of the difference between the id of a field of a record (as returned by PfGetFieldId) and the id of a field of a record variable (as returned by PfId).
SEE ALSO
PfId in "ProcSee Reference Manual"on page 215
ProcSee Reference Manual
207
Application Programmers Interface
PfGetFuncArg (3c)
FUNCTION
PfGetFuncArg - Extract a logical argument in a function called from the rtm
SYNOPSIS
void* PfGetFuncArg( args, dataType, size )
void** args;
int32* dataType;
int32* size;
typedef int32 (*PfTFunction) (int32 numArgs, void* args );
DESCRIPTION
PfGetFuncArg extracts the data of an argument to a function registered with PfRegisterFunction or PfRegisterFunctionEx. PfGetFuncArg should be called once for each argument. It will return a pointer to the data for the specific argument. *args will be updated to
point to the next argument. The type and size of the argument will be delivered in the dataType and size arguments if non-NULL.
EXAMPLE
See an example at the man page for PfRegisterFunction.
SEE ALSO
PfRegisterFunction and PfRegisterFunctionEx in "ProcSee Reference Manual"on page
237
208
ProcSee Reference Manual
Application Programmers Interface
PfGetNumAllRtms (3c)
FUNCTION
PfGetNumAllRtms - Get the total number of rtms connected
SYNOPSIS
int32 PfGetNumAllRtms()
DESCRIPTION
PfGetNumAllRtms returns the total number of rtms the application program is connected to.
SEE ALSO
PfGetNumCurrentRtms in "ProcSee Reference Manual"on page 209
PfIsConnected in "ProcSee Reference Manual"on page 222
ProcSee Reference Manual
209
Application Programmers Interface
PfGetNumCurrentRtms (3c)
FUNCTION
PfGetNumCurrentRtms - Get the number of rtms in the set of current rtms
SYNOPSIS
int32 PfGetNumCurrentRtms()
DESCRIPTION
PfGetNumCurrentRtms returns the number of rtms in the set of current rtms, that is, the
number of rtms the application program talks to right now. Within usrFuncConnect and usrFuncDisconnect, this set by default consists of the single rtm to which connection is established or lost. Anywhere else, the set consists all rtms for which the usrFuncConnect has
finished.
SEE ALSO
PfGetNumAllRtms in "ProcSee Reference Manual"on page 209
PfAddRtmToCurrent in "ProcSee Reference Manual"on page 172
PfWithdrawRtmFromCurrent in "ProcSee Reference Manual"on page 259
PfInitialize in "ProcSee Reference Manual"on page 217
PfIsConnected in "ProcSee Reference Manual"on page 222
210
ProcSee Reference Manual
Application Programmers Interface
PfGetSystemError (3c)
FUNCTION
PfGetSystemError - Convert an error status to an error text
SYNOPSIS
char* PfGetSystemError( errorCode )
int32 errorCode;
DESCRIPTION
PfGetSystemError returns the error text corresponding to errorCode.
EXAMPLE
printf( "Error message is %s\n", PfGetSystemError(apiError) );
SEE ALSO
apiError in "ProcSee Reference Manual"on page 169
PfPrintSystemError in "ProcSee Reference Manual"on page 230
ProcSee Reference Manual
211
Application Programmers Interface
PfGetTypeId (3c)
FUNCTION
PfGetTypeId - Get the type of a variable
SYNOPSIS
int32 PfGetTypeId( varId )
int32 varId;
DESCRIPTION
PfGetTypeId is used to get the type of a variable, given the variable id, varId. The value
returned is the type if apiError is OK, else -1.
SEE ALSO
apilib in "ProcSee Reference Manual"on page 161
212
ProcSee Reference Manual
Application Programmers Interface
PfGetVarId (3c)
FUNCTION
PfGetVarId - Get the id of a variable
SYNOPSIS
int32 PfGetVarId( varName )
char* varName;
DESCRIPTION
PfGetVarId returns the variable id given a variable name, varName. The value returned
is the variable id if apiError is OK, else NullId.
PfGetVarId is an anachronism for the more general function PfId. The following lines
are equal:
PfGetVarId( "myVar" )
PfId( PfLocalProcess, "myVar" )
SEE ALSO
PfId in "ProcSee Reference Manual"on page 215
PfCreateVar in "ProcSee Reference Manual"on page 178
ProcSee Reference Manual
213
Application Programmers Interface
PfGetWindowChanges (3c)
FUNCTION
PfGetWindowChanges - Set up a call back function for window changes
SYNOPSIS
int32 PfGetWindowChanges( winName, func )
char*
winName;
PfTCallback func;
typedef int32 (*PfTCallback) ( PfTReqId operation, void* data );
typedef long PfTReqId;
DESCRIPTION
PfGetWindowChanges instructs the rtm to call function func whenever certain changes occur in the window specified by winName. The value of apiError is returned.
operation is one of the constants PfCOneSelected, PfCOneUnselected, PfCAllUnselected,
PfCShapeFinished, PfCShapeMoved, which is found in the file $PROCSEE_DIR/include/WindowOp.h. Information about the actual change can be obtained using Pfsor functions with the data pointer as input argument.
If operation is PfCShapeMoved, the relative movement is found in the full Name (dx) and
Signature(dy) strings in the object passed in the call back function. The C function atof can
be used to get the x and y movement from these strings. PfCShapeMoved is also used to
report changes in the picture that are not pure moving of a shape, like resizing. In these cases,
the dx and dy values are "0" (zero).
SEE ALSO
Pfsor in "ProcSee Reference Manual"on page 254
PfExportWindow in "ProcSee Reference Manual"on page 192
214
ProcSee Reference Manual
Application Programmers Interface
PfId (3c)
FUNCTION
PfId - Get the id of an object
SYNOPSIS
int32 PfId( parent, name )
int32 parent;
char* name;
DESCRIPTION
PfId can return the id of an rtm, of a variable and of a field of a record variable. PfId returns the id if apiError is OK, else NullId.
EXAMPLES
/* Get the id of RTM "rtm1" */
int32 anRtmId = PfId( PfLocalProcess, "rtm1" );
/* Get the id of variable "myVar" */
int32 myVarId = PfId( PfLocalProcess, "myVar" );
/* Get the id of field "f1" of variable "myVar" */
int32 myFieldId = PfId( myVarId, "f1" );
ProcSee Reference Manual
215
Application Programmers Interface
PfIndex (3c)
FUNCTION
PfIndex - Get the id of an entry of an array
SYNOPSIS
int32 PfIndex( arrayId, index )
int32 arrayId;
int32 index;
DESCRIPTION
PfIndex returns the id of entry number index in the array specified by arrayId. The first entry
has index 0. The returned value is the id if apiError is OK, else NullId.
EXAMPLE
int32 id = PfIndex( myArray, 3 );
216
ProcSee Reference Manual
Application Programmers Interface
PfInit (3c)
FUNCTION
PfInit - initialize the API and make the application ready for rtms to connect.
SYNOPSIS
int32 PfInit( processName, hostName, usrConnectFunc, usrDisconnectFunc )
char*
processName;
char*
hostName;
PfTConnectFunc usrConnectFunc;
PfTConnectFunc usrDisconnectFunc;
typedef void (*PfTConnectFunc) ( int32 status, const char* rtmName );
DESCRIPTION
PfInit should be the first ProcSee API function called in an application. PfInit initiates a
SWBus connection to a process named processName. The application will register itself
to the Control Server as process processName. The hostname argument specifies the
host where the Control Server is running. Default value for hostName is the value specified by the environment variable CONTROLHOST if set, else local host.
PfInit does not establish a connection to an rtm. Instead it is the rtm’s responsibility to
establish this connection. To establish a connection an rtm must call the pTALK function
connectToProcess(pTALK) where the argument processName is the same name that
was used as the first argument to PfInit. When using PfInit an application can be regarded
as a server where the rtms are clients responsible for connecting to the server.
When an rtm establish a connection to the application, the function usrConnectFunc is
called, and when the connection is lost, the usrDisconnectFunc is called. These are user
defined functions for initialization and cleanup, respectively. A usrConnectFunc typically contains creation of variables and records, and a usrDisconnectFunc could contain
printouts and cleanup. The functions take two arguments, a bit mask status and a character
string rtmName. In usrConnectFunc the value of status will always be PfCrtmStart, in
usrDisconnectFunc it will be PfCrtmStop if the rtm terminated gracefully and PfCrtmStop|PfCrtmCrash if the rtm crashed or was killed. rtmName is the name of the rtm
to which connection was established or lost.
Within usrConnectFunc and usrDisconnectFunc the set of current rtms consists of the
single rtm to which connection is established or lost. Anywhere else, the set of current
rtms consists of all rtms for which the usrConnectFunc has finished.
The value returned from this function is apiError.
WARNING
See Warning section for PfInitialize.
EXAMPLES
void usrFuncConnect( int32 status, char* rtmName )
{
ProcSee Reference Manual
217
Application Programmers Interface
PfInit (3c)
printf( "Connected to rtm \"%s\".\n", rtmName );
/* Create records and variables in rtm rtmName */
PfCreate......
...
}
void usrFuncDisConnect( int32 status, char* rtmName )
{
char* why;
why = (status&PfCrtmCrash) ? "crashed" : "stopped";
printf( "Lost contact with rtm \"%s\". (Rtm %s.)\n",
rtmName, why );
...
}
main()
{
...
PfInit( "prim", "ola", usrFuncConnect, usrFuncDisConnect );
...
PfMainLoop();
...
PfClose();
...
}
SEE ALSO
PfClose in "ProcSee Reference Manual"on page 176
PfMainLoop in "ProcSee Reference Manual"on page 223
PfIsConnected in "ProcSee Reference Manual"on page 222
PfInitialize in "ProcSee Reference Manual" on page 222
218
ProcSee Reference Manual
Application Programmers Interface
PfInitialize (3c)
FUNCTION
PfInitialize - initialize the API and connect the application to an rtm.
SYNOPSIS
int32 PfInitialize( appName, processName, rtmName, hostName, cacheSize,
master, usrConnectFunc, usrDisconnectFunc )
char*
appName;
char*
processName;
char*
rtmName;
char*
hostName;
int32
cachesize;
int32
master;
PfTConnectFunc usrConnectFunc;
PfTConnectFunc usrDisconnectFunc;
typedef void (*PfTConnectFunc) ( int32 status, const char* rtmName );
DESCRIPTION
PfInitialize should be the first ProcSee API function called in an application. PfInitialize
initiates a SWBus connection to a process named processName in an application named
appName in an rtm named rtmName. The application will register itself to the Control
Server as process processName. The hostname argument specifies the host where the
Control Server is running. The value returned is apiError.
The cacheSize and master arguments are ignored. Default value for processName is a
string equal to the argument appName. Default value for rtmName is "rtm". Default value
for hostName is the value specified by the environment variable CONTROLHOST if
set, else local host.
When connecting to more than one rtm, PfInitialize should be called once for each rtm,
using different values for rtmName. The arguments appName and processName must be
equal for every call to PfInitialize in a program.
When connection to the specified rtm is established, the function usrConnectFunc is
called, and when the connection is lost, the usrDisconnectFunc is called. These are user
defined functions for initialization and cleanup, respectively. A usrConnectFunc typically contains creation of variables and records, and a usrDisconnectFunc could contain
printouts and cleanup. The functions take two arguments, a bit mask status and a character
string rtmName. In usrConnectFunc the value of status will always be PfCrtmStart, in
usrDisconnectFunc it will be PfCrtmStop if the rtm terminated gracefully and PfCrtmStop|PfCrtmCrash if the rtm crashed or was killed. rtmName is the name of the rtm
to which connection was established or lost.
Within usrConnectFunc and usrDisconnectFunc the set of current rtms consists of the
single rtm to which connection is established or lost. Anywhere else, the set of current
rtms consists of all rtms for which the usrConnectFunc has finished.
ProcSee Reference Manual
219
Application Programmers Interface
PfInitialize (3c)
WARNING
Make sure that the argument processName matches the name of the process in which the database containing the variables is defined in the application resource file. If the database is
placed within the application body, the database variables will be placed in a default process
named after the application. In the example below, variables from file "Sim.pdat" will be
placed in process "::Simulator.Simulator"
application Simulator
{
database "Sim.pdat"
...
}
If the application process now calls PfInitialize using e.g. processName "Sim", then variables from the application process will be created within the process "::Simulator.Sim", and
the variables in process "::Simulator.Simulator" will never be updated and hence waste a lot
of memory. The correct way of calling PfInitialize in such a situation is shown below.
/* Wrong, processName doesn’t match definition from the resource file */
PfInitialize("Simulator","Sim","rtm",NULL,0,0,up,down);
/* Correct, processName equals application name */
PfInitialize("Simulator",NULL,NULL,NULL,0,0,up,down);
On the other hand, if the database contain the variables are placed within a process body, the
argument processName must be set individually.
application Simulator
{
process Sim
{
database "Sim.pdat";
}
...
}
/* Correct, processName equals processName from resource file */
PfInitialize("Simulator","Sim",NULL,NULL,0,0,up,down);
EXAMPLES
void usrFuncConnect( int32 status, char* rtmName )
{
printf( "Connected to rtm \"%s\".\n", rtmName );
/* Create records and variables in rtm rtmName */
PfCreate......
...
}
void usrFuncDisConnect( int32 status, char* rtmName )
{
char* why;
why = (status&PfCrtmCrash) ? "crashed" : "stopped";
printf( "Lost contact with rtm \"%s\". (Rtm %s.)\n",
220
ProcSee Reference Manual
Application Programmers Interface
PfInitialize (3c)
rtmName, why );
...
}
main()
{
...
PfInitialize( "Reactor", "prim", "rtm", "ola", 0, True,
usrFuncConnect, usrFuncDisConnect );
...
PfMainLoop();
...
PfClose();
...
}
SEE ALSO
PfClose in "ProcSee Reference Manual"on page 176
PfMainLoop in "ProcSee Reference Manual"on page 223
PfIsConnected in "ProcSee Reference Manual"on page 222
PfInit in "ProcSee Reference Manual" on page 217
ProcSee Reference Manual
221
Application Programmers Interface
PfIsConnected (3c)
FUNCTION
PfIsConnected - Are there any rtms in the set of current rtms?
SYNOPSIS
int32 PfIsConnected()
DESCRIPTION
PfIsConnected returns True if there are one or more rtms in the set of current rtms, False
otherwise.
PfIsConnected is identical to PfGetNumCurrentRtms.
SEE ALSO
PfGetNumCurrentRtms in "ProcSee Reference Manual"on page 210
PfInitialize in "ProcSee Reference Manual"on page 217
PfAddRtmToCurrent in "ProcSee Reference Manual"on page 172
PfWithdrawRtmFromCurrent in "ProcSee Reference Manual"on page 259
222
ProcSee Reference Manual
Application Programmers Interface
PfMainLoop (3c)
FUNCTION
PfMainLoop - Enter the program main loop
SYNOPSIS
int32 PfMainLoop()
DESCRIPTION
PfMainLoop handles input from rtm and from input sources set up by PfAddInput. It
calls the functions registered with PfSetProcessHandler at the specified intervals, and
the functions registered with PfAddVarAction when the corresponding variables are
changed in the rtm. To break the loop PfEndLoop must be called. The value of apiError
is returned.
PfMainLoop can be replaced with a loop calling PfPeriodic, PfGetFDSet, select, and
PfDispatch.
SEE ALSO
PfEndLoop in "ProcSee Reference Manual"on page 186
PfAddInput in "ProcSee Reference Manual"on page 171
PfSetProcessHandler in "ProcSee Reference Manual"on page 252
PfAddVarAction in "ProcSee Reference Manual"on page 173
ProcSee Reference Manual
223
Application Programmers Interface
PfName (3c)
FUNCTION
PfName - Get the name of an object
SYNOPSIS
char* PfName( id )
int32 id;
DESCRIPTION
PfName returns the name of the object specified by id if apiError is OK, else NULL. id
might specify an rtm, a variable, or a field of a record variable.
SEE ALSO
PfId in "ProcSee Reference Manual"on page 215
224
ProcSee Reference Manual
Application Programmers Interface
PfNextVarId (3c)
FUNCTION
PfNextVarId - Get the id of the next api variable in a traversal
SYNOPSIS
int32 PfNextVarId( iterator )
int32* iterator;
DESCRIPTION
PfNextVarId is used to iterate over all variables known to the api. iterator must be initialized to 0, and is incremented by PfNextVarId. The value returned is the variable id if
apiError is OK else NullId is returned.
EXAMPLE
int32 iterator;
int numVars;
int32* varBuf;
int i;
PfReadScript( "variables.pdat" );
numVars = PfGetDefinedVars();
varBuf = (int32*)calloc( numVars, sizeof(int32) );
for ( i = 0, iterator = 0; i < numVars; i++ )
varBuf[i] = PfNextVarId( &iterator );
/* varBuf (containing variable ids) can now be used in PfUpdateValuesId */
SEE ALSO
PfGetDefinedVars in "ProcSee Reference Manual"on page 203
PfReadScript in "ProcSee Reference Manual"on page 234
ProcSee Reference Manual
225
Application Programmers Interface
PfNonBlocking (3c)
FUNCTION
PfNonBlocking - set the connection to the RTM nonblocking
SYNOPSIS
int32 PfNonBlocking()
int32 fifoSize;
DESCRIPTION
PfNonBlocking sets the communication channels to the RTMs in the current set of RTMs in
nonblocking mode. For each RTM, PfNonBlocking allocates a buffer of fifoSize bytes that
is used as a fifo circular buffer when sending data.
Using TCP/IP and sockets in blocking mode, which is the default in the SWBus, means that
a process will be halted whenever the socket FIFO is full. The sender will have to wait for
the receiver to read some bytes from the FIFO before continuing to send. As long as the receiver doesn’t read from the FIFO, the sender will be halted. In some situations this can lead
to a deadlock. Consider two processes sending data to each other simultaneously and the
amount of data exceeding the FIFO size. None of them will ever read, as they are both busy
sending, and a deadlock situation has occured.
In nonblocking mode (when PfNonBlocking is used), a sending process will not be halted.
It will append the data to the allocated circular buffer, and then send as much data as possible
without blocking. If it was unable to send the entire message, the SWBus will leave the rest
in the circular buffer and return from send. In future iterations of the main loop, or when
sending the next message, the SWBus will try to send more data from the circular buffer. The
flow of control is handled entirely by the SWBus, and application developers don’t need to
know about it.
The probability of entering a deadlock situation is significantly reduced when nonblocking
mode is used. However, there is a possibility that the internal circular buffer gets full. If that
happens, the last operation that tried to send will fail, but no blocking will occur, and no other
data will be lost.
PfNonBlocking should be called from within the usrConnectFunc specified as argument to
PfInitialize, as the connection should be set nonblocking whenever it is established.
RETURN VALUES
PfNonBlocking returns the value of apiError.
SEE ALSO
PfInitialize in "ProcSee Reference Manual"on page 217
226
ProcSee Reference Manual
Application Programmers Interface
PfPeriodic (3c)
FUNCTION
PfPeriodic - Execute all periodic functions
SYNOPSIS
struct timeval* PfPeriodic()
DESCRIPTION
PfPeriodic executes internal SWBus periodic functions and all periodic functions set up
by PfSetProcessHandler. The value returned is the amount of time to next periodic function is to be called. If no periodic functions are active, it returns a NULL pointer. This
pointer can be used as input to select. The returned pointer is pointing to a static data area.
EXAMPLES
struct timeval *interval;
fd_set fds;
int32 sizefds = PfGetFDSet( READ_FDS, &fds );
interval = PfPeriodic();
switch( select( sizefds, &fds, NULL, NULL, interval ) )
SEE ALSO
PfSetProcessHandler in "ProcSee Reference Manual"on page 252
PfMainLoop in "ProcSee Reference Manual"on page 223
ProcSee Reference Manual
227
Application Programmers Interface
PfPrintAllRecords (3c)
FUNCTION
PfPrintAllRecords - Print all records known to the api
SYNOPSIS
void PfPrintAllRecords()
DESCRIPTION
All records with their elements will be printed to stdout.
228
ProcSee Reference Manual
Application Programmers Interface
PfPrintAllVars (3c)
FUNCTION
PfPrintAllVars - Print all variables known to the api
SYNOPSIS
void PfPrintAllVars()
DESCRIPTION
All variables will be printed to stdout.
ProcSee Reference Manual
229
Application Programmers Interface
PfPrintSystemError (3c)
FUNCTION
PfPrintSystemError - Print an error text to stdout
SYNOPSIS
void PfPrintSystemError( errorCode )
int32 errorCode;
DESCRIPTION
PPfPrintSystemError
prints the error text corresponding to errorCode to stdout.
EXAMPLE
PfPrintSystemError( apiError );
SEE ALSO
apiError in "ProcSee Reference Manual"on page 169
PfGetSystemError in "ProcSee Reference Manual"on page 211
230
ProcSee Reference Manual
Application Programmers Interface
PfPut (3c)
FUNCTION
PfPut - Update a variable, and put it in the transfer buffer
SYNOPSIS
int32 PfPut( id, valuePtr )
int32 id;
void* valuePtr;
DESCRIPTION
PfPut updates a variable and puts the updated value into the transfer buffer for later transfer by PfFlush. PfPut can also be used for fields in record variables and for entries in arrays.
Argument id is the id of a variable as returned by PfCreateVar or PfCreateArray, the
field of a variable as returned by PfId, or an entry in an array as returned by PfIndex.
Argument valuePtr should point to a location where the updated value is found.
PfPut returns the value of apiError.
WARNING
Unless PfUseField and PfFlushUseFields are called prior to PfPut, using PfPut for
fields in record variables or for entries in arrays will just update locally without putting
the value into the transfer buffer.
EXAMPLES
int32 myIntId = PfCreateVar("myInt",PfCInt,NULL,True,NULL);
int32 myRecVarId = PfCreateVar("myRecVar",PfCRecord,"REC",True,NULL);
int32 myArrayId = PfCreateArray("myArray",PfCInt,100,NULL,True,NULL);
PfFlushCreateVar();
int32 myFieldId = PfId(myRecVarId,"aFieldName");
int32 myArrayEntry = PfIndex(myArrayId,47);
PfUseField( myFieldId );
PfUseField( myArrayentry );
PfFlushUseFields();
:
int32 anInt = 5;
PfPut( myIntId, &anInt );
PfPut( myFieldId, &anInt );
PfPut( myArrayEntry, &anInt );
PfFlush();
SEE ALSO
PfFlush in "ProcSee Reference Manual"on page 194
PfSend in "ProcSee Reference Manual"on page 245
ProcSee Reference Manual
231
Application Programmers Interface
PfPut (3c)
PfCreateVar in "ProcSee Reference Manual"on page 178
PfCreateArray in "ProcSee Reference Manual"on page 177
PfId in "ProcSee Reference Manual"on page 215
PfIndex in "ProcSee Reference Manual"on page 216
PfUseField in "ProcSee Reference Manual"on page 256
PfFlushUseFields in "ProcSee Reference Manual"on page 197
232
ProcSee Reference Manual
Application Programmers Interface
PfQuoteString, PfUnquoteString, PfSetMax-
FUNCTION
PfQuoteString - add quotes ("...") around a string.
PfUnquoteString - remove quotes from a string
PfSetMaxQuotedStrings - init the circular buffer of quoted/unquoted strings.
SYNOPSIS
const char* PfQuoteString( const char* unquotedStr );
const char* PfUnquoteString( const char* quotedStr );
void PfSetMaxQuotedStrings( int32 numStrs );
DESCRIPTION
PfQuoteString returns a pointer to a copy of the string with quotes added. Some characters
inside the string are escaped with a backslash, like the quote character ("), and the backslash (\).
PfUnquoteString returns a pointer to a copy of the string with quotes removed. Characters
inside the string which were escaped with a backslash, are replaced with their intended
values.
PfSetMaxQuotedStrings sets the number of results from these functions to store. Before this function is
called, the default is to store the last 10 results.
WARNING
If PfQuoteString and PfUnquoteString are called more times than the number set with PfSetMaxQuotedStrings, or its default, the earlier returned poniters may point to the same
buffers as the newly returned strings, or to freed memory, which may give problems in
e.g. printf statements.
EXAMPLES
char* s = PfUnquoteString(PfExecute("","\"abc\""));
printf("Resulting string is %s", PfQuoteString(s));
SEE ALSO
PfExecute (string results returned are quoted) in "ProcSee Reference Manual" on page
191
ProcSee Reference Manual
233
Application Programmers Interface
PfReadScript (3c)
FUNCTION
PfReadScript - Create records and variables from a ProcSee database file (.pdat)
SYNOPSIS
int32 PfReadScript( fileName )
char* fileName;
DESCRIPTION
PfReadScript creates records and variables acording to the specifications in the ProcSee database file, fileName.
PfReadScript is very well suited for creating records as using the same database file in the
rtm and the api guarantees consistency in record definitions. Creating variables using
PfReadScript implies that the api will allocate memory for all variables, as PfReadScript
calls PfCreateVar with value NULL.
If there are any syntax errors in the database file, the line numbers where the errors occurred
will be printed to stdout. The value returned is the number of errors encountered.
EXAMPLES
/* See the Referance manual for ProcSee database file format (.pdat) */
SEE ALSO
PfBeginRecord in "ProcSee Reference Manual"on page 174
PfAddField in "ProcSee Reference Manual"on page 170
PfEndRecord in "ProcSee Reference Manual"on page 187
PfCreateArray in "ProcSee Reference Manual"on page 177
PfCreateVar in "ProcSee Reference Manual"on page 178
Referance manual for the ProcSee database file format (.pdat)
234
ProcSee Reference Manual
Application Programmers Interface
PfReceiveRtmUpdates (3c)
FUNCTION
PfReceiveRtmUpdates - Enable/disable variable updates from RTM to application
SYNOPSIS
int32 PfReceiveRtmUpdates( int enable )
DESCRIPTION
When a variable value is modified by a pTALK statement in the RTM, the RTM by default transfers the new value to the application. PfReceiveRtmUpdates can be used to
modify this default behaviour for all or a selected set of variables. Notice that string variables are by default not transferred from the RTM to the application even if variable updates are enabled. This functionality must be enabled by the API function
PfReceiveRtmStringUpdates.
PfReceiveRtmUpdates enables (if enable is true) or disables (if enable is false) variable
updates from RTM to application. The function should be called prior to creating the variables for which the modified behaviour is wanted.
In general, disabling variable updates from RTM to the application reduces the amount of
memory required by the RTM and has a positive effect on performance for creating variables, for clean-up after a communication break and for shutdown.
EXAMPLES
/* This function is called when connection the an RTM is established */
void onRtmConnect( int32 status, const char* rtmName )
{
/* The variables created below comply with the deafult behaviour
when updated in the RTM */
PfCreateVar ( "abc", PfCInt, NULL, 0, NULL );
PfReadScript( "file1.pdat" );
/* Values for the variables created below will not be transferred to
the application when updated in the RTM */
PfReceiveRtmUpdates( 0 );
PfCreateVar ( "def", PfCInt, NULL, 0, NULL );
PfReadScript( "file2.pdat" );
/* Values for the variables created below will be transferred to
the application when updated in the RTM */
PfReceiveRtmUpdates( 1 );
PfCreateVar ( "ghi", PfCInt, NULL, 0, NULL );
PfReadScript( "file3.pdat" );
}
SEE ALSO
PfReceiveRtmStringUpdates in "ProcSee Reference Manual"on page 236
ProcSee Reference Manual
235
Application Programmers Interface
PfReceiveRtmStringUpdates (3c)
FUNCTION
PfReceiveRtmStringUpdates - Enable/disable string variable updates from RTM to application
SYNOPSIS
int32 PfReceiveRtmStringUpdates( int enable )
DESCRIPTION
String variables or fields of type string in struct variables are by default not transferred from
the RTM to the application. The API function PfReceiveRtmStringUpdates can be used to
change this behaviour. This function accepts one argument which enables (true) or disables
(false) this functionality.
Call this function before creating the variable(s) with any of the API functions PfCreateVar,
PfCreateArray or PfReadScript. This function will not have any affect on the variables after they have been created.
Notice that the variable transfer functionality from the RTM to the application must be enabled (PfReceiveRtmUpdates) for this function to have any effect.
SEE ALSO
PfReceiveRtmUpdates in "ProcSee Reference Manual"on page 235
236
ProcSee Reference Manual
Application Programmers Interface
PfRegisterFunction,PfRegisterFunctionEx
}FUNCTION
PfRegisterFunction, PfRegisterFunctionEx - Make an application function known in
the rtm
SYNOPSIS
int32 PfRegisterFunction( funcName, func, numArgs, args )
char*
funcName;
PfTFunction func;
int32
numArgs;
PfTArg
args[];
int32 PfRegisterFunctionEx( funcName, func, numArgs, args, reqId )
char*
funcName;
PfTFunctionEx func;
int32
numArgs;
PfTArg
args[];
PfTReqId reqId;
typedef int32 (*PfTFunction) ( int32 numArgs, void* args );
typedef int32 (*PfTFunctionEx) ( PfTReqId reqId, int32 numArgs, void* args );
typedef long PfTReqId;
typedef struct
{
int32 dtype; /* Data type, from $PROCSEE_DIR/include/TypeCodes.h */
int32 size; /* 0 = pointer, 1 = single variable, >1 = array */
} PfTArg;
DESCRIPTION
PfRegisterFunction and PfRegisterFunctionEx make a function in the application program known to the rtm and thereby avaiable from pTALK. funcName is the name of the
function, func is the function itself, numArgs is the number of arguments, and args is an
array containg the argument descriptions. The function PfRegisterFunctionEx accepts
one additional argument reqId. This is a user supplied request identifier which is passed
back in the first argument in the registered call back function. The value returned is
apiError.
When the function is available to the rtm, it can be called from pTALK as if it were written in pTALK itself. Since C is a compiled language, it is not possible to remotely call a
function with a variable number of arguments. All remotely declared functions must have
the same physical signature although they might have different logical signatures. The
logical signature is the signature of the function as the rtm sees it, for example as void
f(int,float[4], char*). The Run-Time Manager sees f as a void function taking an int, an
array of 4 floating point numbers and a character string. The physical signature for all
functions that are to be called remotely must be int32 f(int32,void*) when the function is
registered by PfRegisterFunction, and int32 f(PfTReqId, int32, void*) when registered
by PfRegisterFunctionEx. reqId is the same request identifier supplied when the function was registered. numArgs holds the actual number of logical arguments passed, and
ProcSee Reference Manual
237
Application Programmers Interface
PfRegisterFunction,PfRegisterFunctionEx (3c)
args is a pointer to a data block containing all the logical arguments. The data block holds
each argument’s actual size and type in addition to the value itself. The api function PfGetFuncArg helps retrieving the actual data.
EXAMPLE
/* Declaring the function storeData( int, float[4], char* ) to the RTM */
PfTArg formals[] =
{
{PfCInt,1},
{PfCFloat,4}
{PfCUnsignedChar,0}
};
PfRegisterFunction( "storeData", store, 3, formals );
:
:
int32 store( int32 numArgs, void* data )
{
int32 size, type;
void* theData;
int32 intVal;
float floatVals[4];
char stringVal[32];
int i;
if ( numArgs != 3 )
return !OK;
/* Extract first argument */
theData = PfGetFuncArg( &data, &type, &size );
if ( type != PfCInt || size != 1 )
return !OK;
intVal = *(int32*)theData;
/* Extract second argument */
theData = PfGetFuncArg( &data, &type, &size );
if ( type != PfCFloat || size != 4 )
return !OK;
for ( i = 0; i < 4; i++ )
floatVals[i] = ((float*)theData)[i];
/* Extract third argument */
theData = PfGetFuncArg( &data, &type, &size );
if ( type != PfCUnsignedChar && size > 32 )
return !OK;
strcpy( stringVal, (char*)theData );
:
return OK;
}
238
ProcSee Reference Manual
Application Programmers Interface
PfRegisterFunction,PfRegisterFunctionEx
SEE ALSO
PfGetFuncArg in "ProcSee Reference Manual"on page 208
ProcSee Reference Manual
239
Application Programmers Interface
PfReleaseWindow (3c)
FUNCTION
PfReleaseWindow - End the use of an X-Window in rtm
SYNOPSIS
void PfReleaseWindow( name )
char* name;
DESCRIPTION
PfReleaseWindow releases the window specified by name. The window should previously
have been exported by PfExportWindow.
SEE ALSO
PfExportWindow in "ProcSee Reference Manual"on page 192
240
ProcSee Reference Manual
Application Programmers Interface
PfRemoveAllInputs (3c)
FUNCTION
PfRemoveAllInputs - Remove all input handler callback functions
SYNOPSIS
int32 PfRemoveAllInputs()
DESCRIPTION
PfRemoveAllInputs removes all callback functions previously set up by PfAddInput.
The value of apiError is returned.
SEE ALSO
PfAddInput in "ProcSee Reference Manual"on page 171
PfRemoveInput in "ProcSee Reference Manual"on page 242
PfMainLoop in "ProcSee Reference Manual"on page 223
ProcSee Reference Manual
241
Application Programmers Interface
PfRemoveInput (3c)
FUNCTION
PfRemoveInput - removes an input handler callback function.
SYNOPSIS
int32 PfRemoveInput( fd, condition, func )
int32
fd;
int32
condition;
PfTInputFunc func;
typedef int32 (*PfTInputFunc) ( int32 fd );
DESCRIPTION
PfRemoveInput removes a callback function previously set up by PfAddInput. fd is the file
descriptor. condition is PfCReadCondition, PfCWriteCondition, PfCExceptCondition,
or PfCAllCondition. func is the function to be removed from the function list. The value of
apiError is returned.
EXAMPLES
PfRemoveInput( PfCKeyboardFd, PfCReadCondition, kbdHandler );
SEE ALSO
PfAddInput in "ProcSee Reference Manual"on page 171
PfRemoveAllInputs in "ProcSee Reference Manual"on page 241
PfMainLoop in "ProcSee Reference Manual"on page 223
242
ProcSee Reference Manual
Application Programmers Interface
PfRemoveProcessHandler (3c)
FUNCTION
PfRemoveProcessHandler - Remove a periodic process handler callback function
SYNOPSIS
int32 PfRemoveProcessHandler( id )
int32 id;
DESCRIPTION
PfRemoveProcessHandler removes a process handler previously set up by PfSetProcessHandler. id is the id returned by PfSetProcessHandler. The value of apiError
is returned.
EXAMPLES
int32 id;
:
id = PfSetProcessHandler( ... );
:
PfRemoveProcessHandler( id );
SEE ALSO
PfSetProcessHandler in "ProcSee Reference Manual"on page 252
PfMainLoop in "ProcSee Reference Manual"on page 223
ProcSee Reference Manual
243
Application Programmers Interface
PfRemoveVarAction (3c)
FUNCTION
PfRemoveVarAction - Remove a variable action
SYNOPSIS
int32 PfRemoveVarAction( varId, func )
int32
varId;
PfTVarActionFunc func;
typedef int32 (*PfTVarActionFunc) ( int32 varId );
DESCRIPTION
PfRemoveVarAction removes a variable action previously set up by PfAddVarAction.
varId is the variable identifier and func is the callback function. The value of apiError is
returned.
SEE ALSO
PfAddVarAction in "ProcSee Reference Manual"on page 173
PfMainLoop in "ProcSee Reference Manual"on page 223
244
ProcSee Reference Manual
Application Programmers Interface
PfSend (3c)
FUNCTION
PfSend - Put a value into the transfer buffer
PfSendToOne - Put a value into the transfer buffer for a specific RTM
SYNOPSIS
int32 PfSend( id )
int32 id;
int32 PfSendToOne( id, rtmId )
int32 id;
int32 rtmId;
DESCRIPTION
PfSend puts the value of the variable specified by id into the transfer buffer for later transfer by PfFlush. PfSend can also be used for a field in a record variable or for an entry in
an array. Argument id should be the id of a variable as returned by PfCreateVar or PfCreateArray, the id of a field in a record variable as returned by PfId, or the id of an entry
in an array as returned by PfIndex. The value returned is apiError.
PfSendToOne works like PfSend, but the value is only put into the transfer buffer for the
specific RTM identified by rtmId. When PfFlush is later invoked, only the specified
RTM receives the value. rtmId can be obtained by using PfId.
WARNING
Unless PfUseField and PfFlushUseFields, are called prior to PfSend, using PfSend for
fields in record variables or for entries in arrays will have no effect.
EXAMPLES
int32 myInt = 0;
struct REC myRecVar;
int32 myArray[100];
:
int32 myIntId, myRecVarId, myArrayId, myFieldId, myArrayEntry;
:
myIntId = PfCreateVar("myInt",PfCInt,NULL,True,&myInt);
myRecVarId = PfCreateVar("myRecVar",PfCRecord,"REC",True,&myRecVar);
myArrayId = PfCreateArray("myArray",PfCInt,100,NULL,True,myArray);
PfFlushCreateVar();
myFieldId = PfId(myRecVarId,"aFieldName");
myArrayEntry = PfIndex(myArrayId,47);
PfUseField( myFieldId );
PfUseField( myArrayEntry );
PfFlushUseFields();
:
myInt++;
myRecVar.aFieldName = 3.14;
myArray[47] += 100;
ProcSee Reference Manual
245
Application Programmers Interface
PfSend (3c)
PfSend( myIntId );
PfSend( myFieldId );
PfSend( myArrayEntry );
PfFlush();
SEE ALSO
PfFlush in "ProcSee Reference Manual"on page 194
PfId in "ProcSee Reference Manual"on page 215
PfIndex in "ProcSee Reference Manual"on page 216
PfUseField in "ProcSee Reference Manual"on page 256
PfFlushUseFields in "ProcSee Reference Manual"on page 197
PfPut in "ProcSee Reference Manual"on page 231
PfCreateVar in "ProcSee Reference Manual"on page 178
PfCreateArray in "ProcSee Reference Manual"on page 177
246
ProcSee Reference Manual
Application Programmers Interface
PfSendApiStringUpdates (3c)
FUNCTION
PfSendApiStringUpdates - Enable/disable string variable updates from application to
RTM
SYNOPSIS
int32 PfSendApiStringUpdates( int enable )
DESCRIPTION
String variables or fields of type string in struct variables are by default not transferred
from the application to the RTM. The API function PfSendApiStringUpdates can be
used to change this behaviour. This function accepts one argument which enables (true)
or disables (false) this functionality.
Call this function before creating the variable(s) with any of the API functions PfCreateVar, PfCreateArray or PfReadScript. This function will not have any affect on the
variables after they have been created.
ProcSee Reference Manual
247
Application Programmers Interface
PfSetAllRtmsCurrent (3c)
FUNCTION
PfSetAllRtmsCurrent - insert all rtms into the set of current rtms
SYNOPSIS
int32 PfSetAllRtmsCurrent()
DESCRIPTION
PfSetAllRtmsCurrent inserts all connected rtms into the set of current rtms. The value returned is apiError. The set of current rtms is those rtms which the application program talks
to at the moment.
Within the user supplied connection callback functions (refered to as usrConnectFunc and
usrDisconnectFunc at the man page for PfInitialize) the set of current rtms by default consists of the single rtm to which connection is established or lost. Anywhere else, the set of
current rtms by default consists of all rtms for which the usrConnectFunc has finished.
SEE ALSO
PfAddRtmToCurrent in "ProcSee Reference Manual"on page 172
PfWithdrawRtmFromCurrent in "ProcSee Reference Manual"on page 259
PfSetRtmCurrent in "ProcSee Reference Manual"on page 253
PfInitialize in "ProcSee Reference Manual"on page 217
248
ProcSee Reference Manual
Application Programmers Interface
PfSetDefinition (3c)
FUNCTION
PfSetDefinition - Set the definition of a function or attribute in the rtm
SYNOPSIS
int32 PfSetDefinition( idMask, changeMask, fullName, definition )
int32 idMask;
int32 changeMask;
char* fullName;
char* definition;
DESCRIPTION
PfSetDefinition is used to create and change variables, functions, and dialogues in the
symboltable in the rtm. The definition is a string containing a definition of a function or
a variable or a dialogue . The fullName tells the parent of what to create, or the fullName
of what to change. Constants for idMask are found in the file $PROCSEE_DIR/include/
IdCodes.h. Constants for changeMask are found in the file $ROCSEE_DIR/include/
P3Misc.h. The value of apiError is returned.
SEE ALSO
PfGetDefinition in "ProcSee Reference Manual"on page 204
ProcSee Reference Manual
249
Application Programmers Interface
PfSetFlushBehaviour (3c)
FUNCTION
PfSetFlushBehaviour - Modify the behaviour of PfFlush
SYNOPSIS
int32 PfSetFlushBehaviour( behavior )
int32 behaviour;
DESCRIPTION
PfSetFlushBehaviour modifies the behaviour of PfFlush. PfFlush by default performs
three tasks, it transfers variable values, updates displays and ticks the trendlogger. Updating
displays and ticking the trendlogger can be switch off and on by PfSetFlushBehaviour. behaviour is a bitmask containing a combination of the constants PfCTransferData, PfCUpdateDisplay and PfCTickTrendLogger. The value of apiError is returned.
EXAMPLES
/* Don’t tick trend logger */
PfSetFlushBehaviour( PfCTransferData | PfCUpdateDisplay );
/* Just transfer data */
PfSetFlushBehaviour( PfCTransferData );
SEE ALSO
PfFlush in "ProcSee Reference Manual"on page 194
250
ProcSee Reference Manual
Application Programmers Interface
PfSetProcessClass (3c)
FUNCTION
PfSetProcessClass - Set the process class to use when connecting to control
SYNOPSIS
int32 PfSetProcessClass( const char* processClass )
DESCRIPTION
PfSetProcessClass sets the process class to use when connecting to the SWBus control
program. This function should be called before PfInit, PfInitialize or SbInit is called the
first time.
apiError is returned.
EXAMPLE
int main()
{
SetProcessClass( "MyProcessClass" );
PfInitialize(...)
:
:
}
ProcSee Reference Manual
251
Application Programmers Interface
PfSetProcessHandler (3c)
FUNCTION
PfSetProcessHandler - Set up a function to be called periodically from PfMainLoop
SYNOPSIS
int32 PfSetProcessHandler( func, interval )
PfTPeriodicFunc func;
int32
interval;
typedef int32 (*PfTPeriodicFunc) ( int32 processHandlerId );
DESCRIPTION
PfSetProcessHandler makes func beeing called periodically at intervals specified by interval from PfMainLoop. interval is specified in milliseconds.
The value returned is the unique id of the process handler if apiError is OK,else PfBADINDEX is returned. This id is used as parameter for the callback function, and can be used to
differentiate the callbacks from each other, when more than one process handler is registered
using the same callback function. The callback function should return OK, otherwise it will
be suspended and not be called again.
EXAMPLE
int32 ph( int32 id )
{
printf( "ProcessHandler %d called\n",id );
:
return OK;
}
:
:
PfSetProcessHandler( ph, 1000); /* call ph every second */
SEE ALSO
PfRemoveProcessHandler in "ProcSee Reference Manual"on page 243
PfMainLoop in "ProcSee Reference Manual"on page 223
252
ProcSee Reference Manual
Application Programmers Interface
PfSetRtmCurrent (3c)
FUNCTION
PfSetRtmCurrent - make the set of current rtms consist of a single rtm
SYNOPSIS
int32 PfSetRtmCurrent( rtmId )
int32 rtmId;
DESCRIPTION
PfSetRtmCurrent makes the set of current rtms consist of the single rtm specified by
rtmId. The value returned is apiError. The set of current rtms is those rtms which the application program talks to at the moment.
Within the user supplied connection callback functions (refered to as usrConnectFunc and
usrDisconnectFunc at the man page for PfInitialize) the set of current rtms by default
consists of the single rtm to which connection is established or lost. Anywhere else, the
set of current rtms by default consists of all rtms for which the usrConnectFunc has finished.
WARNING
PSetRtmCurrent does not control distribution of data values by PfPut, PfSend or PfUpdateValuesId. In order to send data to a specific RTM, use PfSendToOne.
SEE ALSO
PfSetAllRtmsCurrent in "ProcSee Reference Manual"on page 248
PfAddRtmToCurrent in "ProcSee Reference Manual"on page 172
PfWithdrawRtmFromCurrent in "ProcSee Reference Manual"on page 259
PfInitialize in "ProcSee Reference Manual"on page 217
PfSentToOne
ProcSee Reference Manual
253
Application Programmers Interface
Pfsor (3c)
FUNCTION
Pfsor - Get data about an object
SYNOPSIS
int32 PfsorLength( data )
int32 PfsorIdMask( data )
int32 PfsorDefinitionLength( data )
char* PfsorFullName( data )
char* PfsorSignature( data )
char* PfsorExtra( data )
void* data;
DESCRIPTION
The Pfsor functions returns the contents of the data structure asked for in PfGetChildren
and the data structure returned by PfGetCurrentObject and PfGetChanges.
PfsorLength returns the total length of the data structure
PfsorIdMask returns the idMask of the object. Legal values for idMask can be found in
$PROCSEE_DIR/include/IdCodes.h.
PfsorDefinitionLength returns the length to use if the definition of this object is to be requested later.
PfsorFullName returns the fullName of the object.
PfsorSignature returns the signature of the object.
PfsorExtra returns extra information, like the new name in PfGetChanges with PfCObjectRenamed. If no extra data is present, it returns a NULL pointer.
SEE ALSO
PfGetChildren in "ProcSee Reference Manual"on page 200
PfGetCurrentObject in "ProcSee Reference Manual"on page 202
PfGetChanges in "ProcSee Reference Manual"on page 198
254
ProcSee Reference Manual
Application Programmers Interface
PfUpdateValuesId (3c)
FUNCTION
PfUpdateValuesId - Put variable values into the transfer buffer
SYNOPSIS
int32 PfUpdateValuesId( varIds, numIds )
int32 varIds[];
int32 numIds;
DESCRIPTION
PfUpdateValuesId puts the variable values for all variables specified by varIds into the
transfer buffer for later transfer by PfFlush. varIds is an array containing variable ids, numIds specifies the number of entries in the array. The value returned is apiError.
PfUpdateValuesId is identical to calling PfSend for each entry in varIds.
SEE ALSO
PfFlush in "ProcSee Reference Manual"on page 194
PfPut in "ProcSee Reference Manual"on page 231
PfSend in "ProcSee Reference Manual"on page 245
ProcSee Reference Manual
255
Application Programmers Interface
PfUseField (3c)
FUNCTION
PfUseField - Make it possible to update single fields or entries
SYNOPSIS
int32 PfUseField( id )
int32 id;
DESCRIPTION
PfUseField makes it possible to send just some fields of a record variable or some entries of
an array to the rtm. id is the field of a record variable as returned by PfId or an entry of an
array as returned by PfIndex. PfUseField stores the information in an internal buffer and relies on the user to call PfFlushUseField when PfUseField is called for all relevant fields. If
the internal buffer is full PfUseField will call PfFlushUseFields itself to empty the buffer.
The value returned is apiError.
If the application program contains rather large structs, where most fields contain static data,
PfUseField might be an appropriate function to use for updating the dynamic fields of the
struct variables. Using PfUseField will enable transferring just the relevant fields instead of
the entire struct when values change.
WARNING
Care should be taken when using PfUseField. It might happen that the performance of the
application suffers when using PfUseField, due to the fact that putting several small fields
into the transfer buffer can be inefficient compared to putting the entire variable. PfUsefield
will also increase the use of dynamic memory. However, if just a few field of a large record
variable need to be updated, PfUseField will improve performance.
SEE ALSO
PfFlushUseFields in "ProcSee Reference Manual"on page 197
PfId in "ProcSee Reference Manual"on page 215
PfIndex in "ProcSee Reference Manual"on page 216
PfPut in "ProcSee Reference Manual"on page 231
PfSend in "ProcSee Reference Manual"on page 245
PfFlush in "ProcSee Reference Manual"on page 194
256
ProcSee Reference Manual
Application Programmers Interface
PfWinInit, PfWinInitialize (3c)
FUNCTION
PfWinInitialize - connect a window application ( with windows mainloop ) to a rtm.
PfWinInit - initialize the API and make the application (with windows mainloop) ready
for rtms to connect.
SYNOPSIS
int32 PfWinInitialize( hInstance, appName, procName, rtmName, hostName,
cacheSize, master, usrWC, usrWDC )
HINSTANCE hInstance;
char* appName;
char* procName;
char* rtmName;
char* hostName;
int32 cacheSize;
int32 master;
void (*usrWC)();
void (*usrWDC)();
int32 PfWinInit( hInstance, procName, hostName, usrWC, usrWDC )
HINSTANCE hInstance;
char* procName;
char* hostName;
void (*usrWC)();
void (*usrWDC)();
DESCRIPTION
PfWinInitialize and PfWinInit should be used instead of PfInitialize and PfInit, respectively, if your application have to use the Windows mainloop. (Most Windows applications). The hInstance is the handle to current instance of the application. This is the first
argument to WinMain. If MFC is used call AfxGetInstanceHandle() to get the instance
handle. An explanation of the remaining parameters, see PfInitialize and PfInit.
EXAMPLES
int WINAPI WinMain( HINSTANCE hInstance, ...... );
{
.....
PfWinInitialize( hInstance, .... );
....
MSG msg;
while( GetMessage( &msg, 0, 0, 0 ) )
//windows main loop
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
ProcSee Reference Manual
257
Application Programmers Interface
PfWinInit, PfWinInitialize (3c)
SEE ALSO
PfInitialize in "ProcSee Reference Manual"on page 217
258
ProcSee Reference Manual
Application Programmers Interface
PfWithdrawRtmFromCurrent (3c)
FUNCTION
PfWithdrawRtmFromCurrent - Withdraw an rtm from the set of current rtms
SYNOPSIS
int32 PfWithdrawRtmFromCurrent( rtmId )
int32 rtmId;
DESCRIPTION
PfWithdrawRtmFromCurrent withdraws the rtm specified by rtmId from the set of
current rtms. The value returned is apiError.
Within the user supplied connection callback functions (refered to as usrConnectFunc and
usrDisconnectFunc at the man page for PfInitialize) the set of current rtms by default
consists of the single rtm to which connection is established or lost. Anywhere else, the
set of current rtms by default consists of all rtms for which the usrConnectFunc has finished.
The id of an rtm can be obtained by using PfId.
WARNING
PWithdrawRtmFromCurrent does not control distribution of data values by PfPut, PfSend or PfUpdateValuesId. In order to send data to a specific RTM, use PfSendToOne.
EXAMPLES
int32 rtmId = PfId( PfLocalProcess, "myRtmName" );
PfWithdrawRtmFromCurent( rtmId );
/* Do something that doesn’t involve rtm "myRtmName" */
:
PfAddRtmToCurrent( rtmId );
SEE ALSO
PfAddRtmToCurrent in "ProcSee Reference Manual"on page 172
PfSetAllRtmsCurrent in "ProcSee Reference Manual"on page 248
PfSetRtmCurrent in "ProcSee Reference Manual"on page 253
PfInitialize in "ProcSee Reference Manual"on page 217
PfId in "ProcSee Reference Manual"on page 215
ProcSee Reference Manual
259
Application Programmers Interface
PfXtInit, PfXtInitialize (3c)
FUNCTION
PfXtInitialize - connect an X application ( with XtMainloop ) to an rtm.
PfXtInit - initialize the API and make the application (with XtMainLoop) ready for rtms to
connect.
SYNOPSIS
int32 PfXtInitialize( appContext, appName, procName, rtmName, hostName,
cacheSize, master, usrWC, usrWDC )
XtAppContext appContext;
const char* appName;
const char* procName;
const char* rtmName;
const char* hostName;
int32 cacheSize;
int32 master;
void (*usrWC)();
void (*usrWDC)();
int32 PfXtInit( appContext, procName, hostName, usrWC, usrWDC )
XtAppContext appContext;
const char* procName;
const char* hostName;
void (*usrWC)();
void (*usrWDC)();
DESCRIPTION
PfXtInitialize and PfXtInit should be used instead of PfInitialize and PfInit, respectively,
if your application must use the XToolkit mainloop functions XtMainloop or XtAppMainloop. Motif applications should use PfXtInitialize or PfXtInit to initialize the API. The first
parameter appContext is the application context. Use the XtAppInitialize to get the context.
An explanation of the remaining parameters see PfInitialize and PfInit.
EXAMPLES
Widget tlw;
tlw = XtAppInitialize( &appContext, ... );
...
PfXtInitialize( appContext, ... );
...
XtAppMainLoop( appContext );
SEE ALSO
PfInitialize in "ProcSee Reference Manual"on page 217
260
ProcSee Reference Manual
Application Programmers Interface
PWinApp (3c)
NAME
PWinApp - class for integration of ProcSee API with Microsoft Foundation Classes
(MFC).
SYNOPSIS
#include <p3MFC.h>
class PWinApp : public CWinApp
{
...
protected: // Callback methods:
virtual void OnConnect(
int32 status, const char* rtmName );
virtual void OnDisconnect(
int32 status, const char* rtmName );
virtual void OnDisconnectCleanup( int32 status, const char* rtmName );
virtual void OnFatalError( const char* errorMessage );
public: // Call these if you override them:
virtual BOOL PreTranslateMessage( MSG* pMsg );
virtual BOOL OnIdle( LONG lCount );
public: // The constructor:
PWinApp( LPCTSTR lpszAppName = NULL );
public: // Methods you could call:
BOOL InitializeRTM( const char* appName, const char* processName,
const char* rtmName, const char* hostName = 0,
INT cacheSize = 0, BOOL master = true,
BOOL useSbLoop = true );
BOOL InitPf( const char* processName, const char* hostName = 0,
BOOL useSbLoop = true );
};
DESCRIPTION
This class makes it easier to integrate ProcSee with MFC applications.
When you have created an MFC application, you have an application class that inherits
from CWinApp. By replacing this inheritance with PWinApp, the needed extras for communication with the RTM is handled well.
The PWinApp contains some callback methods that can be implemented, to get information about connection status etc. Normally the OnConnect method is implemented, so you
can load .pdat files and export windows when the connection is up.
There are some MFC methods used by the class, PreTranslateMessage, and OnIdle. Remember to call these if you override them in your application class.
ProcSee Reference Manual
261
Application Programmers Interface
PWinApp (3c)
The constructor can have the SWBus application class name as parameter.
The InitializeRTM() method should be called to connect to a given RTM. This is normally
done from the OnInitDialog() or OnCreate() or InitInstance(), but can be called from other
places as well.
The InitPf() method should be called if it is the RTM that is going to initiate the connection
to your MFC application instead of your MFC application initiating the connection to the
RTM. This is normally done from the OnInitDialog() or OnCreate() or InitInstance().
EXAMPLES
...
SEE ALSO
PfWinInit and PfWinInitialize. PWindow and PScrolledWindow.
262
ProcSee Reference Manual
Application Programmers Interface
PWindow, PScrolledWindow (3c)
NAME
PWindow, PScrolledWindow - classes for integration with Microsoft Foundation Classes (MFC).
SYNOPSIS
#include <p3MFC.h>
class PWnd : public CWnd
{
...
public:
/* Special ProcSee functions.
*/
BOOL ExportWindow(const CString& expWndName, int32 mask = WOpAll);
BOOL ReleaseWindow();
public:
/* ProcSee window op functions.
*/
virtual void WinOpMove( WOpMoveStruct& move ) =0;
virtual void WinOpResize( WOpResizeStruct& resize ) =0;
virtual void WinOpZoomPan( WOpZoomPanStruct& zoomPan ) =0;
virtual void WinOpColour( WOpColorStruct& colour );
virtual void WinOpSelect( WOpSelectStruct& select );
virtual void WinOpMap();
virtual void WinOpUnmap();
virtual void WinOpIconify();
virtual void WinOpClose();
virtual void WinOpRaise();
virtual void WinOpLower();
};
/*
* Definition of a ProcSee window.
*/
class PWindow : public PWnd
{
...
public:
/* Interface
*/
PWindow();
~PWindow();
virtual BOOL Create( LPCTSTR lpszWindowName,
const RECT& winRect,
DWORD dwStyle, DWORD dwExStyle,
CWnd* pParentWindow, UINT nId,
CCreateContext* pContext );
};
ProcSee Reference Manual
263
Application Programmers Interface
PWindow, PScrolledWindow (3c)
/*
* Definition of a ProcSee window with scrollbars.
*/
class PScrolledWindow : public PWnd
{
...
public:
PScrolledWindow();
~PScrolledWindow();
virtual BOOL Create( LPCTSTR lpszWindowName,
DWORD dwStyle, DWORD dwExStyle,
const RECT& winRect,
CWnd* pParentWindow, UINT nId,
CCreateContext* pContext,
float scrollPage = 100.,
float scrollLine = 0. );
};
DESCRIPTION
The PWindow class is a MFC window for displaying ProcSee exported windows in an MFC
application. The PScrolledWindow class also handles scrollbars and scrolling of this exported window. They are used like other MFC windows. To display an exported window in this
window, you have to call the ExportWindow method, after the connection to the RTM is established.
EXAMPLES
...
SEE ALSO
PfExportWindow. PWinApp.
264
ProcSee Reference Manual
Application Programmers Interface
apiExamples (3c)
API EXAMPLE
Makefile
# Makefile for apiExample
CC = cc -g
IFLAGS = -I$(PROCSEE_DIR)/include
LFLAGS = -L$(PROCSEE_DIR)/lib/$(ARCH)
# Add the following line if $(ARCH) is sunArch
#ARCHLIBS = -lnsl -lsocket
P3LIBS = -lProcSeeApiC $(ARCHLIBS)
all : apiExample apiExample.pctx apiExamplePicture.ppic
apiExample : apiExample.o
$(CC) apiExample.o $(LFLAGS) $(P3LIBS) -o apiExample
apiExample.o : apiExample.c
$(CC) -c $(IFLAGS) apiExample.c
apiExample.pctx : apiExample.Tdoc
pcc apiExample.Tdoc
apiExamplePicture.ppic : apiExamplePicture.Tdoc
pcc apiExamplePicture.Tdoc
Database Definition File
/* File Records.dat */
struct MyStruct
{
char theString[6];
float theFloat;
int32 theInt;
};
Program apiExample.c
/* File apiEksample.c */
/* Executable is run by typing apiEksample -r rtmName1 -r rtmName2 ... */
#include <api/api.h>
#include <stdio.h>
static char applName[PfVARLENGTH] = "apiExample";
/* Definition of structs matching the defintions from Records.pdat */
typedef struct
{
char theString[6];
float theFloat;
ProcSee Reference Manual
265
Application Programmers Interface
apiExamples (3c)
int32 theInt;
} MyStruct;
/* C variables updated by processHandler and sent to RTM */
#define FloatArraySize 10
int32 myInt;
float myFloatArray[FloatArraySize];
double myDouble;
char myString[6];
MyStruct myStruct;
/* C variables set when receiving remote function calls from an RTM */
int intValueStep = 1;
float floatValueStep = 1.0;
double doubleValueStep = 1.0;
/* ProcSee variable ids */
#define MaxNumVariables 100
int32 myIntId, myFloatArrayId, myDoubleId, myStringId, myStructId;
int32 myStructTheFloatId, myStructTheIntId;
int32 varIds[MaxNumVariables];
int32 numVarIds;
int32 processHandlerId = PfBADINDEX;
/* Function prototypes */
void initVariables();
void whenRtmConnects();
void whenRtmDisconnects();
void quit();
int32 KbdHandler();
int32 processHandler();
int32 createRecords();
int32 createVariables();
int32 registerFunctions();
int32 stopApplication();
int32 incValueSteps();
int main( argc, argv )
int argc;
char* argv[];
{
extern char* optarg;
char* rtmNames[10];
int numRtmNames = 0;
int i;
/* Initialize C variable values */
initVariables();
/* Get the name of the RTMs to connect to */
while( getopt( argc, argv, "r:") != EOF )
rtmNames[numRtmNames++] = strdup(optarg);
266
ProcSee Reference Manual
Application Programmers Interface
apiExamples (3c)
if ( numRtmNames == 0 )
rtmNames[numRtmNames++] = strdup("rtm");
/* Call PfInitialize for each RTM */
for ( i = 0; i < numRtmNames; i++ )
{
PfInitialize( applName, NULL, rtmNames[i], NULL, 0, 0,
whenRtmConnects, whenRtmDisconnects );
if ( apiError != OK )
printf( "[%s]: PfInitialize failed for RTM %s\n",
applName,
rtmNames[i] );
}
/* Create a keyboard handler to allow terminal input */
PfAddInput( PfCKeyboardFd, PfCReadCondition, KbdHandler );
if ( apiError != OK )
printf( "[%s]: PfAddInput failed (%s)\n",
applName, PfGetSystemError(apiError) );
/* Enter the main loop */
PfMainLoop();
/* Close connection to all RTMs */
PfClose();
return(0);
}
/* Function to initialize variable values */
void initVariables()
{
int i;
myInt = 0;
for ( i = 0; i < FloatArraySize; i++ )
myFloatArray[i] = 0.5;
myDouble = 0.5;
strcpy( myString, "abcde" );
strcpy( myStruct.theString, "ABCDE" );
myStruct.theFloat = 0.5;
myStruct.theInt = 0;
}
/* Function called when an RTM stops or crashes */
void whenRtmDisconnects( status, rtmName )
int32 status;
char* rtmName;
{
printf( "[%s]: Lost contact with RTM %s\n", applName, rtmName );
}
ProcSee Reference Manual
267
Application Programmers Interface
apiExamples (3c)
/* Function called when connection to an RTM is established */
void whenRtmConnects( status, rtmName )
int32 status;
char* rtmName;
{
printf( "[%s]: Established contact with RTM %s\n", applName, rtmName );
/* Create records, variables and funcitons in RTM rtmName */
if ( createRecords() != OK )
quit();
if ( createVariables() != OK )
quit();
if ( registerFunctions() != OK )
quit();
/* Ticking trendlogger is not needed in this application */
PfSetFlushBehaviour( PfCTransferData|PfCUpdateDisplay );
/* Transfer initial variable values and update displays */
PfFlush();
/* Create processHandler to be called every 2 seconds
if not already created */
if ( processHandlerId == PfBADINDEX )
{
processHandlerId = PfSetProcessHandler( processHandler, 2000 );
if ( apiError != OK )
printf( "[%s]: PfSetProcessHandler failed (%s)\n",
applName, PfGetSystemError(apiError) );
}
}
/* Function to terminate the main loop */
void quit()
{
PfEndLoop();
}
/* Function called from PfMainLoop whenever terminal input is available */
int32 KbdHandler( handlerId )
int32 handlerId;
{
char c;
scanf("%c",&c);
/* Terminate program if user types q<return> or Q<return> */
if ( c == 'q' || c == 'Q' )
quit();
return OK;
}
/* Function called periodically from PfMainLoop */
268
ProcSee Reference Manual
Application Programmers Interface
apiExamples (3c)
int32 processHandler( pHandlerId )
int32 pHandlerId;
{
int i;
char firstChar;
static bool even = True;
/* Update variable values */
myInt += intValueStep;
for ( i = 0; i < FloatArraySize; i++ )
myFloatArray[i] += floatValueStep;
myDouble += doubleValueStep;
firstChar = myString[0];
for ( i = 0; i < strlen(myString)-1; i++ )
myString[i] = myString[i+1];
myString[strlen(myString)-1] = firstChar;
even = !even;
if ( even )
{
/* The struct is just updated every other time this function is called */
myStruct.theFloat += floatValueStep;
myStruct.theInt += intValueStep;
if ( PfIsConnected() )
{
/* Put the updated field values into the transferbuffer */
/* A better aproach with such a small struct
would be to call PfSend( myStructId ) */
PfSend( myStructTheFloatId );
PfSend( myStructTheIntId );
}
}
if ( PfIsConnected() )
{
/* Put the variable values into the transfer buffer... */
PfUpdateValuesId( varIds, numVarIds );
/* ... and send them to the RTMs. Update displays as well */
PfFlush();
}
return OK;
}
int32 createRecords()
{
int32 numErrors;
char* fileName = "Records.pdat";
/* PfReadScript is a simple and safe function for creating records */
/* Record definitions are found in the file "Record.pdat", and the
application resource file (.Tdoc) includes a
database "Records.pdat"; statement */
numErrors = PfReadScript( fileName );
if ( apiError != OK )
ProcSee Reference Manual
269
Application Programmers Interface
apiExamples (3c)
printf( "[%s]: PfReadScript reported %d errors for %s\n",
numErrors, fileName );
return apiError;
}
int32 createVariables()
{
numVarIds = 0;
/* Create variables locally int the api and in the RTM
Store variable ids into an array used when calling PfUpdateValuesId */
myIntId = PfCreateVar( "myInt", PfCInt, NULL, 0, &myInt );
if ( apiError == OK )
varIds[numVarIds++] = myIntId;
myFloatArrayId = PfCreateArray( "myFloatArray", PfCFloat, FloatArraySize,
NULL, 0, myFloatArray );
if ( apiError == OK )
varIds[numVarIds++] = myFloatArrayId;
myDoubleId = PfCreateVar( "myDouble", PfCDouble, NULL, 0, &myDouble );
if ( apiError == OK )
varIds[numVarIds++] = myDoubleId;
myStringId = PfCreateArray( "myString", PfCUnsignedChar, 6, NULL,
0, myString
);
if ( apiError == OK )
varIds[numVarIds++] = myStringId;
myStructId = PfCreateVar( "myStruct", PfCRecord, "MyStruct", 0, &myStruct );
if ( apiError == OK )
varIds[numVarIds++] = myStructId;
PfFlushCreateVar();
if ( apiError == OK )
printf( "[%s]: %d variables sucessfully created\n",
applName, numVarIds );
/* Get the id of some fields of the struct variable */
/* Call PfUseField and PfFlushUseFields to be able
to update these fields individually.
With such a small struct one would be better off avoid
using PfUseField and transfer the entire struct instead */
myStructTheFloatId = PfId( myStructId, "theFloat" );
if ( apiError == OK )
PfUseField( myStructTheFloatId );
myStructTheIntId = PfId( myStructId, "theInt" );
if ( apiError == OK )
PfUseField( myStructTheIntId );
PfFlushUseFields();
if ( apiError != OK )
printf( "[%s]: PfFlushUseFields failed (%s)\n",
applName, PfGetSystemError(apiError) );
return apiError;
}
270
ProcSee Reference Manual
Application Programmers Interface
apiExamples (3c)
int32 registerFunctions()
{
PfTArg formals[3];
/* Register a function for terminating the program */
PfRegisterFunction( "stopApplication", stopApplication, 0, NULL );
if ( apiError != OK )
printf( "[%s]: PfRegisterFunction failed (%s)\n",
applName, PfGetSystemError(apiError) );
/*Register function for receiving value steps to be used in processHandler*/
formals[0].dtype = PfCInt;
formals[0].size = 1;
formals[1].dtype = PfCFloat;
formals[1].size = 1;
formals[2].dtype = PfCDouble;
formals[2].size = 1;
PfRegisterFunction( "incValueSteps", incValueSteps, 3, formals );
if ( apiError != OK )
printf( "[%s]: PfRegisterFunction failed (%s)\n",
applName, PfGetSystemError(apiError) );
return OK;
}
/* Function to be called from an RTM */
int32 stopApplication( numArgs, args )
int32 numArgs;
void* args;
{
quit();
return OK;
}
/* Function to be called from an RTM */
int32 incValueSteps( numArgs, args )
int32 numArgs;
void* args;
{
void* data;
int32 type, size;
if ( numArgs != 3 )
return !OK;
/* Get data for first argument */
data = PfGetFuncArg( &args, &type, &size );
if ( type != PfCInt || size != 1 )
return !OK;
intValueStep += *(int32*)data;
/* Get data for second argument */
data = PfGetFuncArg( &args, &type, &size );
if ( type != PfCFloat || size != 1 )
ProcSee Reference Manual
271
Application Programmers Interface
apiExamples (3c)
return !OK;
floatValueStep += *(float*)data;
/* Get data for third argument */
data = PfGetFuncArg( &args, &type, &size );
if ( type != PfCDouble || size != 1 )
return !OK;
doubleValueStep += *(double*)data;
return OK;
}
272
ProcSee Reference Manual
Message Output Formatter
Message Output Formatter (3c)
MODULE
Message Output Formatter
DESCRIPTION
The message output formatter functionality provides a set of functions to control the format and type of messages to print, and user defined call-back functions to be called when
the Software Bus, or the ProcSee API prints messages. The output to the callback functions can be enabled/disabled for each combination of context and category, with some
reasonable defaults. Using this functionality, messages can be tailor-made to the task they
are used for, for instance in GUI applications where the error and warning messages are
likely to be added to an output list where the user or system administrator can view the
output.
FUNCTIONS
A list of the available Message Output Formatter functions, follows:
Message initialization function: MfInitialize
Message function: MfMessage.
Message output selection functions: MfSetOutputs, MfGetOutputs.
Message category functions: MfSetCategoryName, MfGetCategoryName, MfSetCategoryDefaultOutputs, MfGetCategoryDefaultOutputs.
Message format functions: MfSetFormat, MfGetFormat, MfSetCategoryFormat, MfGetCategoryFormat, MfSetOutputFormat, MfGetOutputFormat, MfSetDefaultFormat,
MfGetDefaultFormat.
Message output functions: MfRegisterOutput, MfSetOutputFunc, MfGetOutputFunc,
MfGetNumOutputs, MfGetOutput, MfSetDefaultOutputFunc, MfGetDefaultOutputFunc.
Message module functions: MfRegisterModule, MfSetModuleName, MfGetModuleName, MfSetModuleDescription, MfGetModuleDescription, MfGetNumModules, MfGetModule.
Message context functions: MfRegisterContext, MfSetContextName, MfGetContextName, MfSetContextDescription, MfGetContextDescription, MfGetNumContexts, MfGetContext, MfGetContextModule.
ProcSee Reference Manual
273
Message Output Formatter
MfInitialize (3c)
FUNCTION
MfInitialize - initializes the message output formatter library.
SYNOPSIS
void MfInitialize( MfTOutputFunc outputFunc, const char* format )
DESCRIPTION
MfInitialize initializes the message output formatter functionality and provides a call-back
function and a message format used as the default. This function must be called prior to any
of the other message formatter functions to initialize the internal structures and set up the default call-back function.
SEE ALSO
MfSetDefaultFormat in "ProcSee Reference Manual" on page 279
MfSetDefaultOutputFunc in "ProcSee Reference Manual" on page 281
274
ProcSee Reference Manual
Message Output Formatter
MfMessage (3c)
FUNCTION
MfMessage - function used in code to output a message.
SYNOPSIS
void MfMessage( MfTCategory category, MfTContext context, const char* file, int line,
const char* obj, const char* func,
const char* msg, ... )
DESCRIPTION
The MfMessage function is used by the API and SWBus code to output messages, and
can be used in user programs to output messages. The msg argument is creating a message
by formatting the msg and the following arguments like the printf function. The message
together with the other arguments, like category, context, etc., are used by the Mf library
to select if the message should be output, and how the output is formatted on the different
output functions that can be registered. The selection of what messages to output is done
by the function MfSetOutputs.
EXAMPLE
SEE ALSO
MfSetOutputs in "ProcSee Reference Manual" on page 276
ProcSee Reference Manual
275
Message Output Formatter
Message output selection (3c)
FUNCTION
Message output selection functions - enables/disables message output.
SYNOPSIS
MfTBool MfSetOutputs( MfTCategory category, MfTContext context, MfTOutputBits outputs )
MfTOutputBits MfGetOutputs( MfTCategory category, MfTContext context )
DESCRIPTION
For each category - context combination, the different output functions can be enabled/disabled. When a context is created, it gets a default value for what outputs that are enabled.
The MfSetOutputs function sets what outputs that are enabled and disabled. The outputs argument is 0 to disable all, and a value that is the result of or-ing the different output handles
to tell what outputs that should be enabled. This argument can contain bits set for nonexisting
outputs without any problem, and the default for all outputs enabled is the value
0xFFFFFFFF, i.e. all bits on.
The MfGetOutputs function gets the currently enabled outputs for the given category - context combination.
EXAMPLE
SEE ALSO
MfSetCategoryDefaultOutputs in "ProcSee Reference Manual" on page 277
276
ProcSee Reference Manual
Message Output Formatter
Message categories (3c)
FUNCTION
Message categories - message output format categories, like error, warning, information,
etc.
SYNOPSIS
MfTBool MfSetCategoryName( MfTCategory category, char* name )
const char* MfGetCategoryName( MfTCategory category )
MfTBool MfSetCategoryDefaultOutputs( MfTCategory category, MfTOutputBits outputs )
MfTOutputBits MfGetCategoryDefaultOutputs( MfTCategory category )
DESCRIPTION
A set of predefined message categories are supported by the Mf library, i.e. categories like
warning, error, debug, flow, information, etc. Next follows a table of supported message
categories. Notice that not all of these message categories are used by the Software Bus or
the ProcSee API, but can be utilised in the application by calling the MfMessage function.
Table 1: Message Categories
Message Categories
Category default text
Description
MfCCritical
Critical
Used for critical errors.
MfCError
Error
Used for error messages.
MfCWarning
Warning
Used for warning messages.
MfCInfo
Info
Used for information messages.
MfCDebug1
Debug1
Used for important debug messages.
MfCDebug2
Debug2
Used for debug messages.
MfCDebug3
Debug3
Used for debug messages.
MfCDebug4
Debug4
Used for debug messages.
MfCDebug5
Debug5
Used for very frequent debug messages, like
inside of loops.
MfCFlow
Flow
Used for execution flow messages (reduces
performance dramatically).
Whether the message output callback functions are called, depends on whether the output
is enabled for the given message category and context. This enabling can be changed at
any time during the execution of the application, using the MfSetOutputs function. By default critical, error, warning and info categories are enabled. The debug1 message category is by default enabled in debug-builds. The other message categories (debug2-debug5,
flow) are by default not enabled.
ProcSee Reference Manual
277
Message Output Formatter
Message categories (3c)
The MfSetCategoryName function can be used to change the output text for a category, e.g.
when one wants to use another language for the categories. The default text in the table above
is used by default. The MfGetCategoryName function can be used to retrieve the current
text set for a given category.
The MfSetCategoryDefaultOutputs function is used to change the default outputs that are
enabled for a given category. This default is copied to the context when a context is registered. It is the value in the context that determines if a category is output or not. The MfGetCategoryDefaultOutputs function is used to get the current outputs that are set in this
default value.
SEE ALSO
MfMessage in "ProcSee Reference Manual" on page 275
MfSetOutputs in "ProcSee Reference Manual" on page 276
278
ProcSee Reference Manual
Message Output Formatter
Message format (3c)
FUNCTION
Message format - specification of the message output format
SYNOPSIS
MfTBool MfSetFormat( MfTCategory category, MfTOutput output, const char* format )
const char* MfGetFormat( MfTCategory category, MfTOutput output )
MfTBool MfSetCategoryFormat( MfTCategory category, const char* format )
const char* MfGetCategoryFormat( MfTCategory category )
MfTBool MfSetOutputFormat( MfTOutput output, const char* format )
const char* MfGetOutputFormat( MfTOutput output )
MfTBool MfSetDefaultFormat( const char* format )
const char* MfGetDefaultFormat()
DESCRIPTION
A message format can be provided with the category and output, with the category, with
the output, or globally. Normally one provides a format for each output, so that output to
file can have one format and output to a list in the GUI can have another format. If the
format is not provided for the output, the default (global) format is used. In addition, the
format can be provided for a given category, and if it is this is used instead of the format
given for the output. The most specific configuration can set a format for a given category
and output combination, and if this is given, it is used instead of any of the other formats.
If no format is found (i.e. it is set to NULL), a default message format will be used, which
is "{TIME:T} {CAT} {MSG}", i.e. time, category and message.
The message format is a compound string composed of pure text and directives. A directive in this context is a keyword surrounded by curly braces. To output a curly brace, it is
written twice. The directives can be used to output the time, the category, the message,
and other elements, as specified in the table below.
Table 2: Directives
Directive
Description
{{
the character ’{’ is copied to the output buffer.
}}
the character ’}’ is copied to the output buffer.
{TIME:A}
{TIME:z}
the output is the result of the strftime function with the
character after : used as the format. E.g. {TIME:T} is
replaced with the result from strftime with the format
"%T", which results in the time as HH:MM:SS.
{CAT}
the category, e.g. Error.
{MSG}
the message to output.
{OBJ}
the name of the object issuing the message.
{FUNC}
the name of the function issuing the message.
ProcSee Reference Manual
279
Message Output Formatter
Message format (3c)
Table 2: Directives
Directive
Description
{FILE}
the name of the file where the message was issued.
{LINE}
the line number in the file where the message was issued.
{PROG}
the program name if set, or an empty string.
{SERVICE}
the service name if set, or an empty string.
{ARCH}
the architecture, for instance winArch, linuxX86Arch,
etc.
{HOST}
the host name.
{PID}
the process identifier.
{MOD}
the module.
{CTX}
the context.
{DESC:MOD}
the description of the module.
{DESC:CTX}
the description of the context.
The MfSetFormat function sets the format for a given category and output combination. The
MfGetFormat retrieves the current format for the given category and output combination.
The MfSetCategoryFormat function sets the format for a given category. The MfGetCategoryFormat function gets the format for the category.
The MfSetOutputFormat function sets the format for a given output. The MfGetOutputFormat function gets the format for a given output.
The MfSetDefaultFormat function sets the format to use if no format is specified with the
other MfSet...Format functions. This is the same as the format set with MfInitialize. The MfGetDefaultFormat function gets this format.
The MfSet... functions return MfCFalse if the format contains illegal directives, meaning that
the message format will not be stored for the specified message category or output in the
message output formatter's internal structures. MfCTrue is returned if the format was successfully parsed and stored. Passing a null pointer in the format argument to these functions
makes the format unset for this category or output.
SEE ALSO
MfInitialize in "ProcSee Reference Manual" on page 274
MfMessage in "ProcSee Reference Manual" on page 275
280
ProcSee Reference Manual
Message Output Formatter
Message output (3c)
FUNCTION
Message output - the callback functions that are called when a message is going to be
output.
SYNOPSIS
void (*MfTOutputFunc)( MfTCategory category, MfTContext context, MfTOutput output,
const char* message )
MfTOutput MfRegisterOutput( MfTOutputFunc outputFunc, const char* format )
MfTBool MfSetOutputFunc( MfTOutput output, MfTOutputFunc outputFunc )
MfTOutputFunc MfGetOutputFunc( MfTOutput output )
unsigned int MfGetNumOutputs()
MfTOutput MfGetOutput( unsigned int ix )
void MfSetDefaultOutputFunc( MfTOutputFunc outputFunc )
MfTOutputFunc MfGetDefaultOutputFunc()
DESCRIPTION
MfTOutputFunc defines the type of the message callback function used by the library.
This function is called when messages are issued in the Software Bus, the ProcSee API or
when invoking the function MfMessage(...). The arguments category, context, and output
is information about the current message, that may have been incorporated into the message via the format used. The argument message, is the message to output. Typically the
output function appends the message to a log-file, or outputs it to a message window.
More than one output function can be registered, and for each message, all output functions that are enabled for the given category will be called.
The MfRegisterOutput is used to register a new output callback function. It returns a
handle to the output. The arguments are a callback function and a format. If the call-back
function is NULL, the call-back registered with the MfInitialize function will be used instead. If the format is NULL, the format registered with the MfInitialize function will be
used. If no outputs are registered, the call-back registered with the MfInitialize will be
used.
The MfSetOutputFunc function is provided to change the call-back function set with the
specified output. The MfGetOutputFunc gets the currently registered call-back function.
The MfGetNumOutputs returns the number of outputs registered. The MfGetOutput
function returns an output handle from an input in the range 0 to number of outputs - 1.
The MfSetDefaultOutputFunc function sets the default function to use. This is the same
as the function set with MfInitialize. The MfGetDefaultOutputFunc functions gets this
function.
SEE ALSO
MfInitialize in "ProcSee Reference Manual" on page 274
MfMessage in "ProcSee Reference Manual" on page 275
ProcSee Reference Manual
281
Message Output Formatter
Message modules (3c)
FUNCTION
Message modules - message modules.
SYNOPSIS
MfTModule MfRegisterModule( const char* moduleName, const char* description )
MfTBool MfSetModuleName( MfTModule module, const char* moduleName )
const char* MfGetModuleName( MfTModule module )
MfTBool MfSetModuleDescription( MfTModule module, const char* description )
const char* MfGetModuleDescription( MfTModule module )
unsigned int MfGetNumModules()
MfTModule MfGetModule( unsigned int ix )
DESCRIPTION
A module has a name and a description. All messages are defined to be in a specific context,
and every context is in a specific module. The name and description of the module can be
output in the messages.
The function MfRegisterModule registers a new module, and returns a handle to the module.
The function MfSetModuleName can be used to change the name of a module. The function
MfGetModuleName returns the name of the given module.
The function MfSetModuleDescription can be used to change the description of the module. The function MfGetModuleDescription returns the description of the given module.
The MfGetNumModules function returns the number of modules. The MfGetModule
function returns a module handle from the input index in the range 0 to number of modules
- 1.
EXAMPLE
SEE ALSO
MfRegisterContext in "ProcSee Reference Manual" on page 283
282
ProcSee Reference Manual
Message Output Formatter
Message contexts (3c)
FUNCTION
Message contexts - message contexts.
SYNOPSIS
MfTContext MfRegisterContext( MfTModule module, const char* contextName, const char* description );
MfTBool MfSetContextName( MfTContext context, const char* contextName );
const char* MfGetContextName( MfTContext context );
MfTBool MfSetContextDescription( MfTContext context, const char* description );
const char* MfGetContextDescription( MfTContext context );
MfTModule MfGetContextModule( MfTContext context );
unsigned int MfGetNumContexts();
MfTContext MfGetContext( unsigned int ix );
DESCRIPTION
The MfRegisterContext function creates a new context in the given module, and gives it
a name and a description.
The MfSetContextName function changes the name of the context. The MfGetContextName function gets the name of the context.
The MfSetContextDescription function changes the description of the context. The MfGetContextDescription function gets the description of the context.
The MfGetContextModule function returns the module that the given context is in.
The MfGetNumContexts function returns the number of contexts. The MfGetContext
function returns the context from the ix argument in the range 0 to number of contexts - 1.
EXAMPLE
SEE ALSO
MfMessage in "ProcSee Reference Manual" on page 275
ProcSee Reference Manual
283
Message Output Formatter
284
Message contexts (3c)
ProcSee Reference Manual
Application Programmers Interface
List of Functions
List of Functions
MfInitialize . . . . . . . . . . . . . . . . . . . . . . . . 274
MfTOutputFunc . . . . . . . . . . . . . . . . . . . . 281
PfAddField . . . . . . . . . . . . . . . . . . . . . . . . 170
PfAddInput . . . . . . . . . . . . . . . . . . . . . . . . 171
PfAddRtmToCurrent . . . . . . . . . . . . . . . . 172
PfAddVarAction. . . . . . . . . . . . . . . . . . . . 173
PfBeginRecord . . . . . . . . . . . . . . . . . . . . . 174
PfClearEvents . . . . . . . . . . . . . . . . . . . . . . 175
PfClose . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
PfCreateArray. . . . . . . . . . . . . . . . . . . . . . 177
PfCreateVar . . . . . . . . . . . . . . . . . . . . . . . 178
PfData . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
PfDeleteRecord. . . . . . . . . . . . . . . . . . . . . 180
PfDeleteVar . . . . . . . . . . . . . . . . . . . . . . . 181
PfDeleteVarId. . . . . . . . . . . . . . . . . . . . . . 181
PfDiagnosticsSubscribe . . . . . . . . . . . . . . 182
PfDiagnosticsSubscribeEx . . . . . . . . . . . . 182
PfDisableInitialUpdate . . . . . . . . . . . . . . . 183
PfDispatch . . . . . . . . . . . . . . . . . . . . . . . . 184
PfEditLogBuffer . . . . . . . . . . . . . . . . . . . . 185
PfEnableInitialUpdate . . . . . . . . . . . . . . . 183
PfEndLoop . . . . . . . . . . . . . . . . . . . . . . . . 186
PfEndRecord. . . . . . . . . . . . . . . . . . . . . . . 187
PfEvent . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
PfEvent . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
PfEvents . . . . . . . . . . . . . . . . . . . . . . . . . . 188
PfEvents . . . . . . . . . . . . . . . . . . . . . . . . . . 188
PfExecute . . . . . . . . . . . . . . . . . . . . . . . . . 191
PfExecuteAsync . . . . . . . . . . . . . . . . . . . . 191
PfExecuteAsync . . . . . . . . . . . . . . . . . . . . 191
PfExportWindow . . . . . . . . . . . . . . . . . . . 192
PfFlush . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
PfFlushCreateVar . . . . . . . . . . . . . . . . . . . 195
PfFlushEditLogBuffer . . . . . . . . . . . . . . . 196
PfFlushUseFields . . . . . . . . . . . . . . . . . . . 197
PfGetChanges . . . . . . . . . . . . . . . . . . . . . . 198
PfGetChildren. . . . . . . . . . . . . . . . . . . . . . 200
PfGetCurrentObject . . . . . . . . . . . . . . . . . 202
PfGetDefinedVars . . . . . . . . . . . . . . . . . . 203
PfGetDefinition . . . . . . . . . . . . . . . . . . . . 204
PfGetDiagnosticsMessage . . . . . . . . . . . . 205
PfGetFDSet. . . . . . . . . . . . . . . . . . . . . . . . 206
PfGetFieldId . . . . . . . . . . . . . . . . . . . . . . . 207
PfGetFuncArg. . . . . . . . . . . . . . . . . . . . . . 208
PfGetNumAllRtms . . . . . . . . . . . . . . . . . . 209
PfGetNumCurrentRtms . . . . . . . . . . . . . .
PfGetSystemError . . . . . . . . . . . . . . . . . .
PfGetTypeId . . . . . . . . . . . . . . . . . . . . . .
PfGetVarId. . . . . . . . . . . . . . . . . . . . . . . .
PfGetWindowChanges . . . . . . . . . . . . . .
PfId . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PfIndex. . . . . . . . . . . . . . . . . . . . . . . . . . .
PfInit . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PfInitialize . . . . . . . . . . . . . . . . . . . . . . . .
PfIsConnected . . . . . . . . . . . . . . . . . . . . .
PfMainLoop . . . . . . . . . . . . . . . . . . . . . . .
PfName . . . . . . . . . . . . . . . . . . . . . . . . . .
PfNextVarId. . . . . . . . . . . . . . . . . . . . . . .
PfNonBlocking . . . . . . . . . . . . . . . . . . . .
PfPeriodic . . . . . . . . . . . . . . . . . . . . . . . .
PfPrintAllRecords . . . . . . . . . . . . . . . . . .
PfPrintAllVars . . . . . . . . . . . . . . . . . . . . .
PfPrintSystemError . . . . . . . . . . . . . . . . .
PfPut . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PfQuoteString . . . . . . . . . . . . . . . . . . . . .
PfReadScript . . . . . . . . . . . . . . . . . . . . . .
PfReceiveRtmStringUpdates . . . . . . . . . .
PfReceiveRtmUpdates . . . . . . . . . . . . . . .
PfRegisterFunction . . . . . . . . . . . . . . . . .
PfRegisterFunctionEx . . . . . . . . . . . . . . .
PfReleaseWindow . . . . . . . . . . . . . . . . . .
PfRemoveAllInputs . . . . . . . . . . . . . . . . .
PfRemoveInput . . . . . . . . . . . . . . . . . . . .
PfRemoveProcessHandler . . . . . . . . . . . .
PfRemoveVarAction . . . . . . . . . . . . . . . .
PfSend . . . . . . . . . . . . . . . . . . . . . . . . . . .
PfSendApiStringUpdates . . . . . . . . . . . . .
PfSendToOne. . . . . . . . . . . . . . . . . . . . . .
PfSetAllRtmsCurrent . . . . . . . . . . . . . . . .
PfSetDefinition . . . . . . . . . . . . . . . . . . . .
PfSetFlushBehaviour . . . . . . . . . . . . . . . .
PfSetMaxQuotedStrings . . . . . . . . . . . . .
PfSetProcessClass . . . . . . . . . . . . . . . . . .
PfSetProcessHandler . . . . . . . . . . . . . . . .
PfSetRtmCurrent . . . . . . . . . . . . . . . . . . .
PfsorDefinitionLength . . . . . . . . . . . . . . .
PfsorFullName . . . . . . . . . . . . . . . . . . . . .
PfsorIdMask. . . . . . . . . . . . . . . . . . . . . . .
PfsorLength . . . . . . . . . . . . . . . . . . . . . . .
PfsorSignature . . . . . . . . . . . . . . . . . . . . .
ProcSee Reference Manual
210
211
212
213
214
215
216
217
219
222
223
224
225
226
227
228
229
230
231
233
234
236
235
237
237
240
241
242
243
244
245
247
245
248
249
250
233
251
252
253
254
254
254
254
254
285
PfUnquoteString . . . . . . . . . . . . . . . . . . . .233
PfUpdateValuesId. . . . . . . . . . . . . . . . . . .255
PfUseField . . . . . . . . . . . . . . . . . . . . . . . .256
PfWinInitialize . . . . . . . . . . . . . . . . . . . . .257
PfWithdrawRtmFromCurrent . . . . . . . . . .259
PfXtInitialize. . . . . . . . . . . . . . . . . . . . . . .260
PfXtInitialize. . . . . . . . . . . . . . . . . . . . . . .260
286
ProcSee Reference Manual
Standard pTALK Functions Manual pages
ProcSee Reference Manual
287
288
ProcSee Reference Manual
Standard pTALK Functions
array (3pTALK)
NAME
array - creates arrays of any type.
SYNOPSIS
any*
newArray( char* elementType, int size );
char*
newCharArray( int size );
short int* newShortIntArray( int size );
int*
newIntArray( int size );
float*
newFloatArray( int size );
double* newDoubleArray( int size );
int
arrayLength( any array );
int
arrayIndex( any pointer );
DESCRIPTION
newArray is a generic function for creating single- or multi dimensional arrays. This
function accepts two arguments, elementType and size.
The first argument, elementType is a string specifying the data type of each element in the
array. The element type can be a simple data type, like int, char, float, etc, or an array of
a simple data type, like int[10], float[5], int[3][4], etc. Specifying for instance int[10]
creates a two dimensional array, where each element in the first dimension is an array of
10 integers. Notice that there isn't possible to create a jagged array, i.e. a multi dimensional array where the elements in each dimension have different element size. The elementType can also be a pointer to a ProcSee meta-class, like Rectangle*, Picture*, etc. Each
element in this array is a pointer to a meta-class.
The second argument, size specifies the number of elements in the array. In a multi dimensional array the size argument is the number of elements of the first dimension, i.e.
newArray( "int[4]", 3 ) creates a two dimensional array where the first dimension has 3
elements, while the second dimension has 4 elements.
The return value from this function is a pointer to the specified elementType, i.e. it returns
int* if the element type is int, int** if the element type is int[10], char* if the element type
is char, etc. A null pointer is returned if an unknown element type or an illegal size is specified.
Notice that arrays created with this function are automatically deallocated when the last
reference to the array goes out of scope. An example is an array created in a function.
When the function returns, the array is deallocated.
The arrays created with newArray() are zero based, meaning that the first index in the
array is 0. To access an element in a multi dimensional array, an ordered list of integers,
such as arr[2][3][1] is used. An error message is issued if trying to access an element outside the array bounds.
The functions newCharArray(), newShortIntArray(), newIntArray(), newFloatArray() and newDoubleArray() are specialized functions used to create arrays of simple
data types, in contrast to the generic function newArray() which can be used to create arrays of any type and dimension. These functions create single arrays of simple types. To
ProcSee Reference Manual
289
Standard pTALK Functions
array (3pTALK)
create an integer array of 10 elements, use either the specialized function newIntArray( 10 )
or the generic newArray( "int", 10 ). The result is, as expected the same, they create a pointer
to an integer array of 10 elements. In fact, the specialized functions is the same as calling the
more generic function newArray(), where the element type is set to a simple data type. For
more information about these functions see the description about newArray().
arrayLength() accepts one argument of type array and returns the number of elements in the
array. The remaining number of elements in the array is returned if a pointer to an element
in the array is passed as argument.
arrayIndex() accepts one argument of type pointer, where the pointer points to an element
in an array. This function returns the index to that element. In multi dimensional arrays, it
returns the index in the array at the n'th dimension.
EXAMPLE
char* F(int a)
{
char* t = newCharArray(16); // array created.
sprintf(t,"%d",a);
return t;
}
void G()
{
char* s = F(random(25));
printf("%s",s);
} // s goes out of scope => array memory released.
int** GetRandomMatrix()
{
int** m = newArray( "int[2]", 2 ); // Creates a 2x2 array
for ( int y = 0; y < 2; y++ )
for ( int x = 0; x < 2; x++ )
m[y][x] = random( 100 );
return m;
}
NOTES
If the size parameter is 0 or less than 0, the new array functions returns 0.
SEE ALSO
newList() and newMatrix() in "ProcSee Reference Manual"on page 380 and page 385
290
ProcSee Reference Manual
Standard pTALK Functions
atof, atoi (3pTALK)
NAME
atof, atoi - conversion functions
SYNOPSIS
double atof( char* aString );
int atoi( char* aString );
DESCRIPTION
atof() takes one string argument and converts it to the corresponding floating point value.
For both functions, the string argument is scanned up to the first character inconsistent
with the base (0..9). Leading white-space is ignored. If no conversion can take place, zero
is returned.
atoi() takes one string argument and converts it to the corresponding integer value.
EXAMPLES
int anInt;
float aFloat;
:
anInt = atoi( "45" );
aFloat = atof( "38" );
In this example, the string argument to atoi() and atof() is converted to the integer value 45 and the float
value 38.
ProcSee Reference Manual
291
Standard pTALK Functions
Colour (3pTALK)
NAME
Colour - colour functions
SYNOPSIS
int
int
int
int
int
int
Colour::red( int ix = 0 );
Colour::green( int ix = 0 );
Colour::blue( int ix = 0 );
Colour::time( int ix = 0 ):
Colour::numBlinkColours();
Colour::edit( int red = -1, int green = -1, int blue = -1,
int time = -1, int ix = 0 );
int Colour::add( int red, int green, int blue, int time=500, int ix=-1 );
int Colour::remove( int ix=-1 );
int Colour::setTransparency( int transparency, int ix= 0 );
int Colour::getTransparency( int ix = 0 );
int Colour::comRGB();
int Application::comRGB(int colour);
Colour* Application::getColour(int colour, ::ResourceStyle* rs = 0);
Colour* Application::getColourFromRGB(int r, int g, int b, int exact=0);
Colour* Application::getColourFromRGB(int rgb, int exact=0);
DESCRIPTION
red(), green() and blue() return the red, green and blue component of the colour, respectively. If the colour is a blink colour the argument ix specifies an index into the blink colour array.
Returns -1 on failure.
time() returns the blink time in milliseconds for a specific blink colour. The argument ix
specifies an index into the blink colour array. This function has no meaning if the colour is a
not blinking. Returns -1 on failure.
numBlinkColours() returns 0 if the colour is shared, 1 if the colour is private or the number
of blink colours if it is blinking. For more information about shared, private and blink see the
notes section.
edit() changes the red, green, blue or time attributes of an already existing colour. If the colour is a blink colour the argument ix specifies an index into the blink colour array. Returns 0
on success, -1 on failure.
add() adds a new red, green, blue and time attribute to the colour object. If the colour is
shared it becomes private. If it is private it becomes blinking. For more information about
shared, private and blink see the notes section. If the argument ix is –1 it is added last, otherwise at the specified index. Returns 0 on success, –1 on failure.
remove() removes a red, green, blue and time attribute from the colour object. If the argument ix is –1 the last blink colour is removed otherwise the blink colour at the specified index. Returns 0 on success, -1 on failure.
292
ProcSee Reference Manual
Standard pTALK Functions
Colour (3pTALK)
setTransparency() changes the colour’s transparency. The first argument defines the
magnitude of the transparency. A value of 0 specifies an opaque colour, while 65535 specifies a transparent colour. The last argument ix specifies the blink colour index to modify.
This argument has a default value of 0.
getTransparency() returns the colour’s transparency attribute.The argument ix specifies
the blink colour index. This argument has a default value of 0.
comRGB() returns an int combining the red, green, and blue components (8 bits each).
Normally used when a Windows colour is needed, e.g. when using COM.
Application::comRGB() finds the colour in the application, and returns an int combining
the red, green, and blue components (8 bits each). Typically used when a Windows colour
is needed, e.g. when using COM.
Application::getColour() returns a pointer to the Colour that is given as input argument.
Used to convert integer colour index back to the Colour it represents. An optional ResourceStyle can be given.
Application::getColourFromRGB() finds the Colour closest to the input colour. The input colour is either red, green, and blue components in the range 0-65535, or a combined
rgb value with 8 bits for each colour component. If the exact parameter is true, the colour
must match at least 8 bits for each colour component.
NOTES
A colour object can be in three different states:
Shared: which means that the colour is not blinking. On PseudoColor on X-Windows it
means that the colour can be shared by any other application.
Private: which means that the colour is not blinking but it has a blink time specified. On
PseudoColor on X-Windows this has a meaning because the colour is allocated as private
and cannot be shared with any other application. Using private colours on X-Windows are
resource consuming and may result in the problem that application cannot allocate colours. Only 256 colours are available on PseudoColor.
Blink: which means that the colour is blinking. It is a colour that has more than one RGB
component.
SEE ALSO
create(3pTALK) in "ProcSee Reference Manual"on page 306
ProcSee Reference Manual
293
Standard pTALK Functions
Colour matrix functions (3pTALK)
NAME
Colour matrix functions – functions for initializing matrices with colour adjustment data.
SYNOPSIS
::Matrix* setGreyMatrix( ::Matrix* m, double min, double max );
::Matrix* setRGBMatrix( ::Matrix* m, double min, double max );
DESCRIPTION
The functions setGreyMatrix(…) and setRGBMatrix(…) initialize a Matrix object with
colour information data. The Matrix object must be a matrix of size 4 by 4. A 4 by 4 Matrix
object will be created in these functions if null is specified for the parameter m. The return
value from these functions is a pointer to a matrix initialized with colour data.
The colour matrices can be used to adjust the colour balance for all colours used in a picture.
It is possible to let the entire picture be displayed in a grey-scale tone, or make the entire picture become darker or brighter by modifying the lightness. The Picture class has a function
called adjustColours(…) which can be used to modify all colours in a picture without making any permanent changes to the colours.
The function setGreyMatrix(…) initializes the 4 by 4 matrix with grey-scale data. The greyscale will range from the argument min to max. The value of min and max must be in the
range 0 to 1. A value close to 0 will produce a matrix with dark grey data, while a value close
to 1 will produce a matrix with light grey data.
The function setRGBMatrix(…) initializes the 4 by 4 matrix with colour adjustment data.
The colour values will range from the arguments min to max. These values must be in the
range 0 to 1. Values close to 0 will produce dark colour matrices, while values close to 1 will
produce light colour matrices.
EXAMPLE
function `void setColours()
{
// Modify the colours using dark greyscale fill and
// brighter border.
::Matrix* border = setRGMatrix( 0, 0.5, 1.0 );
::Matrix* fill = setGreyMatrix( 0, 0, 0.5 );
adjustColours( fill, border );
}`
SEE ALSO
Picture::adjustColours, Matrix
294
ProcSee Reference Manual
Standard pTALK Functions
COM functions (3pTALK)
NAME
COM functions - functions used when creating and accessing COM functionality
SYNOPSIS
int
int
double
int
comAdvise( eventObject, interfaceObject )
comUnadvise( eventObject )
comDateFromTime( int uxTime )
comDateToTime( double comDate )
ComEventObject* newComEventObject( char* fullName, char* name,
char* comEventClass )
ComInterfaceObject* newComInterfaceObject( char* fullName, char* name,
char* comInterfaceClass )
ComObject* newComObject( char* fullName, char* name, char* comClass )
ComShape* newComShape( char* fullName, char* name, char* comClass,
float x, float y, float w, float h )
int Application::newComLibrary( char* libraryId,
int major = -1, int minor = -1 )
int Library::newComLibrary( char* libraryId,
int major = -1, int minor = -1 )
int ComInterfaceObject::queryInterface( ComInterface** interface );
int ComInterface::queryInterface( ComInterface** interface );
DESCRIPTION
The function comAdvise() registers an event object to receive event callbacks from a
ComShape or ComObject. The interfaceObject is a pointer associated with a ComShape
or ComObject. ComShape or ComObject is the object which fires the event. The comAdvise() function takes the following arguments, eventObject and interfaceObject. EventObject is either the fullname of the event object or a pointer to the event object. The
argument interfaceObject is either a character string or a pointer to one of the following
data types, ComInterfaceObject, ComShape, ComObject, attribute or local variable of
type ComInterface pointer. The comAdvise() function returns true if the registration was
successful and false otherwise.
The function comUnadvise() cancels a registration previously established with comAdvise(). No event callbacks will be received in the event object sent from the ComShape or
ComObject after this function has been called. See comAdvise() for a description of the
argument. The comUnadvise() function returns true if the un-registration was successful
and false otherwise.
The function comDateFromTime() converts and returns a time specified in seconds since
January 1, 1970 to a double value. This double value is represented as time elapsed since
December 30, 1899. The time value can be used in COM components accepting time parameters.
The function comDateToTime() converts and returns a time specified in seconds since
December 30, 1899 to a time elapsed since January 1, 1970. For more information see
comDateFromTime(). This function can be used to convert time arguments received
from COM components.
ProcSee Reference Manual
295
Standard pTALK Functions
COM functions (3pTALK)
The function newComEventObject() creates a new ComEventObject, where the argument
fullName is the owner's fullname and name is the new event object's name. The event object
will be of the interface class specified by the last argument comEventClass. This function returns a pointer to a ComEventObject if the event object was successfully created and 0 otherwise. See also comAdvise() and comUnadvise().
The function newComInterfaceObject() creates a new ComInterfaceObject, where the argument fullName is the owner's fullname and name is the new interface object's name. The
interface object will be of the interface class type specified by the last argument comInterfaceClass. This function returns a pointer to a ComInterfaceObject if the interface object was
successfully created and 0 otherwise.
The newComObject() function creates a ComObject of a component class specified by the
last argument comClass. The argument fullName is the owner's fullname and name is the new
name of the com object. It returns 0 if the function fails, otherwise a pointer to the created
COM object.
The newComShape() function create a ComShape object of a component class type specified by the argument comClass. The argument fullName is the owner's fullname and name is
the new name of the COM shape. The owner fullname is normally a Picture or Class. x and
y specify the position of the COM shape in world coordinates. The arguments w and h specify the COM shape's width and height. The COM shape will try to use its own default size if
a negative value is given for w or h. If the COM shape does not have a default size then the
absolute value of the arguments w and h will be used. The function newComShape() returns
a pointer to a ComShape if it returned successfully and 0 otherwise.
The function newComLibrary() adds all the definitions in the COM library to the symboltable specified by the arguments libraryId, major and minor version number. The argument
libraryId is a unique library identifier (known as LIBID, GUID, UUID). An example of a
GUID is "{898B4426-679D-4544-99E9-B98AF501B9EB}". The major and minor version
number is the COM library version to load. It returns 1 on success and 0 otherwise.
The member function ComInterfaceObject::queryInterface() initializes a pointer to the
interface requested by the argument interface. When a ComInterfaceObject is initialized
properly it has reference to a COM shape or COM object. The interface passed as argument
to this function must be of a COM interface type supported by the same COM object or COM
shape as the ComInterfaceObject. The pointer will be set to the value 0 if the requested interface is not supported by the COM shape or COM object. It returns 1 if the interface was
successfully initialized and 0 otherwise.
The member function ComInterface::queryInterface() initializes a pointer to the interface
requested by the argument interface. It returns 1 if the interface was successfully initialized
and 0 otherwise.
NOTES
These functions are only available on the Windows platform.
296
ProcSee Reference Manual
Standard pTALK Functions
ComShape (3pTALK)
NAME
ComShape - Graphical user interface COM component
SYNOPSIS
int
ComShape::backgroundColour;
int
ComShape::foregroundColour;
int
ComShape::theFont;
int
ComShape::resizeable;
float
ComShape::x;
float
ComShape::y;
float
ComShape::width;
float
ComShape::height;
void
ComShape::hideProperties();
void
ComShape::showProperties( char* title );
void
ComShape::showProperties( char* title, int x, int y );
int
ComShape::persist( int mode = -1 );
int
ComShape::queryInterface( ComInterface** interface );
ComClass* ComShape::theComClass();
DESCRIPTION
The attributes backgroundColour, foregroundColour and theFont control the background colour, foreground colour and font used by the COM shape, respectively. Not all
COM shapes support this feature. Only COM shapes supporting the following ambient
properties can be used to change a COM shape's appearance through these attributes,
DISPID_AMBIENT_BACKCOLOR,
DISPID_AMBIENT_FORECOLOR
and
DISPID_AMBIENT_FONT. These attributes will by default be set to the value -1, meaning that they will use the COM shape's own initial default values. Setting the attribute
backgroundColour to -2 will use the Picture's background colour. Setting foregroundColour to -2 will use either white or black colour. It depends on whether white or black
produces best contrast to the Picture's background colour. To set a user specified value,
use a ProcSee resource. These attributes can be regarded as hints to the COM component.
It is up to the component if it accepts the settings.
The attribute resizeable is used to control whether the COM shape is allowed to be resized
on request from the component or not. Setting this attribute to 1 will allow resizing, 0 will
deny any attempt from the component to resize itself. It is by default set to the value 1.
The attributes x, y, width and height controls the COM shape's position and size.
The functions hideProperties() and showProperties() hides and displays the COM
shape's property pages, respectively. showProperties() displays the property pages at the
coordinates x, y relative to the upper left corner of the screen. If x, y is not given, a default
position is used. The first argument title specifies the caption used for the property page
window. A property page is used to display a COM shape's configuration information to
the user and to enable the user to modify that information. Notice that not all COM shapes
have property pages.
ProcSee Reference Manual
297
Standard pTALK Functions
ComShape (3pTALK)
The persist() function controls whether the configuration data for the ComShape is saved to
file or not, and where the data is saved. Current persist setting is returned if it is called without argument. Setting the mode argument to the value 0 will ignore the configuration data
when saving the picture. Setting this parameter to the value 1 will save the configuration data
together with the ComShape. This is the default when creating new ComShape objects. When
this parameter is set to the value 2, the configuration data will be saved to a separate binary
file.
The function queryInterface() initializes and returns a pointer to the interface requested by
the argument interface. The interface passed as argument must be of an interface definition
type which is supported by the COM shape. The pointer will be set to the value 0 if the requested interface is not supported by the COM shape. A COM shape may have support for
several interfaces. In ProcSee only the default interface is created and initialized automatically. This function can be used to initialize the other interfaces. It returns 1 if the interface
was successfully initialized and 0 otherwise.
The function theComClass() returns a pointer to the COM shape's COM class definition.
NOTES
The ComShape is only available on the Windows platform.
298
ProcSee Reference Manual
Standard pTALK Functions
ComObject (3pTALK)
NAME
ComObject - non-graphical COM component.
SYNOPSIS
int ComObject::persist( int mode = -1 );
int ComObject::queryInterface( ComInterface** interface );
ComClass* ComObject::theComClass();
DESCRIPTION
The persist() function controls whether the configuration data for the ComObject is saved
to file or not, and where the data is saved. Current persist setting is returned if it is called
without argument. Setting the mode argument to the value 0 will ignore the configuration
data when saving the application, library or picture. Setting this parameter to the value 1
will save the configuration data together with the ComObject. This is the default when
creating new COM objects. When this parameter is set to the value 2, the configuration
data will be saved to a separate binary file.
The function queryInterface() initializes and returns a pointer to the interface requested
by the argument interface. The interface passed as argument must be of an interface definition type which is supported by the COM object. The pointer will be set to the value 0
if the requested interface is not supported by the COM object. A COM object may have
support for several interfaces. In ProcSee only the default interface is created and initialized automatically. This function can be used to initialize the other interfaces. It returns 1
if the interface was successfully initialized and 0 otherwise.
The function theComClass() returns a pointer to the COM object's COM class definition.
NOTES
The ComObject is only available on the Windows platform.
ProcSee Reference Manual
299
Standard pTALK Functions
COM definitions (3pTALK)
NAME
COM definitions - base classes for the COM definitions.
SYNOPSIS
ComLibrary
ComClass
ComInterface
DECSRIPTION
ComLibrary is the base class for all the COM library definitions added to a ProcSee application. A derived ComLibrary definition is used as a container for all the COM definitions
in the COM library.
The ComClass type is the base class for all the COM component definitions added to a ProcSee application. It keeps information about the interfaces and event interfaces supported by
the ComClass. A ComClass derived type is a COM definition used by a ComShape or ComObject when being created.
The ComInterface is the base class for all COM interface definitions added to a ProcSee application. Objects of definitions derived from ComInterface are used as ComInterfaceObject and ComEventObject.
NOTES
These COM definitions are only available on the Windows platform.
300
ProcSee Reference Manual
Standard pTALK Functions
Comments (3pTALK)
NAME
Comments - functions for handling comments.
SYNOPSIS
int setComment( char* fullName, char* comment );
char* getComment( char* fullName );
List* searchComments( char* str, char* startEntry=0, List* L=0, char* flags=0 );
DECSRIPTION
The setComment function sets the comment on the element specified in the fullName. It
returns a value different from 0 if all is OK. It returns 0 if the fullName was not found, or
not a legal place to set comments. It is not allowed to set comments on primitive attributes,
since they have no entry in the symboltable except for the definition in some meta-class.
It is not allowed to set comments on elements inside instances, since it will be lost when
the instance is saved, or the class is updated.
The getComment function return the comment of the element specified by the fullName.
If no comment is set, or the fullName was not found, it returns 0.
The searchComments function finds all elements in the symboltable under the startEntry, that has a comment containing the search string in str. If list is specified, this list is
added to, if not a new list is created. The list is returned. If the startEntry is not given, the
current position of the call is used. The flags argument is currently not used.
SEE ALSO
"Comments" on page 40 in "The Configuration Language" chapter, document function on
page 425, and PCC option -o comments on page 146.
ProcSee Reference Manual
301
Standard pTALK Functions
containsName (3pTALK)
NAME
containsName - testing for a named object given full name of the object’s owner.
SYNOPSIS
int containsName( char* ownerFullName, char* objectName );
DESCRIPTION
containsName() takes two arguments, the first is the full name of the owner and the second
is the name of the object. Returning an int with the following interpretation:
• less than zero for illegal name
• zero for a name that does not exist
• greater than zero is the symboltable identifier for the named object
302
ProcSee Reference Manual
Standard pTALK Functions
constructor, destructor (3pTALK)
NAME
constructor, destructor - functions called when objects are created/removed.
SYNOPSIS
void constructor();
void destructor();
unsigned int Application::setConstructorBehaviour( char* ctorMask );
unsigned int Application::setConstructorBehaviour( int ctorMask );
unsigned int Application::getConstructorBehaviour();
DESCRIPTION
Constructors and destructors are functions that are called when an object is created, or removed. If you create a function named constructor in one of the different objects that supports constructors in ProcSee, this function will be called when the object have been
created, e.g. loaded from file. Objects that can have a constructor, can also have a destructor, which will be called when the object is removed, right before the object disappears.
The following objects supports constructors and destructors:
Application, TrendLog, Library, Picture, Instance.
To get a constructor into an instance, it must be defined in the class.
The call sequence of the constructors and destructors are as follows:
First
constructors: Instances
...
Last
Pictures Libraries TrendLog Application
destructors: Application TrendLog Libraries Pictures Instances
Since the pictures normally are loaded from the Application constructor, the actual sequence for constructors will be:
Libraries TrendLog Application -- Instances Pictures
In some cases one wants the call sequence of the constructors and destructors to be different. To support this, both constructors and destructors can have an extra optional function
body. In these cases, the code in the first function body is called before the child objects
constructor/destructor, and the second function body is called after the child objects constructor/destructor.
The function setConstructorBehaviour() is used to change the way constructors and destructors are called in ProcSee. The argument ctorMask is a combination of one or several
of the following strings or integers constants (add :off after the string to reverse its meaning):
• descend - call the constructor and destructor in the child objects. Can be set to true or
ProcSee Reference Manual
303
Standard pTALK Functions
constructor, destructor (3pTALK)
false (constant value 1). This is the default.
• callable - set to true if the constructor and destructor can be called from pTALK and otherwise false (constant value 2).
• ctorCalled - set this value to one of the following values.
If it is set to the value dtor, it will automatically be called from the constructor function.
The destructor will be called automatically if object is in constructed state. This is the
default. (constant value 4).
If it is set to the value ctor, then call the constructor, but do not automatically call the
destructor. (constant value 8).
If the value is ignore then ignore the constructor call if the object is in constructed state
(constant value 16).
• ifCalledWarn - if true, a warning message is displayed when the constructor or destructor is called from pTALK (constant value 32). This is default.
• dtorAutoCallWarn - if this value is set to true a warning message is displayed when a
destructor is automatically called from a constructor (constant value 64).
The function getConstructorBehaviour() returns current setting for the constructor and destructor behaviour in the application.
EXAMPLES
application myApp
{
...
function �void constructor()
{
load("myPicture.ppic");
displayPicture("myWindow","myPicture");
}�
...
}
class myClass
{
...
int myAttr = 23;
instance aClass myInst
{
myInstAttr = 45;
...
}
function ’void constructor() // with double body.
{
myInst.myInstAttr = myAttr; // Set before myInst.constructor called.
}
{
...
}�
...
}
304
ProcSee Reference Manual
Standard pTALK Functions
constructor, destructor (3pTALK)
SEE ALSO
"Constructors and Destructors" on page 37 in the ProcSee Reference Manual.
ProcSee Reference Manual
305
Standard pTALK Functions
create (3pTALK)
NAME
create - functions for instantiation of user interface objects
SYNOPSIS
// container objects:
Library* newLibrary( char* ownerFullName, char* name );
Class* newClass( char* ownerFullName, char* name );
// shapes:
Instance* newInstance( char* ownerFullName, char* name,
char* classFullName, float x, float y );
Rectangle* newRectangle( char* ownerFullName, char* name,
float x, float y, float width, float height );
RoundRect* newRoundRect( char* ownerFullName, char* name,
float x, float y, float width, float height, float xRadiusCorner, float yRadiusCorner );
DialogueArea* newDialogueArea( char* ownerFullName, char* name,
float x, float y, float width, float height );
Circle* newCircle( char* ownerFullName, char* name,
float x, float y, float radius );
CircleArc* newCircleArc( char* ownerFullName, char* name,
float x, float y, float radius,
float startAngle, float openingAngle, int mode);
Ellipse* newEllipse( char* ownerFullName, char* name,
float x, float y, float xradius, float yradius );
EllipseArc* newEllipseArc( char* ownerFullName, char* name,
float x, float y, float xradius, float yradius,
float startAngle, float openingAngle, int mode);
Text* newText( char* ownerFullName, char* name,
float x, float y, char* text );
Image* newImage( char* ownerFullName, char* name, char* filename,
float x, float y);
Line* newLine( char* ownerFullName, char* name,
float x1, float y1, float x2, float y2 );
Line* addLinePoint( char* ownerFullName, char* name,
float x, float y );
Polygon* newPolygon( char* ownerFullName, char* name,
float x1, float y1, float x2, float y2 );
Polygon* addPolygonPoint( char* ownerFullName, char* name,
float x, float y );
Trend* newTrend( char* ownerFullName, char* name,
float x, float y, float width, float height );
Group* newGroup( char* ownerFullName, char* name );
Scale* newScale( char* fullName, char* name, float x, float y, float length,
int orientation = 1 );
// attributes, functions and dialogues:
Attribute* newAttribute( char* ownerFullName, char* definition );
Function* newFunction( char* ownerFullName, char* definition );
Dialogue* newDialogue( char* ownerFullName, char* event, char* action );
int newVariable( char* processFullName, char* name, int type, int size, char* recordName, any defaultValue );
306
ProcSee Reference Manual
Standard pTALK Functions
create (3pTALK)
// Picture
pPicture* newPicture( char* ownerFullName, char* name );
// Application
int newProcess( char* ownerFullName, char* processName );
int Application::newWindow( char* windowName, char* parentName,
int x, int y, int width, int height );
// Colours
Colour* Application::newColour( char* name, int red, int green, int blue,
int time = -1);
Colour* Library::newColour( char* name, int red, int green, int blue,
int time = -1);
// Enum
Enum* newEnum(char* fullName, char* name, char* dataType);
EnumElement* newEnumElement(char* fullName, char* name, any value);
DESCRIPTION
These functions can be used to create (instantiate) new objects at run-time. All functions
for shape creation take the owner’s fullname and the new object’s name as the first two
parameters. An empty name string indicates an anonymous shape. All the functions return
a pointer to the created object, except the functions newProcess and newVariable() that
return a value different from 0 if object created OK. All functions return 0 if it fails.
newLibrary() creates an empty library.
newClass() creates a graphics class. The class is initially empty, and should be filled by
the use of the other create functions.
newInstance() creates a new instance of class given by classFullName, and coordinates
given by x and y. An empty name string indicates an anonymous shape.
new<Shape>() creates a new <Shape> shape at the coordinates given by x and y. The
mode parameter in newCircleArc() and newEllipseArc() determines if the arc should be
a chord (mode=0) or a slice (mode=1). The startAngle and openingAngle parameters in
newCircleArc() and newEllipseArc() are specified in degrees. newLine() and newPolygon() creates a line or a polygon with 2 points, more points should be added by the use
of addLinePoint() or addPolygonPoint(). The filename parameter in newImage()
should be the filename of an image in one of the supported graphics formats. newTrend
creates a trend shape with a trend label. New trend labels, grid lines, rulers and curves
must be added using the member functions new<TrendShape>. Refer to the
Trend(3pTALK) manual entry for a detailed description of these functions. newGroup
creates an empty group.
The function newScale(…) creates a new Scale shape. If the Scale shape was successfully
created a pointer to the shape is returned, otherwise 0. The length argument is the length
of the Scale shape in world coordinates. The argument orientation controls the direction
of the scale shape. Legal values are 1 and 2, where the value 1 creates a vertical shape and
2 creates a horizontal shape.
The function newRoundRect(...) creates and returns a pointer to a new RoundRect
shape. The RoundRect shape is created at the coordinates given by x and y, with the size
given by the arguments width and height. The last two arguments xRadiusCorner and
ProcSee Reference Manual
307
Standard pTALK Functions
create (3pTALK)
yRadiusCorner determines the x- and y-radius of the corners, respectively. The arguments
fullName and name specifies the scope and the name of the new shape, respectively. To create an anonymous shape specify 0 in the name argument.
newAttribute() creates a new attribute as defined in the definition string. E.g.: newAttribute(“MyPicture”, “int myAttr = 45;”);
newFunction() creates a new function as defined in the definition string. E.g.: newFunction(“MyPicture”, “int myFunc(int x) { myAttr = x; }”);
newDialogue() creates a new dialogue as defined by the event and action strings. E.g.: newDialogue(“MyPicture”, “buttonPressed(0)“, “{ myFunc( 45 ); }”);
newPicture() creates an empty picture with the name specified. If name is empty a default
name NoName1 (increasing the number if several) will be given.
newProcess() creates an empty process with the name specified, located under the the application specified in the parameter ownerFullName.
newVariable() creates a variable in a process. The first argument is the fullName of the process. The rest of the arguments specified are the same as for the API function PfCreateVar()
and PfCreateArray(). The size field should be 0 to create a simple variable, and >= 1 to create
an array. Record name should be an empty string if not used.
newWindow() creates a new window in the application with the name windowName and
parent parentName. The initial position of the window is given by x and y. The window dimension is specified in the parameters width and height. These values must be non-negative.
A subwindow is created if the parentName contains the name of another window in the application. To create a top-level window specify the name of a display in the application as
the parentName.
newColour() creates a new colour either on the Application level or on the Library level. If
time is set the colour become private else it will be a shared colour on X when running with
pseudo-colour, i.e. with X using a colour lookup table.
The function newEnum() creates a new enumeration of a data type specified by the last argument dataType. The enumeration can be of any primitive data types inclusive character
strings, i.e. int, float, char* etc. The argument fullName is the owner's fullname and name is
the new name of the enumeration. If the enumeration was successfully created a pointer to
the object is returned and 0 otherwise.
The function newEnumElement() adds a new enumerator element to the enumeration. The
argument fullName must be a fullname of an enumeration. The argument name is the name
of the enumerator and value is the enumerator value. This value argument must match the
data type specified when the enumeration was created. It returns a pointer to the enumerator
if it was successfully created and 0 otherwise.
NOTES
The routines for instantiating new primitive shapes use RTM’s internal defaults for all attributes not given as argument. These attributes can be set prior to the creation by calling setPrimitiveAttr().
308
ProcSee Reference Manual
Standard pTALK Functions
create (3pTALK)
SEE ALSO
edit(3pTALK) in "ProcSee Reference Manual"on page 327
remove(3pTALK) in "ProcSee Reference Manual"on page 416
ProcSee Reference Manual
309
Standard pTALK Functions
Cursor (3pTALK)
NAME
Cursor - cursor functions
SYNOPSIS
void Window::setCursor( int cursor=-2 );
void Picture::setCursor( int cursor=-2 );
void Application::setCursor( int cursor=-2 );
void Application::defaultCursor( int cursor );
void Application::setCursorColours( int cursor, int foregroundColour,
int backgroundColour );
Cursor* Application::getCursor( int cursor, ::ResourceStyle* rs = 0 );
DESCRIPTION
The setCursor() function on the window and picture changes the cursor used by this window. This function would normally be called from a cursorMoved() dialogue, to display a
temporary cursor over specific areas in your pictures. The default value -2 means to change
to the cursor that the window normally would have displayed. The value -1 means to change
to the cursor that is set as the default cursor for the application.
The setCursor() function on the application changes the cursor used by all the windows displayed by the application. This can among other things be used to change to another cursor
when something time consuming is going on.
The defaultCursor() function changes the default cursor used by all the windows in the application that is set up to use the default cursor.
The setCursorColours() function changes the colours of the given cursor.
Application::getCursor() returns a pointer to the Cursor that is given as input argument.
Used to convert integer cursor index back to the Cursor it represents. An optional ResourceStyle can be given.
The cursor parameter is the index number of the cursor or the cursor name. The foregroundColour and backgroundColour parameters is the index number of the colours or the colour
names.
NOTES
It is not possible to make the cursor colours blink by setting the cursor colours to blink colours.
SEE ALSO
"Cursors" on page 56.
"Defining Cursors" in "ProcSee User’s Guide".
310
ProcSee Reference Manual
Standard pTALK Functions
debug (3pTALK)
NAME
debug - debugging functions and utilities
SYNOPSIS
void dumpSymbolTable();
void trace( int toggle, func = 0 );
DESCRIPTION
These debugging functions are of little or no use to ordinary users, but have proved useful
when tracking down bugs in the system.
dumpSymbolTable() prints the contents of RTM’s symboltable on the terminal.
trace() turns on (if toggle argument is non-zero) or off (if toggle argument is zero) the
Virtual Machine’s tracing capabilities. When tracing is enabled, top element of the Virtual
Machine’s CPU stack will be printed for each instruction that is executed.
The func argument is a pointer to a function, or a string containing the name of a function.
If the func argument is given, and toggle is 1, the RTM will turn on tracing when the function given is executed, and tracing will be set to its previous state when the function has
ended its execution.
ProcSee Reference Manual
311
Standard pTALK Functions
dialogue (3pTALK)
NAME
dialogue - dialogue functions
SYNOPSIS
char* getDialogueTrigger( Dialogue* d );
void setDialogueTrigger( Dialogue* d, char* trigger );
char* getDialogueAction( Dialogue* d );
void setDialogueAction( Dialogue* d, char* action );
void dialogueToFront( Dialogue* d, int skipElems=0x7FFFFFFF );
void dialogueToFront( Dialogue* d, Dialogue* d2, int skipElems=0 );
void dialogueToBack( Dialogue* d, int skipElems=0x7FFFFFFF );
void dialogueToBack( Dialogue* d, Dialogue* d2, int skipElems=0 );
DESCRIPTION
These dialogue functions are mainly used by the ProcSee editor GED. The Dialogue* arguments can be specified either as a pointer to a Dialogue, or as a fullName string.
The getDialogueTrigger() and getDialogueAction() functions returns the trigger or action
part of a dialogue. The setDialogueTrigger() and setDialogueAction() functions changes
the trigger or action part of a dialogue. The trigger argument must be a string that contains a
pTALK expression and this expression should call at least one of the trigger functions given
on page 333. The action argument must be a string that contains a pTALK statement, preferably a compound statement, ie. code surrounded by curly braces.
The dialogueToFront() and dialogueToBack() functions changes the order of the dialogue
list. If more than one dialogue trigger can be activated by the same event, the one closest to
the front will be executed. The d argument is the dialogue to move. If this is the only argument, the dialogue is moved to the front or back of the dialogue list. If the skipElems argument is given the dialogue is moved over this number of dialogues in the front or back
direction. If the d2 argument is specified, the dialogue d is moved in front of or behind the
d2 dialogue. If both d2 and skipElems are specified, the dialogue is first moved in relation
to d2, then the dialogue is moved the number in skipElems toward the front or back.
SEE ALSO
For trigger functions to use in a dialogue, see the event functions on page 333.
For creation of dialogues by pTALK, see the newDialogue() function on page 308.
312
ProcSee Reference Manual
Standard pTALK Functions
Display (3pTALK)
NAME
Display- defines a display surface where windows can be placed.
SYNOPSIS
char*
int
int
int
int
int
int
int
Display::connection;
Display::width;
Display::height;
Display::resizeMode;
Display::virtualX;
Display::virtualY;
Display::virtualWidth;
Display::virtualHeight;
DisplayInfo* Display::getDisplayInfo();
Display* Application::newDisplay( char* name, char* connection );
DESCRIPTION
The Display object represents a display surface where the ProcSee RTM can display its’
windows. The display surface can be a physical monitor, a virtual display, an area on a
display (virtual display area), etc. The purpose with the Display object is to better control
the size and position of the windows that the RTM uses for displaying its’ pictures. A
powerful feature which is provided by the Display object is the ability to scale the display
coordinate system to new monitor sizes. If the application was initially designed to fit the
display resolution 1280x1024, it can easily be adapted to 1024x768 or any other display
resolution for that matter. Another feature provided by the Display class is the ability to
move the entire application from one display to another just by making one simple modification to the Display object.
The Display object provides a set of attributes which can be changed programmatically
from the pTALK language. Notice that the changes will not take effect before the global
pTALK function update() is run.
The Display object is a resource, just like the meta-classes Window, Colour, Font, etc.
All Window objects in ProcSee are associated with a Display object. The Window class
attribute parent must specify a Display object if the Window instance isn’t a child window or a group window.
The attributes width and height specifies the width and the height of the display in pixels,
respectively. By default these attributes are set to the actual display size when the Display
object is created. It is important that these attributes are set to the size of the display the
application was designed for. Note that these attributes have an effect only when the resizeMode attribute is set or when the virtual display area attributes are set.
The resizeMode attribute controls whether the Display object is automatically rescaled
to fit the display or maintain its’ original size independent of the display size. Setting the
resizeMode attribute to the value 0 means no resizing. To resize the Display object and
ProcSee Reference Manual
313
Standard pTALK Functions
Display (3pTALK)
maintain the aspect ratio, set this attribute to the value 2. Setting this attribute to the value 1
means resize the Display object to fit the entire display area, even if it means that the aspect
ratio becomes different from the design aspect ratio.
In resizeMode 2, the default is that the Display object is anchored to the centre of the display.
Use the enum AnchorStyle constants to change where the Display object is anchored, i.e.
left, centre, top, right or bottom position of the display surface. To change the Display object’s default anchor position set this attribute equal to the value 2, and perform a bitwise or
combination of this value and the enum AnchorStyle constants. This attribute does not have
any effect on the Display object unless the attributes width and height are set.
The attributes virtualX, virtualY, virtualWidth and virtualHeight define an area on a display surface. This area can be smaller or larger than the physical size of the display. This is
called a virtual display area in ProcSee. The area where the ProcSee RTM is allowed to display its’ pictures can be controlled with these attributes. An example of this usage is a multidisplay ProcSee application where each display is associated with a Display object. It is easy
to allow this type of ProcSee application to be displayed on a laptop with a single monitor
just by modifying the Display object’s virtual display area and connection attribute. Another example where the virtual display area attributes are used is when a Display object should
automatically be adjusted to a ProcSee window. This functionality is useful when an application should be rescaled when the application’s top-level window is resized or moved. This
functionality is provided in the Window class member function adjustVirtualDisplay().
Note that virtual display area attributes doesn’t have any effect unless the attributes width
and height are set.
The attribute connection is the name of the display device. For more information and a description of this attribute, see the description of the pTALK function newDisplay().
The function getDisplayInfo() returns the DisplayInfo associated with the Display instance.
A null pointer is returned if the function fails to get a DisplayInfo.
The Application member function newDisplay() creates a new Display object. The first argument is the name of the Display object. The second argument connection is the name of
the display device to open a connection to. To open a connection to a specific display, use
the DisplayInfoSet class to return the qualified name of the display. The connection string
is composed of a scheme name, followed by a colon character and a connection device string.
For the time being, ProcSee only supports the WIN and the X schemes. ProcSee will support
other schemes as well in the future. If the connection string is empty, the default is WIN: on
Microsoft Windows operating systems, and X: on Linux/Unix systems running X-Windows.
Specify an empty string to open a connection on the primary display on Microsoft Windows
platforms. Examples of connection strings on Windows are “WIN:1”, “WIN:2”, etc. Notice
that the connection string “WIN:0” has a special meaning. In a multi-display setup, “WIN:0”
means: open a connection to the entire desktop, i.e. the virtual display (all monitors). The
numbering of the displays on Windows are assuming that the display monitors are placed in
one or more rows. The leftmost display monitor in the upper row will be "WIN:1". The mon-
314
ProcSee Reference Manual
Standard pTALK Functions
Display (3pTALK)
itors in the row is counted from left to right. The rows will be counted from top to bottom,
see example below. Note that this doesn’t always correspond with the number displayed
by the screen resolution setting in the Windows control panel.
WIN:3
WIN:1
WIN:2
WIN:4
WIN:5
WIN:6
On Linux/Unix operating systems running X-Windows the connection string is the name
of the hardware display screen, like “X:gandalf:0.0”, “X::0.0”, etc. After the scheme
name X: the host name is specified. In the previous examples the host names are gandalf
and the current machine (empty string), respectively. The syntax of the device string is as
follows [host]:[number].[screen number], where host is the machine name, number is the
display on that machine, and screen number is the screen to use on that machine. If an
empty string is specified the display is opened on the device where the DISPLAY environment variable is pointing, or the local host if not specified.
It is possible to specify several display devices with the connection string attribute. Use
the semicolon character ';' to separate the display device entries. For instance, the string
"WIN:1;X::0.1;" defines two display device entries. WIN: will be used on the Windows
platforms, while X: will be used on Unix/Linux platforms running X-Windows. Notice
that the RTM will try each entry from the connection attribute string until successful. Inserting a semicolon at the very end of the connection attribute string ensures that the display-object will open on the computer's default display if all other items fail.
SEE ALSO
DisplayInfo in "ProcSee Reference Manual"on page 316
DisplayInfoSet in "ProcSee Reference Manual"on page 318
ProcSee Reference Manual
315
Standard pTALK Functions
DisplayInfo (3pTALK)
NAME
DisplayInfo- Returns properties and capabilities supported by a display.
SYNOPSIS
Rect*
Rect*
int
int
char*
DisplayInfo::displayArea();
DisplayInfo::workArea();
DisplayInfo::isPrimary();
DisplayInfo::getCapability( char* capability, any* arg1, … );
DisplayInfo::connection();
DESCRIPTION
The DisplayInfo class provides methods which return properties and capabilities supported
by a display. Examples are the display’s display area and work area.
The function displayArea() returns a Rect object initialized with the display’s viewable area
in pixels. On X-Windows the x and y attributes are always set to the value 0.
The function workArea() returns a Rect object initialized with the display’s work area in
pixels, i.e. the area on the display which can be used by client applications. This is the display’s viewable area minus the area of some stay-on-top windows controlled by the window
manager, like the Windows taskbar, or the Gnome panel.
isPrimary() returns true (1) if the display is the primary display, otherwise false (0).
connection() returns the name of the connection string, like “WIN:1”, “X::0.0”, "X:gandalf:0.0", etc.
The functionality provided by the getCapability() function is device dependent. The first argument capability is the name of the capability supported by the display. If the capability
isn’t supported false (0) is returned, otherwise true (1). Always check the return value before
using the result of this function. The number of, and the type of arguments depends entirely
on the kind of capability requested. Notice that the getCapability() function returns the result in the arguments following the capability name. These arguments must be specified with
the address operator which yields the pointer to the operands, like getCapability( “resolution”, &resolution ). The arguments are left as is if the capability isn’t supported by the display.
Some of the capabilities which can be requested from the DisplayInfo object accept one, two
or three arguments. An example is the “resolution” capability. The diagonal size in pixels is
returned if one argument is specified. The width and the height in pixels are returned if two
arguments are specified. If three arguments are specified, the first two arguments are the
width and the height, while the diagonal size is specified in the third argument.
On Microsoft Windows platforms the capabilities supported by the virtual display (WIN:0)
are only a subset of the capabilities supported by the other displays. For instance, it is not
possible and it makes no sense to get the name of the physical monitor from a virtual display.
Notice that the last column in the following table tells whether the capability is supported by
the virtual display or not.
316
ProcSee Reference Manual
Standard pTALK Functions
DisplayInfo (3pTALK)
The following table is the capabilities supported by the Microsoft Windows operating systems:
Table 3:
Arguments
Virtual
Display
Capabiltiy
Description
resolution
The size and diagonal resolution in pixels
See description of the inch
capability arguments.
*
depthsys
Number of colour planes.
Integer
*
inch
The size of the physical
monitor in inches. This
functionality is not supported by older monitors.
1, 2 or 3 arguments.
One arg: diagonal size.
Two args: width and height.
Three args: width, height and
diagonal size.
Accepts integers and reals.
cm
See description of inch. The
result is in centimetres.
mm
See description of inch. The
result is in millimetres.
name
The name of the monitor.
char*
The following table is the capabilities supported by X-Windows on Linux/Unix operating
systems:
Table 4:
Capabiltiy
Description
Arguments
resolution
The size and diagonal resolution in pixels
1, 2 or 3 arguments.
One arg: diagonal size.
Two args: width and height.
Three args: width, height and diagonal
size.
Accepts integers and reals.
depth
Number of colour planes.
Integer
SEE ALSO
Display in "ProcSee Reference Manual"on page 313
DisplayInfoSet in "ProcSee Reference Manual"on page 318
ProcSee Reference Manual
317
Standard pTALK Functions
DisplayInfoSet (3pTALK)
NAME
DisplayInfoSet- Stores a collection of DisplayInfo data objects.
SYNOPSIS
int
DisplayInfoSet::numDisplays();
DisplayInfo* DisplayInfoSet::display( int index );
static DisplayInfoSet* DisplayInfoSet::get( char* connection );
DESCRIPTION
The DisplayInfoSet stores a collection of DisplayInfo data objects.
The method numDisplays() returns the number of DisplayInfo objects in the collection. Use
this upper bound when iterating through the DisplayInfo objects.
display() returns the DisplayInfo at the given index. A null pointer is returned if the index
is out of the legal bounds (legal index values are; 0 <= index < numDisplays()).
The static method get() returns a DisplayInfoSet object based on the information passed in
the connection string. Information about all displays are stored in this set if the connection
string "*" (asterisk) is specified, i.e. it means match all displays. Notice, the virtual display
is stored at index 0 when the connection string is "*" on the Microsoft Windows platforms.
To get the default display specify an empty string. For more information how to specify the
connection string, see page 313. A null pointer is returned if the specified display device
doesn’t exist.
SEE ALSO
Display in "ProcSee Reference Manual"on page 313
DisplayInfo in "ProcSee Reference Manual"on page 316
318
ProcSee Reference Manual
Standard pTALK Functions
DnDSource (3pTALK)
NAME
DnDSource – source of a drag and drop operation.
SYNOPSIS
// Member functions:
int DnDSource::drag( char* action = "copy", int n = 0 );
void DnDSource::setBitmap( any bitmap,
int xOffset,
int yOffset,
int transparentColour );
void DnDSource::setBitmap( char* bitmapFile,
int xOffset,
int yOffset,
int r = -1,
int g = -1,
int b = -1 );
int DnDSource::setCursor( ::Cursor* cursor,
char* type = "none | copy | "
"move | link" );
int DnDSource::setData( any data, char* typeName = 0 );
// Global functions:
DnDSource* ::dndSource();
DESCRIPTION
The ProcSee class DnDSource is used as a data source when starting a drag and drop operation. When using drag and drop, user defined data can be transferred between different
applications, within the same application or in its simplest form within shapes in the same
picture.
All drag and drop operations start in the action part of a dndBegin() dialogue trigger.
There are two different ways to start a drag operation, either by using the global function
dndSimpleDrag(…) or by using an object of class type DnDSource. See page 325 for
more information about dndSimpleDrag(…).
To start a drag operation a DnDSource pointer must be obtained either from the dialogue
trigger dndBegin() or the global function dndSource(). These calls will fail if used outside the body of the action part of dndBegin(). The DnDSource class has methods which
can customise the drag operation as opposed to dndSimpleDrag(…). One of the features
only available in the DnDSource class is the ability to use an image while dragging.
In this version of ProcSee only plain text is supported for the drag and drop operation. The
plain text can have different meaning when added to the drag source. This is accomplished
by something called type names. The type name is specified in the last argument to setData(…). To exchange information through drag and drop both the drag source and drop
target must conform to the same protocol, i.e. they must use the same type name. Sending
for example data like “RECTANGLE 10, 10, 32, 3, 23” has no meaning if dropped in a
text editor. In this example a type name like “SHAPE_INFO” would have been much better. Data sent by the drag source which must be interpreted by the drop target should not
be sent using default type name. Avoid using default type name if the target must interpret
ProcSee Reference Manual
319
Standard pTALK Functions
DnDSource (3pTALK)
the data. Information that everybody can read and understand should always be sent using
default type name (in Windows, CF_TEXT). New clipboard formats like bitmap, filename,
etc. will probably be implemented in future versions of ProcSee.
The function setData(…) puts data into the drag source data object. The first argument to
this function is the data and the second is the type name. For a detailed description of type
name, see previous paragraph. It is possible to put different data with different type names
into the drag source data object. It is up to the drop target to decide the most appropriate data
to use based on the type name. If the example in the previous paragraph is continued assuming that the setData(…) function is called with “SHAPE_INFO” and plain text as type
names. It is very likely that plain text would have been copied if the data was dropped in a
text editor. It is likely that “SHAPE_INFO” would be requested if the same operation was
performed dropping the same data in a ProcSee picture. Plain text could also have been requested in the last example, it is up to the drop target to decide what kind of data to use when
the drag source offers several data types. It all depends on the drop target. Notice that successive calls to the setData(…) function will delete the old data when the same type names
are used.
The DnDSource is responsible for generating the visual feedback to the end user. In ProcSee
it is possible to control both the visual cursor and a semi-transparent image which can be used
during the drag and drop operation.
The function setCursor(…) is used to control the cursors used during the drag operation.
The first argument to this function is a pointer to a ProcSee cursor. Individual cursors can be
set for different drag effects. The second and last argument controls this behavior. The default is “copy | move | link | none”, meaning that a call to this function using the default argument will change cursors for all drag effects. The cursors must be set before the drag
operation starts, cursor Ca can for example be set when using “copy”, cursor Cb when using
“move” etc.
The function setBitmap(…) controls the semi-transparent image used during a drag and drop
operation. The arguments xOffset and yOffset specifies the offset from the upper left corner
of the image in relation to the mouse cursor. The function setBitmap( any bitmap, int xOffset, int yOffset, int transparentColour ) creates an image of the shape, which is specified
in the first argument bitmap. The argument must be a shape pointer. The last argument transparentColour is a ProcSee colour index and it defines the transparency colour used by the
image. The function setBitmap( char* bitmapFile, int xOffset, int yOffset, int r = -1, int
g = -1, int b = -1 ) reads the image to use during the drag operation from file. The first argument bitmapFile is the name of the image file. The last argument r,g,b defines the transparency colour used by the image. Notice that show window contents while dragging must be
enabled in Windows to be able to use an image during a drag and drop operation.
The function drag(…) starts the drag and drop operation. Calling this function will start a
modal drag and drop loop. It will not return from this function till the drag operation ends.
The first argument action is the actions the source allows the drag operation to have. The following are legal actions: copy, move or link. The default is copy. If several actions are applied it is up to the drop target to request an action. The visual cursor will by default change
when different drag effects are used. The drag and drop effects are controlled with the mouse,
the shift key and the control key. Move is default when neither the shift key nor the control
key is down. Copy cursor is default when the control key is down, while the link cursor is
default when both the shift key and the control key are down. This function returns the drop
320
ProcSee Reference Manual
Standard pTALK Functions
DnDSource (3pTALK)
effect the target applied in the action part of the dndDrop() dialogue trigger. The return
value is set either using the function setDropEffect(…) on the DnDTarget object or the
function dndSimpleDrop(…).
EXAMPLES
dialogue
{
event = `dndBegin(0)`;
action = `{
DnDSource* s = dndSource();
s->setBitmap( (Shape@fullName()), 10, 10, black );
s->setData( "RECTANGLE 10, 10, 32, 32", "SHAPE_INFO" );
s->setData( "Dragging a RECTANGLE" );
s->drag( "copy" );
}`;
...
}
SE ALSO
DnDTarget, dndBegin
ProcSee Reference Manual
321
Standard pTALK Functions
DnDTarget (3pTALK)
NAME
DnDTarget – target of a drag and drop operation.
SYNOPSIS
// Member functions
int DnDTarget::getData( any* data, char* typeName = 0 );
char* DnDTarget::getDropEffect();
void DnDTarget::setDropEffect( char* dropEffect );
int DnDTarget::isLeftMouseButtonDown();
int DnDTarget::isMiddleMouseButtonDown();
int DnDTarget::isRightMouseButtonDown();
int DnDTarget::isAltDown();
int DnDTarget::isControlDown();
int DnDTarget::isShiftDown();
int DnDTarget::isCopy();
int DnDTarget::isLink();
int DnDTarget::isMove();
// Global functions
DnDTarget* dndTarget();
DESCRIPTION
The class DnDTarget provides a communication mechanism between a drag source, DnDSource, and a drop target. It handles the receiving portion of the drag and drop operation,
that is functionality for accepting data through the drag and drop protocol. It also provides
functionality for requesting status information during a drag and drop operation, like the status of the mouse buttons, the keyboard keys, etc. The drop target can also modify the visual
appearance of the cursor for instance when the target does not accept the data the source has
put on the data object.
Objects of the class DnDTarget can only be requested in the action part of one of the dialogue triggers dndDrop(), dndEnter(), dndLeave() or dndMotion(). For more information
about these dialogue triggers, see page 333. Notice that the DnDTarget object is undefined
outside the body of these triggers. To get a drop target object of type DnDTarget use either
one of the dialogue triggers, dndDrop(), dndEnter(), dndLeave(), dndMotion() or the
global function dndTarget(). Each of these functions return a pointer to a DnDTarget object.
A simpler variant of the drop target functionality is provided by the global function dndSimpleDrop(…). For more information see page 325.
To get the data set by the drag source use the function getData( … ). This function returns
true if the requested type name is available on the drag source, otherwise false. For more information about type names, see page 319. If not specified the last argument typeName has
a default value. The type name will by default be plain text if for instance the first argument
data is a character string. Notice that a pointer to a variable or attribute must be passed in the
first argument to the getData(…) function.
322
ProcSee Reference Manual
Standard pTALK Functions
DnDTarget (3pTALK)
The function getDropEffect() returns the drop effect for the current drag and drop operation. The drop effect is set on the drag source using either the function dndSimpleDrag(…) or the function setDropEffect(…) in the class DnDSource. For more
information, see page 325 and page 319.
The function setDropEffect(…) modifies current drop effect. The drop effects which can
be changed are copy, move, link or none. To set for instance copy or move call this function with the argument “copy | move”. When the drop effect is modified the visual appearance of the cursor will be changed to better reflect the drop effect in current drop zone.
The drop effect should be set to none if the drop target does not accept the drag and drop
data provided by the data source. The cursor will then immediately change indicating that
the drop zone is not an active drop target for the data. Notice that it is not possible to set
a drop effect to a value unsupported by the source. It will fail if the target tries to change
the drop effect to move if for example the source only supports copy. The drop effect set
in the action part of dndDrop() will be the return value from the functions dndSimpleDrag(…) or the DnDSource object function drag(…).
The functions isLeftMouseButtonDown(), isMiddleMouseButtonDown() and isRightMouseButtonDown() returns true when the respective left, middle and right mouse button is down.
The functions isAltDown(), isControlDown() and isShiftDown() returns true when the
respective alt, ctrl and key shift key is down.
The functions isCopy(), isLink() and isMove() returns true when the drag source supports
copy, link or move, respectively.
EXAMPLE
dialogue
{
event = ВґdndEnter()Вґ;
action = Вґ{
DnDTarget* t = dndTarget();
// Only copy is supported by the target
if ( !t->isCopy() )
t->setDropEffect( "none" );
}Вґ;
}
dialogue
{
event = ВґdndDrop()Вґ;
action = Вґ{
DnDTarget* t = dndTarget();
char* data;
if ( t->getData( &data ) )
printf( "Dropped data \"%s\"", data );
else
ProcSee Reference Manual
323
Standard pTALK Functions
DnDTarget (3pTALK)
printf( "Unsupported data type" );
}Вґ;
}
SEE ALSO
DnDSource, dndEnter, dndLeave, dndMotion, dndDrop, dndSimpleDrop, dndSimpleDrag
324
ProcSee Reference Manual
Standard pTALK Functions
Drag’n’Drop (3pTALK)
NAME
Drag’n’Drop - drag and drop functions
SYNOPSIS
void Picture::dndActivate( char* dropEffect = "copy" );
void Picture::dndDeactivate();
void Shape::dndActivate( char* dropEffect = "copy" );
void Shape::dndDeactivate();
int dndSimpleDrag( any data,
char* action = "copy",
char* typeName = 0 );
int dndSimpleDrop( any* data,
char* dropEffect = "copy",
char* typeName = 0 );
DESCRIPTION
The functions Picture::dndActivate(…) and Shape::dndActivate(…) activates a drop
zone. The argument to these functions is the drop effect. The following drop effects are
available: copy, move, link or none. The default for this argument is copy. When setting
for example copy or move as the drop effect, use the string “copy | move” as argument to
these functions. The entire picture will become an active drop zone when calling Picture::dndActivate(…). Calling Shape::dndActivate(…) will activate only the drop
zone for the shape. Notice that individual shapes can have different drop effects. Some
shapes only accept copy operations while others only accept link or move or a combination. These functions are rarely used because functionality is provided in the graphics editor GED to activate and deactivate drop zones. The dialogue triggers dndEnter(),
dndLeave(), dndMotion() and dndDrop() will not work unless the picture or shape is
enabled as an active drop zone.
To deactivate an active drop zone use the functions Picture::dndDeactivate() or
Shape::dndDeactivate().
The function dndSimpleDrag( … ) starts a new drag and drop operation. This function
is only applicable within the action part of the dndBegin(…) dialogue trigger. It will fail
if used outside the body of this event function. The first argument data is the data to put
onto the drag source object. The second argument action is the actions provided by the
source. The following actions are available, copy, move or link. If the source supports both
copying and moving of data, use “copy | move”. This argument has a default value which
is copy. The last argument is typeName. The type name allows the data source to add data
with different meaning onto the drag source object. For more information about type
name, see page 319. Returns true on success, otherwise false.
The function dndSimpleDrop(…) gets the data available from a drag and drop operation.
This function is applicable and should only be used within the action part of the dialogue
trigger dndDrop(). It returns true if the data was successfully converted and returned in
the first argument data, otherwise false. Notice that the first argument is a pointer to the
data. The second argument dropEffect is used to modify current drop effect. It can be set
ProcSee Reference Manual
325
Standard pTALK Functions
Drag’n’Drop (3pTALK)
to any of the values copy, move, link, none or a combination of these. The last argument is
typeName. This argument must match the drag source type name set either by dndSimpleDrag(…), DnDSource::setData(…) or another drag source. For more information about
type names, see page 319 or page 325.
SEE ALSO
DnDSource, DnDTarget
326
ProcSee Reference Manual
Standard pTALK Functions
edit (3pTALK)
NAME
edit - functions to manipulate the currently selected picture elements in edit mode
SYNOPSIS
void Picture::copy();
void Picture::cut();
void Picture::clear()
void Picture::paste();
void Window::paste();
void Picture::toFront();
void Picture::toBack();
void Picture::group();
void Picture::ungroup();
void Picture::align( int alignment );
void Picture::distribute( int distribution );
void Picture::setPrimitiveAttr( int attribute, int value );
void Picture::setDynPrimitiveAttr( int attribute, char* value );
int Picture::getPrimitiveAttr( int attribute );
char* Picture::getDynPrimitiveAttr( int attribute );
int Picture::numberOfSelected();
DESCRIPTION
All these functions manipulate on the current selection. If no objects are selected, they do
nothing at all.
copy() copies the currently selected objects to the clipboard. cut() removes the currently
selected objects and puts a copy of them on the clipboard. paste() is a member function
of both Window and Picture. paste() copies the objects currently on the clipboard into the
picture from which it was called. The new objects becomes the current selection. If no objects are present on the clipboard, paste() does nothing at all. clear() removes the currently selected objects from the picture.
toFront() moves the currently selected objects to the front of the shape stacking order in
the picture. toBack() moves the currently selected objects to the back of the shape stacking order.
group() groups the currently selected objects into a group shape and that group shape becomes the new current selection. If the original selection contains less than two objects,
group() does nothing. ungroup() explodes all groups in the current selection, i.e. the
group shapes are removed and their contents becomes part of the current selection.
align() aligns the currently selected objects vertically and/or horizontally. The argument
alignment can have the following values:
argument
name
comment
0
alignNone
do nothing
1
alignLeft
all objects will have the same left border position
ProcSee Reference Manual
327
Standard pTALK Functions
argument
edit (3pTALK)
name
comment
2
alignRight
all objects will have the same right border position
3
alignTop
all objects will have the same top border position
4
alignBottom
all objects will have the same bottom border position
5
alignCentre
all objects will be centred both in x and y direction
6
alignHCentre
all objects will be centred to the same x position
7
alignVCentre
all objects will be centred to the same y position
distribute() distributes the objects evenly in the vertical or horizontal direction. The argument distribution can have the following values:
argument
name
comment
0
distributeNone
do nothing
1
distributeEquidistant
not implemented
2
distributeSpaced
not implemented
3
distributeHCentre
distribute centre positions evenly horizontally
4
distributeVCentre
distribute centre positions evenly vertically
5
distributeHEdge
adjust horizontally to equal spacing between
6
distributeVEdge
adjust vertically to equal spacing between
setPrimitiveAttr() sets the primitive attribute given as argument to the value given as argument for all currently selected objects. setDynPrimitiveAttr() set the primitive attribute given as argument to the dynamic value given as argument for all currently selected objects. The
value is a character string, and is parsed as an expression in the function language. getPrimitiveAttr() returns the value of the primitive attribute given as argument for the last (most in
front) of the currently selected objects. If this attribute has a dynamic binding, the return value is undefined. setDynPrimitiveAttr() returns the dynamic value of the primitive attribute
given as argument for the last (most in front) of the currently selected objects. The return value is the function language source code of the dynamic expression, or an empty string if the
attribute is not dynamic.
328
ProcSee Reference Manual
Standard pTALK Functions
edit (3pTALK)
If no objects is currently selected, then setPrimitiveAttr(), getPrimitiveAttr(), setDynPrimitiveAttr(), and getDynPrimitiveAttr() set/get RTM’s internal defaults for the
attribute. These internal defaults are used when new objects are instantiated from the
function language, for example by newRectangle(). The attribute codes used as argument
are given in the table below (they are also found in the include file <AttrCodes.h>:
code
name
0
PaVisibility
6
PaXcoord
7
PaYcoord
8
PaForegroundColour
9
PaBackgroundColour
10
PaPattern
11
PaLineWidth
12
PaForegroundFillColour
13
PaBackgroundFillColour
14
PaFillPattern
15
PaWidth, PaRadius, PaXradius
16
PaHeight, PaYradius
17
PaStartAngle, PaFont
18
PaOpeningAngle
numberOfSelected() returns the number of selected objects, zero if no objects are currently selected.
SEE ALSO
create(3pTALK) in "ProcSee Reference Manual"on page 306
Picture(3pTALK) in "ProcSee Reference Manual"on page 395
Window(3pTALK) in "ProcSee Reference Manual"on page 488
ProcSee Reference Manual
329
Standard pTALK Functions
editWindow (3pTALK)
NAME
editWindow - set a picture in edit mode.
SYNOPSIS
void editWindow(char * windowName, int editState, char * optName, int optData = 0);
DESCRIPTION
The editWindow() function is used to change the edit mode of a picture displayed in the window windowName. This function is mainly intended for use in editor applications.
Pictures have the following editStates:
0 normal mode. (Called test mode in the ProcSee Editor).
1 select mode. Used for interactive selection and moving of shapes.
ShapeClassId draw mode. Used for interactive drawing of shapes.
ShapeClassId can be one of the following constants:
pCirArcClass, pEllArcClass, pCircleClass, pEllipseClass, pDiaAreaClass, pImageClass,
pLineClass, pPolygonClass, pRectangleClass, pTextClass, pInstanceClass, pTrendClass,
pComShapeClass, pScaleClass, pRoundRectClass.
These constants are found in the file $PROCSEE_DIR/include/P3ShapeClassId.h.
If editState is pInstanceClass the optName parameter holds the name of the class to instantiate. If editState is pImageClass, the optName holds the file name of the imagefile. If editState are pEllArcClass or pCirArcClass the optName holds the string "chord" or the string
"slice", which makes the arcs of the requested type. If editState is pComShapeClass, optName is the ComClass to instantiate. In all other cases the optName parameter should be the
empty string "".
The optional parameter optData can have the following values, ored together:
• 0x0100 Use the cursors defined in the application, instead of the default edit cursors.
When editState is pComShapeClass, the following values can also be used:
• 0x0001 Give the comShape a name automatically.
• 0x0002 Use the RTM internal default colours and font (set with setPrimitiveAttr()) when
creating the comShape, instead of the comShape defaults.
When the picture is in a draw mode, it waits for the end user to press the left button to place
a shape in the picture. Some shapes have a rubber band that is used for the interactive drawing of the shape. More information of how this drawing is performed, are presented in the
ProcSee Users Guide.
330
ProcSee Reference Manual
Standard pTALK Functions
editWindow (3pTALK)
EXAMPLES
editWindow("myWindow", 1, ""); // Make selection and moving available
editWindow("myWindow", 631, "slice"); // Interactive drawing of elliptic arc slices.
editWindow("myWindow", 0, ""); // Set the picture into normal mode.
SE ALSO
PfGetWindowChanges(3C) in "ProcSee Reference Manual"on page 214
ProcSee Reference Manual
331
Standard pTALK Functions
environment (3pTALK)
NAME
environment - functions for getting and setting environment variables.
SYNOPSIS
char* getenv( char* name );
int
putenv( char* name, char* value );
DESCRIPTION
getenv() searches the environment list for a string of the form name=value, and returns a
pointer to the string value if such a string is present. Otherwise, getenv() returns an empty
string.
putenv() adds or changes an environment variable. The arguments are the name of the environment variable (name) and the value (value). The function returns 1 if the environment
variable was successfully added/changed, otherwise 0.
NOTES
Unlike its C-code equivalent, ProcSee getenv() returns an empty string (and not a NULL
pointer) if the environment variable doesn’t exist.
332
ProcSee Reference Manual
Standard pTALK Functions
event (3pTALK)
NAME
event - event handling functions used in dialogues
SYNOPSIS
// event trigger routines:
int
buttonPressed( int button );
int
buttonReleased( int button );
int
buttonDoubleClicked( int button );
int
buttonTripleClicked( int button );
int
buttonRepeated( int button );
int
keyPressed( int key );
int
keyReleased( int key );
int
cursorMoved();
int
mouseWheel();
int
shapeEntered();
int
shapeLeft();
int
viewableStateChanged( int mask = -1 );
int
windowClose();
Window*
windowEntered();
Window*
windowLeft();
Window*
windowMoved();
Window*
windowResized();
Window*
windowMapped();
Window*
windowUnmapped();
Shape*
focusLost();
// Obsolete, use lostKeyFocus()
Shape*
gotKeyFocus();
Shape*
lostKeyFocus();
Shape*
trendUpdated();
Shape*
limitsChanged();
Picture*
pictureDisplayed();
Picture*
pictureUndisplayed();
Picture*
beforePictureUpdate();
Picture*
afterPictureUpdate();
DnDSource* dndBegin( int button );
DnDTarget* dndDrop();
DnDTarget* dndEnter();
DnDTarget* dndLeave();
DnDTarget* dndMotion();
// event status routines:
int
buttonIsDown( int button );
int
shiftIsDown();
int
controlIsDown();
int
altIsDown();
int
metaIsDown();
float
cursorX();
float
cursorY();
float
Shape::shapeCursorX( char* flags=0 );
float
Shape::shapeCursorY( char* flags=0 );
Picture*
eventPicture();
Picture*
lastSelectionPicture();
ProcSee Reference Manual
333
Standard pTALK Functions
// misc:
void
void
void
void
void
event (3pTALK)
ungrabPointer( int mode );
Window::postKeyEvent( int keyCode, int keyEvents );
Picture::postKeyEvent( int keyCode, int keyEvents );
Window::postMouseButtonEvent( int buttonNo, int buttonEvents );
Picture::postMouseButtonEvent( int buttonNo, int buttonEvents );
DESCRIPTION
These functions are typically used in the trigger and action part of dialogues. They come in
three categories as illustrated in the above listing. The event trigger routines should be used
in the trigger part of the dialogue. In fact, there should always be at least one call to a trigger
routine in a dialogue trigger! The event status routines all return various information concerning the last event that occurred in the system.
X-Windows numbers mouse buttons from 1 to 5; on a three button mouse the numbers 1 to
3 corresponds to the left, middle and right button respectively.
X-Windows uses so-called keysyms to index keyboard characters. For normal printable characters, these keysyms corresponds to ASCII values. For special characters like function keys,
the keysym values typically is in the range 0xff00 to 0xffff. The X-Windows utility program
xev(1) can be used to find the keysym value corresponding to a given keyboard character.
A zero argument to the event functions can be thought of as the value “ANY”, while a zero
return value can be thought of as the value “NONE”.
buttonPressed() takes one argument button, which corresponds to an X-Window button
number. If button is non-zero, buttonPressed() returns the value of button if the given
mouse button was pressed, zero otherwise. If button is zero, buttonPressed() returns zero if
no mouse button was pressed, otherwise it returns the number of the pressed button.
buttonReleased() behaves identically with buttonPressed() except for that it tests for the
release of mouse buttons.
buttonDoubleClicked() and buttonTripleClicked() behave identically with buttonPressed() except for that they test for mouse double/triple clicks.
buttonRepeated() tests for button events that are repeated. When a mouse button has been
kept down for a certain period of time (called AutoRepeatDelay), the system will start to generate repeated events. These events are generated at a certain time interval (called
AutoRepeatInterval) until a button is pressed or released, or until ungrabPointer() is called.
The button argument is similar to that of buttonPressed().
keyPressed() takes one argument key, which corresponds to an X-Window keysym value. If
key is non-zero, keyPressed() returns the value of key if the given keyboard character was
pressed, zero otherwise. If key is zero, keyPressed() returns zero if no keyboard character
was pressed, otherwise it returns the keysym number of the pressed key.
keyReleased() behaves identically with keyPressed() except for that it tests for the release
of keyboard characters.
cursorMoved() returns true if the cursor was moved, false otherwise.
334
ProcSee Reference Manual
Standard pTALK Functions
event (3pTALK)
The mouseWheel() dialogue trigger returns a value different from 0 when the mouse
wheel is rolled, 0 otherwise. Rolling the wheel towards you returns a value <0, rolling the
wheel in the opposite direction return a value >0. By rolling the mouse slowly the dialogue will be triggered repeatedly with values of +/- 1, rolling faster may return larger values.
shapeEntered() returns true when a shape is entered, shapeLeft() returns true when a
shape is left. These functions are based on a shape hierarchy where some shapes are children of other shapes. Typically an instance is a shape that have children shapes. shapeEntered() returns true when the mouse pointer is moved into a shape or any of its children
shapes, otherwise it returns false. shapeLeft() returns true when the mouse is moved out
of a shape. This applies to all descendent shapes. Note that overlapping shapes often do
not have a parent/children relationship.
The viewableStateChanged() dialogue trigger returns a bit-mask with the bits set that has
changed in the viewableState of a shape. The optional mask argument is anded with the
result. The returned bit-mask is composed of the bits from the ViewableState enumeration. The returned bits contains changes in the mapped and displayed state of the picture,
in addition to the visibility state of the shape calculated from the visibility of the shape
itself and the visibility of its parent shapes. This dialogue trigger is called when the RTM
becomes idle, a short time after a picture is displayed/undisplayed, a window is mapped/
unmapped, or visibility attributes are changed. See also the Shape::getViewableState()
function on page 433. An example of use is:
dialogue
{
event = �viewableStateChanged( ViewableState.viewable )�;
action = �{
if ( getViewableState( ViewableState.viewable ) )
printf( "shape is viewable" );
else
printf( "shape is not viewable" );
}�;
}
windowClose() returns true if closing the window from the window frame. This trigger
works only in dialogues immediately under pictures.
If the cursor is moved into a window, then windowEntered() returns a pointer to that window, otherwise it returns 0. If the cursor is moved out of a window, then windowLeft()
returns a pointer to that window, otherwise it returns 0. These functions only works in dialogues immediately under pictures.
windowMoved() returns a pointer to the window that has been moved, otherwise 0.
windowResized() returns a pointer to the window that has been resized, otherwise 0.
windowMapped() returns a pointer to the window that has been mapped.
windowUnmapped() returns a pointer to the window that has been unmapped.
These window event triggers only works in dialogues immediately under pictures.
ProcSee Reference Manual
335
Standard pTALK Functions
event (3pTALK)
The routine focusLost() is only valid for Text shapes. Note that this dialogue trigger is obsolete. Use insead the event function lostKeyFocus(). The return value is a pointer to the text
shape about to loose its focus, otherwise 0. Only one text shape can be in edit mode in a picture. All keyboard input will be directed to this text shape. When setting another text shape
in edit mode the text shape currently in edit mode will loose its focus. Typically an action
part of this trigger function will be to save or discard the text buffer.
The event function gotKeyFocus() returns a pointer to the shape receiving the key focus. Notice that all keyboard input will be directed to the shape having the key focus. When a shape
receives the key focus, a lostKeyFocus() event will be sent to the shape about to loose the
key focus.
The event function lostKeyFocus() returns a pointer to the shape which has lost the key focus. This event is raised either when calling the pTALK function Shape::setKeyFocus(), or
when the key focus is changed automatically, for instance if a Text shape is set to edit mode.
trendUpdated() returns a pointer to a Trend shape after it has updated the trend diagram
based on the data received from the trend logger, otherwise 0. The purpose with this function
is to update other parts of the picture if these parts depends on the new trend data. This problem can only arise when using an external trend logger because the update() will be executed
before the trend data is received.
limitsChanged() returns a pointer to a TrendPress shape when the autoscale limits have
changed.
pictureDisplayed() returns a Picture pointer just after the picture is displayed using displayPicture(). pictureUndisplayed() returns a Picture pointer just before the picture is undisplayed. The pictureDisplayed and pictureUndisplayed dialogues can be located in
application, window or picture scope.
beforePictureUpdate() and afterPictureUpdate() returns a Picture pointer before and after a picture is updated, respectively. The purpose with these two events are to trig a dialogue,
if some action have to take part, before and after an update. These dialogues can be located
in application, window or picture scope.
dndBegin(…) dialogue trigger returns true when a drag and drop operation can be started.
The argument button corresponds to a button number. A zero value means all buttons. This
dialogue trigger returns a pointer to a DnDSource objects which acts as a source for a drag
operation. The object DnDSource can only be obtained in the action part of this trigger. Calling member functions on DnDSource or calling the global function dndSimpleDrag(…)
has a meaning only within the action part of dndBegin(…). The dialogue trigger dndBegin(…) can be applied to shapes, pictures and windows only.
dndDrop() dialogue trigger returns true when dropping an object in an active drop zone.
dndEnter(), dndLeave() and dndMotion() returns true when entering, leaving or moving
the mouse cursor in a drop zone during a drag and drop operation, respectively. These dialogue triggers can be applied to shapes, pictures and windows only. These triggers return a
pointer to an active DnDTarget class object.
Calling member function on DnDTarget or calling the global function dndSimpleDrop(…)
has a meaning only within the action part of these trigger functions. Notice that these event
functions must be activated before they can be used. Functionality is provided in the graphics
editor GED to activate and deactivate drop zones. The following functions can also be used
336
ProcSee Reference Manual
Standard pTALK Functions
event (3pTALK)
to activate and deactivate drop zones, even if they are rarely used: dndActivate(…), dndDeactivate(), Picture::setPictureFlags(…), Shape::setShapeFlags(…) and Window::setWindowFlags(…).
buttonIsDown() takes one argument button, which corresponds to an X-Window button
number. If button is non-zero, buttonIsDown() returns 1 if the given mouse button is currently being pressed, i.e. is down, zero otherwise. If button is zero, buttonIsDown() returns zero if no mouse button is currently down, otherwise it returns 1. Note that
buttonIsDown() reports on the previous event, not the event that triggered the action.
shiftIsDown() returns true if one of the shift keys are currently being pressed, i.e. is
down, false otherwise.
controlIsDown() returns true if the control key is currently being pressed, i.e. is down,
false otherwise.
altIsDown() returns true if the alt key is currently being pressed, i.e. is down, false otherwise.
metaIsDown() returns true if the meta key is currently being pressed, i.e. is down, false
otherwise.
cursorX() and cursorY() returns the current cursor position in world coordinates, i.e. in
picture coordinates.
shapeCursorX() and shapeCursorY() return the coordinates of the cursor, in the shapes
coordinate system. See Shape (page 432) and xyConv (page 497) for more information.
eventPicture() returns a pointer to the picture in which the last event occurred.
lastSelectionPicture() returns a pointer to the picture where a shape last was marked for
selection or unmarked. It was added for compatibility with earlier versions of ProcSee.
Always check if this function returns 0 before using it. Since the global functions copy(),
cut() and clear() from release 2.3 have become member functions in the picture class, this
function is normally used when creating these functions in the application scope. An example of the function copy() in the application scope is given in the examples section.
ungrabPointer() is used to eliminate the effect of an active grab. When a mouse button
is pressed, the shape (if any) and window catching that event will grab the cursor. As long
as the cursor is grabbed, the "grabbing" object will receive all incoming events, regardless
of the cursor position. A grab is active until all mouse buttons are released or the function
ungrabPointer() is called. Calling ungrabPointer() with a parameter value of 1 means
that the window will still grab the cursor, but the shape will not. Calling ungrabPointer()
with a parameter value of 3 means that neither the window, nor the shape will grab the
cursor.
postKeyEvent(...) posts a user generated key event or key release event and add this event
on the message queue in the RTM. When the RTM process this user generated event, it
will be handled just as if it was a key that was actually pressed on the keyboard. That is,
key pressed and key release dialogues will be invoked in the application. The argument
keyCode is the key code to post. This is the same key code which are returned by the event
trigger functions keyPressed(0) and keyReleased(0). The second argument keyEvents
determines what kind of events to generate. Legal values for this argument are: key press
(1), key release (2) or both (3).
ProcSee Reference Manual
337
Standard pTALK Functions
event (3pTALK)
postMouseButtonEvent(...) posts a user generated mouse button press or mouse button release event on the message queue in the RTM. When the RTM process this user generated
event, it will be handled just as if it was a mouse button that was actually pressed or released.
That is, mouse button dialogues will be invoked in the application, buttonPressed(...), buttonReleased(...), buttonRepeated(...), buttonDoubleClicked(...) and buttonTripleClick(...). The argument buttonNo is the virtual mouse button being pressed. The following
values are legal for this argument: left (1), middle (2), right (3). The last argument buttonEvents determines what kind of events to generate. Legal values for this argument are: button
press (1), button release (2) or both (3).
WARNINGS
Be aware that all event functions returns data associated with the last event that occurred. The
only place where the contents of this event is predictable is within a dialogue trigger or action. If data returned from these functions are needed elsewhere, store the data in variables
or attributes.
EXAMPLES
application TestApp
{
...
function `copy()
{
Picture* p = lastSelectionPicture();
if ( p ) p->copy();
}`
...
}
338
ProcSee Reference Manual
Standard pTALK Functions
EventPlot (3pTALK)
NAME
EventPlot - user interface component for visualizing events in trend diagrams
SYNOPSIS
// attributes
char* EventPlot::event;
float EventPlot::offset;
char* EventPlot::shape;
char* EventPlot::theTrendPres;
DESCRIPTION
The EventPlot class is used for visualizing events in a trend diagram. The EventPlot instance must be connected to an event type specified in the trend variable configuration
file. When an event of the requested event type is generated using either the pTALK functions TrendLog::event or TrendLog::events or the API functions PfEvent or PfEvents,
instances of any class or basic shape can be created to visualize the event in the trend diagram. The EventPlot class can be initialized to generate different classes or shapes for
different type of events based on the information stored in the event data.
The attribute event is a text string and must be set equal to the name of an event type specified in the trend variable configuration file.
The shape attribute can be set equal to the name of a user defined class or a pTALK function. When setting this attribute equal to a class in the application or library, all events
will produce instances of the same class. If this attribute is set to a pTALK function, different shapes can be created based on either the time stamp when the event occured or the
event data. The callback function that is called from the EventPlot shape will be called
with the following arguments: the full name of the EventPlot shape, the time when the
event occured and a pointer to the event data. The callback function has the following prototype:
Shape* eventCB( char* fullName, int timeStamp, void* data )
Shapes created in this callback function must use the fullName argument as the parent’s
fullname when they are created. This is extremly important. If this rule is broken the event
shapes will not move as expected. The data argument will be of the same type as the event
data type which is defined in the trend variable configuration file. If for instance the event
type is defined to be of type float, the last argument will be a pointer to a float variable.
The void pointer used in the callback function can be changed to be a pointer of the actual
data type, for instance float* data. The return value from the callback function must be a
pointer to the created shape. If for any reason no shape is created for the event then 0 must
be returned. When creating the shapes, use the position (0,0) for x and y. The shapes will
be automatically repositioned by the EventPlot shape and the visibility attribute will be
set to visible. Do not call the pTALK function updateShape() from within the callback
function.
ProcSee Reference Manual
339
Standard pTALK Functions
EventPlot (3pTALK)
The attribute theTrendPres can be set to 0 or to the name of a trend presentation (TrendPres) curve in the same trend diagram. If setting this attribute to 0 all events will be put in
the middle of the trend diagram. On the other hand if this attribute is set to a trend curve, the
events will follow the trend curve at the time stamp when the events occured. It will look as
if the events are placed on the trend curve.
The attribute offset will move the position of the shapes up or down compared to the position
they would have been given unless this attribute had not been specified. A negative value
moves the shapes up and a positive value down. For instance, setting this attribute to half the
height of the trend diagram and setting the attribute theTrendPres to 0 will position the
shapes right below the trend diagram.
EXAMPLES
/* An example of an event plot creating instances of different */
/* classes based on the event data. The data type is of a user */
/* defined alarm struct (defined in a pdat file).
*/
Shape* myEventCB( char* ofName, int theTime, Alarm* alarm )
{
if ( alarm->state == 1 )
{
// High alarm. Create an instance of the class CHiAlarm.
CHiAlarm* h = newInstance( ofName, 0, "CHiAlarm", 0, 0 );
// Intitialize the instance by calling a user defined
// function using the event data.
h->Initialize( alarm );
return h; // Return the instance.
}
if ( alarm->state == 2 )
{
// Lo alarm. Create an instance of the class CLoAlarm.
CLoAlarm* l = newInstance( ofName, 0, "CLoAlarm", 0, 0 );
// Save the event data Alarm in the CLoAlarm instance.
l->Alarm = alarm;
return l;
}
// Do not create any instance for other alarm states.
// Just return 0.
return 0;
}
...
trend T
{
...
eventPlot myEventPlot
{
event = "Ev321_Alarm"; // The name of the event type
shape = "myEventCB"; // Points to the call-back function
offset = 0;
340
ProcSee Reference Manual
Standard pTALK Functions
EventPlot (3pTALK)
theTrendPres = "myTP";
}
...
}
SEE ALSO
TrendLog(3pTALK) in "ProcSee Reference Manual"on page 462
Trend(3pTALK) in "ProcSee Reference Manual"on page 455
ProcSee Reference Manual
341
Standard pTALK Functions
execute, executeAsync, eval (3pTALK)
NAME
execute, executeAsync, eval, strEval - compile and execute a pTALK statement
SYNOPSIS
void execute( char* source, ... );
void executeAsync( char* scope, char* source, ... );
any eval( char* scope, char* source, ... );
char* strEval( char* scope, char* source, ... );
DESCRIPTION
execute() takes one argument source and can contain all formatting options supported by
printf(). Optional formatting arguments can follow the first argument.
The source string is compiled as a compound statement, meaning that the result isn’t returned
back to the caller, if the source is be surrounded by the characters ’{’ and ’}’. It is executed
only if the source compiled successfully. The statement is compiled and executed within the
scope of the owner of the caller, which means that the code executed doesn’t have access to
local variables defined in the function containing the execute() call. Example:
int a = 45; // attribute a, at same scope as f().
void f()
{
int a = 123; // local variable a, not accessible from execute().
execute("{ printf(\"%%d\",a); }");
}
When f() is called, the value printed is 45. Also note the %% and the \" in the example. The
\" is required because it is a string within a string. The %% is needed because of the printf
formatting of the source argument to execute(). %% is then converted to a single % used
by the printf in the source string.
executeAsync() behaves much like execute() with two important exceptions: The statement
is compiled and executed within the scope given as first parameter. And - the statement is
executed asynchronously. This means that the statement is queued up internally in RTM and
compiled and executed when RTM becomes idle. executeAsync() is useful for performing
background operations.
eval() and strEval() accept the same arguments as executeAsync(). The difference is that
these methods compiles and runs the source code synchronously and returns the result of the
execution back to the caller.
The integer value 1 is returned from the eval() function if the execute string passed as argument is a compound statement.When an expression is executed, the data type of the value
returned to the caller is the data type of the pTALK evaluation. For instance, the result of the
expression float value = eval(fullName(), "4*3.14"), is the value 12.56, where the data type
of the result is a float.
342
ProcSee Reference Manual
Standard pTALK Functions
execute, executeAsync, eval (3pTALK)
The result of the method strEval() is an empty string if the source code is a compound
statement. If the source code is an expression, the result of the evaluation is returned back
to the caller as a character string. For instance, the expression eval(fullName(), "4*3") returns the character string "12", while the compound statement eval(fullName(), "{4*3;}")
returns the empty string "". The value 0 is returned in case of errors, i.e. if the compilation
or the execution of the source code fails.
execute() is useful for executing statements stored in variables, or entered by end users at
run-time. Another example is delayed compilation:
void createR1()
{
newRectangle(fullName(), "R1", 100, 100, 200, 150);
execute( "{ R1.foregroundFillColour = green; }" );
}
In this example, the compilation of the statements is delayed, because the object R1
doesn’t exist at the time createR1() is compiled.
ProcSee Reference Manual
343
Standard pTALK Functions
exportDxf (3pTALK)
NAME
exportDxf - export Dxf-Script code to file of a ProcSee picture.
SYNOPSIS
int exportDxf( char* sourceName, char* targetName,
int xMax, int yMax, int exportMode );
DESCRIPTION
exportDxf() takes five arguments, sourceName and targetName to make a Dxf file, named
from the second argument; targetName, and placed in the current directory. This file reflects
the graphical state of the displayed ProcSee picture, specified by the first parameter; sourceName. The xMax and yMax are width and height of the screen where the AutoCad is running.
exportMode controls what dxf codes to use in the exported dxf file. A value of 0 indicates
that the graphics in the exported dxf file is made as identical as possible to the original ProcSee picture. A value of 1 indicates that solid circles in ProcSee are to be exported as circle
outlines in the dxf file.
Due to different font representations in ProcSee and dxf, a font conversion file
"x2dxfFonts.pfon" is needed. This is a conversion between X11 fonts and dxfScript fonts.
Tuning of the width and height parameters in the conversion file might be necessary to get
the correct size of the dxf fonts.
If the program/system that is going to import the dxf file is running on a different computer
system, the dxf file might need to converted. If the system is running on a PC running MSDOS, the unix2dos program must be run on the generated file.
If your AutoCad version always starts up with a default header when importing a dxf-file, it
will only read the ENTITIES section of the file. Tables specified in the dxf-file header and
later used, will become undefined. The Linetypes must be created in the autocad before importing the dxf-file. The linetype names are described under LTYPE following the 3 group
code in the dxf-file. The same goes for style tables( the fonts ). The Blocks specified will also
be unknown.
EXAMPLE
exportDxf( "MyPicture", "MyPicture.dxf", 1024, 768, 0 );
x2dxfFonts.pfon:
#
# X11 fonts:
# ----------
scale:
# dxf fonts: height width
------------
-adobe-courier-bold-o-normal-*-12- ROMANS
-adobe-courier-bold-r-normal-*-12- ROMANS
344
0.9
1.0
1.0
0.7
ProcSee Reference Manual
Standard pTALK Functions
exportImage (3pTALK)
NAME
exportImage - creates image of window(s) or picture and exports the result to clipboard
or file.
SYNOPSIS
int Application:exportImage( char* sourceName, char* targetName,
char* format=0, char* mode=0, [Rect*|Rect**|Size*|Size**] sizeOutput=0 );
DESCRIPTION
exportImage() exports an image containing either one or several windows or a single picture that are displayed in the RTM either to clipboard or file. This function supports screen
capturing directly from the screen or drawing to image. When capturing directly from the
screen other windows that overlaps the RTM pictures will become part of the captured image. The advantage of using screen capturing mode is that what is displayed on the screen
is what is saved in the image. When drawing into the image the window border will also
be drawn which will not produce an exact copy of the window manager frame. The advantage of using drawing mode is that overlapping windows will not affect the image
dump. The mode argument is used to select source (capturing) mode.
If exportImage fails, it will return 0. If everything is OK, it will return a number different
from 0.
The argument sourceName controls the source that will be exported to an image. The
RTM supports three different source types, which are Display, Window and Picture. This
can be specified using a string containing the fullname of the object, or by specifying a
pointer to the object.
The argument targetName is either an empty string (""), null pointer (0) or a file name
with or without a file extension. If an emtpy string or a null pointer is specified the image
dump will be copied to the clipboard, otherwise the specified file. If the file extension is
omitted the RTM will add a file extension based on the image format.
The image format is specified with the argument format. The RTM supports the following graphic formats:
• tiff - Tag Image File Format
• png - Portable Network Graphcis format
• xwd - X Windows Dump format
• bmp - Windows bitmap format
The format argument must be set to one of the file formats listed above. In ProcSee compression is only used in the png graphics file format. Note that this argument is not used
if the image is copied to the clipboard. If it is set to an empty string ("") or a null pointer
(0), the extension of the file given in targetName will be used, if it is one of the legal formats, if not the format will be png.
ProcSee Reference Manual
345
Standard pTALK Functions
exportImage (3pTALK)
The argument mode is used to specify additional options. By default the screen capturing
function exportImage() will capture the image from screen using black background, white
window background, border frames, and give an error if the specified file exists. This default
behaviour can be changed using the argument mode.
The following options for the mode argument can be specified:
• exists
• source
• frame
• backgroundColour
• windowColour
The option exists is used to control whether to overwrite, enumerate or return with an error
if the specified file exists. Setting exists=overwrite will overwrite the file if the file exists.
Setting exists=enumerate will add additional numbers to the file name. The RTM will create
a file name using underscore plus three digits. It will start enumerating from 0. The file name
produced by the RTM will be on the format <file>_###.<type>, where ### will be set to values in the range 000 to 999. For instance rtmImage_001.tiff. If setting exists=error the RTM
will return with an error if the image file exists when executing the exportImage() function.
Default is that the RTM will return with an error if the file exists.
The source option is used to control whether the image will be captured from the screen or
drawn. Set source=draw to draw the image. Set source=screen to capture the image directly
from the screen. The latter is default.
The frame option can be set to yes or no. If frame=yes is specified the exportImage() function will dump all the RTM windows with the window manager frames visible. If frame=no
the window frames will not be included in the image dump. The default is that frames are on.
The option backgroundColour is used to specify the colour to use for the image background. If capturing several windows using the display as source the image may have regions
that are not occupied by RTM windows. These areas will be cleared using this backgroundColour. The syntax for setting the background colour is backgroundColour=<colour>,
where colour is a ProcSee colour that is defined in the application. For instance red, green,
blue etc. The default background colour is black.
The option windowColour is only applicable if the ProcSee application uses exported windows and the source is drawing into image. The area between the window frame and the exported ProcSee windows will be cleared using this colour. The syntax for using this option
is windowColour=<colour>, where the colour is one of the colours defined in the RTM. The
default value for windowColour is white.
The options are separated using comma (,). Note that it is not necessary to type the entire
words when specifying the options. Just see to it that the abbreviated words are unique. However, the colour names can not be abbreviated. Instead of typing "exists=overwrite,
source=draw, frame=yes, backgroundColour=red", you may type "ex=ov, so=dr, fr=yes,
ba=red".
The mode argument can also specify the resource styles to use. For information about the
values that controls this, see resource styles on page 419.
346
ProcSee Reference Manual
Standard pTALK Functions
exportImage (3pTALK)
The sizeOutput argument is an optional argument for getting the size of the exported image, and optionally the position on the screen that refers to the upper left corner of the image. The size is in number of pixels in the exported image. The position is in pixel
coordinates.
If the type of this argument is Size*, the object must exist before calling exportImage. If
the type is Size**, exportImage will create a new Size object, and set the argument to
point to this. If the type of this argument is Rect* or Rect**, the same applies, but the Rect
object will also get the position of the area on screen that the image is captured from.
EXAMPLE
// This example dumps the display DefaultDisplay1 to the clipboard.
exportImage( "DefaultDisplay1", "", "", "so=sc, fr=yes, ba=white" );
// This example dumps the window MainWin to the tiff file Img.tiff
exportImage( "MainWin", "Img", "tiff", "ex=ov" );
// This example dumps the picture P543 to the png file Img_###.png
exportImage( "P543", "Img", "png", "ex=en" );
// Using a Size object to get the size of the genereated image:
Size* A = newSize(); // Create the object, that will hold the size.
exportImage( Display2, "Img", "png", "", A ); // After this call, A created above contains the size.
// or:
Size* A;
exportImage( Display2, "Img", "png", "", &A ); // After this call, A points to a new Size object.
ProcSee Reference Manual
347
Standard pTALK Functions
exportPostScript (3pTALK)
NAME
exportPostScript - export PostScript code to file or printer.
exportPostScriptEx - export PostScript code to file or printer. Part of the window is specified.
SYNOPSIS
int exportPostScript( char* sourceName, char* targetName,
char* printerName, char* options="" );
int exportPostScriptEx( char* sourceName, char* targetName,
char* printerName, int orientation,
int offsetX, int offsetY,
int width, int height, char* options="" );
DESCRIPTION
exportPostScript() takes three arguments, sourceName, targetName, and printerName to
make a PostScript file, named from the second argument; targetName, and placed in the
start-up or fullpath directory. This file reflects the graphical state of the displayed ProcSee
pictures. The first parameter; sourceName, is able to convert and export four different sources; Picture, Window, Display, and Application. Use the name of the source known to the
ProcSee system. When exporting a picture, use only the picture-name without extension. For
a display, use the Display object name. And when exporting an application, remember to
start the application-name with two leading colons; like "::myApp".
The second parameter; targetName, is the name of the file where the PostScript code is exported. If this parameter is empty, the system is executing an unix printer command specified
in the printerName parameter described below, and sending a temporary file to this printer.
The printerName parameter contains the name of a printer tuning file. The tuning file contains margin definitions and colour tuning factors. The printer tuning file is described in
printer(3pTALK). printerName should contain the file name without the ".pprn"extension,
or default values will be used. There is an example of this file, with extension ".pprn", delivered in each release of ProcSee. If printerName is empty, default values for a printer is
used. Another file that is required in order to get a successful export is the "x2psFonts.pfon"
file. This is a conversion between X11 fonts and PostScript fonts. Example files are located
in the $PROCSEE_DIR/etc directory.
exportPostScriptEx() takes five more arguments, orientation where 0 is best fit, 1 is portrait
and 2 is landscape, offsetX, offsetY, width and height specify the part of the display to be
printed.
The optional parameter options can bu used to specify the resource styles to use. For more
information about the values of the options parameter, se resource styles on page 419.
EXAMPLE
exportPostScript( "MyPicture", "MyPicture.ps", "printer" );
348
ProcSee Reference Manual
Standard pTALK Functions
exportPostScript (3pTALK)
The above example will export the picture "MyPicture.ppic"(that is mapped on the
screen), and put it into a PostScript file named "MyPicture.ps". The "printer.pprn" file
have to be present in the $PROCSEE_DIR/etc directory, the $HOME directory, or in
the directory containing the .pctx application file. The x2psFonts.pfon file have to be present in in the directory containing the .pctx application file, the directory where the RTM
was started or in the $PROCSEE_DIR/etc directory.
An example of the printer.pprn file is found on the printer(3pTALK) manual page.
Example of the x2psFonts.pfon file:
#_______________________________________________________________#
#
#
# Relations between fonts used in the ProcSee application
#
# resource file (****.pctx) (X11 font names),
#
# and the relating PostScript fonts.
#
#
#
# The ProcSee system will interpret the beginning of each line as
#
# either a comment line (with a leading # or //),
#
# or a legal font conversion line with X11 and PostScript
#
# font-syntax separated with one or more spaces between.
#
# If its an XLFD font you just have to include the
#
# first six -*- values of the whole name. The rest is taken
#
# care of by the system.
#
#
#
# If you want another encoding vector for your PostScript
#
# font which is often used in Scandinavian fonts dealing
#
# with special characters as aring, ae etc. You have to
#
# add an extension to this font name; like *ISOLatin1.
#
# Or create a new encoding vector yourself. Use the
#
# syntax shown in the example, "/MyVec", below.
#
#_______________________________________________________________#
# New Encoding Vector
/MyVec
[
8#133 /AE
8#134 /Oslash
8#135 /Aring
8#173 /ae
8#174 /oslash
8#175 /aring
]
# X11 fonts:
# ----------
# PostScript fonts:
-------------------
-adobe-courier-bold-o-normal-adobe-courier-bold-r-normal-adobe-courier-medium-o-normal-adobe-courier-medium-r-normal-adobe-helvetica-bold-o-normal-adobe-helvetica-bold-r-normal-adobe-helvetica-medium-o-normal-adobe-helvetica-medium-r-normal-
Courier-BoldOblique
Courier-Bold
Courier-Oblique
Courier
Helvetica-BoldOblique
Helvetica-Bold
Helvetica-Oblique
Helvetica
ProcSee Reference Manual
349
Standard pTALK Functions
exportPostScript (3pTALK)
-adobe-times-bold-i-normal-adobe-times-bold-r-normal-adobe-times-medium-i-normal-adobe-times-medium-r-normal-
Times-BoldItalic
Times-Bold
Times-Italic
Times-Roman
ife5x7
ife7x10
Helvetica*ISOLatin1
Helvetica*ISOLatin1
sap6x9
sap7x10
Courier*ISOLatin1*MyVec
Courier*ISOLatin1*MyVec
SEE ALSO
printer(3pTALK) in "ProcSee Reference Manual"on page 405
350
ProcSee Reference Manual
Standard pTALK Functions
fileNames (3pTALK)
NAME
fileNames - functions for converting file names between host format and ProcSee’s internal formats.
SYNOPSIS
char* fileNameHost( char* fileName );
char* fileNameNormal( char* fileName );
DESCRIPTION
fileNameHost() converts the argument (fileName) to host file format which is returned
from the function. On Microsoft Windows platforms the host file format includes the
drive letter and uses the backslash character, ’\’, to separate directories. The forward slash
’/’ is used to separate directories on UNIX platforms .
fileNameNormal() converts the argument (fileName) to ProcSee’s internal file format.
EXAMPLES
char* normal = "/LOCALPC/C/My Documents/Test.txt";
char* host = fileNameHost( normal ); // Returns c:\My Documents\Test.txt
ProcSee Reference Manual
351
Standard pTALK Functions
Font (3pTALK)
NAME
Font - object holding information about an X11 font.
SYNOPSIS
int
int
int
int
int
int
int
int
int
Font::width( Window* w, float scale=1.0 );
Font::height( Window* w, float scale=1.0 );
Font::ascent( Window* w, float scale=1.0 );
Font::descent( Window* w, float scale=1.0 );
Font::lbearing( Window* w, float scale=1.0 );
Font::rbearing( Window* w, float scale=1.0 );
Font::capHeight( Window* w, float scale=1.0 );
Font::xHeight( Window* w, float scale=1.0 );
Font::textWidth( char* str, int len, Window* w, float scale=1.0 );
Font* Application::getFont( int font, ::ResourceStyle* rs = 0 );
DESCRIPTION
The Font object holds information about an X11 font. The Window* parameter in the functions is a pointer to the window in which the font or text is being used. The optional scale
parameter tells the scaling of the font to use.
The width() function returns the width (in screen coordinates) of the widest character in the
font.
The height() function returns the height (in screen coordinates) of the highest character in
the font (i.e. ascent + descent).
The ascent() function returns the logical extent (in screen coordinates) of the font above the
baseline of the font. The ascent is normally greater than the capHeight.
The descent() function returns the logical extent (in screen coordinates) of the font below the
baseline of the font.
The lbearing() function returns the minimum left bearing (in screen coordinates) of the font.
The rbearing() function returns the maximum right bearing (in screen coordinates) of the
font.
The capHeight() function returns the height (in screen coordinates) of the capital characters
in the font (e.g. the height of the H character).
The xHeight() function returns the height (in screen coordinates) of the lowercase characters
without ascenders and descenders, like the x character.
The textWidth() function returns the width (in screen coordinates) of the len first characters
in the string str.
Application::getFont() returns a pointer to the Font that is given as input argument. Used to
convert integer font index back to the Font it represents. An optional ResourceStyle can be
given.
352
ProcSee Reference Manual
Standard pTALK Functions
fullName (3pTALK)
NAME
fullName - functions for manipulating an object’s full name
SYNOPSIS
char* nameOfFullName( char* fullName );
char* ownerOfFullName( char* fullName );
char* fullNameOf( any* addr );
char* nameOf( any* addr );
char* quoteId( char* id );
char* unquoteId( char* quotedId );
char* typeNameOf( char* fullName );
DESCRIPTION
nameOfFullName() takes an objects’s full name as an argument. The last part of the fullName is then returned. It behaves like if the fullName is looked up, and the function
name() is called on this object, except that the object does not have to exist. Examples:
nameOfFullName( "::myApp.someName" ) returns "someName", nameOfFullName(
"::someApp.myPict.0xe000001" ) returns "", and nameOfFullName( "::app.pict.$s-23$ )
returns "s-23".
ownerOfFullName() is splitting the full name given as argument, returning the full name
of the owner. Example: ownerOfFullName( "::app.pict.sh" ) returns "::app.pict".
fullNameOf() gets a fullName from the address given. This can be used on attributes,
functions, dialogues and variables in addition to all the other elements in the symboltable.
The fullNameOf() function is needed since the function Object::fullName() isn’t available
for attributes, functions, dialogues and variables.
nameOf() gets the name from the address given. This can be used on attributes, functions,
dialogues and variables in addition to all the other elements in the symboltable. The nameOf() function is needed since the function Object::name() isn’t available for attributes,
functions, dialogues and variables. Note that nameOf(...) is conceptually the same as
nameOfFullName( fullNameOf(...) ), and that possible ’$’-quotes is not included in the
result.
quoteId() adds ’$’-quotes around the id when the id argument is not a legal identifier. If
the id argument is a legal identifier, it is returned unchanged.
unquoteId() removes the ’$’-quotes that was added by quoteId(). If no ’$’-quotes had
been added, it will not try to remove any. In cases where the quotedId argument is not a
possible result from quoteId(), unquoteId() returns a legal identifier found at the start of
the quotedId argument. If the quotedId argument does not start as a legal identifier, an
empty string is returned.
typeNameOf() returns the type of the object passed as argument in (fullName). The argument must be the full qualified name of the object whose type to return.
EXAMPLES
char* ptr = "myApp.procLib.Valve1";
ProcSee Reference Manual
353
Standard pTALK Functions
fullName (3pTALK)
char* name;
char* ownerName;
name = nameOfFullName( ptr ); // name pointing to "Valve1"
ownerName = ownerOfFullName( ptr ); // pointing to "myApp.procLib"
char* ptrFN = fullNameOf( & ptr ); // The fullName of ptr: "::myApp.ptr"
354
ProcSee Reference Manual
Standard pTALK Functions
getDependencies (3pTALK)
NAME
getDependencies – returns a list of symbol table objects that an object depends on
SYNOPSIS
::List* getDependencies( char* fullName,
::List list = 0,
char* flags = 0 );
DESCRIPTION
The function getDependencies(…) returns a list of symbol table objects. Put in the fully
qualified name of the entry of the object in the fullName parameter and the getDependencies(…) function will find all the objects that is referenced from this object or any object under it, including references from inside of pTalk expressions. If the list argument is
given it is appended to and returned, if not, a new list is created and returned. The flags
argument can change what objects to include, and how the output is filtered. See the table
below.
flags options
description
directDependenciesOnly
Only mark the direct dependencies. The default is to find all
dependencies recursively.
asUpdate
Don't check functions and attributes, unless they are used by
other elements.
primAttrs
Mark the primitive attributes in the metaClasses, in addition
to the object it is in.
objFuncs:instance
objFuncs:class
objFuncs:both
Output functions for each instance it is in (default), or class,
or both.
valuePointers
Follow pointers in values that have no dynamics.
valueResources
Mark resources for int values on some primitive attributes.
values
Same as valuePointers,valueResources.
class=’...’
Filter the output to only the meta-classes specified here, with
+ or - for each. This is the same filtering as is used in the
getList function.
outsideOnly
Filter the output, so that only things outside the object is
reported.
insideOnly
Filter the output, so that only things inside the object is
reported.
ProcSee Reference Manual
355
Standard pTALK Functions
getDependencies (3pTALK)
flags options
description
reCompile
Force recompilation of all pTalk code. Default is to only
compile pTalk code that has not compiled successfully
before.
failedToCompile
The output is the list of symboltable objects that has pTalk
code that failed to compile, instead of dependencies.
quiet
Don’t write compile errors to output window or stdout.
debug
Write to output window or stdout the pTalk code that is recompiled.
Since this function scans the pTalk code, and tries to compile code that has not yet been compiled, it can be used to check that all code compiles. By using the failedToCompile flag, the
result is a list of objects that failed to compile, instead of the list of objects that the input object depends on.
Even though this function finds dependencies in pTalk code, content of strings are not
checked, so the fact that the following code depends on a window and a picture is not detected:
displayPicture( "MainWin", "MyPict" );
This function can be used to find dependencies. By storing these in e.g. a database-table, the
reverse can be checked, e.g. what pictures depends on a given variable.
EXAMPLE
List* L = getDependencies( "::App1.Pict1", 0, "class=’Variable’ " );
int n = L.length();
printf( "Picture Pict1 depends on %d variables", n );
for ( int i = 0; i < n; i++ )
{
printf( " %s", fullNameOf( L.get( i ) ) ); // The fullName of each variable.
}`
SEE ALSO
getList, fullNameOf, List
356
ProcSee Reference Manual
Standard pTALK Functions
getErrorString (3pTALK)
NAME
getErrorString – returns the string describing an error code
SYNOPSIS
char* getErrorString( int errorCode );
DESCRIPTION
The function getErrorString() returns a string for each error code. This function does the
same as the API function PfGetSystemError() documented on page 211. This function can
be used for the return values of the pTALK functions load, save, and document.
ProcSee Reference Manual
357
Standard pTALK Functions
getList (3pTALK)
NAME
getList – returns a list of matching symbol table objects contained in an object
SYNOPSIS
::List* getList( char* fullName, ::List list = 0, char* flags = "class=’all’ " );
DESCRIPTION
The function getList(…) returns a list of symbol table objects. Put in the fully qualified name
of the entry of the parent object and the getList(…) function will find all the objects that
matches class in the flags argument. The first argument fullName is the name of the parent
object. The second argument list is a List object where the matching objects are put. If the
list argument is 0 a new object of type List is created and returned. If a List object is specified
the matching objects are appended to the existing list. The list is not cleared.
The following values can be specified for the flags argument; class, levels, name, ignoreCase, descendInto, inherited, onlyInherited, and selected. The default value for the flags argument is class=’all’, meaning that all objects will be put into the list. The levels flag requires
an int-value, like levels=3. The default for levels is 0. Only objects at current level will be
traversed when the levels flag is zero. Setting this value to a non-negative value will recursively scan this number of sub-levels for objects matching the flag class. The name=’match’
is used to only store symbol table objects that have a name that matches the match string. The
match string can contain ’*’ for 0 or more characters, and ’?’ for matching one character, in
addition to all other characters that will match the character itself. E.g. for finding all elements that have 4 letters in its name and the second letter is ’a’, use "name=’?a??’" as a match
string. For finding all elements that have 2 or more characters in the name, use ’??*’ as the
match string. If the ignoreCase flag is given, the match is performed case insensitively. The
descendInto=’metaclasses’ makes it only descend into the given meta-class types, specified
in the same way as for the class flag. When the descendInto flag is given, the levels defaults
to a very large value if not given. If descendInto is not given, all types is traversed when levels > 0. The inherited flag makes getList also get elements from inherited objects, like the
iterator functions. E.g. it can list the predefined attributes of a shape. The onlyInherited flag
makes it only report the inherited elements. To get all shapes in a picture use the getList(…)
function and set the class flag to Shape and levels to a large value, for instance 9999. These
settings will return all the shapes created in the picture. If the flag selected is specified in the
flags string only selected shapes will be appended to the list. If selected is enabled the fullName passed as argument to getList(…) must be an entry containing shapes, like Picture,
Instance, etc.
The flags class and descendInto can have one of or a combination of the metaClass, Class,
ComClass and ComInterface names in the RTM. Each name should have a ’+’ or ’-’ sign in
front of it, to indicate if this one is supposed to be in or out of the set. The first metaClass
name given does not need this sign, and it will then be understood as having a ’+’ sign. The
string ’all’ can also be used, and is typically used when one wants to get a list off all objects
except some few types. This all string can only be given with the ’+’ modifier, since ’-all’
would mean nothing can be added to the list. An example of the flags string is:
"class=’Shape-Instance+Attribute’", resulting in looking for shapes and attributes, but ignor-
358
ProcSee Reference Manual
Standard pTALK Functions
getList (3pTALK)
ing instance shapes. The flags string "class=’all-Shape’" will make getList add all objects
except shapes to the list. Notice that the Object function metaClass() returns the class of
an object. The following is a list of some of the metaClass names that can be used:
Application,
Attribute, Circle,
CircleArc,
Class,
ClassPicture,
Colour,
ComClass,
ComEnum,
ComEventObject, ComInterface, ComInterfaceObject,
ComLibrary,
ComObject,
ComShape,
Cursor,
Dialogue,
DialogueArea, DnDSource, DnDTarget,
Drawable,
Ellipse,
EllipseArc,
Enum,
EnumElement, EventPlot,
Font,
Function,
Group,
Image,
Instance,
Interpolator, Library,
Line,
Linestyle, List,
Matrix,
Object,
Pattern,
Picture,
Polygon,
Printer,
Rectangle,
ResourceStyle, RoundRect, Scale,
Shape,
Text,
TimeTag,
TimerAt,
TimerInterval, Trend,
TrendGrid,
TrendLog, TrendLogExternal,
TrendLogInternal, TrendPres, TrendRuler,
Window, Display
The objects put into the ::List object are addresses to entries in the ProcSee symbol table.
Either use the cast operator or the function fullNameOf(…) to get an object from the list.
For instance ::Shape* s = (Shape *)L.get( n ), where L is the List object, n is an index in
the list and (Shape *) is the cast operator. Notice that the cast operator returns null if the
cast operation fails.
This function is an alternative to the symbol table iterator functions available in ProcSee,
createIterator(…), nextFullName(…) and deleteIterator(…).
EXAMPLE
function `void getSelRect( char* fn )
{
// Get all selected rectangles in fn
::List* l = getList( fn, 0, "class=’Rectangle’, selected" );
if ( !l ) return;
int n = l->length();
for ( int i = 0; i < n; i++ )
{
Rectangle* r = (Rectangle *)l->get( i );
if ( r ) do-something-with-the-rectangle-r
}
}`
SEE ALSO
fullNameOf, List, iterator
ProcSee Reference Manual
359
Standard pTALK Functions
getpid (3pTALK)
NAME
getpid - return the process identifier for the rtm
SYNOPSIS
int getpid();
DESCRIPTION
getpid() obtains the process identifier for the rtm. The rtm process is uniquely identified on
the system with this identifier.
360
ProcSee Reference Manual
Standard pTALK Functions
Gradient (3pTALK)
NAME
Gradient - creates and stores information about a gradient.
SYNOPSIS
Gradient* gradient( Pattern* pattern,
[ [ float x1, float y1, float x2, float y2, [ float x3, float y3, ] ]
char* options ] );
DESCRIPTION
The Gradient class is an empty class which does not contain any attributes or methods.
An instance of this class stores internal information needed when drawing a gradient. This
information is not available from pTALK. Actually, it is unnecessary to store attribute
pointers to the Gradient class because ProcSee handles this more efficiently. However,
even if it is unusual, Gradient pointer attributes can be created in ProcSee using the gradient(…) function. Situations where it can be useful are when several shapes use the same
Gradient instance, and changes made to one or more of the gradient's properties should
be reflected in all shapes.
The pTALK gradient(…) function creates and assigns a gradient to a shape's line- or fill
pattern attributes, or to a picture's pattern attribute. Use this function either to create a gradient that is different from the gradient pattern's default values, or to create a gradient impossible to create using default values.
The return value from this function is an instance of the class Gradient initialized with
the specified arguments. The first argument pattern must be a pattern of type gradient pattern, 0 is returned otherwise (the shape or picture is drawn using a solid pattern when this
function returns 0).
The remaining arguments are optional. Calling this function with only the gradient pattern
argument is the same as assigning an attribute of type gradient pattern to a pattern attribute
directly, like this:
S.fillPattern = 'GradientPatttern1';
S.fillPattern = 'gradient( GradientPattern1 )';
In the example above the properties of the gradient come from the gradient pattern's default values.
The arguments x1, y1, x2, y2, x3, y3 define one or two vectors used when creating the gradient. These vectors determine the direction and size of the gradient. Whether one or two
vectors are needed depend on the gradient type. If not specified in the options argument,
ProcSee Reference Manual
361
Standard pTALK Functions
Gradient (3pTALK)
the gradient type is determined by the gradient pattern's default value. The next table provides information about the available gradient types and the number of arguments and vectors needed to be specified for each of these.
Table 5: Vector arguments
Gradient Type
Arguments
Vectors
Linear
4
1
Elliptical
6
2
Circular
4
1
Rectangular
6
2
Square
4
1
A vector consists of two coordinate pairs, which is the vector (x1, y1) to (x2, y2) or the vector
(x1, y1) to (x3, y3). The vectors origin is the coordinate (x1, y1). Therefore, if specified, four
or six coordinates must be provided, otherwise an error message is issued. The interpretation
of these vectors depends on the flag coordType, which is specified with the options argument. See the options sections for more information about the values of this flag. The coordinates do not need to be specified as real or integer literals. One or more of these arguments
can be specified using a statement, i.e. an attribute, a variable, a function, etc.
S.fillPattern = 'gradient( G1, 0, 0, 1, 0 )';
\\ Default gradient type is linear
S.fillPattern = 'gradient( G2, 0.5, 0.5, 1, 0.5, 0.5, 1 )'; \\ Default gradient type is elliptical
The last argument options are optional. This argument is used when specifying properties
different from the gradient pattern's default values or which are impossible to specify when
creating the gradient pattern. The following table provides information about the available
options.
Table 6: Options
Flag
type
Abbreviation
t
Options
linear
elliptical
circular
rectangular
square
repeated
rep
true or false
reflected
ref
true or false
coordBaseObject
coordB
<shape or picture>
362
ProcSee Reference Manual
Standard pTALK Functions
Gradient (3pTALK)
Table 6: Options
Flag
coordType
Abbreviation
coordT
Options
sizeRelative
coord
offsetCoord
The flag type controls the shape of the gradient. Use this flag to change the type from the
gradient pattern's defaults, for instance: gradient( G1, "type=circular" ).
The flag repeated and reflected changes the repeated and reflected gradient pattern's default settings, respectively. The following statements are all legal: "repeated", "norepeated", "repeated=true", "repeated=false", "rep".
The flag coordBaseObject is used to let another shape or picture determine the size and
position of the gradient. This flag makes it possible to let the gradient be connected to a
bounding box of another shape or picture, and not the shape or picture the gradient function is assigned to. This option can be quite powerful when used properly, for instance in
classes where several shapes can use the same shape as coordinate base object. The following example illustrates this option, where the shape R and C are shapes in a class called
C1, where they use the shape B as coordinate base object.
class C1
{
polygon B
{
}
Rectangle R
{
fillPattern = 'gradient (G1, "coordBaseObject=B )';
}
Circle C
{
fillPattern = 'gradient( G1, "coordBaseObject=B )';
}
}
The flag coordType determine the interpretation of the vectors (x1, y1) to (x2, y2) and (x1,
y1) to (x3, y3). Note that this flag changes the interpretation of all the coordinates. If not
specified the default value of this flag is sizeRelative, which means that the coordinates
are relative to the shape or picture. Normally, these coordinates are specified in the range
[0, 1], but negative values and values larger than 1 are also accepted. For instance, the coordinates (0, 0) is in the upper left corner, (1, 1) is in the lower right corner, (0.5, 0.5), is
in the centre, (-1, 0) is to the left of the shape (actually, it is one times the width of the
bounding box to the left).
Setting the flag coordType to coord changes the coordinates to become absolute inside the
coordinate system the shape is located in. The following objects in ProcSee have their
own coordinate system, pictures, instances of user defined classes and trend. Legal values
ProcSee Reference Manual
363
Standard pTALK Functions
Gradient (3pTALK)
of the coordinates, when this option is used, are actually any legal floating point value, but
in practice are values inside the screen size normal. Examples of coordinates are, (20.5,
30.5), (100, 200), (-70, 400), etc.
When the flag coordType is set to the value offsetCoord, all coordinates are relative to the
shape or the picture the gradient is assigned to (can be changed by using the flag coordBaseObject). The coordinates (0, 0) is the shape's upper left, (100, 100) is 100 pixels to the right
and 100 pixels down from the shape's upper left corner.
EXAMPLES
// G1, G2 and G3 are gradients
Gradient* commonG = 0; // Attribute of type Gradient pointer
rectangle R1
{
fillPattern = �gradient( G1, 0, 0, 1, 1, "rep, ref" )�;
}
circle C1
{
fillPattern = �gradient( G2, 0.5, 0.5, 1, 0.5, 0.5, 1, "type=elliptical, coordB=R1" )�;
}
rectangle R2
{
fillPattern = �commonG�;
}
rectangle R3
{
fillPattern = �commonG�;
}
void constructor()
{
commonG = gradient( G3, 1, 0, 0, 0, "type=linear" );
}
364
ProcSee Reference Manual
Standard pTALK Functions
HashTable (3pTALK)
NAME
HashTable- provides functionality for storing and retrieving data.
SYNOPSIS
int
int
any
::List
int
int
int
int
char*
HashTable::clear();
HashTable::contains( any key );
HashTable::get( any key );
HashTable::getKeys( [::List* list ] );
HashTable::length();
HashTable::put( any key, any value );
HashTable::putAll( ::HashTable* from );
HashTable::remove( any key );
HashTable::toString( [char|char*] delimiter=’|’, [char|char*] keyValueDelimiter=’=’ );
HashTable*::newHashTable();
DESCRIPTION
HashTable objects provides functionality for storing and retrieving large amount of data
efficiently by using user defined keys to identify data elements in the hash table. When
putting data into the hash table the value to add is associated with a key. To retrieve a value from the hash table the key must be given and the corresponding data is returned. The
value 0 is returned if the key is not found in the hash table. The key can be character
strings or integral numbers. The value can be a number or a pointer. (E.g. pointers to symboltable elements like instances, or pointers to strings.)
HashTable can be created as attributes or as anonumous objects in functions or dialgoues
using the pTALK function newHashTable(). When the hash table is created, it is initially
empty. Note that the contents of the hash table is not stored when a picture, library or application is saved. HashTables created with newHashTable() is removed from memory
when there are no pointers left pointing to the created HashTable.
The HashTable function length() return the number of elements in the HashTable.
clear() clears the HashTable.
put() puts an element into the HashTable, at the position given by the argument key. If
the key is alredy in the HashTable, the value in the HashTable is replaced by the new value.
putAll() puts all elements found in the from HashTable into this HashTable. Values at
keys found in both HashTables will be replaced with the value in the from HashTable.
get() return the element specified by key. 0 if not found.
getKeys() returns a list of all the keys in the hash table. The function accepts one optional
argument, list of type ::List. If not specified a ::List object is created in the function. The
keys are added to the list and returned. The list returned can be used to traverse the items
in the hash table, i.e. for each key item in the list, use the function get() to return the value
associated with each key.
ProcSee Reference Manual
365
Standard pTALK Functions
HashTable (3pTALK)
contains() returns 0 if the specified key is not found in the HashTable, and a value != 0 if it
is found in the HashTable. If the values put into the HashTable are numbers, the value 0 will
return 0 from get(), but 1 from contains().
remove() remove the element specified by key from the HashTable.
toString() returns a string which is the concatenation af all elements in the HashTable, with
the given delimiter between each element. For each element the key and value will be given,
delimited by the keyValueDelimiter. Each key and value is converted to a string like using
the global pTALK function toString(). The delimiters can be a single character, or a string.
If no delimiter is given, the default is a single bar ’|’ between each element. If no keyValueDelimiter is given, the default is a the ’=’ character between the key and the value.
EXAMPLES
HashTable aHashTable
aHashTable.put( "Zero", 0 );
aHashTable.put( 1, "The number one" ); // Key can be integer.
aHashTable.put( "myKey", "myValue" );
aHashTable.put( "myKey", "otherValue" );
if ( aHashTable.contains( "Zero" ) )
printf( "Zero = %d", aHashTable.get("Zero") );
printf( "Value for myKey: %s", aHashTable.get("myKey") ); // prints Value for myKey: otherValue
HashTable* tmpHT = newHashTable(); // Creates a HashTable
tmpHT.put( "aKey", "aValue" );
tmpHT = 0;
// The hash table is removed from memory here.
void traverseShapeMap( ::HashTable* shapeMap )
{
::List* keyL = shapeMap->getKeys();
for ( int i = 0; i < keyL->length(); i++ )
{
Shape* s = (Shape *)shapeMap->get( keyL->get( i ) );
…
}
}
366
ProcSee Reference Manual
Standard pTALK Functions
Image (3pTALK)
NAME
Image - user interface component displaying an image.
SYNOPSIS
// attributes
char* Image::filename;
float Image::x;
float Image::y;
// functions
int Image::reload();
DESCRIPTION
The Image shape displays a graphical image in ProcSee.
The attributes x, y specifies the upper left corner of the image. The attribute filename is
the name of the graphical image file to load. This file can be a path relative to the application or an absolute path.
The function reload() loads the image from file if the image has changed on disk. It returns 1 on success, otherwise 0.
NOTE
The bmp and wmf file format is not available in the Unix versions of ProcSee.
SEE ALSO
Shape(3pTALK) in "ProcSee Reference Manual"on page 430
ProcSee Reference Manual
367
Standard pTALK Functions
Instance (3pTALK)
NAME
Instance - an object of class type.
SYNOPSIS
char* Instance::classFullName();
int Instance::changeClass( char* classFullName );
DESCRIPTION
All instances, share some common behaviour. Although the Instance class is not defined as such
in ProcSee, this common behaviour is still described here.
classFullName() returns the full name of the class from which this instance is created.
changeClass() changes the class this instance is of, keeping as many of the attribute values as
possible.
SEE ALSO
Shape(3pTALK) in "ProcSee Reference Manual"on page 430
368
ProcSee Reference Manual
Standard pTALK Functions
Interpolator (3pTALK)
NAME
Interpolator - linearly interpolating new values between a set of known values.
SYNOPSIS
// member functions
int
int
int
int
int
int
int
int
Interpolator::set( double in1, double out1, [char* i1,] double in2, double out2, ... );
Interpolator::modifyInterpolator( int interpolatorIndex, char* interpolator );
Interpolator::modifyInValue( int inIndex, double newInValue );
Interpolator::modifyOutValue( int outIndex, double newOutValue );
Interpolator::numPoints();
Interpolator::add([char* segment], double inValue, double outValue, int position = -1 );
Interpolator::insert( double inValue, double outValue, [char *segment], int position = 0 );
Interpolator::remove( int position = -1 );
double
double
double
double
double
Interpolator::minValueOut();
Interpolator::maxValueOut();
Interpolator::value( double inValue );
Interpolator::getInValue( int inIndex );
Interpolator::getOutValue( int outIndex );
char*
Interpolator::getInterpolator( int interpolatorIndex );
Interpolator*::newInterpolator();
DESCRIPTION
The Interpolator class linearly interpolate new values which lie between two or several
known values. The segments can be either linear or logarithmic. When an interpolator object is used, input values are mapped to a new coordinate system. The output value is calculated using an interpolation algorithm and the result is inside the range of legal values.
The legal values are specified when initializing the Interpolator using the member functions set(...), modifyInValue(...) or modifyOutValue(...).
The Interpolator object consist of two or several points. A point is composed of an input
value and an output value. Between each point in the Interpolator object is an interpolator segment. Each interpolator segment can be linear or logarithmic, which can be specified individually. There are numPoints() - 1 segments. If an input value is within the
range of legal values for a segment, the segment will interpolate the input value and calculate a value between the output values. The interpolation segments are specified using
strings. Legal options for the interpolation segments are:
• linear - linear segment.
• ln - logarithmic segment.
• noLowerLimit, noLoLim - the Interpolator does not check the lower limit. This option is valid for the first segment only.
• noUpperLimit, noUpLim - the Interpolator does not check the upper limit. This op-
ProcSee Reference Manual
369
Standard pTALK Functions
Interpolator (3pTALK)
tion is valid for the last segment only.
• equalInputs, eqInp - this option defines what to do if the lower and upper points’ input
values are equal, i.e. the slope is undefined. The default is that the output value of the
previous point is returned. If this option is specified the output value can be determined
using minium, maximum, middle or any value between the previous and next points’
output value. The legal options for this flag are:
- min - returns the minimum value of the previous and next points’ output values.
- mid - returns the middle value of the previous and the next points’ output values.
- max - returns the maximum value of the previous and next points’ output values.
- <value>, <value>% - this value must be specified in the interval [0,1] or [0,100]%.
The returned value will be calculated using a percentage of the difference between the
next and previous points’ output values.
Note that the input values must be specified in increasing order. The Interpolator object will
fail if an input value of 100 is followed by an input value of 10. In this case an error message
will be issued and the initialization data will not be accepted. When using logarithmic segments input values less or equal to 0 can not be accepted. The output values have no limit.
This paragraph only applies if the flags noUpperLimit or noLowerLimit are not specified. If
the input value does not lie inside the legal input value range, the output value will be cut
using either the output value of the first point or the last point. The output value of the first
point will be returned if the input value is less than the input value of the first point, and the
output value of the last point will be returned if the value exceed the input value of the last
point.
The function set(...) initializes an Interpolator object. This function accepts a variable number of arguments. The Interpolator is cleared if the set() function is called without arguments. If a single value is specified the Interpolator object will act as an offset, where the
offset value will be added to the input value. The set(...) function does not accept two or three
arguments. If more than three arguments are specified, two and two values can be viewed as
input and output pair or points. Each point is composed of an input value and an output value.
To specify a segment at least two points (four values) must be specified. Between each point
can an optional interpolation segment be specified, for instance "linear" or "ln". The default
is linear. In the following examples are i the Interpolator object. i.set( 0.1, 0, "ln", 10000,
50 ) specifies a logarithmic interpolation segment where the legal input range is within the
values 0.1 and 10000, and the output range is between 0 and 50. i.set( 0, 0, 1000, 100 ) specifies a linear interpolator which maps input values in the range 0 to 1000 to the output range
0 to 100. The last example illustrated how to use the set(...) function using the default interpolator function (linear). Several segments can be specified adding new points with an optional interpolator segment between each point. To specify four segments, five points must
be specified. An example: i.set( 0, 0, "lin", 1, 0, "ln", 1000, 200, "ln", 10000, 300, 100000,
350 ). The return value is 1 if the arguments was accepted by the set(...) function, otherwise 0.
modifyInterpolator(...) modifies the interpolation algorithm used by an interpolator segment. The first parameter interpolatorIndex specifies the interpolation segment to change.
This index must be in the range 0 to numPoints() - 1. The last argument interpolator is the
type of interpolation algorithm to use. The legal values for this argument is given in the list
above. The value 1 is returned if the input was accepted, otherwise 0.
370
ProcSee Reference Manual
Standard pTALK Functions
Interpolator (3pTALK)
modifyInValue(...) modifies the input value of the point specified with the argument inputIndex. The second argument newInValue is the point’s new input value. Note that this
function might fail if the input value is not inside the legal value range, that is, it can not
be less than the previous point’s input value or exceed the next point’s input value. The
input value affects the previous and the next interpolation segments as well. These segments will be recalculated. The segment(s) in question will be invalid if the input value is
not accepted by one or both of these segments. For instance setting the input value to 0 if
the next segment is logarithmic will be invalid because a logarithmic value of 0 is an illegal mathematical operation. A value of 0 is returned if this function fails, otherwise 1.
modifyOutValue(...) modifies the output value of the point specified with the argument
outputIndex. The second argument newOutValue is the point’s new output value. The
previous and next interpolation segments will be recalculated. A value of 1 is returned if
this function accepts the new value, otherwise 0.
numPoints() returns the number of points in the Interpolator object.
The function add(...) adds a new segment to the Interpolator object at the index specified
with the argument position. The segment will be added after the specified position. The
first argument segment is optional and can be omitted. The default type is linear if this
argument is not specified. The arguments inValue and outValue specify the input and
output values for the point, respectively. The last argument position is a default argument.
If this function is called without this argument, the segment will be appended to the Interpolator object.
The function insert(...) inserts the new segment to the Interpolator object at the index
specified with the argument position. Note that the segment will be inserted before the
specified position. The arguments inValue and outValue specify the input and output values for the point, respectively. The third argument segment is optional. The default type
is linear if the segment argument is not specified. The last argument position has a default
value of 0. If not specified, this function will insert the new segment first in the Interpolator object.
The function remove(...) removes a point and segment at the given position. If the argument position is not specified, then the last segment is removed from the Interpolator object.
minValueOut() returns the minimum output value of the points specified in the Interpolator object.
maxValueOut() returns the maximum output value of the points specified in the Interpolator object.
getInValue(...) returns the input value of the point at the index specified with the argument inIndex.
getOutValue(...) returns the output value of the point at the index specified with the argument outIndex.
value(...) returns an interpolated output value based on the input value passed in the argument inValue.
getInterpolator(...) returns the interpolator at the index specified with the argument interpolatorIndex. The index must be in the range 0 to numPoints() - 1.
ProcSee Reference Manual
371
Standard pTALK Functions
Interpolator (3pTALK)
The global function ::newInterpolator() creates a new local Interpolator object. This function is normally used to create temporary Interpolator objects used in local functions or in
Line, Polygon or TrendPres shapes.
EXAMPLE
// The following example illustrates how to connect Interpolator objects to a Line shape. The line will
// map the original points within the value range (200, 400) for x values and (300,500) for y values.
::Interpolator XInterpolator;
::Interpolator YInterpolator;
void constructor()
{
XInterpolator.set( 0, 200, 1000, 400 );
YInterpolator.set( 0, 300, 1000, 500 );
L.setInterpolatorX( XInterpolator );
L.setInterpolatorY( YInterpolator );
}
Line L
{
...
}
// The next example illustrates how to initialize an Interpolator object which is updated with new input
// values.
::Interpolator I;
void updateInterpolator( float in1, float out1, float in2, float out2 )
{
I.set( in1, out1, "noLowerLimit, noUpperLimit, equalInputs=0.5", in2, out2 );
}
SEE ALSO
Line(3pTALK) in "ProcSee Reference Manual"on page 376
TrendPres(3pTALK) in "ProcSee Reference Manual"on page 474
372
ProcSee Reference Manual
Standard pTALK Functions
iterators (3pTALK)
NAME
iterators - functions to get information about what objects are contained in an object.
SYNOPSIS
int createIterator( char* parentFullName, int mask );
char* nextFullName( int iteratorId );
void deleteIterator( int iteratorId );
DESCRIPTION
createIterator() creates an iterator that can be used to find all objects with the given parent and mask. The parentFullName and the mask have the same meaning as the name
and mask parameters used in the API function PfGetChildren(). The value returned is an
iteratorId, that is to be used by the other iterator functions. If the iterator was not created,
the value returned is <= 0.
nextFullName() returns the fullname of the next object, found by the given iterator. If no
more objects can be found, or the iteratorId is illegal, the return value is 0. When nextFullName() returns 0, the iterator is also freed.
deleteIterator() frees an iterator given in iteratorId. This should be done if the next fullname is not needed, and nextFullName() has not yet returned 0 for the given iteratorId.
SEE ALSO
PfGetChildren(3C) in "ProcSee Reference Manual"on page 200
ProcSee Reference Manual
373
Standard pTALK Functions
Layers (3pTALK)
NAME
Layers - functions for layers.
SYNOPSIS
Layer* ::newLayer(char* ownerFullName, char* name, char* behindLayer=0, char* flags=0);
int Layer::isDefault();
void Layer::setAsDefault();
int Layer::getVisibility();
void Layer::setVisibility(int visibility);
void Layer::moveBehind(char* behindLayer);
void Layer::toBack(int skipElems = 99999);
void Layer::toFront(int skipElems = 99999);
void Layer::addAlias(char* libLayer);
void Layer::delAlias(char* libLayer);
List* Layer::getAliases(List* L=0);
char* Layer::getOriginalName();
void Layer::setOriginalName(char* origName);
char* Shape::getLayer();
void Shape::setLayer(Layer* layer);
DESCRIPTION
The Layer objects determine the order that the shapes are drawn, and can be used to have
shapes inside classes that are assigned to different layers. When instances of these classes are
drawn, the shapes will be drawn in (application) layer order, making it possible to have e.g.
selection or alarm information in layers that are not dependent on the overlap order of nearby
shapes.
The following functions are used to create and change layers, and should normally only be
used by editor applications:
newLayer() creates a new Layer in ownerFullName, with the given name. If behindLayer is
specified, the new layer will be placed behind this layer, if not, the layer will be placed above
all other layers. If flags is set to "default", this layer will be made the default layer. If flags
are not set to "default", a default layer will be automatically created if none exists.
isDefault() returns 1 if this layer is the default layer, 0 if not. setAsDefault() sets this layer
as the default layer.
getVisibility() returns this layers visibility. setVisibility() sets this layers visibility.
moveBehind(), moves the layer behind the behindLayer. toBack() moves the layer behind
the other layers. toFront() moves the layer in front of the other layers. The skipElems argument controls the number of positions to move the layer.
addAlias() and delAlias() is used to add or delete aliases for the layer.
374
ProcSee Reference Manual
Standard pTALK Functions
Layers (3pTALK)
getAliases() returns a list of strings for the aliases for this layer. If a List is given as input
argument, the aliases of this layer is added to this list which is returned.
getOriginalName() gets the originalName for this layer if one is set, returns 0 if not. setOriginalName() sets the originalName.
A shape can be connected to a layer. If the shape is not connected to a layer, the shape will
use the same layer as its parent shape (e.g. if it is inside a group or an instance). A special
value "#default" makes the shape have the same layer as the instance it is inside.
getLayer() gets the layer this shape is connected to. setLayer() sets the layer this shape
is connected to.
SEE ALSO
Layers on page 50, in "ProcSee Reference Manual", chapter "The Configuration Language".
ProcSee Reference Manual
375
Standard pTALK Functions
Line, Polygon (3pTALK)
NAME
Line/Polygon - multi-segment line and polygon shape.
SYNOPSIS
// NOTE: These functions are also available in the Polygon class
// Attributes:
float* Line::x;
float* Line::y;
// Methods:
int
Line::numberOfPoints();
void
Line::setX( int point, float value );
void
Line::setY( int point, float value );
void
Line::setDynamicX( int point, char* dynamicValue );
void
Line::setDynamicY( int point, char* dynamicValue );
void
Line::set( char* xDynamicValue, char* yDynamicValue );
void
Line::get( char** xDynamicValue, char** yDynamicValue );
void
Line::addPoint( float x, float y, int maxNumberOfPoints = -1 );
void
Line::removePoint( int pointNo );
float Line::getX( int point );
float Line::getY( int point );
char* Line::getDynamicX( int point );
char* Line::getDynamicY( int point );
::Interpolator* Line::getInterpolatorX();
::Interpolator* Line::getInterpolatorY();
void
Line::setInterpolatorX( ::Interpolator* xI );
void
Line::setInterpolatorY( ::Interpolator* yI );
void
Line::setCapStyle( int capStyle );
void
Line::setJoinStyle( int joinStyle );
int
Line::getCapStyle();
int
Line::getJoinStyle();
DESCRIPTION
Line and Polygon are graphics shapes. These are very similar except for the fact that lines
are open, i.e. have different start and end points, while polygons are closed and can have fill.
The two classes do however share the same set of member functions and editing behaviour
to be described in the following.
When the picture is in edit mode, you can manipulate the line or polygon shape with the
mouse. The following operations are defined if the cursor is currently on a marker, i.e. on a
line/polygon point:
left button drag
Move point
control left button click Delete point
The following operations are defined if the cursor is currently on a line/polygon segment, i.e.
not on any line point:
left button drag
376
Move whole line/polygon
ProcSee Reference Manual
Standard pTALK Functions
Line, Polygon (3pTALK)
control left button click Add point on this line/polygon segment
The following attributes are defined in both Line and Polygon:
The attributes x and y give direct access to the points in the Line/Polygon. These attributes
are of type float array. Individual elements in the array can be modified or values can be
returned using the array index operator [], for instance float v = l.x[2], l.x[10] = 3, l.y[1]
= ВґSQ_32.valueВґ, char* d = @l.y[4], etc. To return a pointer to the array use the attributes
x or y without the array operator, for instance float* lx = l.x. The attributes x and y replaces
the functions getX(), getY(), setX(), setY(), setDynamicX(), setDynamicY(), getDynamicX() and getDynamicY().
The following member functions are defined in both Line and Polygon:
numberOfPoints() returns the number of definition points in the shape.
Individual Line/Polygon points have to be manipulated using the setX(), setY(), setDynamicX(), setDynamicY(), set(), getX(), getY(), getDynamicX(), and getDynamicY().
setX() and setY() are used to give static values to an x- or y-coordinate, respectively. The
point index is given as first parameter, which has a range from 0 to numberofPoints()-1.
The second parameter is the new value, given as a floating point number in picture coordinates.
setDynamicX() and setDynamicY() are used to give dynamic values to an x- or y-coordinate, respectively. The point index is given as first parameter, which has a range from 0
to numberofPoints()-1. The second parameter is the new dynamic value, given as a
pTALK source code string.
set() is used to bind the coordinates of a line dynamically to two arrays, one for the x coordinates, and one for the y coordinates. The arguments are given as pTALK source code
strings, the first on for the x coordinates, and the second one for the y coordinates. get()
is used to get these array dynamics back if they were set.
addPoint() is used to add a new point to the line. The coordinate of the point is given by
x and y. The last argument maxNumberOfPoints is optional. If this argument is specified
it gives the total number of points the line accepts. If the line has more points than maxNumberOfPoints these points will be removed starting from index 0.
removePoint() is used to remove an existing point on the line. The point is given by pointNo.
getX() and getY() return the current value of an x- or y-coordinate, respectively. The parameter point is the index, i.e. line point number in the range 0 to numberOfPoints()-1.
The value returned is a floating point number given in picture coordinates. Note that these
functions works also for dynamically bound coordinates; the current value is then returned as a constant.
getDynamicX() and getDynamicY() return the dynamic binding of an x- or y-coordinate,
respectively. The parameter point is the index, i.e. line point number in the range 0 to numberOfPoints()-1. The value returned is the dynamic binding as a pTALK source code
character string. Note that these functions works also for statically bound coordinates; an
empty string is then returned.
ProcSee Reference Manual
377
Standard pTALK Functions
Line, Polygon (3pTALK)
getInterpolatorX() and getInterpolatorY() return the Interpolator used to calculate the x- or
y-coordinates of points in the Line/Polygon, respectively. The value 0 is returned if no Interpolator is specified for the x- or y-coordinate. To set an interpolator, use the functions
setInterpolatorX(...) or setInterpolatorY(...).
setInterpolatorX(...) and setInterpolatorY(...) set or clear the x or y Interpolator objects
used by the Line/Polygon shape, respectively. These functions accept one argument, an Interpolator object. Setting the argument to the value 0 will clear the Interpolator object used
by the Line/Polygon shape. The purpose with the interpolator is to map either the x or y
points or both points into a new coordinate system.
setCapStyle(...) determines how the end points of the line are displayed. The following cap
styles can be set on the Line shape: butt (1), round (2) and square (3). These constant values
are available in the enum LineCap. The default value of the cap style is butt.
setJoinStyle(...) determines how the line segments meeting at the corners should be displayed. The following join styles can be set on the Line and Polygon shapes: bevel (16), miter (48) and round (32). These constant values are available in the enum LineJoin. The
default value of the join style is miter for the Polygon shape and bevel for the Line shape.
getCapStyle() returns current line cap style and getJoinStyle() returns current line join style.
Note that the cap style functions are not available in Polygon shape.
SEE ALSO
Shape(3pTALK) in "ProcSee Reference Manual"on page 430
378
ProcSee Reference Manual
Standard pTALK Functions
Linestyle (3pTALK)
NAME
Linestyle - linestyle functions
SYNOPSIS
Linestyle* Application::getLinestyle( int linestyle,
::ResourceStyle* rs=0 );
DESCRIPTION
The Application::getLinestyle() function returns a pointer to the Linestyle that is given
as input argument. Used to convert integer linestyle index back to the Linestyle it represents. An optional ResourceStyle can be given.
ProcSee Reference Manual
379
Standard pTALK Functions
List (3pTALK)
NAME
List- functions used to handle lists.
SYNOPSIS
int
int
int
int
int
int
any
any
int
char*
char*
List::length();
List::insert( any elem, int positon = 0 );
List::add( any elem, int position = -1 );
List::sort( int (*sortFunc)( any v1, any v2 ) );
List::clear( int fromPos = 0, int length = -1 );
List::copy( ::List* fromList, int fromPos = 0, int length = -1 );
List::get( int position );
List::remove( int position );
List::concat( ::List* fromList, int fromPos = 0, int length = -1,
int insPos = -1);
List::toString( char delimiter = ’|’ );
List::toString( char* delimiter );
List*
::newList();
DESCRIPTION
List objects can hold numbers and pointers. (E.g. pointers to symboltable elements like instances, or pointers to strings.)
Named List objects are created like attributes. The content of a list is not saved or documented, so it is initially empty.
Anonymous List objects can be created with the function newList(), which creates a List object, and returns a pointer to it. When there are no pointers left pointing to the created List, it
will be removed automatically.
The List function length() return the number of elements in the List.
insert() inserts an element into the List. If the argument position is not used, the element is
inserted first in the list, else it is inserted before this position. Return value is the position if
OK, else -1.
add() adds an element to the end of the List. If the argument position is used, the element is
inserted after this position. Return value is the position if OK, else -1.
sort() sort the List, using the user made pTalk function sortfunc. sortfunc takes two arguments of any type. Return < 0 if v1 is less than v2, 0 if v1 is equivalent to v2 and > 0 if v1 is
greater than v2 if an increasing sort is taking place, see example below. Return value is the
number of sorted elements if OK, else -1.
clear() clear length elements from the List, from the fromPos argument. If not length is given, clear to the end of the List. Return value is the number of cleared elements if OK, else -1.
copy() clear the List and copy length elements starting at fromPos in the fromList to List.
Return value is the number of copied elements if OK, else -1.
get() return the element specified by position. 0 if failed.
380
ProcSee Reference Manual
Standard pTALK Functions
List (3pTALK)
remove() remove the element specified by position from the List. Return a pointer to the
element that is removed if OK, else 0.
concat() inserts a subset of fromList into the List at insPos. The fromList subset is
length elements starting at fromPos in the fromList. If insPos is -1 (it’s default), the
fromList subset is appended to the List. If length is -1 (it’s default), all elements after
fromPos is inserted
toString() returns a string which is the concatenation af all elements in the list, with the
given delimiter between each element. Each element is converted to a string like using the
global pTALK function toString(). The delimiter can be a single character, or a string. If
no delimiter is given, the default is a single bar ’|’ between each element.
EXAMPLES
List aList;
int I1 = 6;
int I2 = 3;
int I3 = 5;
int sortFunc( int v1, int v2 )
{
if( v1 > v2 ) return 1;
if( v1 == v2 ) return 0;
return -1;
}
aList.add( I1 );
aList.add( I2 );
aList.add( I3 );
aList.sort( sortFunc );
List* tmpList = newList(); // Creates a List
tmpList.add( I1 );
tmpList = 0;
// The list is removed from memory here.
ProcSee Reference Manual
381
Standard pTALK Functions
load, display (3pTALK)
NAME
load, display - routines for loading and displaying pictures, libraries, and applications
SYNOPSIS
int load( char* fileName, char* flags = "" );
void displayPicture( char* windowName, char* pictureName, char* flags = "async, uc, map" );
DESCRIPTION
load() loads the picture, library or application given by fileName from file. If the file is a
picture, then this picture is not displayed. The argument is a complete file name (i.e. a .ppic,
.plib, or .pctx file). If the file is a picture object which is already present internally in RTM,
the picture will still be loaded and replace the old representation.
Additional functionality can be specified with the flags argument. load() accepts the following options for the flags argument:
• comPersistSeparateFile - this flag only applies when loading an old file saved with version 3.3 or earlier of ProcSee. It controls how to handle the persist mode used by the
ComShape and the ComObject. If this flag is specified the persist mode will be set to the
value 2, meaning that the ComShape’s and the ComObject’s configuration data will be
saved in a separate COM file. If this flag is false, which is the default, the persist mode
will be set to the value 1. In the latter case the ComShape’s and the ComObject’s configuration data will be saved together with the object.
• rename - this flag renames the picture, library or application when it is loaded. To specify a new name use the following syntax: rename=NewName, where NewName is the
new name of the picture, library or application. It is a replacement for the pTALK sequence load() followed by rename().
• scope - specifies the fullname of the entry in the rtm where the load function is executed.
This flag is not applicable when the file to load is an application (pctx file). Use the following syntax to specify the scope: scope = fullname. fullname is either application or
library. Notice that library scope is legal only when loading pictures (ppic files).
load() returns 0 on success, otherwise an error code describing the failure is returned. The
api function PfGetSystemError(3c) or the pTALK function getErrorString() can be used
to obtain the error text corresponding to the error code.
displayPicture() displays the picture given by pictureName in the window given by windowName. If pictureName is not a file name, the picture must already be loaded in the RTM.
If pictureName is a complete picture file name, displayPicture() will attempt to load the picture from the specified file if the picture does not already exist in the RTM. If the window is
not mapped, it will by default be mapped by displayPicture().
With the flags argument additional functionality can be specified. displayPicture() accepts
the following options for the flags argument:
• asynchronous/synchronous - a boolen flag inidicating whether to run the displayPicture() immediately (synchronous) or put it on an internal queue (asynchronous) and perform the action at a later stage. The default value for this flag is asynchronous. No
assumptions about the picture being loaded or displayed can be made immediately after
382
ProcSee Reference Manual
Standard pTALK Functions
load, display (3pTALK)
the call when running displayPicture() asynchronously.
• unmapChildren - a boolean flag indicating whether to unmap the sub windows when
displaying the picture or leave the sub windows as is. The default value for this property is true. The flag uc is an abbreviation for unmapChildren. When the picture is
already displayed in the window, this property is ignored, and the sub-windows are
not unmapped.
• map - by specifying map=false, the window will not be mapped by displayPicture().
The default is to map the window (map=true).
EXAMPLES
load("./pictures/MyPicture.ppic");
// the following usage of displayPicture assumes that MyPicture already
// exists in the RTM
displayPicture("MainWindow", "MyPicture");
// the following usage of displayPicture will load MyPicture from file
// if it is not already loaded
displayPicture("MainWindow", "./pictures/MyPicture.ppic");
// The following example will display the picture immediately and leave all sub-windows as is.
displayPicture( "TrendWindow", "./pictures/TrendPic.ppic", "async=false, uc=false" );
SEE ALSO
remove(3pTALK) in "ProcSee Reference Manual"on page 416
save/document(3pTALK) in "ProcSee Reference Manual"on page 425
Picture(3pTALK) in "ProcSee Reference Manual"on page 395
Window(3pTALK) in "ProcSee Reference Manual"on page 488.
ProcSee Reference Manual
383
Standard pTALK Functions
math (3pTALK)
NAME
log, log10, exp, pow, floor, ceil, round, roundToInt, fabs, abs - mathematical utility functions
SYNOPSIS
double log( double x );
double log10( double x );
double exp( double x );
double pow( double x, double y );
double floor( double x );
double ceil( double x );
double round( double x );
int roundToInt( double x );
double fabs( double x );
int abs( int x );
DESCRIPTION
The log() function returns the natural logarithm of x. The log10() function returns the base
10 logarithm of x. The exp() function returns the exponential function of x (e to the power
of x). The pow() function returns x to the power of y. pow(x,y) = xy
The floor() functions returns the largest integer less than or equal to x. The ceil() function
returns the smallest integer greater than or equal to x. The round() function returns the integer closest to x. The roundToInt() function returns an integer closest to x.
The fabs() and abs() functions returns the absolute value of x.
SEE ALSO
log(3), log10(3), exp(3), pow(3), floor(3), ceil(3), fabs(3)
384
ProcSee Reference Manual
Standard pTALK Functions
Matrix (3pTALK)
NAME
Matrix – a rectangular array of double values
SYNOPSIS
// member functions:
void Matrix::clear();
void Matrix::set( int row, int column, double value );
int Matrix::columns();
int Matrix::rows();
int Matrix::isNull();
int Matrix::isSquare();
int Matrix::isIdentity();
int Matrix::isSymmetric();
int Matrix::isOrthogonal();
int Matrix::isDiagonal();
int Matrix::isTriangular();
int Matrix::isUpperTriangular();
int Matrix::isLowerTriangular();
int Matrix::isEqual( ::Matrix* m1, ... );
double Matrix::determinant();
double Matrix::trace();
double Matrix::get( int row, int column );
::Matrix* Matrix::identity();
::Matrix* Matrix::inverse();
::Matrix* Matrix::transpose();
::Matrix* Matrix::cofactors();
::Matrix* Matrix::adjoint();
::Matrix* Matrix::add( ::Matrix* m1, ... );
::Matrix* Matrix::subtract( ::Matrix* m1, ... );
::Matrix* Matrix::multiply( [::Matrix* m1 | double s1], ... );
// Static functions:
int
Matrix::isEqual( ::Matrix* m1, ::Matrix* m2 );
::Matrix* Matrix::identity( ::Matrix* m );
::Matrix* Matrix::inverse( ::Matrix* m );
::Matrix* Matrix::transpose( ::Matrix* m );
::Matrix* Matrix::cofactors( ::Matrix* m );
::Matrix* Matrix::adjoint( ::Matrix* m );
::Matrix* Matrix::add( ::Matrix* m, , ::Matrix* m2,… );
::Matrix* Matrix::subtract( ::Matrix* m1, ::Matrix* m2, … );
::Matrix* Matrix::multiply( [::Matrix* m1 | double s1],
[::Matrix* m2 | double s2], ... );
// create functions:
::Matrix* ::newMatrix( int row, int column );
::Matrix<int rows, int columns> name;
ProcSee Reference Manual
385
Standard pTALK Functions
Matrix (3pTALK)
DESCRIPTION
The class for the matrix data type is called Matrix in ProcSee. A matrix is a rectangular array
of numbers. The size of the matrix is called its order, and it is denoted by rows and columns.
By convention, rows are always mentioned first. So a matrix of order 3 by 2 is a matrix of 3
rows and 2 columns. An element in a matrix is always denoted by ij, where i is the row and
j is the column. ProcSee supports only some of the basic elementary algebraic operations on
matrices. The elements in the matrix are represented by double values.
Several Matrix functions are defined both as member functions and as static functions.
When a member function is called on a Matrix object the modification will apply to the object itself and not to a copy. If M for example is an object of type Matrix and the identity()
method is called the effect of the operation will be on M, for instance ::Matrix* identityM =
M. identity(). In this example the Matrix variable identityM will point to the same object as
M points to. Several of the Matrix member functions will return a pointer to itself when they
succeed, otherwise null. When the static Matrix functions are called, new matrices are created and returned. The modifications will not apply to any of the Matrix objects which where
passed as arguments to the Matrix functions, but to the matrix created in the function. Calling the same identity() method as above using the static function will not modify the matrix
M, but instead return a new matrix initialized with the identity matrix. For instance ::Matrix*
identityM = ::Matrix.identity( M ).
A Matrix in ProcSee can be created as an attribute or as a local variable. To create a matrix
as an attribute, use the syntax:
::Matrix<int rows, int columns> name;
Where name is the name of the attribute and rows and columns are the size of the matrix. To
create a Matrix attribute called M with 4 rows and 3 columns use the following syntax:
::Matrix<4,3> M;
To create a Matrix as a local variable, i.e. in functions or dialogues, use the global function
newMatrix( int row, int column ). This function returns a pointer to a Matrix of the specified size. The Matrix is released from memory when no pointers point to it anymore. To
create a local Matrix variable with 10 rows and 2 columns, use the following syntax: Matrix* LM = newMatrix( 10, 2 ); , where LM is the name of the local variable. All matrices
created as attributes or as local variables are by default initialized to zero, that is all elements
in the rectangular array are set to the value 0.0.
To get the number of rows and columns of a matrix use the functions rows() and columns(),
respectively.
Individual elements in a matrix can be accessed using the member functions set( int row, int
column, double value ) and get( int row, int column ). To set the ij element in a matrix use
the function set(…), where i denotes the row and j denotes the column. To get an element in
the matrix use the function get(…).
The function clear() resets all the elements in the matrix to the value 0.0.
isNull() returns true when all the element in the matrix are 0.0.
isSquare() returns true when the rows and columns in the matrix are equal, e.g. a 2 by 2 matrix, a 5 by 5 matrix etc.
386
ProcSee Reference Manual
Standard pTALK Functions
Matrix (3pTALK)
The functions transpose() and ::Matrix.transpose( ::Matrix* m ) converts the m by n
matrix into an n by m matrix, by flipping the rows and the columns. The transpose of the
matrix is formed by interchanging the rows and the columns. The transpose of a matrix A
is denoted AT. After transposing the matrix the value A.get( i, j ) is equal to AT.get( j, i )
for all elements of A.
The functions add( ::Matrix* m, … ) and ::Matrix.add( ::Matrix* m1, ::Matrix* m2,
… ) adds two or more matrices of the same sizes together. Notice that this function will
fail if the matrices to be added have different order, that is different number of rows or
columns. On failure a null pointer is returned.
The functions subtract( ::Matrix* m, … ) and ::Matrix.subtract(::Matrix* m1, ::Matrix* m2, … ) subtracts two or more matrices of the same sizes together. It is analogous
to the method add(…).
The functions multiply( [::Matrix* m1 | double s1], … ) and ::Matrix.multiply( [::Matrix* m1 | double s1], [::Matrix* m2 | double s2], … ) multiplies two or more matrices
together, or one or several scalar numbers. When multiplying two matrices the order of
the matrices do matter, that is the number of columns of the first matrix must be equal to
the number of rows of the next matrix, etc. The size of the resulting matrix is the row of
the first matrix and the columns of the last matrix. Multiplication of the three matrices A(
3, 2 ), B( 2, 5 ) and C( 5, 4 ) will produce a matrix of size 3 by 4. This function will fail if
the matrices are not conformable, i.e. they are not of the correct sizes. On failure a null
pointer is returned.
Some matrix operations can only be applied if the matrix is square, i.e. it must have the
same number of rows and the same number of columns. This applies to the following
functions. determinant(), trace(), identitiy(…), inverse(…), cofactors(…) and adjoint(…). These functions fail if the matrix is not square.
The function determinant() calculates the determinant of the matrix.
The function trace() calculates the trace of the matrix, that is the sum of the elements of
the leading diagonal.
identity() and ::Matrix.identity( ::Matrix* m ) are used when initializing a matrix to the
identity matrix. An identity matrix is a square matrix where the elements on the leading
diagonal are 1 and all the other elements are 0.
The functions cofactors() and ::Matrix.cofactors( ::Matrix* m ) calculates the cofactor
matrix. It returns a null pointer if it fails.
The functions adjoint() and ::Matrix::adjoint( ::Matrix* m ) calculates the adjoint of
the matrix. The adjoint of a matrix is the transpose of the cofactor matrix. It returns a null
pointer if it fails.
The functions inverse() and ::Matrix.inverse( ::Matrix* m ) calculates the inverse of a
matrix. An inverse matrix of A is denoted A-1. Notice that not all matrices have an inverse.
To determine whether the inverse of a matrix can be calculated or not use the determinant() function. The determinant returns a non-zero value if the inverse matrix can be
found. The inverse() function returns a null pointer on failure.
The function isIdentity() returns true if the matrix is an identity matrix, otherwise false.
See the description of the function identity() for more information.
ProcSee Reference Manual
387
Standard pTALK Functions
Matrix (3pTALK)
The function isDiagonal() returns true if the matrix is a diagonal matrix. A diagonal matrix
is a matrix in where the elements are zero except for the elements on the leading diagonal.
The function isSymmetric() returns true if the matrix is symmetric. A symmetric matrix is a
matrix where all the elements is symmetrical about the leading diagonal, that is the element
Aij is equal to Aji for all elements of matrix A. A symmetric matrix is equal to its transpose
that is A = AT.
The function isOrthogonal() returns true if the matrix is orthogonal. An orthogonal matrix
has the characteristic that it is always invertible and the inverse matrix is orthogonal. Another
characteristics of an orthogonal matrix is the fact that AAT=I , where I denotes the identity
matrix.
The functions isUpperTriangular(), isLowerTriangular() and isTriangular() returns true
if the matrix is triangular. An upper-triangular matrix is a matrix where all the entries below
the leading diagonal are zero. A lower-triangular matrix has all its entries above the main diagonal set to zero. A matrix that is either upper- or lower-triangular is called triangular.
The functions isEqual( ::Matrix* m1, … ) and ::Matrix.isEqual( ::Matrix* m1, ::Matrix
* m2, … ) returns true if the matrices m1, m2, etc. have the same sizes and their corresponding entries are equal.
EXAMPLES
::Matrix<2,4> M1; // Attributes
::Matrix<4,2> M2;
::Matrix* P1; // Pointer attribute
...
void testFunc()
{
::Matrix* lM = newMatrix( 2, 2 ); // Create local matrix
lM->identity();
lM->set( 0, 1, 4 );
lM->set( 1, 0, 2 );
// The result will be returned in P1. It will not modify
// M1 or M2. The result is a 2 by 2 matrix.
P1 = ::Matrix.multiply( M1, M2 );
// Multiply P1 with the value 3.14. The call will modify
// the matrix P1.
P1->multiply( 3.14 );
// The addition of P1 and lM will be returned in sumM,
// a new local variable.
::Matrix* sumM = ::Matrix.add( P1, lM );
// The next function will fail because M1 and M2 cannot
// be added due to different sizes. A null pointer will
// be returned.
sumM = ::Matrix.add( M1, M2 );
}
388
ProcSee Reference Manual
Standard pTALK Functions
Matrix (3pTALK)
SEE ALSO
ProcSee Reference Manual
389
Standard pTALK Functions
min,max,arrayMinIndex,arrayMaxIndex
NAME
min- returns the minimum value in a set of values.
max- returns the maximum value in a set of values.
arrayMinIndex - returns the index of the minimum value in an array.
arrayMaxIndex - returns the index of the maximum value in an array.
SYNOPSIS
any min( any v1, any v2, ... );
any max( any v1, any v2, ... );
int arrayMinIndex( any array, int last = 0, int startIx = 0, int length = 0 );
int arrayMaxIndex( any array, int last = 0, int startIx = 0, int length = 0 );
DESCRIPTION
min returns the minimum value and max returns the maximum value in a set of values, respectively. The arguments to these functions can be any number or array of numbers, like
integers, unsigned integers, double, array of integers, etc. These function accepts a variable
number of arguments.
The data type returned from the min or max function is the data type of the minum or maximum value to return. If for instance the minimum value is an integer, the return type is integer, if the minimum value is a double, the return type is a double, etc.
arrayMinIndex( ... ) returns the index of the minimum value in the array passed as argument, and arrayMaxIndex( ... ) returns the index of the maximum value in the array. The
first argument array is an array of type short, int, float or double.
The second argument last determines whether to start searching from the last element going
backward, or starting from the first element going forward. This flag has a meaning only if
there is a possibility that several elements in the array can have equal values. If last is 1, the
last index with the minimum/maximum value is returned, otherwise the first index. The default value for this argument is start searching from index startIx.
The third argument startIx is the index in the array where to start searching for the minimum
or the maximum value. The default value of this argument is 0.
The last argument length is the number of elements in the array to search for the minimum
or the maximum value, starting from startIx. The default value of this argument is 0, which
means use the length of the array.
EXAMPLE
float fA[3] = { 3.14, 2.71, 12.3 };
int iA[4] = { 1, 2, 3, 4 };
int aI[6] = { 3, 2, 4, 5, 3, 2 };
void test()
{
390
ProcSee Reference Manual
Standard pTALK Functions
int
iMin
int
iMax
double dMin
double dMax
min,max,arrayMinIndex,arrayMaxIndex
= min( 12, 13, iA, 3 );
= max( iA, 4 );
= min( iA, fA, 4, 3 12.34 );
= min( 3.43, 12.43, 34.56, 654.4, 12.99 );
int i1 = arrayMinIndex( aI );
int i2 = arrayMinIndex( aI, 1 );
int i3 = arrayMinIndex( aI, 0, 2 );
int i3 = arrayMinIndex( &aI[2] );
// Returns 1
// Returns 5
// Returns 5, while
// this function call returns index 3.
}
ProcSee Reference Manual
391
Standard pTALK Functions
message (3pTALK)
NAME
message - message broadcasting
SYNOPSIS
void message( int category, char* text, ... );
DESCRIPTION
message() broadcasts the text message given as argument text to all external processes subscribing to the message category given as first argument.
The argument text can contain all formatting options supported by printf(), and can be followed by optional arguments to be formatted.
N
The category is an integer with only 1 bit set, i.e on the form 2 , where N is in the range 031. Values in the range 0-15 is reserved for predefined message categories while bits in the
range 16-31 can be used freely to define own message categories.
A list of some useful predefined message categories follows. The category masks indicated
are available in the header file <P3Misc.h> :
Bit
Mask
Comment
0
CompilationErrors
Errors in pTALK source code
1
CompilationWarnings
Warnings in pTALK source code
2
RunTimeErrors
Run-Time messages from Virtual Machine
3-7
StatusMessages
Miscellaneous status messages
8 - 12
ErrorMessages
Miscellaneous error messages
SEE ALSO
PfDiagnosticsSubscribe(3C) in "ProcSee Reference Manual"on page 182
392
ProcSee Reference Manual
Standard pTALK Functions
Object (3pTALK)
NAME
Object - a base class for all user interface components
SYNOPSIS
// member functions:
char* Object::name();
char* Object::fullName();
Object* Object::owner();
char* Object::metaClass();
int
Object::isMetaClass( char* mClass );
These functions are available in all objects in ProcSee.
name() returns the name of the object, if the object is anonymous, "" is returned.
fullName() returns the fullname of the object. For anonymous objects, the fullName contains the hexadecimal id code for this object instead of the name. Names that contain illegal characters are quoted with ’$’s around the name.
owner() returns the owner of the object. Typically the owner of a picture, is the application.
metaClass() returns the name of the meta class of the object. The meta class of a rectangle
is Rectangle, and so on. The available class names are listed below.
isMetaClass() returns 1 if the class name passed as argument in mClass matches the object class, or one of the classes the objects’ meta class inherits from. E.g. the isMetaClass
function called on a rectangle, returns true both when the mClass argument is "Rectangle"
and when the mClass argument is "Shape". The mClass argument must be a meta class,
like one of the class names listed below:
Window, Picture, Class, Library, TrendLog, Application, Rectangle, RoundRect, Circle,
CircleArc, Ellipse, EllipseArc, DialogueArea, Text, Image, Line, Polygon, Instance, Dialogue, Group, Scale, Trend, TrendGrid, TrendRuler, TrendPres, TimeTag, Colour, Font,
Pattern, Linestyle, Cursor.
ProcSee Reference Manual
393
Standard pTALK Functions
Pattern (3pTALK)
NAME
Pattern - pattern functions
SYNOPSIS
Pattern* Application::getPattern( int pattern,
::ResourceStyle* rs = 0 );
DESCRIPTION
The Application::getPattern() function returns a pointer to the Pattern that is given as input
argument. Used to convert integer pattern index back to the Pattern it represents. An optional
ResourceStyle can be given.
394
ProcSee Reference Manual
Standard pTALK Functions
Picture (3pTALK)
NAME
Picture - user interface component for displaying graphics
SYNOPSIS
// attributes:
float Picture::angleSnap;
int
Picture::crosshairFollowSnap;
int
Picture::crosshairLength;
int
Picture::crosshairVisibility;
int
Picture::gridMajor;
int
Picture::gridMinor;
float Picture::oneToOne;
float Picture::radiusSnap;
float Picture::rotationAngle;
int
Picture::updateMode;
float Picture::worldX;
float Picture::worldY;
float Picture::worldWidth;
float Picture::worldHeight;
float Picture::xReference;
float Picture::yReference;
float Picture::xScaleFactor;
float Picture::yScaleFactor;
float Picture::xSnap;
float Picture::ySnap;
int
Picture::backgroundColour;
int
Picture::foregroundColour;
int
Picture::pattern;
int
Picture::resizeMode
// member functions:
void
Picture::align( int alignment );
void
Picture::adjustColours( ::Matrix* fillM = 0,
::Matrix* borderM = 0 );
void
Picture::clear();
void Picture::clearKeyFocus();
void
Picture::copy();
void
Picture::cut();
void
Picture::distribute( int distribution );
int
Picture::exportEMF( char* destination, int x=0, int y=0
int width=0, int height=0, char* options=0 );
int
Picture::freeze(int mode = -1);
char* Picture::fullName();
char* Picture::getDynPrimitiveAttr( int attribute );
Shape* Picture::getKeyFocusShape()
int
Picture::getPictureFlags();
int
Picture::getPrimitiveAttr( int attribute );
int
Picture::getShapesWithinCircle( float x, float y, float radius,
List* toList,
any (*selectFunc)(Shape*) = 0,
int maxShapes = 0,
char* flags = 0 );
void
Picture::group();
ProcSee Reference Manual
395
Standard pTALK Functions
Picture (3pTALK)
bool
Picture::isDisplayed();
bool
Picture::isIconic();
bool
Picture::isInEditMode();
bool
Picture::isMapped();
bool
Picture::isViewable();
void
Picture::lower();
void
Picture::map();
void
Picture::moveCursor( float x, float y);
void
Picture::moveSelected( int dx, int dy );
char* Picture::name();
int
Picture::numberOfSelected();
void
Picture::pan( float x, float y );
void
Picture::paste();
void
Picture::raise();
int
Picture::selectAllIn( int mode, float x, float y,
float width, float height );
int
Picture::selectShape( int mode, char* shapeFullName );
void
Picture::setDynPrimitiveAttr( int attribute, char* value );
void
Picture::setCursor( int cursor=-2 );
void
Picture::setFocus();
void
Picture::setPictureFlags(int flags);
void
Picture::setPrimitiveAttr( int attribute, int value );
Shape* Picture::shapeAt( float x, float y, int level = 0 );
char* Picture::shapeFullNameAt( float x, float y, int level = 0);
void
Picture::sound( int volume, int pitch, int duration );
Window* Picture::theWindow();
void
Picture::title( char* s );
void
Picture::toBack();
void
Picture::toFront();
void
Picture::ungroup();
void
Picture::unmap();
void
Picture::unmapChildren();
void
Picture::updatePicture();
float Picture::xSnapped( float x );
void
Picture::xy2dxy( float wx, float wy, int* dx, int* dy );
int
Picture::xy2sx( float wx, float wy );
int
Picture::xy2sy( float wx, float wy );
float Picture::xy2wx( int sx, int sy );
float Picture::xy2wy( int sx, int sy );
int
Picture::xy2winxy( float inX, float inY, int* outX, int* outY );
int
Picture::winxy2xy( int inX, int inY, float* outX, float* outY );
float Picture::ySnapped( float y );
void
Picture::zoom( double scale );
double Picture::zoomFactor();
DESCRIPTION
xSnap and ySnap are attributes used in edit mode when new shapes are introduced, moved,
or resized. The values for xSnap and ySnap (given in world coordinates) form an invisible
grid to which points snap. For creation and resizing, the definition points itself snap to the
grid, for motion the motion takes place in multiples of the snap size. angleSnap is given in
degrees and applies to opening and start angles for circular and elliptical arcs. ;Picture:radi-
396
ProcSee Reference Manual
Standard pTALK Functions
Picture (3pTALK)
usSnap applies to the radii of circles and circular arcs. Initial snap sizes are all 0, which
means that snap is disabled. Negative snap settings are ignored by RTM(1), but is interpreted by GED(1) as a disabled snap setting.
crosshairLength, crosshairFollowSnap, and crosshairVisibility are attributes that control the appearance and behaviour of the crosshair cursor. The crosshairLength attribute
indicates how long each crosshair "arm" should be (in pixels), and a negative length indicates an infinite length (default). The crosshairFollowSnap attribute is a boolean specifying if the crosshair should jump in snap units. The default binding is �isInEditMode()�,
which means that the crosshair only follows snap when the picture is in editmode. The
crosshairVisibility attribute is a boolean that controls the visibility of the crosshair. The
default binding is �isInEditMode()�, which means that the crosshair is visible in edit mode
only.
gridMinor and gridMajor controls the appearance of the picture grid when in edit mode.
The gridMinor attribute is an integer specifying the resolution of the grid, relative to the
snap setting. The default value is 1, which means that the grid equals the "snap grid". A
value of 2 means that the grid is twice as coarse as the "snap grid". The gridMajor attribute is an integer specifying the distance between each grid line, measured in grid points.
The default value is 10, which means that every 10th grid point forms a grid line. If either
gridMajor or gridMinor are negative, the grid is invisible. If both gridMajor and gridMinor are negative, then the origin cross is also invisible.
worldX, worldY, worldWidth, and worldHeight are attributes indicating the limits of the
picture in world coordinates, i.e. the part of the world that the picture represents. The oneToOne attribute specifies how many pixels represent one world coordinate unit. The actual relation between screen coordinates and world coordinates will also be affected by
the zoomFactor() of the picture.The default setting is 0 for worldX and worldY, 1280 for
worldWidth, 1024 for worldHeight, and 1 for oneToOne. These settings correspond to a
picture where the world coordinates fully correspond to the screen (pixel) coordinates.
xReference and yReference defines the reference point (in world coordinates) for scaling
and rotation operations. Default value for xReference and yReference is 0, the origin of
the picture coordinate system. xScaleFactor and yScaleFactor specify the factors used to
scale the picture in the x and y direction respectively. Default value for the scale factors
is 1, indicating no scaling. A scale factor of 2 indicates twice the original size. The rotationAngle specifies the rotation angle of the picture in degrees. Default value is 0.
backgroundColour, foregroundColour and pattern are all attributes which can be used
to control a picture's background. The attribute backgroundColour is by default the only
attribute needed to set when changing a picture's background using a solid pattern. The
attributes foregroundColour and pattern are initially set to the value -1, which means that
they are unused. Notice that these attributes will not be documented when set to the value
-1. These attributes are normally used when displaying a pattern or a gradient as a picture's
background. However, the attribute foregroundColour overrides the attribute backgroundColour when it is set to a value unequal to -1 and the pattern is solid. The pattern
attribute can also be used to visualize an image as background by setting this attribute
equal to an RGB pattern.
ProcSee Reference Manual
397
Standard pTALK Functions
Picture (3pTALK)
The updateMode attribute controls the way the picture is updated. The different updatemodes are described in the following table:
Value
Name
Description
0
Partial
Obsolete, automatically uses split buffering mode.
(Was: Redraws only changed shapes.
Nonbuffering.)
1
Full
Obsolete, automatically uses split buffering mode.
(Was: Redraws all changed shapes and shapes
overlapping the changed shapes. Nonbuffering.)
2
Buffering
Redraws the whole picture if anything changed,
but using buffering.
3
Split-Buffering
The picture is split into rectangles, and everything
in a rectangle containing changed shapes will be
redrawn.
4
Smart Split-Buffering
Same as split-buffering, but the areas that have
changed may be smaller for instances and groups.
5
Region-Buffering
All shapes in the regions containing changed
shapes are redrawn. A region is built from the
bounding-boxes of all changed shapes.
6
Smart Region-Buffering
Same as region-buffering, but the areas that have
changed may be smaller for instances and groups.
7
Static-Buffering
The shapes in the picture is sorted into two lists,
the static shapes, and the shapes that have
nonstatic dynamics or are marked as nonstatic
shapes. All the static shapes are drawn into a
buffer, that is used as the background, and all
nonstatic shapes are drawn on top of this, if any
shape have changed.
8
Static-Region-Buffering
Same as static-buffering, but the nonstatic shapes
are drawn as in the region-buffering mode.
9
Static-Split-Buffering
Same as static-buffering, but the nonstatic shapes
are drawn as in the split-buffering mode.
10
Unbuffered
Unbuffered split-buffering mode.
The buffering modes uses a double buffer to prevent flicker on the screen. The unbuffered
mode draws directly to the screen. It is not recommended to use the unbuffered mode.
398
ProcSee Reference Manual
Standard pTALK Functions
Picture (3pTALK)
The "smart" update-modes tries to find smaller changed areas, by using the bounding box
of the inner shapes in instances and groups, whereas the other update-modes uses the
bounding-boxes of the shapes at the picture level.
The static update-modes requires that the static shapes that is in front of and overlaps nonstatic shapes are manually marked with the nonstaticShape shape-flag. If not, they will be
drawn into the background pixmap behind the nonstatic shapes.
The best update mode can not be predicted in advance, it all depends on the size and complexity of the picture.
The attribute resizeMode defines how the picture is resized in the window. ProcSee supports the following resize modes:
Value
Name
Description
0
ResizeWithClipping
The picture is clipped if the window is smaller
than the picture size. The picture is not resized if
the window size is changed.
1
ResizeFitWithNoMargins
Resizes the picture and all the shapes within the
picture to fit into the window, i.e. it is
automatically resized when the size of the
window is changed. There is no margins. The
ascpect ratio is not maintained.
2
ResizeFitWithMargins
Resizes the picture and all the shapes within the
picture to fit into the window, i.e. it is
automatically resized when the size of the
window is changed. The ascpect ratio is
maintained. Depending on the window size,
margins to the left/right or top/bottom will be
visible. The margins will be drawn using the
window’s background colour.
name() returns the name of the picture object, while fullName() returns the complete
name, including all ancestors, for example “::Sim.MainPic”.
map() maps the window associated with the picture, if any. unmap() unmaps the window
associated with the picture, if any, and it disappears from the screen. unmapChildren()
unmaps all children windows of the window associated with the picture, if any.
raise() moves the window associated with the picture to the top of the stacking order
among its siblings. lower() moves the window object to the bottom of the stacking order
among its siblings. Siblings are windows on the same level, i.e. windows sharing the same
parent window. All top-level windows are considered siblings. If no window is associated
with the picture, nothing happens.
ProcSee Reference Manual
399
Standard pTALK Functions
Picture (3pTALK)
title() sets the title of the window associated with the picture according to the parameter. The
title is not to be confused with the name of the window. The window manager is hinted about
the new title and will probably display it as part of the window decoration if it’s a top-level
window. The default title of a window is the name of the picture object displayed in the window. If no window is currently associated with the picture, nothing happens.
moveSelected() moves all selected shapes in the picture dx and dy relative to their current
position.
zoom() zooms the picture by a scale given as argument. The scale is given in percent and
indicates the new scale relative to scale 1:1 (oneToOne).
pan() pans the picture displayed in the window. The x and y panning coordinates are given
as arguments. The picture is panned so that the upper left corner of the view is in position
(x,y).
zoomFactor() returns the current zoom factor in percent, relative to the current 1:1 setting.
xSnapped() and ySnapped() takes a picture coordinate as input and returns the same coordinate snapped according to the current snap setting.
paste() copies all objects from the clipboard onto the picture. copy() copies the currently selected objects to the clipboard. cut() removes the currently selected objects from the picture
and puts a copy of them on the clipboard. clear() removes the currently selected objects from
the picture. toFront() and toBack() moves the currently selected object to the front or back
of the shape stacking order, respectively. group() groups the currently selected objects. ungroup() explodes all the groups and the shapes in the groups becomes part of the selection.
align() aligns the currently selected objects vertically or horizontally. distribute() distributes
the objects evenly in vertical or horizontal direction. setPrimitiveAttr() and setDynPrimitiveAttr() sets the primitive attribute to the value or dynamic value given as argument to all
selected object, respectively. getPrimitiveAttr() and getDynPrimitiveAttr() returns the
value or the dynamic value of the primitive attribute given as argument for the last of the currently selected objects, respectively. Refer to the edit(3pTALK) manual entry for a detailed
description of these functions.
getShapesWithinCircle() fills the toList with the shapes within the circle given by x,y, and
radius, sorted with the shapes closest to x,y first. If a selectFunc function is given, it must
return 0 if the shape given as input parameter to the select function should not be added to
the list, or the value to add to the list if it should be added. If maxShapes is given, this specifies the maximum number of shapes to add to the toList. The flags argument specifies the
point of the shapes to use in the calculation of the distance from the x,y point. The values for
flags can be: shapeposition=xyposition or shapeposition=boundingboxcenter. xyposition
is the point given by the x and y attributes of the shape, or the first point in a line/polygon,
or the upper left corner of the boundingbox of a group. boundingboxcenter is the center of
the smallest enclosing nonrotated rectangle. The default is to use boundingboxcenter. The
names in the flags string can be abbreviated to the shortest prefix of the name that is still
unique, in addition shapeposition can be abbreviated to sp, and boundingboxcenter can be
abbreviated to the shortest unique prefix of bbcenter. It is also possible to find subshapes in
a picture, by specifying how many levels down in each shape to go. This is done by using
levels=N where N is a positive number in the flags string. The default is to only search for
the toplevel shapes.
400
ProcSee Reference Manual
Standard pTALK Functions
Picture (3pTALK)
getKeyFocusShape() returns a pointer to the shape that has got the key focus, otherwise
null. To set the key focus, call Shape::setkeyFocus().
clearKeyFocusShape() clears the key focus. No shape in the picture will have the key
focus after this function has been called. A lostKeyFocus() event will be sent to the shape
about to loose the key focus.
isMapped() returns true if a window is associated with the picture, and that window is
currently mapped on the displayed, false otherwise. This does not imply that it is currently
viewable.
isViewable() returns true if a window is associated with the picture, and that window is
currently viewable on the displayed, false otherwise.
isIconic() returns true if the window associated with the picture is iconified, false otherwise.
isDisplayed() returns true if a window is currently associated with the picture, false otherwise.
isInEditMode() returns true if the picture is currently in edit mode, false otherwise.
shapeFullNameAt() returns the full qualified name of the foremost shape located at the
given x, y world coordinate, or an empty string if no shape is present. If the last argument
level is set to a value larger than zero sub shapes will be returned as well, that is shapes in
instance, groups and trend. If level is set it will recursively scan this number of sub levels.
shapeAt() is analogues to shapeFullNameAt() except that it returns a Shape pointer instead of a full qualified name. A null pointer is returned if no shape is present at the given
position.
setFocus() set focus on the window associated with the picture, if any.
theWindow() returns a pointer to the window in which the picture is currently displayed,
or 0 if the picture is not currently displayed in any window.
selectShape() changes the selection state of the shape given by shapeFullName. If mode
is 0, the shape is unselected, if mode is 1, the shape is selected, and if mode is 2 the shape
is toggle selected. The routine returns the number of shapes whose selection state were
changed by the call, i.e. 0 or 1.
selectAllIn() changes the selection state of all shapes completely included in the rectangular area given by x, y, width, and height. If mode is 0, the shapes are unselected, if mode
is 1, the shapes are selected, and if mode is 2 the shapes are toggle selected. If both width
and height are 0, all shapes in the picture is affected by the call. The routine returns the
number of shapes whose selection state were changed by the call.
setCursor() changes the cursor temporarily for this window. See "Cursor - cursor functions" on page 310.
sound() rings a bell at the display on which this picture is displayed. The volume is given
in the range -100 to 100; see the XBell(3X) man page for a description of this setting. The
pitch is given in Hz, and the duration is given in milliseconds. Note that the actual sound
is hardware dependent.
ProcSee Reference Manual
401
Standard pTALK Functions
Picture (3pTALK)
xy2dxy() convert picture world coordinates to display coordinates relative to upper left corner of the display. This function is useful when posting a popup- or pulldown-menu at a given position on the screen.
xy2sx() and xy2sy() converts picture world coordinates to screen coordinates, relative to upper left corner of the picture.
xy2wx() and xy2wy() converts screen coordinates relative to upper left corner of the picture,
to picture world coordinates.
xy2winxy() converts picture world coordinates to screen coordinates relative to the upper left
corner of the window, winxy2xy() converts screen coordinates relative to the upper left corner of the window to picture world coordinates.
moveCursor() will move the mouse cursor to the position given by x and y. The (x,y) position
is given in world coordinates.
exportEMF() exports the picture to an enhanced Windows meta file (EMF). Windows meta
file is a vector based file format that is widely used on the Windows platforms. This function
supports exporting of the EMF file directly to the clipboard or to a file. The first argument
destination is either a file name, an emtpy string ("") or a null pointer (0). If a file name is
specified the EMF file will be saved to disk. If an emtpy string or a null pointer is specified
the EMF file will be copied to the clipboard. The arguments x, y, width and height are used
to define the picture area that will be exported to the EMF file. These arguments have default
values which will dump the entire picture to the EMF file (The value 0 is used as default argument). The optional argument options is used to specify eventual resource styles to use.
For more information about the values this option can have, see resource styles on page 419.
This function is only available on the Windows platform.
The freeze() function inhibits the picture from being updated. If the input argument is -1, or
not given, the function only returns the freeze status. If the input argument is 0 it unfreezes
the picture, and if it is 1 it freezes the picture. It returns the new freeze status (0 or 1).
The updatePicture() function is used to update the picture immediately. As opposed to the
normal update functions, the updatePicture function does not merge consecutive updates.
The setPictureFlags() function is used to mark this picture as a Drag and Drop target area,
by using the values DnDFlags.none, or DnDFlags.copy, DnDFlags.move, or DnDFlags.link
ored together. The value 0 means that the picture is not a Drag and Drop target area. The getPictureFlags() function returns the current setting.
The function adjustColours(…) modifies all the colours used in a picture. The arguments to
this function are one or two 4 by 4 Matrix objects filled with colour adjustment data. The
functions setGreyMatrix(…) and setRGBMatrix(…) can be used to initialize the matrices.
Different colour adjustments can be made to the shapes’ fill- and border colour. The parameter fillM is the fill colour and borderM is the border colour. If only one Matrix argument is
specified the same adjustment will be made to both fill- and border colour. To reset the colours to default, call this function without arguments. This function can be used to make a picture look brighter, darker or displayed in grey-scale. It can for example also be used to
highlight the shapes’ border. Notice that the original colours will be left unchanged when this
function is used.
The format of the 4 by 4 colour matrix is as follows:
402
ProcSee Reference Manual
Standard pTALK Functions
Picture (3pTALK)
Rr
Gr
Br
0
Rg
Gg
Bg
0
Rb
Gb
Bb
0
Rt
Gt
Bt
1
r
r'
g = g'
b
b'
1
0
Where Rr, Rg, Rb are the red, green and blue factors are multiplied with the colour producing the red colour component. It is analogous to calculate the green and blue colours,
where G* and B* are used instead. Rt, Gt an Bt are the translation, i.e. lightness. Values
close to 0 will produce dark colours, while values close to 1 will produce light colours.
EXAMPLES
alarms.raise();
// raise the picture “alarms”
spreadSheet.title( “NoName” ); // entitle picture “spreadSheet” NoName
alarms.zoom( 200 );
// zoom in to scale 2:1
SEE ALSO
Window(3pTALK) in "ProcSee Reference Manual"on page 488
load/display(3pTALK) in "ProcSee Reference Manual"on page 382
edit(3pTALK) in "ProcSee Reference Manual"on page 327
save/document(3pTALK) in "ProcSee Reference Manual"on page 425
XBell(3X), Matrix, setGreyMatrix, setRGBMatrix
ProcSee Reference Manual
403
Standard pTALK Functions
Point (3pTALK)
NAME
Point - object for storing a position.
SYNOPSIS
double
double
Point::x;
Point::y;
void
Point::set( double x, double y );
Point*
::newPoint();
DESCRIPTION
Point objects holds a position. It has the attributes x, and y, all of type double. The Point function set() can be used to set all the values of the Point object in one operation.
Named Point objects are created like attributes. The values of a Point object is not saved or
documented.
Anonymous Point objects can be created with the function newPoint(), which creates a Point
object, and returns a pointer to it. When there are no pointers left pointing to the created
Point, it will be removed automatically.
404
ProcSee Reference Manual
Standard pTALK Functions
printer (3pTALK)
NAME
printer - functions for printer configuration
SYNOPSIS
void Application::loadPrinterFiles( int loadOption );
DESCRIPTION
The loadPrinterFiles() function is used to load or reload the printer definition files used
by the exportPostScript() function.
The loadOption parameter defines how the loading is done:
0 (LoadNew) : Only load printer definition files for printer definitions not yet loaded into
the application.
1 (ClearAndReload) : Remove all existing printer definitions from the application, and
load all printer definition files.
2 (Reload) : Load all printer definition files, and keep the definitions that does not have
any printer definition files.
The printer definition files are files on the $PROCSEE_DIR/etc, $HOME, and Application directory, that has the extension .pprn.
EXAMPLE
Example of a printer.pprn file:
#-----------------------------------------------#
#
#
# Configuration file for the printer named #
# after the file name except the extention. #
#
#
#-----------------------------------------------#
# topMargin in cm.
tm
2.3
# bottomMargin in cm.
bm
2.6
# leftMargin in cm.
lm
0.2
# rightMargin in cm.
rm
0.2
# paperHeight in cm
height
29.7
# paperWidth in cm
width
21.0
ProcSee Reference Manual
405
Standard pTALK Functions
loadPrinterFiles (3pTALK)
# colour printer (yes/no)
color
yes
# blackAndWhite output (yes/no)
bw
no
# rgbTuning values in % (whitepoint)
rgb
80 100 100
# rgbGamma values
rgbg
1.0 1.0 1.0
# includePsFile, adding extra PostScript into the generated file.
# (normally not used)
incl printerSetup.ps
# printerInfo text about the printer
info This colour printer is located in the computerlab at second floor.
# printCommand to use, %F is the filename, %P is the printername
cmd lp -d%P %F
Instead of the short forms used in the example above, topMargin can be used instead of tm,
bottomMargin instead of bm and so on. (The long name is written as the first word in the
comments above). Tags not found in the .pprn file, will get default values; To make a printer
available for pTALK, just create an empty file in one of the locations given above with the
name of the printer with the .pprn extension added.
Examples of printer configuration files are found in $PROCSEE_DIR/etc.
NOTES
The loadPrinterFiles() function is run automatically when an application is loaded.
For Microsoft Windows, see "ProcSee User’s Guide", Section 12.2 - The File Menu: "Configure printing on Windows".
SEE ALSO
exportPostScript(3pTALK) in "ProcSee Reference Manual"on page 348
406
ProcSee Reference Manual
Standard pTALK Functions
print (3pTALK)
NAME
printf - formatted output
sprintf, strformat - store/create a formatted string
SYNOPSIS
void printf( char* format, ...);
int sprintf( char* targetString, char* format, ... );
char* strformat( char* format, ...);
DESCRIPTION
printf() is writing output to the standard output stream. On the Microsoft Windows platform, this is the output window of the RTM, and the log-file if rtm is started with the -L
option. On the other platforms (Linux, Mac, ...) this output is displayed in the terminal
window where the RTM was started, and can eventually be redirected to a file there using
normal shell operations.
sprintf() place output, followed by the null-character (\0), in consecutive bytes starting at
targetString[0]. sprintf() returns the number of characters put into the targetString. If the
result is longer than the targetString buffer, an error message is given, and the result is cut
at the length of the targetString buffer. It is the user's responsibility to ensure that enough
storage is available.
strformat() does the same as sprintf(), but it allocates the buffer needed by the result of
the formatting, and returns this. If there are errors in the format, it can return 0, but in most
cases it returns a string.
All these functions use formatting of strings like in the C language printf function. The
allowed formatting options are described below. A string will be generated in most cases,
even if there are errors or warnings.
The format parameter is a character string containing two types of objects: plain characters that are copied to the output, and conversion specifications, each of which results in
fetching zero or more arguments. The result is undefined if there is insufficient arguments
for the format.
The conversion specification starts with a ’%’-character, and ends with a conversion specifier character. Between these, there can be (in order): flags, length, precision, exponentSize, valueSize.
The flags can be a combination of the following characters:
Flag
Description
-
Left adjust (Pad with space at right end, requires width).
!
Center adjust (Pad with space at both sides, requires width).
ProcSee Reference Manual
407
Standard pTALK Functions
Flag
0
space
print (3pTALK)
Description
Pad with zeros on the left of numbers (ignore if - or !, or precision
for numbers, or no width).
Use space in front of positive numbers.
+
Use + in front of positive numbers.
#
Use alternate form for the value.
For integer conversions, a prefix is added, so that it can be read back
by the pTalk parser. For o the octal number is prefixed with 0, for the
other integer formats, the number is prefixed with 0r where r is b for
binary, d for decimal, and x for hexadecimal. If an upper-case letter
is wanted, the format type letters b, d, x can be written with uppercase when the ’#’-flag is given.
For e, E, f, F, g, G, the result will always contain a decimal point,
even if no digits follow it, For g and G trailing zeros are not
removed.
’
Use thousand-separators in the number. For binary every 4 digits are
grouped, for decimal and octal every 3 digits are grouped, for hexadecimal every 2 digits are grouped.
The width can be specified as a number, or with the character ’*’, meaning to read the next
integer from the arguments for this value. The width is the minimum width of the result. If
the result is smaller than this width, it will be padded with spaces at the left, or according to
the ’-’, ’!’, and ’0’ flags. For the Text shape and the Scale shape, the width is also the maximum width, resulting in ’*’-characters instead of the value when the value is too large. All
other places, the result is expanded to show the value when the value needs more room than
the width.
The precision starts with a ’.’-character, and can be specified as a number, or with the character ’*’, meaning to read the next integer from the arguments for this value. For integer format conversions, the precision gives the minimum number of digits to use, resulting in extra
zeros added in front of shorter numbers. For e, E, f, and F, it gives the number of digits after
the decimal separator. For g and G, it gives the number of significant digits. For s, it gives
the maximum number of characters to use from the string.
For the format types e, E, g, and G, the format can contain an exponent size1. This starts with
the ’:’-character, and can be followed by a ’+’ or ’-’ character, and then a number or the character ’*’, meaning to read the next integer from the arguments for this value. The ’-’ character
means to have a sign on the exponent only for negative exponents. The ’+’ sign means to
have a sign on the exponent always, and is the default. The default number of digits for the
exponent is 2.
1. The exponent size specification is specific to pTalk, and not available in normal C/C++.
408
ProcSee Reference Manual
Standard pTALK Functions
print (3pTALK)
The optional valueSize can be ’hh’, ’h’, or ’V’. ’hh’ treats the value as an 8 bits value, ’h’
treats the value as a 16 bits value. The ’V’ flag treats the value as the type and size it has,
resulting in negative numbers being displayed with a sign even for the unsigned integer
conversions. If none of ’hh’, ’h’, or ’V’ is specified, the value is treated as a 32 bits value.
The valueSize is only useful on the unsigned integer conversions, e.g. for ’b’, ’o’, ’u’, ’x’
and ’X’, where it will influence how negative values are displayed. Examples: strformat("%x", -1) results in "ffffffff", strformat("%hhx", -1) results in "ff", strformat("%Vx",
-123) results in "-7b". If the value is larger than the size specified, the next larger size will
be used (8 -> 16 -> 32bits), and a warning will be given.
The following conversion specifier characters are supported:
Conversion
specifier
Description
%
Output the % character, uses no arguments.
b
Binary number.a
o
Octal number.
d, i
Decimal number.
u
Decimal number.
x, X
Hexadecimal number using abcdef or ABCDEF for 10, ..., 15.
e, E
Floating point number with exponent.
f, F
Floating point number without exponent.
g, G
Floating point number with good presentation (with or without
exponent)
c
Character.
s
String.
p
Output the fullname of the object in the RTM symbol table
pointed to.
a. Output of binary numbers are specific to pTalk, and not available in normal C/C++.
For the integer conversions d and i, the value can be both a signed or an unsigned value,
and the output is done according to the type of the argument. For all the other integer conversions, e.g.: b, o, u, x, X, the value is treated as an unsigned value.
In addition to the above, the position of the arguments can be specified, using %N$ and
*N$ where N is the index into the argument to use, in the range 1 to number of arguments.
%N$ is for the argument to be converted, *N$ is instead of the * character on the width,
precision, and exponent size. When using one position specifier, all arguments must be
referenced in this way. Examples: strformat( "%2$d and %1$f", 3.14, 123 ); strformat(
"%3$*1$.*2$f", 10, 2, 123.45 );
ProcSee Reference Manual
409
Standard pTALK Functions
print (3pTALK)
EXAMPLES
char* charPtr; // pointing to a character array
int anInt = 55;
:
// after the following sprintf has bee executed
// charPtr will point to a character string containing
// Hello world
sprintf( charPtr, "Hello %s", "world" );
// execution of the following printf will print
// Value of an Int 55
// to the terminal window where the rtm was started in
printf( "Value of an Int %d", anInt );
410
ProcSee Reference Manual
Standard pTALK Functions
process (3pTALK)
NAME
process - process functions
SYNOPSIS
int Application::connectToProcess( char* processName );
int Application::disconnectFromProcess( char* processName );
void Application::processNotify( int status, char* processName );
int processIsConnected( char* processFullName );
int loadDatabase( char* processFullName, char* dbFileName );
DESCRIPTION
connectToProcess() connects the RTM to the process with the name processName. The
process the RTM trying to establish a connection to must be initialized with PfInit(3c).
The argument processName in PfInit(3c) must be equal to the argument used in this
pTALK function. processName is the name the application process is registered as with
the Control Server.
disconnectFromProcess() disconnects the RTM from the process. The argument processName is the process to disconnect from.
processNotify() is not a standard pTALK function but is a user defined callback function
located in the application scope that is called when the connection state of a remote process changes. If the connection state of the remote process is needed, create a user defined
pTALK function with the name processNotify() in the application scope. This function
is also invoked when the connection to an external trend logger is established or lost. The
arguments to this function is the name of the process changing state (processName) and
the status itself (status). Notice that the status parameter is a bitmask. Several bits can be
set. The bits have the following meaning:
Bit
mask
Meaning
0x1
Connection established.
0x2
Waiting for connection from process.
0x4
Remote process wanted connection.
0x8
RTM has given up establish connection to the remote process. Timeout.
0x10
Gracefully disconnected from the remote process.
0x80
The connection to the remote process has been broken.
0x200
Incompatible SWBus versions. Check that the process is using the
same SWBus version as the RTM.
ProcSee Reference Manual
411
Standard pTALK Functions
process (3pTALK)
processIsConnected() returns true if the process specified by processFullName is connected to the RTM, otherwise false. The name processFullName is either the fullname to the process or just the process name.
loadDatabase() load the database file named specified in dbFileName located in the named
process scope.
EXAMPLE
void processNotify( int status, char* processName )
{
if ( status & 0x1 )
printf( "Connection to process \"%s\" established!", processName );
else
if ( status & ( 0x10 | 0x80 ) )
printf( "Lost connection to process \"%s\"!", processName );
else
if ( status & 0x8 )
printf( "Failed to connect to process \"%s\"!", processName );
else
if ( status & 0x200 )
printf( "Incompatible SWBus versions. Check \"%s\"!", processName );
}
SEE ALSO
PfInit(3c) in "ProcSee Reference Manual" on page 217.
412
ProcSee Reference Manual
Standard pTALK Functions
random (3pTALK)
NAME
random - random number generator
SYNOPSIS
int random( int max );
DESCRIPTION
random() returns a random number in the interval [0,max>, i.e. excluding max. This routine uses the UNIX function drand48(3C), and will be seeded by a call to srand48(3C)
(taking the current time as input) each time a new application is loaded into RTM(1).
ProcSee Reference Manual
413
Standard pTALK Functions
readdir (3pTALK)
NAME
readdir - read filenames from a directory
SYNOPSIS
int readdir(List* list, char* directory, char* match="*", char* flags="");
DESCRIPTION
readdir() reads filenames from the directory and adds them to the list. If a match parameter
is given, only files matching this string will be added to the list. The match parameter can
contain ’*’ which matches zero or more characters, and ’?’ which matches one character. The
flags parameter can have the following values:
files - match if the filename is an ordinary file.
directories - match if the filename is a directory.
symlinks or linkssym - match if the filename is a symbolic link.
all - match all (the above) filetypes. This is the default.
In addition casesensitive or nocasesensitive can be given, to set the case sensitivnes of the
match. Default on MS-Windows is not case-senisitve, on all other platforms the default is
case-sensitive matches.
Wanted permissions can also be specified using permissions=P, where P is combinations of
the following: r : readable, w : writable, x : executable, h : hidden, s : system (s is ignored
on unix, h is a file flag on MSWindow, and that the file starts with ’.’ on unix), with ’+’ for
wanted, and ’-’ for not wanted. Example: permissions=+rw-h which means that the file
should be both readable and writable, but should not be hidden.
The values in the flags parameter can be abbreviated to the shortest unique prefix.
EXAMPLES
To find all writable files on the /tmp directory, starting with the letter a or A:
fileNameList.clear();
readdir(fileNameList, "/tmp", "a*", "files,nocase,perm=+w");
414
ProcSee Reference Manual
Standard pTALK Functions
Rect (3pTALK)
NAME
Rect - object for storing position and size of a rectangular area.
SYNOPSIS
double
double
double
double
Rect::x;
Rect::y;
Rect::width;
Rect::height;
void
Rect::set( double x, double y, double width, double height );
Rect*
::newRect();
DESCRIPTION
Rect objects holds the position and size of a rectangular area. It has the attributes x, y,
width, and height, all of type double. The Rect function set() can be used to set all the
values of the Rect object in one operation.
Named Rect objects are created like attributes. The values of a Rect object is not saved or
documented.
Anonymous Rect objects can be created with the function newRect(), which creates a
Rect object, and returns a pointer to it. When there are no pointers left pointing to the created Rect, it will be removed automatically.
ProcSee Reference Manual
415
Standard pTALK Functions
remove (3pTALK)
NAME
remove - delete user interface objects
SYNOPSIS
bool remove( char* objectFullName );
DESCRIPTION
remove() deletes the user interface object given by objectFullName. Currently this applies
to shapes, instances, pictures, libraries, applications, user defined functions and attributes,
and classes. remove() returns true if the object was successfully removed, false otherwise.
If an attempt to remove the object that will receive the return value is made, the remove()
operation will be executed asynchronously. An example of this can be to remove a picture
from within a dialogue in the same picture. In this case, the return value will always be true.
416
ProcSee Reference Manual
Standard pTALK Functions
rename (3pTALK)
NAME
rename - rename a named user interface object
SYNOPSIS
int rename( char* objectFullName, char* newName );
DESCRIPTION
rename() renames the object specified by objectFullName to the string pointed to by
newName. Currently this applies to shapes, instances, pictures, libraries, user defined
functions and attributes, and classes. The routine returns true if the object was successfully renamed, otherwise false.
ProcSee Reference Manual
417
Standard pTALK Functions
ResourceStyle (3pTALK)
NAME
ResourceStyle – container for modified resources
DESCRIPTION
The class ResourceStyle is a container for the ProcSee resources Colour, Pattern, Cursor,
Linestyle and Font. Resources defined in the application or library can be added to a resource style, modified and used for instance when printing or dumping an image to file.
If a computer is connected to a black and white printer, a resource style using grey scale colours would be preferred. If the background colours used in a picture is black it would have
been nice to have the opportunity to modify this colour to be white when printed. This is
where ResourceStyle comes in handy. The black colour can be added to a ResourceStyle
called for instance BWPrinter and modified from being black to become white. The background colour used when printing will be white when this BWPrinter ResourceStyle is used
in the exportPostScript(…) function.
Another use of resource styles are the ability to change the resources used by the application
or the pictures without modifying the original resources. Different ResourceStyle can be
used for instance for daylight and night. Another use of resource styles is the possibility to
customize the colours to different users. The resource style can be set when the user is logging into the system.
When a ResourceStyle is created not all resources defined in the application or library needs
to be added. Only the resources necessary to modify needs to be added. The graphics editor
GED has built in support for adding and modifying resources used in resource styles.
SEE ALSO
ResourceStyle functions
418
ProcSee Reference Manual
Standard pTALK Functions
ResourceStyle functions (3pTALK)
NAME
ResourceStyle functions - resource style functions
SYNOPSIS
void Window::useResourceStyle( ResourceStyle* frs,
ResourceStyle* lrs);
void Picture::useResourceStyle( ResourceStyle* frs,
ResourceStyle* lrs);
void Application::useResourceStyle( ResourceStyle* frs,
ResourceStyle* lrs );
... ...( ..., char* options="" ); // resource style options.
DESCRIPTION
The useResourceStyle() function for windows and pictures changes the resource style
used for drawing in this window or the window the picture is displayed in. The useResourceStyle() function for applications changes the resource style used globaly.
The arguments to these functions are the resource style to use on the fill areas, and on the
line areas of the shapes. If only one argument is used, the same resource style will be used
on both the fill and the line areas. If no arguments are used, no resource style is used, and
the global resources will be used for all drawing.
Some functions like exportPostScript, have an options parameter, that can be used to
specify the resource styles to use. The values that specifies resource styles are as follows:
resourceStyleFill=RSF or rsf=RSF
resourceStyleBorder=RSB or rsb=RSB
resourceStyle=RS or rs=RS
Where RSF is the name of a resource style to use for fill, RSB is the name of a resource
style to use for borders, and RS is the name of a resource style to use for both fill and border areas. Example: exportPostScript(....., "rsf=myRS1,rsb=myRS2");
SEE ALSO
"ResourceStyles" on page 59 in "The Configuration Language" chapter in the ProcSee
Reference Manual.
ProcSee Reference Manual
419
Standard pTALK Functions
RoundRect (3pTALK)
NAME
RoundRect – rectangle shape with rounded corners.
SYNOPSIS
// Attributes:
float
RoundRect::x;
float
RoundRect::y;
float
RoundRect::width;
float
RoundRect::height;
float
RoundRect::xRadiusCorner;
float
RoundRect::yRadiusCorner;
char*
RoundRect::flags;
DESCRIPTION
RoundRect is a graphic rectangle shape in ProcSee with rounded corners. A RoundRect
shape does not have sharp 90 degree angle corners, in contrast to a Rectangle shape. The size
of the rounded corners can be specified with the attributes xRadiusCorner and yRadiusCorner. These attributes are used to determine the shape of the RoundRect shape. Smaller values will produce a RoundRect resembling a rectangle shape, while large values will
produce a RoundRect resembling a ellipse shape. Setting one or both of these attributes to
the value 0 will produce a rectangle shape with sharp corners.
The attributes x and y specifies the location of the RoundRect shape, and the attributes
width and height specifies the size of the shape.
The attribute flags is used to modify the RoundRect's default values. The RoundRect's default corners are round, but these can be changed by the flags attribute. The following table
describes the corner flags (notice that the next table describes the corner flags options):
420
Corner Flags
Description
corners
the flag applies to all the RoundRect's corners
topleftCorner
lefttopCorner
tlC
ltC
this flag applies to the RoundRect's top left
corner.
toprightCorner
righttopCorner
trC
rtC
this flag applies to the RoundRect's top right
corner.
bottomleftCorner
leftbottomCorner
blC
lbC
this flag applies to the RoundRect's bottom left
corner.
ProcSee Reference Manual
Standard pTALK Functions
bottomrightCorner
rightbottomCorner
brC
rbC
RoundRect (3pTALK)
this flag applies to the RoundRect's bottom right
corner.
Each of these corner flags must be set to one of the RoundRect’s supported corner options, as described in the following table:
Corner Options
Description
round
the corner is round, i.e. drawn as an ellipse arc.
square
the corner is square, i.e. just like a Rectangle corner.
cut
the corner is cut, i.e. the corner is drawn straight
between the xRadiusCorner and yRadiusCorner values.
invertedRound
the corner is round, but is drawn inwards, i.e.
towards the centre.
iround
a shorthand notation for invertedRound.
invertedSquare
the corner is square, but is drawn inwards.
isquare
a shorthand notation for invertedSquare.
EXAMPLE
// Defines a roundRect were the top left corner is square.
roundRect r1
{
...
flags = "tlC=square";
}
// Defines a roundRect were all the corners are interved round, except for the bottom right corner
which
// is round.
roundRect r1
{
...
flags = "corners=iround, brC=round";
}
SEE ALSO
newRoundRect
ProcSee Reference Manual
421
Standard pTALK Functions
rtmName, rtmVersion (3pTALK)
NAME
rtmName - get the name of the Run-Time Manager
rtmVersion - return the version string of the Run-Time Manager
SYNOPSIS
char* rtmName();
char* rtmVersion();
DESCRIPTION
rtmName() returns the name of the Run-Time Manager. This name can be specified using
the -n option to the rtm(1). If this option is omitted the default value is rtm. The name returned from this function is the one registered with control(1).
rtmVersion() returns the version string of the Run-Time Manager. The string returned is on
the format: "ProcSee 3.3 RTM (January 2006)".
422
ProcSee Reference Manual
Standard pTALK Functions
runTime environment (3pTALK)
NAME
runTime environment - functions used to manipulate the run-time environment
SYNOPSIS
void maxRunTimeMessages( int n = -1 );
void ignoreWatchdog( int state );
DESCRIPTION
maxRunTimeMessages changes the maximum number of run-time messages printed between two states where the Run-Time Manager is idle (normally between two global updates). maxRunTimeMessages is used to limit the number of error messages printed and
should only be used during application development. Printing a large number of run-time
messages can dramatically reduce system performance. The argument n can have one of
the following values. Setting the argument n to the default value -1 will clear the limit, all
run-time messages will be printed. Setting the argument to zero will ignore all run-time
messages. Settting this argument to a value greather than zero will print maximum this
number of run-time messages.
ignoreWatchdog disables or enables the watch dog counter used when running pTALK
code. The watch dog counter prevents pTALK code from running in an infinite loop. The
initial value of the watch dog counter in the Run-Time Manager is one million virtual machine instructions. When the counter reaches the value zero, the loop terminates and an
error message is isssued. ignoreWatchdog can be used to disable this check and prevent
pTALK code from terminating during lengthy operations, like multi nested for loops. The
argument state accepts the following values. The value 0 enables the watch dog. The value
1 ignores the watch dog in current pTALK function only. The value 2 ignores the watch
dog in current pTALK function and functions called from current function. Any other value will be ignored.
EXAMPLE
double calculate()
{
ignoreWatchdog( 2 );
// Ignore watch dog check in this as well as in calcPart
double sum = 0.0;
for ( int i = 0; i < 10000; i++ )
for ( int j = 0; j < 10000; j++ )
{
double part = calcPart( i, j );
sum = calcAverage( i, j, part );
}
}
double calcPart( int i, int j )
{
double part = 0.0;
// This function uses the caller’s ignoreWatchDog
// settings.
ProcSee Reference Manual
423
Standard pTALK Functions
runTime environment (3pTALK)
for ( int x = 0; x < i; x++ )
for ( int y = 0; y < j; y++ )
part += ...;
return part;
}
double calcAverage( int i, int j, double part )
{
ignoreWatchdog( 0 ); // Enables the watch dog in this function only. It does
// not affect the caller function.
return ...;
}
424
ProcSee Reference Manual
Standard pTALK Functions
save,document (3pTALK)
NAME
save/document - saving and documenting user interface objects
SYNOPSIS
int save( char* objectFullName );
int document( char* objectFullName, char* options=0 );
void setPath( char* objectFullName, char* path );
char* getPath( char* objectFullName );
void setFileName( char* applicationFullName, char* fileName );
char* getFileName( char* applicationFullName );
char* getApplicationName( char* applicationFileName );
DESCRIPTION
These functions all work on pictures, libraries and whole applications.
save() saves the object given by objectFullName to binary file. The file gets an extension
according to the table below:
object type
file extension
picture
.ppic
library
.plib
application
.pctx
The file name will be the same as the object name, and the path will be the one it was previously loaded from, or if it was not loaded, the path set by setPath(). For applications,
the filename defaults to the object name, but can be set by setFileName().
document() saves the object given by objectFullName to an ASCII file in a format readable by pcc(1). The file gets the extension .Tdoc. The file name will be the same as the
object name, and the path will be the one it was previously loaded from, or if it was not
loaded, the path set by setPath(). The optional options parameter to document (introduced
in ProcSee 3.8), can specify a comma-separated combination of the options in the table
below:
option
description
noDefaults
Don’t document attributes that have default values. Implies
noScaleRotateDefaults.
noScaleRotateDefaults
Don’t document xScaleFactor, yScaleFactor or rotationAngle attributes when they have default values
noXYreference
Don’t document any scale/rotate attribute, including xReference and
yReference attributes if the scale and rotate attributes have default
values. Gives all or no scale/rotate attributes unless used together
with noDefaults or noScaleRotateDefaults.
ProcSee Reference Manual
425
Standard pTALK Functions
option
save,document (3pTALK)
description
oldComments
Add a lot of automatic comments to the file produced, e.g. comments on some end braces ’}’, like // end of picture ...
Should not be used, and if used, the option ’-o comments=none’
should be used on pcc.
oldKeywords
Adds the word "attribute" in front of user defined instance attributes.
Adds the word "statement" to the event attribute of dialogues. Adds
an "=" to the database elements.
oldNewLines
Outputs some resources on a single line, e.g. colour definitions.
oldOrder
In ProcSee 3.8 the document order was changed to match the order
used in the binary files, to make internal testing easier. This option
outputs the elements in the order used before version 3.8.
old
Short for all the old... options above.
Even though the old... options gives the old behaviour, there are still some changes in amount
of whitespace between the files before version 3.8 and newer versions.
The functions save() and document() returns 0 on success, otherwise an error code describing the problem is returned. The api function PfGetSystemError(3c) or the pTALK function getErrorString() can be used to obtain the error text corresponding to this error code.
setPath() sets the path of the object given by objectFullName to the value given as argument. This affects the behaviour of save() and document() according to the description
above.
The path argument to setPath() for applications must be absolute. For pictures and libraries,
the path argument can be relative to that of the application.
getPath() returns the path of the object given by objectFullName.
setFileName() sets the basename part (no extension or path) of the filename of the application given in the applicationFullName parameter to the fileName parameter.
getFileName() returns the complete filename (including path and extension) of the application given in the applicationFullName parameter.
getApplicationName() returns the application name of the application that has a complete
filename equal to the applicationFileName parameter.
SEE ALSO
load/display(3pTALK) in "ProcSee Reference Manual"on page 382
426
ProcSee Reference Manual
Standard pTALK Functions
Scale (3pTALK)
NAME
Scale – scale and grid shape
SYNOPSIS
// Attributes:
char*
Scale::flags;
char*
Scale::format;
float
Scale::length;
float
Scale::lengthMajorTicks;
float
Scale::lengthMinorTicks;
float
Scale::majorTickStepValue;
float
Scale::maxValue;
float
Scale::minValue;
int
Scale::minorTickSteps;
float
Scale::offset;
int
Scale::theFont;
// Functions:
int Scale::getPosValue( double x, double y, double* value );
int Scale::getValuePos( double value, double* x, double* y );
DESCRIPTION
Scale is a graphic shape. It is composed of four parts, which are a base line, major and
minor ticks, plus labels. The Scale shape can be used both as a scale shape and as a grid
shape. The difference between a scale shape and a grid shape is just the visualization of
the shape. The major and minor grid lines when used as a grid shape are equal in size and
are longer than the corresponding major and minor ticks used by a scale shape. Another
difference is that the labels are displayed on opposite sides of the base line. When creating
a Scale shape in the graphics editor GED, using interactive drawing, the scale shape
changes appearance depending on the width of the shape. If the width is large, a grid shape
is created, otherwise a scale shape. The differences between a scale shape and a grid shape
are just the attribute settings. Notice that a vertical Scale shape is rotated 90 degrees. The
Scale shape can be used for example when creating XY-plot or in trend diagrams to display the curves’ values.
The attribute length specifies the length of the Scale shape in world coordinates. The attributes lengthMajorTicks and lengtMinorTicks control the length of major and minor
ticks, respectively.
minValue and maxValue specifies the minimum and maximum value of the Scale shape.
Notice that the value of maxValue can be smaller than the value of minValue. The labels
will be displayed from maximum to minimum, instead of minimum to maximum when
this is true.
The major tick lines are visually evenly spaced within the Scale shape. The attribute majorTickStepValue gives the length between each major tick step. This value must be given in the same unit as the attribute minValue and maxValue. If the Scale shape is
logarithmic the value between each major tick step are majorTickStepValue times larger
than the previous value. If the shape is linear the value of the next major tick step is the
ProcSee Reference Manual
427
Standard pTALK Functions
Scale (3pTALK)
previous tick step value plus the value of the attribute majorTickStepValue. See the flags
section on how to set the shape in linear or logarithmic mode. The attribute minorTickSteps
controls the number of minor ticks between two major ticks.
The attributes theFont and format controls the labels which are displayed. The format attribute has the same syntax as in the Text shape, but only the number formatting specifiers
are legal in addition to pure text, for instance “%.2f”, “%g”, “%-10.2f Kb”. The position of
the labels can be changed via the attribute offset. The offset is specified in world coordinates
from the base line. A positive offset will display the labels above or to the right of the base
line, a negative value in the opposite direction.
alignment specifies where to display the text relative to its position. The default value of this
attribute is center, vcenter. The text can be left (0), center (1), decimal (3) and right (2)
aligned in the horizontal direction, and top (0x10), vcenter (0x20), baseline (0) and bottom
(0x30) aligned in the vertical direction. The constants for these values are defined in the
enum TextAlign. (This is the same as for the Text shape.)
The Scale shape has an attribute called flags where a lot of extra functionality can be specified. Most of the functionality provided by this attribute is set during design-time and should
not be changed during run-time, for instance on every update. The following flags are available for the flags attribute:
Flag
Options
Description
labelOverlap
hide
Hides overlapping labels. See flag labelSpace.
off
Overwrite overlapping labels. This is default.
labelSpace
>= 0
Used together with labelOverlap when set to hide.
Labels inside this value will be hidden. Must be an
integer value >= 0. Default is 2.
label
major
Show labels at major ticks. Default on.
minor
Show labels at minor ticks.
min
Always show label at minimum value.
max
Always show label at maximum value.
all
Show all labels.
none
Do not display any labels.
min
Start major ticks at minimum value. Default value.
max
Start major ticks at maximum value.
none
Start major ticks at a value divisible by the attribute
majorTickStepValue.
minor
Show minor ticks. Default on.
startAt
ticks
428
ProcSee Reference Manual
Standard pTALK Functions
line
function
Scale (3pTALK)
major
Show major ticks. Default on.
ends
Show ticks at the maximum and minimum value.
all
Show all ticks.
none
Do not display any ticks.
on
Show the base line. Default on.
off
Do not show the base line.
linear
Display the scale using linear values. Default value.
ln
Display the scale using natural logarithm values.
log
Display the scale using 10th logarithm values.
The flags in the table above can be combined. Use the following combination of flags to
set for instance the Scale shape to 10th logarithm, starting at majorTickStepValue and hiding labels which overlap.
flags = "labelOverlap=hide, startAt=none, function=log";
The function getPosValue(…) calculates and returns a value between the attributes minValue and maxValue based on the value of the x, y position. True is returned if the coordinate passed as argument to the function was inside the Scale shape, otherwise false.
The function getValuePos(…) calculates and returns an x, y position in world coordinates
based on the value passed in the argument value. The parameter value must be in the range
minValue and maxValue. It returns false if the value is outside the range, otherwise true.
SEE ALSO
newScale
ProcSee Reference Manual
429
Standard pTALK Functions
Shape (3pTALK)
NAME
Shape - general behaviour of all shapes
SYNOPSIS
// attributes:
int
Shape::visibility;
float Shape::xReference;
float Shape::yReference;
float Shape::xScaleFactor;
float Shape::yScaleFactor;
float Shape::rotationAngle;
// member functions:
char* Shape::name();
char* Shape::fullName();
Picture* Shape::thePicture();
void
Shape::updateShape( char* flags = "fast" );
int
int
float
float
int
int
float
float
int
int
Shape::xy2sx( float wx, float wy );
Shape::xy2sy( float wx, float wy );
Shape::xy2wx( int sx, int sy );
Shape::xy2wy( int sx, int sy );
Shape::xy2shxy( float x, float y, float* retX, float* retY );
Shape::shxy2xy( float x, float y, float* retX, float* retY );
Shape::shapeCursorX( char* flags=0 );
Shape::shapeCursorY( char* flags=0 );
Shape::shapeToBack()
Shape::shapeToFront()
float
float
float
float
Shape::bX();
Shape::bY();
Shape::bHeight();
Shape::bWidth();
int
int
Shape::containsPoint( float wx, float wy );
Shape::grabPointer( int relBtn );
void
void
Shape::select();
Shape::unselect();
void
int
Shape::setShapeFlags( int flags );
Shape::getShapeFlags();
void
Shape::setKeyFocus();
int Shape::getViewableState( int mask=-1 );
430
ProcSee Reference Manual
Standard pTALK Functions
Shape (3pTALK)
DESCRIPTION
All shapes, i.e. rectangles, circles, text, groups, instances, etc. share some common behaviour. Although the Shape class is not defined as such in ProcSee, this common behaviour
is still described here.
If the visibility is assigned a value of 0 the shape will not be visible1. If the value is set to
1 then the shape will be visible. xReference and yReference defines the reference point
(in world coordinates) for scaling and rotation operations. Default values for xReference
and yReference vary depending on the specific shape. Some examples; rectangle - upper
left corner, circle/ellipse (arc/slice) - centre, line/polygon - coordinate of the first point.
xScaleFactor and yScaleFactor specify the factors used to scale the shape in the x and y
direction, respectively. Default value for the scale factors is 1, indicating no scaling. A
scale factor of 2 indicates twice the original size. A negative scale factor makes the shape
mirrored. The rotationAngle specifies the rotation angle of the shape in degrees. Default
value is 0.
name() returns the name of the shape, or an empty string "" if the shape is anonymous,
i.e. has no name.
fullName() returns the full name of the shape.
thePicture() returns a pointer to the picture in which the shape is contained.
The function updateShape() updates the shape and all of its sub-shapes (if it’s an instance, a group or a trend shape). It is executed immediately (synchronous) but the redraw
is delayed. The redraw action is put either on the system’s event queue or the action queue.
The default is that the action is put on the event queue. It will in this case be executed
when the RTM processes the messages on the event queue (which includes window
events, display events, SWBus update events, etc.). Note that the action queue in the RTM
are normally processed when the system’s event queue is empty, i.e. the RTM is idle.
updateShape() provides an optional flags argument which accepts the following options:
• fast - The redraw action is put on the event queue (this is default).
• slow - The redraw action is put on the action queue.
xy2sx() and xy2sy() converts the shapes world coordinates to screen coordinates (relative
to the upper left corner of the window).
xy2wx() and xy2wy() converts screen coordinates (relative to the upper left corner of the
window) to the shapes world coordinates. If the shape is rotated or scaled, the shapes
world coordinates are not the same as the pictures world coordinates.
xy2shxy() returns coordinates in the shapes coordinate system, given coordinates in the
picture coordinate system. shxy2xy() returns the coordinates in the pictures coordinate
system, given coordinates in the shape coordinate system. Has only effect where the shape
is rotated or scaled, or the shape is an instance of a class.
1. The visibility attribute also controls if the shape is sensitive to dialogue events. This can be useful on e.g.
the dialogueArea shape.
ProcSee Reference Manual
431
Standard pTALK Functions
Shape (3pTALK)
shapeCursorX() and shapeCursorY() return the coordinates of the cursor, in the shapes coordinate system. The flags argument can contain one of the following flags: xyOrigo (this is
the default), xyXy, or xyOld. xyOrigo means that the coordinate system of the shape is with
origo in the shapes x,y coordinate. Shapes that do not have x,y attributes like group, are handled as if it had x=0 and y=0. The same is true for the line and polygon shapes. xyXy means
that the shapes coordinate system is treated as if the shapes x,y attributes specifies the x,y
position in the shapes coordinate system. xyOld means that instance and trend is handled as
xyOrigo, and the rest of the shapes as xyXy. See xyConv (page 497) for more information
about coordinate systems.
shapeToBack() and shapeToFront() moves the shape behind or in front of all the sibling
shapes. Returns 0 if it fails.
bX(), bY(), bWidth(), and bHeight() returns the x, y, width, and height of the bounding box
of the shape. The bounding box of a shape is the smallest surrounding rectangle. The coordinates returned are given in the picture coordinate system (world coordinates).
containsPoint() returns a non zero value if the shape contains the (wx,wy) point. The point
is given in the pictures world coordinates.
grabPointer() grabs the mouse pointer to the shape. If the argument relBtn is -1, a call to
ungrabPointer() is needed to ungrab the shape. If relBtn is 0, the currently pressed mouse
buttons have to be released to ungrab the shape. If relBtn is 1,2, or 3, this mouse button has
to be released to ungrab the shape. Returns 0 on failure, 1 on ok.
The select() and unselect() functions are used to select or unselect the shape.
The setShapeFlags() function can be used to set several flags on the shape.
Flag value
432
Description
DnDFlags.none
The value none is used to mark the shape as not a target area for drag
and drop. The value none should not be combined with the other DnDFlags.
DnDFlags.copy
DnDFlags.move
DnDFlags.link
These values are used to mark the shape as a drag and drop target area.
The values copy, move, and link can be ored together.
ShapeFlags.enterLeaveArea
The value enterLeaveArea is used to mark this shape as an enter leave
area, so that enter and leave events are given according to the area of
this shape, even if the shape is overlayed with other shapes.
ShapeFlags.nonstaticShape
The value nonstaticShape is used to mark this shape so it will not go
into the static background image used with the "static" update modes.
ShapeFlags.bboxDialogue
The value bboxDialogue is used to get old behaviour for instances and
groups: If this flag is set (for the class of the instance, or for the group),
the bounding box of the instance or group will be used as the active
area for dialogues. If this flag is not set, the active area is the active
area of the shapes in this instance or group.
ShapeFlags.antiAlias
The value antiAlias is used to tell that this shape should be drawn using
anti-aliasing, i.e. the pixels at the edge of the shape can be combined
with the background in a way that makes the edge look smooth. This
makes e.g. curves and sloping lines look much better.
ProcSee Reference Manual
Standard pTALK Functions
Shape (3pTALK)
These flags can be ored together. The value 0 means that the shape is a normal shape. The
getShapeFlags() function returns current shape flag setting. An example of changing
shape flags: s1.setShapeFlags( s1.getShapeFlags() | ShapeFlags.antiAlias )
The function setKeyFocus() sets the key focus to this shape. A lostKeyFocus() event will
be sent to the shape about to loose the key focus, and a gotKeyFocus() event to this shape,
i.e. the shape that receives the key focus. All key input will be directed to this shape after
calling setKeyFocus(). Note that only one shape can have the keyboard focus.
The function getViewableState() returns the current viewable state of the shape. The optional mask argument is anded with the result, so that only bits specified in the mask is
returned. The viewable state of the shape is based on the visibility of the shape and its parent shapes, and the mapped and displayed state of the picture the shape is in. This state is
composed of several bits defined in the ViewableState enumeration. This enumeration
contains mapped, displayed, and visible values. The value all is the or of the mapped,
displayed, and visible bits. If all these bits are set, the bit for viewable will also be set.
Changes in the viewable state can be detected with the dialogue trigger viewableStateChanged(), see page 335.
SEE ALSO
Picture(3pTALK) in "ProcSee Reference Manual" on page 395
Instance(3pTALK) in "ProcSee Reference Manual" on page 368
Text(3pTALK) in "ProcSee Reference Manual" on page 440
Line/Polygon(3pTALK) in "ProcSee Reference Manual" on page 376
ProcSee Reference Manual
433
Standard pTALK Functions
shutdown (3pTALK)
NAME
shutdown - bring down Run-Time Manager
SYNOPSIS
void shutdown();
DESCRIPTION
shutdown() is an asynchronous function that will take the RTM(1) through a graceful shutdown procedure.
EXAMPLE
:
shutdown();
434
// last thing you do is to stop RTM
ProcSee Reference Manual
Standard pTALK Functions
Size (3pTALK)
NAME
Size - object for storing a size.
SYNOPSIS
double
double
Size::width;
Size::height;
void
Size::set( double width, double height );
Rect*
::newSize();
DESCRIPTION
size objects holds a size. It has the attributes width, and height, all of type double. The
Size function set() can be used to set all the values of the Size object in one operation.
Named Size objects are created like attributes. The values of a Size object is not saved or
documented.
Anonymous Size objects can be created with the function newSize(), which creates a Size
object, and returns a pointer to it. When there are no pointers left pointing to the created
Size, it will be removed automatically.
ProcSee Reference Manual
435
Standard pTALK Functions
sqrt (3pTALK)
NAME
sqrt - square root
SYNOPSIS
double sqrt( double x );
DESCRIPTION
sqrt() returns the square root of x.
SEE ALSO
trig(3pTALK) in "ProcSee Reference Manual"on page 481
436
ProcSee Reference Manual
Standard pTALK Functions
string (3pTALK)
NAME
strcat, strcmp, strcpy, strncpy, strlen, strstr, strchr, strrchr, strdup, strtrim, strfield,
strsplit, stricmp, strnicmp, strnatcmp, strnaticmp, strformat - string operations
SYNOPSIS
char* strcat( char* s1, char* s2 );
int strcmp( char* s1, char* s2 );
int strncmp( char* s1, char* s2, int n );
char* strcpy( char* s1, char* s2 );
char* strncpy( char* s1, char* s2, int n );
int
strlen( char* s );
char* strstr( char* s1, char* s2 );
char* strchr( char* s1, char c );
char* strrchr( char* s1, char c );
char* strdup( char* s );
char* strtrim( char* str, [int|char*] options=0 );
char* strfield( char* str, int fieldNumber, [char|char*] delim=’|’ );
List* strsplit( char* str, [char|char*] delim='|', limit=0 );
char* strquote( char* s1, char quote=’"’ );
char* strunquote( char* s1 );
char* strlower( char* str );
char* strupper( char* str );
int
stricmp( char* s1, char* s2 );
int
strnicmp( char* s1, char* s2, int n );
int
strnatcmp( char* s1, char* s2, int n );
int
strnaticmp( char* s1, char* s2, int n );
char* strformat( char* format, ... );
DESCRIPTION
All functions operate on null-terminated strings. A run-time error will occur if any of the
strings are actually null pointers.
strcat() appends a copy of string s2 to the end of string s1. A pointer to the null-terminated
result is returned. If the string object pointed to by s1 is not big enough to hold the con
catenated result, a run-time error occurs.
strcmp() compares its arguments and returns an integer greater than, equal to, or less than
0, according as s1 is lexicographically greater than, equal to, or less than s2. strncmp() is
equal to strcmp() except that it compares the first n characters of s1 and s2.
strcpy() copies string s2 to s1 until the null character has been copied. strncpy() copies
string s2 to s1 until either the null character has been copied or n characters have been
copied. Both functions returns s1. If the string object pointed to by s1 is not big enough
to hold the result, a run-time error occurs.
strlen() returns the number of characters in s, not including the null-terminating character.
strstr() is returning a pointer to the first occurrence of string s2 in the first string (s1). A
null- pointer is returned if s2 does not occur in s1. If s2 has zero length, strstr() returns
the first string, s1
ProcSee Reference Manual
437
Standard pTALK Functions
string (3pTALK)
strchr() is returning a pointer to the first occurrence of the character c in the string (s1). A
null- pointer is returned if c does not occur in s1.
strrchr() is returning a pointer to the last occurrence of the character c in the string (s1). A
null- pointer is returned if c does not occur in s1.
strdup() is returning a copy of the input argument string (s). The string is released from
memory when no pointers point to it anymore.
strtrim() is returning a copy of the input argument string (str), with leading and ending
whitespace removed. The optional options argument can specify TrimOption.start or
"start" to only remove leading whitespace, or TrimOption.end or "end" to only remove ending whitespace. The default is to remove both leading and ending whitespace. Whitespace
here is characters in the range ’\x01’ to ’\x20’.
strfield() is returning a pointer to the fieldNumber in the string (str). The delim argument
specifies the seperator. The separator is either a single character or a character string. If the
delim argument is 0, the separator is white-space. A null-pointer is returned if fieldNumber
exceed the number of fields in s1.
strsplit() is returning a List of strings, resulting from splitting the string (str). The delim argument specifies the seperator. The separator is either a single character or a character string.
If the delim argument is 0, the separator is white-space. The limit argument specifies the
number of elements in the resulting list, with the last element containing the rest of the string.
Its default value of 0 means to split the string at all places the delimiter is found.
strquote() returns a pointer to a string where the input string (s1) is surrounded by the quote
character (quote). Further the backslash character, ’\’, is inserted before any escape sequence. The last argument (quote), specifies the character to surround the input string. The
default value of (quote) is the character, ".
strunquote() returns a pointer to a character string where the first and the last characters,
plus all back slash characters in front of each escape sequence characters are removed from
the input string (s1).
strlower() and strupper() converts the string (character array) passed as argument to lowerand upper case letters, respectively. The return value from these function are the converted
character array.
The stricmp() and strnicmp() functions compares the strings passed as argument using a
case insensitive algorithm, and returns a value indicating their relationship. For more information about the return values, see the case sensitive equivalents, strcmp() and strncmp().
The strnatcmp() and strnaticmp() functions compares the strings passed as arguments using a "natural" order algorithm. Return value is <0, 0, or >0. strnatcmp() is case sensitive,
and strnaticmp() is case insensitive. The "natural" order is comparing numbers in the strings
as numbers, and not as digit characters, so that e.g. the strings "a1", "a2", "a10" sorts in this
order, and not like "a1","a10","a2". In addition, it sorts space and control characters before
symbols before digits before letters before characters with the hi-bit set. Each of these groups
are in ASCII-code order, except letters, where the sort order is A,a,B,b,...,Z,z.
The strformat() function creates a string formatted according to the format argument, in the
same way as the sprintf function. For more information see the description of printf/sprintf/
strformat on the print man page.
438
ProcSee Reference Manual
Standard pTALK Functions
system (3pTALK)
NAME
system - execute a UNIX command
SYNOPSIS
int system( char* string, ... );
DESCRIPTION
system() causes the string to be given to the shell as input, as if the string had been typed
as a command at a terminal. RTM(1) waits until the shell has completed, and then returns
the exit status of the shell. The string argument can contain formatting options like those
supported by printf(), and arguments to be formatted can be given.
EXAMPLES
char* gedOptions;
:
system( “ged %s &”, gedOptions ); // starts ged with the given options
WARNINGS
Be sure to include a trailing & to the shell so that RTM(1) doesn’t hang for an unacceptable amount of time.
ProcSee Reference Manual
439
Standard pTALK Functions
Text (3pTALK)
NAME
Text - text and input graphics shape.
SYNOPSIS
// Attributes
char*
Text::format;
any
Text::theText;
int
Text::alignment;
// Functions
void
Text::edit( bool on, float width = 0 );
char*
Text::buffer();
bool
Text::isInEditMode();
int
Text::clearSelection();
int
Text::selectWord();
int
Text::selectAll();
int
Text::moveRight();
int
Text::moveLeft();
int
Text::moveToEnd();
int
Text::moveToHome();
int
Text::deleteForward();
int
Text::deleteBackward();
int
Text::position();
int
Text::put( char c );
int
Text::textWidth();
void Application::setTextEditorAttributes( int curType,
int curBlinkTime = -1, int curFg = -1, int curBg = -1,
int selFg = -1, int selBg = -1 );
DESCRIPTION
Text is a graphics text shape used to visualize text and entering input values in ProcSee.
The format attribute provides a description of the text to visualize. The format attribute can
consist of two types of characters, plain text which are displayed as is and a conversion specification, used to determine how the attribute theText is displayed. For more information
about the format attribute, see printf. Only one conversion specification is accepted by this
format attribute. In addition to the normal printf handling, the format specification part of
the result will be replaced with ’*’-characters if the format specification contains a length,
and the resulting value needs more space than this length. Note that the data type of the theText value must correspond to the type expected by the format. For "%s", NULL is displayed in the Text shape if the data type of the attribute theText does not match the
conversion specification in the format attribute. If "%d" is specified in the format string,
then the attribute theText must specify an integer value. The attribute theText is of type any
and accepts values of any primitive data type.
alignment specifies where to display the text relative to its x, y position. The default value
of this attribute is left, baseline. The text can be left (0), center (1), decimal (3) and right (2)
aligned in the horizontal direction, and top (0x10), vcenter (0x20), baseline (0) and bottom
(0x30) aligned in the vertical direction. The constants for these values are defined in the
440
ProcSee Reference Manual
Standard pTALK Functions
Text (3pTALK)
enum TextAlign. For decimal alignment, the decimal position has to be within the area
where the format specifier is inserting the value from the theText attribute. If not, the
alignment is at the end of this area.
edit() toggles edit (input) mode. If the argument on is true, edit mode is turned on, i.e. an
I-beam cursor is displayed in the text near the pointer cursor position, and the text is ready
to receive keyboard input. If the on argument is false, edit mode is turned off, i.e. the Ibeam cursor disappears and the text is redisplayed. The width argument set the width on
the text inputfield when the text is in edit (input) mode. If width is not given the default
value is 0, i.e. the width is the same as the original width of the text.
buffer() returns the current input buffer if the text is in edit (input) mode, otherwise the
function returns an empty string.
isInEditMode() returns true if the text object is currently in edit (input) mode, false otherwise.
clearSelection() clears the selected text if the text object is in edit mode, otherwise it does
nothing. The routine returns the current I-beam position (0 is before the leftmost character), or -1 if the text object isn’t in edit mode.
selectWord() selects the word in which the I-beam cursor is currently positioned. A word
is any sequence of characters limited by spaces, tabs, or newlines. The I-beam cursor is
moved to the beginning or end of the word, whichever is nearest. The routine returns the
current I-beam position, or does nothing and returns -1 if the text object isn’t currently in
edit mode.
selectAll() selects all characters in the text. The I-beam cursor is moved to the beginning
or end of the text, whichever is nearest. The routine returns the current I-beam position,
or does nothing and returns -1 if the text object isn’t currently in edit mode.
moveRight() and moveLeft() clear the selection and moves the I-beam cursor one position to the right or left, if possible. The routines return the current I-beam position, or do
nothing and return -1 if the text object isn’t currently in edit mode.
moveToEnd() and moveToHome() clear the selection and moves the I-beam cursor to
the end or beginning of the text, if possible. The routines return the current I-beam position, or do nothing and return -1 if the text object isn’t currently in edit mode.
deleteForward() and deleteBackward() both have dual behaviour: If the text object contains selected characters, both routines behave identical and deletes all selected characters
from the text. If the text doesn’t contain a selection, then the routines delete the character
after or before the I-beam cursor, if possible. The routines return the current I-beam position, or do nothing and return -1 if the text object isn’t currently in edit mode.
position() returns the current I-beam position, or -1, if the text object isn’t currently in edit
mode. The position ranges from 0 to n, where n is the number of characters in the text.
put() inserts the character c given as input parameter in the text at the current I-beam position. The I-beam position is advanced one step to the right, i.e. to the right of the newly
inserted character. If the text object contains a selection, the inserted character replaces
the selected characters. The routine returns the current I-beam position, or does nothing
and return -1 if the text object isn’t currently in edit mode.
textWidth() returns the width of the text shape in screen coordinates.
ProcSee Reference Manual
441
Standard pTALK Functions
Text (3pTALK)
setTextEditorAttributes() is an application function and sets the behaviour to all text
shapes used in the application. If the value on the attribute is -1, it will not be changed by this
function. The curType attribute can have the following values:
0: Standard P3 cursor, it’s the default
1: Windows cursor ( | )
2: Motif cursor ( I )
3: Block cursor ( a )
To make the cursor more noticeable, it can be set to blink by the attribute curBlinkTime. The
time is given in milliseconds. Recommended time is 500. The minimum value is 20. The value 0 stop the blinking, it’s the default value. The colour on the cursor is set by curFg (default
black) and curBg (default white). At the moment only curType = 0 use the curBg. To change
the selection colour on the cursor, selFg (default white) and selBg (default black) should be
set.
When a text shape is in edit mode, the user can enter keyboard input to the shape. Shift together with the arrow buttons select the text. The edit mode contains predefined dialogues
(behaviour) that is reasonably compatible with GNU Emacs, but the behaviour can still be
redefined by adding dialogues to the text object. The corresponding pTALK routines are
shown in parentheses, if applicable:
Ctrl-A
Go to beginning of line ( moveToHome() )
Ctrl-E
Go to end of line ( moveToEnd() )
Ctrl-F
Go one character forward ( moveRight() )
Ctrl-B
Go one character backward ( moveLeft() )
Ctrl-D
Kill character after cursor ( deleteForward() )
Ctrl-K
Kill characters to end of line
The mouse can also be used to mark (select) characters in the text:
left button click
Place I-beam cursor
left button double click Mark word ( selectWord() )
left button triple click
Mark whole input buffer ( selectAll() )
shift left button click
Extend current selection to cursor position
left button down drag
Mark characters
ProcSee supports copy/paste of text using X-Windows’ cut buffers. Marking characters rolls
the cut buffer stack 1 step and places the marked characters in cut buffer 0. Pressing the middle mouse button pastes in the characters currently in X cut buffer 0 at the current I-beam
cursor position.
SEE ALSO
Shape(3pTALK) in "ProcSee Reference Manual"on page 430
442
ProcSee Reference Manual
Standard pTALK Functions
time (3pTALK)
NAME
time, cftime, strcftime, mktime, localtime - get time, convert time to string and convert
year, month, day, etc. to or from a standard unix time
msecsToday - get the number of milliseconds since midnight.
setTimeZone - sets the time zone used by all time functions in ProcSee.
SYNOPSIS
int time( int* clock );
int cftime( char* s, char* format, int clock, int zone=0 );
char* strcftime( char* format, int clock, int zone=0 );
int mktime( int year, int month, int day, int hour, int minute,
int second, int dst=-1, int zone=0 );
int localtime( int theTime, int* year, int* month, int day*,
int* hour, int* minute, int* second, int* dst,
int zone=0 );
int msecsToday( int zone=0 );
void setTimeZone( char* timeZone );
DESCRIPTION
time() returns the value of time in seconds since 00:00:00 UTC, January 1, 1970. If clock
is non-zero, the return value is also stored in the location to which clock points. time()
fails and returns -1 if the clock parameter does not point to a legal integer object.
The zone parameter used in the time functions below can have the following values:
0 : use default timezone (UTC if the RTM is started with -g, local time if not.)
1 : use local timezone.
2 : use UTC timezone.
msecsToday() returns the number of milliseconds since midnight. The "millisecond" time
is reset to 0 at midnight.
cftime() and strcftime() converts the time in seconds since 1970, from the clock argument, to a string, using the format, and optional zone arguments. strcftime() returns this
string, and cftime() copies this string into the buffer pointed to by the first argument s.
The format string consists of zero or more directives and ordinary characters. All ordinary
characters (including the terminating null character) are copied unchanged into the result.
Each directive is replaced by appropriate characters as described in the following list. The
appropriate characters are determined by the LC_TIME category of the Run-Time Manager’s locale and by the time represented by the clock parameter.
%%
same as the "percent" character (%)
%a
locale's abbreviated weekday name
%A
locale's full weekday name
ProcSee Reference Manual
443
Standard pTALK Functions
time (3pTALK)
%b
locale's abbreviated month name
%B
locale's full month name
%c
locale's appropriate date and time representation
%d
day of month ( 01 - 31 )
%D
date as %m/%d/%y
%e
day of month ( 1 - 31; single digits are preceded by a space)
%h
locale's abbreviated month name.
%H
hour ( 00 - 23 )
%I
hour ( 01 - 12 )
%j
day number of year ( 001 - 366 )
%k
hour ( 0 - 23; single digits are preceded by a blank)
%l
hour ( 1 - 12; single digits are preceded by a blank)
%m
month number ( 01 - 12 )
%M
minute ( 00 - 59 )
%n
same as \n
%p
locale's equivalent of either AM or PM
%r
time as %I:%M:%S [AM|PM]
%R
time as %H:%M
%S
seconds ( 00 - 61 ), allows for leap seconds
%t
insert a tab
%T
time as %H:%M:%S
%U
week number of year ( 00 - 53 ), Sunday is the first day of
week 1
%w
weekday number ( 0 - 6 ), Sunday = 0
%W
week number of year ( 00 - 53 ), Monday is the first day of week
1
%x
locale's appropriate date representation
%X
locale's appropriate time representation
%y
year within century ( 00 - 99 )
%Y
year as ccyy ( for example 1986)
%Z
time zone name or no characters if no time zone exists
The difference between %U and %W lies in which day is counted as the first of the week.
Week number 01 is the first week in January starting with a Sunday for %U or a Monday for
%W. Week number 00 contains those days before the first Sunday or Monday in January for
%U and %W, respectively.
444
ProcSee Reference Manual
Standard pTALK Functions
time (3pTALK)
cftime() returns the number of characters placed into the array pointed to by s not including the terminating null character.
mktime() converts the time specified in the parameters year, month, day, hours, minutes,
seconds, and dst to a standard unix time. It is not necessary to specify all the parameters
given to the function because mktime() uses current time as default. Setting the parameter
to -1 means that current time will be used instead. The dst parameter have the following
values: -1 : find out if daylight saving time is in effect for the specified time given. 0 : do
not use daylight saving time. 1 : use daylight saving time.
The parameters to the function mktime() are given below
year
- the year, must be in the range 1970 to 2038.
month
- month of the year. 1 to 12. 1 is January, 2 is February etc.
day
- day of the month. 1 to 31
hours
- hour of the day. 0 to 23
minutes
- minutes since last precise hour. 0 to 59
seconds
- number of second since last precise minute. 0 to 59
localtime() converts the time given (theTime) to its year, month, day, hour, minute, second, and dst. The arguments must be pointers to integer values. A NULL pointer (0) can
be used for the arguments which are not needed.
setTimeZone(...) sets the time zone used by all time functions in ProcSee. The following
strings are legal argument values accepted by setTimeZone():
UTC
- use universal time. UTC (Coordinated Universal Time)
never changes with the season, i.e. it is not affected by
daylight saving time (summer time). Note that starting the
RTM with the -g option sets UTC as the default time zone in
ProcSee.
GMT
- it’s an abbreviation for Greenwich Mean Time. This is the
same as UTC.
local
- use local time. Local time includes daylight saving time
(summer time) if approriate. Local time is the default time
zone used in ProcSee, unless the RTM is started with the -g
option.
NOTES
Although an extensive listing of format options accepted by cftime() is given above, the
number of options actually supported might vary across hardware and software platforms.
As a rule ProcSee accepts the format options for strftime(3C) on each specific platform.
EXAMPLES
int uxTime;
ProcSee Reference Manual
445
Standard pTALK Functions
time (3pTALK)
:
// Get the standard unix time for the date 01/04/1996 at 12:00:00
uxTime = mktime( 1996, 1, 4, 12, 0, 0 );
// Get the standard unix time New Years Day year 2000 at the same hour as
// current hour
uxTime = mktime( 2000, 1, 1, -1, -1, -1 );
// Set UTC time zone in the RTM
setTimeZone( "UTC" );
SEE ALSO
setlocale(3C), strftime(3C), strftime(4), environ(5)
446
ProcSee Reference Manual
Standard pTALK Functions
TimerAt (3pTALK)
NAME
TimerAt - executes a pTALK statement or function at a specified time.
SYNOPSIS
int
int
int
int
TimerAt::start( char* statement, int theTime );
TimerAt::start( void (*funcCB)(), int theTime );
TimerAt::stop();
TimerAt::isRunning();
DESCRIPTION
The class TimerAt executes a pTALK statement or function at a given time specified in
seconds since 1 january 1970. Instances of the class TimerAt are created like attributes.
Object of this class can be created in Application, Library, Class or Picture. Note that the
state of the timer object is not saved. They must be initialized when beeing loaded from
file.
The function start( ... ) initializes the timer class. The first parameter to this function is a
pTALK statement or a callback function. The callback function has the following prototype:
void (*funcCB)()
The last parameter theTime is the time specified in seconds since 1 january 1970. The
pTALK functions time( ... ) or mktime( ... ) are two functions that can be useful when
specifiying this time. The function returns 1 if the timer was successfully added, otherwise
0.
stop() stops the timer if it is running. The function returns 1 if the timer was successfully
stopped, otherwise 0.
The function isRunning() returns 1 if the timer is running or 0 if it is stopped.
EXAMPLES
TimerAt MyTimer;
...
void myCB()
{
// Called after one hour
}
void constructor()
{
// In Application constructor. Let the timer execute the
// function myCB() one hour from when the application was
// started
MyTimer.start( myCB, time( 0 ) + 3600 );
}
ProcSee Reference Manual
447
Standard pTALK Functions
TimerAt (3pTALK)
SEE ALSO
TimerInterval(3pTALK) in "ProcSee Reference Manual"on page 449
448
ProcSee Reference Manual
Standard pTALK Functions
TimerInterval (3pTALK)
NAME
TimerInterval - executes a pTALK statement or function periodically.
SYNOPSIS
int TimerInterval::start( char* periodStatement, int interval,
int count = -1, int thePeriod = -1,
char* terminateStatement = 0 );
int TimerInterval::start( char* periodStatement, int interval,
int count = -1, int thePeriod = -1,
void (*termCB)() = 0 );
int TimerInterval::start( void (*periodCB)(), int interval,
int count = -1, int thePeriod = -1,
void (*termCB)() = 0 );
int TimerInterval::start( void (*periodCB)(), int interval,
int count = -1, int thePeriod = -1,
char* terminateStatement = 0 );
int TimerInterval::stop();
int TimerInterval::isRunning();
int TimerInterval::setInterval( int interval );
int TimerInterval::count();
DESCRIPTION
The class TimerInterval executes a pTALK statement or function periodically at given
intervals. Object of this class can be created in Application, Library, Class or Picture. Note
that the state of the timer object is not saved. They must be initialized when loaded from
file.
The function start( ... ) starts the timer interval object. The first parameter is either a
pTALK statement (periodStatement) or a callback function (periodCB) which will be
called periodically at specified intervals. The second parameter interval is specified in
milliseconds. If the parameter count is set to -1 it means that the timer object will run forever unless the parameter thePeriod is specified. If count is set to a positive integer value
the timer will run the pTALK statement or callback function this number of times before
terminating. The parameter thePeriod is used for specifying the period of time the timer
will be running before terminating. This argument is specified in milliseconds. The last
argument is a pTALK statement or a callback function. This statement or callback function
is called when the timer terminates due to the fact that the counter has reached zero or the
time period has expired for the timer. The termintion condition is specified either in the
arguments count or thePeriod. Note that this function is not called if the pTALK function
stop() is called. The start function returns 1 if the timer was successfully started, otherwise 0. Only the pTALK statement or callback function and the interval must be specfied.
The rest of the parameters to the start(...) function will have default values and will be
ignored by the TimerInterval class if not specified.
The callback functions funcCB and termCB have the following prototype:
void (*periodCB)()
void (*termCB)()
ProcSee Reference Manual
449
Standard pTALK Functions
TimerInterval (3pTALK)
stop() stoppes the timer object. The function returns 1 if the timer object was successfully
stopped, otherwise 0.
setInterval(...) changes the periodic interval of a running timer object. The parameter interval is specified in milliseconds. Note that the timer object must be running for this function
to take any effect. Returns 1 if the periodic interval was successfully changed, otherwise 0.
isRunning() returns 1 if the timer object is running or 0 if the timer is stopped.
count() returns the number of times the periodic function or statement is called since
start(...) was called.
EXAMPLES
TimerInterval UpdateTimer;
...
void updateCB()
{
// Called every second for 2 hours.
...
}
...
void termCB()
{
// The time period has expired for the update timer.
...
}
...
void constructor()
{
// In Application constructor. Let the timer execute the
// function updateCB() every second for two hours. The pTALK
// function termCB will then be called.
UpdateTimer.start( updateCB, 1000, -1, 7200, termCB );
}
SEE ALSO
TimerAt(3pTALK) in "ProcSee Reference Manual"on page 447
450
ProcSee Reference Manual
Standard pTALK Functions
tolower, toupper (3pTALK)
NAME
tolower, toupper - character conversion functions
SYNOPSIS
int tolower( int c );
int toupper( int c );
DESCRIPTION
tolower() and toupper() takes one character argument and returns its corresponding lower-case or upper-case character. The parameter c should be in the range 0 to 255 (unsigned
char).
EXAMPLES
printf("%c",toupper(’a’));
ProcSee Reference Manual
451
Standard pTALK Functions
toString (3pTALK)
NAME
toString - get a string from any expression.
SYNOPSIS
char* toString( any value );
DESCRIPTION
toString() converts its input argument to a string, and returns this string. If the input argument already is a string this is returned unchanged. Integers and floats are converted as expected, addresses are converted to strings containg the fullName of the element pointed to,
or the string "0" if it is a null pointer.
452
ProcSee Reference Manual
Standard pTALK Functions
tr (3pTALK)
NAME
tr - connects a trend variable to a trend shape attribute.
trTime - gets the time at the current tr position.
SYNOPSIS
float tr( char* variable );
unsigned int trTime();
DESCRIPTION
The function tr() connects a trend variable to a trend shape attribute. For the time being
the tr() function can only be used in the TrendPres shape.
The purpose with this function is to connect a trend variable to an attribute in a shape. For
instance to better reflect the state of the historical data the attribute foreground colour of
a trend curve may be trended together with the amplitude value. The tr() function is guaranteed not to be handled as regular dynamics, but each historic trend point is used to determine the attribute’s value.
The parameter variable is the name of the trend variable, this name must be specified in
the trend specification file. The log frequency of the parameter variable must correspond
with the log frequency of the amplitude variable, the result is otherwise unpredictable.
Note that the tr() function uses the log frequency of the trend shape (TrendPres) it is defined in. If for instance the logFrequency attribute in a TrendPres shape is set to 5 seconds
the variable in the tr() function must be logged with an interval of 5 seconds as well. The
parameter variable can be a string, a pointer to a trended variable or any legal pTALK expression returning a trend variable name.
Several tr() functions can be specified in one statement. If for instance a function is depending upon several float values, several tr() functions may be specified.
The trTime() function gets the current time for the trend point the tr() function corresponds to. It can only be used in combination with the tr() function.
EXAMPLES
function �int func( float a, float b )
{
if ( a > b ) return 0;
if ( a == b ) return 1;
return 2;
}�
class TrendPlot
{
.
.
variable
= "var1";
foregroundColour = �tr( "trFgCol" )�;
ProcSee Reference Manual
453
Standard pTALK Functions
presentation
.
.
tr (3pTALK)
= �func( tr( "var1" ), tr( "var2" ) )�;
};
NOTE
The tr() function can only be used in a TrendPres shape.
SEE ALSO
TrendPres(3pTALK) in "ProcSee Reference Manual"on page 474
454
ProcSee Reference Manual
Standard pTALK Functions
Trend (3pTALK)
NAME
Trend - user interface component displaying historical data.
SYNOPSIS
// attributes
int Trend::orientation;
int Trend::scroll;
int Trend::timespan;
char* Trend::trLog;
// functions
TrendGrid* Trend::newTrendGrid( char* name );
TimeTag* Trend::newTimeLabel( char* name );
TrendPres* Trend::newTrendPres( char* name );
TrendRuler* Trend::newTrendRuler( char* name );
EventPlot* Trend::newEventPlot( char* name );
int
Trend::numTimeLabel();
int
Trend::numTrendGrid();
int
Trend::numTrendPres();
int
Trend::numTrendRuler();
int
Trend::numEventPlot();
void
Trend::panAbs( int time );
int
Trend::panFreeze( int freeze );
void
Trend::panRel( int delta );
void
Trend::reset();
int
Trend::scrollValue( int timeAlignment, int scrollFactor);
void
Trend::setScrollModifier( void (*funcCB)( ::Trend* trend,
int* theTime,
int lastTime,
int type,
any userData = 0 ),
any userData = 0 );
unsigned int Trend::theTime();
unsigned int Trend::xyW2Time( float x, float y );
unsigned int Trend::xW2Time( float x );
DESCRIPTION
The Trend class displays historical data received from the TrendLog(3pTALK).
The orientation attribute determines whether the trend curve is displayed left-to-right,
right-to-left, or circular. Setting the attribute to 0 will display the positive time axis from
left to right. This is the default behaviour for the Trend. If this attribute is set to the value
1 the time and there for also the curves will be displayed from right to left. The curves in
a circular Trend diagram are always displayed counter-clockwise. Setting the orientation
attribute to 2 will display the curves in a circular manner. All other values for this attribute
will be ignored.
The attribute scroll is used when calculating the trend time window's last time. It controls
two behaviours; how much the trend diagram is scrolled in percentage of the time-span,
and how the last time in the trend diagram is aligned. Notice that the last time is re-calcu-
ProcSee Reference Manual
455
Standard pTALK Functions
Trend (3pTALK)
lated only when one or several of the trend presentation curves have reached the last time in
the trend diagram, or the scroll attribute has been changed. It is recommended to use the
pTALK function scrollValue(…) when setting this attribute, for instance, scroll = `scrollValue( 60, 50 )`. The lower eight bits (least significant bits) are used for the scroll factor. This
factor is in percentage of the Trend attribute timespan, and must be in the range [0,100].
Values outside this range will be ignored. A warning message will be issued to the output
window if values outside this range are set. A value of 50% means that the trend presentation
curve(s) will be moved to the middle of the trend diagram. Notice that a value of 0 will not
influence on the calculation of the trend diagram's last time. The upper twenty four bits (most
significant bits) are used to better control the alignment of the trend diagram's last time. The
value of the time alignment must be in the range [0, timespan], i.e. inside the values 0 and
the Trend attribute timestamp. If the attribute is set to a value outside this range a warning
message will be issued and the value will be ignored. Setting for instance the time alignment
value to 60 will align the trend diagrams last time to minutes. The time alignment factor can
be set regardless whether the scroll factor is set or vice versa. Notice that the scroll factor is
calculated before the time is aligned. If the scroll modifier call-back function is enabled via
the pTALK function setScrollModifier(…), the second argument to the call-back function is
the calculated time and not the trend subscription's last time.
trLog is the name of the trend logger the Trend diagram is receiving its historical data from.
The trend logger may be an internal or an external trend logger. The RTM looks up in the
symbol table to find the trend logger specified in the application. This name is the default
name for this attribute. One trend diagram can only be receiving data from a single trend logger. A good practise is to define the trend logger in the application before creating any picture
with Trends. If you do so you may ignore this attribute, otherwise this attribute must be set
to the name you are going to give the trend logger.
timespan is the attribute used to specify the number of seconds or the interval the Trend diagram is displaying data for. All the shapes contained in a Trend diagram use this attribute
to calculate their positions.
newTrendGrid(), newTimeLabel(), newTrendPres(), newTrendRuler() and newEventPlot() are functions which add a time label, a trend grid, a trend presentation a trend ruler
and an event plot respectively to a trend diagram. These functions take as the only parameter
the name of the new shape. This name must be unique.
The functions numTimeLabel(), numTrendGrid(), numTrendPres(), numTrendRuler()
and numEventPlot() returns the number of time labels, trend grids, trend presentations,
trend rulers and event plots defined in a trend diagram.
When calling the function panAbs() the trend diagram requests for data from the trend logger for the given time and the attribute timespan seconds back in time and displays the data.
The time which is the parameter to this function is given in standard unix time format. If the
time specified is back in time and it is not contained in the trend diagram sent from the application no more updates will be sent to the Trend. The only possible way to get new data
is to pan the trend so the diagram is inside current trend time, this can be obtained with the
function panAbs() given that the parameter is set equal to the trend time variable.
The function panRel() has the same properties as panAbs() but the parameter is added or
subtracted from the trend’s current time. If the value is negative the trend will be panned this
number of seconds back in time, or if it is positive it will be panned forward in time.
456
ProcSee Reference Manual
Standard pTALK Functions
Trend (3pTALK)
The function panFreeze() is used to freeze a trend at a given time. If the parameter freeze
is 1 it will freeze the time, 0 means unlock the freeze. This function will normally be
called before the functions panAbs() or panRel().
The reset() function will clear all trend plots currently contained in the Trend.
The function int scrollValue( int timeAlignment, int scrollFactor = 0 ) calculates a value composed of a time alignment and a scroll factor. This function is applicable only when
setting the Trend's scroll attribute. The intention with this function is to make it easier
and less error-prone when setting the value of the scroll attribute. The last argument
scrollFactor has a default value of 0. For instance to align the trend diagram’s last time
on hours, use scrollValue( 3600 ). For more information, see the scroll atribute.
The function setScrollModifier(…) registers a call-back function which is called each
time one of the trend curves reach the last visual time in the trend diagram. The purpose
with this call-back function is to modify and better control the last time used in the trend
diagram. The setScrollModifier(…) function has two arguments, a pointer to a call-back
function funcCB and user specific data, userData. The last argument is optional. If it is
specified it must be specified in the call-back function as well. The user data will be sent
unmodified in the last argument to the call-back function. The first argument in the callback function is a pointer to the Trend object calling the function. The next argument is
theTime. This is an in/out parameter controlling the last time used by the trend diagram.
Notice that the function is called after the parameter theTime has been altered with the attribute scroll. The argument lastTime is the last time of the trend curves got in the update
message from the trend log. The argument type is 1 for normal cyclic updates and 0 for a
complete new data set (a new request).
theTime() returns the last visual time in the trend diagram.
The xW2Time() function takes a world coordinate x in the Trend, and convert it to a corresponding time. This function is typically used in the action part of a dialogue in the
Trend.
The function xyW2Time() converts a world coordinate (x,y) pair to a standard unix time.
The time returned will always be inside the Trend diagram’s time interval. This function
is typically used in the action part of a dialogue in the Trend or in any other shape to move
one or several Trend rulers.
NOTES
Note that when the orientation attribute is set to circular Trend the time labels within the
diagram will not behave properly if the shape is rotated. If a circular trend is rotated then
remove the trend labels.
The functions xW2Time() and xyW2Time() are identical as long as the functions are
used within a non-circular Trend diagram. Note that the function xW2Time() can not be
used in a circular Trend. This function may be removed in the next release of ProcSee so
do not use xW2Time(), use xyW2Time() instead.
ProcSee Reference Manual
457
Standard pTALK Functions
Trend (3pTALK)
Setting the background fill style to none is not recommended because the trend curves are
not erased when new trend points are received from the trend logger. If a non buffering update mode is used the curves will look erroneously. Another problem is that the ruler will not
be erased in its old position when it is moved.
EXAMPLES
function `void timeCB( ::Trend* theTrend, int* theTime,
int lT, int reqType, int deltaT )
{
int t = *theTime + deltaT;
t /= deltaT;
t *= deltaT;
*theTime = t;
}
Trend T
{
...
}
...
{
T.setScrollModifier( timeCB, 3600 );
}
SEE ALSO
TrendLog(3pTALK) in "ProcSee Reference Manual"on page 462
TrendPres(3pTALK) in "ProcSee Reference Manual"on page 474
TrendRuler(3pTALK) in "ProcSee Reference Manual"on page 480
TrendGrid(3pTALK) in "ProcSee Reference Manual"on page 459
TimeTag(3pTALK) in "ProcSee Reference Manual"on page 461
EventPlot(3pTALK) in "ProcSee Reference Manual"on page 339
458
ProcSee Reference Manual
Standard pTALK Functions
TrendGrid (3pTALK)
NAME
TrendGrid - trend diagram component displaying a grid
SYNOPSIS
// attributes
float TrendGrid::autoStep;
int TrendGrid::depthPosition;
int TrendGrid::noOfLines;
char* TrendGrid::theTrendPres;
int TrendGrid::timeInterval;
int TrendGrid::timeOffset;
// functions
void TrendGrid::toBack();
void TrendGrid::toFront();
int TrendGrid::getLine( float* pos, float* value, int major,
int minor = -1, TrendPres* tp = 0 );
int TrendGrid::getNumLines();
DESCRIPTION
The TrendGrid class displays a grid in a trend diagram.
The attributes autoStep and theTrendPres are used to connect the grid to a trend curve.
When set the horizontal grid lines are locked to the values of the curve. A change in the
trend curve's upper or lower limit will result in a change in the trend grid. The grid lines
will also appear as logaritmic if the attribute presentationFunc in the TrendPres shape is
set to either 1 or 2.
The attribute theTrendPres must be set to 0 or to the name of a TrendPres shape. The
autoStep attribute specifies a factor. If it is set to 10 and the TrendPres::presentationFunc
is set to log10, the horizontal grid lines will appear at the positions 1, 10, 100, 1000, ... .
If the TrendPres::presentationFunc is set to linear the horizontal grid lines will appear at
the positions 0, 10, 20, 30, ... . The attribute noOfLines specifies the number of lines between each line given by autoStep.
The attribute depthPosition controls the position of the grid among the other shapes contained in the trend diagram. The attribute can be set to the values 0,1,2 which will put the
grid behind any other non-grid trend shape, behind the trend rulers or in front of any other
non-grid trend shape, respectively.
Horizontal grid lines is set with the attribute noOfLines. A value of 0 will display a grid
with no horizontal grid lines.
The timeInterval attribute determines the amount of space between two successive vertical grid lines in a trend diagram. Setting this attribute to 0 will remove any vertical grid
lines. Number of vertical grid lines are controlled with the attributes timeInterval, timeOffset and Trend::timespan.
The attribute timeOffset determines the position of the first vertical grid line.
ProcSee Reference Manual
459
Standard pTALK Functions
TrendGrid (3pTALK)
The function toBack() displays the grid behind any other grid shape in the same depthPosition defined in the trend diagram.
The function toFront() displays the grid in front of any other grid shape in the same depthPosition defined in the trend diagram.
The function getLine() calculates the vertical position and value of a horizontal grid line
specified by the arguments major and minor. The result is returned in the arguments pos and
value. The vertical position is returned in world coordinates. If the argument tp is set to a
TrendPres then the argument value is calculated based on its minimum and maximum limits.
Setting the tp argument to 0 forces the function getLine() to use the first TrendPres it finds
in the Trend. The attributes autoStep and noOfLines are used to create a grid with both major and minor horizontal grid lines. The argument major must be in the range 0 to the value
returned from the function getNumLines(). The argument minor must be in the range 0 to
the value of the attribute noOfLines. To get only the major grid lines set minor to 0. This
function is normally used to calculate the position and value of horizontal grid lines when
logarithmic or follow trend grid is set.
The function getNumLines() returns the number of major grid lines which is created in the
TrendGrid.
SEE ALSO
Trend(3pTALK) in "ProcSee Reference Manual"on page 455
460
ProcSee Reference Manual
Standard pTALK Functions
TimeTag (3pTALK)
NAME
TimeTag - trend diagram component displaying historic time
SYNOPSIS
// attributes
int TimeTag::alignment;
char* TimeTag::format;
int TimeTag::interval;
float TimeTag::offset;
int TimeTag::theFont;
// functions
int TimeTag::getStartTime();
void TimeTag::setStartTime( int startTime );
DESCRIPTION
The TimeTag class displays the time received from the Trend logger in given intervals
above or below the trend diagram.
The alignment attribute determines whether the time labels should be aligned left, centered or right. This attribute can be set to 0, 1 or 2 where a value equal to 0 means that the
time labels are aligned left, 1 are centered and 2 is right aligned.
The format attribute consists of zero or more directives and ordinary characters. All ordinary characters are copied unchanged into the time labels. For more information about
the directives available for the format attribute see the format parameter in the function
cftime(3pTALK) The default value for this attribute is "%T".
The attribute interval together with the attribute timespan in Trend controls the total
number of time labels in a TimeLabel shape. Between two successive time labels there are
interval number of seconds.
The offset attribute controls whether the labels should be placed above or below the trend
diagram. A negative offset displays the labels above and a positive offset places the labels
below the trend diagram. The absolute value of the offset attribute is the amount of space
between the edge of the trend diagram to the trend labels.
The theFont attribute is the font used to display the time labels.
setStartTime(…) sets current start time for the trend labels. Setting a new start time will
modify the time received from the trend. The argument startTime will be subtracted from
the time got in the update message.
getStartTime() returns the time set by the function setStartTime(…) or 0.
SEE ALSO
Trend(3pTALK) in "ProcSee Reference Manual"on page 455
time(3pTALK) in "ProcSee Reference Manual"on page 443
ProcSee Reference Manual
461
Standard pTALK Functions
TrendLog (3pTALK)
NAME
TrendLog - base class for trend logger functionality.
SYNOPSIS
int TrendLog::addEvent( void (*funcCB)( int requestId,
char* eventName,
int state ),
char* eventName,
char* dataType,
int history );
void TrendLog::addVariable( void (*funcCB)( int requestId,
char* varName, int state ),
int requestId, char* variableName,
int logFrequency, int history,
int logType = 5,
int mode = 1,
float lowerLimit = -1e10,
float upperLimit = 1e10 );
int TrendLog::analyse( int mode );
int TrendLog::clearEvents( void (*funcCB)( int requestId,
char* eventName,
int state ),
int requestId,
char* eventName );
void TrendLog::document( void (*funcCB)( int requestId, int state ),
requestId );
int TrendLog::event( void (*funcCB)( int requestId,
char* eventName,
int state ),
int requestId, char* eventName,
int timeStamp, void* data );
int TrendLog::events( void (*funcCB)( int requestId,
char* eventName,
int state ),
int requestId, char* eventName,
int num, int* timeStamps, void* data );
void TrendLog::freeze ( int mode );
int TrendLog::getEventInfo( void (*funcCB)( int requestId, List* list ),
int requestId, List list,
char* inputMask, char* outputMask,
char* eventName = "",
char* dataType = "",
int history = 0 );
void TrendLog::getVariableInfo( void (*funcCB)( int requestId, List l ),
int requestId, List list,
char* inputMask,
char* outputMask,
char* variableName = "",
int logFrequency = 0,
int history
= 0,
int logType = 5,
int mode = 1,
float lowerLimit = -1e10,
462
ProcSee Reference Manual
Standard pTALK Functions
TrendLog (3pTALK)
float upperLimit = 1e10 );
void TrendLog::logMode( int mode );
void TrendLog::maxInterpolTime( int time );
int TrendLog::removeEvent( void (*funcCB)( int requestId,
char* eventName,
int state ),
int requestId,
char* eventName, );
int TrendLog::removeVariable( void (*funcCB)( int requestId,
char* varName, int state ),
int requestId, char* variableName,
int logFrequency,
int logType = 5,
int mode = 1 );
void TrendLog::save( void (*funcCB)( int requestId, int state ),
requestId );
int TrendLog::setTime( int time, int mode );
int TrendLog::timeTick( int time );
DESCRIPTION
The class TrendLog is a base class for the pTALK classes TrendLogInternal and
TrendLogExternal. Common functionality for these classes are put into this class.
The pTALK function addEvent(...) adds a new event type to the historic trend logger. It
accepts five arguments. The arguments in the correct order are: a user defined callback
function, a request identifier, an event type name, a data type name and history in seconds.
The third argument eventName is the name of the event type. This name is the same name
that must be used in the functions event(..) and events(...) to add new events to the historic
trend logger and in the event attribute in the EventPlot shape when the event should be
visualized. The dataType argument is either a primitive data type like float, int, etc. or a
complex data type (struct). Pointer data types are not supported. The last argument history is the number of seconds events of this type should be stored in the log before they are
automatically deleted. The first two arguments funcCB and requestId are optional and
can be set to 0. The funcCB is a callback function and is called asynchronously to indicate
wheter the function returned successfully or not. The callback function must have the following prototype:
void (*funcCB)( int requestId, char* eventName, int status )
, where requestId is the same request identifier that was passed as the second argument
to addEvent(...). eventName is the name of the event type and status will be set to one
of the following values. 0 indicates success.
Status
Value
Successful
0
Event exists already
257
Undefined data type
513
ProcSee Reference Manual
463
Standard pTALK Functions
TrendLog (3pTALK)
The pTALK function save(...) must be called after events have been added if the events added
should be made permanent between subsequent runs.
addVariable() adds a new trend variable to the trend logger. The argument funcCB(…) is a
callback function that will be called to indicate the status of the operation. The first two arguments to the callback function are requestId and variableName. These are the same arguments that were passed as the second and third argument to the addVariable() function.
The third argument is the status that indicates whether the operation was successful or not.
The function prototype for the callback function is:
void (*funcCB)( int requestId, char* variableName, int status )
, where requestId is a user supplied id, variableName is the name of the trend variable. The
least significant byte of status is 0 on success or 1 on failure. (status & 0x000F indicates
whether the operation was successful or not). The three most significant bytes include more
information. If the trend variable already existed in the trend logger the following bits indicate the difference between the existing variable and the variable that was added. See table
below.
Description
Value
Bit
Mode
256
8
History
512
9
Lower limit
1024
10
Upper limit
2048
11
Log type
4096
12
If the least significant byte was 1 (failure) the most significant bytes indicate the reason for
the failure. See table below.
Description
Value
Bit
Variable did not exist
256
8
The arguments funcCB(…) and requestId can be 0 if no status of the add trend variable operation is required. The argument logFrequency is the log cycle (in seconds) the trend logger
will use when updating the trend variable, i.e. how frequent the variable is logged to memory
or disk. Note that this log cycle must not be faster than the timeTickInterval specified in the
trend logger. The argument history specifies the number of seconds the trend logger will
store historic data for the variable. logType tells the trend logger how it will update the trend
variable. See table below.
464
Log Type
Value
Average value
1
Minimum value
2
ProcSee Reference Manual
Standard pTALK Functions
TrendLog (3pTALK)
Maximum value
3
Minimum/Maximum value. Alternate
4
Raw data
5
Each time
6
Prediction
7
The argument mode can be either 1 (real time, temporary) or 0 (historic, permanent). Note
that trend variables added with the mode parameter set to 1 (real time) will be available
immediately, while historic trend variables are not available until the function save() is
called. The arguments lowerLimit and upperLimit are the smallest and largest value that
will be logged, respectively.
The analyse() function is mainly used for debugging purposes. Be aware that printing debug information to standard out will slow down the system significantly. The following
values for the mode parameter will be recognized:
• 0 .. 10 different debug levels
• 11 show start-up banner from trend logger
• 12 list current subscriptions in trend logger
• 13 print a list of trend variables
The function clearEvents(..) clears all events of event type eventName from the historic
trend logger. The parameters funcCB and requestId is used to get status information. For
more information about these two arguments see addEvent(...). Note that this function
will automatically clear all trend diagrams displaying events of the event type that was
cleared. In the status field in the callback function, 0 indicates success and >0 indicates
failure.
document() documents all trend variables with the mode attribute (function addVariable(…)) set to 0 (historic trend variables) to the .Tdoc file. The arguments to this function
is the same as for save(). For more information about these argument see the description
for save(). document() should always be called after calling save(). Note that added trend
variables will not be available before save() is called and hence will not be documented.
The function document() also documents all events added with addEvent(...).
The function event(...) sends a single event to the historic trend logger. This function accepts five arguments. The first two arguments to this function is a user supplied callback
function and a request identifier. Status information is returned in the callback function.
These arguments are optional and can be set to 0. The callback function must have the following prototype:
void (*funcCB)( int requestId, char* eventName, int status )
ProcSee Reference Manual
465
Standard pTALK Functions
TrendLog (3pTALK)
, where requestId is the same identifier that was supplied in the second argument to the
event(...) function. The status is returned in the status parameter. The following table lists
possible status values. 0 indicates success.
Status
Value
Successful
0
Warning
2
Undefined event
257
Unknown type
513
Failed to convert
769
Internal error
1025
The parameter eventName is a name of one of the event types specified in the event configuration file (pevl). The parameter timeStamp is the time when the event occured. 0 can be
specified for this parameter meaning current trend logger time. The data to send to the historic trend logger is given in the last parameter data. This parameter can be a single primitive
data type like int, float etc. or a more complex data type like a struct variable. The data type
for the variable specified in the data parameter must be compatible with the event data type
given in the event configuration file (pevl). Note that the RTM will automatically try to convert the data to the correct data type. An error message will be returned if the type conversion
results in loss of precision.
The function events(...) is the plural version of the function event(...) described above and is
used for sending several events of the same event type simultaneously to the historic trend
logger. Note that the parameter num must be equal to the array size of the parameters timeStamps and data. Setting the parameter timeStamps to 0 will use current trend logger time.
freeze() is used with a mode parameter to make the trend logger acting on time ticks or not.
A mode value of 1 will set the trend logger in freeze mode (not logging data) while a value
of 0 will set the trend logger in run mode (default).
The function getEventInfo(...) is used to get specific event information from the historic
trend logger. This is an asyncronous function and the result is not applicable before the callback function is called. The information is stored as text strings in an instance of a List object.
This List instance is passed as argument to this function in the argument list. The prototype
for the callback function is as follows:
void (*funcCB)( int requestId, List list )
The requested information is specified in the input argument inputMask, eventName, dataType and history. The inputMask specifies which fields that contain information. These
fields must exactly match the events types stored in the historic trend logger. It is a text string
and is a combination of the following characters:
Description
466
Char
Input
Output
ProcSee Reference Manual
Standard pTALK Functions
TrendLog (3pTALK)
Event name
E
x
x
Data type
T
x
x
History
H
x
x
The outputMask specifies what kind of information that is wanted back from the historic
trend logger. It is like inputMask a text string and is a combination of one of the above
characters. The information stored in the text strings are separated with the character ’|’.
The function strfield(...) can be used to split this string into fields. The List instance will
contain text strings with the following format if "ETH" is specified for the outputMask.
“Ev321_V2|float|72000”
getVariableInfo() gets specific information about trend variables in the trend logger. The
requested information is put in a variable of type List. For more information about the
List class object see "List- functions used to handle lists." on page 380. The List variable
will contain character strings in the following format:
“::App.proc.var1|10|5”
, where the character �|’ is a separator used to divide the different information. The
pTALK function strfield() can be used to split the string in different parts.
The argument funcCB(…) is a callback function that will be called when the information
requested from the trend logger is stored successfully in the List variable. Note that the
information is not available before this callback function is invoked. Do not ever call getVariableInfo() and immediately operate on the List variable. Wait until the callback
function is called. The prototype for the funcCB() callback function is as follows:
void (*funcCB)( int requestId, List list )
Where requestId is the same user supplied id that was passed as the second argument to
getVariableInfo(). list is the same List variable that was passed as the third argument to
getVariableInfo().
inputMask is used to control which of the input arguments that contain valid information.
This is a string with a combination of one or several of the following characters. If 0 is
passed as argument, it means request all information.
Description
Char
Input
Output
Name
V
x
x
Fullname
F
Log frequency
C
x
x
History
S
x
x
Log type
T
x
x
Mode
M
x
x
Lower limit
L
x
x
x
ProcSee Reference Manual
467
Standard pTALK Functions
TrendLog (3pTALK)
Upper limit
U
x
x
outputMask is used to control what kind of information that is wanted back from the trend
logger. This is a string with a combination of one or several of the characters specified in table above. Note that name (V) and fullname (F) are mutually exclusive (F has precedence
over V if both are specified). The character strings stored in the List variable are on the format:
“V|C|S|T|M|L|U” or “F|C|S|T|M|L|U”
The description of the remaining arguments can be found in addVariable(). See the examples section for more information about how to use this function.
The trend logger can be ticked by cyclic update from SWBus (mode=1, default), by an external application(mode=2) or by pTALK code(mode=3). The logMode() function makes it
possible to select any of these three log modes from pTALK. Please note that this function
should be used together with the setTime() function.
The trend logger is expecting to be ticked at a regular interval. Data is logged according to
the following rules:
• the actual value is logged if trend logger is ticked regularly.
• if one or more time ticks are missing, the corresponding time span is calculated. If this
time span is below the value set by maxInterpolTime(), then values are interpolated for
the missing interval.
• if one or more time ticks are missing, and the missing time span is above the value set
by maxInterpolTime(), then data is assumed lost and illegal value is stored for the variables.
Default value is 30 seconds.
The function removeEvent(...) removes an event type from the historic trend logger. The
name of the event type to remove is specified in the argument eventName. The arguments
funcCB and requestId is described for the function addEvent(...). The status is returned in
the status parameter in the callback function. It will have one of the following values:.
Status
Value
Successful
0
Event does not exist
257
removeVariable() removes a variable from the trend logger. Only trend variables added with
the mode argument set to 1 (real time, temporary) can be removed. For a detailed description
about the arguments to this function, see addVariable().
save() saves all trend variables with the mode attribute (function addVariable(…)) set to 0
(historic trend variables) to the .ptrv file. The argument funcCB(...) is a callback function
that will be called when the save operation is finished to indicate the status of the call. This
argument can be 0 if no status is required. The argument requestId is a user-supplied number
468
ProcSee Reference Manual
Standard pTALK Functions
TrendLog (3pTALK)
that will be passed as the first argument in the callback function. The same callback function can be used if unique requestIds are used for instance for save() and document().
The function prototype for the callback function is:
void (*funcCB)( int requestId, int status )
, where requestId is the user supplied id that was passed in the second argument to save().
status is the status of the save operation. 0 indicates success, 1 failure. Note that save()
only has an effect when historic trend variables are added (mode parameter set to 0 in addVariable(…)). It is recommended that all trend variables are added before calling save()
and document(). Historic trend variables added on-line will not be updated before save()
is called. All event variables added with addEvent(...) will be saved to the trend configuration file.
To control the time for the trend logger, the setTime() function can be used. If the mode
parameter has the value -1, all existing historical data will be cleared. A value of 1 indicates to keep as much historical data as possible for variables logged in memory. The
trend logger will be set to the time contained in the time parameter.
The timeTick() function can be used to tick the trend logger when the logging mode
(timemaster) is set to be user driven (3). The time parameter is the Unix time in seconds.
Note that time must be incremented according to the expected interval between time ticks
(timeTickIntvl) parameter.
EXAMPLES
List aList;
void getVarCB( int requestId, List L )
{
for( int = 0; i < L.length(), i++ )
printf( "%s", L.get( i ) );
}
getVariableInfo( getVarCB, 10, aList, "CM","FT", "", 5, 0, 0, 1, 0, 0 );
SEE ALSO
Trend(3pTALK) in "ProcSee Reference Manual"on page 455
TrendPres(3pTALK) in "ProcSee Reference Manual"on page 474
TrendRuler(3pTALK) in "ProcSee Reference Manual"on page 480
ProcSee Reference Manual
469
Standard pTALK Functions
TrendLogExternal (3pTALK)
NAME
TrendLogExternal - class for accessing historical trend log data in an external RTM.
SYNOPSIS
void TrendLogExternal::execute(char* scope, char* source, ... );
int TrendLogExternal::isConnected();
void TrendLogExternal::connectTo( char* rtmName,
char* appName = "" );
DESCRIPTION
The class TrendLogExternal is used in an RTM to access trend logger data stored in an external RTM. This class is derived from TrendLog.
The function execute(...) executes a pTALK statement in the trend logger RTM. The statement is compiled and executed in the scope given as first parameter. The second parameter
can contain all formatting options supported by printf(). Optional formatting arguments can
follow the second argument.
isConnected() returns 1 if the connection to the external trend logger is established, otherwise 0.
connectTo(…) connects the external trend log to a process (RTM) running an internal trend
log. The name of the process is rtmName. The name of the application to connect to in the
external process is appName. If not specified it uses the name of the application where the
trend log is defined. If the TrendLogExternal object is connected to an external trend log it
will be closed before initiating a new connection to the process (RTM) specified in the first
argument to this function.
SEE ALSO
Trend(3pTALK) in "ProcSee Reference Manual"on page 455
TrendPres(3pTALK) in "ProcSee Reference Manual"on page 474
TrendRuler(3pTALK) in "ProcSee Reference Manual"on page 480
470
ProcSee Reference Manual
Standard pTALK Functions
TrendLogInternal (3pTALK)
NAME
TrendLogInternal - class logging historical data
SYNOPSIS
void TrendLogInternal::appendLogBuffer( char* fullName,
int logFrequency,
int numOfPoints,
int* tArr, float* vArr );
void TrendLogInternal::cancelLogBuffer( char* fullName,
int logFrequency );
void TrendLogInternal::connectedRTMs( List list );
int TrendLogInternal::eventTypeHandling( char* name,
char* convert = "",
char* less = "",
char* larger = "")
void TrendLogInternal::execute( char* rtms,
char* scope, char* source, ... );
void TrendLogInternal::execute( List rtms,
char* scope, char* source, ... );
void TrendLogInternal::getLogBuffer( char* fullName, int logFrequency,
int numOfPoints, int lastTime,
int* tArr, float* vArr );
int TrendLogInternal::isConnected( char* rtm );
void TrendLogInternal::newLogBuffer( char* fullName, int logFrequency,
int numOfPoints,
int* tArr, float* vArr );
void TrendLogInternal::setLogBuffers( int timeSpan );
void TrendLog::setTrigger( int mode );
int TrendLogInternal::snapshotSave( char* fileName, char* comment="" );
int TrendLogInternal::snapshotLoad( char* fileName );
int TrendLogInternal::snapshotGetTime( char* fileName );
char* TrendLogInternal::snapshotGetComment( char* fileName );
DESCRIPTION
The class TrendLogInternal is the class used for logging historical trend variables and
events. It is derived from the pTALK class TrendLog.
newLogBuffer() and appendLogBuffer() are functions for adding a set of predictive
data to the trend variable specified by the fullName and logFrequency parameters. A logFrequency value of -1 will use the first variable with this name (if more than one). The
tArr and vArr parameters are arrays that are supposed to contain time stamps and the corresponding values for all numOfPoints of data. Thus the first element of tArr will be the
oldest (back in time) time stamp and the first element vArr will hold the corresponding
value.
cancelLogBuffer() is a function for deleting predictive data in the trend logger. The fullName and logFrequency parameters will specify a trend variable uniquely as for the functions above.
ProcSee Reference Manual
471
Standard pTALK Functions
TrendLogInternal (3pTALK)
As opposed to the other functions that alter the actual content of the log buffers, the getLogBuffer() function is retrieving information from the log buffers and connects it to process
variables or attributes. The first parameters specify the trend variable and number of points
in the same way as the functions above. In addition it is required to specify the last time from
which the number of points is to be extracted. The lastTime parameter is used for this. The
points returned will be from lasTime and numOfPoints*logFrequency back in time.
The getLogBuffer() function will return logged data in two arrays, tArr and vArr. The first
element of this array will be the oldest value in tArr and the corresponding time stamp in
vArr. Element number numOfPoints-1 will contain data for lastTime.
One potential use of the getLogBuffer() function is to extract data from the trend logger each
time the logger is ticked. This can be done by calling the function setTrigger() function with
the mode parameter set to 1 from e.g. the constructor of the trend logger. The system will
then search for a user defined function in the trend logger which much be named trigger().
This functionality can be turned off again by calling the setTrigger() function with mode parameter set to 0.
All variables logged in memory can have their log buffers set to current (last logged) value
for a specified interval by calling the setLogBuffers() function. The timeSpan parameter is
time span in seconds that will be set. A value of -1 indicates setting the whole buffer to the
value last logged.
The function connectedRTMs(...) returns a list of the RTMs currently connected to the historic trend logger. The name of the RTMs are put into the list as text strings. The argument
list to this function is an instance of type List.
The pTALK function eventTypeHandling(...) is used to change the default rules for converting data types when using the pTALK functions event(...) and events(...) or the API functions
PfEvent(...) and PfEvents(...). The RTM will return an error message if a data type can not
be converted without loosing precision or there is a mismatch in an array size when adding
an event. This function can be used to change this behaviour. The parameter name is either
a data type or an event type. If an event type is specified it means that the conversion rules
for this event type is changed. If a data type is specified the historic trend logger will change
the default conversion rules for all the event types of this data type. This function is for advanced users only and should be left as is. In the RTM all data types are converted without
errors as long as the conversion does not result in loss of precision. For instance converting
a float to double is OK, but vice versa issues by default an error message.
The parameters convert, less and larger are text strings and legal characters for these strings
are shown in the table below. The mark x in the convert, less and larger columns gives the
legal character in the char column. The legal characters for convert is for instance "CWE".
Description
472
Char
Convert
Less
Larger
Convert
C
x
Warning
W
x
x
x
Error
E
x
x
x
Null padding
N
x
x
ProcSee Reference Manual
Standard pTALK Functions
Strip
TrendLogInternal (3pTALK)
S
x
The parameter convert is used to change the default rules for converting data types. The
next two parameters are used for arrays only. The data type char arrays are handled different compared to other array data types. Char arrays are treated as character strings and
by default these are null terminated. All other data types will issue error messages when
the data array does not match the event data type. The parameter less is used to change the
rules when the array data type passed as argument to any of the event functions are less in
size than the size of the event data type. If the size of the array data type is larger, the larger parameter must be used to change this default rules.
If setting the parameters convert, less and larger to the empty string "" the default convertion rules used by the RTM will be restored.
The function execute(...) executes a pTALK statement in one or several connected RTMs.
The statement is compiled and executed in the scope given as second parameter. The third
parameter can contain all formatting options supported by printf(). Optional formatting
arguments can follow the third argument. The first parameter rtm is either a character
string or a List instance. If the parameter rtm is a character string this string must be a
name of one of the connected RTMs. If the parameter rtm is an instance of a List class the
objects in this list must be names of RTMs to send the execute command to. Setting this
argument to 0 will send the execute command to all the connected RTMs.
The function isConnected(...) returns 1 if the name of the rtm passed as argument is connected to the RTM, otherwise 0.
To support simulator applications the trendlogger can store its current state and historic
values into a snapshot. The snapshot can later be loaded bringing the trendlogger back to
the exact same state. A snapshot consists of a single file with the extention .ptss. An optional comment and trendlogger's time are also included in the file. The function snapshotSave() saves a snapshot with the specified comment to the specified file. Directories
are created automatically if not present. snapshotLoad() clears the trendlogger's history
and replaces it by the contents of the snapshot file. Return values from these functions are
0 if the operation completed successfully and an error number if the operation failed. If
the snapshotLoad() function fails, the trendlogger will be cleared. Note that the functions
snapshotSave() and snapshotLoad() may take several seconds to complete if the trendlogger's history is large. snapshotGetTime() and snapshotGetComment() returns the
time and comment stored as part of the snapshot respectively. Any extention supplied in
the fileName argument to these functions is replaced by the extention .ptss.
SEE ALSO
Trend(3pTALK) in "ProcSee Reference Manual"on page 455
TrendPres(3pTALK) in "ProcSee Reference Manual"on page 474
TrendRuler(3pTALK) in "ProcSee Reference Manual"on page 480
ProcSee Reference Manual
473
Standard pTALK Functions
TrendPres (3pTALK)
NAME
TrendPres - user interface component displaying a trend plot.
SYNOPSIS
// attributes
int TrendPres::autoScale;
float TrendPres::fillOffset;
int TrendPres::logFrequency;
float TrendPres::lowerBand;
float TrendPres::lowerLimit;
int TrendPres::presentation;
int TrendPres::presentationFunc;
float TrendPres::upperBand;
float TrendPres::upperLimit;
char* TrendPres::variable;
// functions
float
TrendPres::getRulerValue( int rulerNo );
float
TrendPres::getRulerValue( char* rulerName );
unsigned int TrendPres::getRulerTime( int rulerNo );
unsigned int TrendPres::getRulerTime( char* rulerName );
int
TrendPres::getValue( int theTime, float* value,
char* flags = "previous",
int* time = 0 );
int
TrendPres::getValuePos( int theTime,
float* x, float* y,
char* flags = "previous" );
int
TrendPres::legalRulerValue( int rulerNo );
int
TrendPres::legalRulerValue( char* rulerName );
void
TrendPres::setLimitModifier( void (*funCB)(
::TrendPres* trendPres,
float* lowerLimit,
float* upperLimit,
any userData ),
any userData );
void
TrendPres::toBack();
void
TrendPres::toFront();
::Interpolator* TrendPres::getInterpolator();
void
TrendPres::setInterpolator( ::Interpolator i );
DESCRIPTION
The TrendPres class displays historical data for one variable. In addition the graphic attributes in this shape can use the tr() function to trend other variables to better reflect the state
of the historical data.
The autoScale attribute determines whether auto scaling of the curve is on or off. Setting this
attribute to 1 will turn auto scaling on, 0 is off. A value of 2 indicates that auto scaling is carried out for all trend presentations (with autoScale = 2) in the trend diagram to ensure consistency between the trend presentations. If auto scaling is off the curve will be cut-off if the
value exceeds the attributes lowerLimit or upperLimit. The Trend curve will ignore these
474
ProcSee Reference Manual
Standard pTALK Functions
TrendPres (3pTALK)
two attributes if auto scale is on. The RTM will of course update these attributes when the
curve is re-scaled. Whenever the trend presentation receives a value that exceeds any other value contained in the diagram the curve will re-scale itself for the new value. It will
also be re-scaled when the maximum or minimum value for the curve is no longer inside
the trend diagram.
logFrequency is the attribute that determines how often the curve will be updated. If this
attribute is set to 5, it means that the curve will be updated every 5. second. This logger
frequency together with the attribute variable which is the name of the logged variable
the Trend is displaying historical data for, must correspond with the trend specification
file. The value -1 has a special meaning which is also the default value for this attribute.
In ProcSee terminology this mode is called best-fit. What this mean is that the trend logger
will send data to the trend presentation with the highest possible resolution. If the trend
logger logs a variable with different log-frequencies where the slower log frequencies
have longer history, the trend presentation will display the curve with different log frequencies as the trend is panned back in time.
The attributes lowerBand and upperBand are only in use when auto scaling is on. The
purpose with these attributes is to display a band between the edge of the trend to the highest or lowest value of the curve contained in the diagram. These values are given in percentage of the total height of the trend diagram and not the value of the curves upper or
lower limit. A value of 0 means that no band is wanted.
The lowerLimit and upperLimit attributes are used when the auto scaling of the curve is
turned off. Curve values exceeding these values will be cut-off, which will cause a straight
line in the trend diagram. As long as the attribute autoScale is off these attributes can be
both written to and read from. When changing the value of any of these two attributes the
curve will be re-scaled to fit the new limits. If the attribute autoScale is on these attributes
are read only. Changing these attributes will not lead to a re-scaling of the curve. The values of these attributes will be changed by the RTM whenever a new value received from
the trend logger exceeds the maximum or minimum value of the curve contained in the
diagram. The attributes lowerLimit and upperLimit will always reflect the minimum
and maximum value of the curve as long as auto scaling is on.
The attribute presentation is used to change the visualization of a trend curve. Nine different presentation forms are available for the trend curve. The shape of the trend curve
depends on this presentation attribute. Three major presentation types existst, these are:
line, layer and step. Line curves draws a line between two adjacent values. Layer has the
same form as line but fills an area above or below the curve. Step is a shape that resembles
a bar graph. A step curve can be filled or not filled.
The following table shows the presentation forms that can be used and the next table
shows the affected attributes for the different visualization types.
Presentation Form
Value
Line
0
Layer
1
Step fill
2
ProcSee Reference Manual
475
Standard pTALK Functions
TrendPres (3pTALK)
Step line
3
Layer offset
4
Step fill offset
5
Layer difference
6
Layer maximum
7
Step maximum
8
Attribute
0
1
2
3
4
5
6
7
8
foregroundColour
x
x
x
x
x
x
x
x
x
backgroundColour
x
x
x
x
x
x
x
x
x
foregroundFillColour
x
x
x
x
x
x
x
backgroundFillColour
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
linePattern
x
fillPattern
lineWidth
x
fillOffset
x
x
The attribute fillOffset is used when the presentation form is set to 4 (layer offset), 5 (step
offset) or 6 (layer difference). For all other visualization types this attribute is ignored. If the
presentation form is 4 or 5 the fillOffset controls the filled area between the curve and the
value of this attribute. If the presentation form is 6 this attribute must be set dynamically
equal to another trend presentation curve in the same trend diagram. The area between these
two curves will be filled using current attribute settings.
Setting the attribute presentationFunc can change the curve from linear to logaritmic. Legal
values for this attribute is:
- 0: normal linear
- 1: ln - natural logartimic.
- 2: log10 - 10 logartimic.
The default value for this attribute is linear (0). Notice that when using logaritmic trend the
trend values must be greater than zero. This applies to upperLimit and lowerLimit as well.
The name of the variable the presentation is displaying its historical data for is specified using the attribute variable. This name together with the log frequency must correspond with
a name in the trend specification file. If the logFrequency attribute is set to -1 (best-fit) only
the name must match. Elements in arrays or fields in structs can be trended as well as single
476
ProcSee Reference Manual
Standard pTALK Functions
TrendPres (3pTALK)
variables. If the variable is located in another application or it is an attribute in a picture
the name must be specified using a full-name. The variable attribute can also be set dynamic equal to a pointer variable if the name is surrounded by back-quotes. This pointer
variable must point to a trended variable specified in the trend specification file. This attribute can also be set to an arbitrary pTALK expression as long as the result of the evaluation is a name of a trended variable.
The function getRulerValue() returns the value for the current ruler position given by parameter rulerNo or rulerName. The parameter to this function may be either a ruler name
or a number. If the parameter is a number this is the ruler number as it is specified in the
picture or .Tdoc file.
The getRulerTime() returns the time for the current ruler position for the ruler given by
parameter rulerNo or rulerName. This function has the same parameter as the function
getRulerValue().
legalRulerValue() returns true if the value for the ruler specified by rulerNo or rulerName in current ruler position is a legal float value, otherwise false. This function has the
same parameter as the function getRulerValue().
The function toBack() puts the trend curve behind any other presentations defined in the
trend diagram. This attribute is typically used for filled trend curves.
The function toFront() puts the trend curve at top of any other presentations defined in
the trend diagram. This attribute is typically used for filled trend curves.
The function getValue(…) returns the value of the trend curve in the out parameter value
at the time specified in the first argument theTime. False is returned if the time given is
outside the visual time span displayed by the trend diagram, otherwise true. The flags argument is used when the time given does not exactly match a data point on the curve. The
following flags are supported.
Flag
Description
interpolated
Calculates an interpolated point between the two adjacent
data points.
previous
Get previous data point.
next
Get next data point.
closest
Get the nearest data point.
timepos
Uses the interpolated time when calculating the position in
the function getValuePos(…).
force
Forces the function to return a value even if the time given
contains illegal data points.
Notice that the flags interpolated, previous, next and closest are mutually exclusive and
can not be combined.
ProcSee Reference Manual
477
Standard pTALK Functions
TrendPres (3pTALK)
The function getValuePos(…) is analogous to getValue(…) except that it returns the position within the trend diagram. The position is returned in the arguments x and y. The world
coordinates are relative to the Trend shape.
It is sometimes required to better control the values of the lower- and upper limits when a
TrendPres shape is in one of the auto-scale modes. The function setLimitModifier(…) registers a call-back function which will be called each time the auto-scale limits change. The
call-back function can modify the limits calculated by the TrendPres shape. It should for
example be possible to set the limits to 0 and 100 if the TrendPres calculates the limits to
0.23 and 99.42. The setLimitModifier(…) function accepts two arguments, a pointer to a
call-back function funcCB and user specific data, userData. The last argument is optional. If
it is specified it must be specified in the call-back function as well. The user data will be sent
unmodified in the last argument to the call-back function. The first argument in the call-back
function is a pointer to the TrendPres object calling the function. The next two arguments
lowerLimit and upperLimit in the call-back function are in/out parameters. Modify these values to change the auto-scale limits.
getInterpolator() returns the Interpolator associated with the TrendPres shape. The value
0 is returned if the TrendPres shape has not been initialized with an Interpolator.
setInterpolator(...) sets or clears the Interpolator used by the TrendPres shape. This function accepts an Interpolator as argument. Setting this arguments to the value 0 will clear the
interpolator. The purpose with the interpolator is to map the trend curve’s data into a new
coordinate system. An Interpolator can for instance be used to magnify values within a value
range, and reduce values which lie outside this range.
NOTE
Only the following attributes in the TrendPres shape can use the tr() function. For the other
attributes the result is unpredictable.
• foregroundColour
• backgroundColour
• foregroundFillColour
• backgroundFillColour
• presentation
• lineWidth
• pattern
• fillPattern
• visibility
EXAMPLES
function `void modifier( ::TrendPres* tp, float* ll, float* ul )
{
*ul += 5;
478
ProcSee Reference Manual
Standard pTALK Functions
TrendPres (3pTALK)
*ll -= 5;
}`
Trend T
{
...
TrendPres TP
{
// Example using the tr() function
foregroundColour = �tr( "trFgCol" )�;
// Trending the attribute attr in the picture pic1.
variable = "::myApp.pic1.attr";
}
...
}
function `void constructor()
{
T.TP.setLimitModifier( modifier );
}`
...
SEE ALSO
TrendLog(3pTALK) in "ProcSee Reference Manual"on page 462
Trend(3pTALK) in "ProcSee Reference Manual"on page 455
EventPlot(3pTALK) in "ProcSee Reference Manual"on page 339
tr(3pTALK) in "ProcSee Reference Manual"on page 453
ProcSee Reference Manual
479
Standard pTALK Functions
TrendRuler (3pTALK)
NAME
TrendRuler - user interface component displaying a ruler in a Trend.
SYNOPSIS
// attributes
int TrendRuler::rulerIsSelected;
// functions
int TrendRuler::setRulerPosition( int time );
int TrendRuler::moveRuler();
DESCRIPTION
The TrendRuler class displays a ruler that can be used to get exact time position and value
for a TrendPres.
The rulerIsSelected attribute determines whether the ruler can be moved by the functions
setRulerPosition() or moveRuler() or not. Setting the attribute to 0 disables the ruler, the
value 1 enables the ruler.
The setRulerPosition() moves the ruler to the position in the Trend given by the time parameter. The time can be calculated using the functions Trend::xyW2Time() or mktime().
The function moveRuler() moves the ruler to a new position determined by the position of
the mouse cursor. This function is typically used in a dialogue action. This function can only
be called if the event contains a coordinate position.
SEE ALSO
TrendPres(3pTALK) in "ProcSee Reference Manual"on page 474
Trend(3pTALK) in "ProcSee Reference Manual"on page 455
480
ProcSee Reference Manual
Standard pTALK Functions
trig (3pTALK)
NAME
sin, cos, tan, asin, acos, atan, atan2 - trigonometric functions
SYNOPSIS
double sin( double x );
double cos( double x );
double tan( double x );
double asin( double x );
double acos( double x );
double atan( double x );
double atan2( double y, double x );
DESCRIPTION
sin(), cos(), and tan() return trigonometric functions of radian arguments. asin(), acos()
and atan() are the inverse functions of sin(), cos(), tan() respectively.
atan2() returns
the arctangent of y/x, in the range -pi to pi, using the signs of both arguments to determine
the quadrant of the return value.
SEE ALSO
sin(3M), cos(3M), tan(3M), asin(3M), acos(3M), atan(3M), atan2(3M)
ProcSee Reference Manual
481
Standard pTALK Functions
Update functions (3pTALK)
NAME
update - updates applications, pictures, shapes and resources in the RTM
onUpdate - user defined pTALK function automatically called from within a global update.
onVariableUpdate - user defined pTALK function automatically called when variables
have been updated by an external source (i.e. by the ProcSee API).
SYNOPSIS
update( [char* fullName|Object* entry]=0, char* flags = 0 );
void onUpdate();
void onVariableUpdate( char* processName );
DESCRIPTION
The pTALK function update() updates applications, pictures, shapes and resources in the
RTM. This function is by default asynchronous, i.e. the update action will not be executed
immediately but will be put on an asynchronous queue and executed later when the RTM is
idle. Calling this function without arguments is the same as putting a global update on the
asynchronous queue. In this context a global update is an update that updates all applications
in the RTM. Applying frequent calls to the global update() within the pTALK code does not
reduce performance since consecutive global updates put on the queue will be merged into a
single update.
The update() function provides one or two optional arguments. The argument fullName is
the full qualified name of the entry to update in the RTM (note that an Object pointer can be
passed as argument instead of the fullname). The entry must be, either:
• :: (same as global update)
• application
• picture
• shape
The optional argument flags provides additional options to the update() function. The following flags are supported:
• sync -The update action is not put on the asynchronous queue in the RTM but executed
immediately. Note that this option should be used with care when applying frequent
global update calls because it will hurt performance.
All pictures that are currently mapped on the screen will be updated when invoking a global
update or an application specific update. Those not currently mapped will be flagged so that
they will be updated next time they are mapped.
The following operations are performed upon update for each currently displayed and
mapped picture:
• All dynamic bindings are evaluated. A dynamic binding is an attribute with a dynamic
value, i.e. a value expressed in pTALK. If a dynamic value is referred to from several
482
ProcSee Reference Manual
Standard pTALK Functions
Update functions (3pTALK)
places, it is only evaluated once.
• The new evaluated value of a dynamic binding is compared to the old value, and the
need for graphical changes on the screen is determined based on this comparison.
• The picture is redrawn on the screen. Only areas that will actually change appearance
are redrawn.
onUpdate is a user defined pTALK function invoked when updating the application or
pictures. It can be created at different levels in the object hierarchy, i.e. at the Application,
Library, Picture, ComObject, ComShape, Instance, Group and Trend scope. Before each
update, ProcSee will search for this function. If it is found, it is executed prior to updating
the dynamic attributes and the graphics for the object. This function is normally used to
update ComObject and ComShape objects.
onVariableUpdate is a user defined pTALK function called when variables have been
updated by an external source, like simulators, data acquisition systems, etc. This function
must be declared at the application scope in the object hierarchy. The argument processName is the name of the process which have updated the variables. This function will be
called every time new variable values are available from an external source and it will be
called immediately. That is, it will be called before the global update function is executed
and it is called synchronously.
NOTES
By default the update() function is asynchronous which means that an update() call is
queued internally and executed when the RTM(1) becomes idle. If the internal queue contains more than one global update() call, only the last one is executed. This means that
applying frequent calls to the global update() within your pTALK code does not hurt performance.
onVariableUpdate is a synchronous function which will be called immediately when
variable values have been received from an external source.
WARNINGS
Do not call update() from a dynamic binding! This will cause system crawl because one
update will put another one on the queue, ad nauseam. update() should only be called
from dialogue actions or remotely from external applications.
EXAMPLE
// The next examples illustrates how to invoke the update() function to update a specific application,
// a shape, etc.
update( "::System" );
// Only update the ::System application.
update( "::System.MainPicture.I1" );
// Update the I1 instance shape.
update( "sync" );
// Make a synchronous global update.
update( "::System.MainPicture", "sync" ); // Update the picture synchronously.
// The following example shows how to implement a user defined onUpdate function to update a
// data grid. The data grid is a ComShape object.
ProcSee Reference Manual
483
Standard pTALK Functions
Update functions (3pTALK)
function onUpdate()
{
// This function updates the data grid with process data. The variable pdata is an array of
// floating point numbers.
int n = 0;
for ( int c = 0; c < di.Columns; c++ )
for ( int r = 0; r < di.Rows; r++ )
di.Update( c, r, pdata[ n++ ] );
}
// The following example illustrates how to implement an user defined onVariableUpdate function.
// This function checks whether the data received is from the process "PROCSEE_S1" or not
// before calling the pTALK function updateS1()
void onVariableUpdate( char* processName )
{
if ( strcmp( processName, "PROCSEE_S1" ) == 0 )
{
updateS1();
}
}
SEE ALSO
Picture(3pTALK) in "ProcSee Reference Manual"on page 395
Window(3pTALK) in "ProcSee Reference Manual"on page 488
Shape(3pTALK) in "ProcSee Reference Manual"on page 430
484
ProcSee Reference Manual
Standard pTALK Functions
updateResources (3pTALK)
NAME
updateResources - updates all resources in the application scope.
SYNOPSIS
void Application::updateResources( int async = 0 );
DESCRIPTION
updateResources() is a function that updates all the resources defined in the application
scope. This function accepts an optional argument async. Setting this argument to 1 will
put the update resources action on the asynchronous queue and suspend the update until
the RTM becomes idle. Calling this function several times with the async flag will remove
unnecessary update actions on the queue, and thereby improve the overall performance.
When this argument is 0, which is the default, will execute the update of the resources immediately.
SEE ALSO
updateWindows(3pTALK) in "ProcSee Reference Manual"on page 485
update(3pTALK) in "ProcSee Reference Manual"on page 482
ProcSee Reference Manual
485
Standard pTALK Functions
updateWindows (3pTALK)
NAME
updateWindows - updates all windows in the application scope.
SYNOPSIS
void Application::updateWindows();
DESCRIPTION
updateWindows() is a function that updates all the windows defined in the application
scope. The global update() function do not include windows in the update. Any changes to
a window attribute must be followed by a call to updateWindows().
In updateWindows() all dynamic bindings are evaluated. A dynamic binding is an attribute
with a dynamic value, i.e. a pTALK expression. If the new value compared to the old one has
changed then the window is updated based on the new value.
SEE ALSO
Window(3pTALK) in "ProcSee Reference Manual"on page 488
update(3pTALK) in "ProcSee Reference Manual"on page 482
486
ProcSee Reference Manual
Standard pTALK Functions
Value Changes (3pTALK)
NAME
hasValueChanged - function to check if a value has changed.
SYNOPSIS
int
hasValueChanged( any* valueAddress );
DESCRIPTION
The hasValueChanged() function returns true (a value different from 0) if the value at
valueAddress has changed since last time hasValueChanged was called with this address. It returns false (0) if the value at valueAddress is the same. The first time it is called
for a new valueAddress, it returns true. valueAddress can point to a variable or an attribute. valueAddress must point to the top-level of the value, i.e. it can not point to a field in
a struct or an element in an array. The change status is on the whole variable or attribute.
EXAMPLE
// Assume v1 is a struct variable with many fields, making it tedious to check if it has changed
// by comparing the fields with a stored copy of the previous value:
void onUpdate()
{
if ( hasValueChanged( &v1 ) )
{
// do something using v1, requiring a lot of pTALK code...
}
}
ProcSee Reference Manual
487
Standard pTALK Functions
Window (3pTALK)
NAME
Window - user interface component for displaying pictures
SYNOPSIS
// attributes
int Window::backgroundColour;
int Window::x;
int Window::y;
int Window::height;
int Window::width;
char* Window::decorations;
char* Window::functions;
char* Window::mode;
char* Window::parent;
int Window::theCursor;
char* Window::theTitle;
char* Window::type;
// member functions
char* Window::name();
char* Window::fullName();
void
Window::raise();
void
Window::lower();
void
Window::map();
void
Window::unmap();
void
Window::unmapChildren();
int
Window::alwaysOnTop(int onTop=1);
void
Window::minimize();
void
Window::iconify();
void
Window::maximize();
void
Window::restore();
void
Window::title( char* s );
void
Window::move( int x, int y );
void
Window::moveFrame( int x, int y );
void
Window::resize( int w, int h );
void
Window::zoom( double scale );
void
Window::pan( float x, float y );
double Window::zoomFactor();
float Window::xSnapped( float x );
float Window::ySnapped( float y );
void
Window::update();
void
Window::updatePicture(int mode=0);
void
Window::paste();
bool
Window::isMapped();
bool
Window::isViewable();
bool
Window::isIconic();
bool
Window::isInEditMode();
char* Window::shapeFullNameAt( float x, float y );
Display* Window::display();
Picture* Window::thePicture();
int
Window::grabPointer();
int
Window::selectShape( int mode, char* shapeFullName );
488
ProcSee Reference Manual
Standard pTALK Functions
Window (3pTALK)
int
Window::selectAllIn( int mode, float x, float y,
float width, float height );
void
Window::setCursor( int cursor=-2 );
void
Window::sound( int volume, int pitch, int duration );
void
Window::moveCursor( float x, float y);
void
Window::setDecorations( char* decoration );
void
Window::setFocus();
void
Window::setFunctions( char* function );
Window* Window::windowAt( float x, float y );
int
Window::translateCoordinates( float inX, float inY,
Window* toWin,
float* outX, float* outY );
int
Window::translateCoordinates( float inX, float inY,
char* toWin,
float* outX, float* outY );
void
Window::buttonRepeatInterval( int startDelay,
int repeatInterval );
void
Window::getFrameSize( int* left, int* top,
int* right=0, int* bottom=0, char* flags = "" );
void
Window::getScreenSize(int* width, int* height,
int* x=0, int* y=0, int s=0);
void
Window::modSysKeyBehaviour( char* sysKeys );
int
Window::adjustVirtualDisplay( int x = 0, int y = 0, int w = 0, int h = 0 );
DESCRIPTION
Although all windows are global to the application, they are arranged in an hierarchical
manner. Two windows B and C may be sub windows of window A. Top-level windows
are managed by the window manager.
Window attributes can be changed at run-time and they can be dynamic, but remember
that any changes to a window attribute must be followed by a call to the function updateWindows() or the global update() function.
The attribute backgroundColour is used to control the colour of the window. A value of
-1 means that the background colour in the picture associated with the window is used.
This is default behaviour. Any other value will set the window background to the value
specified. This attribute will however not change the picture’s background colour. It only
has an effect when the picture’s attributes worldWidth and worldHeight are smaller than
the window it is displayed in (or no picture is displayed in the window). Only the area outside the picture will be displayed in this colour.
x, y, width and height are attributes indicating the position and dimension of the window.
Resizing or moving the window using the pointer will change these attributes. These attributes are specified in display coordinates. Where the coordinate (0,0) is upper left corner of the display. x, y specifies the position of the upper left corner of the window, inside
the window frame. For sub-windows, the position is relative to the parent window. width,
height specifies the size of the window inside the window frame.
The attribute decorations controls the appearance of the decoration the window manager
put on any top level window. This attribute has only an effect when a mwm window manager is used or any other window manager defining the same window manager hints as
ProcSee Reference Manual
489
Standard pTALK Functions
Window (3pTALK)
mwm. This includes Microsoft Windows, vue, cde or 4DWM from Silicon Graphics. Setting
this attribute will not affect the window decoration if a window manager like open-look,
uwm, twm etc. is used. The following values are legal for the decoration:
Property
Comment
ОќОџОќО•
No decoration
ALL
All decorations are on
BORDER
Turn border on/off
RESIZEH
Switch resize handlers on/off
TITLE
Display window title
MENU
Turn menu in window frame on/off
MINIMIZE
Minimize button on/off
MAXIMIZE
Maximize button on/off
A minus sign in front of the property means that it is removed from the window manager
frame and a plus sign means that is added. For instance setting all properties except the minimize and maximize, use "ALL - MINIMIZE - MAXIMIZE". Setting just the title and border
use, "TITLE + BORDER". Some of these properties can not be removed unless other properties are removed as well. For instance the border is removed only if BORDER and RESIZEH are removed.
functions is an attribute that specifies what kind of functions that will be available from the
menu in the window frame. This attribute has an effect only on top-level windows and if a
window manager like mwm is used. For more information about what kind of window managers this attribute applies to, see the description of decorations. The following properties
are recognized by the rtm. Mixed case are legal for the property strings.
Property
490
Comment
NONE
Remove all functions
ALL
All functions are available
RESIZE
Enable or disable resize function
MOVE
Move window on/off
MINIMIZE
Enable or disable the minimize function
MAXIMIZE
Enable or disable the maximize function
CLOSE
Kill window through the window frame menu
QUIT
Same as CLOSE (Silicon Graphics only)
ProcSee Reference Manual
Standard pTALK Functions
Window (3pTALK)
It is not possible to remove for instance raise and lower from the functions menu. This is
a restriction in the window manager. A plus in front of the property string will enable the
function in the menu frame. A minus will disable the same function. To disable for instance the close/quit function set this attribute equal to "ALL - CLOSE - QUIT".
The mode attribute applies to UNIX and linux platforms only. It is used to prevent other
parts of the application or system to receive input as long as the window is mapped. The
attribute can be set to either MODELESS or SYSTEM_MODAL. The system default is
MODELESS which means that all windows in the application can receive keyboard and
pointer input. If this attribute is set equal to SYSTEM_MODAL the only window that will
be receiving input from keyboard or pointer will be this one. The entire workstation will
be blocked until the window is unmapped. This mode should be used with care. The
modes FULL_APPLICATION_MODAL and PRIMARY_APPLICATION_MODAL
are not available in this release of ProcSee.
The parent attribute should either be the name of a display, or another window. See description of the type attribute below for details. For backwards compatibility; If the name
is not the name of another window or display, it is assumed to be a display connection
string, and is replaced with the name of a display created with this connection string.
theCursor is an attribute that overrides the application’s default cursor. Setting this value
to another value than the default cursor (-1) will display the specified cursor in the window.
The attribute theTitle controls the window title. If this value is set to a non-empty string
this value overrides the setting from displayPicture(). For more information see the function title().
The type attribute controls what kind of window to create. ProcSee supports the following
window types:
Type
Description
NORMAL
Creates a top level window. The attribute parent must specify
the name of a Display object.
SUB
Creates a sub window. The parent attribute must specify the
name of a Window object.
MENU
Creates a menu window. A menu window is a window that is
not controlled by the window manager (X-Windows only).
This kind of window is not decorated with a border. The parent attribute must specify a name of a Display object.
GROUP
Creates a group window. The group owner is specified with
the parent attribute, i.e. a Window object. A group window is
always on top of the group owner, and it is iconified when the
group owner is iconified.
ProcSee Reference Manual
491
Standard pTALK Functions
Type
TOOL
Window (3pTALK)
Description
A tool window has the same characteristics as a GROUP window except that it has a tinner (tool) border. Notice that on XWindows it depends on the window manager if tool windows
use a different border than the group windows.
When a new window is created, it will by default be a NORMAL window where the parent
attribute is automatically set to point to a default Display object in the application (either automatically created by the pTALK function newWindow(), or an existing Display object).
A top-level window is entirely controlled by the window manager. A top level window can
be moved using the mouse and it can be iconified, minimized, maximized, etc. A SUB window is a window displayed inside and controlled by its’ parent window. A MENU window
is a window that is not controlled by the window manager, meaning that it has no window
decoration. A MENU window is normally used to create menus or popup-menus. To create
a menu use the functions ungrabPointer() and grabPointer(). The GROUP window and
the TOOL window types behave the same, and may have the same visual appearance on XWindows. Note that the group owner window must be mapped before the GROUP window
or TOOL window is displayed in order to function properly.
name() returns the name of the window object, while fullName() returns the complete name,
including all ancestors, for example “::Sim.MainWin”.
raise() moves a window object to the top of the stacking order among its siblings. lower()
moves a window object to the bottom of the stacking order among its siblings. Siblings are
windows on the same level, i.e. windows sharing the same parent window. All top-level windows are considered siblings.
map() maps the window object. If all ancestor windows are also mapped, the window object
will display on the screen. unmap() unmaps the window object, and it disappears from the
screen. unmapChildren() unmaps all children windows.
alwaysOnTop() makes the window stay on top of other windows, or not, depending on the
argument. This functionality is only supported on MS Windows. On the X Windows platforms, this function does nothing.
minimize() and iconify() are two names for the exact same functionality, both iconifies the
window. maximize() maximizes the window. restore() restores the window from maximized or iconified to maximized or normal window state. maximize() and restore() does not
work on X, since this is behaviour that programs are not allowed to control.
title() sets the theTitle attribute of the window object according to the parameter s. The title
is not to be confused with the name of the window. The window manager is hinted about the
new title and will probably display it as part of the window decoration if it’s a top-level window. If the theTitle attribute is an empty string, the window will use the name of the window
if no picture is displayed in the window, or the name of the picture displayed in window, as
window title.
move() moves the upper left corner of the clientArea (inside of the window frame) of the
window to the specified position.
492
ProcSee Reference Manual
Standard pTALK Functions
Window (3pTALK)
moveFrame() moves the upper left (outside) corner of the window frame to the specified
position.
resize() resizes the width and height of the window. The specified size is the inside of the
window frame.
zoom() zooms the picture displayed in the window by a scale given as argument. The
scale is given in percent (100 is normal size) and indicates the new scale relative to scale
1:1. If no picture is currently associated with the window, nothing happens.
pan() pans the picture displayed in the window. The x and y panning coordinates are given
as arguments. The picture is panned so that the upper left corner of the view is in position
(x,y). If no picture is currently associated with the window, nothing happens.
zoomFactor() returns the current zoom factor in percent, relative to the current 1:1 setting, of the picture displayed in the window. If no picture is currently associated with the
window, the value 0 is returned.
xSnapped() and ySnapped() takes a picture coordinate as input and returns the same coordinate snapped according to the picture’s current snap setting.
paste() copies all objects from the clipboard onto the picture. Refer to the edit(3pTALK)
manual entry for a detailed explanation.
update() is updating the picture currently displayed in the window. It acts like the global
pTALK update() functions, but only operates on the picture that is displayed in this window. See the update(3pTALK) manual entry for a detailed explanation.
The updatePicture() function is used to update the picture displayed in the window immediately. As opposed to the normal update functions, the updatePicture function does
not merge consecutive updates. The optional mode argument can have the following values:
• 0 : Update the dynamics. Redraws the changed areas, according to the picture updateMode.
• 1 : Update dynamics and redraw all shapes.
• 2 : Don’t update the dynamics, but redraw all the shapes.
isMapped() returns true if the window is currently mapped on the display, false otherwise. This does not imply that it is currently viewable.
isViewable() returns true if the window is currently viewable on the displayed, false otherwise.
isIconic() returns true if the window is iconified, false otherwise.
isInEditMode() returns true if a picture is currently associated with the window, and that
picture is currently in edit mode, false otherwise.
shapeFullNameAt() returns the full name of the foremost shape located at the given (x,y)
world coordinate, or an empty string if no shape is present or if no picture is associated
with the window.
display() returns the Display associated with the window.
ProcSee Reference Manual
493
Standard pTALK Functions
Window (3pTALK)
thePicture() returns a pointer to the picture that is currently displayed in the window, or 0 if
no picture is currently displayed in the window.
grabPointer() actively grabs control of the pointer. Further pointer events are reported to the
window until a ungrabPointer() is called or the window is unmapped. Grabbing of pointers
are mainly used in menus where the menu should receive all pointer input after it is mapped.
Observe that an active grab may lock the system forever.
selectShape() changes the selection state of the shape given by shapeFullName. If mode is
0, the shape is unselected, if mode is 1, the shape is selected, and if mode is 2 the shape is
toggle selected. The routine returns the number of shapes whose selection state were changed
by the call, i.e. 0 or 1.
selectAllIn() changes the selection state of all shapes completely included in the rectangular
area given by x, y, width, and height. If mode is 0, the shapes are unselected, if mode is 1,
the shapes are selected, and if mode is 2 the shapes are toggle selected. If both width and
height is 0, all shapes in the picture are affected by the call. The routine returns the number
of shapes whose selection state were changed by the call.
setCursor() changes the cursor temporarily for this window. See "Cursor - cursor functions"
on page 310.
sound() rings a bell at the display on which this window is displayed. The volume is given
in the range -100 to 100; see the XBell(3X) man page for a description of this setting. The
pitch is given in Hz, and the duration is given in milliseconds. Note that the actual sound is
hardware dependent.
moveCursor() will move the mouse cursor to the position given by x and y. The (x,y) position is given in world coordinates.
setDecorations() changes the current window decoration. The parameter decoration is set
equal to any combination of the property strings described for the attribute decorations. If
the parameter starts with a minus or a plus sign then the current decoration setting is changed
accordingly. A minus means that the property string specified is removed from the window
decoration and a plus means that it is added. If the parameter starts with a property string then
the value of the parameter decoration will replace current window decoration. For more information about the property strings available see the description of the attribute decorations.
setFocus() set the focus on the window
setFunctions() manipulates the menu in the window frame. The parameter function is set
equal to any combination of the property strings described for the attribute functions. If the
parameter function do not start with a plus or minus sign then the property string specified
will replace current function menu setting. On the other hand if the parameter starts with a
minus or plus then the menu property specified will be enabled or disabled leaving the other
menu options as they are. For more information about the property strings available see the
description of the attribute functions.
windowAt() returns a pointer to a ProcSee window at position (x,y). The position is specified
in the window’s coordinate system. It returns 0 if no ProcSee window is found at this position.
494
ProcSee Reference Manual
Standard pTALK Functions
Window (3pTALK)
translateCoordinates() translates the coordinates inX,inY from the current window to
the window specified in the argument toWin’s coordinate system. If successfully converted the result is placed in outX,outY
buttonRepeatInterval() modifies the repeat interval and the initial delay for button repeated events received by the window’s display. The arguments startDelay and repeatInterval are specified in milliseconds.
getFrameSize() returns the window’s border size in the arguments left, top, right and bottom. The arguments right and bottom can be ignored if set to null pointer (0). The majority
of the window managers on the market use the same border size for left, right and bottom.
If it is a top level window the top border may include a caption bar. By default the border
size is returned in the Display object’s scale factor. This can be changed by specifying
pixels in the optional flags argument, i.e the border size is returned in device pixels.
getScreenSize() returns the size of the screen, and the position of the upper left pixel of
the screen. If the last argument is -1, the size of the virtual screen is returned. If the last
argument is 0 then the size of the primary screen is returned. On X Windows the last argument is not in use.
modSysKeyBehaviour(...) modifies the default behaviour of some predefined system
keys on the Microsoft Windows platforms. The following system keys can be modified:
F10 and Alt+F4. The key F10 is by default used to activate the menu bar on Windows.
When this feature is enabled (which is the default), only every second key stroke will be
registered in ProcSee. The key focus will alternate between the ProcSee window and the
menu bar (even if the window does not have a menu bar). The system key combination
Alt+F4 is used on Windows platforms to close the window which has the key focus. Calling this function with a string specifying the system keys to disable will modify the default
actions of these keys. This function accepts one argument of type character string. Only
F10 and Alt+F4 are legal values. The comma character ’,’ is used to separate the keys
specified in the string. For instance "F10", "Alt+F4" or "F10, Alt+F4". Calling this function several times will override the old settings. To reset the system keys to their default
actions, call this function with an empty string.
adjustVirtualDisplay(...) adjust the Display object’s virtual display area’s (virtualX,
virtualY, virtualWidth and virtualHeight) attributes to fit the size of the Window. This
functionality is mainly used when resizing the entire application based on the size of a toplevel window, i.e. all windows including sub-windows are automatically repositioned and
rescaled. The optional arguments x, y, width and height are in device pixels. These arguments specify the initial size of the Display. To cover the entire display, use this function
with the size arguments to initialize the Display object. It should be called from the application’s constructor before any picture is displayed. The DisplayInfo class provides
the display size. If the top-level window has a frame, then get the initial size in pixels by
subtracting the frame size from the display size. To get the frame size in pixels use the
pTALK function getFrameSize where the flags argument is set to pixels. To implement
interactive resizing functionality, call this function from the action part of the dialogues
windowMoved() and windowResized() (with no arguments).
EXAMPLES
alarms.raise();
// raise the window “alarms”
ProcSee Reference Manual
495
Standard pTALK Functions
Window (3pTALK)
spreadSheet.title( “NoName” ); // entitle window “spreadSheet” NoName
alarms.zoom( 200 );
// zoom in to scale 2:1
// Remove border and resize handlers
// from the window frame.
alarms.setDecorations( "-BORDER-RESIZEH" );
alarms.setFunctions( "-MOVE" ); // The window can no longer be moved
// by the user.
alarms.setDecorations( "NONE" ); // Remove all window decorations
// Enable all menu functions except
// minimize.
alarms.setFunctions( "ALL-MINIMIZE" );
// Get the border size. Do not get the right border, it is the same as
// left
int leftright, top, bottom;
alarm.getFrameSize( &leftright, &top, 0, &bottom );
NOTES
In order to change the window decoration or the functions menu the window manager must
accepts the hints sent to it. If the window manager that is used does not know the hints they
are simply ignored. Here comes a list of known window managers that ignores the hints: olwm, twm, uwm
SEE ALSO
Picture(3pTALK) in "ProcSee Reference Manual"on page 395
edit(3pTALK) in "ProcSee Reference Manual"on page 327
load/display(3pTALK) in "ProcSee Reference Manual"on page 382
save/document(3pTALK) in "ProcSee Reference Manual"on page 425
XBell(3X)
updateWindows(3pTALK) in "ProcSee Reference Manual"on page 485
496
ProcSee Reference Manual
Standard pTALK Functions
xyConv (3pTALK)
NAME
xyConv - converts between different coordinate systems of displays, windows, pictures,
and shapes.
SYNOPSIS
int xyConv( Object* from, float fromX, float fromY, Object* to, float* toX, float* toY, char* flags=0
);
float xyConvX( Object* from, float fromX, float fromY, Object* to, char* flags=0 );
float xyConvY( Object* from, float fromX, float fromY, Object* to, char* flags=0 );
DESCRIPTION
The xyConv() function converts between coordinate systems of displays, windows, pictures, and shapes. The from and to arguments are either a pointer or a fullName string to
an object of one of these types. If the from or to argument is 0, the coordinate system used
is the device pixels. The fromX and fromY arguments are the coordinate in the from objects’ coordinate system. The result is returned in the to objects’ coordinate system in the
float arguments pointed to by toX and toY. The functions xyConvX() and xyConvY() returns only the x or the y part of the to coordinate, and is typically used inside dynamics
where out arguments are unusable. The flags argument can contain flags that modify how
the coordinate system of shapes are viewed. The legal values of flags are in the following
table:
Table 7: xyConv flags values
Option
from or src
to or dest
Value
Description
xyOrigo
If the from object is a shape, the source coordinate system has
its origo at the point given by the shapes x and y attributes. This
is the default.
xyXy
If the from object is a shape, the source coordinate system has
its (x, y) coordinate at the point given by the shapes x and y
attributes.
xyOld
If the from object is a shape, the source coordinate system is
handled as if xyOrigo was specified for instances and trend, and
as if xyXy was specified for all other shapes.
xyOrigo
If the to object is a shape, the destination coordinate system has
its origo at the point given by the shapes x and y attributes. This
is the default.
xyXy
If the to object is a shape, the destination coordinate system has
its (x, y) coordinate at the point given by the shapes x and y
attributes.
ProcSee Reference Manual
497
Standard pTALK Functions
xyConv (3pTALK)
Table 7: xyConv flags values
Option
Value
xyOld
Description
If the to object is a shape, the destination coordinate system is
handled as if xyOrigo was specified for instances and trend, and
as if xyXy was specified for all other shapes.
An example value of the flags argument: "from=xyXy, to=xyXy". Note that the flags option
xyOld is for backwards compatibility only, and may be removed in the future. Shapes that
don’t have x and y attributes act as if they are 0. This includes the shapes: Line, Polygon,
Group, and the sub-shapes of Trend.
Coordinate systems in ProcSee
The coordinate systems of the different objects are described here:
Table 8: ProcSee coordinate systems
Object type
Description of coordinate system
Shape
The origo of the coordinate systems of shapes (simple shapes as circle, rectangle, etc. but also
composite shapes as group, trend, and instance) are at the position given by the shapes x and
y attributes. The sub-shapes of trend, and the shapes Line, Polygon, and Group act as if they
have x and y attributes set to 0.
If the shape is rotated or scaled, using the rotationAngle, xScaleFactor, and yScaleFactor
attributes, the point that is not moving relative to the parent is the point given by the xReference and yReference attribute. xReference and yReference is given in the parent coordinate
system. All other coordinate values in the shape is given in the shapes coordinate system. The
(x, y) coordinate is also given in the shapes coordinate system, but before the translation of
the shapes coordinate system so that origo is at the (x, y) coordinate.
Composite shapes can contain other shapes, meaning that there can be several different shape
coordinate systems between the shape you look at and the picture it is in.
Picture
The origo of the picture coordinate system is given by the attributes worldX and worldY, by
specifying the position of the upper left corner of the picture relative to origo. The worldWidth and worldHeight attributes gives the size of the picture. The attributes xReference,
yReference, xScaleFactor, yScaleFactor, rotationAngle, resizeMode, and the oneToOne
attribute, and the current pan and zoom settings determines the scaling and rotation of the
picture coordinate system.
Window
The origo of the window coordinate system is at the upper left corner of the window, inside
the window frame. The scaling of the windows’ coordinate systems are given by the display.
Display
The origo of the display is at the displays upper left corner. In a multi-monitor setup, this
does not have to correspond to the origo of the device pixels. This does not need to be the
upper left corner of a monitor either when the virtualX, virtualY, virtualWidth, virtualHeight attributes of a display object are used. The display object coordinate system can be
scaled, if the resizeMode attribute is set. This scaling is determined by either the virtualWidth and virtualHeight attributes, or the width and height attributes if virtualWidth or virtualHeight is not set (=0), compared to the actual display.
0 (Device pixels)
This is the coordinate system of the display device. For multi-monitor setups on e.g. MS
Windows, this may extend in both positive and negative directions from origo.
498
ProcSee Reference Manual
Standard pTALK Functions
xyConv (3pTALK)
SEE ALSO
Shape::shapeCursorX and Shape::shapeCursorY (page 432).
Shape (page 430), Picture (page 395), Window (page 488), Display (page 313).
ProcSee Reference Manual
499
Standard pTALK Functions
500
xyConv (3pTALK)
ProcSee Reference Manual
Standard pTALK Functions
List of Functions
List of Functions
::abs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
::acos. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
::addLinePoint . . . . . . . . . . . . . . . . . . . . . 306
::addPolygonPoint . . . . . . . . . . . . . . . . . . 306
::afterPictureUpdate . . . . . . . . . . . . . . . . . 333
::altIsDow . . . . . . . . . . . . . . . . . . . . . . . . . 333
::arrayIndex. . . . . . . . . . . . . . . . . . . . . . . . 289
::arrayLength . . . . . . . . . . . . . . . . . . . . . . 289
::arrayMaxIndex . . . . . . . . . . . . . . . . . . . . 390
::arrayMinIndex . . . . . . . . . . . . . . . . . . . . 390
::asin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
::atan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
::atan2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
::atof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
::atoi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
::beforePictureUpdate. . . . . . . . . . . . . . . . 333
::buttonDoubleClicked . . . . . . . . . . . . . . . 333
::buttonIsDown . . . . . . . . . . . . . . . . . . . . . 333
::buttonPressed . . . . . . . . . . . . . . . . . . . . . 333
::buttonReleased . . . . . . . . . . . . . . . . . . . . 333
::buttonRepeated. . . . . . . . . . . . . . . . . . . . 333
::buttonRepeatInterval . . . . . . . . . . . . . . . 489
::buttonTripleClicked . . . . . . . . . . . . . . . . 333
::ceil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
::cftime . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
::comAdvise . . . . . . . . . . . . . . . . . . . . . . . 295
::comDateFromTime . . . . . . . . . . . . . . . . 295
::comDateToTime. . . . . . . . . . . . . . . . . . . 295
::comUnadvise . . . . . . . . . . . . . . . . . . . . . 295
::constructor . . . . . . . . . . . . . . . . . . . . . . . 303
::containsName . . . . . . . . . . . . . . . . . . . . . 302
::controlIsDown . . . . . . . . . . . . . . . . . . . . 333
::cos. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
::createIterator. . . . . . . . . . . . . . . . . . . . . . 373
::cursorMoved. . . . . . . . . . . . . . . . . . . . . . 333
::cursorX . . . . . . . . . . . . . . . . . . . . . . . . . . 333
::cursorY . . . . . . . . . . . . . . . . . . . . . . . . . . 333
::deleteIterator. . . . . . . . . . . . . . . . . . . . . . 373
::destructor . . . . . . . . . . . . . . . . . . . . . . . . 303
::dialogueToBack . . . . . . . . . . . . . . . . . . . 312
::dialogueToFront . . . . . . . . . . . . . . . . . . . 312
::displayPicture . . . . . . . . . . . . . . . . . . . . . 382
::dndBegin . . . . . . . . . . . . . . . . . . . . . . . . 333
::dndDrop . . . . . . . . . . . . . . . . . . . . . . . . . 333
::dndEnter . . . . . . . . . . . . . . . . . . . . . . . . . 333
::dndLeave . . . . . . . . . . . . . . . . . . . . . . . .
::dndMotion . . . . . . . . . . . . . . . . . . . . . . .
::dndSimpleDrag . . . . . . . . . . . . . . . . . . .
::dndSimpleDrop . . . . . . . . . . . . . . . . . . .
::dndSource . . . . . . . . . . . . . . . . . . . . . . .
::dndTarget. . . . . . . . . . . . . . . . . . . . . . . .
::document . . . . . . . . . . . . . . . . . . . . . . . .
::dumpSymbolTable . . . . . . . . . . . . . . . .
::editWindow . . . . . . . . . . . . . . . . . . . . . .
::eval
.................................
::eventPicture . . . . . . . . . . . . . . . . . . . . . .
::execute . . . . . . . . . . . . . . . . . . . . . . . . . .
::executeAsync. . . . . . . . . . . . . . . . . . . . .
::exp . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
::exportDxf. . . . . . . . . . . . . . . . . . . . . . . .
::exportDxf. . . . . . . . . . . . . . . . . . . . . . . .
::exportPostScript . . . . . . . . . . . . . . . . . .
::exportPostScriptEx . . . . . . . . . . . . . . . .
::fabs . . . . . . . . . . . . . . . . . . . . . . . . . . . .
::fileNameHost. . . . . . . . . . . . . . . . . . . . .
::fileNameNormal . . . . . . . . . . . . . . . . . .
::floor . . . . . . . . . . . . . . . . . . . . . . . . . . . .
::focusLost . . . . . . . . . . . . . . . . . . . . . . . .
::fullNameOf . . . . . . . . . . . . . . . . . . . . . .
::getApplicationName . . . . . . . . . . . . . . .
::getComment . . . . . . . . . . . . . . . . . . . . .
::getDependencies . . . . . . . . . . . . . . . . . .
::getDialogueAction. . . . . . . . . . . . . . . . .
::getDialogueTrigger . . . . . . . . . . . . . . . .
::getenv . . . . . . . . . . . . . . . . . . . . . . . . . .
::getErrorString . . . . . . . . . . . . . . . . . . . .
::getFileName . . . . . . . . . . . . . . . . . . . . .
::getList . . . . . . . . . . . . . . . . . . . . . . . . . .
::getPath . . . . . . . . . . . . . . . . . . . . . . . . . .
::getpid . . . . . . . . . . . . . . . . . . . . . . . . . . .
::gotKeyFocus . . . . . . . . . . . . . . . . . . . . .
::gradient . . . . . . . . . . . . . . . . . . . . . . . . .
::hasValueChanged . . . . . . . . . . . . . . . . .
::ignoreWatchdog . . . . . . . . . . . . . . . . . .
::keyPressed . . . . . . . . . . . . . . . . . . . . . . .
::keyReleased . . . . . . . . . . . . . . . . . . . . . .
::lastSelectionPicture . . . . . . . . . . . . . . . .
::limitsChanged . . . . . . . . . . . . . . . . . . . .
::load . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ProcSee Reference Manual
333
333
325
325
319
322
425
311
330
342
333
342
342
384
344
345
348
348
384
351
351
384
333
353
425
301
355
312
312
332
357
425
358
425
360
333
361
487
423
333
333
333
333
382
501
Standard pTALK Functions
List of Functions
::loadDatabase. . . . . . . . . . . . . . . . . . . . . .411
::localtime . . . . . . . . . . . . . . . . . . . . . . . . .443
::log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .384
::log10 . . . . . . . . . . . . . . . . . . . . . . . . . . . .384
::lostKeyFocus . . . . . . . . . . . . . . . . . . . . .333
::max . . . . . . . . . . . . . . . . . . . . . . . . . . . . .390
::maxRunTimeMessages. . . . . . . . . . . . . .423
::message. . . . . . . . . . . . . . . . . . . . . . . . . .392
::metaIsDown . . . . . . . . . . . . . . . . . . . . . .333
::min . . . . . . . . . . . . . . . . . . . . . . . . . . . . .390
::mktime . . . . . . . . . . . . . . . . . . . . . . . . . .443
::nameOf . . . . . . . . . . . . . . . . . . . . . . . . . .353
::nameOfFullName . . . . . . . . . . . . . . . . . .353
::newArray . . . . . . . . . . . . . . . . . . . . . . . .289
::newAttribute . . . . . . . . . . . . . . . . . . . . . .306
::newCharArray . . . . . . . . . . . . . . . . . . . .289
::newCircle . . . . . . . . . . . . . . . . . . . . . . . .306
::newCircleArc . . . . . . . . . . . . . . . . . . . . .306
::newClass. . . . . . . . . . . . . . . . . . . . . . . . .306
::newColour . . . . . . . . . . . . . . . . . . . . . . .307
::newComEventObject . . . . . . . . . . . . . . .295
::newComInterfaceObject. . . . . . . . . . . . .295
::newComObject . . . . . . . . . . . . . . . . . . . .295
::newComShape . . . . . . . . . . . . . . . . . . . .295
::newDialogue. . . . . . . . . . . . . . . . . . . . . .306
::newDialogueArea . . . . . . . . . . . . . . . . . .306
::newDoubleArray . . . . . . . . . . . . . . . . . .289
::newEllipse . . . . . . . . . . . . . . . . . . . . . . .306
::newEllipseArc . . . . . . . . . . . . . . . . . . . .306
::newEnum . . . . . . . . . . . . . . . . . . . . . . . .307
::newEnumElement. . . . . . . . . . . . . . . . . .307
::newFloatArray . . . . . . . . . . . . . . . . . . . .289
::newFunction . . . . . . . . . . . . . . . . . . . . . .306
::newGroup . . . . . . . . . . . . . . . . . . . . . . . .306
::newHashTable . . . . . . . . . . . . . . . . . . . .365
::newImage . . . . . . . . . . . . . . . . . . . . . . . .306
::newInstance . . . . . . . . . . . . . . . . . . . . . .306
::newIntArray . . . . . . . . . . . . . . . . . . . . . .289
::newInterpolator. . . . . . . . . . . . . . . . . . . .369
::newLayer . . . . . . . . . . . . . . . . . . . . . . . .374
::newLibrary . . . . . . . . . . . . . . . . . . . . . . .306
::newLine . . . . . . . . . . . . . . . . . . . . . . . . .306
::newList . . . . . . . . . . . . . . . . . . . . . . . . . .380
::newMatrix. . . . . . . . . . . . . . . . . . . . . . . .385
::newPicture . . . . . . . . . . . . . . . . . . . . . . .307
::newPoint . . . . . . . . . . . . . . . . . . . . . . . . .404
::newPolygon . . . . . . . . . . . . . . . . . . . . . .306
::newProcess . . . . . . . . . . . . . . . . . . . . . . .307
502
::newRect . . . . . . . . . . . . . . . . . . . . . . . . . 415
::newRectangle. . . . . . . . . . . . . . . . . . . . . 306
::newRoundRect. . . . . . . . . . . . . . . . . . . . 306
::newScale . . . . . . . . . . . . . . . . . . . . . . . . 306
::newShortIntArray . . . . . . . . . . . . . . . . . 289
::newSize . . . . . . . . . . . . . . . . . . . . . . . . . 435
::newText . . . . . . . . . . . . . . . . . . . . . . . . . 306
::newTrend . . . . . . . . . . . . . . . . . . . . . . . . 306
::nextFullName. . . . . . . . . . . . . . . . . . . . . 373
::ownerOfFullName . . . . . . . . . . . . . . . . . 353
::pictureDisplayed . . . . . . . . . . . . . . . . . . 333
::pictureUndisplayed . . . . . . . . . . . . . . . . 333
::pow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
::printf. . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
::processIsConnected . . . . . . . . . . . . . . . . 411
::putenv. . . . . . . . . . . . . . . . . . . . . . . . . . . 332
::quoteId . . . . . . . . . . . . . . . . . . . . . . . . . . 353
::random . . . . . . . . . . . . . . . . . . . . . . . . . . 413
::readdir . . . . . . . . . . . . . . . . . . . . . . . . . . 414
::remove . . . . . . . . . . . . . . . . . . . . . . . . . . 416
::rename . . . . . . . . . . . . . . . . . . . . . . . . . . 417
::round . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
::roundToInt . . . . . . . . . . . . . . . . . . . . . . . 384
::rtmName . . . . . . . . . . . . . . . . . . . . . . . . 422
::rtmVersion . . . . . . . . . . . . . . . . . . . . . . . 422
::save . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
::searchComments . . . . . . . . . . . . . . . . . . 301
::setComment . . . . . . . . . . . . . . . . . . . . . . 301
::setDialogueAction . . . . . . . . . . . . . . . . . 312
::setDialogueTrigger . . . . . . . . . . . . . . . . 312
::setFileName . . . . . . . . . . . . . . . . . . . . . . 425
::setGreyMatrix . . . . . . . . . . . . . . . . . . . . 294
::setPath . . . . . . . . . . . . . . . . . . . . . . . . . . 425
::setRGBMatrix . . . . . . . . . . . . . . . . . . . . 294
::shapeCursorX. . . . . . . . . . . . . . . . . . . . . 333
::shapeCursorY. . . . . . . . . . . . . . . . . . . . . 333
::shapeEntered . . . . . . . . . . . . . . . . . . . . . 333
::shapeLeft . . . . . . . . . . . . . . . . . . . . . . . . 333
::shiftIsDown . . . . . . . . . . . . . . . . . . . . . . 333
::shutdown . . . . . . . . . . . . . . . . . . . . . . . . 434
::sin. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
::sprintf . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
::sqrt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
::strcat. . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
::strcftime . . . . . . . . . . . . . . . . . . . . . . . . . 443
::strchr . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
::strcmp. . . . . . . . . . . . . . . . . . . . . . . . . . . 437
::strcpy . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
ProcSee Reference Manual
Standard pTALK Functions
List of Functions
::strdup . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
::strEval
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
::strfield. . . . . . . . . . . . . . . . . . . . . . . . . . . 437
::strformat . . . . . . . . . . . . . . . . . . . . . . . . . 407
::strformat . . . . . . . . . . . . . . . . . . . . . . . . . 437
::stricmp . . . . . . . . . . . . . . . . . . . . . . . . . . 437
::strlen . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
::strlower. . . . . . . . . . . . . . . . . . . . . . . . . . 437
::strnatcmp . . . . . . . . . . . . . . . . . . . . . . . . 437
::strnaticmp . . . . . . . . . . . . . . . . . . . . . . . . 437
::strncmp . . . . . . . . . . . . . . . . . . . . . . . . . . 437
::strncpy . . . . . . . . . . . . . . . . . . . . . . . . . . 437
::strnicmp . . . . . . . . . . . . . . . . . . . . . . . . . 437
::strquote . . . . . . . . . . . . . . . . . . . . . . . . . . 437
::strrchr . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
::strsplit . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
::strstr . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
::strtrim . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
::strunquote . . . . . . . . . . . . . . . . . . . . . . . . 437
::strupper. . . . . . . . . . . . . . . . . . . . . . . . . . 437
::system. . . . . . . . . . . . . . . . . . . . . . . . . . . 439
::tan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
::time. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
::tolower . . . . . . . . . . . . . . . . . . . . . . . . . . 451
::toString . . . . . . . . . . . . . . . . . . . . . . . . . . 452
::toupper . . . . . . . . . . . . . . . . . . . . . . . . . . 451
::tr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
::trace . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
::trendUpdated . . . . . . . . . . . . . . . . . . . . . 333
::trTime . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
::typeNameOf . . . . . . . . . . . . . . . . . . . . . . 353
::ungrabPointer . . . . . . . . . . . . . . . . . . . . . 334
::unquoteId . . . . . . . . . . . . . . . . . . . . . . . . 353
::update . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
::viewableStateChanged . . . . . . . . . . . . . . 333
::windowClose . . . . . . . . . . . . . . . . . . . . . 333
::windowEntered. . . . . . . . . . . . . . . . . . . . 333
::windowLeft . . . . . . . . . . . . . . . . . . . . . . 333
::windowMapped . . . . . . . . . . . . . . . . . . . 333
::windowMoved . . . . . . . . . . . . . . . . . . . . 333
::windowResized . . . . . . . . . . . . . . . . . . . 333
::windowUnmapped . . . . . . . . . . . . . . . . . 333
::xyConv . . . . . . . . . . . . . . . . . . . . . . . . . . 497
::xyConvX . . . . . . . . . . . . . . . . . . . . . . . . 497
::xyConvY . . . . . . . . . . . . . . . . . . . . . . . . 497
Application::comRGB . . . . . . . . . . . . . . . 292
Application::connectToProcess . . . . . . . . 411
Application::defaultCursor . . . . . . . . . . .
Application::disconnectFromProcess . . .
Application::getColour . . . . . . . . . . . . . .
Application::getColourFromRGB . . . . . .
Application::getConstructorBehaviour . .
Application::getCursor . . . . . . . . . . . . . .
Application::getFont . . . . . . . . . . . . . . . .
Application::getLinestyle . . . . . . . . . . . .
Application::getPattern . . . . . . . . . . . . . .
Application::loadPrinterFiles. . . . . . . . . .
Application::newComLibrary . . . . . . . . .
Application::newDisplay . . . . . . . . . . . . .
Application::newWindow . . . . . . . . . . . .
Application::processNotify . . . . . . . . . . .
Application::setConstructorBehaviour . .
Application::setCursor . . . . . . . . . . . . . . .
Application::setCursorColours . . . . . . . .
Application::setTextEditorAttributes . . .
Application::updateResources . . . . . . . . .
Application::updateWindows . . . . . . . . .
Application::useResourceStyle . . . . . . . .
Colour::add . . . . . . . . . . . . . . . . . . . . . . .
Colour::blue . . . . . . . . . . . . . . . . . . . . . . .
Colour::comRGB . . . . . . . . . . . . . . . . . . .
Colour::edit . . . . . . . . . . . . . . . . . . . . . . .
Colour::getTransparency . . . . . . . . . . . . .
Colour::green . . . . . . . . . . . . . . . . . . . . . .
Colour::numBlinkColours . . . . . . . . . . . .
Colour::red. . . . . . . . . . . . . . . . . . . . . . . .
Colour::remove . . . . . . . . . . . . . . . . . . . .
Colour::setTransparency . . . . . . . . . . . . .
Colour::time . . . . . . . . . . . . . . . . . . . . . . .
ComInterface::queryInterface . . . . . . . . .
ComInterfaceObject::queryInterface . . . .
ComObject::persist . . . . . . . . . . . . . . . . .
ComObject::queryInterface . . . . . . . . . . .
ComObject::theComClass( . . . . . . . . . . .
ComShape::backgroundColour . . . . . . . .
ComShape::foregroundColour. . . . . . . . .
ComShape::height . . . . . . . . . . . . . . . . . .
ComShape::hideProperties . . . . . . . . . . .
ComShape::persist . . . . . . . . . . . . . . . . . .
ComShape::queryInterface . . . . . . . . . . .
ComShape::resizeable . . . . . . . . . . . . . . .
ComShape::showProperties . . . . . . . . . . .
ComShape::showProperties . . . . . . . . . . .
ComShape::theComClass . . . . . . . . . . . .
ComShape::theFont . . . . . . . . . . . . . . . . .
ProcSee Reference Manual
310
411
292
292
303
310
352
379
394
405
295
313
307
411
303
310
310
440
485
486
419
292
292
292
292
292
292
292
292
292
292
292
295
295
299
299
299
297
297
297
297
297
297
297
297
297
297
297
503
Standard pTALK Functions
List of Functions
ComShape::width . . . . . . . . . . . . . . . . . . .297
ComShape::x. . . . . . . . . . . . . . . . . . . . . . .297
ComShape::y. . . . . . . . . . . . . . . . . . . . . . .297
Display . . . . . . . . . . . . . . . . . . . . . . . . . . .313
Display::connection . . . . . . . . . . . . . . . . .313
Display::getDisplayInfo . . . . . . . . . . . . . .313
Display::height . . . . . . . . . . . . . . . . . . . . .313
Display::resizeMode . . . . . . . . . . . . . . . . .313
Display::virtualHeight . . . . . . . . . . . . . . .313
Display::virtualWidth . . . . . . . . . . . . . . . .313
Display::virtualX . . . . . . . . . . . . . . . . . . .313
Display::virtualY . . . . . . . . . . . . . . . . . . .313
Display::width. . . . . . . . . . . . . . . . . . . . . .313
DisplayInfo::connection . . . . . . . . . . . . . .316
DisplayInfo::displayArea . . . . . . . . . . . . .316
DisplayInfo::getCapability . . . . . . . . . . . .316
DisplayInfo::isPrimary . . . . . . . . . . . . . . .316
DisplayInfo::workArea . . . . . . . . . . . . . . .316
DisplayInfoSet::get . . . . . . . . . . . . . . . . . .318
DisplayInfoSet::numDisplays. . . . . . . . . .318
DisplayInfoSet:display . . . . . . . . . . . . . . .318
DnDSource::drag . . . . . . . . . . . . . . . . . . .319
DnDSource::setBitmap . . . . . . . . . . . . . . .319
DnDSource::setCursor . . . . . . . . . . . . . . .319
DnDSource::setData . . . . . . . . . . . . . . . . .319
DnDTarget::getData . . . . . . . . . . . . . . . . .322
DnDTarget::getDropEffect . . . . . . . . . . . .322
DnDTarget::isAltDown . . . . . . . . . . . . . .322
DnDTarget::isControlDown . . . . . . . . . . .322
DnDTarget::isCopy. . . . . . . . . . . . . . . . . .322
DnDTarget::isLeftMouseButtonDown . . .322
DnDTarget::isLink . . . . . . . . . . . . . . . . . .322
DnDTarget::isMiddleMouseButtonDown 322
DnDTarget::isMove . . . . . . . . . . . . . . . . .322
DnDTarget::isRightMouseButtonDown . .322
DnDTarget::isShiftDown . . . . . . . . . . . . .322
DnDTarget::setDropEffect . . . . . . . . . . . .322
Font::ascent. . . . . . . . . . . . . . . . . . . . . . . .352
Font::capHeight . . . . . . . . . . . . . . . . . . . .352
Font::descent. . . . . . . . . . . . . . . . . . . . . . .352
Font::height. . . . . . . . . . . . . . . . . . . . . . . .352
Font::lbearing . . . . . . . . . . . . . . . . . . . . . .352
Font::rbearing . . . . . . . . . . . . . . . . . . . . . .352
Font::textWidth. . . . . . . . . . . . . . . . . . . . .352
Font::width . . . . . . . . . . . . . . . . . . . . . . . .352
Font::xHeight . . . . . . . . . . . . . . . . . . . . . .352
HashTable::clear . . . . . . . . . . . . . . . . . . . .365
HashTable::contains . . . . . . . . . . . . . . . . .365
504
HashTable::get . . . . . . . . . . . . . . . . . . . . . 365
HashTable::getKeys . . . . . . . . . . . . . . . . . 365
HashTable::length . . . . . . . . . . . . . . . . . . 365
HashTable::put . . . . . . . . . . . . . . . . . . . . . 365
HashTable::putAll . . . . . . . . . . . . . . . . . . 365
HashTable::remove . . . . . . . . . . . . . . . . . 365
HashTable::toString . . . . . . . . . . . . . . . . . 365
Image::filename . . . . . . . . . . . . . . . . . . . . 367
Image::reload . . . . . . . . . . . . . . . . . . . . . . 367
Image::x . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Image::y . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Instance::changeClass . . . . . . . . . . . . . . . 368
Instance::classFullName . . . . . . . . . . . . . 368
Interpolator::add. . . . . . . . . . . . . . . . . . . . 369
Interpolator::getInterpolator. . . . . . . . . . . 369
Interpolator::getInValue. . . . . . . . . . . . . . 369
Interpolator::getOutValue . . . . . . . . . . . . 369
Interpolator::insert . . . . . . . . . . . . . . . . . . 369
Interpolator::maxValueOut . . . . . . . . . . . 369
Interpolator::minValueOut. . . . . . . . . . . . 369
Interpolator::modifyInterpolator . . . . . . . 369
Interpolator::modifyInValue . . . . . . . . . . 369
Interpolator::modifyOutValue . . . . . . . . . 369
Interpolator::numPoints . . . . . . . . . . . . . . 369
Interpolator::remove. . . . . . . . . . . . . . . . . 369
Interpolator::set . . . . . . . . . . . . . . . . . . . . 369
Interpolator::value . . . . . . . . . . . . . . . . . . 369
Layer::addAlias . . . . . . . . . . . . . . . . . . . . 374
Layer::delAlias. . . . . . . . . . . . . . . . . . . . . 374
Layer::getAliases . . . . . . . . . . . . . . . . . . . 374
Layer::getOriginalName . . . . . . . . . . . . . 374
Layer::getVisibility . . . . . . . . . . . . . . . . . 374
Layer::isDefault . . . . . . . . . . . . . . . . . . . . 374
Layer::moveBehind . . . . . . . . . . . . . . . . . 374
Layer::setAsDefault . . . . . . . . . . . . . . . . . 374
Layer::setOriginalName. . . . . . . . . . . . . . 374
Layer::setVisibility. . . . . . . . . . . . . . . . . . 374
Layer::toBack. . . . . . . . . . . . . . . . . . . . . . 374
Layer::toFront . . . . . . . . . . . . . . . . . . . . . 374
Library::newComLibrary . . . . . . . . . . . . . 295
Line::addPoint . . . . . . . . . . . . . . . . . . . . . 376
Line::get . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Line::getCapStyle. . . . . . . . . . . . . . . . . . . 376
Line::getDynamicX . . . . . . . . . . . . . . . . . 376
Line::getDynamicY . . . . . . . . . . . . . . . . . 376
Line::getInterpolatorX . . . . . . . . . . . . . . . 376
Line::getInterpolatorY . . . . . . . . . . . . . . . 376
Line::getJoinStyle . . . . . . . . . . . . . . . . . . 376
ProcSee Reference Manual
Standard pTALK Functions
List of Functions
Line::getX. . . . . . . . . . . . . . . . . . . . . . . . . 376
Line::getY. . . . . . . . . . . . . . . . . . . . . . . . . 376
Line::numberOfPoints . . . . . . . . . . . . . . . 376
Line::removePoint . . . . . . . . . . . . . . . . . . 376
Line::set . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Line::setCapStyle . . . . . . . . . . . . . . . . . . . 376
Line::setDynamicX. . . . . . . . . . . . . . . . . . 376
Line::setDynamicY. . . . . . . . . . . . . . . . . . 376
Line::setInterpolatorX . . . . . . . . . . . . . . . 376
Line::setInterpolatorY . . . . . . . . . . . . . . . 376
Line::setJoinStyle . . . . . . . . . . . . . . . . . . . 376
Line::setX . . . . . . . . . . . . . . . . . . . . . . . . . 376
Line::setY . . . . . . . . . . . . . . . . . . . . . . . . . 376
List::add . . . . . . . . . . . . . . . . . . . . . . . . . . 380
List::clear . . . . . . . . . . . . . . . . . . . . . . . . . 380
List::concat . . . . . . . . . . . . . . . . . . . . . . . . 380
List::copy . . . . . . . . . . . . . . . . . . . . . . . . . 380
List::get. . . . . . . . . . . . . . . . . . . . . . . . . . . 380
List::insert. . . . . . . . . . . . . . . . . . . . . . . . . 380
List::length . . . . . . . . . . . . . . . . . . . . . . . . 380
List::remove . . . . . . . . . . . . . . . . . . . . . . . 380
List::sort . . . . . . . . . . . . . . . . . . . . . . . . . . 380
List::toString. . . . . . . . . . . . . . . . . . . . . . . 380
Matrix::add . . . . . . . . . . . . . . . . . . . . . . . . 385
Matrix::adjoint . . . . . . . . . . . . . . . . . . . . . 385
Matrix::clear . . . . . . . . . . . . . . . . . . . . . . . 385
Matrix::cofactors . . . . . . . . . . . . . . . . . . . 385
Matrix::columns . . . . . . . . . . . . . . . . . . . . 385
Matrix::determinant . . . . . . . . . . . . . . . . . 385
Matrix::get . . . . . . . . . . . . . . . . . . . . . . . . 385
Matrix::identity. . . . . . . . . . . . . . . . . . . . . 385
Matrix::inverse . . . . . . . . . . . . . . . . . . . . . 385
Matrix::isDiagonal . . . . . . . . . . . . . . . . . . 385
Matrix::isEqual . . . . . . . . . . . . . . . . . . . . . 385
Matrix::isIdentity . . . . . . . . . . . . . . . . . . . 385
Matrix::isLowerTriangular . . . . . . . . . . . . 385
Matrix::isNull . . . . . . . . . . . . . . . . . . . . . . 385
Matrix::isOrthogonal . . . . . . . . . . . . . . . . 385
Matrix::isSquare . . . . . . . . . . . . . . . . . . . . 385
Matrix::isSymmetric. . . . . . . . . . . . . . . . . 385
Matrix::isTriangular . . . . . . . . . . . . . . . . . 385
Matrix::isUpperTriangular . . . . . . . . . . . . 385
Matrix::multiply . . . . . . . . . . . . . . . . . . . . 385
Matrix::rows . . . . . . . . . . . . . . . . . . . . . . . 385
Matrix::set. . . . . . . . . . . . . . . . . . . . . . . . . 385
Matrix::subtract . . . . . . . . . . . . . . . . . . . . 385
Matrix::trace . . . . . . . . . . . . . . . . . . . . . . . 385
Matrix::transpose . . . . . . . . . . . . . . . . . . . 385
mouseWheel . . . . . . . . . . . . . . . . . . . . . .
msecsToday . . . . . . . . . . . . . . . . . . . . . . .
newVariable . . . . . . . . . . . . . . . . . . . . . . .
Object::fullName . . . . . . . . . . . . . . . . . . .
Object::isMetaClass . . . . . . . . . . . . . . . . .
Object::metaClass . . . . . . . . . . . . . . . . . .
Object::name . . . . . . . . . . . . . . . . . . . . . .
Object::owner . . . . . . . . . . . . . . . . . . . . .
onUpdate . . . . . . . . . . . . . . . . . . . . . . . . .
onVariableUpdate . . . . . . . . . . . . . . . . . .
Picture::adjustColours . . . . . . . . . . . . . . .
Picture::align . . . . . . . . . . . . . . . . . . . . . .
Picture::align . . . . . . . . . . . . . . . . . . . . . .
Picture::clear . . . . . . . . . . . . . . . . . . . . . .
Picture::clear . . . . . . . . . . . . . . . . . . . . . .
Picture::clearKeyFocus . . . . . . . . . . . . . .
Picture::copy . . . . . . . . . . . . . . . . . . . . . .
Picture::copy . . . . . . . . . . . . . . . . . . . . . .
Picture::cut . . . . . . . . . . . . . . . . . . . . . . . .
Picture::cut . . . . . . . . . . . . . . . . . . . . . . . .
Picture::distribute. . . . . . . . . . . . . . . . . . .
Picture::distribute. . . . . . . . . . . . . . . . . . .
Picture::dndActivate . . . . . . . . . . . . . . . .
Picture::dndDeactivate. . . . . . . . . . . . . . .
Picture::exportEMF . . . . . . . . . . . . . . . . .
Picture::freeze . . . . . . . . . . . . . . . . . . . . .
Picture::fullName. . . . . . . . . . . . . . . . . . .
Picture::getDynPrimitiveAttr. . . . . . . . . .
Picture::getDynPrimitiveAttr. . . . . . . . . .
Picture::getKeyFocusShape . . . . . . . . . . .
Picture::getPictureFlags . . . . . . . . . . . . . .
Picture::getPrimitiveAttr . . . . . . . . . . . . .
Picture::getPrimitiveAttr . . . . . . . . . . . . .
Picture::getShapesWithinCircle. . . . . . . .
Picture::group . . . . . . . . . . . . . . . . . . . . .
Picture::group . . . . . . . . . . . . . . . . . . . . .
Picture::isDisplayed . . . . . . . . . . . . . . . . .
Picture::isIconic . . . . . . . . . . . . . . . . . . . .
Picture::isInEditMode . . . . . . . . . . . . . . .
Picture::isMapped . . . . . . . . . . . . . . . . . .
picture::isViewable . . . . . . . . . . . . . . . . .
Picture::lower. . . . . . . . . . . . . . . . . . . . . .
Picture::map . . . . . . . . . . . . . . . . . . . . . . .
Picture::moveCursor . . . . . . . . . . . . . . . .
Picture::moveSelected . . . . . . . . . . . . . . .
Picture::name . . . . . . . . . . . . . . . . . . . . . .
Picture::numberOfSelected . . . . . . . . . . .
Picture::numberOfSelected . . . . . . . . . . .
ProcSee Reference Manual
333
443
306
393
393
393
393
393
482
482
395
327
395
327
395
395
327
395
327
395
327
395
325
325
395
395
395
327
395
395
395
327
395
395
327
395
396
396
396
396
396
396
396
396
396
396
327
396
505
Standard pTALK Functions
List of Functions
Picture::pan . . . . . . . . . . . . . . . . . . . . . . . .396
Picture::paste. . . . . . . . . . . . . . . . . . . . . . .327
Picture::paste. . . . . . . . . . . . . . . . . . . . . . .396
Picture::postKeyEvent . . . . . . . . . . . . . . .334
Picture::postMouseButtonEvent . . . . . . . .334
Picture::raise . . . . . . . . . . . . . . . . . . . . . . .396
Picture::selectAllIn . . . . . . . . . . . . . . . . . .396
Picture::selectShape . . . . . . . . . . . . . . . . .396
Picture::setCursor . . . . . . . . . . . . . . . . . . .310
Picture::setCursor . . . . . . . . . . . . . . . . . . .396
Picture::setDynPrimitiveAttr . . . . . . . . . .327
Picture::setDynPrimitiveAttr . . . . . . . . . .396
Picture::setFocus. . . . . . . . . . . . . . . . . . . .396
Picture::setPictureFlags . . . . . . . . . . . . . .396
Picture::setPrimitiveAttr . . . . . . . . . . . . . .327
Picture::setPrimitiveAttr . . . . . . . . . . . . . .396
Picture::shapeAt . . . . . . . . . . . . . . . . . . . .396
Picture::shapeFullNameAt . . . . . . . . . . . .396
Picture::sound . . . . . . . . . . . . . . . . . . . . . .396
Picture::theWindow . . . . . . . . . . . . . . . . .396
PIcture::title . . . . . . . . . . . . . . . . . . . . . . .396
Picture::toBack . . . . . . . . . . . . . . . . . . . . .327
Picture::toBack . . . . . . . . . . . . . . . . . . . . .396
Picture::toFront . . . . . . . . . . . . . . . . . . . . .327
Picture::toFront . . . . . . . . . . . . . . . . . . . . .396
Picture::ungroup . . . . . . . . . . . . . . . . . . . .327
Picture::ungroup . . . . . . . . . . . . . . . . . . . .396
Picture::unmap . . . . . . . . . . . . . . . . . . . . .396
Picture::unmapChildren . . . . . . . . . . . . . .396
Picture::updatePicture. . . . . . . . . . . . . . . .396
Picture::useResourceStyle . . . . . . . . . . . .419
Picture::winxy2xy. . . . . . . . . . . . . . . . . . .396
Picture::xSnapped . . . . . . . . . . . . . . . . . . .396
Picture::xy2dxy. . . . . . . . . . . . . . . . . . . . .396
Picture::xy2sx . . . . . . . . . . . . . . . . . . . . . .396
Picture::xy2sy . . . . . . . . . . . . . . . . . . . . . .396
Picture::xy2winxy. . . . . . . . . . . . . . . . . . .396
Picture::xy2wx . . . . . . . . . . . . . . . . . . . . .396
Picture::xy2wy . . . . . . . . . . . . . . . . . . . . .396
Picture::ySnapped . . . . . . . . . . . . . . . . . . .396
Picture::zoom . . . . . . . . . . . . . . . . . . . . . .396
Picture::zoomFactor . . . . . . . . . . . . . . . . .396
Point::set . . . . . . . . . . . . . . . . . . . . . . . . . .404
Point::x . . . . . . . . . . . . . . . . . . . . . . . . . . .404
Point::y . . . . . . . . . . . . . . . . . . . . . . . . . . .404
Rect::height. . . . . . . . . . . . . . . . . . . . . . . .415
Rect::set . . . . . . . . . . . . . . . . . . . . . . . . . .415
Rect::width . . . . . . . . . . . . . . . . . . . . . . . .415
506
Rect::x . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Rect::y . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
setTimeZone. . . . . . . . . . . . . . . . . . . . . . . 443
Shape::bHeight. . . . . . . . . . . . . . . . . . . . . 430
Shape::bWidth . . . . . . . . . . . . . . . . . . . . . 430
Shape::bX. . . . . . . . . . . . . . . . . . . . . . . . . 430
Shape::bY. . . . . . . . . . . . . . . . . . . . . . . . . 430
Shape::containsPoint . . . . . . . . . . . . . . . . 430
Shape::dndActivate . . . . . . . . . . . . . . . . . 325
Shape::dndDeactivate. . . . . . . . . . . . . . . . 325
Shape::fullName. . . . . . . . . . . . . . . . . . . . 430
Shape::getLayer . . . . . . . . . . . . . . . . . . . . 374
Shape::getShapeFlags . . . . . . . . . . . . . . . 430
Shape::getViewableState . . . . . . . . . . . . . 430
Shape::grabPointer . . . . . . . . . . . . . . . . . . 430
Shape::name . . . . . . . . . . . . . . . . . . . . . . . 430
Shape::select. . . . . . . . . . . . . . . . . . . . . . . 430
Shape::setKeyFocus . . . . . . . . . . . . . . . . . 430
Shape::setLayer . . . . . . . . . . . . . . . . . . . . 374
Shape::setShapeFlags. . . . . . . . . . . . . . . . 430
Shape::shapeCursorX() . . . . . . . . . . . . . . 430
Shape::shapeCursorY. . . . . . . . . . . . . . . . 430
Shape::shapeToBack . . . . . . . . . . . . . . . . 430
Shape::shapeToFront . . . . . . . . . . . . . . . . 430
Shape::shxy2xy . . . . . . . . . . . . . . . . . . . . 430
Shape::thePicture . . . . . . . . . . . . . . . . . . . 430
Shape::unselect. . . . . . . . . . . . . . . . . . . . . 430
Shape::updateShape . . . . . . . . . . . . . . . . . 430
Shape::xy2shxy . . . . . . . . . . . . . . . . . . . . 430
Shape::xy2sx . . . . . . . . . . . . . . . . . . . . . . 430
Shape::xy2sy . . . . . . . . . . . . . . . . . . . . . . 430
Shape::xy2wx. . . . . . . . . . . . . . . . . . . . . . 430
Shape::xy2wy. . . . . . . . . . . . . . . . . . . . . . 430
Shape:attribute:visibility . . . . . . . . . . . . . 430
Size::height. . . . . . . . . . . . . . . . . . . . . . . . 435
Size::set . . . . . . . . . . . . . . . . . . . . . . . . . . 435
Size::width . . . . . . . . . . . . . . . . . . . . . . . . 435
Text::alignment . . . . . . . . . . . . . . . . . . . . 440
Text::buffer . . . . . . . . . . . . . . . . . . . . . . . 440
Text::buffer . . . . . . . . . . . . . . . . . . . . . . . 447
Text::clearSelection . . . . . . . . . . . . . . . . . 440
Text::clearSelection . . . . . . . . . . . . . . . . . 447
Text::deleteBackward . . . . . . . . . . . . . . . 440
Text::deleteForward . . . . . . . . . . . . . . . . . 440
Text::edit . . . . . . . . . . . . . . . . . . . . . . . . . 440
Text::edit . . . . . . . . . . . . . . . . . . . . . . . . . 447
Text::format . . . . . . . . . . . . . . . . . . . . . . . 440
Text::isInEditMode . . . . . . . . . . . . . . . . . 440
ProcSee Reference Manual
Standard pTALK Functions
List of Functions
Text::isInEditMode. . . . . . . . . . . . . . . . . . 447
Text::moveLeft . . . . . . . . . . . . . . . . . . . . . 440
Text::moveRight. . . . . . . . . . . . . . . . . . . . 440
Text::moveToEnd. . . . . . . . . . . . . . . . . . . 440
Text::moveToHome . . . . . . . . . . . . . . . . . 440
Text::position . . . . . . . . . . . . . . . . . . . . . . 440
Text::put . . . . . . . . . . . . . . . . . . . . . . . . . . 440
Text::selectAll . . . . . . . . . . . . . . . . . . . . . 440
Text::selectWord . . . . . . . . . . . . . . . . . . . 440
Text::textWidth. . . . . . . . . . . . . . . . . . . . . 440
Text::theText . . . . . . . . . . . . . . . . . . . . . . 440
TimerInterval::count. . . . . . . . . . . . . . . . . 449
TimerInterval::isRunning . . . . . . . . . . . . . 449
TimerInterval::setInterval. . . . . . . . . . . . . 449
TimerInterval::start. . . . . . . . . . . . . . . . . . 449
TimerInterval::start. . . . . . . . . . . . . . . . . . 449
TimerInterval::start. . . . . . . . . . . . . . . . . . 449
TimerInterval::start. . . . . . . . . . . . . . . . . . 449
TimerInterval::stop . . . . . . . . . . . . . . . . . . 449
TimeTag::getStartTime . . . . . . . . . . . . . . 461
TimeTag::setStartTime. . . . . . . . . . . . . . . 461
Trend::newEventPlot . . . . . . . . . . . . . . . . 455
Trend::newTimeLabel . . . . . . . . . . . . . . . 455
Trend::newTrendGrid. . . . . . . . . . . . . . . . 455
Trend::newTrendPres . . . . . . . . . . . . . . . . 455
Trend::newTrendRuler . . . . . . . . . . . . . . . 455
Trend::numEventPlot . . . . . . . . . . . . . . . . 455
Trend::numTimeLabel . . . . . . . . . . . . . . . 455
Trend::numTrendGrid . . . . . . . . . . . . . . . 455
Trend::numTrendPres. . . . . . . . . . . . . . . . 455
Trend::numTrendRuler. . . . . . . . . . . . . . . 455
Trend::panAbs . . . . . . . . . . . . . . . . . . . . . 455
Trend::panFreeze . . . . . . . . . . . . . . . . . . . 455
Trend::panRel . . . . . . . . . . . . . . . . . . . . . . 455
Trend::reset. . . . . . . . . . . . . . . . . . . . . . . . 455
Trend::scrollValue . . . . . . . . . . . . . . . . . . 455
Trend::setScrollModifier . . . . . . . . . . . . . 455
Trend::theTime . . . . . . . . . . . . . . . . . . . . . 455
Trend::xW2Time . . . . . . . . . . . . . . . . . . . 455
Trend::xyW2Time . . . . . . . . . . . . . . . . . . 455
TrendGrid::getLine. . . . . . . . . . . . . . . . . . 459
TrendGrid::getNumLines . . . . . . . . . . . . . 459
TrendGrid::toBack . . . . . . . . . . . . . . . . . . 459
TrendGrid::toFront . . . . . . . . . . . . . . . . . . 459
TrendLog::addVariable . . . . . . . . . . . . . . 462
TrendLog::analyse . . . . . . . . . . . . . . . . . . 462
TrendLog::appendLogBuffer . . . . . . . . . . 471
TrendLog::cancel LogBuffer . . . . . . . . . . 471
TrendLog::document . . . . . . . . . . . . . . . . 462
TrendLog::freeze . . . . . . . . . . . . . . . . . . . 462
TrendLog::getLogBuffer . . . . . . . . . . . . . 471
TrendLog::getVariableInfo . . . . . . . . . . . 462
TrendLog::logMode. . . . . . . . . . . . . . . . . 463
TrendLog::maxInterpolTime . . . . . . . . . . 463
TrendLog::newLogBuffer . . . . . . . . . . . . 471
TrendLog::removeVariable . . . . . . . . . . . 463
TrendLog::save . . . . . . . . . . . . . . . . . . . . 463
TrendLog::setLogBuffers . . . . . . . . . . . . 471
TrendLog::setTime . . . . . . . . . . . . . . . . . 463
TrendLog::setTrigger. . . . . . . . . . . . . . . . 471
TrendLog::timeTick. . . . . . . . . . . . . . . . . 463
TrendLogInternal::connectedRTMs . . . . 471
TrendLogInternal::eventTypeHandling . . 471
TrendLogInternal::execute . . . . . . . . . . . 471
TrendLogInternal::isConnected . . . . . . . . 471
TrendLogInternal::snapshotGetComment 471
TrendLogInternal::snapshotGetTime . . . 471
TrendLogInternal::snapshotLoad . . . . . . 471
TrendLogInternal::snapshotSave . . . . . . . 471
TrendPres::getInterpolator . . . . . . . . . . . . 474
TrendPres::getRulerTime . . . . . . . . . . . . 474
TrendPres::getRulerValue . . . . . . . . . . . . 474
TrendPres::getValue . . . . . . . . . . . . . . . . 474
TrendPres::getValuePos . . . . . . . . . . . . . 474
TrendPres::legalRulerValue . . . . . . . . . . 474
TrendPres::setInterpolator . . . . . . . . . . . . 474
TrendPres::setLimitModifier . . . . . . . . . . 474
TrendPres::toBack . . . . . . . . . . . . . . . . . . 474
TrendPres::toFront . . . . . . . . . . . . . . . . . . 474
TrendRuler::moveRuler . . . . . . . . . . . . . . 480
TrendRuler::setRulerPosition . . . . . . . . . 480
Window::adjustVirtualDisplay . . . . . . . . 489
Window::alwaysOnTop . . . . . . . . . . . . . . 488
Window::display . . . . . . . . . . . . . . . . . . . 488
Window::fullName . . . . . . . . . . . . . . . . . 488
Window::getFrameSize . . . . . . . . . . . . . . 489
Window::getScreenSize. . . . . . . . . . . . . . 489
Window::grabPointer. . . . . . . . . . . . . . . . 488
Window::iconify . . . . . . . . . . . . . . . . . . . 488
Window::isIconic. . . . . . . . . . . . . . . . . . . 488
Window::isInEditMode . . . . . . . . . . . . . . 488
Window::isMapped . . . . . . . . . . . . . . . . . 488
Window::isViewable . . . . . . . . . . . . . . . . 488
Window::lower . . . . . . . . . . . . . . . . . . . . 488
Window::map . . . . . . . . . . . . . . . . . . . . . 488
Window::maximize . . . . . . . . . . . . . . . . . 488
ProcSee Reference Manual
507
Standard pTALK Functions
List of Functions
Window::minimize . . . . . . . . . . . . . . . . . .488
Window::modSysKeyBehaviour . . . . . . .489
Window::move . . . . . . . . . . . . . . . . . . . . .488
Window::moveCursor. . . . . . . . . . . . . . . .489
Window::moveFrame . . . . . . . . . . . . . . . .488
Window::name . . . . . . . . . . . . . . . . . . . . .488
Window::pan. . . . . . . . . . . . . . . . . . . . . . .488
Window::paste . . . . . . . . . . . . . . . . . . . . .327
Window::paste . . . . . . . . . . . . . . . . . . . . .488
Window::postKeyEvent . . . . . . . . . . . . . .334
Window::postMouseButtonEvent. . . . . . .334
Window::raise. . . . . . . . . . . . . . . . . . . . . .488
Window::resize . . . . . . . . . . . . . . . . . . . . .488
Window::restore . . . . . . . . . . . . . . . . . . . .488
Window::selectAllIn. . . . . . . . . . . . . . . . .489
Window::selectShape . . . . . . . . . . . . . . . .488
Window::setCursor . . . . . . . . . . . . . . . . . .310
Window::setCursor . . . . . . . . . . . . . . . . . .489
Window::setDecorations. . . . . . . . . . . . . .489
Window::setFocus . . . . . . . . . . . . . . . . . .489
Window::setFunctions . . . . . . . . . . . . . . .489
Window::shapeFullName . . . . . . . . . . . . .488
Window::sound. . . . . . . . . . . . . . . . . . . . .489
Window::thePicture . . . . . . . . . . . . . . . . .488
Window::title . . . . . . . . . . . . . . . . . . . . . .488
Window::translateCoordinates . . . . . . . . .489
Window::translateCoordinates . . . . . . . . .489
Window::unmap . . . . . . . . . . . . . . . . . . . .488
Window::unmapChildren . . . . . . . . . . . . .488
Window::update . . . . . . . . . . . . . . . . . . . .488
Window::updatePicture . . . . . . . . . . . . . .488
Window::useResourceStyle . . . . . . . . . . .419
Window::windowAt . . . . . . . . . . . . . . . . .489
Window::xSnapped. . . . . . . . . . . . . . . . . .488
Window::ySnapped. . . . . . . . . . . . . . . . . .488
Window::zoom . . . . . . . . . . . . . . . . . . . . .488
Window::zoomFactor . . . . . . . . . . . . . . . .488
508
ProcSee Reference Manual
APPENDIX A
Example Patterns
APPENDIX A
Example Patterns
$PROCSEE_DIR/examples/libraries/Patterns
ProcSee Reference Manual
509
APPENDIX A
Example Colours
510
Example Colours
$PROCSEE_DIR/examples/libraries/Colours
ProcSee Reference Manual
APPENDIX A
Example Fonts
Example Fonts
$PROCSEE_DIR/examples/libraries/Fonts
ProcSee Reference Manual
511
APPENDIX A
512
Example Fonts
ProcSee Reference Manual
APPENDIX B
Example Classes
APPENDIX B
Example Classes
$PROCSEE_DIR/examples/libraries/Buttons
ProcSee Reference Manual
513
APPENDIX B
Example Classes
Example Classes
$PROCSEE_DIR/examples/libraries/InputFields
$PROCSEE_DIR/examples/libraries/ScrollBars
514
ProcSee Reference Manual
APPENDIX B
Example Classes
Example Classes
$PROCSEE_DIR/examples/libraries/PerformanceMonitoring
ProcSee Reference Manual
515
APPENDIX B
Example Classes
Example Classes
$PROCSEE_DIR/examples/libraries/PictureCache
516
ProcSee Reference Manual
Index
Symbols
.pctx 145, 147, 425
.pdat 112, 117
.pevl 147
.pfon 349
.plib 145, 147, 425
.ppic 145, 147, 425
.pprn 348, 349, 405
.ptrv 147
.Tdoc 147
.Xdefaults 152
$ARCH 7
$BUSTIMEOUT 7
$CONTROLHOST 7
$PATH 7
$PROCSEE_DIR 7, 192, 254, 348
A
abs 384
acos 481
action 43
add
Colour 292
Matrix 385, 387
additive expression 24
addLinePoint 306, 307
addPoint 377
addPolygonPoint 306, 307
addVariable
TrendLog 462, 464
adjoint
Matrix 385, 387
adjustColours 395
picture 402
adjustVirtualDisplay
window 489, 495
afterPictureUpdate
event 333, 336
align 395
edit 327
alignment
text 89, 440
trend attribute 461
TrendLabels 96
ALL
window decorations 490
altIsDown 333, 337
alwaysOnTop
window 488, 492
analyse
TrendLog 465
and expression 25
angleSnap
class 64
picture 68, 395, 396
ANSI C 17
api 161–169, 177, 178, 192, 200, 202–204,
217, 219, 225, 234, 238
connection 168
function 169
Main Loop 168
miscellaneous 168
records 168
Updating variable values 168
variable 168
api.h 161
apiError 169–192, 255
OK 177, ??–178, 207–??, 212, 213
apilib 161
appendLogBuffer
TrendLog 471
Application
ProcSeeReference Manual
I
Index
function
comRGB 293
connectToProcess 411
defaultCursor 310
disconnectFromProcess 411
getColour 293
getColourFromRGB 293
getCursor 310
getFont 352
getLinestyle 379
getPattern 394
loadPrinterFiles 405
newDisplay 313
processNotify 411
setCursor 310
setCursorColours 310
setTextEditorAttribute 442
setTextEditorAttributes 440
application 45
body 44–59, 67, 76, 84, 85, 90
definition 44
item 44
p3sim 134
p3sim keyword 135
applicationFullName 426
ARCH 7, 125, 161
hpArch 7, 161
linuxX86Arch 7, 161, 162
macX86Arch 7, 161, 162
sunArch 7, 161, 162
winArch 7, 161, 162
area
dialogue 78
arg
PfRegisterFunction 237
argument 43
array
subscript 21
arrayIndex 290
arrayLength 290
arrayMaxIndex 390
arrayMinIndex 390
ascent
font 352
asin 481
assignment
action 43
argument 43
II
attribute 61
element 43
expression 26
operator 26
point 43
statement 43
TrendPlot 92
atan 481
atan2 481
atof 291
atoi 291
attribute
assignment 61
circle 76
code 329
definition 32, 59
picture 395
TrendLabel 96
trendPlot 96
visibility 75
AutoRepeatDelay 152, 334
AutoRepeatInterval 152, 334
autoScale
TrendPlot 96
TrendPres 474, 475
autoStep
TrendGrid atribute 459
B
backgroundColour 395
class 65
comShape 297
picture 68, 397
shape 75
window 488, 489
backgroundFillColour
polygon 85
rectangle 87
roundRect 88
shape 75
beforePictureUpdate
event 333, 336
bHeight 432
blue
Colour 292
bmp
image 81
body
ProcSeeReference Manual
Index
application 44–59, 67, 76, 84, 85, 90
colour 52
cursor 57
dialogue 62, 79
display 49
EventPlot 93
font 56
group 70
instance 72
library 46, 53, 56, 67, 85
pattern 54
picture 68
process 47
rgb 52
shape 74
trend 92
TrendGrid 93
TrendLabels 92
TrendLog 100, 101
TrendPlot 92
TrendRuler 93
trendvar 103
trendvarconfig 103
window 48
BORDER
window decorations 490
bottomMargin
exportPostScript 406
break
statement 32
buffer
text 441
BUSCONNECT 161
BUSPATH 126
BUSRETRY 161
BUSTIMEOUT 7, 161
buttonDoubleClicked
event 333, 334
buttonIsDown
event 333, 337
buttonPressed
event 333, 334
buttonReleased
event 333, 334
buttonRepeated
event 333, 334
buttonRepeatInterval
event 489, 495
buttonTripleClicked
event 333, 334
bWidth 432
bX 432
bY 432
C
C++ 17
cancelLogBuffer
TrendLog 471
capHeight
font 352
cast expression 23
category
message 392
ceil 384
cftime 443, 445, 461
changeClass
instance 368
changeMask
PfSetDefinition 249
char 427
character
constant 42
circle
attribute 76
radius 76
x 76
y 76
circleArc 77, 78
openingAngle 77, 78
startAngle 77
circleSlice 78
openingAngle 77, 78
startAngle 77
class
angleSnap 64
backgroundColour 65
definition 64
example 513
foregroundColour 65
Line 376
oneToOne 65
pattern 65, 68
Polygon 376
radiusSnap 64
rotationAngle 65
worldHeight 65
ProcSeeReference Manual
III
Index
worldWidth 65
worldX 64
worldY 65
xReference 65
xScaleFactor 65
xSnap 64
yReference 65
yScaleFactor 65
ySnap 64
classBrowser 131
classElementFlag 67
classFullName 307
instance 368
ClassLIst 131
classList 131
clear 395
edit 327
Matrix 385, 386
paste 327
clearKeyFocus 395
clearKeyFocusShape
picture 401
clearSelection
text 441
CLOSE
window functions 490
code
attribute 329
pTALK 42
cofactors
Matrix 385, 387
Colour 418
function
add 292
blue 292
comRGB 293
edit 292
getTransparency 293
green 292
numBlinkColours 292
red 292
remove 292
setTransparency 293
time 292
colour 292
body 52
definition 53
example 510
IV
columns
Matrix 385, 386
COM definitions 300
COM functions 295
comAdvise 295
comDateFromTime 295
comDateToTime 295
comUnadvise 295
newComEventObject 296
newComInterfaceObject 296
newComLibrary 296
newComObject 296
newComShape 296
queryInterface 296
comAdvise 295
ComClass 300
comDateFromTime 295
comDateToTime 295
ComInterface 300
ComLibrary 300
comma operator 27
comment 40
pTALK 18
comments 301
communication system
SWBus 7
ComObject 299
comObject
persist 299
queryInterface 299
theComClass 299
comPersistSeparateFile 146, 150, 382
compile 167
compiled
library 47
compiler
pcc 39
compound statement 29
comRGB 293
Colour 293
ComShape 297
comShape
backgroundColour 297
foregroundColour 297
hideProperties 297
persist 298
queryInterface 298
resizeable 297
ProcSeeReference Manual
Index
showProperties 297
theComClass 298
theFont 297
comUnadvise 295
condition
PfAddInput 171
PfRemoveInput 242
conditional expression 26
configuration
item 44
connectedRTMs
TrendLog 471, 472
connectToProcess 411
const 139
constant 19
character 19, 42
floating 20, 42
integer 18, 41, 113
string literal 20
constructor 303
containsName 302
containsPoint 432
continue
statement 32
control 125, 127, 128, 129
CONTROLHOST 7, 125, 127, 128, 161
controlIsDown 333, 337
CONTROLPATH 125
controlutil 125, 127
copy 395
edit 327
cos 481
cosine 139
count
TimerInterval 450
create 329
addLinePoint 306, 307
addPolygonPoint 306, 307
newAttribute 306, 308
newCircle 306
newCircleArc 306, 307
newClass 306, 307
newColour 308
newDialogue 306, 308
newDialogueArea 306
newEllipse 306
newEllipseArc 306, 307
newEnum 307, 308
newEnumElement 307, 308
newFunction 306, 308
newGroup 306, 307
newImage 306, 307
newInstance 306, 307
newLibrary 306, 307
newLine 306, 307
newPicture 307, 308
newPolygon 306, 307
newProcess 307, 308
newRectangle 306
newRoundRect 306, 307
newScale 306, 307
newText 306
newTrend 306, 307
newVariable 306, 308
newWindow 307, 308
createIterator 359, 373
crosshairFollowSnap 395
picture 69, 397
crosshairLength 395
picture 69, 397
crosshairStyle 69
crosshairVisibility 395
picture 69, 397
Cursor 418
cursor 310
body 57
definition 56
cursorMoved 333, 334
cursorX 333, 337
cursorY 333, 337
cut 395
buffers 442
edit 327
D
database 47, 48, 112
file 112
p3sim 135
pragma directives 113
structure definition 112
variable definition 112
variable initialization 113
debug 311
dumpSymbolTable 311
trace 311
declaration 32
ProcSeeReference Manual
V
Index
library 44, 47, 47
statement 32
declarator 34
decl-specifier 32
decorations
window 488, 489, 490, 494
decrement 22
unary expression 22
defaultCursor 310
definition
application 44
attribute 32, 59
class 64
colour 53
cursor 56
dialogue 74
display 49
font 56
function 61
group 70
instance 72
library 46, 47
linestyle 59
pattern 54
PfSetDefinition 249
picture 68
process 47
resource style 59
shape 74
struct 112, 112
trend 92
TrendGrid 93
TrendLabels 92
TrendLog 99, 101
TrendPlot 92
TrendRuler 93
trendvar 103
trendvarconfig 103
variable 112
window 48
definition file
printer 405
defSize
PfGetDefinition 204
deleteBackward
text 440, 441
deleteForward
text 440, 441, 442
VI
deleteIterator 359, 373
depthPosition
TrendGrid attribute 459
descent
font 352
destructor 303
determinant
Matrix 385, 387
dialogue 312
area 78
body 62, 79
definition 74
disconnectFromProcess 411
diskBufferSize
TrendLog 101
diskFlushIntvl
TrendLog 101
diskForceWrite
TrendLog 101
diskLogLimIntvl
TrendLog 100
Display 313
attribute
connection 313
getDisplayInfo 313
height 313
resizeMode 313
virtualHeight 313
virtualWidth 313
virtualX 313
vitualY 313
width 313
display
body 49
definition 49
window 488, 493
DisplayInfo 316, 318
function
connection 316
displayArea 316
getCapability 316
isPrmary 316
workArea 316
DisplayInfoSet 318
function
display 318
get 318
numDisplays 318
ProcSeeReference Manual
Index
displayName
PfExportWindow 192
displayPicture 491
load/display 382
distribute 395
edit 327, 328
dndActivate 337
Picture 325, 325
Shape 325, 325
dndBegin 319, 325
event 333, 336
dndDeactivate 337
Picture 325, 325
Shape 325, 325
dndDrop 321, 322, 325
event 333, 336
dndEnter 322, 325
event 333, 336
dndLeave 322, 325
event 333, 336
dndMotion 322, 325
event 333, 336
dndSimpleDrag 319, 323, 325, 325, 326
dndSimpleDrop 321, 322, 325, 325
DnDSource 319
function
drag 319, 320
setBitmap 319, 320
setCursor 319, 320
setData 319, 319, 326
setDropEffect 323
dndSource 319
DnDTarget 322
function
getData 322, 322
getDropEffect 322, 323
isAltDown 322, 323
isControlDown 322, 323
isCopy 322, 323
isLeftButtonDown 323
isLeftMouseButtonDown 322
isLeftRightButtonDown 323
isLink 322, 323
isMiddleMouseButtonDown 322, 323
isMove 322, 323
isRightMouseButtonDown 322
isShiftDown 322, 323
setDropEffect 321, 322, 323
dndTarget 322, 322
do statement 31
document
save/document 425
TrendLog 462, 465
drag
DnDSource 319, 320
DragThreshold 152
drand48 413
dumpSymbolTable
debug 311
dynamic
operator 23
string 34
E
edit 309, 403
align 327
clear 327
Colour 292
copy 327
cut 327
distribute 327, 328
getDynPrimitiveAttr 327, 329
getPrimitiveAttr 327, 328
group 327
numberOfSelected 327, 329
paste 327
setDynPrimitiveAttr 327, 328
setPrimitiveAttr 327, 328
text 441
toBack 327
toFront 327
ungroup 327
window 327
editStates 330
editWindow 330
element 43
ellipse 79
xRadius 79
yRadius 79
ellipseArc 81
ellipseSlice 81
environ 446
environment variable
ARCH 7, 125, 161
BUSCONNECT 161
BUSPATH 126
ProcSeeReference Manual
VII
Index
BUSRETRY 161
BUSTIMEOUT 7, 161
CONTROLHOST 7, 125, 127, 128, 161
CONTROLPATH 125
PATH 7
PROCSEE_DIR 5, 7, 161
equality expression 25
eval 342
event
afterPictureUpdate 333, 336
altIsDown 333, 337
beforePictureUpdate 333, 336
buttonDoubleClicked 333, 334
buttonIsDown 333, 337
buttonPressed 333, 334
buttonReleased 333, 334
buttonRepeated 333, 334
buttonRepeatInterval 489, 495
buttonTripleClicked 334
buttonTripleCliked 333
controlIsDown 333, 337
cursorMoved 333, 334
cursorX 333, 337
cursorY 333, 337
dndBegin 333, 336
dndDrop 333, 336
dndEnter 333, 336
dndLeave 333, 336
dndMotion 333, 336
eventPicture 333, 337
EventPlot 97, 339
focusLost 333, 336
gotKeyFocus 333, 336
keyPressed 333, 334
keyReleased 333, 334
lastSelectionPicture 333, 337
limitsChanged 333, 336
lostKeyFocus 333, 336
metaIsDown 333, 337
mouseWheel 333, 335
pictureDisplayed 333, 336
pictureUndisplayed 333, 336
postKeyEvent 334, 337
postMouseButtonEvent 334, 338
shapeCursorX 333, 337
shapeCursorY 333, 337
shapeEntered 333, 335
shapeLeft 333, 335
VIII
shiftIsDown 333, 337
status routines 333
trendUpdated 333, 336
trigger routines 333
ungrabPointer 334, 337, 494
viewableStateChanged 333, 335
windowClose 333, 335
windowEntered 333, 335
windowLeft 333, 335
windowMapped 333, 335
windowMoved 333, 335
windowResized 333, 335
windowUnmapped 333, 335
eventPicture
event 333, 337
EventPlot 339, 458, 479
attribute
event 97, 339
offset 339
shape 339
theTrendPres 339
body 93
eventPlot 93
eventPlotFile
TrendLog 101
eventTypeHandling
TrendLog 471, 472
exclusive or expression 25
Execute 129
execute 342
TrendLog 471, 473
Execute options 129
-? (help) 129
-a <application> 129
-c <command> 129
-d (debug mode) 129
-h <host> 129
-p <process> 129
-r <rtm> 129
-s <scope> 129
-v (verbose mode) 129
executeAsync 342
exp 384
exportDxf 344
exportMode 344
sourceName 344
targetName 344
xMax 344
ProcSeeReference Manual
Index
yMax 344
exportEMF 395
picture 402
exportImage 345
exportMode
exportDxf 344
exportPostScript 348
bottomMargin 406
printerName 348
sourceName 348
targetName 348
topMargin 406
exportPostScriptEx 348
expression 20
additive 24
and 25
assignment 26
cast 23
conditional 26
equality 25
exclusive or 25
if 31
inclusive or 25
logical and 25
logical or 25
lookup 27
multiplicative 23
postfix 21
primary 20
relational 24
shift 24
statement 29
switch 30
unary 22
extLogApp
TrendLog 102
extLogProc
TrendLog 102
extLogRTM
TrendLog 102
F
fabs 384
fd
PfAddInput 171
PfRemoveInput 242
fdc
PfGetFDSet 206
fds
PfGetFDSet 206
field
struct 112
fieldName
PfAddField 170
PfGetFieldId 207
fieldSize
PfAddField 170
fieldType
PfAddField 170
fifoSize 226
file
database 112
fileName 382, 426
filename
image 82
fileNameHost
fileNames 351
fileNameNormal
fileNames 351
fileNames
fileNameHost 351
fileNameNormal 351
fillPattern
polygon 85
rectangle 87
roundRect 88
shape 76
fix
PfCreateArray 177
flags
RoundRect 420
Scale 427
float 427
floating 20
floating constant 42
floor 384
focusFollowPointer 150
focusLost
event 333, 336
Font 418
function
ascent 352
capHeight 352
descent 352
height 352
lbearing 352
ProcSeeReference Manual
IX
Index
rbearing 352
textWidth 352
width 352
xHeight 352
font
body 56
definition 56
text 352
for statement 31
foregroundColour 395
class 65
comShape 297
line 83
picture 68, 397
shape 75
foregroundFillColour
polygon 85
rectangle 87
roundRect 88
shape 75
format
Scale 427
text 88, 89, 91, 440
time 443
trend attribute 461
TrendLabels 97
freeze 395
picture 402
TrendLog 462, 466
fullName 351, 353, 395
fullNameOf 353
nameOfFullName 353
object 393
ownerOfFullName 353
PfSetDefinition 249
picture 399
shape 431
typeNameOf 353
window 488
fullNameOf 359
fullName 353
func
PfGetChanges 198
PfGetWindowChanges 214
funcName
PfRegisterFunction 237
funcPtr
PfRegisterFunction 237
X
function
ALL 490
api 169
definition 61
window 488, 490, 494
function call 21
functionPtr
PfAddInput 171
PfRemoveInput 242
functions
window 494
G
gauss 141
ged 7, 130, 130, 397
ged options
-? (help) 130
-application 130
-controlHost 130
-debug 130
-extDebug 130
-gedName 130
-rtmName 130
get
line/polygon 377
Matrix 385, 386
getCapStyle
line/polygon 378
getColour 293
getColourFromRGB 293
getComment 301
getConstructorBehaviour 304
getCursor 310
getData
DnDTarget 322, 322
getDependencies 355
getDropEffect
DnDTarget 322, 323
getDynamicX
line/polygon 377, 377
getDynamicY
line/polygon 377, 377
getDynPrimitiveAttr 395
edit 327, 329
getenv 332
getErrorString 357
getFileName 426
getFont 352
ProcSeeReference Manual
Index
getFrameSize
window 489, 495
getInterpolator
TrendPres 474, 478
getInterpolatorX
line/polygon 378
getInterpolatorY
line/polygon 378
getJoinStyle
line/polygon 378
getKeyFocusShape 395
picture 401
getLayer 375
getLine 460
getLinestyle 379
getList 358
getLogBuffer
TrendLog 471, 472
getNumLines 460
getPath
save/document 426
getPattern 394
getPictureFlags 395
picture 402
getpid 360
getPosValue
Scale 427, 429
getPrimitiveAttr 395
edit 327, 328
getRulerTime
TrendPres 474, 477
getRulerValue
TrendPres 474, 477
getScreenSize
window 489, 495
getShapeFlags 433
getShapesWithinCircle 395
picture 400
getStartTime
TimeTag 461, 461
getTransparency
Colour 293
getValue
TrendPres 474, 477
getValuePos
Scale 427, 429
TrendPres 474, 478
getVariableInfo
TrendLog 462
getViewableState 433
getX
line/polygon 377, 377
getY
line/polygon 377, 377
gif
image 81
gotKeyFocus
event 336
gotKeyFocust
event 333
grabPointer 432
window 488, 494
Gradient 361
gradient 361
graphical
image 81
green
Colour 292
gridMajor 395, 397
gridMinor 395, 397
GROUP
window type 492
group 395
body 70
definition 70
edit 327
item 70
rotatingAngle 71
visibility 71
xReference 71
xScaleFactor 71
yReference 71
yScaleFactor 71
H
HashTable 365
function
clear 365
contains 365
get 365
getKeys 365
length 365
put 365
putAll 365
remove 365
toString 365
ProcSeeReference Manual
XI
Index
hasValueChanged 487
height
font 352
RoundRect 420
window 488, 489
help 134, 138, 138, 146, 150, 154
hi
TrendVariable 104
hideProperties
comShape 297
hist
TrendVariable 104, 105
hostname 127
HP 9000/700 161
hpArch 161
link option 162
I
iconify
window 488, 492
id
PfRemoveProcessHandler 243
IdCodes.h 249
identifier 18, 41
library 46
identity
Matrix 385, 387
idMask
PfSetDefinition 249
if
expression 31
statement 31
ignoreWatchdog 423
image 81
bmp 81
filename 82
gif 81
jpg 82
pcx 82
png 82
rotationAngle 82
tga 82
tiff 82
visibility 82
wmf 82
x 82
xReference 82
xScaleFactor 82
XII
xwd 82
y 82
yReference 82
yScaleFactor 82
inclusive or expression 25
increment 22
unary expression 22
initialization
variable 113
initializer 34
instance 72
install.unix
script 6
Instance
function
changeClass 368
classFullName 368
instance 67, 368, 433
body 72
definition 72
initializer 72
item 72
rotatingAngle 72
visibility 72
x 72
xReference 72
xScaleFactor 72
y 72
yReference 72
yScaleFactor 72
integer 18
constant 41, 113
Intel 80x86 162
Interpolator 369
function
add 369
getInterpolator 369
getInValue 369
getOutValue 369
insert 369
maxValueOut 369
minValueOut 369
modifyInterpolator 369
modifyInValue 369
modifyOutValue 369
numPoints 369
remove 369
set 369
ProcSeeReference Manual
Index
value 369
interval
trend attribute 461
TrendLabels 96
inverse
Matrix 385, 387
isAltDown
DnDTarget 322, 323
isConnected
TrendLog 471, 473
isControlDown
DnDTarget 322, 323
isCopy
DnDTarget 322, 323
isDiagonal
Matrix 385, 388
isDisplayed 396
picture 401
isEqual
Matrix 385, 388
isIconic 396
picture 401
window 488, 493
isIdentity
Matrix 385, 387
isInEditMode 396
picture ??–401
text 441
window 488, 493
isLeftButtonDown
DnDTarget 322, 323
isLink
DnDTarget 322, 323
isLowerTriangular
Matrix 385, 388
isMapped 396
picture 401
window 488, 493
isMetaClass
object 393
isMiddleMouseButtonDown
DnDTarget 322, 323
isMove
DnDTarget 322, 323
isNull
Matrix 385, 386
isOrthogonal
Matrix 385, 388
isRightMouseButtonDown
DnDTarget 322, 323
isRunning
TimerAt 447
TimerInterval 450
isShiftDown
DnDTarget 322, 323
isSquare
Matrix 385, 386
isSymmetric
Matrix 385, 388
isTriangular
Matrix 385, 388
isUpperTriangular
Matrix 385, 388
isViewable 396
picture 401
window 488, 493
item
application 44
configuration 44
group 70
instance 72
library 46, 46
picture 68
shape 74
trend 92
TrendLog 100, 102
iteration statement 31
iterator 373
createIterator 373
deleteIterator 373
nextFullName 373
iteratorId 373
J
jpg
image 82
jump
statement 32
K
keyPressed
event 333, 334
keyReleased
event 333, 334
keysym 334
keyword
ProcSeeReference Manual
XIII
Index
pTALK language 17
shape 74
L
labeled statement 29
lastSelectionPicture
event 333, 337
Layer
function
addAlias 374
delAlias 374
getAliases 374
getOriginalName 374
getVisibility 374
isDefault 374
moveBehind 374
setAsDefault 374
setOriginalName 374
setVisibility 374
toBack 374
toFront 374
layer 374
lbearing
font 352
lCycle
TrendVariable 104
legalRulerValue
TrendPres 474, 477
length
Scale 427
lengthMajorTicks
Scale 427
lengthMinorTicks
Scale 427
lib
api 161
library 46
body 46, 53, 56, 67, 85
compiled 47
declaration 44, 47, 47
definition 46, 47
identifier 46
item 46, 46
resource 46
limitsChanged
event 333, 336
Line 376
attribute 376
XIV
function
addPoint 376
get 376
getCapStyle 376
getDynamicX 376
getDynamicY 376
getInterpolatorX 376
getInterpolatorY 376
getJoinStyle 376
getX 376
getY 376
numberOfPoints 376
removePoint 376
set 376
setCapStyle 376
setDynamicX 376
setDynamicY 376
setInterpolatorX 376
setInterpolatorY 376
setJoinStyle 376
setX 376
setY 376
line 83
foregroundColour 83
lineWidth 83
line/polygon 433
get 377
getCapStyle 378
getDynamicX 377, 377
getDynamicY 377, 377
getInterpolatorX 378
getInterpolatorY 378
getJoinStyle 378
getX 377, 377
getY 377, 377
numberOfPoints 377
set 377
setCapStyle 378
setDynamicX 377
setdynamicX 377
setDynamicY 377, 377
setInterpolators 378
setInterpolatorY 378
setJoinStyle 378
setX 377
setY 377
linePattern
rectangle 87, 91
ProcSeeReference Manual
Index
roundRect 88
shape 76
Linestyle 418
linestyle 379
definition 59
lineWidth
line 83
polygon 85
rectangle 87, 91
roundRect 88
shape 76
link 167
-lp3 167
link option
hpArch 162
linuxX86Arch 162
macX86Arch 162
sunArch 162
winArch 162
linuxX86Arch 162
link option 162
List 380
function
add 380
clear 380
concat 380
copy 380
get 380
insert 380
length 380
remove 380
sort 380
toString 380
literal 41
character constant 19, 42
floating constant 20, 42
integer constant 18, 41
string literal 20, 42
lo
TrendVariable 104
load 382
load/display 382, 403, 426, 496
displayPicture 382
load 382
loadDatabase 412
loadOption
printer 405
loadPrinterFiles 405
localtime 445
log 384
log10 384
logDirectory
TrendLog 101
logFrequency
TrendPlot 96
TrendPres 475, 476
logical and expression 25
logical or expression 25
logMode
TrendLog 463, 468
lookup expression 27
lostKeyFocus
event 336
lostKeyFocust
event 333
lower 396
picture 399
window 488
lowerBand
TrendPlot 96
TrendPres 474, 475
lowerLimit
TrendPlot 96
TrendPres 474, 475
M
macX86Arch 162
link option 162
majorTickStepValue
Scale 427
map 396
picture 399
window 488, 492
MarkerSize 152
mask
PfExportWindow 192
PfGetChildren 200
math
abs 384
ceil 384
exp 384
fabs 384
floor 384
log 384
log10 384
pow 384
ProcSeeReference Manual
XV
Index
round 384
roundToInt 384
Matrix 294, 385, 402
add 387
adjoint 387
clear 386
cofactors 387
columns 386
determinant 387
function
add 385
adjoint 385
clear 385
cofactors 385
columns 385
determinant 385
get 385
identity 385
inverse 385
isDiagonal 385
isEqual 385
isIdentity 385
isLowerTriangular 385
isNull 385
isOrthogonal 385
isSquare 385
isSymmetric 385
isTriangular 385
isUpperTriangular 385
multiply 385
rows 385
set 385
subtract 385
trace 385
transpose 385
get 386
identity 387
inverse 387
isDiagonal 388
isEqual 388
isIdentity 387
isLowerTriangular 388
isNull 386
isOrthogonal 388
isSquare 386
isSymmetric 388
isTriangular 388
isUpperTriangular 388
XVI
multiply 387
rows 386
set 386
subtract 387
trace 387
transpose 387
max 390
MAXIMIZE
window decorations 490
window functions 490
maximize
window 488, 492
maxInterpolTime
TrendLog 463, 468
maxRunTimeMessages 423
maxValue
Scale 427
mClass 393
member
object 21
member functions
picture 395
MENU
window decorations 490
window type 492
message 392
category 392
Message format 279
Message Output Formatter 273
metaClass
object 393
metaIsDown 333, 337
MfInitialize 274
MfTMessageOutput 281
min 390
MINIMIZE
window decorations 490
window functions 490
minimize
window 488, 492
minorTickSteps
Scale 427
minValue
Scale 427
mirror
shape 431
mktime 443, 445
day 445
ProcSeeReference Manual
Index
hours 445
minutes 445
month 445
seconds 445
year 445
mode
window 488, 491
modSysKeyBehaviour
window 489, 495
mouseWheel 333, 335
MOVE
window functions 490
move
window 488, 492
moveCursor 396
picture 402
window 489, 494
moveFrame
window 488, 493
moveLeft
text 441, 442
moveRight
text 441, 442
moveRuler
TrendRuler 480
moveSelected 396
picture 400
moveToEnd
text 441, 442
moveToHome
text 441, 442
msecsToday 443
MultiClickTimeout 152
multiplicative expression 23
multiply
Matrix 385, 387
N
name 396
object 393
PfExportWindow 192
picture 399
shape 431
struct 112
window 488, 492
nameOf 353
nameOfFullName
fullName 353
newArray 289
newAttribute 306, 308
newCharArray 289
newCircle 306
newCircleArc 306, 307
newClass 306, 307
newColour 308
newComEventObject 296
newComInterfaceObject 296
newComLibrary 296
newComObject 296
newComShape 296
newDialogue 306, 308
newDialogueArea 306
newDoubleArray 289
newEllipse 306
newEllipseArc 306, 307
newEnum 307, 308
newEnumElement 307, 308
newEventPlot 455, 456
newFloatArray 289
newFunction 306, 308
newGroup 306, 307
newHashTable 365
newImage 306, 307
newInstance 306, 307
newIntArray 289
newLayer 374
newLibrary 307
create 306
newLine 306, 307
newList 380
newLogBuffer
TrendLog 471
newMatrix 386
newName
rename 417
newPicture 307, 308
newPoint 404
newPolygon 306, 307
newProcess 307, 308
newRect 415
newRectangle 306, 329
newRoundRect 306, 307
newScale 306, 307
newShortIntArray 289
newSize 435
newText 306
ProcSeeReference Manual
XVII
Index
newTimeLabel 455, 456
newTrend 306, 307
newTrendGrid 455, 456
newTrendPres 455, 456
newTrendRuler 455, 456
newVariable 306, 308
newWindow 307, 308
nextFullName 359
iterator 373
noArgs
PfRegisterFunction 237
noise 140
NONE
window decorations 490
window functions 490
noOfLines
TrendGrid attribute 459
NORMAL
window type 492
NullId 177, ??–178, 207–??, 213
numberOfPoints 377
line/polygon 377
numberOfSelected 396
edit 327, 329
numBlinkColours
Colour 292
numEventPlot 455, 456
numTimeLabel 455, 456
numTrendGrid 455, 456
numTrendPres 455, 456
numTrendRuler 455, 456
O
Object
function
fullName 393
isMetaClass 393
metaClass 393
name 393
owner 393
object 393
member 21
objectFullName
remove 416
rename 417
save/document 425
offset
EventPlot 339
XVIII
Scale 427
trend attribute 461
TrendLabels 96
OK 177, ??–178, 207–??, 212, 213
olwm
window decoration 496
oneToOne
class 65
picture 69, 395, 397
onUpdate 483
onVariableUpdate 483
openingAngle
circleArc 77, 78
circleSlice 77, 78
operator
assignment 26
comma 27
dynamic 23
unary - 22
unary ! 22
unary @ 23
unary * 22
unary & 22
unary ~ 23
options
Execute 129
ged 130
pcc 145
rtm 149
Timer 154
TrPrint 156
optName 330
orientation
Trend Attribute 96, 455, 457
owner
object 393
ownerOfFullName
fullName 353
P
P3Misc.h 249
p3sim 134, 135, 136, 138
application 134
database 135
process 135
randomCycle 135, 137
rtmName 135
startTime 135
ProcSeeReference Manual
Index
timeTickIntvl 135
timeVariable 135
value 137
p3sim function
const 139
cosine 139
gauss 141
noise 140
predefined 141
probability 141
random 140
sequence 142
sine 140
p3sim options
-? (help) 134
-e <errorLog> 134
-f <simFile> 134
-h <host> 134
-v (verbose mode on) 134
p3simTalk 134, 136, 138
help 138
precision 138
quit 138
randomCycle 138
runPfExecute 139
updatedVariables 138
verbose 138
p3simTalk options
-? (help) 138
-h <host> 138
-p <processName> 138
pan 396
picture 400
window 488, 493
panAbs 455, 456
panFreeze 455, 457
function
Trend 455
panRel 455, 456
parent
window 488, 491
parentFullName 373
parentName 308
paste
clear 327
edit 327
picture 396, 400
window 488, 493
PasteDelta 152
PATH 7
path 166, 167
Pattern 418
pattern 394, 395
body 54
class 65, 68
definition 54
example 509
picture 397
pcc 16, 39, 145, 147, 425
pcc options 145
-? (help) 146
-a (anachronism) 145, 146
-d (debug) 145
-f (filename) 146
-h (directory) 146
-h (help) 146
-h (name) 146
-h (otuput) 146
-m maxMessages 145
-n (no defaults) 145
-o options 145
-s (suppress) 145
-v (verbose) 145
-W numLines 146
pCirArcClass 330
pCircleClass 330
pComShapeClass 330
pcx
image 82
pDiaAreaClass 330
pEllArcClass 330
pEllipseClass 330
persist 146, 150, 382
comObject 299
comShape 298
PfAddField 168, 170, 174, 180, 187, 234
fieldName 170
fieldRecName 170
fieldSize 170
fieldType 170
recName 170
PfAddInput 168, 171, 184, 223, 241, 242
condition 171
fd 171
functionPtr 171
PfAddRtmToCurrent 168, 172
ProcSeeReference Manual
XIX
Index
PfAddVarAction 168, 173, 184, 223, 244
PfBeginRecord 168, 170, 174, 180, 187, 234
recordName 174
PfCAllConditions 206
PfCAllUnselected 214
PfCChar 161
PfCDouble 161
PfCExceptCondition 206
PfCFloat 161
PfCInt 161
PfClearEvents 168, 175
PfCLogBufferAppend 185
PfCLogBufferCancel 185
PfCLogBufferNew 185
PfClose 168, 176, 218, 221
PfCObjectCreated 198
PfCObjectRemoved 198
PfCOneSelected 214
PfCOneUnselected 198, 214
PfCPointer 161
PfCReadCondition 206
PfCreateArray 168, 177, 178, 181, 195, 231,
234
fix 177
NullId 177
recordName 177
size 177
type 177
value 177
varName 177
PfCreateVar 168, 177, 178, 181, 195, 231, 234
NullId 178
type 178
value 178
varName 178
PfCRecord 161
PfCrtmCrash 217, 219
PfCrtmStart 217, 219
PfCrtmStop 217, 219
PfCShapeFinished 214
PfCShapeMoved 214
PfCShortInt 161
PfCUnsignedChar 161
PfCUnsignedInt 161
PfCUnsignedShortInt 161
PfCWriteCondition 206
PfData 168, 179
id 179
XX
PfDeleteRecord 168, 180
recName 180
PfDeleteVar 168, 181
PfDeleteVarId 168, 181
PfDiagnosticsSubscribe 168, 182, 392
PfDiagnosticsSubscribeEx 168, 182
PfDisableInitialUpdate 168, 183
PfDispatch 168, 184, 223
PfEditLogBuffer 168, 185, 196
PfEnableInitialUpdate 168, 183
PfEndLoop 168, 186, 223
PfEndRecord 168, 170, 174, 180, 187, 234
PfEvent 168, 188
PfEvents 168, 188
PfExecute 139, 168, 191
scope 191
sourceCode 191
PfExecuteAsync 168, 191
PfExportWindow 168, 192, 240
displayName 192
mask 192
name 192
win 192
PfFlush 168, 194, 231, 245, 250, 255, 256
PfFlushCreateVar 168, 177, 178, 179, 195,
231, 245
PfFlushEditLogBuffer 168, 185, 196
PfFlushUseFields 168, 197, 231, 245, 256
PfGetChanges 168, 198
func 198
scope 198
PfGetChildren 168, 199, 200, 254, 373
mask 200
PfGetCurrentObject 168, 202, 254
PfGetDefinedVars 168, 203, 225
PfGetDefinition 168, 204, 249, 254
defSize 204
PfGetDiagnosticsMessage 168, 205
PfGetFDSet 168, 206, 223, 227
fdc 206
fds 206
PfGetFieldId 207
fieldName 207
NullId 207
recordId 207
PfGetFuncArg 168, 208
PfGetNumAllRtms 168, 209
PfGetNumCurrentRtms 168, 210
ProcSeeReference Manual
Index
PfGetSystemError 168, 211, 230
PfGetTypeId 168, 212
varId 212
PfGetVarId 168, 213
NullId 213
varName 213
PfGetWindowChanges 168, 193, 214, 331
func 214
winName 214
PfId 168, 172, 179, 207, 213, 215, 224, 231,
259
PfIndex 168, 216
PfInit 168, 217
PfInitialize 168, 172, 175, 176, 219, 220, 222,
226, 248, 253, 259
rtmName 219
usrFuncDisConnect 218, 221
PfIsConnected 168, 222
PfMainLoop 168, 171, 173, 184, 186, 218,
221, 223, 227, 241–244, 252
PfName 168, 224
PfNextVarId 168, 225
PfNonBlocking 168, 226
PfPeriodic 168, 184, 223, 227
PfPrintAllRecords 168, 228
PfPrintAllVars 168, 229
PfPrintSystemError 168, 211, 230
PfPut 168, 194, 197, 207, 231, 246, 255, 256
valuePtr 231
PfPutValue 234
PfQuoteString 168, 233
PfReadScript 168, 234
PfReceiveRtmStringUpdates 168, 235, 236,
236
PfReceiveRtmUpdates 168, 235
PfRegisterFunction 168, 208, 237
arg 237
funcName 237
funcPtr 237
noArgs 237
PfRegisterFunctionEx 168, 208, 237
PfReleaseWindow 168, 193, 240
PfRemoveAllInputs 168, 241, 242
PfRemoveInput 168, 171, 241, 242
condition 242
fd 242
functionPtr 242
PfRemoveProcessHandler 168, 243, 252
id 243
PfRemoveVarAction 168, 173, 244
varId 244
PfSend 168, 194, 197, 231, 245, 255, 256
PfSendApiStringUpdates 168, 247
PfSendToOne 168, 194, 197, 245, 253, 259
PfSetAllRtmsCurrent 168, 248
PfSetDefinition 168, 249
changeMask 249
definition 249
fullName 249
idMask 249
PfSetFlushBehaviour 168, 250
PfSetMaxQuotedStrings 168, 233
PfSetProcessClass 168, 251
PfSetProcessHandler 168, 223, 227, 243, 252
PfSetRtmCurrent 168, 253
Pfsor 168, 199, 201, 254
PfsorDefinitionLength 254
PfsorExtra 254
PfsorFullName 254
PfsorIdMask 254
PfsorLength 254
PfsorSignature 254
PfUnquoteString 168, 233
PfUpdateValuesId 168, 194, 197, 225, 255
PfUseField 168, 197, 231, 231–??, 245, 256
PfWinInit 168, 257
PfWinInitialize 168, 257
PfWithdrawRtmFromCurrent 168, 259
PfXtInit 168, 260
PfXtInitialize 168, 260
Picture 329, 383, 484, 496
attribute
angleSnap 395
backgroundColour 395
crosshairFollowSnap 395
crosshairLength 395
crosshairVisibility 395
foregroundColour 395
gridMajor 395
gridMinor 395
oneToOne 395
pattern 395
radiusSnap 395
resizeMode 395
rotationAngle 395
updateMode 395
ProcSeeReference Manual
XXI
Index
worldHeight 395
worldWidth 395
worldX 395
worldY 395
xReference 395
xScaleFactor 395
xSnap 395
yReference 395
yScaleFactor 395
ySnap 395
function
adjustColours 294, 395
align 327, 395
clear 327, 395
clearKeyFocus 395
copy 327, 395
cut 327, 395
distribute 327, 395
dndActivate 325, 325
dndDeactivate 325, 325
exportEMF 395
freeze 395
fullName 395
getDynPrimitiveAttr 327, 395
getKeyFocusShape 395
getPictureFlags 395
getPrimitiveAttr 327, 395
getShapesWithinCircle 395
group 327, 395
isDisplayed 396
isIconic 396
isInEditMode 396
isMapped 396
isViewable 396
lower 396
map 396
moveCursor 396
moveSelected 396
name 396
numberOfSelected 327, 396
pan 396
paste 327
raise 396
selectAllIn 396
selectShape 396
setCursor 396, 401
setDynPrimitiveAttr 327, 396
setFocus 396
XXII
setPictureFlags 337, 396
setPrimitiveAttr 327, 396
shapeAt 396
shapeFullNameAt 396
sound 396
theWindow 396
title 396
toBack 327, 396
toFront 327, 396
ungroup 327, 396
unmap 396
unmapChildren 396
updatePicture 396
winxy2xy 396
xSnapped 396
xy2dxy 396
xy2sx 396
xy2sy 396
xy2winxy 396
xy2wx 396
xy2wy 396
ySnapped 396
zoom 396
zoomFactor 396
picture 69, 395, 402, 433
adjustColours 402
angleSnap 68, 396
attributes 395
backgroundColour 68, 397
body 68
clearKeyFocusShape 401
crosshairFollowSnap 69, 397
crosshairLength 69, 397
crosshairStyle 69
crosshairVisibility 69, 397
definition 68
exportEMF 402
foregroundColour 68, 397
freeze 402
fullName 399
getKeyFocusShape 401
getPictureFlags 402
getShapesWithinCircle 400
gridMajor 397
gridMinor 397
isDisplayed 401
isIconic 401
isInEditMode ??–401
ProcSeeReference Manual
Index
isMapped 401
isViewable 401
item 68
lower 399
map 399
member functions 395
moveCursor 402
moveSelected 400
name 399
oneToOne 69, 397
pan 400
paste 396, 400
pattern 397
radiusSnap 68, 396
raise 399
resizeMode 69
rotationAngle 69, 397
selectAllIn 401
selectShape 401
setFocus 401
setPictureFlags 402
shapeAt 401
shapeFullNameAt 401
sound 401
theWindow 401
title 400
unmap 399
unmapChildren 399
updateMode 69
updatePicture 402
winxy2xy 402
worldHeight 69, 397, 489
worldWidth 69, 397, 489
worldX 69, 397
worldY 69, 397
xReference 69, 397
xScaleFactor 69, 397
xSnap 68
xSnapped 400
xy2dxy 402
xy2sx 402
xy2sy 402
xy2winxy 402
xy2wx 402
xy2wy 402
yReference 69, 397
yScaleFactor 69, 397
ySnap 68
ySnapped 400
zoom 400
zoomFactor 400
pictureDisplayed
event 333, 336
pictureFlags 70
pictureName 382
pictureUndisplayed
event 333, 336
pImageClass 330
pInstanceClass 330
pLineClass 330
png
image 82
Point 404
attribute
x 404
y 404
function
set 404
point 43
Polygon 376
polygon 85
backgroundFillColour 85
fillPattern 85
foregroundFillColour 85
lineWidth 85
SolidPattern 85
position
text 440, 441
postfix expression 21
postKeyEvent 337
event 334
postMouseButtonEvent 338
event 334
postscript
export 348
pow 384
pPolygonClass 330
PpPop 113
PpPush 113
PpReceiveRtmStringUpdates 114
PpReceiveRtmUpdates 114
PpSendApiStringUpdates 114
precision
p3simTalk 138
pRectangleClass 330
predefined 141
ProcSeeReference Manual
XXIII
Index
presentation
TrendPlot 96
TrendPres 474
presentationFunc
TrendPres 474, 476
primary expression 20
print
printf 407
sprintf 407
printer
definition file 405
loadOption 405
loadPrinterFiles 405
tuning file 348
printerName
exportPostScript 348
printf 90, 191, 392, 407, 439
strformat 407
probability 141
process
body 47
connectToProcess 411
definition 47
disconnectFromProcess 411
loadDatabase 412
p3sim 135
p3sim keyword 135
processFullName 412
processIsConnected 412
processName 411
processNotify 411
status 411
processFullName
process 412
processIsConnected 412
processName
process 411
processNotify 411
ProcSee
Configuration Language 15, 16
editor (ged) 130
Tutorial 9
User’s Guide 9
PROCSEE_DIR 5, 7, 161
pRoundRectClass 330
pScaleClass 330
pTALK 15, 17
code 42
XXIV
comment 18
keyword 17
pTextClass 330
pTrendClass 330
put
text 440, 441
putenv 332
Q
queryInterface 296
comObject 299
comShape 298
QUIT
window functions 490
quit 138
function 154, 266, 268
p3simTalk 138
Timer 155
quoteId 353
R
radius
circle 76
radiusSnap
class 64
picture 68, 395, 396
raise 396
picture 399
window 488, 492
random 140, 413
randomCycle
p3sim 135, 137
p3simTalk 138
rbearing
font 352
readdir 414
recName
PfAddField 170
PfDeleteRecord 180
recordId 187, 207
PfGetFieldId 207
recordName
PfBeginRecord 174
PfCreateArray 177
Rect 415
attribute
height 415
width 415
ProcSeeReference Manual
Index
x 415
y 415
function
set 415
rectangle 87, 88
backgroundFillColour 87
fillPattern 87
foregroundFillColour 87
linePattern 87, 91
lineWidth 87, 91
SolidPattern 87
red
Colour 292
relational expression 24
relBtn 432
remove 309, 383, 416
Colour 292
objectFullName 416
removePoint 377
removeVariable
TrendLog 463, 467, 468
rename 417
newName 417
objectFullName 417
reset
trend 455, 457
RESIZE
window functions 490
resize
window 488, 493
resizeable
comShape 297
RESIZEH
window decorations 490
resizeMode 395
picture 69
resource
library 46
resource style
definition 59
functions 419
ResourceStyle 418
restore
window 488, 492
return
statement 32
rgb
body 52
rotationAngle 395
class 65
group 71
image 82
instance 72
picture 69, 397
shape 75, 431
round 384
RoundRect 420
flags 420
height 420
width 420
x 420
xRadiusCorner 420
y 420
yRadiusCorner 420
attribute
flags 420, 420
height 420, 420
width 420, 420
x 420, 420
xRadiusCorner 420, 420
y 420, 420
yRadiusCorner 420, 420
roundRect
backgroundFillColour 88
fillPattern 88
foregroundFillColour 88
linePattern 88
lineWidth 88
SolidPattern 88
roundToInt 384
rows
Matrix 385, 386
RTM 111
rtm 7, 149, 153, 158, 161, 311, 397
symboltable 249
rtm options 149
-? (help) 150
-c (Constructor and destructor behaviour)
149
-F (No text font scaling) 149
-g (GMT) 149
-h <controlHostName> 149
-L (logfile) 150
-M (Map behaviour) 149
-n <rtmName> 149
ProcSeeReference Manual
XXV
Index
-r <appFile> 149
-t (terminal) 149
-T (Windows terminal options) 151
-v (verbose) 149
rtmName 422
p3sim 135, 135
PfInitialize 219
rtmVersion 422
rulerIsSelected
TrendGrid 97
TrendRuler 97
attribute 480
runPfExecute
p3simTalk 139
S
save 425
TrendLog 463, 468
save/document 403, 425, 496
document 425
getPath 426
objectFullName 425
save 425
setPath 425
Scale 427
getPosValue 427
getValuePos 427
attribute
alignment 428
flags 427, 428
format 427, 428
length 427, 427
lengthMajorTicks 427, 427
lengthMinorTicks 427
lengtMinorTicks 427
majorTickStepValue 427, 427
maxValue 427, 427
minorTickSteps 427, 428
minValue 427, 427
offset 427, 428
theFont 427, 428
function
getPosValue 427, 429
getValuePos 427, 429
scope
PfExecute 191
PfGetChanges 198
XXVI
script
install.unix 6
scroll
Trend Attribute 96, 455
scrollValue
trend 455, 457
searchComments 301
select 432
selectAll
text 441, 442
selectAllIn 396
picture 401
window 489, 494
selection statement 30
selectShape 396
picture 401
window 488, 494
selectWord
text 441, 442
sequence 142
set
line/polygon 377
Matrix 385, 386
setBitmap
DnDSource 319, 320
setCapStyle
line/polygon 378
setComment 301
setConstructorBehaviour 303
setCursor 310
DnDSource 319, 320
picture 396, 401
window 494
setCursorColours 310
setData
DnDSource 319, 319
setDecorations
window 489, 494
setDropEffect
DnDTarget 322, 323
setDynamicX
line/polygon 377, 377
setDynamicY
line/polygon 377, 377
setDynPrimitiveAttr 396
edit 327, 328
setFileName 425
setFocus 396
ProcSeeReference Manual
Index
picture 401
window 489, 494
setFunctions
window 489, 494
setGreyMatrix 294, 294, 402
setInterpolator
TrendPres 474, 478
setInterpolators
line/polygon 378
setInterpolatorY
line/polygon 378
setInterval
TimerInterval 450
setJoinStyle
line/polygon 378
setKeyFocus 433
setLayer 375
setLimitModifier
TrendPres 474, 478
setlocale 446
setLogBuffers
TrendLog 471, 472
setPath
save/document 425
setPictureFlags 396
picture 402
setPrimitiveAttr 308, 396
edit 327, 328
setRGBMatrix 294, 294, 402
setRulerPosition
TrendRuler 480
setScrollModifier
Trend 455, 457
setShapeFlags 432
setStartTime
TimeTag 461, 461
setTextEditorAttributes 440
text 442
setTime
TrendLog 468, 469
setTimeZone 445
setTransparency
Colour 293
setTrigger
TrendLog 471, 472
setX
line/polygon 377
setY
line/polygon 377
Shape 367, 368, 378, 430, 442
attribute
rotationAngle 430
xReference 430
xScaleFactor 430
yReference 430
yScaleFactor 430
function
bHeight 430
bWidth 430
bX 430
bY 430
containsPoint 430
dndActivate 325, 325
dndDeactivate 325, 325
fullName 430
getLayer 374
getShapeFlags 430
getViewableState 430
grabPointer 430
name 430
select 430
setKeyFocus 430
setLayer 374
setShapeFlags 337, 430
shapeCursorX 430
shapeCursorY 430
shapeToBack 430
shapeToFront 430
shxy2xy 430
thePicture 430
unselect 430
updateShape 430
xy2shxy 430
xy2sx 430
xy2sy 430
xy2wx 430
xy2wy 430
shape
backgroundColour 75
backgroundFillColour 75
bHeight 432
body 74
bWidth 432
bX 432
bY 432
containsPoint 432
ProcSeeReference Manual
XXVII
Index
definition 74
EventPlot 339
fillPattern 76
foregroundColour 75
foregroundFillColour 75
fullName 431
getShapeFlags 433
getViewableState 433
grabPointer 432
item 74
keyword 74
linePattern 76
lineWidth 76
mirror 431
name 431
negative scale factor 431
rotationAngle 75, 431
select 432
setKeyFocus 433
setShapeFlags 432
shapeCursorX 432
shapeCursorY 432
shapeToBack 432
shapeToFront 432
shxy2xy 431
thePicture 431
ungrabPointer 432
unselect 432
updateShape 431
visibility 75, 76, 431
xReference 75, 431
xScaleFactor 75, 431
xy2shxy 431
xy2sx 431
xy2sy 431
xy2wx 431
xy2wy 431
yReference 75, 431
yScaleFactor 75, 431
shapeAt 396
picture 401
ShapeClassId 330
pCirArcClass 330
pCircleClass 330
pComShapeClass 330
pDiaAreaClass 330
pEllArcClass 330
pEllipseClass 330
XXVIII
pImageClass 330
pInstanceClass 330
pLineClass 330
pPolygonClass 330
pRectangleClass 330
pRoundRectClass 330
pScaleClass 330
pTextClass 330
pTrendClass 330
shapeCursorX 333, 337, 432, 499
shapeCursorY 333, 337, 432, 499
shapeEntered
event 333, 335
shapeFlags 76
shapeFullNameAt 396
picture 401
window 488, 493
shapeLeft 333, 335
shapeToBack 432
shapeToFront 432
shift expression 24
shiftIsDown
event 333, 337
showProperties
comShape 297
shutdown 434
shxy2xy 431
sin 481
sine 140
Size 435
attribute
height 435
width 435
function
set 435
size
PfCreateArray 177
snap
angle 396
x 396
y 396
snapshotGetComment
TrendLog 471, 473
snapshotGetTime
TrendLog 471, 473
snapshotLoad
TrendLog 471, 473
snapshotSave
ProcSeeReference Manual
Index
TrendLog 471, 473
SolidPattern
polygon 85
rectangle 87
roundRect 88
sound 396
picture 401
window 489, 494
sourceCode
PfExecute 191
sourceName
exportDxf 344
exportPostScript 348
specifier
type 33
sprintf 407
sqrt 436
start
TimerAt 447
TimerInterval 449
startAngle
circleArc 77
circleSlice 77
startTime
p3sim 135
statement 29
assignment 43
break 32
compound 29
continue 32
declaration 32
do 31
expression 29
for 31
if 31
iteration 31
jump 32
labeled 29
return 32
selection 30
switch 30
while 31
status
process 411
status routines 333
stdout 127
stop
TimerAt 447
TimerInterval 450
strcat 437
strcftime 443
strchr 438
strcmp 437
strcpy 437
strdup 438
strEval 342, 343
strfield 438
strformat 407, 438
strftime 445, 446
stricmp 438
string
dynamic 34
literal 20, 42
strcat 437
strchr 438
strcmp 437
strcpy 437
strdup 438
strfield 438
strformat 438
stricmp 438
strlen 437
strlower 438
strnatcmp 438
strnaticmp 438
strncmp 437
strncpy 437
strnicmp 438
strquote 438
strrchr 438
strsplit 438
strstr 437
strtrim 438
strunquote 438
strupper 438
strlen 437
strlower 438
strnatcmp 438
strnaticmp 438
strncmp 437
strncpy 437
strnicmp 438
strquote 438
strrchr 438
strsplit 438
strstr 437
ProcSeeReference Manual
XXIX
Index
strtrim 438
struct
database structure 112
definition 112, 112
field 112
name 112
timeval 227
strunquote 438
strupper 438
subscript
array 21
subtract
Matrix 385, 387
Sun SPARC 162
sunArch 162, 168
link option 162
SWBus 7
switch
expression 30
statement 30
symboltable
rtm 249
system 439
T
tan 481
targetName
ExportDxf 344
exportPostScript 348
Tdoc 16, 112
Text
attribute
alignment 440
format 440
theText 440
function
buffer 441
clearSelection 441
deleteBackward 440, 441
deleteForward 440, 441, 442
edit 441
isInEditMode 441
moveLeft 441, 442
moveRight 441, 442
moveToEnd 441, 442
moveToHome 441, 442
position 440, 441
put 440, 441
XXX
selectAll 441, 442
selectWord 441, 442
textWidth 440, 441
text 89, 433, 440
alignment 89
font 352
format 88, 89, 91
theFont 89, 91
theText 89, 91
textWidth
font 352
text 440, 441
tga
image 82
theComClass
comObject 299
comShape 298
theCursor
window 488, 491
theFont
comShape 297
Scale 427
text 89, 91
trend attribute 461
thePicture
shape 431
window 488, 494
theText
test 89, 91
text 440
theTime
Trend 455, 457
theTitle
window 488, 491
theTrendPres
EventPlot 339
TrendGrid atribute 459
theWindow 396
picture 401
tiff
image 82
time 443, 461
cftime 443, 445
Colour 292
format 443
mktime 445
strcftime 443
strftime 446
ProcSeeReference Manual
Index
trend 456
timeInterval
TrendGrid 97
TrendGrid attribute 459
TimeLabel 458
timeMaster 135
TrendLog 100
timeOffset
TrendGrid 97
TrendGrid attribute 459
Timer 154, 155, 447, 449
quit 155
Timer options 154
-? (help) 154
-a <application> 154
-d <debug> 154
-h <host> 154
-p <process> 154
-r <rtm> 154
-t (tty) 154
-v <verbose> 154
TimerAt 447
function
isRunning 447
start 447
stop 447
TimerInterval 448, 449, 450
function
count 450
isRunning 450
setInterval 450
start 449
stop 450
timespan
Trend 459
Trend Attribute 96, 456
TimeTag
attribute
alignment 461
format 461
interval 461
offset 461
theFont 461
function
getStartTime 461, 461
setStartTime 461, 461
timeTick
TrendLog 469
timeTickIntvl
p3sim 135, 136
TrendLog 100
timeval
struct 227
timeVariable
p3sim 135
TrendLog 100
TITLE
window decorations 490
title 396
picture 400
window 488, 491, 492
toBack 396, 460
edit 327
TrendPres 474, 477
toFront 396, 460
edit 327
TrendPres 474, 477
tolower 451
TOOL
window type 492
topMargin
exportPostScript 406
toString 452
toupper 451
tr 453, 454, 474, 479
TrendPres 478
trace
debug 311
Matrix 385, 387
translateCoordinates
window 489, 495
transpose
Matrix 385, 387
Trend 93, 341, 455, 460, 461, 469, 470, 473,
479, 480
attribute
orientation 96, 455, 457
scroll 96, 455
timespan 96, 456
trLog 96, 456
updateMode 96
body 92
definition 92
function
newEventPlot 455, 456
newTimeLabel 455, 456
ProcSeeReference Manual
XXXI
Index
newTrendGrid 455, 456
newTrendPres 455, 456
newTrendRuler 455, 456
numEventPlot 455, 456
numTimeLabel 455, 456
numTrendGrid 455, 456
numTrendPres 455, 456
numTrendRuler 455, 456
panAbs 455, 456
panFreeze 457
panRel 455, 456
reset 455, 457
scrollValue 455, 457
setScrollModifier 455, 457
theTime 455, 457
time 456
xW2Time 455, 457
xyW2 455
xyW2Time 457
item 92
panAbs 456
timespan 459
tr 453, 454
trTime 453
xyW2Time 480
TrendDiagram 98
TrendGrid 95, 99, 458, 459
attribute
autoStep 459
depthPosition 459
noOfLines 459
rulerIsSelected 97
theTrendPres 459
timeInterval 97, 459
timeOffset 97, 459
body 93
definition 93
function
getLine 460
getNumLines 460
toBack 460
toFront 460
trendGrid 93
TrendLabel 93, 95, 98
attribute 96
alignment 96
format 97
interval 96
XXXII
offset 96
body 92
definition 92
TrendLog 156, 341, 458, 479
attraibute
extLogApp 102
attribute
diskBufferSize 101
diskFlushIntvl 101
diskForceWrite 101
diskLogIntvl 100
eventPlotFile 101
extLogProc 102
extLogRTM 102
logDirectory 101
timeMaster 100
timeTicIntvl 100
timeVariable 100
trendVariableFile 100
body 100, 101
definition 99, 101
function
addVariable 462, 464
analyse 465
appendLogBuffer 471
cancelLogBuffer 471
connectedRTMs 471, 472
document 462, 465
eventTypeHandling 471, 472
execute 471, 473
freeze 462, 466
getLogBuffer 471, 472
getVariableInfo 462
isConnected 471, 473
logMode 463, 468
maxInterpolTime 463, 468
newLogBuffer 471
removeVariable 463, 467, 468
save 463, 468
setLogBuffers 471, 472
setTime 468, 469
setTrigger 471, 472
snapshotGetComment 471, 473
snapshotGetTime 471, 473
snapshotLoad 471, 473
snapshotSave 471, 473
timeTick 469
item 100, 102
ProcSeeReference Manual
Index
mode 469
time 469
TrendLogExternal 470
TrendPlot 93, 98
assignment 92
attribute 96
autoScale 96
logFrequency 96
lowerBand 96
lowerLimit 96
presentation 96
upperBand 96
upperLimit 96
variable 96
body 92
definition 92
TrendPres 454, 458, 469, 470, 473, 474, 480
attribute
autoScale 474, 475
logFrequency 475, 476
lowerBand 474, 475
lowerLimit 474, 475
presentation 474
presentationFunc 474, 476
upperBand 474, 475
upperLimit 474, 475
variable 474, 475, 476
function
getInterpolator 474
getRulerTime 474, 477
getRulerValue 474, 477
getValue 474, 477
getValuePos 474, 478
legalRulerValue 474, 477
setInterpolator 474
setLimitModifier 474, 478
toBack 474, 477
toFront 474, 477
tr 478
getInterpolator 478
setInterpolator 478
TrendRuler 93, 95, 99, 458, 460, 469, 470,
473, 480
attribute
rulerIsSelected 97, 480
body 93
definition 93
function
moveRuler 480
setRulerPosition 480
trendUpdated
event 333, 336
trendvar
body 103
definition 103
trendvarconfig
body 103
definition 103
TrendVariable
attribute
hi 104
hist 104, 105
lCycle 104
lo 104
type 104
TrendVariableFile
TrendLog 100
trig 436
acos 481
asin 481
atan 481
atan2 481
cos 481
sin 481
tan 481
trigger routines 333
trLog
Trend Attribute 96, 456
TrPrint 156, 158
TrPrint options 156
-? (help) 158
-a <appname> 156
-f <fromtime> 157
-h <rtmname> 157
-L <language> 157
-l <loggername> 157
-m <margins> 157
-n <columns> 157
-o <outputfile> 157
-p <printername> 157
-P <processname> 156
-s <papersize> 157
-t <timespan> 157
-v <varname> 157
trTime 453
tuning file
ProcSeeReference Manual
XXXIII
Index
printer 348
Tutorial 9
twm
window decoration 496
type
PfCreateArray 177
PfCreateVar 178
specifier 33
TrendVariable 104
window 488, 491
typeNameOf
fullName 353
U
unary - operator 22
unary ! operator 22
unary @ operator 23
unary * operator 22
unary & operator 22
unary ~ operator 23
unary expression 22
decrement 22
increment 22
ungrabPointer 337, 432
event 334, 494
ungroup 396
edit 327
unmap 396
picture 399
window 488, 492
unmapChildren 396
picture 399
window 488, 492
unquoteId 353
unselect 432
update 194, 485, 486, 489
window 488, 493
updatedVariables
p3simTalk 138
updateMode 395
picture 69
Trend Attribute 96
updatePicture 396
picture 402
window 488, 493
updateResources 485
updateShape 431
updateWindows 485, 486, 489, 496
XXXIV
upperBand
TrendPlot 96
TrendPres 474, 475
upperLimit
TrendPlot 96
TrendPres 474, 475
User’s Guide 9
useResourceStyle 419
usrConnectFunc 226
usrFuncDisConnect
PfInitialize 218, 221
utility program
controlutil 125, 127
uwm
window decoration 496
V
value 142
float constant 43
integer constant 43
p3sim 137
PfCreateArray 177
PfcreateVar 178
pTALK code 43
variable
definition 112, 112
initialization 113
TrendPlot 96
TrendPres 474, 475, 476
VariableNotExist 196
varId
PfGetTypeId 212
PfRemoveVarAction 244
varName
PfCreateArray 177
PfCreateVar 178
PfGetVarId 213
verbose
p3simTalk 138
viewableStateChanged 333
event 335
visibility
attribute 75
group 71
image 82
instance 72
shape 75, 76, 431
Visual Studio
ProcSeeReference Manual
Index
link settings 164
new project 164, 165
preprocessor definition 164
W
while statement 31
width
font 352
RoundRect 420
window 488, 489
win
PfExportWindow 192
winArch 162
link option 162
Window 329, 383, 403, 484, 486, 488
attribute
backgroundColour 488, 489
decorations 488, 489, 490, 494
ALL 490
BORDER 490
MAXIMIZE 490
MENU 490
MINIMIZE 490
NONE 490
RESIZEH 490
TITLE 490
function 490
functions 488, 494
ALL 490
CLOSE 490
MAXIMIZE 490
MINIMIZE 490
MOVE 490
NONE 490
QUIT 490
RESIZE 490
height 488, 489
mode 488, 491
parent 488, 491
theCursor 488, 491
theTitle 488, 491
type 488, 491
GROUP 492
MENU 492
NORMAL 492
TOOL 492
width 488, 489
x 488, 489
y 488, 489
function
adjustVirtualDisplay 489, 495
alwaysOnTop 488, 492
display 488, 493
fullName 488
getFrameSize 489, 495
getScreenSize 489, 495
grabPointer 488, 494
iconify 488, 492
isIconic 488, 493
isInEditMode 488, 493
isMapped 488, 493
isViewable 488, 493
lower 488
map 488, 492
maximize 488, 492
minimize 488, 492
modSysKeyBehaviour 489, 495
move 488, 492
moveCursor 489, 494
moveFrame 488, 493
name 488, 492
pan 488, 493
paste 327, 488, 493
raise 488, 492
resize 488, 493
restore 488, 492
selectAllIn 489, 494
selectShape 488, 494
setCursor 494
setDecorations 489, 494
setFocus 489, 494
setFunctions 489, 494
setWindowFlags 337
shapeFullNameAt 488, 493
sound 489, 494
thePicture 488, 494
title 488, 491, 492
translateCoordinates 489, 495
unmap 488, 492
unmapChildren 488, 492
update 488, 493
updatePicture 488
windowAt 489, 494
xSnapped 488, 493
ySnapped 488, 493
zoom 488, 493
ProcSeeReference Manual
XXXV
Index
zoomFactor 488, 493
window
body 48
definition 48
edit 327
Sim.MainWin 492
updatePicture 493
window decoration
olwm 496
twm 496
uwm 496
windowAt
window 489, 494
windowClose
event 333, 335
windowEntered 335
event 333
windowLeft 335
event 333
windowMapped
event 333, 335
windowMoved
event 333, 335
windowName 308, 382
windowResized
event 333, 335
windowUnmapped
event 333, 335
winName
PfGetWindowChanges 214
winxy2xy 396
picture 402
wmf
image 82
WOpAll 192
WOpAllUnselected 192
WOpAnyStruct 192
WOpBackgroundColor 192
WOpChangeSelected 192
WOpClose 192
WOpColor 192
WOpColorStruct 193
WOpForegroundColor 192
WOpIconify 192
WOpLower 192
WOpMap 192
WOpMove 192
WOpMoveStruct 192
XXXVI
WOpNone 192
WOpOneSelected 192
WOpOneUnselected 192
WOpPattern 192
WOpRaise 192
WOpResize 192
WOpResizeStruct 193
WOpScrollBar 192
WOpScrollBarStruct 193
WOpSelection 192
WOpUnmap 192
WOpZoomPan 192
WOpZoomPanStruct 193
workstation
HP9000/700 161
Intel 80x86 162
SunSPARC 162
worldHeight 395
class 65
picture 69, 397, 489
worldWidth 395
class 65
picture 69, 397, 489
worldX 395
class 64
picture 69, 397
worldY 395
class 65
picture 69, 397
X
x 376
attribute 489
circle 76
image 82
instance 72
Line 376
RoundRect 420
window 488
X resources 7, 131, 152
XBell 403, 496
xHeight
font 352
xMax
exportDxf 344
xRadius
ellipse 79
xRadiusCorner
ProcSeeReference Manual
Index
RoundRect 420
xReference 395
class 65
group 71
image 82
instance 72
picture 69, 397
shape 75, 431
xScaleFactor 395
class 65
group 71
image 82
instance 72
picture 69, 397
shape 75, 431
xSnap 395, 396
class 64
picture 68
xSnapped 396
picture 400
window 488, 493
xW2Time 455, 457
xwd
image 82
xy2dxy 396
picture 402
xy2shxy 431
xy2sx 396, 402, 431
xy2sy 396, 431
picture 402
xy2winxy 396, 402
xy2wx 396, 431
picture 402
xy2wy 396, 431
picture 402
xyConv 497
xyConvX 497
xyConvY 497
xyW2Time 455, 457
Trend 480
RoundRect 420
window 488
yMax
exportDxf 344
yRadius
ellipse 79
yRadiusCorner
RoundRect 420
yReference 395
class 65
group 71
image 82
instance 72
picture 69, 397
shape 75, 431
yScaleFactor 395
class 65
group 71
image 82
instance 72
picture 69, 397
shape 75, 431
ySnap 395, 396
class 64
picture 68
ySnapped 396
picture 400
window 488, 493
Z
zoom 396
picture 400
window 488, 493
zoomFactor 396
picture 400
window 488, 493
Y
y 376
attribute 489
circle 76
image 82
instance 72
Line 376
ProcSeeReference Manual
XXXVII
Index
XXXVIII
ProcSeeReference Manual