Harlequin RIP SDK

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

#include "std.h"
#include "jansson.h"
#include "rf_library.h"
#include "rf_mem.h"
#include "testtooliface.h"

Functions

HqBool send_farm_start (RF_IFACE_CTXT *iface_ctxt)
 A veneer of rf_send_farm_start(). Send a Farm Start message to the rip farm. More...
 
HqBool send_farm_stop (RF_IFACE_CTXT *iface_ctxt)
 A veneer of rf_send_farm_stop(). Send a Farm Stop message to the rip farm. More...
 
HqBool send_job_start (RF_IFACE_CTXT *iface_ctxt, int job_id, const char *filename, const char *setupname, const char *overrideps, int priority)
 A veneer of rf_send_job_start(). Send a Job Start message to the rip farm. More...
 
HqBool send_job_cancel (RF_IFACE_CTXT *iface_ctxt, int job_id)
 A veneer of rf_send_job_cancel(). Send a Job Cancel message to the rip farm. More...
 
HqBool send_job_pause (RF_IFACE_CTXT *iface_ctxt, int job_id)
 A veneer of rf_send_job_pause(). Send a Job Pause message to the rip farm. More...
 
HqBool send_job_resume (RF_IFACE_CTXT *iface_ctxt, int job_id)
 A veneer of rf_send_job_resume(). Send a Job Resume message to the rip farm. More...
 
HqBool send_job_status_request (RF_IFACE_CTXT *iface_ctxt, int job_id)
 A veneer of rf_send_job_status_request(). Send a Job Status message to the rip farm. More...
 
HqBool send_raster_status_request (RF_IFACE_CTXT *iface_ctxt, int job_id, RF_RASTERS_STATE page_state)
 A veneer of rf_send_raster_status_request(). Send a Raster Status message to the rip farm. More...
 
HqBool send_raster_request (RF_IFACE_CTXT *iface_ctxt, int connection_id, int job_id, int page_count)
 A veneer of rf_send_raster_request(). Send a Raster Request message to the rip farm. More...
 
HqBool send_rasters_handled (RF_IFACE_CTXT *iface_ctxt, int connection_id, int job_id, int page_count)
 A veneer of rf_send_rasters_handled(). Send a Rasters Handled message to the rip farm. More...
 
HqBool send_rip_status_request (RF_IFACE_CTXT *iface_ctxt)
 A veneer of rf_send_rip_status_request(). Send a Rip Status Request message to the rip farm. More...
 
HqBool send_raster_connect (RF_IFACE_CTXT *iface_ctxt, const char *name)
 A veneer of rf_send_raster_connect(). Send a Raster Connect message to the rip farm. More...
 
HqBool send_raster_disconnect (RF_IFACE_CTXT *iface_ctxt, int connection_id)
 A veneer of rf_send_raster_disconnect(). Send a Raster Disconnect message to the rip farm. More...
 
HqBool send_blade_status_request (RF_IFACE_CTXT *iface_ctxt)
 A veneer of rf_send_blade_status_request(). Send a Blade Status Request message to the rip farm. More...
 
HqBool send_blade_stop (RF_IFACE_CTXT *iface_ctxt, int blade_id, HqBool stop_controller, HqBool force)
 A veneer of rf_send_blade_stop(). Send a Blade Stop message to the rip farm. More...
 
static HqBool message_callback (void *args, RF_FARM_REPLY farm_reply)
 Called directly by the libripfarm interface when the RIP farm sends a message. More...
 
void process_farm_reply (RF_FARM_REPLY *farm_reply)
 Handles messages from the farm, which have been relayed via message_callback(). More...
 
HqBool set_alloc_funcs (rf_alloc_t alloc_fn, rf_free_t free_fn)
 A veneer of rf_set_alloc_funcs(). Set the allocation and deallocation functions for the library to use. If this function is not called the system will default to using malloc and free. More...
 
HqBool testtool_run (const char *cfg_dir, const char *bcip_str)
 Start the libripfarm interface and run the application's reactor. Stop the libripfarm interface when the application exits. More...
 

Detailed Description

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

This file shows the direct interactions with the libripfarm interface library.

Refer to the design notes and data flow diagrams in ripfarmtesttool.c.

  1. It is intended that the contents of this file may be used largely as boilerplate in customer applications. Building an application on top of this file should be straightforward.
  2. The UI components of the test tool are implemented in ripfarmtesttool.c and testtoolkeyboard.c. Customer applications will most likely completely replace the simple UI of these files.
  3. In addition, the inter-thread comms between the DFE Interface and UI threads are implemented in testtoolsignals.c, along with the test tool reactor. Both of these things are expected to be replaced to fit with the inter-thread comms used by the UI framework of the application.

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

Function Documentation

◆ message_callback()

static HqBool message_callback ( void *  args,
RF_FARM_REPLY  farm_reply 
)
static

Called directly by the libripfarm interface when the RIP farm sends a message.

Relay the message received from the farm back to process_farm_reply() in the main UI thread via relay_message_callback().

Ownership of farm_reply->payload eventually passes to process_farm_reply(). So rf_free_payload() must be called there, or by this function on error.

This function runs in the DFE Interface thread.

Parameters
[in]argsAnonymously contains the farm_reply_ctxt that was passed to rf_iface_start().
[in]farm_replyA message sent by the rip farm.
Return values
TRUENormal value. Does not guarantee that farm_reply will be successfully processed by process_farm_reply().
FALSEA catastrophic error was detected. Will result in shutting down the libripfarm interface.

◆ process_farm_reply()

void process_farm_reply ( RF_FARM_REPLY farm_reply)

Handles messages from the farm, which have been relayed via message_callback().

For each message type, there is a callout to the process_*() functions which have been layered to provide application specific behaviour and to retain the direct interactions with the libripfarm in simple functions.

This function takes ownership of farm_reply->payload, so it must destroy it by calling rf_free_payload().

This function runs in the main UI thread.

Parameters
[in]farm_replyA message from the rip farm for processing.

◆ send_blade_status_request()

HqBool send_blade_status_request ( RF_IFACE_CTXT iface_ctxt)

A veneer of rf_send_blade_status_request(). Send a Blade Status Request message to the rip farm.

This function runs in the UI thread.

◆ send_blade_stop()

HqBool send_blade_stop ( RF_IFACE_CTXT iface_ctxt,
int  blade_id,
HqBool  stop_controller,
HqBool  force 
)

A veneer of rf_send_blade_stop(). Send a Blade Stop message to the rip farm.

This function runs in the UI thread.

◆ send_farm_start()

HqBool send_farm_start ( RF_IFACE_CTXT iface_ctxt)

A veneer of rf_send_farm_start(). Send a Farm Start message to the rip farm.

This function runs in the UI thread.

◆ send_farm_stop()

HqBool send_farm_stop ( RF_IFACE_CTXT iface_ctxt)

A veneer of rf_send_farm_stop(). Send a Farm Stop message to the rip farm.

This function runs in the UI thread.

◆ send_job_cancel()

HqBool send_job_cancel ( RF_IFACE_CTXT iface_ctxt,
int  job_id 
)

A veneer of rf_send_job_cancel(). Send a Job Cancel message to the rip farm.

This function runs in the UI thread.

◆ send_job_pause()

HqBool send_job_pause ( RF_IFACE_CTXT iface_ctxt,
int  job_id 
)

A veneer of rf_send_job_pause(). Send a Job Pause message to the rip farm.

This function runs in the UI thread.

◆ send_job_resume()

HqBool send_job_resume ( RF_IFACE_CTXT iface_ctxt,
int  job_id 
)

A veneer of rf_send_job_resume(). Send a Job Resume message to the rip farm.

This function runs in the UI thread.

◆ send_job_start()

HqBool send_job_start ( RF_IFACE_CTXT iface_ctxt,
int  job_id,
const char *  filename,
const char *  setupname,
const char *  overrideps,
int  priority 
)

A veneer of rf_send_job_start(). Send a Job Start message to the rip farm.

This function runs in the UI thread.

◆ send_job_status_request()

HqBool send_job_status_request ( RF_IFACE_CTXT iface_ctxt,
int  job_id 
)

A veneer of rf_send_job_status_request(). Send a Job Status message to the rip farm.

This function runs in the UI thread.

◆ send_raster_connect()

HqBool send_raster_connect ( RF_IFACE_CTXT iface_ctxt,
const char *  name 
)

A veneer of rf_send_raster_connect(). Send a Raster Connect message to the rip farm.

This function runs in the UI thread.

◆ send_raster_disconnect()

HqBool send_raster_disconnect ( RF_IFACE_CTXT iface_ctxt,
int  connection_id 
)

A veneer of rf_send_raster_disconnect(). Send a Raster Disconnect message to the rip farm.

This function runs in the UI thread.

◆ send_raster_request()

HqBool send_raster_request ( RF_IFACE_CTXT iface_ctxt,
int  connection_id,
int  job_id,
int  page_count 
)

A veneer of rf_send_raster_request(). Send a Raster Request message to the rip farm.

This function runs in the UI thread.

◆ send_raster_status_request()

HqBool send_raster_status_request ( RF_IFACE_CTXT iface_ctxt,
int  job_id,
RF_RASTERS_STATE  page_state 
)

A veneer of rf_send_raster_status_request(). Send a Raster Status message to the rip farm.

This function runs in the UI thread.

◆ send_rasters_handled()

HqBool send_rasters_handled ( RF_IFACE_CTXT iface_ctxt,
int  connection_id,
int  job_id,
int  page_count 
)

A veneer of rf_send_rasters_handled(). Send a Rasters Handled message to the rip farm.

This function runs in the UI thread.

◆ send_rip_status_request()

HqBool send_rip_status_request ( RF_IFACE_CTXT iface_ctxt)

A veneer of rf_send_rip_status_request(). Send a Rip Status Request message to the rip farm.

This function runs in the UI thread.

◆ set_alloc_funcs()

HqBool set_alloc_funcs ( rf_alloc_t  alloc_fn,
rf_free_t  free_fn 
)

A veneer of rf_set_alloc_funcs(). Set the allocation and deallocation functions for the library to use. If this function is not called the system will default to using malloc and free.

This function runs in the main UI thread.

Note
This should be called before any other functions from the library.

◆ testtool_run()

HqBool testtool_run ( const char *  cfg_dir,
const char *  bcip_str 
)

Start the libripfarm interface and run the application's reactor. Stop the libripfarm interface when the application exits.

This function runs in the main UI thread.

Parameters
[in]cfg_dirIf present, contains the directory of the rip farm's global config file. If not present, the global config file is assumed to be in the current working directory. If not found there, default params will be assumed.
[in]bcip_strIf present, contains the IP address of the rip farm's central blade. If not present, the localhost will be assumed.
Return values
TRUEIf the test tool exited normally after the exit command was entered.
FALSEIf the test tool exited for any other reason.