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.
plot_jobs.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2018 The Earlham Institute
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 /*
17  * plot_jobs.h
18  *
19  * Created on: 1 Oct 2018
20  * Author: billy
21  */
22 
23 #ifndef SERVICES_FIELD_TRIALS_INCLUDE_PLOT_JOBS_H_
24 #define SERVICES_FIELD_TRIALS_INCLUDE_PLOT_JOBS_H_
25 
26 
29 
30 #include "study.h"
31 #include "plot.h"
32 
33 
34 
35 #ifndef DOXYGEN_SHOULD_SKIP_THIS
36 
37 #ifdef ALLOCATE_PLOT_JOB_CONSTANTS
38  #define PLOT_JOB_PREFIX DFW_FIELD_TRIAL_SERVICE_API
39  #define PLOT_JOB_VAL(x) = x
40  #define PLOT_VARIABLE_JOB_STRUCT_VAL(x,y) = { x, y }
41 #else
42  #define PLOT_JOB_PREFIX extern
43  #define PLOT_JOB_VAL(x)
44  #define PLOT_VARIABLE_JOB_STRUCT_VAL(x,y)
45 #endif
46 
47 #endif /* #ifndef DOXYGEN_SHOULD_SKIP_THIS */
48 
49 /*
50  * Study parameters
51  */
52 PLOT_JOB_PREFIX const char *PL_REPLICATE_TITLE_S PLOT_JOB_VAL("Replicate");
53 
54 PLOT_JOB_PREFIX const char *PL_INDEX_TABLE_TITLE_S PLOT_JOB_VAL("Plot ID");
55 
56 PLOT_JOB_PREFIX const char *PL_ACCESSION_TABLE_TITLE_S PLOT_JOB_VAL ("Accession");
57 
58 
59 PLOT_JOB_PREFIX const char *PL_STORE_CODE_TABLE_TITLE_S PLOT_JOB_VAL ("Store Code");
60 
61 
62 PLOT_JOB_PREFIX const char *PL_ROW_TITLE_S PLOT_JOB_VAL("Row");
63 
64 PLOT_JOB_PREFIX const char *PL_COLUMN_TITLE_S PLOT_JOB_VAL ("Column");
65 
66 
67 
68 PLOT_JOB_PREFIX const char * const PL_RACK_TITLE_S PLOT_JOB_VAL ("Rack");
69 
70 PLOT_JOB_PREFIX const char * const PL_GENE_BANK_S PLOT_JOB_VAL ("Gene Bank");
71 
72 
73 PLOT_JOB_PREFIX NamedParameterType PL_PLOT_TABLE PLOT_VARIABLE_JOB_STRUCT_VAL ("PL Upload", PT_JSON_TABLE);
74 
75 
76 PLOT_JOB_PREFIX NamedParameterType PL_ID PLOT_VARIABLE_JOB_STRUCT_VAL("Plot ID", PT_STRING);
77 
78 
79 #ifdef __cplusplus
80 extern "C"
81 {
82 #endif
83 
84 
85 
87 
88 
90 
91 
93 
94 
96 
97 
99 
100 
101 DFW_FIELD_TRIAL_SERVICE_LOCAL Plot *GetPlotByRowColumnRack (const uint32 row, const uint32 column, const uint32 rack, Study *study_p, const ViewFormat format, FieldTrialServiceData *data_p);
102 
103 
104 DFW_FIELD_TRIAL_SERVICE_LOCAL Plot *GetPlotById (bson_oid_t *id_p, Study *study_p, const ViewFormat format, FieldTrialServiceData *data_p);
105 
106 
115 
116 
118 
120 
121 
122 DFW_FIELD_TRIAL_SERVICE_LOCAL json_t *GetPlotsCSVDialect (const char *null_sequence_s);
123 
124 DFW_FIELD_TRIAL_SERVICE_LOCAL json_t *GetPlotAsFrictionlessData (const Plot *plot_p, const Study * const study_p, const FieldTrialServiceData *service_data_p, const char * const null_sequence_s);
125 
126 
127 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddPlotAsFrictionlessData (const Plot *plot_p, json_t *plots_array_p, const Study * const study_p, const FieldTrialServiceData *service_data_p, const char * const null_sequence_s);
128 
130 
131 
133 
134 
135 #ifdef __cplusplus
136 }
137 #endif
138 
139 
140 
141 #endif /* SERVICES_FIELD_TRIALS_INCLUDE_PLOT_JOBS_H_ */
GetSearchPlotParameterTypeForNamedParameter
bool GetSearchPlotParameterTypeForNamedParameter(const char *param_name_s, ParameterType *pt_p)
Plot
Definition: plot.h:84
AddSearchPlotParams
bool AddSearchPlotParams(ServiceData *data_p, ParameterSet *param_set_p)
PLOT_VARIABLE_JOB_STRUCT_VAL
PLOT_JOB_PREFIX NamedParameterType PL_PLOT_TABLE PLOT_VARIABLE_JOB_STRUCT_VAL("PL Upload", PT_JSON_TABLE)
NamedParameterType
This is a datatype that stores a read-only c-style string along with a ParameterType.
Definition: parameter.h:85
GetStudyPlotHeaderAsFrictionlessData
json_t * GetStudyPlotHeaderAsFrictionlessData(const Study *study_p, const FieldTrialServiceData *service_data_p)
ParameterType
ParameterType
The different types that a Parameter can take.
Definition: parameter_type.h:35
study.h
ServiceJob
A datatype to represent a running task.
Definition: service_job.h:72
PT_STRING
A c-style string.
Definition: parameter_type.h:58
DataResource
A datatype representing a URI.
Definition: data_resource.h:40
GetPlotsFrictionlessDataTableSchema
json_t * GetPlotsFrictionlessDataTableSchema(const Study *study_p, const FieldTrialServiceData *service_data_p)
GetPlotsAsFDTabularPackage
json_t * GetPlotsAsFDTabularPackage(const Study *study_p, const FieldTrialServiceData *data_p)
Get the plots as a Frictionless Data Table.
dfw_field_trial_service_library.h
RunForSearchPlotParams
bool RunForSearchPlotParams(FieldTrialServiceData *data_p, ParameterSet *param_set_p, ServiceJob *job_p)
DFW_FIELD_TRIAL_SERVICE_LOCAL
#define DFW_FIELD_TRIAL_SERVICE_LOCAL
Definition: dfw_field_trial_service_library.h:43
AddPlotAsFrictionlessData
bool AddPlotAsFrictionlessData(const Plot *plot_p, json_t *plots_array_p, const Study *const study_p, const FieldTrialServiceData *service_data_p, const char *const null_sequence_s)
GetSubmissionPlotParameterTypeForNamedParameter
bool GetSubmissionPlotParameterTypeForNamedParameter(const char *param_name_s, ParameterType *pt_p)
PT_JSON_TABLE
Tabular data stored as a JSON array where each object is it is a row within the tabular data.
Definition: parameter_type.h:118
GetPlotByRowColumnRack
Plot * GetPlotByRowColumnRack(const uint32 row, const uint32 column, const uint32 rack, Study *study_p, const ViewFormat format, FieldTrialServiceData *data_p)
RunForSubmissionPlotParams
bool RunForSubmissionPlotParams(FieldTrialServiceData *data_p, ParameterSet *param_set_p, ServiceJob *job_p)
GetPlotsCSVDialect
json_t * GetPlotsCSVDialect(const char *null_sequence_s)
dfw_field_trial_service_data.h
AddSubmissionPlotParams
bool AddSubmissionPlotParams(ServiceData *data_p, ParameterSet *param_set_p, DataResource *resource_p)
PLOT_JOB_VAL
const PLOT_JOB_PREFIX char *PL_REPLICATE_TITLE_S PLOT_JOB_VAL("Replicate")
GetPlotAsFrictionlessData
json_t * GetPlotAsFrictionlessData(const Plot *plot_p, const Study *const study_p, const FieldTrialServiceData *service_data_p, const char *const null_sequence_s)
ServiceData
A datatype for holding the configuration data for a Service.
Definition: service.h:126
FieldTrialServiceData
The configuration data used by the DFW Field Trial Service.
Definition: dfw_field_trial_service_data.h:118
ViewFormat
ViewFormat
An indicator of what the output destination is for the JSON data values.
Definition: view_format.h:19
GetPlotById
Plot * GetPlotById(bson_oid_t *id_p, Study *study_p, const ViewFormat format, FieldTrialServiceData *data_p)
ParameterSet
A set of Parameters along with an optional name and description.
Definition: parameter_set.h:46
plot.h
Study
Definition: study.h:182