From 80ce8846c58ccd16597872332ebe290bc51364e3 Mon Sep 17 00:00:00 2001 From: Timothy McPhillips Date: Mon, 6 Nov 2017 11:40:04 -0800 Subject: [PATCH] Fixed msys2 build. --- gcc/yw-common/Makefile | 7 + gcc/yw-graph-app/wf.svg | 606 +++++++++++++++++++++++++++ gcc/yw.setup.makefile | 2 + msvc/yw.sln | 8 +- src/yw-common/yw_io.h | 2 + src/yw-extract/annotation_listener.h | 2 +- src/yw-parse/parsing_exception.cpp | 4 +- src/yw-parse/parsing_exception.h | 2 +- test/yw-test/random_testing.h | 8 +- test/yw-test/yw_test.h | 1 + 10 files changed, 634 insertions(+), 8 deletions(-) create mode 100644 gcc/yw-common/Makefile create mode 100644 gcc/yw-graph-app/wf.svg diff --git a/gcc/yw-common/Makefile b/gcc/yw-common/Makefile new file mode 100644 index 0000000..4f899ac --- /dev/null +++ b/gcc/yw-common/Makefile @@ -0,0 +1,7 @@ +include ../yw.setup.makefile +include ../cpp.setup.makefile + +LIB_TARGET = libywcommon.a +LIB_SRC = $(wildcard ../../src/yw-common/*.cpp) + +include ../lib.targets.makefile diff --git a/gcc/yw-graph-app/wf.svg b/gcc/yw-graph-app/wf.svg new file mode 100644 index 0000000..e2d35c8 --- /dev/null +++ b/gcc/yw-graph-app/wf.svg @@ -0,0 +1,606 @@ + + + + + + +simulate_data_collection + + +cluster_workflow_inputs_box_outer + + + +cluster_workflow_inputs_box_inner + + + +cluster_workflow_outputs_box_outer + + + +cluster_workflow_outputs_box_inner + + + +cluster_workflow_box_outer + + + +cluster_workflow_box_inner + + + + +calculate_strategy + +calculate_strategy + +Reject unsuitable crystals and compute + best data sets to collect for accepted crystals. + + + +accepted_sample + +accepted_sample + + + +calculate_strategy->accepted_sample + + + + + +energies + +energies + + + +calculate_strategy->energies + + + + + +num_images + +num_images + + + +calculate_strategy->num_images + + + + + +rejected_sample + +rejected_sample + + + +calculate_strategy->rejected_sample + + + + + +collect_data_set + +collect_data_set + +Collect data set using the given data collection parameters. + + + +energy + +energy + + + +collect_data_set->energy + + + + + +frame_number + +frame_number + + + +collect_data_set->frame_number + + + + + +raw_image + +raw_image + +file:run/raw/{cassette_id}/{sample_id}/e{energy}/image_{frame_number}.raw + + + +collect_data_set->raw_image + + + + + +run_log + +run_log + +file:run/run_log.txt + + + +collect_data_set->run_log + + + + + +sample_id + +sample_id + + + +collect_data_set->sample_id + + + + + +initialize_run + +initialize_run + +Create run directory and initialize log files. + + + +initialize_run->run_log + + + + + +load_screening_results + +load_screening_results + +Load sample information from spreadsheet. + + + +load_screening_results->run_log + + + + + +sample_name + +sample_name + + + +load_screening_results->sample_name + + + + + +sample_quality + +sample_quality + + + +load_screening_results->sample_quality + + + + + +log_average_image_intensity + +log_average_image_intensity + +Record statistics about each diffraction image. + + + +collection_log + +collection_log + +file:run/collected_images.csv + + + +log_average_image_intensity->collection_log + + + + + +log_rejected_sample + +log_rejected_sample + +Record which samples were rejected. + + + +rejection_log + +rejection_log + +file:run/rejected_samples.txt + + + +log_rejected_sample->rejection_log + + + + + +transform_images + +transform_images + +Correct raw image using the detector calibration image. + + + +corrected_image + +corrected_image + +file:run/data/{sample_id}/{sample_id}_{energy}eV_{frame_number}.img + + + +transform_images->corrected_image + + + + + +pixel_count + +pixel_count + + + +transform_images->pixel_count + + + + + +transform_images->run_log + + + + + +total_intensity + +total_intensity + + + +transform_images->total_intensity + + + + + +accepted_sample->collect_data_set + + + + + +calibration_image + +calibration_image + + + +calibration_image->transform_images + + + + + +cassette_id + +cassette_id + + + +cassette_id->collect_data_set + + + + + +cassette_id->initialize_run + + + + + +cassette_id->load_screening_results + + + + + +cassette_id->log_average_image_intensity + + + + + +cassette_id->log_rejected_sample + + + + + +workflow output collection_log + + + + +collection_log->workflow output collection_log + + + + + +corrected_image->log_average_image_intensity + + + + + +workflow output corrected_image + + + + +corrected_image->workflow output corrected_image + + + + + +data_redundancy + +data_redundancy + + + +data_redundancy->calculate_strategy + + + + + +energies->collect_data_set + + + + + +energy->transform_images + + + + + +frame_number->log_average_image_intensity + + + + + +frame_number->transform_images + + + + + +num_images->collect_data_set + + + + + +pixel_count->log_average_image_intensity + + + + + +raw_image->transform_images + + + + + +rejected_sample->log_rejected_sample + + + + + +workflow output rejection_log + + + + +rejection_log->workflow output rejection_log + + + + + +workflow output run_log + + + + +run_log->workflow output run_log + + + + + +sample_id->log_average_image_intensity + + + + + +sample_id->transform_images + + + + + +sample_name->calculate_strategy + + + + + +sample_quality->calculate_strategy + + + + + +sample_score_cutoff + +sample_score_cutoff + + + +sample_score_cutoff->calculate_strategy + + + + + +sample_score_cutoff->initialize_run + + + + + +sample_spreadsheet + +sample_spreadsheet + +file:cassette_{cassette_id}_spreadsheet.csv + + + +sample_spreadsheet->load_screening_results + + + + + +total_intensity->log_average_image_intensity + + + + + +workflow input calibration_image + + + + +workflow input calibration_image->calibration_image + + + + + +workflow input cassette_id + + + + +workflow input cassette_id->cassette_id + + + + + +workflow input corrected_image + + + + +workflow input corrected_image->corrected_image + + + + + +workflow input data_redundancy + + + + +workflow input data_redundancy->data_redundancy + + + + + +workflow input sample_score_cutoff + + + + +workflow input sample_score_cutoff->sample_score_cutoff + + + + + +workflow input sample_spreadsheet + + + + +workflow input sample_spreadsheet->sample_spreadsheet + + + + + diff --git a/gcc/yw.setup.makefile b/gcc/yw.setup.makefile index a359978..ebc3802 100644 --- a/gcc/yw.setup.makefile +++ b/gcc/yw.setup.makefile @@ -4,6 +4,7 @@ YW_DIR = ../.. YW_SRC_DIR = $(YW_DIR)/src YW_GCC_DIR = $(YW_DIR)/gcc +YW_INCLUDES += -I$(YW_SRC_DIR)/yw-common YW_INCLUDES += -I$(YW_SRC_DIR)/yw-cli YW_INCLUDES += -I$(YW_SRC_DIR)/yw-graph YW_INCLUDES += -I$(YW_SRC_DIR)/yw-model @@ -24,6 +25,7 @@ YW_LIBS += -lywdb -L$(YW_GCC_DIR)/yw-db YW_LIBS += -lsqlitedb -L$(YW_GCC_DIR)/sqlite-db YW_LIBS += -lywconfig -L$(YW_GCC_DIR)/yw-config YW_LIBS += -lsqlite3 -L$(YW_GCC_DIR)/sqlite3 +YW_LIBS += -lywcommon -L$(YW_GCC_DIR)/yw-common ANTLR_LIB += -lantlr4 -L$(YW_GCC_DIR)/antlr4-runtime ANTLR_INCLUDES += -I$(ANTLR4_RUNTIME_SRC) diff --git a/msvc/yw.sln b/msvc/yw.sln index f379547..6a77ab4 100644 --- a/msvc/yw.sln +++ b/msvc/yw.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.27004.2005 +VisualStudioVersion = 15.0.27004.2006 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yw-extract", "yw-extract\yw-extract.vcxproj", "{158B1288-0CC1-426B-8967-800EDBD8C278}" ProjectSection(ProjectDependencies) = postProject @@ -306,6 +306,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yw-common-tests", "yw-commo {53F368BF-5AE1-4D98-BF66-E2D100E90E8C} = {53F368BF-5AE1-4D98-BF66-E2D100E90E8C} EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "yw-common", "yw-common", "{549611AB-FBB2-4168-BCBB-99335AF54FDC}" + ProjectSection(SolutionItems) = preProject + ..\gcc\yw-common\Makefile = ..\gcc\yw-common\Makefile + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -575,6 +580,7 @@ Global {4FFEE26C-A586-4DEC-A7B7-E61F3DE416D4} = {BFFDE3BA-F86B-4FCA-A0B1-D4D035806F75} {4520D083-3914-444C-9B11-590BDD272DC5} = {67337B64-473B-4676-AF06-D1EDCE123B6D} {FE656FA7-CC96-49A7-928B-F4C05547E52E} = {67337B64-473B-4676-AF06-D1EDCE123B6D} + {549611AB-FBB2-4168-BCBB-99335AF54FDC} = {67337B64-473B-4676-AF06-D1EDCE123B6D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {9AEF8164-5EBC-432F-98B9-C7C5704935A3} diff --git a/src/yw-common/yw_io.h b/src/yw-common/yw_io.h index 9156527..c3550e0 100644 --- a/src/yw-common/yw_io.h +++ b/src/yw-common/yw_io.h @@ -1,3 +1,5 @@ +#pragma once + #include #ifdef _MSC_VER diff --git a/src/yw-extract/annotation_listener.h b/src/yw-extract/annotation_listener.h index bb3d10d..543bb1c 100644 --- a/src/yw-extract/annotation_listener.h +++ b/src/yw-extract/annotation_listener.h @@ -58,7 +58,7 @@ namespace yw { void enterResource(YWParser::ResourceContext *context); protected: - bool AnnotationListener::inProgramBlock(); + bool inProgramBlock(); row_id getLineId(antlr4::ParserRuleContext* context); AnnotationRange getRangeInLine(antlr4::ParserRuleContext* context); }; diff --git a/src/yw-parse/parsing_exception.cpp b/src/yw-parse/parsing_exception.cpp index 8af161e..37b3bcc 100644 --- a/src/yw-parse/parsing_exception.cpp +++ b/src/yw-parse/parsing_exception.cpp @@ -12,9 +12,9 @@ namespace yw { updateMessage(); } - const char* ParsingException::what() const { + const char* ParsingException::what() const noexcept { return getMessage().c_str(); - }; + } const std::string& ParsingException::getMessage() const { return messageBacking; diff --git a/src/yw-parse/parsing_exception.h b/src/yw-parse/parsing_exception.h index 3c41b9a..a9d003c 100644 --- a/src/yw-parse/parsing_exception.h +++ b/src/yw-parse/parsing_exception.h @@ -16,7 +16,7 @@ namespace yw { const std::string& what = "" ); - virtual const char* what() const override; + virtual const char* what() const noexcept override; virtual nullable_string getDetails() const; virtual const std::string& getMessage() const; virtual nullable_string getSource() const; diff --git a/test/yw-test/random_testing.h b/test/yw-test/random_testing.h index 2f89aaf..127bda9 100644 --- a/test/yw-test/random_testing.h +++ b/test/yw-test/random_testing.h @@ -1,3 +1,5 @@ +#pragma once + #include namespace yw { @@ -6,15 +8,15 @@ namespace yw { class RandomTextGenerator { public: - void RandomTextGenerator::setSeed(unsigned int seed) { + void setSeed(unsigned int seed) { srand(seed); } - char RandomTextGenerator::getRandomASCIICharacter() { + char getRandomASCIICharacter() { return rand() % 128; } - std::string RandomTextGenerator::getRandomASCIIText(size_t size) { + std::string getRandomASCIIText(size_t size) { std::stringstream ss; for (size_t i = 0; i < size; ++i) { ss << getRandomASCIICharacter(); diff --git a/test/yw-test/yw_test.h b/test/yw-test/yw_test.h index 31b1de9..819632f 100644 --- a/test/yw-test/yw_test.h +++ b/test/yw-test/yw_test.h @@ -1,5 +1,6 @@ #pragma once +#include "yw_io.h" #include "nullable.h" #include "yw_test_msvc.h" #include "yw_test_cpputest.h"