7#include "AIDASLCMOSC_SERVER.h"
9static int getMoscArguments(JNIEnv* env,
Arguments arguments,
Value value,
char** units,
char** ring,
float* floatValue);
39 if (!$VMS_STATUS_SUCCESS(status =
init(
"AIDA_SLCMOSC",
false))) {
42 printf(
"AIDA-PVA Master Oscillator Provider\n");
57 if (!DPSLCMOSC_ACCESSENABLED()) {
59 "Aida access to Master Oscillator is not currently enabled");
66 status = DPSLCMOSC_MEASMASTEROSC(&meas_abs_freq);
67 if (!SUCCESS(status)) {
116 if (!DPSLCMOSC_ACCESSENABLED()) {
118 "Aida access to Master Oscillator is not currently enabled");
126 int getArgStatus = getMoscArguments(env, arguments, value, &units, &ring, &floatValue);
136 double resulting_abs_freq;
138 status = DPSLCMOSC_SETMASTEROSC(&floatValue, units, ring, &resulting_abs_freq);
140 if (!SUCCESS(status))
165static int getMoscArguments(JNIEnv* env,
Arguments arguments,
Value value,
char** units,
char** ring,
float* floatValue)
167 *units =
"FREQUENCY";
169 if (
avscanf(env, &arguments, &value,
"%f %os %os",
178 if (strcasecmp(*units,
"ENERGY") == 0 && *ring == NULL ) {
180 "Master Oscillator Set Variable requires a RING parameter if the UNITS are ENERGY");
REQUEST_STUB_BOOLEAN REQUEST_STUB_BYTE REQUEST_STUB_SHORT REQUEST_STUB_INTEGER REQUEST_STUB_LONG REQUEST_STUB_FLOAT REQUEST_STUB_STRING REQUEST_STUB_BOOLEAN_ARRAY REQUEST_STUB_BYTE_ARRAY REQUEST_STUB_SHORT_ARRAY REQUEST_STUB_INTEGER_ARRAY REQUEST_STUB_LONG_ARRAY REQUEST_STUB_FLOAT_ARRAY REQUEST_STUB_DOUBLE_ARRAY REQUEST_STUB_STRING_ARRAY SET_STUB_VOID void aidaServiceInit(JNIEnv *env)
Initialise the service.
Table aidaSetValueWithResponse(JNIEnv *env, const char *uri, Arguments arguments, Value value)
Set a value and return a table as a response.
Table aidaRequestTable(JNIEnv *env, const char *uri, Arguments arguments)
Get a table of data.
double aidaRequestDouble(JNIEnv *env, const char *uri, Arguments arguments)
Get a double.
The Header File for the AIDA-PVA Module functions.
#define REQUEST_STUB_BYTE
aidaRequestByte API Stub
#define VERSION(_version)
Use this macro to define the version of the provider.
#define REQUEST_STUB_INTEGER
aidaRequestInteger API Stub
#define REQUEST_STUB_LONG_ARRAY
aidaRequestLongArray API Stub
#define REQUEST_STUB_SHORT
aidaRequestShort API Stub
#define REQUEST_STUB_INTEGER_ARRAY
aidaRequestIntegerArray API Stub
#define SET_STUB_VOID
aidaSetValue API stub
#define REQUEST_STUB_LONG
aidaRequestLong API Stub
#define REQUEST_STUB_STRING
aidaRequestString API Stub
#define REQUEST_STUB_SHORT_ARRAY
aidaRequestShortArray API Stub
#define REQUEST_STUB_BYTE_ARRAY
aidaRequestByteArray API Stub
#define RETURN_NULL_TABLE
Return an empty table response.
#define REQUEST_STUB_BOOLEAN
aidaRequestBoolean API Stub
#define REQUEST_STUB_FLOAT_ARRAY
aidaRequestFloatArray API Stub
#define REQUEST_STUB_DOUBLE_ARRAY
aidaRequestDoubleArray API Stub
#define REQUEST_STUB_BOOLEAN_ARRAY
aidaRequestBooleanArray API Stub
#define REQUEST_STUB_FLOAT
aidaRequestFloat API Stub
#define REQUEST_STUB_STRING_ARRAY
aidaRequestStringArray API stub
#define CONVERT_TO_VMS_FLOAT(_float, _count)
Convert in-place, floating point numbers from ieee to VMS format.
#define CONVERT_FROM_VMS_DOUBLE(_double, _count)
Convert in-place, doubles from VMS to ieee format.
#define SERVER_INITIALISATION_EXCEPTION
Use this string to signal Server Initialisation Exceptions in aidaThrow()
#define UNABLE_TO_SET_DATA_EXCEPTION
Use this string to signal Exceptions when trying to Set Data in aidaThrow()
#define MISSING_REQUIRED_ARGUMENT_EXCEPTION
Use this string to signal Missing Required Argument Exceptions in aidaThrow()
#define ON_EXCEPTION_RETURN_(_r)
Check to see if an exception has been raised, and return the given return value.
#define UNABLE_TO_GET_DATA_EXCEPTION
Use this string to signal Exceptions when trying to Get Data in aidaThrow()
#define TRACK_ALLOCATED_MEMORY
Create tracking variables so that memory can be freed with FREE_MEMORY macro.
#define FREE_MEMORY
Free any allocated memory.
#define TRACK_MEMORY(_ptr)
Register this newly allocated memory so that it will be freed by FREE_MEMORY.
void aidaThrow(JNIEnv *env, vmsstat_t status, char *exception, const char *message)
To log any exceptions and throw back to java.
vmsstat_t init(const char *processName, bool initMessageServices)
Call standalone_init()
void aidaThrowNonOsException(JNIEnv *env, char *exception, const char *message)
To log any non-OS exceptions and throw back to java.
Table tableCreate(JNIEnv *env, int rows, int columns)
Make a Table for return to client.
void tableAddSingleRowDoubleColumn(JNIEnv *env, Table *table, double data, bool ieeeDouble)
Add a double column to a Table with only one row.
int avscanf(JNIEnv *env, Arguments *arguments, Value *value, const char *formatString,...)
ascanf(), avscanf()
An Arguments structure stores all of the arguments passed from the request to the Native Channel Prov...
This special type represents a Value.