The RIP Farm Test Tool is provided as a source code example demonstrating how to use the RIP Farm API. More...
Files | |
file | ripfarmtesttool.c |
Implements a RIP Farm Test Tool as an example usage of the libripfarm interface library. | |
file | ripfarmtesttool.h |
Implements a RIP Farm Test Tool as an example usage of the RIP Farm. | |
file | testtooliface.c |
Implements a RIP Farm Test Tool as an example usage of the RIP Farm. | |
file | testtooliface.h |
Implements a RIP Farm Test Tool as an example usage of the RIP Farm. | |
file | testtoolkeyboard.c |
Implements the RIP Farm Test Tool as an example usage of the RIP Farm. | |
file | testtoolsignals.c |
Implements the RIP Farm Test Tool as an example usage of the RIP Farm. | |
The RIP Farm Test Tool is provided as a source code example demonstrating how to use the RIP Farm API.
The Scalable RIP test tool is an interactive command-based console application that can be used to test the Scalable RIP. It is supplied as buildable source code, so it also provides an example of how to use the libripfarm library for interfacing with the Scalable RIP.
When running a Scalable RIP that the test tool will communicate with, the RIP must be persistent. The simplest way to do this is to specify the -rfin
option to the "clrip" application. If you wish to accept input from hot folders the -H
option can be used instead to specify the hot folder names.
The test tool provides a keyboard interactive and scriptable mechanism to send commands to the RIP Farm, and receive and log replies from the RIP Farm. It can be used to automate testing of RIP Farms, or to debug or explore the RIP Farm API.
The Scalable RIP test tool command line is parsed as a series of space-separated words. Double or single quotation marks can be used to include spaces in a word. Quotation marks can be escaped with a backslash. Each word is terminated by a space or by a newline, so quoted words are joined together if not separated by a space (e.g., "This" "is" is parsed as the single word "This is"). The Scalable RIP test tool commands are:
SpawnBeforeFarmStart
section, and inside that there is an Executable key-value pair, the Scalable RIP executable specified will be run. The global configuration is communicated to the Scalable RIP executable. The SpawnBeforeFarmStart
dictionary may also contain keys WorkingDirectory
and Arguments
. The values of these are a string (for WorkingDirectory
), giving the current directory in which the Scalable RIP executable will be run, and an array of strings giving the arguments passed to the Scalable RIP executable.Send a Job Start message to start a new job on the Scalable RIP. The job ID and job name are mandatory; all other arguments are optional. If an optional argument is specified, all of the arguments up to it must also be specified (and given empty or default values as necessary). The arguments are:
SW/TestConfig
directory. However, it may also be an absolute filename, or a PostScript qualified device name such as %configps%TestConfigName
.Press Enter to print the command summary and prompt again.
The Scalable RIP test tool will print output on the console when certain messages are received from the Scalable RIP. For example, Job Started, Job Completed, and Job Canceling messages will confirm the job information, or report errors such as nonexistent jobs. Raster Deliver and Raster Status Reply will print details of requested raster delivery and status from the raster manager.
The Scalable RIP test tool takes several command-line options, which can be used to affect its operation. It can connect to a Scalable RIP running on another machine, it can read a global configuration file for parameters, and it can read a file of commands to set up repeatable scripted tests. Where possible, the long option names are the same as the Scalable RIP option which performs the same task. The options are:
ripfarm_global.json
global configuration file should be found. If the file is not found, sensible defaults will be used.The following diagram illustrates the architecture of the RIP Farm Test Tool:
Lines of text are received in keyboard_loop() and processed in process_keyboard_cmd(). The former runs in the dedicated keyboard_worker thread, whilst the latter runs in the main UI thread. The implementation of passing data between these threads are in testtoolkeyboard.c.
Lines of text are passed between the threads via relay_keyboard_string() and the test tool reactor.
For each line of text, data is sent back to keyboard_loop() in the reverse direction. This communicates two data items for controlling the UI:
The input is scriptable, as determined by the --script
command line option.
The rf_send_*() functions (e.g., rf_send_job_start()) are sent in response to the appropriate keyboard input. These C functions are part of the libripfarm interface and used to send one of the messages to the rip farm. Some of these are not currently implemented.
These functions have been wrapped within thin functions in testtooliface.c to isolate them from the UI which is implemented in ripfarmtesttool.c and testtoolkeyboard.c.
The rip farm sends reply messages in response to the rf_send_*() functions. Messages from the rip farm are passed to the message_callback() interface function, which is implemented by OEM code, but runs in the DFE interface thread. Since that function should never block, the RIP Farm Test Tool relays the message to process_farm_reply() in the main UI thread where it can be handled at leisure. The messages are relayed between the two via relay_message_callback() and the test tool reactor.
The DFE interface thread is started by calling rf_iface_start().
This handles events from both the keyboard input and the message_callback() function of the libripfarm interface. Events from both of these sources are sent to the test tool reactor by messages which are dealt with in testtoolsignals.c.
The test tool reactor runs in the main UI thread.
process_farm_reply() handles the messages emitted by the farm. The RIP Farm Test Tool uses the rf_extract_*() functions from the libripfarm interface which return a specialised C structure for each message. The RIP Farm Test Tool just prints the content of most of these messages to standard output.
Some of these messages are not currently implemented.
The RIP Farm Test Tool is implemented in several C files, with header files connecting them.
The main entry point file ripfarmtesttool.c performs the argument parsing, startup, and the functions that run in the main command window UI thread. This includes parsing commands, sending requests to the RIP Farm, and processing replies from the RIP Farm to print them to the output. Global Graphics expects that your RIP Farm applications will need to start reactores, send commands, and process replies, but the other functions provided by this file are not relevant.
The file testtooliface.c implements interactions with the libripfarm library. Global Graphics expects that this file would be largely copied in your application. The interactions with the RIP Farm API should be handled by a dedicated thread, handing off messages to other threads so it does not block for any significant duration.
The file testtoolsignals.c implements the inter-thread messaging between the DFE interface, UI threads, and keyboard commands. Global Graphics expects that the contents of the functions in this file would be completely replaced in your applications using a inter-thread communications and a reactor that fits with a framework library used by your application.
The file testtoolkeyboard.c implements the keyboard reader and inter-thread messaging between the keyboard reader and the UI thread. Global Graphics expects that the functions in this file would not be directly relevant to your application, however if you have other sources of input to your DFE application (e.g., a GUI), the general pattern of running a separate thread and messaging the main UI reactor is relevant and may be copied.