Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add egs_view egsinp editor with autocompletion for all egs++ apps #1164

Draft
wants to merge 40 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5cf74da
Add a text editor to egs_view
rtownson Aug 3, 2019
439a0dc
Non-working temporary commit
rtownson Dec 13, 2019
1caf68c
Add a text editor to egs_view
rtownson Aug 3, 2019
0d03724
Non-working temporary commit
rtownson Dec 13, 2019
5642956
Add editor autocomplete and input checking
rtownson Feb 4, 2020
19922d9
Improve egs_view editor input checking
rtownson Feb 22, 2020
212a9f2
Add egs_view editor input dependency checking
rtownson Mar 13, 2020
b7da362
Start adding egs_view editor definition blocks
rtownson Mar 13, 2020
618c6f0
Add egs_view editor source and shape support
rtownson Mar 31, 2020
406f174
Add egs_editor input example menu bar
rtownson Apr 3, 2020
31d2374
Temp
rtownson May 13, 2020
d6fca07
Add egs_editor support for transformations
rtownson Jul 7, 2020
916f1f0
Start adding egs_editor run control support
rtownson Jul 20, 2020
e320166
Finish adding run control inputs to egs_editor
rtownson Jul 23, 2020
85326e6
Improve egs_editor undo history
rtownson Jul 30, 2020
4d2895c
Add Geometry Input Validation
Feb 2, 2021
1d65c15
Add sources, ausgab, other egs_view editor support
hcgallop Feb 10, 2021
0f59cd3
Add support for shapes in egs_view editor
hcgallop Feb 15, 2021
790ed98
Add keystroke seletion to egs_editor
hcgallop Feb 26, 2021
dbcec3a
Add support for applications in egs_view editor
hcgallop Apr 26, 2021
ea05f21
Add support for red line comments
hcgallop Apr 30, 2021
ecd69e2
Fix the recent egs_view ui changes
May 19, 2021
81a28e4
Fix the egs_view dso link to be a relative path
rtownson May 20, 2021
99b8ef4
Add iaea_phsp_source editor inputs
rtownson Apr 6, 2022
2a2e604
Remove old egs_view debug messages
rtownson Apr 7, 2022
70be98a
Improve egs_editor support for shapes
rtownson May 2, 2022
c8c35a9
Run astyle to fix formatting
rtownson May 10, 2022
c78965f
Fix a few typos in the egs_editor additions
rtownson Jun 28, 2022
868f84c
Update egs_input_struct documentation
rtownson Jul 4, 2022
85a78cf
Tidy up egs_view debug output
rtownson Jul 5, 2022
9549983
Fix egs_view image scaling when reloading or saving
rtownson Nov 9, 2023
be3fe92
Add the library auto complete for ausgab objects
rtownson Nov 9, 2023
d251483
Add more egs_editor completion and examples
Xuan-Zheng05 Jul 26, 2024
a45213c
Fixed hardcoded path to density correction files with system dependen…
Xuan-Zheng05 Aug 10, 2024
56e1cce
Fix pegless material autocompletion to work with any name
Xuan-Zheng05 Aug 14, 2024
d2b97b9
Fix incorrect example for media definition
Xuan-Zheng05 Aug 22, 2024
a509ab2
Fix autocomplete error from pegless material addition
Xuan-Zheng05 Aug 30, 2024
efcfc4d
Fix egs_editor medium autocomplete
rtownson Aug 8, 2024
59ea112
Fix make clean of application library objects
rtownson Aug 8, 2024
99e2cbb
Tidy up merge with branch from Xuan
rtownson Sep 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions HEN_HOUSE/egs++/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ egspp_files = egs_input egs_base_geometry egs_library egs_transformations \
egs_base_source egs_functions egs_application egs_run_control \
egs_scoring egs_interpolator egs_atomic_relaxations \
egs_ausgab_object egs_particle_track egs_fortran_geometry \
egs_ensdf
egs_ensdf egs_input_struct

egspp_objects = $(addprefix $(DSO1), $(addsuffix .$(obje), $(egspp_files)))
config1h = $(IEGS1)$(DSEP)egs_config1.h egs_libconfig.h egs_functions.h
Expand Down Expand Up @@ -80,6 +80,7 @@ lib_objects = $(addprefix $(DSO1), $(addsuffix .$(obje), $(all_libs)))

#******************************************************************************

#all: $(EGS_BINDIR)egspp$(EXE) $(ABS_DSO)$(libpre)egspp$(libext) $(ABS_DSO)$(libpre)egs_input_struct$(libext) glibs slibs shapes aobjects gtest
all: $(EGS_BINDIR)egspp$(EXE) $(ABS_DSO)$(libpre)egspp$(libext) glibs slibs shapes aobjects gtest

$(EGS_BINDIR)egspp$(EXE): $(dso) $(DSO1)egspp.$(obje) $(ABS_DSO)$(libpre)egspp$(libext)
Expand All @@ -92,6 +93,9 @@ $(DSO1)egspp.$(obje): egspp.cpp egs_application.h egs_base_geometry.h egs_vector
egs_math.h egs_library.h $(config1h)
$(CXX) $(INC1) $(DEF1) $(opt) -c $(COUT)$@ $(notdir $(basename $@)).cpp

#$(ABS_DSO)$(libpre)egs_input_struct$(libext): $(dso) $(DSO1)egs_input_struct.$(obje) $(egspp_objects)
# $(CXX) $(INC1) $(DEFS) $(opt) $(shared) $(DSO1)egs_input_struct.$(obje) $(egspp_objects) $(extra)

$(DSO1)egs_interpolator.$(obje): egs_interpolator.cpp egs_interpolator.h \
$(config1h)

Expand Down Expand Up @@ -136,7 +140,10 @@ $(DSO1)egs_base_source.$(obje): egs_base_source.cpp egs_base_source.h \
egs_vector.h $(config1h) egs_object_factory.h egs_input.h

$(DSO1)egs_ensdf.$(obje): egs_ensdf.cpp egs_ensdf.h \
$(config1h) egs_functions.h egs_math.h egs_alias_table.h egs_atomic_relaxations.h
$(config1h) egs_math.h egs_alias_table.h egs_atomic_relaxations.h

$(DSO1)egs_input_struct.$(obje): egs_input_struct.cpp egs_input_struct.h \
$(config1h)

$(DSO1)egs_geometry_tester.$(obje): egs_geometry_tester.cpp \
egs_geometry_tester.h egs_input.h egs_vector.h egs_base_geometry.h \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
# Blake Walters
# Max Orok
# Martin Martinov
# Hannah Gallop
#
###############################################################################
#
Expand Down Expand Up @@ -98,6 +99,8 @@
#include "egs_input.h"
#include "egs_functions.h"

static bool EGS_DOSE_SCORING_LOCAL inputSet = false;

EGS_DoseScoring::EGS_DoseScoring(const string &Name,
EGS_ObjectFactory *f) :
EGS_AusgabObject(Name,f), dose(0), doseM(0), doseF(0),
Expand Down Expand Up @@ -591,6 +594,56 @@ void EGS_DoseScoring::resetCounter() {
//**********************************************************************
extern "C" {

static void setInputs() {
inputSet = true;

setBaseAusgabObjectInputs();

ausBlockInput->getSingleInput("library")->setValues({"EGS_Dose_Scoring"});

// Format: name, isRequired, description, vector string of allowed values
ausBlockInput->addSingleInput("medium dose", false, "Requests the dose deposited in each medium to be scored, default is no", {"yes", "no"});
ausBlockInput->addSingleInput("region dose", false, "Requests the dose deposited in each region to be scored, default is yes", {"yes", "no"});
ausBlockInput->addSingleInput("volume", false, "Either a unique volume, which will be the same for all regions or a list of individual volumes for each region, default is 1g/cm3");
auto dosePtr = ausBlockInput->addSingleInput("dose regions", false, "A list of individual regions");
auto startPtr = ausBlockInput->addSingleInput("dose start region", false, "A list of starts for regions");
auto stopPtr = ausBlockInput->addSingleInput("dose stop region", false, "A list of stops for regions");

dosePtr->addDependency(startPtr, "", true);
dosePtr->addDependency(stopPtr, "", true);
startPtr->addDependency(dosePtr, "", true);
stopPtr->addDependency(dosePtr, "", true);

// This can only be used if one of the geometries is an EGS_XYZGeometry
auto blockPtr = ausBlockInput->addBlockInput("output dose file");
blockPtr->addSingleInput("geometry name", true, "The name of a predefined EGS_XYZGeometry");
blockPtr->addSingleInput("file type", true, "The type of file", {"3ddose"});
}

EGS_DOSE_SCORING_EXPORT string getExample() {
string example;
example = {
R"(
# Example of egs_dose_scoring
:start ausgab object:
library = egs_dose_scoring
name = my_score
medium dose = yes # no (default)
region dose = no # yes (default)
volume = v1 ... vn # in cm**3
dose regions = ir1 ... irn # individual regions
:stop ausgab object:
)"};
return example;
}

EGS_DOSE_SCORING_EXPORT shared_ptr<EGS_BlockInput> getInputs() {
if (!inputSet) {
setInputs();
}
return ausBlockInput;
}

EGS_DOSE_SCORING_EXPORT EGS_AusgabObject *createAusgabObject(EGS_Input *input,
EGS_ObjectFactory *f) {
const static char *func = "createAusgabObject(dose_scoring)";
Expand Down Expand Up @@ -732,4 +785,4 @@ extern "C" {
}
return result;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
#include "egs_input.h"
#include "egs_functions.h"

static bool EGS_FLUENCE_SCORING_LOCAL inputSet = false;

#define REGIONS_ENTRIES 100
#define REGIONS_PER_LINE 25

Expand Down Expand Up @@ -1845,4 +1847,32 @@ extern "C" {
}
}

}
// Not finished
// static void setInputs() {
// inputSet = true;

// setBaseAusgabObjectInputs();

// ausBlockInput->getSingleInput("library")->setValues({"EGS_Fluence_Scoring"});

// // Format: name, isRequired, description, vector string of allowed values

// }

// EGS_FLUENCE_SCORING_EXPORT string getExample() {
// string example;
// example = {
// R"(

// )"};
// return example;
// }

// EGS_FLUENCE_SCORING_EXPORT shared_ptr<EGS_BlockInput> getInputs() {
// if (!inputSet) {
// setInputs();
// }
// return ausBlockInput;
// }

}
Loading