Practise how to use Python XML.etree.ElementTree API to process ParamML of OpenBrIM projects. The example here is the MARC Bridge in GT campus.
Aiming at realizing three functions:
- Creating models
- Mapping ParamML models to other format
basically, all these works have been done in PyOpenBrIM.py.
- Querying project information
Aiming at apply object-oriented programming in ClassPyOpenBrIM.py.
Basic class: PyOpenBrIMElmt. Sub class: ObjElmt & PrmElmt. Sub-Sub class: Point, Line, Surface,..., inherited from ObjElmt.
aiming at model transfer function between 3D model and FEM model.
--> maybe too complex. later
class Sensor | - class Temperature | - class StrainGauge | - class Accelometer | - class Displacement
Question: class Sensor(object) or class Sensor(ObjElmt)? ObjElmt, as a new type of ParamML OBJECT, that is like <O T='Sensor' .../> Because i want to write new OpenBrIM schema for BrIM.
The structure of all code has been changed.
The OpenBrIM is only treated as an interface of the model, not the root of all works.
The whole class hierarchy for PyBrIM will be:
ABrIMELMT
+-- PyElmt
+-- PyDesign/Construct
+-- PySensor
+-- PyInspect
+-- PyXML = PyOBPack
+-- PyOpenBrIM
+-- PyDatabase
+-- PyMongo
+-- PyMySQL
Querying function is realized:
- by path, based on Xpath.
- by attributes, which is formatted as dictionary in Python.
Output format is based on
Use OpenBrIM Module to create the xml file in ParamML for MARC bridge.
the preliminary ClassPyOpenBrIM is done. In the next, apply it to re-create the xml for MARC bridge in order to test and modify it.
establish the FEM model, and then export SAP2000 file and excel file of it.
in the next, try to transfer the 3D model to FEM model.
basically complete the framework of class Sensor. More test maybe. Also start to package the RealObjects to Python class. Each RealObject will have both geomodel and femodel.
Introduce the MongoDB for structure and non-structure members as its schema-free character.
Each element in the bridge, like a beam or a deck, will have different attributes.
use PyOpenBrIM v2 (that is ClassPyOpenBrIM) to generate the xml file for MARC bridge and see what can be further developed.
再对照SensorML,看看它是如何定义的
-
class Damage(ObjElmt)
use a element to represent the damage in bridge.
But how many kinds of damage?
How can the damage be considered in the structure evaluation?
-
class Monitor(ObjElmt)
-
class Repair(ObjElmt)
- attributes of elements, like position, dimension, db_config, etc.
- how to generate model of the elements? as attribute or use @property?
- Method to draw the section.
sometimes, parameters are used to refer to another object. the best example is the material of section. has a sub element
In OpenBrIM, the tag is either 'O' or 'P', so the element.tag is not very useful.
The XPath can be useful when locating elements.
-
About OpenBrIM ParamML is specially designed XML language for OpenBrIM project.
-
About xml.etree.ElementTree The documetation of ET (short of ElementTree) is here.
-
About XPath The ET module provides limited support for (XPath)[https://docs.python.org/3/library/xml.etree.elementtree.html?highlight=xpath#xpath-support] to locate elements in a tree.