规范化xml内容,并在xml中添加仿真设置,规范化版本号等内容,补充xml规范md文件
This commit is contained in:
1 parent
c52266ba11
commit
104d41d294
6 files changed
+254
-2
No files matched your search
@@ -1814,10 +1814,18 @@ function buildSystemXml(project: ReactFlowProjectPayload) {
|
||||
const xmlDocument = document.implementation.createDocument("", "System", null);
|
||||
const system = xmlDocument.documentElement;
|
||||
system.setAttribute("name", project.name);
|
||||
system.setAttribute("schemaVersion", "1");
|
||||
system.setAttribute("unitSystem", "SI");
|
||||
|
||||
const simulation = xmlDocument.createElement("Simulation");
|
||||
simulation.setAttribute("tStart", String(project.simulation.t_start));
|
||||
simulation.setAttribute("tStop", String(project.simulation.t_stop));
|
||||
simulation.setAttribute("step", String(project.simulation.step));
|
||||
simulation.setAttribute("maxStep", String(project.simulation.max_step));
|
||||
simulation.setAttribute("method", project.simulation.method);
|
||||
const components = xmlDocument.createElement("Components");
|
||||
const connections = xmlDocument.createElement("Connections");
|
||||
system.append(components, connections);
|
||||
system.append(simulation, components, connections);
|
||||
|
||||
project.nodes.forEach((node) => {
|
||||
const component = xmlDocument.createElement("Component");
|
||||
|
||||
Reference in new issue
Block a user