Commit 0637608e authored by Matteo Quintiliani's avatar Matteo Quintiliani
Browse files

Merge branch 'release/1.11.0'

parents 28694993 38f96030
Pipeline #4692 failed with stages
in 1 minute and 31 seconds
......@@ -22,22 +22,24 @@ build:
- apt-get update && apt-get install -y cmake
script:
# Checkout only Earthworm libraries source and its dependencies
- svn checkout --depth empty svn://svn.isti.com/earthworm/trunk $EW_INSTALL_HOME/$EW_INSTALL_VERSION
- cd $EW_INSTALL_HOME/$EW_INSTALL_VERSION/
- svn update --set-depth infinity include
- svn update --set-depth infinity lib
- svn update --set-depth infinity bin
- svn update --set-depth infinity environment
- svn update --set-depth infinity params
- svn update --set-depth empty src
- svn update --set-depth infinity src/libsrc
- cd -
- git clone https://${CI_DEPLOY_TOKEN_EW}:${CI_DEPLOY_SECRET_EW}@gitlab.rm.ingv.it/earthworm/earthworm.git/ $EW_INSTALL_HOME/$EW_INSTALL_VERSION
# - svn checkout --depth empty svn://svn.isti.com/earthworm/trunk $EW_INSTALL_HOME/$EW_INSTALL_VERSION
# - cd $EW_INSTALL_HOME/$EW_INSTALL_VERSION/
# - svn update --set-depth infinity include
# - svn update --set-depth infinity lib
# - svn update --set-depth infinity bin
# - svn update --set-depth infinity environment
# - svn update --set-depth infinity params
# - svn update --set-depth empty src
# - svn update --set-depth infinity src/libsrc
# - cd -
# Set Earthworm variables from EW_INSTALL_X variables
- . $EW_INSTALL_HOME/$EW_INSTALL_VERSION/environment/ew_linux.bash
# Copy earthworm.d earthworm_global.d from environment/ to params/
- cp $EW_INSTALL_HOME/$EW_INSTALL_VERSION/environment/earthworm.d $EW_INSTALL_HOME/$EW_INSTALL_VERSION/environment/earthworm_global.d $EW_INSTALL_HOME/$EW_INSTALL_VERSION/params/
# Build Earthworm libraries
- cd $EW_INSTALL_HOME/$EW_INSTALL_VERSION/src/libsrc
- make -f makefile.unix clean
- make -f makefile.unix
- cd -
# Update git submodule json-c and rabbitmq-c
......@@ -67,7 +69,10 @@ build:
- echo $EW_INSTALL_HOME/$EW_INSTALL_VERSION/
artifacts:
paths:
- $EW_INSTALL_HOME/$EW_INSTALL_VERSION/
- $EW_INSTALL_HOME/$EW_INSTALL_VERSION/lib
- $EW_INSTALL_HOME/$EW_INSTALL_VERSION/bin
- $EW_INSTALL_HOME/$EW_INSTALL_VERSION/environment
- $EW_INSTALL_HOME/$EW_INSTALL_VERSION/params
- ./ew2openapi
# depending on your build setup it's most likely a good idea to cache outputs to reduce the build time
# cache:
......@@ -106,6 +111,15 @@ test:
- grep -w -v "hostname" j1.json > jj1.json
- grep -w -v "hostname" j2.json > jj2.json
- diff jj1.json jj2.json
# Test ew2openapi standalone with ARC input file
- ./ew2openapi TYPE_HYP2000ARC ./test/arc/20170118-1014097.arc ./test/json/output_test.json
- jq '.' ./test/json/output_test.json > j1.json
- jq '.' ./test/json/20170118-1014097.json > j2.json
# - sed -e 's/"hostname":[[:space:]]*"\([^"]\+\)"/"hostname": "DIFF_IGNORE_HOSTNAME"/' j1.json > jj1.json
# - sed -e 's/"hostname":[[:space:]]*"\([^"]\+\)"/"hostname": "DIFF_IGNORE_HOSTNAME"/' j2.json > jj2.json
- grep -w -v "hostname" j1.json > jj1.json
- grep -w -v "hostname" j2.json > jj2.json
- diff jj1.json jj2.json
# Test ew2openapi standalone with TYPE_MAGNITUDE input file
- ew2openapi TYPE_MAGNITUDE ./test/localmag/lm_75662.localmag ./test/json/output_test.json
- jq '.' ./test/json/output_test.json > j1.json
......
......@@ -2,6 +2,9 @@
ew2openapi Release History
#########################
* Release 1.11.0 (2020/03/12)
- Under development reading extra fields in ARC structure related to magnitude values. Issue #25 (2020/03/12)
* Release 1.10.4 (2020/03/11)
- Remove dependency from EW_LOG and logit() when run as stand-alone mode. Issue #15 (2018/04/24)
- Handle mutual use of sending messages to Webservice or RabbitMQ. Issue #16 (2018/04/24)
......
1.10.4 - 2020-03-11
\ No newline at end of file
1.11.0 - 2020-03-12
\ No newline at end of file
......@@ -29,6 +29,9 @@ LDFLAGS_CURL_STATIC = `curl-config --libs`
CFLAGS = -D_REENTRANT $(GLOBALFLAGS) $(SPECIFIC_CFLAGS)
CFLAGS += -g
CFLAGS += -I$(RABBITMQDIR)/librabbitmq -I$(JSONCDIR)/build/include $(CFLAGS_CURL)
# Under development reading extra fields in ARC structure related to magnitude values
# https://gitlab.rm.ingv.it/earthworm/ew2openapi/issues/25
# CFLAGS += -DARC_EXTRA_FIELDS
LDFLAGS += -L$(RABBITMQDIR)/build/librabbitmq -L$(JSONCDIR)/build/lib
......@@ -95,3 +98,13 @@ clean:
clean_bin:
rm -f $B/$(APP)
test: $(B)/$(APP)
$(B)/$(APP)
$(B)/$(APP) TYPE_HYP2000ARC ./test/arc/20180205-080122.0009627.arc ./test/json/output_test.json
rm -f j1.json j2.json jj1.json jj2.json
jq '.' ./test/json/output_test.json > j1.json
jq '.' ./test/json/20180205-080122.0009627.json > j2.json
grep -w -v "hostname" j1.json > jj1.json
grep -w -v "hostname" j2.json > jj2.json
diff jj1.json jj2.json
......@@ -220,6 +220,21 @@ char *get_json_string_from_arc_ew_struct(struct Hsum *arcSum, struct Hpck *arcPc
json_object_object_add(jobj_ew_message,"mdwt", json_object_new_double_with_precision(arcSum->mdwt, 2));
json_object_object_add(jobj_ew_message,"ingvQuality", json_object_new_string(ingv_quality_str));
#ifdef ARC_EXTRA_FIELDS
/* Extra fields */
json_object_object_add(jobj_ew_message,"amplitudeMagnitude", json_object_new_double_with_precision(arcSum->amplitudeMagnitude, 2));
json_object_object_add(jobj_ew_message,"numberOfAmpMagWeightCode", json_object_new_double_with_precision(arcSum->numberOfAmpMagWeightCode, 1));
json_object_object_add(jobj_ew_message,"medianAbsDiffAmpMag", json_object_new_double_with_precision(arcSum->medianAbsDiffAmpMag, 2));
json_object_object_add(jobj_ew_message,"codeOfCrustAndDelayModel", json_object_new_string(arcSum->codeOfCrustAndDelayModel));
json_object_object_add(jobj_ew_message,"preferredMagLabel", json_object_new_string_from_char(arcSum->preferredMagLabel));
json_object_object_add(jobj_ew_message,"preferredMag", json_object_new_double_with_precision(arcSum->preferredMag, 2));
json_object_object_add(jobj_ew_message,"numberOfPreferredMags", json_object_new_double_with_precision(arcSum->numberOfPreferredMags, 1));
json_object_object_add(jobj_ew_message,"modelDepthType", json_object_new_string_from_char(arcSum->modelDepthType));
json_object_object_add(jobj_ew_message,"dominantCrustModelType", json_object_new_string_from_char(arcSum->dominantCrustModelType));
json_object_object_add(jobj_ew_message,"earthquakeDepthDatum", json_object_new_int(arcSum->earthquakeDepthDatum));
json_object_object_add(jobj_ew_message,"geoidDepth", json_object_new_double_with_precision(arcSum->geoidDepth, 2));
#endif
/* GeoJSON conversion */
if(flag_geojson) {
json_object_ew_message_objects_add(jobj, jobj_ew_message);
......@@ -330,6 +345,17 @@ char *get_json_string_from_arc_ew_struct(struct Hsum *arcSum, struct Hpck *arcPc
}
json_object_object_add(jobj_phase,"caav", jobj_tmp);
#ifdef ARC_EXTRA_FIELDS
/* Extra fields */
json_object_object_add(jobj_phase,"amplitude", json_object_new_double_with_precision(arcPck[i]->amplitude, 2));
json_object_object_add(jobj_phase,"ampUnitsCode", json_object_new_int(arcPck[i]->ampUnitsCode));
json_object_object_add(jobj_phase,"ampType", json_object_new_int(arcPck[i]->ampType));
json_object_object_add(jobj_phase,"ampMag", json_object_new_double_with_precision(arcPck[i]->ampMag, 2));
json_object_object_add(jobj_phase,"ampMagWeightCode", json_object_new_int(arcPck[i]->ampMagWeightCode));
json_object_object_add(jobj_phase,"importanceP", json_object_new_double_with_precision(arcPck[i]->importanceP, 3));
json_object_object_add(jobj_phase,"importanceS", json_object_new_double_with_precision(arcPck[i]->importanceS, 3));
#endif
/* GeoJSON conversion */
if(flag_geojson) {
isite = site_index( arcPck[i]->site, arcPck[i]->net, arcPck[i]->comp, arcPck[i]->loc );
......@@ -353,6 +379,7 @@ char *get_json_string_from_arc_ew_struct(struct Hsum *arcSum, struct Hpck *arcPc
/* Add json object phase into json object phase array */
json_object_array_add(jobj_phase_array, jobj_phase);
}
}
......
/* DO NOT EDIT. Automatically generated. Change file HISTORY in ew2openapi_version main directory. */
#define EW2OPENAPI_VERSION "1.10.4 - 2020-03-11"
#define EW2OPENAPI_VERSION "1.11.0 - 2020-03-12"
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment