index.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>串口调试工具</title>
  7. <link rel="stylesheet" href="style.css">
  8. </head>
  9. <body>
  10. <div class="container">
  11. <h1>串口调试工具</h1>
  12. <!-- 端口控制区域 -->
  13. <div class="control-section">
  14. <div class="port-controls">
  15. <label for="portSelect">端口:</label>
  16. <div class="port-select-wrapper">
  17. <input type="text" id="portSelect" placeholder="例如: 1">
  18. <div id="portOptions" class="port-options">
  19. <div class="port-option" data-value="1">1</div>
  20. <div class="port-option" data-value="2">2</div>
  21. <div class="port-option" data-value="3">3</div>
  22. <div class="port-option" data-value="4">4</div>
  23. <div class="port-option" data-value="5">5</div>
  24. <div class="port-option" data-value="6">6</div>
  25. <div class="port-option" data-value="7">7</div>
  26. <div class="port-option" data-value="8">8</div>
  27. </div>
  28. </div>
  29. <div class="btn-group">
  30. <button id="startBtn" class="btn btn-primary">开始监听</button>
  31. <button id="stopBtn" class="btn btn-secondary">停止监听</button>
  32. <button id="clearBtn" class="btn btn-warning">清空日志</button>
  33. </div>
  34. </div>
  35. </div>
  36. <!-- 数据操作区域 -->
  37. <div class="data-section">
  38. <div class="data-controls">
  39. <div class="input-group">
  40. <input type="text" id="readData" placeholder="读数据,例如: 11 22 33" />
  41. <button id="readSendBtn" class="btn btn-info">读发送</button>
  42. </div>
  43. <div class="input-group">
  44. <input type="text" id="writeData" placeholder="写数据,例如: 11 22 33" />
  45. <button id="writeSendBtn" class="btn btn-success">写发送</button>
  46. </div>
  47. </div>
  48. </div>
  49. <!-- 复选框控制区域 -->
  50. <div class="checkbox-section">
  51. <h3>数据处理选项</h3>
  52. <!-- 三个复选框 -->
  53. <div class="checkbox-group">
  54. <label>
  55. <input type="checkbox" id="writeToWriteSend"> 写入数据 → 写发送
  56. </label>
  57. <label>
  58. <input type="checkbox" id="readToReadSend"> 读取数据 → 读发送
  59. </label>
  60. <label>
  61. <input type="checkbox" id="readToModifyData"> 读取数据 → 修改数据
  62. </label>
  63. </div>
  64. <!-- 数据表格 -->
  65. <table id="dataTable" class="data-table">
  66. <thead>
  67. <tr>
  68. <th>名称</th>
  69. <th>原始值</th>
  70. <th>最大值</th>
  71. </tr>
  72. </thead>
  73. <tbody>
  74. <!-- 数据将通过JavaScript动态填充 -->
  75. </tbody>
  76. </table>
  77. </div>
  78. <!-- 日志输出区域 -->
  79. <div class="log-section">
  80. <h3>日志输出</h3>
  81. <div id="logOutput" class="log-output"></div>
  82. </div>
  83. <!-- 连接状态 -->
  84. <div class="status-section">
  85. <span id="connectionStatus" class="status disconnected">未连接</span>
  86. </div>
  87. </div>
  88. <script src="script.js"></script>
  89. </body>
  90. </html>