Harlequin RIP SDK

Implements a RIP Farm Test Tool as an example usage of the RIP Farm. More...

#include "czmq.h"
#include "testtooliface.h"

Data Structures

struct  KEYBOARD_EVENT_CTXT
 Structure used by keyboard_event(). It is anonymously passed through the test tool reactor. More...
 

Functions

HqBool process_keyboard_cmd (char *cmdline, struct RF_IFACE_CTXT *iface_ctxt, int *waitms)
 Translates lines of keyboard text into rip farm commands by calling the appropriate rf_send_*() libripfarm interface function. More...
 
void keyboard_loop (RELAY_KEYBOARD_CTXT *kbd_ctxt)
 Keyboard commands from stdin are monitored and passed to the test tool reactor via relay_keyboard_string. The test tool reactor will direct the command to process_keyboard_cmd(). More...
 
HqBool relay_keyboard_string (char *str, RELAY_KEYBOARD_CTXT *kbd_ctxt, int *waitms)
 Relays keyboard strings between the keyboard_worker and main UI threads by sending a messages over a ZeroMQ socket to keyboard_event(). More...
 

Variables

HqBool g_reading_script
 Global flag set if reading commands from a script. More...
 

Detailed Description

Implements a RIP Farm Test Tool as an example usage of the RIP Farm.

This header file is private. It declares the interface between the source files of the test tool.

Copyright (C) 2023 Global Graphics Software Ltd. All rights reserved. Global Graphics Software Ltd. Confidential Information.

Function Documentation

◆ keyboard_loop()

void keyboard_loop ( RELAY_KEYBOARD_CTXT kbd_ctxt)

Keyboard commands from stdin are monitored and passed to the test tool reactor via relay_keyboard_string. The test tool reactor will direct the command to process_keyboard_cmd().

This function runs in the keyboard_worker thread.

Parameters
[in]kbd_ctxtAnonymous context for passing to relay_keyboard_string().

◆ process_keyboard_cmd()

HqBool process_keyboard_cmd ( char *  cmdline,
RF_IFACE_CTXT iface_ctxt,
int *  waitms 
)

Translates lines of keyboard text into rip farm commands by calling the appropriate rf_send_*() libripfarm interface function.

Also handles two internal commands to control keyboard_loop(). These two data items will be returned by this function:

  • waitms: intended for scripted input. It's the delay in ms before the next command is accepted. This value will be returned in the waitms param.
  • exit: exits the rip farm test tool. The rip farm will continue to run.

This function runs in the main UI thread.

Parameters
[in]cmdlineThe line of text entered on the keyboard.
[in]iface_ctxtAnonymous context for passing to rf_send_*() functions.
[out]waitmsThe value of the sleep command, if it were found in this cmdline. The value is reset to 0 for all other commands.
Return values
TRUEif the exit command was entered on the cmdline
FALSEotherwise.

◆ relay_keyboard_string()

HqBool relay_keyboard_string ( char *  str,
RELAY_KEYBOARD_CTXT kbd_ctxt,
int *  waitms 
)

Relays keyboard strings between the keyboard_worker and main UI threads by sending a messages over a ZeroMQ socket to keyboard_event().

Waits for a reply from keyboard_event() which contains a keyboard_ack_t struct.

This function runs in the keyboard_worker thread.

Parameters
[in]strThe keyboard string.
[in]kbd_ctxtThe context from keyboard_worker() passed anonymously via keyboard_loop().
[out]waitmsNormally 0. It is the value, in ms, of the delay that keyboard_loop() should wait before accepting the next command.
Return values
TRUENormal return value.
FALSEIFF the response from keyboard_event() is to exit the test tool.

Variable Documentation

◆ g_reading_script

HqBool g_reading_script
extern

Global flag set if reading commands from a script.

This is used to echo the command read, and suppress the UI prompt. NB. Encapsulating this data in non-global data would distract from the example usage of the libripfarm interface.