Giter VIP home page Giter VIP logo

bt-matml-editor's Introduction

Author Paul McGrath Date June, 2022

The MatML Editor is a text Editor for the MatML 3.1 XML Schema.

MatML is an extensible markup language (XML) developed especially for the interchange of material information. It provides a medium of communication for users in materials science and related fields such as manufacturing and aerospace. It sets the stage for the development of semantic web standards to enhance knowledge discovery in materials science and related areas.

Binary Downloads

Goto Releases and under Assets download the win64 for Microsoft Windows releases and Linux for Linux releases.

BT-MatML-Editor Usage

To run the program, click on the BT-MatML-Editor application.

Once running click on 'File->Open', or 'File->New', to start.

The general approach to the program is to use the Tree Control user interface to navigate through the MatML data elements. The tree on the left side is the main navigation aid (1). Mouse click on the elements of the tree and then left mouse click to get more options, such as to add more data elements to the Tree Control. The MatML Schema Information will show up on the right panel (2). The tabs for the right panel (3) will display either the MatML Schema Information (default) or the MatML data itself (can be changed in 'Edit->Preferences').

BT-MatML-Editor

While the BT-MatML-Editor is not a database, and not optimized for extremely large files, it can handle multimaterial files. These larger files are more manageable using the following tools.

Sorting the view of the materials. In 'Edit->Preferences->Sort class', it is possible to add sort classes. This option will changed the view (not the xml file) of the materials. Adding "STEEL" for an example, will display the Materials with the class name of "STEEL" first. Then the remainding materials will be displayed in the order the are in inside the XML file. Once set, 'view->perform material sort' will change the view order of the materials.

One other option for viewing larger files is the use of 'view->Isolate material branch'. This will isolate materials which are interconnected with ' Material -> ComponentDetails -> Class -> ParentMaterial ' associations. To exit this view, 'View->Exit Isolate material branch' will bring back the original list of materials.

BT-MatML-Editor Builds

Development source code is hosted on GitHub and source code for stable release versions are found at releases along with the binaries.

The following prerequisites dependencies are:

For Building CMake 3.24

BT-MatML-Editor Windows Build

To Build:

cmake-gui

Within cmake-gui:

  • Set the "Where is the source code" directory to the BT-MatML-Editor root.

  • Set the "Where to build the binaries" directory to the BT-MatML-Editor root/build

  • Add the following entries (change paths depending on your installation):

    • CMAKE_BUILD_TYPE "Release"
    • XercesC_ROOT PATH "C:/Program Files/xerces-c"
    • XSD_ROOT PATH "C:/Program Files/code_synthesis_xsd/xsd-4.0.0-i686-windows/bin"
    • wxWidgets_ROOT PATH "C:/Program Files/wxWidgets/wxWidgets-3.2.0"
    • BOOST_ROOT PATH "C:/Program Files/boost/boost_1_79_0"
  • Press "Configure" button. Specify your generator

  • Press "Generate" button.

  • Press "Open Project" button.

Within the generator (e.g. Visual Studio):

  • Set the "Solution Configuration" to Release.
  • Set the "Solution Platform" to x64.
  • Build Solution.

In a shell with Administrator privileges (so you can install into "C:/Program Files"):

  • cd into the ${BT-MatML-Editor}/build/win64 directory.
  • cmake --install . --config release

To run:

  • dir "C:/Program Files/BT-MatML-Editor"
  • ./BT-MatML-Editor

Package generation:

  • cd ${source}/build/win64
  • cpack

Package Checksum Values in Windows 10

  • certutil -hashfile BT-MatML-Editor-0.1.1-win64.exe SHA1

BT-MatML-Editor Linux Build

To build:

  • cd /path/to/BT-MatML-Editor/build/linux
  • cmake -S ../.. -B .
  • make
  • sudo cmake --install . --config release

To run:

  • BT-MatML-Editor

Package generation:

  • cd ${source}/build/linux
  • cpack

Package Checksum Values in Linux

  • sha1sum BT-MatML-Editor-0.1.2-Linux.tar.gz

Programming Guide

for doxygen doc see here for active hyperlinks

The program is structure to perform the following tasks:

  1. Parsing the MatML XML Schema using Xerces-c and binding the XML data into C++ using CodeSynthesis-XSD.
  2. Create GUIs using wxWidgets.
  3. Polymorphically bind the MatML XML data to the wxWidgets GUIs.

Parsing the MatML XML Schema using Xerces-c and binding the XML data into C++ using CodeSynthesis-XSD.

The XML data binding into C++ is done using CodeSynthesis-XSD data binding compiler. The compiler produces the matml31.hxx, matml31.cxx files. Add these to your project file.

Place the XML Schema Definition file matml31.xsd in the same directory as the xml data (*.xml).

The xerces-c parsing libraries should be linked in your project. For Windows adding xerces-c_3_1.dll and xerces-c_3_1D.dll to the library paths would do it.

With these files above, the user can perform C++ material calculations.

The MatML_Editor is the GUI for the purpose of providing an input, or output, to these C++ material calculations or used on its own as a MatML Editor.

Create GUIs using wxWidgets

As per the wxWidgets DECLARE_APP and IMPLEMENT_APP macros, class bellshire::BT_MatML_App defines the entry point for the console application.

bellshire::BT_MatML_App::OnInit function calls for the creation of the class bellshire::MaterialFrame, which is the main GUI class for the application.

bellshire::MaterialFrame constructor bellshire::MaterialFrameBase::MaterialFrameBase then calls for the creation of all the different MatML GUI classes via the class bellshire::GUI.

The class bellshire::GUI constructor bellshire::GUI::GUI(wxWindow* parent), calls for the creation of the individual MatML GUIs, such as class bellshire::MatML_Doc_GUI.

The individual MatML GUIs, such as class bellshire::MatML_Doc_GUI_Base constructor bellshire::MatML_Doc_GUI_Base::MatML_Doc_GUI_Base, then create the final GUI for the associated MatML data class, such as MatML_Doc. See the table below for the MatML data and the associated MatML GUI classes.

The base classes, such as bellshire::MaterialFrameBase and the individual MatML GUIs, such as bellshire::MatML_Doc_GUI_Base, contain the creation of the GUIs, virtual Event Handler Functions, and binding the Event Handler Functions.

The derived classes, such as bellshire::MaterialFrame and the individual MatML GUIs, such as bellshire::MatML_Doc_GUI, contain the overwriting of the Event Handler Functions occuring in the base.

It should also be noted that not all instances of MatML data have MatML GUIs associated with them, but all classes of MatML data do. This means that changing MatML data will require showing, and updating, the MatML GUIs to show the new MatML data.

The naming MatML data class and associated MatML GUI classes is as such,

MatML data MatML GUI
Associate bellshire::Associate_GUI
AssociationDetails bellshire::AssociationDetails_GUI
BulkDetails bellshire::BulkDetails_GUI
Characterization bellshire::Characterization_GUI
ChemicalComposition bellshire::ChemicalComposition_GUI
Class bellshire::Class_GUI
ComponentDetails bellshire::ComponentDetails_GUI
Compound bellshire::Compound_GUI
Concentration bellshire::Concentration_GUI
DataFormat bellshire::DataFormat_GUI
DimensionalDetails bellshire::DimensionalDetails_GUI
Element bellshire::Element_GUI
Form bellshire::Form_GUI
Formula bellshire::Formula_GUI
Geometry bellshire::Geometry_GUI
Glossary bellshire::Glossary_GUI
GlossaryTerm bellshire::GlossaryTerm_GUI
Graphs bellshire::Graphs_GUI
Material bellshire::Material_GUI
Metadata bellshire::Metadata_GUI
Name bellshire::Name_GUI
Notes bellshire::Notes_GUI
ParameterValue bellshire::ParameterValue_GUI
PhaseComposition bellshire::PhaseComposition_GUI
ProcessingDetails bellshire::ProcessingDetails_GUI
PropertyData bellshire::PropertyData_GUI
Qualifier bellshire::Qualifier_GUI
Relationship bellshire::Relationship_GUI
Source bellshire::Source_GUI
Specification bellshire::Specification_GUI
Uncertainty bellshire::Uncertainty_GUI
Unit bellshire::Unit_GUI
Unitless bellshire::Unitless_GUI
Units bellshire::Units_GUI
Value bellshire::Value_GUI
AuthorityDetails bellshire::AuthorityDetails_GUI
DataSourceDetails bellshire::DataSourceDetails_GUI
MeasurementTechniqueDetails bellshire::MeasurementTechniqueDetails_GUI
ParameterDetails bellshire::ParameterDetails_GUI
PropertyDetails bellshire::PropertyDetails_GUI
SourceDetails bellshire::SourceDetails_GUI
SpecimenDetails bellshire::SpecimenDetails_GUI
TestConditionDetails bellshire::TestConditionDetails_GUI
ChemicalElementSymbol bellshire::ChemicalElementSymbol_GUI
CurrencyCode bellshire::CurrencyCode_GUI
MatML_Doc bellshire::MatML_Doc_GUI
ParentMaterial bellshire::ParentMaterial_GUI
Symbol bellshire::Symbol_GUI
Graph bellshire::Graph_GUI
Data bellshire::Data_GUI
Data1 bellshire::Data1_GUI
delimiter bellshire::delimiter_GUI[not implemented]
Scale bellshire::Scale_GUI
Definition bellshire::Definition_GUI *
Abbreviation bellshire::Abbreviation_GUI *
Synonym bellshire::Synonym_GUI *
Shape bellshire::Shape_GUI *
Dimensions bellshire::Dimensions_GUI *
Orientation bellshire::Orientation_GUI *
Result bellshire::Result_GUI *
Description bellshire::Description_GUI[not implemented]
ParentSubClass bellshire::ParentSubClass_GUI[not implemented]
  • used BOOST_STRONG_TYPEDEF to implement as a strong type.

Polymorphically bind the MatML XML data to the wxWidgets GUIs

Because the not all instances of MatML data have MatML GUIs associated with them, but all classes of MatML data do, the MatML Editor relies on polymorphic functions to select the appropriate class type to operate on.

The polymorphic functions uses boost::any pointers. The bellshire::TreeCtrlSorted, a derivative of wxTreeCtrl, stores user data in each of its tree elements. Using this functionality the editor stores data such as the bellshire::MatMLTreeItemData which contains the boost::any pointer.

The bellshire::TreeCtrlSorted mimics the tree structure of the MatML_data and allows the user data to be pulled from the tree elements and used.

After the user data is pulled the a given MatML data`s class typeid is compared to the boost::any.type. When the comparison matches, a function is either called, or the data is boost::any_cast back into the MatML data pointer for further processing.

When the MatML data structure is changed the bellshire::TreeCtrlSorted is recreated once again mimicking the MatML data structure.

An example is a function for updating of the MatML GUIs,

void bellshire::GUI::Update_GUI(::boost::any anyptr, ::boost::shared_ptr<MatML_Doc> doc)

this will Update the appropriate GUI depending on the type of MatML data pointer the ::boost::any pointer caste into.

Another, function is a function showing the context menu,

void bellshire::MaterialFrame::ShowContextMenu(wxTreeItemId id, const wxPoint& pt)

it will create a context menu showing possible selections depending on the bellshire::MatMLTreeItemData (has a member of boost::any pointer) selected.

bt-matml-editor's People

Contributors

p-mcg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bt-matml-editor's Issues

Unit Name - treated as an attribute

Unit Name - treated as an attribute//Currency - treated as an attribute POPUP_LINK(UnitInsertCurrency,Currency) //POPUP_CONNECT(UnitInsertCurrency) //The following are treated as MatML Attributes due to casting (e.g. reinterpret_cast) from one cardinality to _optional cardinality not working properly (Authority portion is miscast). The consquence of this is that both Unit->Name and Unit->Currency don't have a authority.

Subclass implementation

Implement Subclass type in BulkDetails and ComponentDetails. Subclass contains the component's subclass(es) and may occur zero or more times within the ComponentDetails element. For additional information, see the documentation for the SubClass type.

Required MatML elements

do we allow insert, delete, paste? e.g. BulkDetails->Name(). If the user forgets to add them the file will be unloadable as it will be not as per schema

Library of elements

Looking to create a library of elements for the user to cut and paste into their tree and to have them add elements to the library.

Sent a message to CodeSynthesis:

I'm looking to save sequences without requiring having to save the whole tree. The rationale behind this is to create a library of elements that can be then cloned into a tree.

Regards,

Undo and Redo

Currently, there is no implementation of Undo and Redo

BumpUp and BumpDown fixes

BumpUp and BumpDown don't work on:
-ParameterValue
-Material - conflicts with the GUI tree sorting algorithm. XOR bumpup/down and sorting.

validate Data1

need to validate Data1 input against the Data1::format()-int, float, string are done. But what exactly is mixed?

Crashing on Strongly Typed elements

Program crashes when selecting the Strongly Typed elements:

STRONGLY_TYPED_DEF(GlossaryTerm::Definition_type, Definition);
STRONGLY_TYPED_DEF(GlossaryTerm::Abbreviation_type, Abbreviation);
STRONGLY_TYPED_DEF(GlossaryTerm::Synonym_type, Synonym);
STRONGLY_TYPED_DEF(Geometry::Shape_type, Shape);
STRONGLY_TYPED_DEF(Geometry::Dimensions_type, Dimensions);
STRONGLY_TYPED_DEF(Geometry::Orientation_type, Orientation);
STRONGLY_TYPED_DEF(ProcessingDetails::Result_type, Result);
STRONGLY_TYPED_DEF(Class::ParentSubClass_type, ParentSubClass);
STRONGLY_TYPED_DEF(Form::Description_type, Description); // Form::Description is Name.  Use Name instead;
STRONGLY_TYPED_DEF(BulkDetails::Subclass_type, Subclass);
STRONGLY_TYPED_DEF(ComponentDetails::Subclass_type, Subclass1);

During the wxTreeCtrl creation in the TreeTraveral functions in the strongly typed are not correctly created.

	//Convert to a strongly typed required for the specialization of the functor
	auto element_strongly_typed{ std::make_shared<Definition>(element).get() };

Does not transfer element to strongly typed classes t member.

validator for the condition that Id cannot be a pure UUID

Create a validator for the condition that Id cannot be a pure UUID. Must have a Alpha begining not a numeric. This will throw a parse error. xs:IDs cannot have : characters anywhere in the name and cannot have a digit as the first character of the name.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.