64 lines
2.0 KiB
HTML
64 lines
2.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<script src="webui.js"></script>
|
|
<title>Frame Generator</title>
|
|
<style>
|
|
#container {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
#frameInput {
|
|
width: 45%;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
#buttons {
|
|
width: 45%;
|
|
text-align: right;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
#generateButton {
|
|
padding: 5px 10px;
|
|
font-size: 16px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
#outputFrame {
|
|
width: auto;
|
|
height: 300px;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="container">
|
|
<div id="frameInput">
|
|
<textarea id="frameParams" rows="10" placeholder="Enter frame parameters here..."></textarea>
|
|
<input type="text" id="comBPS" value="115200">
|
|
<input type="text" id="comParity" value="N">
|
|
<input type="text" id="modbus_addr" value="0x0E">
|
|
<input type="text" id="modbus_len" value="0x12">
|
|
<input type="text" id="modbus_value" value="32">
|
|
</div>
|
|
<div id="buttons">
|
|
<button id="button_com">Connect</button>
|
|
<button id="button_read"
|
|
onclick="my_function(getElementById('frameParams').value).then((response) => {getElementById('generatedFrame').value=response;});">读数据</button>
|
|
<button id="button_write_one"
|
|
onclick="my_function(getElementById('frameParams').value).then((response) => {getElementById('generatedFrame').value=response;});">写数据</button>
|
|
</div>
|
|
<div id="outputFrame">
|
|
<textarea id="generatedFrame" rows="10" placeholder="Generated frame will appear here..."
|
|
readonly></textarea>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
|
|
</html> |