Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
The Field Trials Service Module
Collaboration diagram for The Field Trials Service Module:

Modules

 Programme
 The datatype representing a Programme of Field Trials and Studies.
 

Data Structures

struct  Crop
 
struct  FieldTrialServiceData
 The configuration data used by the DFW Field Trial Service. More...
 
struct  FieldTrial
 A datatype that represents a Field Trial that can contain one or more Studies. More...
 
struct  FieldTrialNode
 A datatype for storing a Field Trial on a list. More...
 
struct  Observation
 A datatype for storing a phneotypic observation within an experiment. More...
 
struct  TreatmentFactor
 A TreatmentFactor is a set of values for a Treatment applied to plots within a Study. More...
 

Functions

ServicesArrayGetServices (User *user_p, GrassrootsServer *grassroots_p)
 Get the Service available for running the DFW Field Trial Service. More...
 
void ReleaseServices (ServicesArray *services_p)
 Free the ServicesArray and its associated DFW Field Trial Service. More...
 
const DFW_FIELD_TRIAL_PREFIX char *DFT_PROGRAM_S DFW_FIELD_TRIAL_VAL ("Programs")
 The key for specifying the object containing the fields data. More...
 
const DFW_FIELD_TRIAL_PREFIX char *DFT_FIELD_TRIALS_S DFW_FIELD_TRIAL_VAL ("FieldTrials")
 The key for specifying the object containing the fields data. More...
 
const DFW_FIELD_TRIAL_PREFIX char *DFT_STUDIES_S DFW_FIELD_TRIAL_VAL ("Studies")
 The key for specifying the object containing the experimental area data. More...
 
const DFW_FIELD_TRIAL_PREFIX char *DFT_LOCATION_S DFW_FIELD_TRIAL_VAL ("Locations")
 The key for specifying the object containing the location data. More...
 
const DFW_FIELD_TRIAL_PREFIX char *DFT_PLOT_S DFW_FIELD_TRIAL_VAL ("Plots")
 The key for specifying the object containing the plot data. More...
 
const DFW_FIELD_TRIAL_PREFIX char *DFT_DRILLING_S DFW_FIELD_TRIAL_VAL ("Drillings")
 The key for specifying the object containing the drilling data. More...
 
const DFW_FIELD_TRIAL_PREFIX char *DFT_MATERIAL_S DFW_FIELD_TRIAL_VAL ("Materials")
 The key for specifying the object containing the materials data. More...
 
const DFW_FIELD_TRIAL_PREFIX char *DFT_PHENOTYPE_S DFW_FIELD_TRIAL_VAL ("Phenotypes")
 The key for specifying the object containing the phenotype data. More...
 
const DFW_FIELD_TRIAL_PREFIX char *DFT_OBSERVATION_S DFW_FIELD_TRIAL_VAL ("Observations")
 The key for specifying the object containing the observation data. More...
 
const DFW_FIELD_TRIAL_PREFIX char *DFT_INSTRUMENT_S DFW_FIELD_TRIAL_VAL ("Instruments")
 The key for specifying the object containing the instruments. More...
 
const DFW_FIELD_TRIAL_PREFIX char *DFT_GENE_BANK_S DFW_FIELD_TRIAL_VAL ("GeneBanks")
 The key for specifying the object containing the Gene Banks. More...
 
const DFW_FIELD_TRIAL_PREFIX char *DFT_CROP_S DFW_FIELD_TRIAL_VAL ("Crops")
 The key for specifying the object containing the rows within the plots. More...
 
const DFW_FIELD_TRIAL_PREFIX char *DFT_TREATMENT_S DFW_FIELD_TRIAL_VAL ("Treatments")
 The key for specifying the object containing the treatments. More...
 
const DFW_FIELD_TRIAL_PREFIX char *DFT_SELECTED_S DFW_FIELD_TRIAL_VAL ("selected")
 The key for specifying whether a particular object in a JSON tree is selected, e.g. More...
 
void FreeFieldTrial (FieldTrial *trial_p)
 Free a given FieldTrial. More...
 
bool RemoveFieldTrialStudy (FieldTrial *trial_p, struct Study *study_p)
 Remove a Study from a given FieldTrial. More...
 
uint32 GetNumberOfFieldTrialStudies (const FieldTrial *trial_p)
 Get the number of Studies in a given FieldTrial. More...
 
void FreeObservation (Observation *observation_p)
 Free an Observation. More...
 
void ClearObservation (Observation *observation_p)
 Clear the data stored within an Observation. More...
 
ObservationNodeAllocateObservationNode (Observation *observation_p)
 Allocate an ObservationNode for a given Observation. More...
 
void FreeObservationNode (ListItem *node_p)
 Free an ObservationNode. More...
 
bool AreObservationsMatching (const Observation *observation_0_p, const Observation *observation_1_p)
 Test whether two Observations are the same in terms of phenotypes, dates and observation indexes. More...
 
bool SetNumericObservationRawValue (NumericObservation *observation_p, const double64 *value_p)
 Set the raw value for a given Observation. More...
 
bool SetNumericObservationCorrectedValue (NumericObservation *observation_p, const double64 *value_p)
 Set the corrected value for a given Observation. More...
 
bool SetStringObservationRawValue (StringObservation *observation_p, const char *value_s)
 Set the raw value for a given Observation. More...
 
bool SetStringObservationCorrectedValue (StringObservation *observation_p, const char *value_s)
 Set the corrected value for a given Observation. More...
 
bool SetStringObservationCorrectedValueFromJSON (StringObservation *observation_p, const json_t *value_p)
 Set the corrected value for a given Observation. More...
 

Detailed Description

Function Documentation

◆ GetServices()

ServicesArray* GetServices ( User user_p,
GrassrootsServer grassroots_p 
)

Get the Service available for running the DFW Field Trial Service.

Parameters
user_pThe User for the user trying to access the services. This can be NULL.
Returns
The ServicesArray containing the DFW Field Trial Service. or NULL upon error.

◆ ReleaseServices()

void ReleaseServices ( ServicesArray services_p)

Free the ServicesArray and its associated DFW Field Trial Service.

Parameters
services_pThe ServicesArray to free.

◆ DFW_FIELD_TRIAL_VAL() [1/14]

const DFW_FIELD_TRIAL_PREFIX char* DFT_PROGRAM_S DFW_FIELD_TRIAL_VAL ( "Programs"  )

The key for specifying the object containing the fields data.

◆ DFW_FIELD_TRIAL_VAL() [2/14]

const DFW_FIELD_TRIAL_PREFIX char* DFT_FIELD_TRIALS_S DFW_FIELD_TRIAL_VAL ( "FieldTrials"  )

The key for specifying the object containing the fields data.

◆ DFW_FIELD_TRIAL_VAL() [3/14]

const DFW_FIELD_TRIAL_PREFIX char* DFT_STUDIES_S DFW_FIELD_TRIAL_VAL ( "Studies"  )

The key for specifying the object containing the experimental area data.

◆ DFW_FIELD_TRIAL_VAL() [4/14]

const DFW_FIELD_TRIAL_PREFIX char* DFT_LOCATION_S DFW_FIELD_TRIAL_VAL ( "Locations"  )

The key for specifying the object containing the location data.

◆ DFW_FIELD_TRIAL_VAL() [5/14]

const DFW_FIELD_TRIAL_PREFIX char* DFT_PLOT_S DFW_FIELD_TRIAL_VAL ( "Plots"  )

The key for specifying the object containing the plot data.

◆ DFW_FIELD_TRIAL_VAL() [6/14]

const DFW_FIELD_TRIAL_PREFIX char* DFT_DRILLING_S DFW_FIELD_TRIAL_VAL ( "Drillings"  )

The key for specifying the object containing the drilling data.

◆ DFW_FIELD_TRIAL_VAL() [7/14]

const DFW_FIELD_TRIAL_PREFIX char* DFT_MATERIAL_S DFW_FIELD_TRIAL_VAL ( "Materials"  )

The key for specifying the object containing the materials data.

◆ DFW_FIELD_TRIAL_VAL() [8/14]

const DFW_FIELD_TRIAL_PREFIX char* DFT_PHENOTYPE_S DFW_FIELD_TRIAL_VAL ( "Phenotypes"  )

The key for specifying the object containing the phenotype data.

◆ DFW_FIELD_TRIAL_VAL() [9/14]

const DFW_FIELD_TRIAL_PREFIX char* DFT_OBSERVATION_S DFW_FIELD_TRIAL_VAL ( "Observations"  )

The key for specifying the object containing the observation data.

◆ DFW_FIELD_TRIAL_VAL() [10/14]

const DFW_FIELD_TRIAL_PREFIX char* DFT_INSTRUMENT_S DFW_FIELD_TRIAL_VAL ( "Instruments"  )

The key for specifying the object containing the instruments.

◆ DFW_FIELD_TRIAL_VAL() [11/14]

const DFW_FIELD_TRIAL_PREFIX char* DFT_GENE_BANK_S DFW_FIELD_TRIAL_VAL ( "GeneBanks"  )

The key for specifying the object containing the Gene Banks.

◆ DFW_FIELD_TRIAL_VAL() [12/14]

const DFW_FIELD_TRIAL_PREFIX char* DFT_CROP_S DFW_FIELD_TRIAL_VAL ( "Crops"  )

The key for specifying the object containing the rows within the plots.

The key for specifying the object containing the crops.

◆ DFW_FIELD_TRIAL_VAL() [13/14]

const DFW_FIELD_TRIAL_PREFIX char* DFT_TREATMENT_S DFW_FIELD_TRIAL_VAL ( "Treatments"  )

The key for specifying the object containing the treatments.

◆ DFW_FIELD_TRIAL_VAL() [14/14]

const DFW_FIELD_TRIAL_PREFIX char* DFT_SELECTED_S DFW_FIELD_TRIAL_VAL ( "selected"  )

The key for specifying whether a particular object in a JSON tree is selected, e.g.

matched a search.

◆ FreeFieldTrial()

void FreeFieldTrial ( FieldTrial trial_p)

Free a given FieldTrial.

Parameters
trial_pThe FieldTrial to free.

◆ RemoveFieldTrialStudy()

bool RemoveFieldTrialStudy ( FieldTrial trial_p,
struct Study study_p 
)

Remove a Study from a given FieldTrial.

Parameters
trial_pThe FieldTrial to remove the Study from.
study_pThe Study to remove.
Returns
true if the Study was removed from the FieldTrial, code>false if the Study was not on the list of Studies belonging to the given FieldTrial.

◆ GetNumberOfFieldTrialStudies()

uint32 GetNumberOfFieldTrialStudies ( const FieldTrial trial_p)

Get the number of Studies in a given FieldTrial.

Parameters
trial_pThe FieldTrial to get the number of Studies for.
Returns
The number of Studies.

◆ FreeObservation()

void FreeObservation ( Observation observation_p)

Free an Observation.

Parameters
observation_pThe Observation to free.

◆ ClearObservation()

void ClearObservation ( Observation observation_p)

Clear the data stored within an Observation.

Parameters
observation_pThe Observation to clear.

◆ AllocateObservationNode()

ObservationNode* AllocateObservationNode ( Observation observation_p)

Allocate an ObservationNode for a given Observation.

Parameters
observation_pThe Observation that will be stored upon the newly-allocated ObservationNode.
Returns
The newly-allocated ObservationNode or NULL upon error.

◆ FreeObservationNode()

void FreeObservationNode ( ListItem node_p)

Free an ObservationNode.

Parameters
node_pThe ObservationNode to free. This will also call FreeObservation() on the ObservationNode's Observation too.

◆ AreObservationsMatching()

bool AreObservationsMatching ( const Observation observation_0_p,
const Observation observation_1_p 
)

Test whether two Observations are the same in terms of phenotypes, dates and observation indexes.

Parameters
observation_0_pThe first Observation.
observation_1_pThe second Observation.
Returns
true if the Observations match, false otherwise.

◆ SetNumericObservationRawValue()

bool SetNumericObservationRawValue ( NumericObservation observation_p,
const double64 *  value_p 
)

Set the raw value for a given Observation.

The value is deep-copied to the Observation so the value passed in can be freed without causing any memory corruption.

Parameters
observation_pThe Observation that will have its raw value updated.
value_pThe new raw value to store, this can be NULL which will clear the Observation's existing raw value if it has been previously set.
Returns
true if the Observation's raw value was updated successfully, false if there errors.

◆ SetNumericObservationCorrectedValue()

bool SetNumericObservationCorrectedValue ( NumericObservation observation_p,
const double64 *  value_p 
)

Set the corrected value for a given Observation.

The value is deep-copied to the Observation so the value passed in can be freed without causing any memory corruption.

Parameters
observation_pThe Observation that will have its corrected value updated.
value_pThe new corrected value to store, this can be NULL which will clear the Observation's existing corrected value if it has been previously set.
Returns
true if the Observation's corrected value was updated successfully, false if there errors.

◆ SetStringObservationRawValue()

bool SetStringObservationRawValue ( StringObservation observation_p,
const char *  value_s 
)

Set the raw value for a given Observation.

The value is deep-copied to the Observation so the value passed in can be freed without causing any memory corruption.

Parameters
observation_pThe Observation that will have its raw value updated.
value_sThe new raw value to store, this can be NULL which will clear the Observation's existing raw value if it has been previously set.
Returns
true if the Observation's raw value was updated successfully, false if there errors.

◆ SetStringObservationCorrectedValue()

bool SetStringObservationCorrectedValue ( StringObservation observation_p,
const char *  value_s 
)

Set the corrected value for a given Observation.

The value is deep-copied to the Observation so the value passed in can be freed without causing any memory corruption.

Parameters
observation_pThe Observation that will have its corrected value updated.
value_sThe new corrected value to store, this can be NULL which will clear the Observation's existing corrected value if it has been previously set.
Returns
true if the Observation's corrected value was updated successfully, false if there errors.

◆ SetStringObservationCorrectedValueFromJSON()

bool SetStringObservationCorrectedValueFromJSON ( StringObservation observation_p,
const json_t *  value_p 
)

Set the corrected value for a given Observation.

The value is deep-copied to the Observation so the value passed in can be freed without causing any memory corruption.

Parameters
observation_pThe Observation that will have its corrected value updated.
value_sThe new corrected value to store, this can be NULL which will clear the Observation's existing corrected value if it has been previously set.
Returns
true if the Observation's corrected value was updated successfully, false if there errors.