From f53713e125a5bd8087aac855103218eb1232c2d8 Mon Sep 17 00:00:00 2001 From: Nosferatu Arucard Date: Tue, 25 Jun 2019 17:51:39 +0100 Subject: [PATCH] Remove duplicate documentation, and fix some bugs. --- src/Database.html | 192 ------- src/DatabaseLibrary.cpp | 70 +-- src/DatabaseLibrary.h | 24 +- src/Detector.html | 140 ----- src/ERYAPIXE.cpp | 139 +++-- src/ERYAPIXE.h | 58 +-- src/ERYAPIXEMainFrame.cpp | 26 +- src/ERYAPIXEMainFrame.h | 1 - src/ERYAPIXEdialogAddDatabase.cpp | 22 +- src/ERYAPIXEdialogAddDatabase.h | 10 +- src/ERYAPIXEdialogAdvanced.cpp | 6 +- src/ERYAPIXEdialogDatabaseManager.cpp | 13 +- src/ERYAPIXEdialogDatabaseManager.h | 3 + src/ERYAPIXEdialogDetectorSetup.cpp | 14 +- src/ERYAPIXEdialogDetectorSetup.h | 3 + src/ERYAPIXEdialogHelp.cpp | 75 --- src/ERYAPIXEdialogHelp.h | 43 -- src/ERYAPIXEdialogR33DataImport.cpp | 4 +- src/ERYAPIXEdialogXlsxDataImport.cpp | 4 +- src/ERYAPIXEdialogZieglerParameters.cpp | 15 +- src/ERYAPIXEdialogZieglerParameters.h | 3 + src/Element.html | 220 -------- src/FileLibrary.cpp | 132 ++++- src/Fit.html | 416 --------------- src/Fitextra.html | 204 -------- src/Index.html | 70 --- src/Legacy.html | 168 ------ src/Macro.html | 655 ------------------------ src/Main.html | 341 ------------ src/R33Library.cpp | 29 +- src/R33Library.h | 8 +- src/Ziegler.html | 477 ----------------- 32 files changed, 357 insertions(+), 3228 deletions(-) delete mode 100644 src/Database.html delete mode 100644 src/Detector.html delete mode 100644 src/ERYAPIXEdialogHelp.cpp delete mode 100644 src/ERYAPIXEdialogHelp.h delete mode 100644 src/Element.html delete mode 100644 src/Fit.html delete mode 100644 src/Fitextra.html delete mode 100644 src/Index.html delete mode 100644 src/Legacy.html delete mode 100644 src/Macro.html delete mode 100644 src/Main.html delete mode 100644 src/Ziegler.html diff --git a/src/Database.html b/src/Database.html deleted file mode 100644 index 7b05406..0000000 --- a/src/Database.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - - - - -

-ERYA : Database Manager

-


- -

-

-The Database Manager is the -main purpose utility to manage and handle a database of elements -required for ERYA to operate correctly, which is to give the -necessary parameters to handle yield calculations.

-

ERYA’s -Database follows the IBANDL -conventions -on -physical units, which -means -that -the atomic -and isotopic masses are -placed in -atomic mass units (amu), where is -also equal to the molar mass in grams per mole; the abundances are -dimensionless; and the total cross-section -data are stored -in milibarn per keV units.

-

- ERYA should bundle a -ready-to-use database that can be edited using the buttons located on -the bottom window, and can be replaced or converted as your will.

-


- -

-

-Quick Guide to Database -Manager

-


- -

-

-1. The Database Manager will -load automatically the default database defined by the configuration -file on start-up.

-

-2. If you prefer to select -another database, just open the new one from “Load” and select it -from a compatible file.

-

3. -You can add a new element or edit the current element highlighted, -and it will open the Element Editor -in -another window.

-

-4. If you want to delete an -Element, just selected an element from the list and choose “Delete” -to remove it. The program will warn you if you really want to delete, -then hit “Yes” to proceed.

-

-5. All changes are not -permanent, unless you choose “Save” and select a new database or -overwrite the original one. And also the new database will be -reloaded at the Main Screen.

-


- -

-

-Exploring the Database -Manager Features

-


- -

-

-When you start the Database -Manager, all elements from the active Database will be sorted and -made accessible from the first pull-down menu. If some element stored -on database have more than one gamma peak, it will appear on second -pull-down menu.

-

-The contents of the second -list (gamma peak) are dynamically changed as long you select a -particular element from the first list (isotopes).

-

-To give a quick visual outlook -of elements, an short version of cross-section database and a quick -plot of cross-section in function of energy are automatically -displayed when you change the elements or gamma peak from the twin -pull-downs lists.

-

-Also a quick information about -the isotope atomic mass or the abundance are displayed.

-


- -

-

To -modify the contents of the active database, you can edit the selected -element, or create a new one to add to the database. This operations -will open the Element -Editor, -and the database content can now the replaced or created.

-

-Otherwise, you can delete an -unnecessary or erroneous element, simply by selecting that element -and click “Delete” to erase it.

-

-Finally, you can load and save -several databases as files, but you can use only one single database -during runtime to be edited or created.

-


- -

-

-Database File Formats

-


- -

-

-ERYA Databases are stored on a -file with epd extension, using the XML document format where -store, in particular, the cross-section data in milibarn-keV, the -energy in keV and the isotope mass in atomic mass unit (grams per -mol).

-

- An ancient text format are -also supported for recovery purposes, but are officially deprecated, -and should use the XML standard instead.

-


- -

-


- -

-

-LabView Database Import -(Legacy and Deprecated Feature)

-


- -

-

-ERYA supports the import of -the LabView ERYA database binary format, mainly dedicated for -the former uses of this previous software, to convert the data.

-

-
- -

-

-To use this feature, click -“Load”, and select the “Legacy (txt)” file format on the file -dialog, and finally select the file to process.

-

-ERYA detects during this event -if the LabView ERYA database file are a plain Text Database or -a Binary Database file, and applies automatically the correct -importation routines.

-

- Once successfully loaded, -their contents are displayed on the Database Manager, and the user -can make any operations, before save to a file.

-

- Notice that is not possible to export any ERYA-Bulk Database to -binary form, and it will never be implemented such feature. Instead, -the user can store the Database to XML or text file formats, where -the first option are the recommendable one.

-


- -

-

-Tip: Use the LabView Import feature only as a convenient tool -to import databases created by the LabView ERYA, and convert to the -native ERYA databases files.

-

Some -technical details are available here.

- - \ No newline at end of file diff --git a/src/DatabaseLibrary.cpp b/src/DatabaseLibrary.cpp index 4036ce4..eaca25f 100644 --- a/src/DatabaseLibrary.cpp +++ b/src/DatabaseLibrary.cpp @@ -24,7 +24,7 @@ WX_DEFINE_OBJARRAY(ElementDatabaseList); WX_DEFINE_OBJARRAY(ElementSRIMList); // Element Database main constructor -ElementDatabase::ElementDatabase(wxString Name, wxString Gamma, wxString Number, wxString Abundance, wxString Atomic, wxString Isotopic, wxArrayString Energy, wxArrayString EnergyError, wxArrayString Sigma, wxArrayString SigmaError) +ElementDatabase::ElementDatabase(wxString Name, wxString Gamma, wxString Number, wxString Abundance, wxString Atomic, wxString Isotopic, wxArrayString Energy, wxArrayString EnergyError, wxArrayString Sigma, wxArrayString SigmaError, wxString Info) { dataEditElement = Name; dataEditGamma = Gamma; @@ -36,6 +36,34 @@ ElementDatabase::ElementDatabase(wxString Name, wxString Gamma, wxString Number, dataEnergyError = EnergyError; dataSigma = Sigma; dataSigmaError = SigmaError; + infoElement = Info; +} + +// Element Database standard constructor +ElementDatabase::ElementDatabase(wxTextCtrl* EditElement, wxTextCtrl* EditGamma, wxTextCtrl* EditNumber, wxTextCtrl* EditAbundance, wxTextCtrl* EditAtomic, wxTextCtrl* EditIsotopic, wxString EditInfo, wxGrid* DataEditor) +{ + dataEditElement = EditElement->GetValue(); + dataEditGamma = EditGamma->GetValue(); + dataEditNumber = EditNumber->GetValue(); + dataEditAbundance = EditAbundance->GetValue(); + dataEditAtomic = EditAtomic->GetValue(); + dataEditIsotopic = EditIsotopic->GetValue(); + infoElement = EditInfo; + dataEnergy.Clear(); + dataEnergyError.Clear(); + dataSigma.Clear(); + dataSigmaError.Clear(); + for(int i=0;iGetNumberRows();i++) + { + wxString temp0 = DataEditor->GetCellValue(i,0); + wxString temp1 = DataEditor->GetCellValue(i,1); + wxString temp2 = DataEditor->GetCellValue(i,2); + wxString temp3 = DataEditor->GetCellValue(i,3); + dataEnergy.Add(temp0); + dataEnergyError.Add(temp1); + dataSigma.Add(temp2); + dataSigmaError.Add(temp3); + } } // Enforce a strict name convention for Elements: @@ -73,7 +101,7 @@ bool ElementDatabase::CheckElement() } // Obtain the relevant Element information to the Element Editor -bool ElementDatabase::GetAllElementInfo(wxTextCtrl* &SetElement, wxTextCtrl* &SetGammaPeak, wxTextCtrl* &SetNumber, wxTextCtrl* &SetAbundance, wxTextCtrl* &SetMass, wxTextCtrl* &SetIsotopic, wxGrid* &SetEnergySigmaErrorTable) +bool ElementDatabase::GetAllElementInfo(wxTextCtrl* &SetElement, wxTextCtrl* &SetGammaPeak, wxTextCtrl* &SetNumber, wxTextCtrl* &SetAbundance, wxTextCtrl* &SetMass, wxTextCtrl* &SetIsotopic, wxString &SetInfo, wxGrid* &SetEnergySigmaErrorTable) { SetElement->SetValue(this->GetElement()); SetGammaPeak->SetValue(this->GetGamma()); @@ -81,6 +109,7 @@ bool ElementDatabase::GetAllElementInfo(wxTextCtrl* &SetElement, wxTextCtrl* &Se SetAbundance->SetValue(this->GetAbundance()); SetMass->SetValue(this->GetAtomic()); SetIsotopic->SetValue(this->GetIsotopic()); + SetInfo = this->GetInfo(); for (int i=0; iGetEnergy().GetCount(); i++) { wxString temp1 = this->GetEnergy().Item(i); @@ -444,7 +473,7 @@ bool ElementDatabaseArray::RemoveElement(wxString GetElement, wxString GetGammaP SetEnergyPlot->DelAllLayers(false,true); wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("The Element Database consistency are damaged. Please, reload with a new one."), wxT("Database is Corrupted!"), wxOK | wxICON_ERROR); dial->ShowModal(); - return true; // Database error. + return false; // Database error. } } else // Delete the contents of the Database Manager, since it was empty! @@ -652,11 +681,12 @@ wxArrayString ElementDatabaseArray::GetAllListGammaPeaks(wxString SearchElement) } // Detector Parameters main constructor -DetectorParameters::DetectorParameters(wxTextCtrl* textFunctionEficiency, wxGrid* tableConstantEficiency) +DetectorParameters::DetectorParameters(wxTextCtrl* textFunctionEficiency, wxGrid* tableConstantEficiency, wxString &info) { DetectorFunction = textFunctionEficiency->GetValue(); DetectorEnergy.Clear(); DetectorEfficiency.Clear(); + infoDetector = info; for(int i=0;iGetNumberRows();i++) { wxString temp0 = tableConstantEficiency->GetCellValue(i,0); @@ -852,8 +882,9 @@ int ElementSRIMArray::GetElementAdress(int Number) } // Ziegler Parameters main constructor -ZieglerParameters::ZieglerParameters( wxChoice* choiceZieglerVersion, wxGrid* tableZieglerParameters) +ZieglerParameters::ZieglerParameters( wxChoice* choiceZieglerVersion, wxGrid* tableZieglerParameters, wxString &info) { + infoZiegler = info; ZieglerVersion = wxString::Format("%d",choiceZieglerVersion->GetSelection()); ZieglerElements.Clear(); ZieglerValues1.Clear(); @@ -903,8 +934,9 @@ ZieglerParameters::ZieglerParameters( wxChoice* choiceZieglerVersion, wxGrid* ta } // Ziegler Parameters main constructor -ZieglerParameters::ZieglerParameters( wxTextCtrl* textZieglerFunction, wxChoice* choiceZieglerVersion, wxGrid* tableZieglerParameters) +ZieglerParameters::ZieglerParameters( wxTextCtrl* textZieglerFunction, wxChoice* choiceZieglerVersion, wxGrid* tableZieglerParameters, wxString &info) { + infoZiegler = info; ZieglerVersion = wxString::Format("%d",choiceZieglerVersion->GetSelection()); ZieglerFunction = textZieglerFunction->GetValue(); ZieglerElements.Clear(); @@ -1094,29 +1126,3 @@ bool ZieglerParameters::FixElementNames() } -// Element Database standard constructor -ElementDatabase::ElementDatabase(wxTextCtrl* EditElement, wxTextCtrl* EditGamma, wxTextCtrl* EditNumber, wxTextCtrl* EditAbundance, wxTextCtrl* EditAtomic, wxTextCtrl* EditIsotopic, wxGrid* DataEditor) -{ - dataEditElement = EditElement->GetValue(); - dataEditGamma = EditGamma->GetValue(); - dataEditNumber = EditNumber->GetValue(); - dataEditAbundance = EditAbundance->GetValue(); - dataEditAtomic = EditAtomic->GetValue(); - dataEditIsotopic = EditIsotopic->GetValue(); - dataEnergy.Clear(); - dataEnergyError.Clear(); - dataSigma.Clear(); - dataSigmaError.Clear(); - for(int i=0;iGetNumberRows();i++) - { - wxString temp0 = DataEditor->GetCellValue(i,0); - wxString temp1 = DataEditor->GetCellValue(i,1); - wxString temp2 = DataEditor->GetCellValue(i,2); - wxString temp3 = DataEditor->GetCellValue(i,3); - dataEnergy.Add(temp0); - dataEnergyError.Add(temp1); - dataSigma.Add(temp2); - dataSigmaError.Add(temp3); - } -} - diff --git a/src/DatabaseLibrary.h b/src/DatabaseLibrary.h index ec963a6..325f192 100644 --- a/src/DatabaseLibrary.h +++ b/src/DatabaseLibrary.h @@ -31,10 +31,11 @@ class ElementDatabase wxArrayString dataEnergyError; wxArrayString dataSigma; wxArrayString dataSigmaError; + wxString infoElement; public: ElementDatabase() {}; - ElementDatabase(wxString Name, wxString Gamma, wxString Number, wxString Abundance, wxString Atomic, wxString Isotopic, wxArrayString Energy, wxArrayString EnergyError, wxArrayString Sigma, wxArrayString SigmaError); - ElementDatabase(wxTextCtrl* EditElement, wxTextCtrl* EditGamma, wxTextCtrl* EditNumber, wxTextCtrl* EditAbundance, wxTextCtrl* EditAtomic, wxTextCtrl* EditIsotopic, wxGrid* DataEditor); + ElementDatabase(wxString Name, wxString Gamma, wxString Number, wxString Abundance, wxString Atomic, wxString Isotopic, wxArrayString Energy, wxArrayString EnergyError, wxArrayString Sigma, wxArrayString SigmaError, wxString Info); + ElementDatabase(wxTextCtrl* EditElement, wxTextCtrl* EditGamma, wxTextCtrl* EditNumber, wxTextCtrl* EditAbundance, wxTextCtrl* EditAtomic, wxTextCtrl* EditIsotopic, wxString EditInfo, wxGrid* DataEditor); bool SetElement(wxString NewName){ dataEditElement = NewName; return true;}; bool CheckElement(); wxString GetElement(){return dataEditElement;}; @@ -47,7 +48,9 @@ class ElementDatabase wxArrayString GetEnergyError(){return dataEnergyError;}; wxArrayString GetSigma(){return dataSigma;}; wxArrayString GetSigmaError(){return dataSigmaError;}; - bool GetAllElementInfo(wxTextCtrl* &SetElement, wxTextCtrl* &SetGammaPeak, wxTextCtrl* &SetNumber, wxTextCtrl* &SetAbundance, wxTextCtrl* &SetMass, wxTextCtrl* &SetIsotopic, wxGrid* &SetEnergySigmaErrorTable); + void SetInfo(wxString f){infoElement = f; return;}; + wxString GetInfo(){return infoElement;}; + bool GetAllElementInfo(wxTextCtrl* &SetElement, wxTextCtrl* &SetGammaPeak, wxTextCtrl* &SetNumber, wxTextCtrl* &SetAbundance, wxTextCtrl* &SetMass, wxTextCtrl* &SetIsotopic, wxString &SetInfo, wxGrid* &SetEnergySigmaErrorTable); }; class ElementDatabaseArray : public ElementDatabaseList @@ -56,6 +59,7 @@ class ElementDatabaseArray : public ElementDatabaseList int CharToNumber(wxString c); double StringToNumber(wxString s); bool SwapStrings(wxString a, wxString b); + wxString infoDatabase; public: ElementDatabaseArray(){}; bool NewElement(ElementDatabase CandidateElement, bool Overwrite); @@ -66,6 +70,8 @@ class ElementDatabaseArray : public ElementDatabaseList bool ResetElementGammaMenu(wxChoice* &ElementList, wxChoice* &GammaPeakList){ return this->RebuildElementGammaMenu(ElementList, GammaPeakList, -1); }; wxArrayString GetAllListElements(); wxArrayString GetAllListGammaPeaks(wxString SearchElement); + void SetInfo(wxString f){infoDatabase = f; return;}; + wxString GetInfo(){return infoDatabase;}; bool SortElementDatabase(); }; @@ -76,15 +82,18 @@ class DetectorParameters wxString DetectorFunction; wxArrayString DetectorEnergy; wxArrayString DetectorEfficiency; + wxString infoDetector; public: DetectorParameters(){}; - DetectorParameters(wxTextCtrl* textFunctionEficiency, wxGrid* tableConstantEficiency); + DetectorParameters(wxTextCtrl* textFunctionEficiency, wxGrid* tableConstantEficiency, wxString &info); wxString GetDetectorFunction(){return DetectorFunction;}; wxArrayString GetDetectorEnergy(){return DetectorEnergy;}; wxArrayString GetDetectorEfficiency(){return DetectorEfficiency;}; void SetDetectorFunction(wxString f){ DetectorFunction = f; return;}; void AddEnergyEfficiencyData(wxString Energy, wxString Efficiency){ DetectorEnergy.Add(Energy); DetectorEfficiency.Add(Efficiency); return;}; bool GetDisplay(wxTextCtrl* &SetDetectorFunction, wxGrid* &DetectorTable); + void SetInfo(wxString f){infoDetector = f; return;}; + wxString GetInfo(){return infoDetector;}; void Clear(); }; @@ -141,10 +150,11 @@ class ZieglerParameters wxArrayString ZieglerMass; wxString ZieglerVersion; wxString ZieglerFunction; + wxString infoZiegler; public: ZieglerParameters(){}; - ZieglerParameters( wxChoice* choiceZieglerVersion, wxGrid* tableZieglerParameters); - ZieglerParameters( wxTextCtrl* textZieglerFunction, wxChoice* choiceZieglerVersion, wxGrid* tableZieglerParameters); + ZieglerParameters( wxChoice* choiceZieglerVersion, wxGrid* tableZieglerParameters, wxString &info); + ZieglerParameters( wxTextCtrl* textZieglerFunction, wxChoice* choiceZieglerVersion, wxGrid* tableZieglerParameters, wxString &info); wxArrayString GetZieglerElements(){return ZieglerElements;}; wxArrayString GetZieglerValues1(){return ZieglerValues1;}; wxArrayString GetZieglerValues2(){return ZieglerValues2;}; @@ -168,6 +178,8 @@ class ZieglerParameters void Clear(); void SetZieglerFunction(wxString f){ ZieglerFunction = f; return;}; wxString GetZieglerFunction(){return ZieglerFunction;}; + void SetInfo(wxString f){infoZiegler = f; return;}; + wxString GetInfo(){return infoZiegler;}; }; diff --git a/src/Detector.html b/src/Detector.html deleted file mode 100644 index cc58e13..0000000 --- a/src/Detector.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - -

-ERYA : Detector -

-


- -

-

-The Detector Setup editor is a -simple tool to handle the datafile that models the detector -efficiency at an certain range of energies.

-

-The minimum requirement is to -export, or type an array of data that should contain a pair of values -that models the efficiency in function of energy. (The program will -assume the energy is in keV, and the efficiency is a dimensionless -value between zero and one).

-

-The main rule is if you have -the major number of points, and the greater range of energies, you -got the better accuracy of the main program calculations.

-

-Alternatively, you can fill a -model function using the built-in ERYA macro language, that will -override the interpolation table, and make a direct calculation -instead.

-


- -

-

-Using the Interpolation -Table

-


- -

-

-To force ERYA to use table -interpolation, it’s required to fill the maximum number of -experimental points on the built-in spreadsheet table, and clean the -function input-box on top window.

-

-ERYA will interpolate the -efficiency by make a linear interpolation between the two nearest -experimental points of energy, respected to the energy input.

-

-Any efficiency calculated -outside the table energy range will return zero value.

-


- -

-

-Using a Function Model

-


- -

-

-To bypass the table -interpolation, it is required to fill a custom function on top window -input-box. -

-

-A typical custom-function for -Detector’s Efficiency have the following format, like in this -example:

-

-fxvar = E, fyvar = F : -a3=-3.E4, a2=-276, a1=10, a0=1.5E-4 : F = a0 + a1/E + a2/E^2 + a3/E^3

-


- -

-

-When ERYA detects a valid -algebraic function, will ignore any table data, and use exclusively -the direct function evaluation.

-

Further -information about writing a custom function can be accessed here.

-


- -

-

-Supported File Formats

-


- -

-

-ERYA support a native file -format to store the Detector data and the user-defined Detector -Function (epsd), where the structure are on XML format.

-

-Due to interchange with other -kind of softwares, ERYA supports two additional file formats:

-

-- A normal ASCII file, filled -with two columns of numerical data.

-

-- An Excel file, where use two -columns to fill the table data.

-

-Notice that on those two -formats, it’s not possible to store a custom algebraic function.

-


- -

-

-ERYA will import Excel files -as long the relevant table is found on first sheet, and forms a -compact matrix of two columns of data.

-

-During table parsing, it will -ignore any line with non-numeric data. The lines with numeric data -will be placed on the Detector’s table.

-

-The same thing will happen -with ASCII files.

-


- -

- - \ No newline at end of file diff --git a/src/ERYAPIXE.cpp b/src/ERYAPIXE.cpp index 7813d59..795bb14 100644 --- a/src/ERYAPIXE.cpp +++ b/src/ERYAPIXE.cpp @@ -95,9 +95,6 @@ MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, co mMainMenu->Append( menuDatabase, wxT("Database") ); menuHelp = new wxMenu(); - wxMenuItem* menuHelpGuide; - menuHelpGuide = new wxMenuItem( menuHelp, wxID_ANY, wxString( wxT("User Guide") ) , wxEmptyString, wxITEM_NORMAL ); - menuHelp->Append( menuHelpGuide ); wxMenuItem* menuHelpAbout; menuHelpAbout = new wxMenuItem( menuHelp, wxID_ANY, wxString( wxT("About ERYA") ) , wxEmptyString, wxITEM_NORMAL ); @@ -403,15 +400,16 @@ MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, co buttonMainCheck->SetBackgroundColour(wxColour(96,128,176,wxALPHA_OPAQUE)); sizerMainButtons->Add( buttonMainCheck, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + buttonMainHelp = new wxButton( this, wxID_ANY, wxT("Norm Table"), wxDefaultPosition, wxDefaultSize, 0 ); + buttonMainHelp->SetFont(TableFont); + buttonMainHelp->SetBackgroundColour(wxColour(96,128,176,wxALPHA_OPAQUE)); + sizerMainButtons->Add( buttonMainHelp, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + buttonMainAdvanced = new wxButton( this, wxID_ANY, wxT("Advanced"), wxDefaultPosition, wxDefaultSize, 0 ); buttonMainAdvanced->SetFont(TableFont); buttonMainAdvanced->SetBackgroundColour(wxColour(96,128,176,wxALPHA_OPAQUE)); sizerMainButtons->Add( buttonMainAdvanced, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - buttonMainHelp = new wxButton( this, wxID_ANY, wxT("Help"), wxDefaultPosition, wxDefaultSize, 0 ); - buttonMainHelp->SetFont(TableFont); - buttonMainHelp->SetBackgroundColour(wxColour(96,128,176,wxALPHA_OPAQUE)); - sizerMainButtons->Add( buttonMainHelp, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); buttonMainFit = new wxButton( this, wxID_ANY, wxT("Run"), wxDefaultPosition, wxDefaultSize, 0 ); buttonMainFit->SetFont(TableFont); @@ -446,7 +444,6 @@ MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, co this->Connect( menuDatabaseElements->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnDatabaseElements ) ); this->Connect( menuDatabaseZiegler->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnDatabaseZiegler ) ); this->Connect( menuDatabaseSetup->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnDatabaseSetup ) ); - this->Connect( menuHelpGuide->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnHelpGuide ) ); this->Connect( menuHelpAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnHelpAbout ) ); choiceElement.Last()->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainFrame::OnElement ), NULL, this ); choiceGP.Last()->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainFrame::OnGammaPeak ), NULL, this ); @@ -472,7 +469,6 @@ MainFrame::~MainFrame() this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnDatabaseElements ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnDatabaseZiegler ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnDatabaseSetup ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnHelpGuide ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnHelpAbout ) ); choiceElement.Last()->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainFrame::OnElement ), NULL, this ); choiceGP.Last()->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainFrame::OnGammaPeak ), NULL, this ); @@ -623,7 +619,7 @@ dialogDatabaseManager::dialogDatabaseManager( wxWindow* parent, wxWindowID id, c buttonCancel = new wxButton( this, wxID_ANY, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); sizerButtons->Add( buttonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - buttonHelp = new wxButton( this, wxID_ANY, wxT("Help"), wxDefaultPosition, wxDefaultSize, 0 ); + buttonHelp = new wxButton( this, wxID_ANY, wxT("Get Info"), wxDefaultPosition, wxDefaultSize, 0 ); sizerButtons->Add( buttonHelp, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); @@ -717,7 +713,6 @@ dialogAddDatabase::dialogAddDatabase( wxWindow* parent, wxWindowID id, const wxS textEditIsotopic = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); sizerEditor->Add( textEditIsotopic, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - sizerDatabaseEditor->Add( sizerEditor, 0, wxEXPAND, 5 ); separatorEditor = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); @@ -790,7 +785,7 @@ dialogAddDatabase::dialogAddDatabase( wxWindow* parent, wxWindowID id, const wxS buttonEditCancel = new wxButton( this, wxID_ANY, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); sizerEditButtons->Add( buttonEditCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - buttonEditHelp = new wxButton( this, wxID_ANY, wxT("Help"), wxDefaultPosition, wxDefaultSize, 0 ); + buttonEditHelp = new wxButton( this, wxID_ANY, wxT("Get Info"), wxDefaultPosition, wxDefaultSize, 0 ); sizerEditButtons->Add( buttonEditHelp, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); @@ -912,7 +907,7 @@ dialogDetectorSetup::dialogDetectorSetup( wxWindow* parent, wxWindowID id, const buttonEficiencyCancel = new wxButton( this, wxID_ANY, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); sizerButtonSetup->Add( buttonEficiencyCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - buttonEficiencyHelp = new wxButton( this, wxID_ANY, wxT("Help"), wxDefaultPosition, wxDefaultSize, 0 ); + buttonEficiencyHelp = new wxButton( this, wxID_ANY, wxT("Get Info"), wxDefaultPosition, wxDefaultSize, 0 ); sizerButtonSetup->Add( buttonEficiencyHelp, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); @@ -1157,7 +1152,7 @@ dialogZieglerParameters::dialogZieglerParameters( wxWindow* parent, wxWindowID i buttonZieglerCancel = new wxButton( this, wxID_ANY, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); sizerZieglerButtons->Add( buttonZieglerCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - buttonZieglerHelp = new wxButton( this, wxID_ANY, wxT("Help"), wxDefaultPosition, wxDefaultSize, 0 ); + buttonZieglerHelp = new wxButton( this, wxID_ANY, wxT("Get Info"), wxDefaultPosition, wxDefaultSize, 0 ); sizerZieglerButtons->Add( buttonZieglerHelp, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); @@ -1310,71 +1305,6 @@ dialogSetup::~dialogSetup() } -dialogHelp::dialogHelp( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* sizerHelpViewer; - sizerHelpViewer = new wxBoxSizer( wxVERTICAL ); - - pageHelpViewer = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO ); - sizerHelpViewer->Add( pageHelpViewer, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - lineHelpViewer = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - sizerHelpViewer->Add( lineHelpViewer, 0, wxEXPAND | wxALL, 5 ); - - wxGridSizer* sizerHelpButtons; - sizerHelpButtons = new wxGridSizer( 1, 6, 0, 0 ); - - buttonHelpMain = new wxButton( this, wxID_ANY, wxT("Main Page"), wxDefaultPosition, wxDefaultSize, 0 ); - sizerHelpButtons->Add( buttonHelpMain, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - buttonHelpIndex = new wxButton( this, wxID_ANY, wxT("Index"), wxDefaultPosition, wxDefaultSize, 0 ); - sizerHelpButtons->Add( buttonHelpIndex, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - buttonHelpReadme = new wxButton( this, wxID_ANY, wxT("Read Me"), wxDefaultPosition, wxDefaultSize, 0 ); - sizerHelpButtons->Add( buttonHelpReadme, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - buttonHelpBack = new wxButton( this, wxID_ANY, wxT("Back"), wxDefaultPosition, wxDefaultSize, 0 ); - sizerHelpButtons->Add( buttonHelpBack, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - buttonHelpForward = new wxButton( this, wxID_ANY, wxT("Forward"), wxDefaultPosition, wxDefaultSize, 0 ); - sizerHelpButtons->Add( buttonHelpForward, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - buttonHelpClose = new wxButton( this, wxID_ANY, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - sizerHelpButtons->Add( buttonHelpClose, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - sizerHelpViewer->Add( sizerHelpButtons, 0, wxEXPAND, 5 ); - - - this->SetSizer( sizerHelpViewer ); - this->Layout(); - - this->Centre( wxBOTH ); - - this->SetIcon(ERYA_xpm); - - // Connect Events - buttonHelpMain->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogHelp::OnHelpMain ), NULL, this ); - buttonHelpIndex->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogHelp::OnHelpIndex ), NULL, this ); - buttonHelpReadme->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogHelp::OnHelpReadme ), NULL, this ); - buttonHelpBack->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogHelp::OnHelpBack ), NULL, this ); - buttonHelpForward->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogHelp::OnHelpForward ), NULL, this ); - buttonHelpClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogHelp::OnHelpClose ), NULL, this ); -} - -dialogHelp::~dialogHelp() -{ - // Disconnect Events - buttonHelpMain->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogHelp::OnHelpMain ), NULL, this ); - buttonHelpIndex->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogHelp::OnHelpIndex ), NULL, this ); - buttonHelpReadme->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogHelp::OnHelpReadme ), NULL, this ); - buttonHelpBack->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogHelp::OnHelpBack ), NULL, this ); - buttonHelpForward->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogHelp::OnHelpForward ), NULL, this ); - buttonHelpClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogHelp::OnHelpClose ), NULL, this ); - -} wizardFirstRun::wizardFirstRun( wxWindow* parent, wxWindowID id, const wxString& title, const wxBitmap& bitmap, const wxPoint& pos, long style ) { @@ -1570,7 +1500,7 @@ dialogAdvancedFit::dialogAdvancedFit( wxWindow* parent, wxWindowID id, const wxS buttonAdvancedReset = new wxButton( this, wxID_ANY, wxT("Default"), wxDefaultPosition, wxDefaultSize, 0 ); sizerAdvancedButtons->Add( buttonAdvancedReset, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - buttonAdvancedHelp = new wxButton( this, wxID_ANY, wxT("Help"), wxDefaultPosition, wxDefaultSize, 0 ); + buttonAdvancedHelp = new wxButton( this, wxID_ANY, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0 ); sizerAdvancedButtons->Add( buttonAdvancedHelp, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); sizerAdvanced->Add( sizerAdvancedButtons, 0, wxEXPAND, 5 ); @@ -1649,7 +1579,7 @@ dialogR33DataImport::dialogR33DataImport( wxWindow* parent, wxWindowID id, const buttonR33DataReset = new wxButton( this, wxID_ANY, wxT("Reset"), wxDefaultPosition, wxDefaultSize, 0 ); sizerR33DataButtons->Add( buttonR33DataReset, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - buttonR33DataHelp = new wxButton( this, wxID_ANY, wxT("Help"), wxDefaultPosition, wxDefaultSize, 0 ); + buttonR33DataHelp = new wxButton( this, wxID_ANY, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); sizerR33DataButtons->Add( buttonR33DataHelp, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); sizerDataImport->Add( sizerR33DataButtons, 0, wxEXPAND, 5 ); @@ -1729,7 +1659,7 @@ dialogXlsxDataImport::dialogXlsxDataImport( wxWindow* parent, wxWindowID id, con buttonXlsxDataReset = new wxButton( this, wxID_ANY, wxT("Reset"), wxDefaultPosition, wxDefaultSize, 0 ); sizerXlsxDataButtons->Add( buttonXlsxDataReset, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - buttonXlsxDataHelp = new wxButton( this, wxID_ANY, wxT("Help"), wxDefaultPosition, wxDefaultSize, 0 ); + buttonXlsxDataHelp = new wxButton( this, wxID_ANY, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); sizerXlsxDataButtons->Add( buttonXlsxDataHelp, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); sizerDataImport->Add( sizerXlsxDataButtons, 0, wxEXPAND, 5 ); @@ -1757,3 +1687,48 @@ dialogXlsxDataImport::~dialogXlsxDataImport() } +dialogRemark::dialogRemark( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* sizerRemark; + sizerRemark = new wxBoxSizer( wxVERTICAL ); + + textRemark = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxTE_MULTILINE|wxTE_RICH|wxTE_WORDWRAP ); + sizerRemark->Add( textRemark, 1, wxALL|wxEXPAND, 5 ); + + wxGridSizer* sizerRemarkButton; + sizerRemarkButton = new wxGridSizer( 1, 3, 0, 0 ); + + buttonSave = new wxButton( this, wxID_ANY, wxT("Save"), wxDefaultPosition, wxDefaultSize, 0 ); + sizerRemarkButton->Add( buttonSave, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + buttonClear = new wxButton( this, wxID_ANY, wxT("Clear"), wxDefaultPosition, wxDefaultSize, 0 ); + sizerRemarkButton->Add( buttonClear, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + buttonQuit = new wxButton( this, wxID_ANY, wxT("Quit"), wxDefaultPosition, wxDefaultSize, 0 ); + sizerRemarkButton->Add( buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + sizerRemark->Add( sizerRemarkButton, 0, wxEXPAND, 5 ); + + + this->SetSizer( sizerRemark ); + this->Layout(); + + this->Centre( wxBOTH ); + + // Connect Events + buttonSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogRemark::OnRemarkSave ), NULL, this ); + buttonClear->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogRemark::OnRemarkClear ), NULL, this ); + buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogRemark::OnRemarkQuit ), NULL, this ); +} + +dialogRemark::~dialogRemark() +{ + // Disconnect Events + buttonSave->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogRemark::OnRemarkSave ), NULL, this ); + buttonClear->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogRemark::OnRemarkClear ), NULL, this ); + buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialogRemark::OnRemarkQuit ), NULL, this ); + +} diff --git a/src/ERYAPIXE.h b/src/ERYAPIXE.h index 26f1319..e468afc 100644 --- a/src/ERYAPIXE.h +++ b/src/ERYAPIXE.h @@ -447,39 +447,6 @@ class dialogSetup : public wxDialog }; -/////////////////////////////////////////////////////////////////////////////// -/// Class dialogHelp -/////////////////////////////////////////////////////////////////////////////// -class dialogHelp : public wxDialog -{ - private: - - protected: - wxString helpMainPage; - wxHtmlWindow* pageHelpViewer; - wxStaticLine* lineHelpViewer; - wxButton* buttonHelpMain; - wxButton* buttonHelpIndex; - wxButton* buttonHelpReadme; - wxButton* buttonHelpBack; - wxButton* buttonHelpForward; - wxButton* buttonHelpClose; - - // Virtual event handlers, overide them in your derived class - virtual void OnHelpMain( wxCommandEvent& event ) { event.Skip(); } - virtual void OnHelpIndex( wxCommandEvent& event ) { event.Skip(); } - virtual void OnHelpReadme( wxCommandEvent& event ) { event.Skip(); } - virtual void OnHelpBack( wxCommandEvent& event ) { event.Skip(); } - virtual void OnHelpForward( wxCommandEvent& event ) { event.Skip(); } - virtual void OnHelpClose( wxCommandEvent& event ) { event.Skip(); } - - - public: - - dialogHelp( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("ERYA Help Viewer"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 1200, 720 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~dialogHelp(); - -}; /////////////////////////////////////////////////////////////////////////////// /// Class wizardFirstRun @@ -624,5 +591,30 @@ class dialogXlsxDataImport : public wxDialog }; +/////////////////////////////////////////////////////////////////////////////// +/// Class dialogRemark +/////////////////////////////////////////////////////////////////////////////// +class dialogRemark : public wxDialog +{ + private: + + protected: + wxTextCtrl* textRemark; + wxButton* buttonSave; + wxButton* buttonClear; + wxButton* buttonQuit; + + // Virtual event handlers, overide them in your derived class + virtual void OnRemarkSave( wxCommandEvent& event ) { event.Skip(); } + virtual void OnRemarkClear( wxCommandEvent& event ) { event.Skip(); } + virtual void OnRemarkQuit( wxCommandEvent& event ) { event.Skip(); } + + + public: + + dialogRemark( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Database Remark Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 650,480 ), long style = wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~dialogRemark(); + +}; #endif //__ERYAPIXE_H__ diff --git a/src/ERYAPIXEMainFrame.cpp b/src/ERYAPIXEMainFrame.cpp index aa2501a..1531ad6 100644 --- a/src/ERYAPIXEMainFrame.cpp +++ b/src/ERYAPIXEMainFrame.cpp @@ -22,7 +22,6 @@ #include "ERYAPIXEdialogDetectorSetup.h" #include "ERYAPIXEdialogZieglerParameters.h" #include "ERYAPIXEdialogSetup.h" -#include "ERYAPIXEdialogHelp.h" #include "ERYAPIXEdialogAdvanced.h" #include "ERYAPIXEwizardFirstRun.h" @@ -662,11 +661,6 @@ void ERYAPIXEMainFrame::OnDatabaseSetup( wxCommandEvent& event ) } } -void ERYAPIXEMainFrame::OnHelpGuide( wxCommandEvent& event ) -{ - ERYAPIXEdialogHelp* help = new ERYAPIXEdialogHelp(this,wxT("Main.html")); - help->ShowModal(); -} void ERYAPIXEMainFrame::OnHelpAbout( wxCommandEvent& event ) { @@ -878,8 +872,24 @@ void ERYAPIXEMainFrame::OnMainAdvanced( wxCommandEvent& event ) void ERYAPIXEMainFrame::OnMainHelp( wxCommandEvent& event ) { - ERYAPIXEdialogHelp* help = new ERYAPIXEdialogHelp(this,wxT("Fit.html")); - help->ShowModal(); + for(int k=0; kGetValue(); + if(temp.Len()==0) // Empty values are equal to one, by default. + temp = wxT("1"); + AlgebraicFunction test(temp); + if(test.GetErrorString().Trim().Len()==0) + { + double value = test.GetAnsEval(); + textSG.Item(k)->SetValue(wxString::Format("%f",value)); + } + else + { + wxMessageDialog *dial = new wxMessageDialog(NULL, test.GetErrorString() , wxT("Error at Stoichiometry Guess Entry #") + wxString::Format("%i",k+1), wxOK | wxICON_ERROR); + dial->ShowModal(); + barMainStatus->SetStatusText(wxT("Warning! Invalid input entry, please check the values.") ,0); + } + } } void ERYAPIXEMainFrame::OnMainNew( wxCommandEvent& event ) diff --git a/src/ERYAPIXEMainFrame.h b/src/ERYAPIXEMainFrame.h index 1dec6a4..5ce80a2 100644 --- a/src/ERYAPIXEMainFrame.h +++ b/src/ERYAPIXEMainFrame.h @@ -40,7 +40,6 @@ class ERYAPIXEMainFrame : public MainFrame void OnDatabaseElements( wxCommandEvent& event ); void OnDatabaseZiegler( wxCommandEvent& event ); void OnDatabaseSetup( wxCommandEvent& event ); - void OnHelpGuide( wxCommandEvent& event ); void OnHelpAbout( wxCommandEvent& event ); void OnElement( wxCommandEvent& event ); void OnGammaPeak( wxCommandEvent& event ); diff --git a/src/ERYAPIXEdialogAddDatabase.cpp b/src/ERYAPIXEdialogAddDatabase.cpp index 4c1920d..12f55a1 100644 --- a/src/ERYAPIXEdialogAddDatabase.cpp +++ b/src/ERYAPIXEdialogAddDatabase.cpp @@ -19,9 +19,9 @@ #include "ERYAPIXEdialogAddDatabase.h" #include "ERYAPIXEdialogDatabaseManager.h" -#include "ERYAPIXEdialogHelp.h" #include "ERYAPIXEdialogR33DataImport.h" #include "ERYAPIXEdialogXlsxDataImport.h" +#include "ERYAPIXEdialogRemark.h" #include "R33Library.h" #include "DatabaseLibrary.h" #include "ParserLibrary.h" @@ -40,7 +40,7 @@ dialogAddDatabase( parent ) { ElementDatabase OpenActualElement; Parent->GetElement(OpenActualElement); - OpenActualElement.GetAllElementInfo(textEditElement,textEditGamma,textEditNumber,textEditAbundance,textEditAtomic,textEditIsotopic,tableDataEditor); + OpenActualElement.GetAllElementInfo(textEditElement,textEditGamma,textEditNumber,textEditAbundance,textEditAtomic,textEditIsotopic,infoRemark,tableDataEditor); } } @@ -131,7 +131,7 @@ wxFileName file(CurrentIBANDLFilePath); if(file.GetExt() == wxT("r33")) { R33File openfile(CurrentIBANDLFilePath); - if(openfile.IBANDLFileLoad(tableDataEditor,textEditElement,textEditGamma,textEditNumber,textEditAbundance,textEditAtomic,textEditIsotopic)) + if(openfile.IBANDLFileLoad(tableDataEditor,textEditElement,textEditGamma,textEditNumber,textEditAbundance,textEditAtomic,textEditIsotopic,infoRemark)) { wxMessageDialog *info = new wxMessageDialog(NULL, wxT("Cross-Section of selected IBANDL file,\nalong some additional data,\nwas successfully imported.") , wxT("Import Successful!"), wxOK); info->ShowModal(); @@ -253,6 +253,7 @@ else if (file.GetExt() == wxT("xlsx")) dial->ShowModal(); tableDataEditor->ClearGrid(); } + infoRemark = wxT("Element's original data extracted from an Excel file."); } else { @@ -266,7 +267,7 @@ else ERYAPIXEdialogR33DataImport* datapanel = new ERYAPIXEdialogR33DataImport(this); datapanel->ShowModal(); ITNFile openfile(CurrentIBANDLFilePath,Units,Angles,IgnoreLine); - if(openfile.ITNFileLoad(tableDataEditor,textEditElement,textEditGamma,textEditNumber,textEditAbundance,textEditAtomic,textEditIsotopic)) + if(openfile.ITNFileLoad(tableDataEditor,textEditElement,textEditGamma,textEditNumber,textEditAbundance,textEditAtomic,textEditIsotopic,infoRemark)) { wxMessageDialog *info = new wxMessageDialog(NULL, wxT("Cross-Section of selected ASCII file,\nwas successfully imported.") , wxT("Import Successful!"), wxOK); info->ShowModal(); @@ -283,7 +284,7 @@ wxFileDialog *SaveDialog = new wxFileDialog(this, wxT("Export current element ta if (SaveDialog->ShowModal() == wxID_OK) // If the user clicked "OK" { // Get the current local frame data - ElementDatabase TestElement(textEditElement,textEditGamma,textEditNumber,textEditAbundance,textEditAtomic,textEditIsotopic,tableDataEditor); + ElementDatabase TestElement(textEditElement,textEditGamma,textEditNumber,textEditAbundance,textEditAtomic,textEditIsotopic,infoRemark,tableDataEditor); // Check if their contents are valid if(!(TestElement.CheckElement())) { @@ -299,7 +300,7 @@ wxFileName file(CurrentIBANDLFilePath); if(file.GetExt() == wxT("r33")) { R33File savefile(CurrentIBANDLFilePath); - if(savefile.IBANDLFileSave(tableDataEditor,textEditElement,textEditGamma,textEditNumber,textEditAbundance,textEditAtomic,textEditIsotopic)) // Save the IBANDL file to the built-in data editor + if(savefile.IBANDLFileSave(tableDataEditor,textEditElement,textEditGamma,textEditNumber,textEditAbundance,textEditAtomic,textEditIsotopic,infoRemark)) // Save the IBANDL file to the built-in data editor { wxMessageDialog *info = new wxMessageDialog(NULL, wxT("Current Element exported to file successfully!") , wxT("Export Successful!"), wxOK); info->ShowModal(); @@ -385,7 +386,7 @@ else if (file.GetExt() == wxT("xlsx")) else { ITNFile savefile(CurrentIBANDLFilePath); - if(savefile.ITNFileSave(tableDataEditor,textEditElement,textEditGamma,textEditNumber,textEditAbundance,textEditAtomic,textEditIsotopic)) + if(savefile.ITNFileSave(tableDataEditor,textEditElement,textEditGamma,textEditNumber,textEditAbundance,textEditAtomic,textEditIsotopic,infoRemark)) { wxMessageDialog *info = new wxMessageDialog(NULL, wxT("Current Element exported to file successfully!") , wxT("Export Successful!"), wxOK); info->ShowModal(); @@ -405,6 +406,7 @@ textEditNumber->Clear(); textEditAbundance->Clear(); textEditAtomic->Clear(); textEditIsotopic->Clear(); +infoRemark.Clear(); } void ERYAPIXEdialogAddDatabase::OnEditSave( wxCommandEvent& event ) @@ -412,7 +414,7 @@ void ERYAPIXEdialogAddDatabase::OnEditSave( wxCommandEvent& event ) if(textEditElement->GetValue() != wxEmptyString && textEditGamma->GetValue() != wxEmptyString && textEditNumber->GetValue() != wxEmptyString && textEditAbundance->GetValue() != wxEmptyString && textEditAtomic->GetValue() != wxEmptyString && textEditIsotopic->GetValue() != wxEmptyString) { // Get the current local frame data - ElementDatabase EditElement(textEditElement,textEditGamma,textEditNumber,textEditAbundance,textEditAtomic,textEditIsotopic,tableDataEditor); + ElementDatabase EditElement(textEditElement,textEditGamma,textEditNumber,textEditAbundance,textEditAtomic,textEditIsotopic,infoRemark,tableDataEditor); // Check if their contents are valid if(!(EditElement.CheckElement())) { @@ -449,6 +451,6 @@ Close(); void ERYAPIXEdialogAddDatabase::OnEditHelp( wxCommandEvent& event ) { - ERYAPIXEdialogHelp* help = new ERYAPIXEdialogHelp(this,wxT("Element.html")); - help->ShowModal(); + ERYAPIXEdialogRemark *remark = new ERYAPIXEdialogRemark(this,infoRemark,0); + remark->ShowModal(); } diff --git a/src/ERYAPIXEdialogAddDatabase.h b/src/ERYAPIXEdialogAddDatabase.h index cf57234..fe0e926 100644 --- a/src/ERYAPIXEdialogAddDatabase.h +++ b/src/ERYAPIXEdialogAddDatabase.h @@ -24,6 +24,7 @@ class ERYAPIXEdialogAddDatabase : public dialogAddDatabase private: int Units,Angles,Profile; bool IgnoreLine; + wxString infoRemark; protected: // Handlers for dialogAddDatabase events. void OnDatabaseSelect( wxGridRangeSelectEvent& event ); @@ -38,10 +39,11 @@ class ERYAPIXEdialogAddDatabase : public dialogAddDatabase public: /** Constructor */ ERYAPIXEdialogAddDatabase( wxWindow* parent); - void SetSelectUnit(int SigmaUnit){Units = SigmaUnit; return;} - void SetSelectAngle(int SigmaAngle){Angles = SigmaAngle; return;} - void SetSelectMode(int SigmaProfile){Profile = SigmaProfile; return;} - void SetIgnoreInvalidLine(bool ParserErrorDisable){IgnoreLine = ParserErrorDisable; return;} + void SetSelectUnit(int SigmaUnit){Units = SigmaUnit; return;}; + void SetSelectAngle(int SigmaAngle){Angles = SigmaAngle; return;}; + void SetSelectMode(int SigmaProfile){Profile = SigmaProfile; return;}; + void SetIgnoreInvalidLine(bool ParserErrorDisable){IgnoreLine = ParserErrorDisable; return;}; + void SetRemark(wxString &info){infoRemark = info; return;}; //// end generated class members diff --git a/src/ERYAPIXEdialogAdvanced.cpp b/src/ERYAPIXEdialogAdvanced.cpp index c3031f5..53c7d02 100644 --- a/src/ERYAPIXEdialogAdvanced.cpp +++ b/src/ERYAPIXEdialogAdvanced.cpp @@ -10,7 +10,6 @@ #include "ERYAPIXEdialogAdvanced.h" #include "ERYAPIXEMainFrame.h" -#include "ERYAPIXEdialogHelp.h" ERYAPIXEdialogAdvanced::ERYAPIXEdialogAdvanced( wxWindow* parent ) @@ -63,7 +62,7 @@ void ERYAPIXEdialogAdvanced::OnAdvancedReset( wxCommandEvent& event ) ERYAPIXEMainFrame *Parent = (ERYAPIXEMainFrame *) GetParent(); // Sync the local data from parent frame to child frame Parent->SyncFitParameters(LocalIterations,LocalTau,LocalYield,LocalStoichiometry); - // Set the apropriate selectors + // Set the appropriate selectors spinNumberIterations->SetValue(100); spinDampingFactor->SetValue(3); spinYieldConvergence->SetValue(3); @@ -72,6 +71,5 @@ void ERYAPIXEdialogAdvanced::OnAdvancedReset( wxCommandEvent& event ) void ERYAPIXEdialogAdvanced::OnAdvancedHelp( wxCommandEvent& event ) { - ERYAPIXEdialogHelp* help = new ERYAPIXEdialogHelp(this,wxT("Fitextra.html")); - help->ShowModal(); + Close(); } diff --git a/src/ERYAPIXEdialogDatabaseManager.cpp b/src/ERYAPIXEdialogDatabaseManager.cpp index 56bac52..7b44bee 100644 --- a/src/ERYAPIXEdialogDatabaseManager.cpp +++ b/src/ERYAPIXEdialogDatabaseManager.cpp @@ -19,8 +19,8 @@ #include "ERYAPIXEdialogAddDatabase.h" #include "ERYAPIXEdialogDatabaseManager.h" -#include "ERYAPIXEdialogHelp.h" #include "ERYAPIXEMainFrame.h" +#include "ERYAPIXEdialogRemark.h" #include "PlotLibrary.h" #include "FileLibrary.h" @@ -124,7 +124,7 @@ void ERYAPIXEdialogDatabaseManager::OnDatabaseEdit( wxCommandEvent& event ) void ERYAPIXEdialogDatabaseManager::OnDatabaseRemove( wxCommandEvent& event ) { - wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("Delete the displayed element of the database?"), wxT("Confirm deletation."), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION); + wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("Delete the displayed element of the database?"), wxT("Confirm delectation."), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION); if (dial->ShowModal() == wxID_YES) { int i = choiceElementName->GetSelection(); @@ -159,6 +159,7 @@ void ERYAPIXEdialogDatabaseManager::OnDatabaseClear( wxCommandEvent& event ) textIsotopicMass->Clear(); tableElementViewer->ClearGrid(); renderElementViewer->DelAllLayers(false,true); + infoRemark.Clear(); } } @@ -167,7 +168,7 @@ void ERYAPIXEdialogDatabaseManager::OnDatabaseLoad( wxCommandEvent& event ) ERYAPIXEMainFrame *Parent = (ERYAPIXEMainFrame *) GetParent(); wxString DefaultDatabaseDirectory; Parent->GetConfig(DefaultDatabaseDirectory); -wxFileDialog *OpenDialog = new wxFileDialog(this, wxT("Select a ERYA Database to open"), DefaultDatabaseDirectory, wxEmptyString, wxT("ERYA database (*.epd)|*.epd|LabView ERYA database (*.txt)|*.txt"), wxFD_OPEN, wxDefaultPosition); +wxFileDialog *OpenDialog = new wxFileDialog(this, wxT("Select a ERYA Database to open"), DefaultDatabaseDirectory, wxEmptyString, wxT("ERYA database (*.epd)|*.epd|Legacy ERYA database (*.txt)|*.txt"), wxFD_OPEN, wxDefaultPosition); if (OpenDialog->ShowModal() == wxID_OK) { MainDatabaseFile = OpenDialog->GetPath(); @@ -242,6 +243,8 @@ void ERYAPIXEdialogDatabaseManager::OnDatabaseCancel( wxCommandEvent& event ) void ERYAPIXEdialogDatabaseManager::OnDatabaseHelp( wxCommandEvent& event ) { - ERYAPIXEdialogHelp* help = new ERYAPIXEdialogHelp(this,wxT("Database.html")); - help->ShowModal(); + infoRemark = MainDatabase.GetInfo(); + ERYAPIXEdialogRemark *remark = new ERYAPIXEdialogRemark(this,infoRemark,1); + remark->ShowModal(); + MainDatabase.SetInfo(infoRemark); } diff --git a/src/ERYAPIXEdialogDatabaseManager.h b/src/ERYAPIXEdialogDatabaseManager.h index 2a2204b..cee45f0 100644 --- a/src/ERYAPIXEdialogDatabaseManager.h +++ b/src/ERYAPIXEdialogDatabaseManager.h @@ -23,6 +23,8 @@ Subclass of dialogDatabaseManager, which is generated by wxFormBuilder. /** Implementing dialogDatabaseManager */ class ERYAPIXEdialogDatabaseManager : public dialogDatabaseManager { + private: + wxString infoRemark; protected: // Handlers for dialogDatabaseManager events. void OnElementName( wxCommandEvent& event ); @@ -46,6 +48,7 @@ class ERYAPIXEdialogDatabaseManager : public dialogDatabaseManager void GetElement(ElementDatabase& ThisElement) {ThisElement = EditElement; return;} // Safe retrieving method void SaveElement(bool FlagElement) { WriteElement = FlagElement; } // Get save flag method void ModifyElement(bool& FlagEdit) { FlagEdit = ChangeElement; return;} // Get edit flag method + void SetRemark(wxString &info){infoRemark = info; MainDatabase.SetInfo(infoRemark); return;}; //// end generated class members diff --git a/src/ERYAPIXEdialogDetectorSetup.cpp b/src/ERYAPIXEdialogDetectorSetup.cpp index 851d1bc..5ffba1d 100644 --- a/src/ERYAPIXEdialogDetectorSetup.cpp +++ b/src/ERYAPIXEdialogDetectorSetup.cpp @@ -8,8 +8,8 @@ **************************************************************/ #include "ERYAPIXEdialogDetectorSetup.h" -#include "ERYAPIXEdialogHelp.h" #include "ERYAPIXEMainFrame.h" +#include "ERYAPIXEdialogRemark.h" ERYAPIXEdialogDetectorSetup::ERYAPIXEdialogDetectorSetup( wxWindow* parent ) @@ -116,7 +116,7 @@ if (OpenDialog->ShowModal() == wxID_OK) { wxString ERYAPIXESetupPath = OpenDialog->GetPath(); wxFileName file(ERYAPIXESetupPath); -DetectorParameters LocalDetector(textFunctionEficiency, tableConstantEficiency); +DetectorParameters LocalDetector(textFunctionEficiency, tableConstantEficiency, infoRemark); DetectorFile localfile(ERYAPIXESetupPath,file.GetExt(),LocalDetector); if (localfile.DetectorFileLoad()) { @@ -147,7 +147,7 @@ if (SaveDialog->ShowModal() == wxID_OK) wxString ERYAPIXESetupPath = SaveDialog->GetPath(); // If the user choose the legacy version, the custom function are ignored. wxFileName file(ERYAPIXESetupPath); -DetectorParameters LocalDetector(textFunctionEficiency, tableConstantEficiency); +DetectorParameters LocalDetector(textFunctionEficiency, tableConstantEficiency, infoRemark); DetectorFile localfile(ERYAPIXESetupPath,file.GetExt(),LocalDetector); if (!(localfile.DetectorFileSave())) { @@ -177,7 +177,7 @@ void ERYAPIXEdialogDetectorSetup::OnEficiencyOK( wxCommandEvent& event ) // Call the parent frame ERYAPIXEMainFrame *Parent = (ERYAPIXEMainFrame *) GetParent(); // Get the current local frame data - DetectorParameters LocalDetector(textFunctionEficiency, tableConstantEficiency); + DetectorParameters LocalDetector(textFunctionEficiency, tableConstantEficiency, infoRemark); // Store the local data from child frame to parent frame Parent->SaveDetector(LocalDetector); // Return to parent frame @@ -193,7 +193,7 @@ void ERYAPIXEdialogDetectorSetup::OnEficiencyOK( wxCommandEvent& event ) // Call the parent frame ERYAPIXEMainFrame *Parent = (ERYAPIXEMainFrame *) GetParent(); // Get the current local frame data - DetectorParameters LocalDetector(textFunctionEficiency, tableConstantEficiency); + DetectorParameters LocalDetector(textFunctionEficiency, tableConstantEficiency, infoRemark); // Store the local data from child frame to parent frame Parent->SaveDetector(LocalDetector); // Return to parent frame @@ -220,6 +220,6 @@ void ERYAPIXEdialogDetectorSetup::OnEficiencyCancel( wxCommandEvent& event ) void ERYAPIXEdialogDetectorSetup::OnEficiencyHelp( wxCommandEvent& event ) { - ERYAPIXEdialogHelp* help = new ERYAPIXEdialogHelp(this,wxT("Detector.html")); - help->ShowModal(); + ERYAPIXEdialogRemark *remark = new ERYAPIXEdialogRemark(this,infoRemark,2); + remark->ShowModal(); } diff --git a/src/ERYAPIXEdialogDetectorSetup.h b/src/ERYAPIXEdialogDetectorSetup.h index 8b9ce5b..6f36613 100644 --- a/src/ERYAPIXEdialogDetectorSetup.h +++ b/src/ERYAPIXEdialogDetectorSetup.h @@ -25,6 +25,8 @@ Subclass of dialogDetectorSetup, which is generated by wxFormBuilder. /** Implementing dialogDetectorSetup */ class ERYAPIXEdialogDetectorSetup : public dialogDetectorSetup { + private: + wxString infoRemark; protected: // Handlers for dialogDetectorSetup events. void OnEficiencySelect( wxGridRangeSelectEvent& event ); @@ -39,6 +41,7 @@ class ERYAPIXEdialogDetectorSetup : public dialogDetectorSetup public: /** Constructor */ ERYAPIXEdialogDetectorSetup( wxWindow* parent ); + void SetRemark(wxString &info){infoRemark = info; return;}; //// end generated class members diff --git a/src/ERYAPIXEdialogHelp.cpp b/src/ERYAPIXEdialogHelp.cpp deleted file mode 100644 index 08857e0..0000000 --- a/src/ERYAPIXEdialogHelp.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/*************************************************************** - * Name: ERYAPIXEdialogHelp.cpp - * Purpose: ERYA Help Viewer implementation - * Author: Vasco Manteigas (vm.manteigas@campus.fct.utl.pt) - * Created: 2015-12-01 - * Copyright: Grupo de Reacoes Nucleares - LIBPHYS - * License: - **************************************************************/ - -#include "ERYAPIXEdialogHelp.h" -#include "ERYAPIXEMainFrame.h" -#include "ERYAPIXEdialogAddDatabase.h" -#include "ERYAPIXEdialogDatabaseManager.h" -#include "ERYAPIXEdialogDetectorSetup.h" -#include "ERYAPIXEdialogZieglerParameters.h" -#include "ERYAPIXEdialogAdvanced.h" -#include "ERYAPIXEdialogR33DataImport.h" -#include "ERYAPIXEdialogXlsxDataImport.h" - -ERYAPIXEdialogHelp::ERYAPIXEdialogHelp( wxWindow* parent ) -: -dialogHelp( parent ) -{ - -} - -ERYAPIXEdialogHelp::ERYAPIXEdialogHelp( wxWindow* parent, wxString HelpFile) -: -dialogHelp( parent ) -{ - wxString rootpath = ::wxStandardPaths::Get().GetExecutablePath(); - wxFileName rootfile(rootpath); - rootpath = rootfile.GetPath(); - pageHelpViewer->LoadPage(rootpath + wxFileName::GetPathSeparator() + HelpFile); - helpMainPage = HelpFile; -} - -void ERYAPIXEdialogHelp::OnHelpMain( wxCommandEvent& event ) -{ - wxString rootpath = ::wxStandardPaths::Get().GetExecutablePath(); - wxFileName rootfile(rootpath); - rootpath = rootfile.GetPath(); - pageHelpViewer->LoadPage(rootpath + wxFileName::GetPathSeparator() + helpMainPage); -} - -void ERYAPIXEdialogHelp::OnHelpIndex( wxCommandEvent& event ) -{ - wxString rootpath = ::wxStandardPaths::Get().GetExecutablePath(); - wxFileName rootfile(rootpath); - rootpath = rootfile.GetPath(); - pageHelpViewer->LoadPage(rootpath + wxFileName::GetPathSeparator() + wxT("Index.html")); -} - -void ERYAPIXEdialogHelp::OnHelpReadme( wxCommandEvent& event ) -{ - wxString rootpath = ::wxStandardPaths::Get().GetExecutablePath(); - wxFileName rootfile(rootpath); - rootpath = rootfile.GetPath(); - pageHelpViewer->LoadPage(rootpath + wxFileName::GetPathSeparator() + wxT("readme.txt")); -} - -void ERYAPIXEdialogHelp::OnHelpBack( wxCommandEvent& event ) -{ - pageHelpViewer->HistoryBack(); -} - -void ERYAPIXEdialogHelp::OnHelpForward( wxCommandEvent& event ) -{ - pageHelpViewer->HistoryForward(); -} - -void ERYAPIXEdialogHelp::OnHelpClose( wxCommandEvent& event ) -{ - Close(); -} diff --git a/src/ERYAPIXEdialogHelp.h b/src/ERYAPIXEdialogHelp.h deleted file mode 100644 index 55dca4b..0000000 --- a/src/ERYAPIXEdialogHelp.h +++ /dev/null @@ -1,43 +0,0 @@ -/*************************************************************** - * Name: ERYAPIXEdialogHelp.h - * Purpose: ERYA Help Viewer implementation - * Author: Vasco Manteigas (vm.manteigas@campus.fct.utl.pt) - * Created: 2015-12-01 - * Copyright: Grupo de Reacoes Nucleares - LIBPHYS - * License: - **************************************************************/ - -#ifndef ERYAPIXEDIALOGHELP_H_INCLUDED -#define ERYAPIXEDIALOGHELP_H_INCLUDED - -/** -@file -Subclass of dialogHelp, which is generated by wxFormBuilder. -*/ - -#include "ERYAPIXE.h" - -//// end generated include - -/** Implementing dialogHelp */ -class ERYAPIXEdialogHelp : public dialogHelp -{ - protected: - // Handlers for dialoghelp events. - void OnHelpMain( wxCommandEvent& event ); - void OnHelpIndex( wxCommandEvent& event ); - void OnHelpReadme( wxCommandEvent& event ); - void OnHelpBack( wxCommandEvent& event ); - void OnHelpForward( wxCommandEvent& event ); - void OnHelpClose( wxCommandEvent& event ); - public: - /** Constructor */ - ERYAPIXEdialogHelp( wxWindow* parent, wxString HelpFile ); - ERYAPIXEdialogHelp( wxWindow* parent ); - //// end generated class members - - -}; - - -#endif // ERYAPIXEDIALOGHELP_H_INCLUDED diff --git a/src/ERYAPIXEdialogR33DataImport.cpp b/src/ERYAPIXEdialogR33DataImport.cpp index 4baef2d..bec70ad 100644 --- a/src/ERYAPIXEdialogR33DataImport.cpp +++ b/src/ERYAPIXEdialogR33DataImport.cpp @@ -9,7 +9,6 @@ #include "ERYAPIXEdialogR33DataImport.h" #include "ERYAPIXEdialogAddDatabase.h" - #include "ERYAPIXEdialogHelp.h" ERYAPIXEdialogR33DataImport::ERYAPIXEdialogR33DataImport( wxWindow* parent) : @@ -45,6 +44,5 @@ void ERYAPIXEdialogR33DataImport::OnDataImportReset( wxCommandEvent& event ) void ERYAPIXEdialogR33DataImport::OnDataImportHelp( wxCommandEvent& event ) { - ERYAPIXEdialogHelp* help = new ERYAPIXEdialogHelp(this,wxT("Element.html")); - help->ShowModal(); + Close(); } diff --git a/src/ERYAPIXEdialogXlsxDataImport.cpp b/src/ERYAPIXEdialogXlsxDataImport.cpp index 66dff54..0ada52b 100644 --- a/src/ERYAPIXEdialogXlsxDataImport.cpp +++ b/src/ERYAPIXEdialogXlsxDataImport.cpp @@ -9,7 +9,6 @@ #include "ERYAPIXEdialogXlsxDataImport.h" #include "ERYAPIXEdialogAddDatabase.h" - #include "ERYAPIXEdialogHelp.h" ERYAPIXEdialogXlsxDataImport::ERYAPIXEdialogXlsxDataImport( wxWindow* parent) : @@ -45,6 +44,5 @@ void ERYAPIXEdialogXlsxDataImport::OnDataImportReset( wxCommandEvent& event ) void ERYAPIXEdialogXlsxDataImport::OnDataImportHelp( wxCommandEvent& event ) { - ERYAPIXEdialogHelp* help = new ERYAPIXEdialogHelp(this,wxT("Element.html")); - help->ShowModal(); + Close(); } diff --git a/src/ERYAPIXEdialogZieglerParameters.cpp b/src/ERYAPIXEdialogZieglerParameters.cpp index 0e00687..1a9ce24 100644 --- a/src/ERYAPIXEdialogZieglerParameters.cpp +++ b/src/ERYAPIXEdialogZieglerParameters.cpp @@ -8,9 +8,8 @@ **************************************************************/ #include "ERYAPIXEdialogZieglerParameters.h" -#include "ERYAPIXEdialogHelp.h" #include "ERYAPIXEMainFrame.h" - +#include "ERYAPIXEdialogRemark.h" ERYAPIXEdialogZieglerParameters::ERYAPIXEdialogZieglerParameters( wxWindow* parent ) : @@ -185,7 +184,7 @@ wxFileDialog *OpenDialog = new wxFileDialog(this, wxT("Select the desired Ziegle wxString ERYAPIXEZieglerPath = OpenDialog->GetPath(); wxFileName ZieglerFileName(ERYAPIXEZieglerPath); wxString Version = ZieglerFileName.GetExt(); - ZieglerParameters LocalParameters(textZieglerFunction, choiceZieglerVersion, tableZieglerParameters); + ZieglerParameters LocalParameters(textZieglerFunction, choiceZieglerVersion, tableZieglerParameters, infoRemark); int DefaultMode; if (tabZieglerTables->GetSelection()==1) DefaultMode = 0; @@ -213,7 +212,7 @@ wxFileDialog *SaveDialog = new wxFileDialog(this, wxT("Save the current Ziegler if (SaveDialog->ShowModal() == wxID_OK) { wxString ERYAPIXEZieglerPath = SaveDialog->GetPath(); - ZieglerParameters LocalZiegler(textZieglerFunction, choiceZieglerVersion,tableZieglerParameters); + ZieglerParameters LocalZiegler(textZieglerFunction, choiceZieglerVersion,tableZieglerParameters, infoRemark); wxFileName ZieglerFileName(ERYAPIXEZieglerPath); wxString Version = ZieglerFileName.GetExt(); int DefaultMode; @@ -256,7 +255,7 @@ void ERYAPIXEdialogZieglerParameters::OnZieglerOK( wxCommandEvent& event ) // Call the parent frame ERYAPIXEMainFrame *Parent = (ERYAPIXEMainFrame *) GetParent(); // Get the current local frame data - ZieglerParameters LocalZiegler(textZieglerFunction,choiceZieglerVersion,tableZieglerParameters); + ZieglerParameters LocalZiegler(textZieglerFunction,choiceZieglerVersion,tableZieglerParameters,infoRemark); // Store the local data from child frame to parent frame Parent->SaveZiegler(LocalZiegler); Parent->SaveSRIM(LocalSRIMTable); @@ -273,7 +272,7 @@ void ERYAPIXEdialogZieglerParameters::OnZieglerOK( wxCommandEvent& event ) // Call the parent frame ERYAPIXEMainFrame *Parent = (ERYAPIXEMainFrame *) GetParent(); // Get the current local frame data - ZieglerParameters LocalZiegler(textZieglerFunction,choiceZieglerVersion,tableZieglerParameters); + ZieglerParameters LocalZiegler(textZieglerFunction,choiceZieglerVersion,tableZieglerParameters,infoRemark); // Store the local data from child frame to parent frame Parent->SaveZiegler(LocalZiegler); Parent->SaveSRIM(LocalSRIMTable); @@ -302,6 +301,6 @@ Close(); void ERYAPIXEdialogZieglerParameters::OnZieglerHelp( wxCommandEvent& event ) { - ERYAPIXEdialogHelp* help = new ERYAPIXEdialogHelp(this,wxT("Ziegler.html")); - help->ShowModal(); + ERYAPIXEdialogRemark *remark = new ERYAPIXEdialogRemark(this,infoRemark,3); + remark->ShowModal(); } diff --git a/src/ERYAPIXEdialogZieglerParameters.h b/src/ERYAPIXEdialogZieglerParameters.h index 08e2359..275bbdd 100644 --- a/src/ERYAPIXEdialogZieglerParameters.h +++ b/src/ERYAPIXEdialogZieglerParameters.h @@ -25,6 +25,8 @@ Subclass of dialogZieglerParameters, which is generated by wxFormBuilder. /** Implementing dialogZieglerParameters */ class ERYAPIXEdialogZieglerParameters : public dialogZieglerParameters { + private: + wxString infoRemark; protected: // Handlers for dialogZieglerParameters events. void OnZieglerSelectElement( wxSpinEvent& event ); @@ -46,6 +48,7 @@ class ERYAPIXEdialogZieglerParameters : public dialogZieglerParameters public: /** Constructor */ ERYAPIXEdialogZieglerParameters( wxWindow* parent ); + void SetRemark(wxString &info){infoRemark = info; return;}; //// end generated class members diff --git a/src/Element.html b/src/Element.html deleted file mode 100644 index e28a8fd..0000000 --- a/src/Element.html +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - - - - - - - - - - - - -

-ERYA : Element Editor

-


- -

-

The -Element Editor will opens when -you choose to create a new element from scratch or edit an existing -one from the Database -Manager. -You should fill the following six parameters (Element Name, Gamma -Peak, Atomic Number, Abundance, Isotopic Mass, Atomic Mass), and try -to add as much data as possible for the cross-section data in -function of their energy.

-

-ERYA also support the -measurement error of Energy and Cross-Section, although it is never -used on any calculations.

-

-The data table will assume -that you will input the Energy in keV, and the cross-section (Sigma) -in milibarn (≡10-27 cm2), since it is the -standard unit of IBANDL databases (Unit = tot).

-


- -

-

-You can add cross-section data -from four different sources:

-


- -

-

-IBANDL Import/Export -Feature

-


- -

-

-Unless strictly necessary, you -should create own database elements by importing a serie of IBANDL -files (in r33 format) and extract their content using the “Import” -button.

-

-It will try to load the -cross-section data and fill some element parameters that the user can -easily change and save, since it only requires a good periodic table -to fill the gaps.

-

-(The main reason is the IBANDL -files don't have some parameters such the isotope abundances.)

-


- -

-

-- The program will only -recognize IBANDL files with the standard units (Units: mb), or with -total angle integration (Units: tot), as explained on this document -introduction, and it will make the adequate conversion. Other -measurements units will be rejected, and will be warned by an error -message.

-

-- Once done the edition, click -“Save” to store the new or edited element on memory.

-

-(Don't forget, once you return -to Database Manager, to click “Save” to save the database.)

-


- -

-

-It is possible to export the -current element edition to IBANDL r33 format, but with several -limitations:

-

-- The r33 will assume an -scattering event between protons and the target element, without -changing the element species. (It may be not very realistic, even for -low energy events)

-

-- The “Comment” field of -IBANDL contains the ERYA software tag and the original Element -parameters, but it will not be exported again.

-


- -

-

-ASCII Import/Export -Features

-


- -

-

-A good alternative to import -cross-section data for a certain element is to load plain ASCII files -that contains columns of numerical data, and was an informal standard -to share data between different softwares.

-

The -main drawback is the total absence of information about the elements -names or any physical references that requires to be manually typed -on the correct boxes.

-

- For convenience, when the -user export a text source file, the program will open an additional -dialog asking about the original measurement units, and some parsing -flags.

-

-The user can choose between -the milibarn or barn cross-section unit, and steradian or total angle -integration. -

-

-An optional parsing option to -ignore invalid lines (when it do not contains a pair of numbers) -instead to abort with an error are also available.

-

- All errors columns cannot be -imported or exported by this method (and filled with zeros instead, -on the cross-section editor), since the majority of programs never -used such information.

-

- Any export of the current -cross-section to a text file, will convert to total barn units.

-


- -

-

-Excel Xlsx Import/Export -Features

-


- -

-

-Another alternative to fill -the Element data is to import from an Excel Xlsx file, the -cross-section data. All additional Element proprieties should be -filled manually on the respective boxes on top of the Element Editor.

-

-Once recognized the relevant -data (it should be a plain two or four compact column numerical data, -while ignore text cells), ERYA will opens an additional dialog to the -user select the cross-section units (barn or mili-barn), and if is a -differential or integration cross-section, and finally if the source -file have two or four columns.

-

- Notice that only the first -sheet of the Excel file will be parsed, due to the limitations of the -built-in Xlsx file filter implemented on ERYA.

-


- -

-

-When the user save the current -Element profile to an Excel Xlsx file, the program will open an -additional dialog to choose the between two or four columns of data, -always on milibarn.

-

-Either way, the Excel file -will have only the cross-section stored, and other elements -information are not placed, due to compatibility reasons. -

-


- -

-

-Import/Export from the -Clipboard (Deprecated!)

-


- -

-

-If you have a four-column -cross-section data stored on your favorite spreadsheet program, you -can copy the contents to the Clipboard and paste to the Element -Editor using the “Paste” button, once you select the first cell -on the built-in spreadsheet.

-

-The inverse is also possible, -by selecting the data and then clicking on “Copy”, and finally -just paste on your favorite Spreadsheet program. -

-

-
- -

-

-Warning! This feature -is very limited, and only work to four columns filled with data.

-

-Notice: Copy -or paste a single box data of the Element’s physical -characteristics are perfectly fine.

-

-
- -

- - \ No newline at end of file diff --git a/src/FileLibrary.cpp b/src/FileLibrary.cpp index 2a668da..1d0ada8 100644 --- a/src/FileLibrary.cpp +++ b/src/FileLibrary.cpp @@ -640,7 +640,7 @@ bool DatabaseFile::ElementBlockParsing(wxArrayString ElementBlock) // Add a new element if (CurrentElement.Len()>0) { - ElementDatabase StoreNewElement(CurrentElement, CurrentGammaStack.Item(k), CurrentNumber, CurrentAbundance, CurrentAtomic, CurrentIsotopic, CurrentEnergy, CurrentEnergyError, CurrentSigma, CurrentSigmaError); + ElementDatabase StoreNewElement(CurrentElement, CurrentGammaStack.Item(k), CurrentNumber, CurrentAbundance, CurrentAtomic, CurrentIsotopic, CurrentEnergy, CurrentEnergyError, CurrentSigma, CurrentSigmaError, wxEmptyString); ParsedDatabase.Add(StoreNewElement); } else @@ -653,7 +653,7 @@ bool DatabaseFile::ElementBlockParsing(wxArrayString ElementBlock) // And finishes the procedure if(CurrentGammaStack.GetCount() == 0) { - ElementDatabase StoreNewElement(CurrentElement, wxT("0"), CurrentNumber, CurrentAbundance, CurrentAtomic, CurrentIsotopic, CurrentEnergy, CurrentEnergyError, CurrentSigma, CurrentSigmaError); + ElementDatabase StoreNewElement(CurrentElement, wxT("0"), CurrentNumber, CurrentAbundance, CurrentAtomic, CurrentIsotopic, CurrentEnergy, CurrentEnergyError, CurrentSigma, CurrentSigmaError, wxEmptyString); ParsedDatabase.Add(StoreNewElement); return true; } @@ -682,6 +682,8 @@ bool DatabaseFile::ERYAPIXEDatabaseFileLoad() wxString CurrentAbundance; wxString CurrentAtomic; wxString CurrentIsotopic; + wxString CurrentRemark; + wxString FileInfo, FileProgram, FileVersion, FileDateTime; wxArrayString CurrentEnergy; wxArrayString CurrentEnergyError; wxArrayString CurrentSigma; @@ -709,10 +711,42 @@ bool DatabaseFile::ERYAPIXEDatabaseFileLoad() wxXmlNode *DatabaseNode = LocalDatabaseFile.GetRoot()->GetChildren(); while(DatabaseNode) { - if(DatabaseNode->GetName() == wxT("Database_Data")) + if(DatabaseNode->GetName() == wxT("File_Details")) //Load header file { - wxXmlNode *DatabaseData = DatabaseNode->GetChildren(); - if(DatabaseData->GetName() == wxT("Database_Element")) + wxXmlNode *DatabaseFileInfo = DatabaseNode->GetChildren(); + if(DatabaseFileInfo->GetName() == wxT("Contents")) + { + wxXmlNode *DatabaseFileContents = DatabaseFileInfo->GetChildren(); + while(DatabaseFileContents) + { + if(DatabaseFileContents->GetName() == wxT("Program_Name")) + { + FileProgram = DatabaseFileContents->GetNodeContent(); + } + if(DatabaseFileContents->GetName() == wxT("Program_Version")) + { + FileVersion = DatabaseFileContents->GetNodeContent(); + } + if(DatabaseFileContents->GetName() == wxT("Date_File_Creation")) + { + FileDateTime = DatabaseFileContents->GetNodeContent(); + } + if(DatabaseFileContents->GetName() == wxT("Remark")) + { + FileInfo = DatabaseFileContents->GetNodeContent(); + ParsedDatabase.SetInfo(FileInfo); + } + DatabaseFileContents = DatabaseFileContents->GetNext(); + } + } + } + DatabaseNode = DatabaseNode->GetNext(); + if(DatabaseNode->GetName() == wxT("Database_Data")) // Read the data section of Element's database + { + wxXmlNode *DatabaseData = DatabaseNode->GetChildren(); + while(DatabaseData) + { + if(DatabaseData->GetName() == wxT("Database_Element")) // Element's data main root { wxXmlNode *DatabaseSector = DatabaseData->GetChildren(); while(DatabaseSector) @@ -731,7 +765,10 @@ bool DatabaseFile::ERYAPIXEDatabaseFileLoad() CurrentAtomic = DatabaseSector->GetAttribute(wxT("Atomic_Mass"),wxT("0")); CurrentIsotopic = DatabaseSector->GetAttribute(wxT("Isotopic_Mass"),wxT("0")); } - DatabaseSector = DatabaseSector->GetNext(); + if(DatabaseSector->GetName() == wxT("Element_Remark")) + { + CurrentRemark = DatabaseSector->GetNodeContent(); + } if(DatabaseSector->GetName() == wxT("Cross-Section")) { wxXmlNode *DatabaseSigma = DatabaseSector->GetChildren(); @@ -751,11 +788,14 @@ bool DatabaseFile::ERYAPIXEDatabaseFileLoad() DatabaseSigma = DatabaseSigma->GetNext(); } } - ElementDatabase StoreNewElement(CurrentElement, CurrentGamma, CurrentNumber, CurrentAbundance, CurrentAtomic, CurrentIsotopic, CurrentEnergy, CurrentEnergyError, CurrentSigma, CurrentSigmaError); - ParsedDatabase.Add(StoreNewElement); DatabaseSector = DatabaseSector->GetNext(); } + // Store the loaded element to the Database array memory + ElementDatabase StoreNewElement(CurrentElement, CurrentGamma, CurrentNumber, CurrentAbundance, CurrentAtomic, CurrentIsotopic, CurrentEnergy, CurrentEnergyError, CurrentSigma, CurrentSigmaError, CurrentRemark); + ParsedDatabase.Add(StoreNewElement); } + DatabaseData = DatabaseData->GetNext(); // Next Element's sector + } } DatabaseNode = DatabaseNode->GetNext(); } @@ -836,9 +876,9 @@ bool DatabaseFile::ERYAPIXEDatabaseFileSave() wxXmlNode* database = new wxXmlNode(NULL, wxXML_ELEMENT_NODE, "ERYA-Bulk_Database"); LocalDatabase.SetRoot(database); wxXmlNode* data = new wxXmlNode(database, wxXML_ELEMENT_NODE, "Database_Data"); - wxXmlNode* block = new wxXmlNode(data, wxXML_ELEMENT_NODE, "Database_Element"); for(int i=0; iAddAttribute(wxT("Sigma_Error"),s3); } } + // Allocate the remark header + wxXmlNode* elementremark = new wxXmlNode(block, wxXML_ELEMENT_NODE, "Element_Remark"); + elementremark->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxEmptyString, c6)); // Allocate the elements wxXmlNode* header = new wxXmlNode(block, wxXML_ELEMENT_NODE, "register"); header->AddAttribute(wxT("n"),wxString::Format("%i",CurrentValue)); @@ -879,6 +923,8 @@ bool DatabaseFile::ERYAPIXEDatabaseFileSave() // Save file header wxXmlNode* fileversion = new wxXmlNode(database, wxXML_ELEMENT_NODE, "File_Details"); wxXmlNode* details = new wxXmlNode(fileversion, wxXML_ELEMENT_NODE, "Contents"); + wxXmlNode* programremark = new wxXmlNode(details, wxXML_ELEMENT_NODE, "Remark"); + programremark->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxEmptyString, ParsedDatabase.GetInfo())); wxXmlNode* programdatetime = new wxXmlNode(details, wxXML_ELEMENT_NODE, "Date_File_Creation"); programdatetime->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxEmptyString, ActualTime)); wxXmlNode* programversion = new wxXmlNode(details, wxXML_ELEMENT_NODE, "Program_Version"); @@ -938,6 +984,7 @@ DetectorFile::DetectorFile(wxString DetectorFilePath, wxString Version, Detector // Loads the Detector settings from the file, which can be the default standard, or the old version from ITN bool DetectorFile::DetectorFileLoad() { + wxString FileProgram, FileVersion, FileDateTime, FileInfo; ParsedParameters.Clear(); if (DetectorFileVersion == wxT("epsd")) { @@ -965,7 +1012,37 @@ bool DetectorFile::DetectorFileLoad() wxXmlNode *DetectorNode = LocalDetectorFile.GetRoot()->GetChildren(); while(DetectorNode) { - if(DetectorNode->GetName() == wxT("Detector_Data")) //Main data entry point + if(DetectorNode->GetName() == wxT("File_Details")) //Load header file + { + wxXmlNode *DetectorFileInfo = DetectorNode->GetChildren(); + if(DetectorFileInfo->GetName() == wxT("Contents")) + { + wxXmlNode *DetectorFileContents = DetectorFileInfo->GetChildren(); + while(DetectorFileContents) + { + if(DetectorFileContents->GetName() == wxT("Program_Name")) + { + FileProgram = DetectorFileContents->GetNodeContent(); + } + if(DetectorFileContents->GetName() == wxT("Program_Version")) + { + FileVersion = DetectorFileContents->GetNodeContent(); + } + if(DetectorFileContents->GetName() == wxT("Date_File_Creation")) + { + FileDateTime = DetectorFileContents->GetNodeContent(); + } + if(DetectorFileContents->GetName() == wxT("Remark")) + { + FileInfo = DetectorFileContents->GetNodeContent(); + ParsedParameters.SetInfo(FileInfo); + } + DetectorFileContents = DetectorFileContents->GetNext(); + } + } + } + DetectorNode = DetectorNode->GetNext(); + if(DetectorNode->GetName() == wxT("Detector_Data")) //Main data entry point { wxXmlNode *DetectorData = DetectorNode->GetChildren(); while(DetectorData) @@ -1108,6 +1185,8 @@ bool DetectorFile::DetectorFileSave() // Save file header wxXmlNode* fileversion = new wxXmlNode(detector, wxXML_ELEMENT_NODE, "File_Details"); wxXmlNode* details = new wxXmlNode(fileversion, wxXML_ELEMENT_NODE, "Contents"); + wxXmlNode* programremark = new wxXmlNode(details, wxXML_ELEMENT_NODE, "Remark"); + programremark->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxEmptyString, ParsedParameters.GetInfo())); wxXmlNode* programdatetime = new wxXmlNode(details, wxXML_ELEMENT_NODE, "Date_File_Creation"); programdatetime->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxEmptyString, ActualTime)); wxXmlNode* programversion = new wxXmlNode(details, wxXML_ELEMENT_NODE, "Program_Version"); @@ -1173,6 +1252,7 @@ bool ZieglerFile::ZieglerFileLoad() { ParsedParameters.Clear(); ParsedTables.Clear(); + wxString FileProgram, FileVersion, FileDateTime, FileInfo; wxXmlDocument LocalZieglerFile; if(!(LocalZieglerFile.Load(ZieglerFileName))) { @@ -1189,6 +1269,36 @@ bool ZieglerFile::ZieglerFileLoad() wxXmlNode *ZieglerNode = LocalZieglerFile.GetRoot()->GetChildren(); while(ZieglerNode) { + if(ZieglerNode->GetName() == wxT("File_Details")) //Load header file + { + wxXmlNode *ZieglerFileInfo = ZieglerNode->GetChildren(); + if(ZieglerFileInfo->GetName() == wxT("Contents")) + { + wxXmlNode *ZieglerFileContents = ZieglerFileInfo->GetChildren(); + while(ZieglerFileContents) + { + if(ZieglerFileContents->GetName() == wxT("Program_Name")) + { + FileProgram = ZieglerFileContents->GetNodeContent(); + } + if(ZieglerFileContents->GetName() == wxT("Program_Version")) + { + FileVersion = ZieglerFileContents->GetNodeContent(); + } + if(ZieglerFileContents->GetName() == wxT("Date_File_Creation")) + { + FileDateTime = ZieglerFileContents->GetNodeContent(); + } + if(ZieglerFileContents->GetName() == wxT("Remark")) + { + FileInfo = ZieglerFileContents->GetNodeContent(); + ParsedParameters.SetInfo(FileInfo); + } + ZieglerFileContents = ZieglerFileContents->GetNext(); + } + } + } + ZieglerNode = ZieglerNode->GetNext(); if(ZieglerNode->GetName() == wxT("Ziegler_Data")) //Main data entry point { wxXmlNode *ZieglerData = ZieglerNode->GetChildren(); @@ -1691,6 +1801,8 @@ bool ZieglerFile::ZieglerFileSave() version->AddAttribute(wxT("zv"),ParsedParameters.GetZieglerVersion()); wxXmlNode* fileversion = new wxXmlNode(ziegler, wxXML_ELEMENT_NODE, "File_Details"); wxXmlNode* details = new wxXmlNode(fileversion, wxXML_ELEMENT_NODE, "Contents"); + wxXmlNode* programremark = new wxXmlNode(details, wxXML_ELEMENT_NODE, "Remark"); + programremark->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxEmptyString, ParsedParameters.GetInfo())); wxXmlNode* programdatetime = new wxXmlNode(details, wxXML_ELEMENT_NODE, "Date_File_Creation"); programdatetime->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxEmptyString, ActualTime)); wxXmlNode* programversion = new wxXmlNode(details, wxXML_ELEMENT_NODE, "Program_Version"); diff --git a/src/Fit.html b/src/Fit.html deleted file mode 100644 index f85501a..0000000 --- a/src/Fit.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - - - - - - - - - - - -

-ERYA – Bulk : How to make -a Composition Analysis

-


- -

-

-Once -you have a workable Element Database, a viable Detector Efficiency -data, and a suitable Stopping-Power -table, you can make a composition -analysis without much effort.

-

-If -you prefer to read the theoretic basis before use -the software, just read -the next section, otherwise jump to the Fitting Instructions. -

-


- -

-

Yield -Evaluation Procedure

-


- -

-

-The ERYA application will evaluate the yield of several isotopes -defined from the user, taking the user-defined parameters and all -related databases to calculate the pretended result.

-

The -gamma emission yield of an isotope either independent or adjacent for -a particular Compound, (As you can -read more about the Compounds -sections of this document), when -bombarded by a beam of protons at non-relativistic energies (less -than 10 MeV), it can be -evaluated from the following integral:

-


- -

-

Y -(E0) -= εabs(Eγ)NpfmfiNav -σ(Γ)dΓ

-


- -

-

† -εabs(Eγ), -is the Detector Efficiency -to -the respective gamma emission energy of the current isotope. Any -isotope on ground-level will have a zero gamma yield emission.

-


- -

-

Np -is -the number of protons calculated from the “Charge” specified from -the user (default is 1 µC).

-


- -

-

fm -relates -to the mass fraction of the isotope related to the compound it -belongs.

-

-- This means, if the element are -alone, their mass fraction will be equal to one.

-

-- If the isotope belongs to a -certain compound, the mass fraction is evaluated by taking the weight -average of their isotope mass and composition ratio of current -compound.

-

- -Thus, taking the sum, S = Σ sk -Ak -, -the mass fraction will be fm -= -si -Ai -/ -S.

-


- -

-

fi -is -simply the isotope abundance, and it should be available on the -Element Database.

-


- -

-

Nav -is -the Avogadro Number (6.022*1023).

-


- -

-

The -integral σ(Γ)dΓ -are evaluated in two major fashions, albeit share a common procedure:

-

- -The -integral are evaluated numerically, by starting on E0 -(“Maximum -Energy”) and decreasing step by step (“Energy Step” specifies -the Riemann's / Simpson's Sum accuracy by taking a certain dE small -as possible. ), until reaches the “Minimum Energy” (which default -is zero), where the -user wants to be the -cut-off.

-

- -This method order are -chosen because it models the physical situation accurately, since -the -beam propagation will -lose energy along the -thick target. -

-

-- Taking the following change of -variables: dΓ = - dE / dε, the integration procedure changes from -the target thickness to the energy beam.

-


- -

-

If -the user choose a non-zero parameter for the sample thickness, the -integration procedure will take the line depth as the variable of -integration, and ignore the minimum energy value.

-


- -

-

The -dε quantity is the Energy Stopping -loss -which use the Bragg's Law and the Ziegler's ansatz -equations -to model the energy beam losses. (An -interpolation mode derived from the SRIM are also available.)

-


- -

-

All -integration procedure use the Simpson Rule to achieve better -precision without selecting a too tiny Energy Step. (A 1 keV is fine -and adequate for most practical analysis, -and 0.1 -keV step can give a more realistic -precision, in exchange of more computational time.)

-


- -

-

Compounds

-


- -

-

-Although all the elements -declared on the main spreadsheet, located on main screen, are treated -as part of the same simulated object, you can declare additional -settings that affects the numerical results. You can declare a -chemical compound by selecting the relevant elements as part of a -particular compound, and give to the “Compound Group” an unique -positive integer, called Group ID. Internally, all isolated elements -are automatically grouped as Group 0, and cannot be overridden as a -normal compound. -

-

-When you declare a compound, -ERYA will create additional objects to handle the supplementary task -required to evaluate correctly the yields.

-

-You can add as many Compounds -you need in the same analysis, as long you have declared the -necessary number of elements on main screen.

-

-The main purpose of the -Compounds is to define a strictly fixed composition ratio, as any -physical chemical compound will have a defined quantity of each -element, and thus a fixed stoichiometry between element species. -

-


- -

-

About -the Composition Fitting

-


- -

-

-Optionally, if you select the -“Fit” flag on the Elements tab of main screen, it will trigger -the Composition fitting procedure.

-

-Basically will read the -evaluated yield using the integral described on the Yield Evaluation -section, plus an user inserted yield, which should be an experimental -or guess result, and try to minimize the difference between the -theoretic and experiment yield, by changing the composition indexes.

-

-ERYA will read the Elements and -Compounds objects in memory, and define the number of independent -parameters to make the stoichiometry fitting successfully. -

-

-
- -

-

-Since the Compounds share a -fixed stoichiometric ratio, any fitting Elements from the Compound -will be treated as a single fitting parameter, in order to maintain -the same stoichiometric ratio.

-

-However any Elements without the -“Fit” flag, even it belongs to the same Compound, will not join -the same fitting parameter, and thus their stoichiometry can be -changed.

-


- -

-

-In physically terms, any Element -outside the fitting process are either an contaminant or a substance -which is main purpose is to make a subtract to the main chemical -compound.

-


- -

-

-During the Stoichiometric -Fitting, and taking the original stoichiometry as initial values, -ERYA will try to apply an iterative nonlinear fitting algorithm based -on Levenberg-Marquardt algorithm, to minimize the gap between -experimental and theoretic yields, while respecting the constraints -defined by the user.

-

-
- -

-

Additional -settings can be achieved by selecting the “Advanced” -button, and it will open an optional dialog to change the convergence -criteria.

-

-Since the Levenberg-Marquardt -use several Linear Algebra numerical evaluations, any numerical or -dimensional error will also stop the procedure with an error dialog.

-

-If the procedure is successful, -it will get a fitted yield, a fitted stoichiometric, and the major -fitting error. A graphical output are also provided on additional -four tabs on application main screen.

-


- -

-

Yield -Analysis How-To

-


- -

-

-1. You need to check first if -you have a functional database. If the program warns about an invalid -database for Elements, Stopping-Power or Detector Setup, you need to -check the source database files (You should put all three in the same -directory), and delete the configuration file (ERYA-Bulk.conf) -located on main program directory as explained on readme.txt file.

-

- Once deleted, run ERYA again -and fill the databases files when the program asks while it will use -the new information to rebuild a new configuration file.

-


- -

-

2. -You can override the default Element Database -loaded -at start-up, using the adequate menu.

-

† -Tip: -Also check the Detector Setup -and -Stopping -Power from -the appropriate menu options.

-


- -

-

-3. ERYA can make several -compounds analysis at -once, so you should define the list of compounds and their elements -and fill on main screen. The elements of the same compound should -share an unique Group ID, -this means their elements -and isotopes should share the same Group ID of the corresponding -compound. Isolated -elements analysis is possible, as long you don't fill a Group ID for -that particular element.

-

† -Tip: -To avoid potential issues during program runtime, it is recommended -to define first the total number of elements that your analysis -needs.

-


- -

-

-4. Notice that the stoichiometry -inserted on the main spreadsheet will be renormalized, no matter the -values inserted. Also, during the fitting procedure, the composition -are renormalized for each step, reducing the number of necessary -steps to achieve a solution.

-


- -

-

-5. In the main spreadsheet, you -should also fill the initial values of the sample composition, the -experimental yields of some elements or compounds. Without this -additional information, ERYA cannot make a more accurate fitting.

-

† -Tip: -You can tune the fitting process, by selecting in the adequate -check-box the -relevant elements for which the composition -ratios are problem-prone to be variable due to the foreground -contamination. Elements -without detailed cross-sections are futile to be fitted, and you -should be deselected them -from -the Composition -Fitting -procedure. -

-


- -

-

-6. Now fill the Thickness and -Energy parameters to define the energy range and click “Run” -to get the results. If anything -goes right (Any errors will be warned to the user, mainly by the form -of message boxes.), the results will appear in a matter of seconds.

-

-
- -

-

† -Tip: -To avoid unnecessary time-consuming problems, first make an initial -test without fit, or change the convergence criteria, if you notice -that the experimental results are beyond the expected ones. Normally, -a long fitting procedure, which require up to 50 or 100 iteration -steps, means several issues, like yield guess beyond the initial or -theoretic values, a convergence criteria too or less adequate for the -problem itself.

-

-If you want to use a custom -efficiency function, make do so, since it only affect to a particular -gamma peak of isolated elements.

-

-If necessary, at the same Energy -scale, define the Compounds, and repeat the calculations.

-

-Finally, make a real Composition -Fitting, and if necessary, change the parameters and compare the -results.

-


- -

-

-7. Now you can check the graphs -plots derived from the numerical results. The -main spreadsheet contents can -be saved to a file, or -even exported to a Excel Xlsx spreadsheet file directly.

-


- -

-

8. The -program also output a profiling table, displaying the partial yields, -once made the fitting operation, for several energies from the user -selected minimum and maximum energy. The intervals can be defined by -the “Profiling Step” input box. Setting “0” will not output -any profiling table.

-

The -profiling table is also stored on Xlsx and native file described on -Step 7.

- - \ No newline at end of file diff --git a/src/Fitextra.html b/src/Fitextra.html deleted file mode 100644 index df44ec0..0000000 --- a/src/Fitextra.html +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - - - - - - - - - - - -

-ERYA : Additional Yield -Fitting Information

-


- -

-

This -additional document contains two main sections: the first one details -some theoretical information about the Levenberg-Marquardt algorithm, -and the later section, explains the factors that the user can make to -change the converge criteria.

-


- -

-

The -Levenberg-Marquardt algorithm on ERYA

-


- -

-

From -the stoichiometric fitting document, the yield -depends from the evaluation of a numerical integral, that along -several variables it depends from the stoichiometric ratios, which -are the critical parameters that can change the value of yields, -during the fitting procedure.

-

By -taking the norm of a vector of different yields, it is possible to -define the following residual function : -ε= -|| Yexp -– Ytheo -||, -where the experimental yield are defined by the user, and the -theoretical yield are evaluated from the current stoichiometric -ratios, calculated by several factors derived from the databases and -some additional initial values that was defined by the user.

-


- -

-

-The main purpose of the -Levenberg-Marquardt algorithm is to minimize the residual function, -and find which stoichiometric ratios makes the residual function -smaller, or by other hand, minimizes the gap between experimental and -theoretical yield values.

-


- -

-

Since -the residual function are nonlinear, the fitting process is basically -an iteration of linear approximations, by taking successive steps: -||xi+1|| -= ||xi|| -+ ||δ||.

-

Where -the vector δ -is -the solution of the following matrix system: (JT -J -+ λ I) -δ = -JT -ε

-

-The J matrix are the Jacobian -matrices, which are the successive derivatives of several yields -along their stoichiometric ratios.

-

-The λ -factor is the gradient damping factor, which is evaluated initially -from λ=τ*max|| -JT J || , where τ is -the initial damping factor, that can be changed by the user, as will -be explained on next section.

-

-The -algorithm will stop, either by exceeding a maximum number of -iterations (up to 100, user selectable), or when reaches a -convergence criteria, that can occur from -the residual functions: ||JT ε|| < h1 -||ε||, or from the stoichiometric ratios: ||δ|| < h2 -||x||.

-

-Otherwise the stoichiometric -ratios x are updated according to the vector δ, as long the -matrix system had solutions, making the damping factor λ -and the Jacobian matrices been updated for the new stoichiometric -ratios at each new iteration step, until a solution emerges.

-

-An additional renormalization -step also occurs each time the stoichiometric ratios x, -in order to confine the numerical values on a more safe range domain.

-


- -

-

-Changing the Convergence -Criteria

-


- -

-

-When the user opens the Advanced -Fitting Settings from the “Advanced”, the window displays the -default settings:

-

-- Maximum number of Iterations, -100 (Selectable from 0 to 100).

-

-- Initial damping factor, 3 -(Selectable from 0 to 3).

-

-- Yield convergence criteria, 3 -(Selectable from 0 to 6).

-

-- Stoichiometric converge -criteria, 3 (Selectable from 0 to 6).

-


- -

-

-Except the first one, all the -numbers should be reading as a reciprocal of a decimal exponential of -the selected argument. This means that the default values are: -τ=10-3; -h1=10-3; -h2=10-3.

-


- -

-

-The default settings should give -a fairy good approximation in a short number of iterations, as long -the experimental results was not far away of the initial -stoichiometric guess.

-

-In some occasions it is possible -to occur a slow convergence due to a series of factors, that only by -experience can help to minimize the problem.

-

-The fitting time will increase -when the number of independent fitting parameter increases. With two -or three, usually the fitting take a couple of seconds. But with 10 -or 20 elements, it may take some minutes to achieve the results.

-

-Other factors that may cause -abnormal fitting times, even for some samples with fewer fitting -parameters. A common cause is that some Elements have a cross-section -function that was not very well conditioned, require several -iterations steps to achieve a reasonable result, due to a slow -convergence.

-


- -

-

-If -the experimental results are too far away, it is possible to reduce -the precision (Like τ=10-2; -h1=10-1; -h2=10-1), -to give an initial correction. Otherwise, it would get a slow -convergence (Taking 50 or almost 100 iterations), or even fail to get -a solution.

-


- -

-

-On -other hand, taking an higher precision can fail to find a solution, -or make a negligible correction beyond the experimental precision. -Only in a few cases, use an higher precision is needed, like τ=10-3; -h1=10-4; -h2=10-4.

-


- -

-

-As a rule of thumb, if any -fitting takes too long, probably the cause was one of the described -before. -

- - \ No newline at end of file diff --git a/src/Index.html b/src/Index.html deleted file mode 100644 index 2d9f821..0000000 --- a/src/Index.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - -

-ERYA Index

-


- -

-

Main -Page

-


- -

-

Detector -Settings

-


- -

-

Database -Manager

-


- -

-

Element -Editor

-


- -

-

Stopping-Power -Table Editor

-


- -

-

How -to make a Stoichiometric Analysis

-


- -

-

Advanced -Fitting Settings

-


- -

-

Additional -Reference for Legacy and Special Software Components

-


- -

-

ERYA -Macro Programming Language Reference

-


- -

-


- -

- - \ No newline at end of file diff --git a/src/Legacy.html b/src/Legacy.html deleted file mode 100644 index ac476b2..0000000 --- a/src/Legacy.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - - - -

-Additional Reference for -Legacy and Special Software Components

-


- -

-

-About LabView Binary DataLog File Import

-


- -

-

-ERYA supports partially the import of Database and Ziegler binary -files (The Detector was always a two columns text file, or an -hard-coded function on program itself) from LabView ERYA.

-

-This resource was only possible to be implemented by reverse -engineering the file structure, using some third-party documentation, -and use programming tools to analyze the original files structure to -understand how the data was stored on their binary files. -

-


- -

-

-ERYA support the declared structure of Database and Ziegler databases -from LabView DataLog files versions 7.x.x.x, 8.x.x.x and 9.x.x.x. The -program checks the presence of the magic header “DTLG” at the -beginning of file, which means a valid LabView DataLog file and then -reads all content as a stream of unsigned characters in hexadecimal -format. -

-


- -

-

-The program do not know all the rules of the file structures, since -follows instead a fixed template for the two expected file formats, -and prioritize the decoding of the data registers addresses, which -contains the relevant data.

-

-Since ERYA hard-codes the Database and Ziegler register structures (a -full and universal LabView DataLog export filter is beyond the scope -of this program), once gets the “magic” offset address, it will -export and convert the binary numerical data to the expected Element -or Ziegler databases.

-


- -

-

-ERYA cannot save any database on LabView DataLog file format, since -the rules of some obscure file features are unknown, and could make -unreadable by the LabView ERYA again. -

-

-Since it only requires to import data from such legacy program, any -attempt to create a save feature will never happen at all.

-


- -

-

-About Microsoft Excel Xlsx File Filter Support

-


- -

-

-In order to help the export and import of some data files, and the -prevalence of Excel files on workflow, this application can now read -and write very simple Excel spreadsheet files compatibles from -version 2007 and onwards, which can be edited from Microsoft Office®, -LibreOffice®, Google Docs®, and other similar products.

-

-Only cells filled with names and numbers are supported, and the -boolean TRUE() and FALSE() functions. Other limitation is ERYA will -only read or write single-worksheet files, or the very first -worksheet at all.

-

-Tables, cell formating, formulas and other advanced features are -incompatible and ignored, treating such cells as equal to blank ones. -In some situations, ERYA can get import errors on some rare -occasions, when notices an unexpected feature.

-


- -

-

-Other major limitation is the fact this experimental library can -write only new Excel files from scratch with minimal styles, and all -data should packed as a single matrix block. Some little enhancements -later makes possible to place empty cells and rows, along the main -data matrix.

-

-All created Excel files will begin at the first spreadsheet cell. -

-

-When ERYA try to read an Excel file as an import source, the relevant -data can begin at any cell, since ERYA will readdress the data block -automatically.

-


- -

-

-Also only reads simple blocks of cells, as long they form a single -block of data, but empty cells are fine readied as null strings, and -discarded on all ERYA-Bulk export routines.

-

-The user should follow the recommendations on each help topic on the -relevant tool to create any source Excel files that would not cause -ambiguities, or data export errors.

-

-The Xlsx filter, once extracted the original data block to a export -matrix of data, it takes some rules to bypass rows filled with -strings (or parse them, on some rare situations), and takes priority -of numerical cells, in order to copy to the ERYA-Bulk memory -locations intended to be relevant. -

-


- -

-

-The Xlsx filter was inspired from the Simple Xlsx Writer and Simple -Xlsx Parser projects, while it was originally written in Ruby and -Java.

-

- ERYA Xlsx filter was written from scratch, and built along the -wxWidgets native support for zip and xml documents -streams.

-


- -

-

-About SRIM® and IBANDL File Filter Features

-


- -

-

-ERYA recognize this ASCII files with special format strings, which is -the SRIM® Stopping-Power files and the IBANDL files that contains -cross-section data.

-

-ERYA implements a string search and conversion using the wxWidgets -libraries for string extraction and conversion. This enables to check -if the source files are valid, and them retrieve some important data. -

-

-Once the initial analyses are completed, ERYA will grab the line -location of the major data located on SRIM or IBANDL files (the -stopping-power and the cross-section, respectively), and convert -automatically to the ERYA’s memory structures.

-

-Once completed, the program places on the correct memory location, -and then it is accessible to the ERYA’s API tools.

- - \ No newline at end of file diff --git a/src/Macro.html b/src/Macro.html deleted file mode 100644 index f340730..0000000 --- a/src/Macro.html +++ /dev/null @@ -1,655 +0,0 @@ - - - - - - - - - - -

-ERYA Macro Programming -Language Reference

-


- -

-

-At some program’s options or -inputs, ERYA accepts small programs to handle custom functions or -algebraic expressions that during the numerical simulation will -deliver numerical values.

-

-Along the ERYA’s -documentation this internal programming language handled by an -interpreter will be declared as ERYA Macro and resembles the -BASIC dialect found on programmable calculators. Compared to other -BASIC implementations, it was designed to made single-line programs, -and tailored to write algebraic functions.

-

-Several characteristics like -flow control, code branches, subroutines and other features presents -on more advanced interpreters are absent on ERYA Macro language.

-

-This documents will detail the -syntax rules and recommend code practices to the user code the -functions.

-


- -

-

-ERYA Macro Code Standards

-


- -

-

-A ERYA Macro are composed by a -linear sequence of sentences, separated by commas (,) forming a chain -function. It is possible to write several chain functions, requiring -to use colons (:) to separate them.

-

-This convention are inherited -from BASIC language, when multiple sentences could be placed on the -same line, using the colon symbol to separate them.

-


- -

-

-ERYA Macro will consider the -last sentence as the return sentence -of the custom function, and ERYA will cache them in order to optimize -the execution time code.

-


- -

-

-ERYA Macro will consider two -types of sentences:

-

-- -Function -Sentences: -Composed by a variable and a number or algebraic expression linked by -an equal sign (=). ERYA will store the numerical value of the -variable, according to the numerical evaluation of the algebraic -equation.

-

-- -Algebraic -Sentences: Are -made with a simple numerical expression, that ERYA will evaluate and -store on an answer memory variable. Multiple -sentences return values will overwrite the answaer variable content.

-

-Only -the last Algebraic Sentence returned value can be retrieved by the -interpreter code to the ERYA numerical routines.

-


- -

-

-A Typical User Defined -Function using ERYA Macro

-


- -

-

A -typical user-defined function, like the ones defined on Detector’s -Efficiency or Stopping-Power -as options, should follow this template:

-

-<Function -Variables>:<Function Constants >:<The desired formula>

-


- -

-

-- The internal interpreter -will read and parse the line from the first term in the left, and -follows the line to the right. You should define several variables or -parameters (as explained above) separated by commas (,), and each -major section should by separated by colons (:).

-

-- After each section separated -by colons (:), the interpreter will flush the stack cache, and store -or update the variable stack memory. The last chain of commands are -maintained on memory, and turns to be the function stack.

-

-This was intended to make a -single compilation step, and one the ERYA numerical code calls the -custom function from memory with an input function variable value, it -just need to run the function stack, and their memory stack values, -to return the function output, reducing the interpreter time to run -the code.

-

-- A Function sentence can be -further classified by three types: parameters, constants and -variables.

-


- -

-

-Get -Acquaintance about Parameters, Constants, Variables and Functions

-


- -

-

-1. -Parameters

-


- -

-

A -parameter -is -a special variable -which only accepts alphanumeric words as arguments, and was the -simplest form to ERYA Macro supports variable declarations.

-

-Each -kind parameter should only be declared a single time, and ERYA will -warn the user when a parameter are redeclared twice, stopping any -further numerical simulation.

-


- -

-

-On -ERYA, all parameters are non-numeric and should be written in the -following format.

-

-<Parameter -Name> = <Parameter Value>

-


- -

-

-And -a list of parameters should be separated by commas (best practice) or -colons (non-recommended). The supported parameters and respective -arguments are the following:

-


- -

-

-- -fxvar = <any valid variable>

-

-Specifies -the function independent variable, which can be any valid combination -of alphanumeric characters, as long the first one are a letter (the -same as C-style syntax), otherwise it will get a syntax error.

-


- -

-

-- -fyvar = <any valid variable>

-

-Specifies -the function dependent variable, like y = f(x), which can be any -valid combination of alphanumeric characters, as long the first one -are a letter (the same as C-style syntax).

-


- -

-

-- -fxmin = <any valid variable>

-

-Specifies -a constant name that should be declared as the minimum possible value -of the function independent variable, which can be any valid -combination of alphanumeric characters, as long the first one are a -letter (the same as C-style syntax).

-


- -

-

-- -fxmax = <any valid variable>

-

-Specifies -a constant that should be declared as the maximum possible value of -the function independent variable, which can be any valid combination -of alphanumeric characters, as long the first one are a letter (the -same as C-style syntax). -

-


- -

-

-- -fnvar = <any valid variable>

-

-Defines -a vector of 16 elements, where the initial vector element starts with -the user-defined variable name as arguments. The next vector elements -are placed by merging the numbers 1 to 15 as suffixes. The initial -values are “1” for all 16 variables. -

-

-The -vector values are normally changed by the Ziegler’s Parameters -table values, and not by the macro code itself.

-


- -

-

-On -ERYA program, only the fxvar -and -fyvar are -obligatory to define a custom function, otherwise it will display an -error about an undefined function. The Ziegler’s custom function -also requires fnvar -parameter -in order to copy the Ziegler’s Parameters values.

-

-The -fxmax and -fxmin are -optional on all ERYA-Bulk program, and serve to define a global -limiting function domain at any context.

-


- -

-

2. -Constants

-


- -

-

A -constant -is -a fixed symbolic name for a number that the user can declare for best -convenience.

-

-A -constant name should be an alphanumerical one, but the first -character should be a letter, like on C languages. -

-

-Once -declared, with the assign symbol (=), the user can put any valid -arithmetic expression, or simply a number on the right side of the -expression: -

-

-<Constant -Name> = <Constant Value>

-

-<Constant -Name> = <Arithmetic Expression>

-


- -

-

-During -the list parsing, the built-in interpreter will create a list of -constants and store into memory, while reading from the left to -right. Groups of constants should be separated by commas, and when -define any constant you can also use any algebraic expression that -contains previous defined constants, as long are declared in first -place.

-


- -

-

† -Tip: -The following example will work, due to the fact the last variable -depends from the first ones previously declared.

-

-a0 -= 1, a1 = 3, a2 = 4, a3 = a0+a1*a2

-


- -

-

† -Tip: -The following example will not work, and will pop-up a warning due to -an undeclared constant. (Like a C program when try to use a variable -or constant that was not declared on code.)

-

-a0 -= 1 , a1 = 3 , a2 = 4 , r = a0+a1*a2-a3

-

-(It will warn of the -non-existence of “a3”)

-


- -

-

† -Tip: -And finally, you cannot redefine the same constant in the same line, -if you define previously:

-

-a0 -= 1 , -a1 = 3 , -a2 = 4 , -a0 = a0+a1*a2

-

-(It -will warn that “a0” value cannot be overwritten)

-


- -

-

-3. -Variables

-


- -

-

A -variable -is -like a constant, but the main difference is the fact their value can -be changed during runtime. On ERYA, all variables should be declared -as an argument of a parameter, on the previous block of code, as -explained above. -

-


- -

-

† -Tip: -In the program context, the variables -are -the function variables defined by the “fxvar” and “fyvar” -Parameters. Constants are simply any symbolic number to avoid a -mixture of numbers in scientific format directly on the fitting -function, reducing syntax errors and other issues.

-


- -

-

-4. -Functions

-


- -

-

On -the last macro block of code (after the last colon sign), the user -should define the algebraic -function, -while taking care to define the necessary parameters, constants and -variables previously.

-

-It is possible to define a -chain of functions separated by commas, and can be useful to define -composite functions which in some situations can be advantageous in -terms of readlibilty.

-


- -

-

-Example 1: Take the following model-function:

-


- -

-

-Efficiency = a3 x3 + a2x2+ -a1x + a0 , where x = 1 / Energy

-

-Where the symbolic constants are: a3=-3000; -a2=-234.5; -a1=10; -a0=1.5*10-4

-


- -

-

-- Then implement the following -chain of instructions:

-

-fxvar = E, fyvar = F : -a3=-3000, a2=-234.5, a1=10, a0=1.5E-4 : F = a0 + a1/E + a2/E^2 + -a3/E^3

-


- -

-

† -Tip, -since the function independent variable can be treated as a composite -function respective to the reciprocal of energy, it is possible to -implement the last instruction line as:

-


- -

-

-fxvar -= E, fyvar = F : a3=-3000, a2=-234.5, a1=10, a0=1.5E-4 : x=1/E, F -= a0 + a1*x + a2*x^2 + a3*x^3 -

-


- -

-

Example -2: To -demonstrate the usefulness to use chain of functions, consider the -following analytical formula that models some detectors (A -log-polynomial interpolation formula):

-


- -

-

-log f(x) = a0 + a1 -log(x) + a2 log2(x) + a3 log3(x) -+ a4 log4(x) -

-

-Where: a0=a1=a2=a3=a4=3*10-4.

-


- -

-

-- Writing the function as -plain it was written on paper, could be very difficult to understand -or fix when the interpreter delivers syntax errors, or the whole -function delivers unexpected values.

-


- -

-

-- Using all ERYA Macro -proprieties, it’s possible to define the function as the following:

-


- -

-

-fxvar = x, fyvar = y : a0 = -3e-4, a1 = a0, a2 = a0, a3 = a0, a4 = a0: z = ln(x), w = a0 + a1*z + -a2*z^2 + a3*z^3 + a4*z^4, y = exp(w) -

-


- -

-


- -

-

-List of Admissible -Functions and Symbols

-


- -

-

-- -ERYA Macro’s interpreters will recognize a valid chain of letters -(capital ones or not) and numbers (as long the first character is a -letter), as a word. Later it will compare to a table of reserved -words (functions or parameters) to further classification. When none -of words belongs to a reserved word, it will become a variable. -Failure to follow the naming rules will trigger a syntax error about -an incorrect word, or an invalid symbol.

-


- -

-

-- Numbers should follow the -standard format for scientific or float point number according to the -C language standard, such as -2.5e+34 to represent -2,5 * 1034, -or decimal numbers like 22.456, or even integers like 23.

-


- -

-

-- However in some operations, -the interpreter will evaluate negative numbers as one token, unlike -the C language standard that uses the negative sign as a special -operator, which means that in some algebraic evaluations ERYA will -apply -3^2 as equal 9, like on standard mathematical analysis, unlike -the C language, that would give -3^2 = -9 instead.

-

-Either way, expressions such -as 3 - -2 will give 5, in both situations, although ERYA process the -expression a little different from the C language standard.

-

-An expression like 5---7 will -get an invalid arithmetic expression error, thought. -

-


- -

-

-- ERYA recognize the basic -arithmetic operations, like “+”, “-”, “*”, “/”. -Exponentiation is done by the “^”, such as 3^5 to evaluate 35 -, following the BASIC standard.

-


- -

-

-- ERYA support the main BASIC -relational operators less “<” , more “>”, equal less -“<=”, equal more “>=”, equal “==” and different -“<>”.

-

-Any true relational operation -will return “1”, and any false statement will get “0”.

-

-It is intended to define -limited domain functions on the following format:

-

-fxvar = x, fyvar = y : y = -(x >= 100) * ( x <= 200 ) * ( x^3+1)

-


- -

-

† -Warning: -Do not chain relational operators like 2<5<8, since it will -make false positives, much due to the conversion of each element to a -single number. ERYA macro language only recognizes double precision -numbers as elements, not true boolean variables. In fact the previous -example will render, 2<5<8, turns 1<8, and 1. But 7>5>2, -will gives 1>2, turning 0.

-


- -

-

-- The number of left or right -parenthesis should be equal, or you will get a parenthesis mismatch -error.

-


- -

-

-- ERYA recognize several -trigonometric functions, both circular and hyperbolic, as well their -inverses. They follow the C standard naming.

-

-The interpreter recognize the -following functions:

-

-sin, cos, tan, sinh, cosh, -tanh, asin, acos, atan, asinh, acosh, atanh.

-


- -

-

-- The following exponential -and logarithmic functions are supported:

-

-sqrt (square root), ln -(natural logarithm), log (decimal logarithm) and exp (natural -exponential).

-


- -

-

-- Any function argument should -at last be placed under a pair of parenthesis, like sqrt(4) . -

-


- -

-

† -Tip: -To -avoid mistakes and potential syntax errors, -it is a good advise to separate the numbers, operators, functions and -variables with at least one empty space.

-


- -

-

-Some Technical Information -about the ERYA Macro Interpreter

-


- -

-

-The built-in interpreter use a -custom parser that read several groups of characters and groups to -form a dynamic vector of strings. Then the vector of strings are -subject to a special algorithm derived from the Shunting-Yard -Algorithm in order to optimize, classify and make an error check.

-


- -

-

-Once completed, it makes a -vector of variables, parameters and constants. Finally, the original -algebraic function are stored as a sequence of string elements in the -RPN format (Reversed Polish Notation or postfix).

-


- -

-

-Once the ERYA makes the -parsing, and optimization successfully, the algebraic function can -now evaluate several values, once the ERYA numerical code call the -function with an input value, and returns the output.

-


- -

-

-The algebraic function -numerical evaluation in postfix notation is now a straightforward -method, since the original function was been optimized, and the -operators with different precedence order was switched to minimize -the numerical evaluation complexity.

-


- -

-

-If during the compilation or -execution of macro code found any error, it will trigger a stop -signal to halt any numerical simulations, placing an error message to -the user about the problem found.

-


- -

-


- -

- - \ No newline at end of file diff --git a/src/Main.html b/src/Main.html deleted file mode 100644 index 6543133..0000000 --- a/src/Main.html +++ /dev/null @@ -1,341 +0,0 @@ - - - - - - - - - - - - - - -

-ERYA User Manual

-


- -

-

-ERYA is a software tool that -enable to do a quick analysis of thick samples when exposed to -particle beams, avoiding the error prone manual calculations using -several printed tables.

-

-This program is built to run -with several software platforms, including Windows, Linux or Mac OS X -using a cross-platform framework called wxWidgets.

-

-Normal users should also read -the readme.txt file for basic installation trouble-shooting, and last -release notes, which can be viewed directly from the built-in Help -module.

-


- -

-

Main -features:

-

-Resuming this ERYA-Bulk -release, this program should be capable of:
-- Evaluate reactions -yields of elements, both alone or belonging to a compound.

-

-- Taking stoichiometric -fittings of compounds, when makes sense.

-

-- Load, edit, export and -import databases of elements.

-

-- Import and Export some data -to the native Operating System Clipboard, with several limitations.

-

-The user are warned to use -direct file export/import instead.

-

-- Basic Import/Export of -IBANDL database (Limited to proton beams), which make possible to -build or edit an entire database from scratch with few user -modifications.

-

-- Better support for import -and export cross-sections of single elements on plain text format.

-

-- A very basic Excel Xlsx file -writer was also implemented, making possible to export the Yield -results to an Excel file, even without install Microsoft Office.

-

-- Support to read simple Excel -Xlsx files is only possible to cells with text and numbers, and -depends to the program context. Reading Excel Xlsx files on ERYA-Bulk -is only implemented on Ziegler or Detector editors, and on Elements -edition of their cross-sections.

-

-- The native Elements, -Detector and Ziegler databases now uses a XML template, while -maintains some support to read and write ASCII formats for legacy and -interchange with other programs.

-

- -Support for SRIM tables, and export them on Ziegler's -Parameter widget.

-


- -

-

-A built-in Programming -Language: ERYA Macro

-

-Within some options on ERYA -software, the program accepts as input a small program, similar to -BASIC, with C conventions, in order to define custom functions, and -algebraic expressions.

-

More -details can be obtained here.

-


- -

-

Additional -features compared to the LabView ERYA:

-

-ERYA also adds the following -functionalities, compared from the previous LabView ERYA:

-

- -The Detector Efficiency, both by an -interpolation table or an algebraic function (ERYA macro language), -is now user-programmable, without needing to recompile the software.

-

- -The Element Database optimizes when -changed, placing the elements by alphabetic order. -

-

- -This application also support the 1977 and 1991 Ziegler's -Parameter -models.

-

- -The Ziegler's Parameter also supports the -SRIM tables, or even a custom algebraic function (ERYA macro).

-

-- Simple and basic support to -load and save numerical and string data from Microsoft Excel Xlsx -files. Those Excel files can be edited by any supported program to -further analysis.

-

- -The fitting operation uses the Levenberg-Marquardt algorithm, -implemented from scratch, instead the -proprietary closed-source non-linear fitting routines bundled on -LabView Runtime.

-


- -

-

Deprecated -Features:

-

-- All Clipboard features -referenced on ERYA are deprecated, since it is more reliable to write -a text or Excel file with the necessary data, and export/import -directly, using the available tools.

-

-- It is still possible to copy -and paste data between the Ziegler, Detector and Element’s -Cross-section built-in spreadsheet editors, and the target -application, but there’s no guarantee of correct formating. Use the -tips on the relevant sections to ease correct handling.

-

-- All LabView export tools or -routines are maintain solely for former users of the previous -software to import the old databases quickly and safely.

-


- -

-


- -

-

Quick -Setup

-


- -

-

1. -All Linux -installation packages are compiled to -be a Debian -Package (DEB), and during installation all dependencies are handled -and installed automatically, -either by the dpkg -tool, -or using -a GUI tool such as -Gdebi.

-

Other -Linux distributions may require manual extraction, and manual -installation of the libwxgtk3.0-0v5 -package, -or similar.

-

-32-bit and 64-bit versions for -Intel x86 and ARM are natively available for Debian systems.

-

-The minimum Debian version is -Debian 9 with the Backports channel enabled, in order to install the -updated libraries. The minimum Ubuntu version is the 18.04 LTS.

-


- -

-

-2. Windows minimum supported -version is Windows 7, and also works on Windows 10.

-

-ERYA are bundled into a 32-bit -and a 64-bit version, using the SimpleInstall® installer. -

-

-The GNU-C++ runtime and -wxWidgets libraries are already included on the Windows version -package.

-


- -

-

-3. Mac OS X minimum supported -version is 10.11 (Some user reports that’s work fine on 10.10, but -ERYA itself don’t makes mandatory Mac OS X version check, since the -critical libraries are statically linked inside the program), and -just requires to unzip the package, and moves ERYA-Profiling.app -(actually a folder) to the OS X Applications directory.

-

-This is only available as a -64-bit program, since the Mac OS X is a 64-bit operating system, and -32-bit programs are strictly deprecated by Apple standards, and -reserved to critical legacy components.

-


- -

-

-4. Once installed, at first -start-up, ERYA will create a custom configuration file, and starts a -wizard to guide the configuration procedure. The configuration file -is now a XML file, and can be changed by the program itself using the -widget from the menu “Default Databases”.

-

-The setup procedure will -request the source place of the following three database files: -Elements, Detector and Ziegler.

-

-Once finished the export of -the initial databases, it will asks if you want to write the setup -file on the default’s operating system user profile folder (highly -recommended), from where the program will copy the assets to the -default user folder to minimize the risks to write data on the -protected operating system directories, since ERYA should not run -with privilege rights to avoid security issues.

-

-Otherwise, choose the same -program root directory, which is not recommended at all.

-

-Finally, once written the -setup file, ERYA will load automatically these three files for each -run, and jump straight to main screen interface.

-


- -

-

-5. To make an analysis, select -the desired total number of elements, fill the initial or -experimental parameters in the correct boxes, and then click “Run” -to handle the calculations.

-


- -

-

How -to Use Help -

-


- -

-

-The on-line help is -straightforward simple to use, and not require more than a couple of -tips to use it.

-

-1. The on-line help window is -a trimmed-down browser that loads a couple of formated HTML files to -display the information, and works in some cases as a web browser.

-

2. -You can at any moment return to first page by clicking -the “Main Page” button.

-

3. If -you want to jump to a desired page, click “Index”, and click on -that index page, the desired topic.

-

4. Also -you can read the “readme.txt” directly, by clicking the “Readme” -button.

-

5. -Finally, you can navigate around your navigation history using the -“Back” and “Forward” buttons.

-

6. And -then choose “Close” to close the Help Viewer.

-


- -

-

Explore -the Main Features of the ERYA

-


- -

-

-Once the application start-up -without issues, it should open a tabbed interface which contains the -major controls and features needed to perform the tasks.

-


- -

-

-The main page, related to -Elements, displays the available isotopes derived from the Database, -and asks the stoichiometry, experimental yield and other global -definitions, like the fact some elements can be related to a -particular chemical compound.

-


- -

-

-Any results will be displayed on -several fields, and can be saved to a file, or exported to a -spreadsheet file, as explained on Fitting section.

-


- -

-

-The program will also generate -some graphics on the other tabs, more dedicated to the visual -representation of the numerical results already available on the -first tab, related to the Detector Efficiency, and the Stoichiometric -analysis.

-


- -

-

-Both databases can be edited or -changed on runtime, and to do this, open the adequate menu on top of -window application, and select the adequate database to be edited.

-


- -

-

-For more information, click on -“Index” button and select the desired topic. -

-


- -

-


- -

- - \ No newline at end of file diff --git a/src/R33Library.cpp b/src/R33Library.cpp index b754115..8383a21 100644 --- a/src/R33Library.cpp +++ b/src/R33Library.cpp @@ -10,10 +10,10 @@ #include "R33Library.h" // R33File class implementation -bool R33File::IBANDLFileLoad(wxGrid* &tableDataEditor, wxTextCtrl* &textEditElement, wxTextCtrl* &textEditGamma, wxTextCtrl* &textEditNumber, wxTextCtrl* &textEditAbundance, wxTextCtrl* &textEditAtomic, wxTextCtrl* &textEditIsotopic) +bool R33File::IBANDLFileLoad(wxGrid* &tableDataEditor, wxTextCtrl* &textEditElement, wxTextCtrl* &textEditGamma, wxTextCtrl* &textEditNumber, wxTextCtrl* &textEditAbundance, wxTextCtrl* &textEditAtomic, wxTextCtrl* &textEditIsotopic, wxString &infoRemark) { // Our IBANDL file parsing is a very simple one, and only dedicated to search and find the relevant values. - // A more robust implementation would require to create several classes to handle the diffrent parameters and data blocks. + // A more robust implementation would require to create several classes to handle the different parameters and data blocks. // Since our recipe works, it just begin with the file loading tableDataEditor->ClearGrid(); wxTextFile database(R33FileName); @@ -23,6 +23,19 @@ bool R33File::IBANDLFileLoad(wxGrid* &tableDataEditor, wxTextCtrl* &textEditElem wxString SigmaUnits = wxT("mb"); //default value double EnergyFactor = 1.0; //default value double SigmaFactor = 1.0; //default value + infoRemark.Clear(); // Copy IBANDL's comment filed to the remark section + infoRemark = wxT("Element's original data extracted from IBANDL file...\n"); + for(int z=0; zGetValue(); @@ -229,7 +242,7 @@ bool R33File::IBANDLFileSave(wxGrid *tableDataEditor, wxTextCtrl* textEditElemen } // ITNFile class implementation -bool ITNFile::ITNFileLoad(wxGrid* &tableDataEditor, wxTextCtrl* &textEditElement, wxTextCtrl* &textEditGamma, wxTextCtrl* &textEditNumber, wxTextCtrl* &textEditAbundance, wxTextCtrl* &textEditAtomic, wxTextCtrl* &textEditIsotopic) +bool ITNFile::ITNFileLoad(wxGrid* &tableDataEditor, wxTextCtrl* &textEditElement, wxTextCtrl* &textEditGamma, wxTextCtrl* &textEditNumber, wxTextCtrl* &textEditAbundance, wxTextCtrl* &textEditAtomic, wxTextCtrl* &textEditIsotopic, wxString &infoRemark) { tableDataEditor->ClearGrid(); // Start initial parameters @@ -294,10 +307,11 @@ bool ITNFile::ITNFileLoad(wxGrid* &tableDataEditor, wxTextCtrl* &textEditElement } } file.Close(); + infoRemark = wxT("Element's original data exported from ASCII file."); return true; } -bool ITNFile::ITNFileSave(wxGrid *tableDataEditor, wxTextCtrl* textEditElement, wxTextCtrl* textEditGamma, wxTextCtrl* textEditNumber, wxTextCtrl* textEditAbundance, wxTextCtrl* textEditAtomic, wxTextCtrl* textEditIsotopic) +bool ITNFile::ITNFileSave(wxGrid *tableDataEditor, wxTextCtrl* textEditElement, wxTextCtrl* textEditGamma, wxTextCtrl* textEditNumber, wxTextCtrl* textEditAbundance, wxTextCtrl* textEditAtomic, wxTextCtrl* textEditIsotopic, wxString infoRemark) { // Store only the cross-section data, since it don-t contain any reference of the element wxTextFile file(ITNFileName); @@ -981,7 +995,7 @@ ElementDatabaseArray LabViewElements::GetElementsFromLabView() LabViewElementName = TestNewName; } // And store the data to the Database class - ElementDatabase StoreNewElement(LabViewElementName, ActualGammaPeak, ActualElementNumber, ActualAbundance, ActualAtomic, ActualIsotopic, ImportElementEnergy, ImportElementEnergyError, ImportElementSigma, ImportElementSigmaError); + ElementDatabase StoreNewElement(LabViewElementName, ActualGammaPeak, ActualElementNumber, ActualAbundance, ActualAtomic, ActualIsotopic, ImportElementEnergy, ImportElementEnergyError, ImportElementSigma, ImportElementSigmaError, wxEmptyString); ElementRecords.Add(StoreNewElement); } } @@ -1028,7 +1042,7 @@ ElementDatabaseArray LabViewElements::GetElementsFromLabView() LabViewElementName = TestNewName; } // And store the data to the Database class - ElementDatabase StoreNewElement(LabViewElementName, ActualGammaPeak, ActualElementNumber, ActualAbundance, ActualAtomic, ActualIsotopic, ImportElementEnergy, ImportElementEnergyError, ImportElementSigma, ImportElementSigmaError); + ElementDatabase StoreNewElement(LabViewElementName, ActualGammaPeak, ActualElementNumber, ActualAbundance, ActualAtomic, ActualIsotopic, ImportElementEnergy, ImportElementEnergyError, ImportElementSigma, ImportElementSigmaError, wxEmptyString); ElementRecords.Add(StoreNewElement); } // Clean temporary vectors @@ -1038,5 +1052,6 @@ ElementDatabaseArray LabViewElements::GetElementsFromLabView() // Final file record cycle } FileTest.Close(); + ElementRecords.SetInfo(wxT("Legacy Database converted from LabView ERYA")); return ElementRecords; } diff --git a/src/R33Library.h b/src/R33Library.h index 142ec38..4edc7e5 100644 --- a/src/R33Library.h +++ b/src/R33Library.h @@ -20,8 +20,8 @@ class R33File wxString R33FileName; public: R33File(wxString IBANDLFilePath){ R33FileName = IBANDLFilePath; }; - bool IBANDLFileLoad(wxGrid* &tableDataEditor, wxTextCtrl* &textEditElement, wxTextCtrl* &textEditGamma, wxTextCtrl* &textEditNumber, wxTextCtrl* &textEditAbundance, wxTextCtrl* &textEditAtomic, wxTextCtrl* &textEditIsotopic); - bool IBANDLFileSave(wxGrid *tableDataEditor, wxTextCtrl* textEditElement, wxTextCtrl* textEditGamma, wxTextCtrl* textEditNumber, wxTextCtrl* textEditAbundance, wxTextCtrl* textEditAtomic, wxTextCtrl* textEditIsotopic); + bool IBANDLFileLoad(wxGrid* &tableDataEditor, wxTextCtrl* &textEditElement, wxTextCtrl* &textEditGamma, wxTextCtrl* &textEditNumber, wxTextCtrl* &textEditAbundance, wxTextCtrl* &textEditAtomic, wxTextCtrl* &textEditIsotopic, wxString &infoRemark); + bool IBANDLFileSave(wxGrid *tableDataEditor, wxTextCtrl* textEditElement, wxTextCtrl* textEditGamma, wxTextCtrl* textEditNumber, wxTextCtrl* textEditAbundance, wxTextCtrl* textEditAtomic, wxTextCtrl* textEditIsotopic, wxString infoRemark); }; class ITNFile @@ -33,8 +33,8 @@ class ITNFile public: ITNFile(wxString ITNFilePath){ ITNFileName = ITNFilePath; SelectUnits = 0; SelectAngles = 0; IgnoreParsingErrors = false;}; ITNFile(wxString ITNFilePath, int SigmaUnit, int SigmaAngle, bool IgnoreErrors){ ITNFileName = ITNFilePath; SelectUnits = SigmaUnit; SelectAngles = SigmaAngle; IgnoreParsingErrors = IgnoreErrors;}; - bool ITNFileLoad(wxGrid* &tableDataEditor, wxTextCtrl* &textEditElement, wxTextCtrl* &textEditGamma, wxTextCtrl* &textEditNumber, wxTextCtrl* &textEditAbundance, wxTextCtrl* &textEditAtomic, wxTextCtrl* &textEditIsotopic); - bool ITNFileSave(wxGrid *tableDataEditor, wxTextCtrl* textEditElement, wxTextCtrl* textEditGamma, wxTextCtrl* textEditNumber, wxTextCtrl* textEditAbundance, wxTextCtrl* textEditAtomic, wxTextCtrl* textEditIsotopic); + bool ITNFileLoad(wxGrid* &tableDataEditor, wxTextCtrl* &textEditElement, wxTextCtrl* &textEditGamma, wxTextCtrl* &textEditNumber, wxTextCtrl* &textEditAbundance, wxTextCtrl* &textEditAtomic, wxTextCtrl* &textEditIsotopic, wxString &infoRemark); + bool ITNFileSave(wxGrid *tableDataEditor, wxTextCtrl* textEditElement, wxTextCtrl* textEditGamma, wxTextCtrl* textEditNumber, wxTextCtrl* textEditAbundance, wxTextCtrl* textEditAtomic, wxTextCtrl* textEditIsotopic, wxString infoRemark); }; class SRIMFile diff --git a/src/Ziegler.html b/src/Ziegler.html deleted file mode 100644 index 7a6552e..0000000 --- a/src/Ziegler.html +++ /dev/null @@ -1,477 +0,0 @@ - - - - - - - - - - - - - - -

-ERYA : Stopping-Power

-


- -

-

-The Stopping-Power editor -contains a spreadsheet dedicated to the user make an easy edition of -the Ziegler’s Parameters, and a chain editor of SRIM tables, that -enables ERYA to load a stack of numerical tables to handle a -semi-empirical physical model of scattering derived from the Bragg -Rule.

-

-
- -

-

- The user can select one of -four models from the appropriate pull-down menu on top right window:

-

-- The first two modes are the -1977 and 1991 Ziegler’s functions that are hard-coded on program, -and require the user fill the 12 parameters on the Ziegler’s -spreadsheet tab that each chemical element should describe.

-

- Additional information are -available at the bottom document.

-

-- The third mode enable the -user-defined function written on the top window.

-

-- And finally, and the -program’s default mode, uses the interpolation tables derived from -SRIM, one of each element.

-

-
- -

-

-To access all content, this -widget contains two main tabs, where the right ones are dedicated to -the Ziegler's Parameters, and the left tab are dedicated to scroll -(using the switch) the SRIM tables for each element.

-


- -

-

-Main Features of Ziegler’s Table:

-

- -For easy management, the first column are dedicated to the chemical -symbol of the element, and the next 12 columns (A-1 to A-12) are the -Ziegler's Fitting Parameters which was publish -from the original Ziegler's books, but can also be exported from a -compatible spreadsheet file, or a database table. The final column -refers to the standard atomic mass of the element, where ERYA will -use on internal evaluations if the original Element -Database do not provide forehand.

-


- -

-

-- This program, support two -Ziegler models which the main difference are the number of -parameters. The 1977 version requires 12 fitting parameters, and the -1991 version only requires 8 (The A-9 to A-12 columns are ignored or -reset to zero).

-


- -

-

-- The user can force the 1977 -or 1991 Ziegler's model, by switching the pull-down menu on the top -right window. The custom macro or the SRIM tables can be activated by -the same menu. -

-


- -

-

-- The program will try lo load -the row assigned to a particular atomic number, leaving the Element -name as a pure convenience. If the element don't exist, it would give -an error.

-


- -

-

-- The editor can import any -Ziegler Parameters file in ASCII, but the program will use an -hard-coded dictionary to change the “Elements” column to the -chemical symbols automatically, beginning with “H, He, ...”

-

-
- -

-

-Main Features of Custom -Function:

-

- -Using the built-in ERYA macro language, it is possible to define a -custom function. With this new feature, it is even possible to use -the Ziegler’s -table -load -special constants values, as it will be explained with an example -later.

-

-
- -

-

-Main Features of SRIM Interpolation Tables:

-

-- To manage the entire set of -interpolation tables for all elements, the SRIM Table editor only -displays a single element each time, according to the atomic number’s -switch.

-

-
- -

-

-- The user only need to change -the atomic number’s value to display their content on the SRIM -spreadsheet below. Manual editing requires to click on “Update -Table” button to store on memory, otherwise any changes are lost. -To permanently store the updated tables, use the “Export” button -to save as a native epsz -file.

-

-
- -

-

-- Clicking “Erase All -Tables” will delete all SRIM tables from memory.

-

-
- -

-

-Export and Import Ziegler -Parameters from an Excel File or plain ASCII files:

-

-- ERYA-Bulk supports to read -and write the Ziegler Parameters from Microsoft Excel files.

-

-However, while reading -directly from an Excel file are supported, the program expects a -compact spreadsheet with 14 columns, otherwise the ERYA’s Xlsx -filter will fail to parse, and gives an error.

-


- -

-

-- The Excel format also -preserves the custom Element’s names, and write the labels at the -first column.

-


- -

-

-- Any custom function are not -stored or retrieved from an Excel file.

-


- -

-

-Export and Import -Interpolation SRIM Tables from an Excel File or plain ASCII files:

-

-- It is only possible to -export or import a single SRIM table for a single Element. The table -should have only two columns (any labels are accepted, but ignored -safely), and require the user to manually select the “SRIM” tab, -and the correct Element’s Atomic Number before import an Excel -file. The same logic applies, when export an Excel file, it will take -the current selected Element’s Atomic Number on screen.

-


- -

-

-- The same export/import rules -for Excel files also applies to plain ASCII files composed by columns -of numerical data. The only real difference is the column that -corresponds to the Elements Names are replaced by the Atomic Number -instead, and ERYA will replace automatically using an internal -dictionary.

-


- -

-

-Import LabView Ziegler's -Parameters files (Legacy and Deprecated Feature) -

-


- -

-

-ERYA can import the original -LabView ERYA binary file for the Ziegler’s Parameters file. To use -this conversion feature, requires to select “SRIM/LabView/ASCII” -option from “Import” button, and select a compatible file. -

-

-If successful, the original -table data are converted to the Ziegler's Parameters table on first -tab, and displayed there. The user can later save to the native ERYA -file, for further processing.

-

Additional -reference are available on Legacy Reference -Section. -

-


- -

-

-Import Original SRIM -Stopping-Power Files:

-


- -

-

-- When select the -“SRIM/LabView/ASCII” option from “Import” button, ERYA can -parse an unedited SRIM Stopping-Power output file to the correct -Atomic Number location, making all unit conversions without any -additional steps.

-

-In -order to import a SRIM table without fail, use SRIM® software to -export a single element stopping-power by an hydrogen ion beam, -resulting a plain text file. -

-

-Then -just use the “Import” button from this widget, and select the -“txt” file format. (It contains a lot of header data that ERYA -will use to recognize the relevant data structures.)

-

- Any -necessary unit conversions are made on fly, and placed on the correct -atomic number automatically. ERYA can ask if you want to -override the table on the Atomic Number defined by the source file.

-

-
- -

-

-- When export a SRIM table as -“LabView/ASCII” file, it will only export the selected Atomic -Number table as a simple text file with two numerical columns, as -explained before.

-

-
- -

-

-- The only way to import or -export all SRIM tables from ERYA at once, is to use the native epsz -file format.

-


- -

-

-Using the Copy and Paste -from the Clipboard (Deprecated!)

-

-- If you can’t export a Ziegler table from an Excel file, as a -workaround, try to copy and paste, by clicking on the first leftmost -cell grid, and then click the “Paste” button. The reverse, it is -simply to select the data, and then click “Copy”. Once done, just -paste on any document you have, including a spreadsheet program, or a -simple text editor.

-

-- Notice that this feature is now deprecated, and should be used as a -last resource when the main tools fail.

-


- -

-

-Ziegler Parameters -Additional Reference

-


- -

-

-The Ziegler Parameters tables -publish in 1977 uses a full set of 12 fitting parameters for each -element, and evaluates the stopping power in function of energy.

-


- -

-

For -E<10 keV

-

-S -= A1 -E0.5

-


- -

-

For -10<E<1000 keV

-

-1/S -= 1/SLOW -+ -1/SHIGH

-

-SLOW -= -A2 -E0.45

-

-SHIGH -= -(A3/E) -log (1 + (A4/E) -+ (A5 -E) -)

-


- -

-

For -E > 1000 keV

-

-S -= (A62) -{log ( A7 -β2 -/ -(1 - β2 -)) -- β2 -- -A8 -- -A9 -log -(E) - -A10 -log2(E) -- -A11 -log3(E) -- -A12 -log4(E) -}

-

-Where -β2 -is -the relativistic velocity from the energy-mass formula for the proton -beams, which are calculated from:

-

-β2 -= -(E2 -+ -2 m E) / (m + E)2 -, -where m = 938280 keV is the rest mass of the proton.

-


- -

-

-Otherwise, -the Ziegler Parameters published in 1991 use only 8 parameters, but -use another set of equations.

-

For -E > 25 keV

-

-1/S -= 1/SLOW -+ -1/SHIGH

-

-SLOW -= -A1 -EA2 -+ -A3 -EA4

-

-SHIGH -= -(A5 -/ -EA6) -log ( (A7/E) -+ (A8 -E) -)

-


- -

-

-Using -a Custom Function

-


- -

-

Applying -the extensive reference from ERYA Macro, it -is possible to define a custom algebraic expression at models the -stopping-power (in eV/1015 -atm/cm2 -units), -in function of Energy (keV).

-


- -

-

-In -order to load the values stored on the Ziegler's Constants table, the -ERYA Macro use the parameter fnvar to create an array of 16 -constants, beginning with the variable name defined by the user (e.g. -zn), and this will add more 15 of them, by appending the -number’s order as suffixes.

-

-In -this case, the variables will be: zn, zn1, …, zn15.

-

-The -base zn variable will be the Atomic Number value, and points -to the corresponding table’s row. The zn1 ~ zn12 will load -the A-1 to A-12 parameters. The final zn13 will be the Atomic -mass.

-

-On -ERYA-Bulk, the zn14 and zn15 variables are not used on -this program context, even it was created on the interpreter memory.

-


- -

-

-It -is obligatory to define the parameters fxvar, fyvar and -fnvar, before write the algebraic function, such as the -following example:

-

-fxvar -= x, fyvar = y, fnvar = a : low = a1*x^a2 + a3*x^a4 , high = -(a5/x^a6) * ln (a7/x + a8*x) , y = (x>=25)*((high*low)/(high+low))

-

-
- -

-

-This -example are the same built-in 1991 Ziegler’s Function described on -this document.

- - \ No newline at end of file