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... | |
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.
Copyright (C) 2023 Global Graphics Software Ltd. All rights reserved. Global Graphics Software Ltd. Confidential Information.
|
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.
[in] | args | Anonymously contains the farm_reply_ctxt that was passed to rf_iface_start(). |
[in] | farm_reply | A message sent by the rip farm. |
TRUE | Normal value. Does not guarantee that farm_reply will be successfully processed by process_farm_reply(). |
FALSE | A catastrophic error was detected. Will result in shutting down the libripfarm interface. |
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.
[in] | farm_reply | A message from the rip farm for processing. |
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
[in] | cfg_dir | If 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_str | If present, contains the IP address of the rip farm's central blade. If not present, the localhost will be assumed. |
TRUE | If the test tool exited normally after the exit command was entered. |
FALSE | If the test tool exited for any other reason. |