Verified Commit b8160861 authored by Stefan Brunecker's avatar Stefan Brunecker
Browse files

Add the model's name to the web interface

parent 436f8873
......@@ -73,11 +73,14 @@
src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/4.0.1/math.min.js"></script>
<script type="text/javascript" src="array_wrapper.js"></script>
<script type="text/javascript" src="array.js"></script>
<title>Model</title>
<title>Array</title>
</head>
<body>
<div class="container">
<div class="model">
<div class="header">
<h2>Array</h2>
</div>
<div class="ports">
<div class="inports">
<div class="header">
......
......@@ -73,11 +73,14 @@
src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/4.0.1/math.min.js"></script>
<script type="text/javascript" src="matrix_wrapper.js"></script>
<script type="text/javascript" src="matrix.js"></script>
<title>Model</title>
<title>Matrix</title>
</head>
<body>
<div class="container">
<div class="model">
<div class="header">
<h2>Matrix</h2>
</div>
<div class="ports">
<div class="inports">
<div class="header">
......
......@@ -73,11 +73,14 @@
src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/4.0.1/math.min.js"></script>
<script type="text/javascript" src="multiplePorts_wrapper.js"></script>
<script type="text/javascript" src="multiplePorts.js"></script>
<title>Model</title>
<title>MultiplePorts</title>
</head>
<body>
<div class="container">
<div class="model">
<div class="header">
<h2>MultiplePorts</h2>
</div>
<div class="ports">
<div class="inports">
<div class="header">
......
......@@ -73,11 +73,14 @@
src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/4.0.1/math.min.js"></script>
<script type="text/javascript" src="noPorts_wrapper.js"></script>
<script type="text/javascript" src="noPorts.js"></script>
<title>Model</title>
<title>NoPorts</title>
</head>
<body>
<div class="container">
<div class="model">
<div class="header">
<h2>NoPorts</h2>
</div>
<div class="ports">
<div class="inports">
<div class="header">
......
......@@ -73,11 +73,14 @@
src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/4.0.1/math.min.js"></script>
<script type="text/javascript" src="scalar_wrapper.js"></script>
<script type="text/javascript" src="scalar.js"></script>
<title>Model</title>
<title>Scalar</title>
</head>
<body>
<div class="container">
<div class="model">
<div class="header">
<h2>Scalar</h2>
</div>
<div class="ports">
<div class="inports">
<div class="header">
......
......@@ -65,11 +65,14 @@
src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/4.0.1/math.min.js"></script>
<script type="text/javascript" src="multiplePorts_wrapper.js"></script>
<script type="text/javascript" src="multiplePorts.js"></script>
<title>Model</title>
<title>MultiplePorts</title>
</head>
<body>
<div class="container">
<div class="model">
<div class="header">
<h2>MultiplePorts</h2>
</div>
<div class="ports">
<div class="inports">
<div class="header">
......
......@@ -21,6 +21,7 @@ import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.springframework.util.StringUtils;
/**
* This generator generates html files that can be used in combination with a
......@@ -62,6 +63,7 @@ public class HtmlGenerator {
List<Port> outports = produceOutports(model.getOutgoingPorts());
Map<String, Object> dataModel = new HashMap<>();
dataModel.put("modelName", getModelName(model));
dataModel.put("model", wasmNamingFunction.apply(model));
dataModel.put("model_wrapper", wrapperNamingFunction.apply(model));
dataModel.put("inports", inports);
......@@ -107,6 +109,10 @@ public class HtmlGenerator {
return type + dim;
}
private String getModelName(ExpandedComponentInstanceSymbol model) {
return StringUtils.capitalize(model.getName());
}
private Port port(String name, String wrapperFunction, String type) {
Port port = new Port();
port.setName(name);
......
......@@ -66,11 +66,14 @@
src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/4.0.1/math.min.js"></script>
<script type="text/javascript" src="${model_wrapper}.js"></script>
<script type="text/javascript" src="${model}.js"></script>
<title>Model</title>
<title>${modelName}</title>
</head>
<body>
<div class="container">
<div class="model">
<div class="header">
<h2>${modelName}</h2>
</div>
<div class="ports">
<div class="inports">
<div class="header">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment