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.
treatment_factor_jobs.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2020 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  * treatment_factor_jobs.h
18  *
19  * Created on: 7 Dec 2020
20  * Author: billy
21  */
22 
23 #ifndef SERVICES_FIELD_TRIALS_INCLUDE_TREATMENT_FACTOR_JOBS_H_
24 #define SERVICES_FIELD_TRIALS_INCLUDE_TREATMENT_FACTOR_JOBS_H_
25 
26 
29 
30 #include "treatment_factor.h"
31 
32 #include "string_parameter.h"
33 
34 
35 #ifndef DOXYGEN_SHOULD_SKIP_THIS
36 
37 #ifdef ALLOCATE_TREATMENT_FACTOR_JOB_CONSTANTS
38  #define TREATMENT_FACTOR_JOB_PREFIX DFW_FIELD_TRIAL_SERVICE_API
39  #define TREATMENT_FACTOR_JOB_STRUCT_VAL(x,y) = { x, y}
40  #define TREATMENT_FACTOR_JOB_VAL(x) = { x }
41 #else
42  #define TREATMENT_FACTOR_JOB_PREFIX extern
43  #define TREATMENT_FACTOR_JOB_STRUCT_VAL(x,y)
44  #define TREATMENT_FACTOR_JOB_VAL(x)
45 #endif
46 
47 #endif /* #ifndef DOXYGEN_SHOULD_SKIP_THIS */
48 
49 
50 TREATMENT_FACTOR_JOB_PREFIX NamedParameterType TFJ_STUDY_ID TREATMENT_FACTOR_JOB_STRUCT_VAL ("TF Study ID", PT_STRING);
51 TREATMENT_FACTOR_JOB_PREFIX NamedParameterType TFJ_TREATMENT_ID TREATMENT_FACTOR_JOB_STRUCT_VAL ("TF Treatment ID", PT_STRING);
52 TREATMENT_FACTOR_JOB_PREFIX NamedParameterType TFJ_TREATMENT_NAME TREATMENT_FACTOR_JOB_STRUCT_VAL ("TF Name", PT_STRING);
53 TREATMENT_FACTOR_JOB_PREFIX NamedParameterType TFJ_VALUES TREATMENT_FACTOR_JOB_STRUCT_VAL ("TF Levels", PT_JSON_TABLE);
54 
55 
56 
57 TREATMENT_FACTOR_JOB_PREFIX const char * const TFJ_LABEL_TITLE_S TREATMENT_FACTOR_JOB_VAL ("Label");
58 TREATMENT_FACTOR_JOB_PREFIX const char * const TFJ_VALUE_TITLE_S TREATMENT_FACTOR_JOB_VAL ("Value");
59 
60 
61 /* forward declarations */
62 struct Study;
63 
64 
65 #ifdef __cplusplus
66 extern "C"
67 {
68 #endif
69 
70 
72 
73 
74 DFW_FIELD_TRIAL_SERVICE_LOCAL bool SetUpTreatmentFactorsListParameter (const FieldTrialServiceData *data_p, Parameter *param_p, const struct Study *active_study_p, const TreatmentFactor *active_tf_p, const bool empty_option_flag);
75 
76 
78 
79 
81 
82 
84 
85 
86 DFW_FIELD_TRIAL_SERVICE_LOCAL bool IsTreatmentFactorParameter (const char * const param_name_s);
87 
88 
89 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddTreatmentFactorToStudy (const char *treatment_url_s, const json_t *factors_json_p, struct Study *study_p, const FieldTrialServiceData *data_p);
90 
91 
93 
94 
95 #ifdef __cplusplus
96 }
97 #endif
98 
99 
100 
101 #endif /* SERVICES_FIELD_TRIALS_INCLUDE_TREATMENT_FACTOR_JOBS_H_ */
Parameter
The datatype that stores all of the information about a Parameter.
Definition: parameter.h:121
ParameterGroup
A datatype to tell the system that certain parameters should be grouped together in the client's user...
Definition: parameter_group.h:85
GetTreatmentFactorAsFrictionlessData
json_t * GetTreatmentFactorAsFrictionlessData(const TreatmentFactor *treatment_factor_p)
GetTreatmentFactorTableParameter
Parameter * GetTreatmentFactorTableParameter(ParameterSet *param_set_p, ParameterGroup *group_p, json_t *tf_json_p, const FieldTrialServiceData *data_p)
NamedParameterType
This is a datatype that stores a read-only c-style string along with a ParameterType.
Definition: parameter.h:85
ParameterType
ParameterType
The different types that a Parameter can take.
Definition: parameter_type.h:35
ServiceJob
A datatype to represent a running task.
Definition: service_job.h:72
IsTreatmentFactorParameter
bool IsTreatmentFactorParameter(const char *const param_name_s)
SetUpTreatmentFactorsListParameter
bool SetUpTreatmentFactorsListParameter(const FieldTrialServiceData *data_p, Parameter *param_p, const struct Study *active_study_p, const TreatmentFactor *active_tf_p, const bool empty_option_flag)
PT_STRING
A c-style string.
Definition: parameter_type.h:58
DataResource
A datatype representing a URI.
Definition: data_resource.h:40
AddSubmissionTreatmentFactorParams
bool AddSubmissionTreatmentFactorParams(ServiceData *data_p, ParameterSet *param_set_p, DataResource *resource_p)
TreatmentFactor
A TreatmentFactor is a set of values for a Treatment applied to plots within a Study.
Definition: treatment_factor.h:76
dfw_field_trial_service_library.h
DFW_FIELD_TRIAL_SERVICE_LOCAL
#define DFW_FIELD_TRIAL_SERVICE_LOCAL
Definition: dfw_field_trial_service_library.h:43
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
TREATMENT_FACTOR_JOB_VAL
const TREATMENT_FACTOR_JOB_PREFIX char *const TFJ_LABEL_TITLE_S TREATMENT_FACTOR_JOB_VAL("Label")
dfw_field_trial_service_data.h
TREATMENT_FACTOR_JOB_STRUCT_VAL
TREATMENT_FACTOR_JOB_PREFIX NamedParameterType TFJ_STUDY_ID TREATMENT_FACTOR_JOB_STRUCT_VAL("TF Study ID", PT_STRING)
AddTreatmentFactorToStudy
bool AddTreatmentFactorToStudy(const char *treatment_url_s, const json_t *factors_json_p, struct Study *study_p, const FieldTrialServiceData *data_p)
RunForSubmissionTreatmentFactorParams
bool RunForSubmissionTreatmentFactorParams(FieldTrialServiceData *data_p, ParameterSet *param_set_p, ServiceJob *job_p)
treatment_factor.h
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
ParameterSet
A set of Parameters along with an optional name and description.
Definition: parameter_set.h:46
GetSubmissionTreatmentFactorParameterTypeForNamedParameter
bool GetSubmissionTreatmentFactorParameterTypeForNamedParameter(const char *param_name_s, ParameterType *pt_p)
string_parameter.h
Study
Definition: study.h:182