Browse Source

use relative path

JY 5 months ago
parent
commit
63a73bf0de

+ 1 - 1
DIPM_resultStatistics/index.html

@@ -281,7 +281,7 @@
 </head>
 
 <body>
-    <audio id="alertSound" src="alert.mp3" preload="auto"></audio>
+    <audio id="alertSound" src="./alert.mp3" preload="auto"></audio>
     <div class="container">
         <div class="tabs">
             <div class="tab active" data-tab="repeatability">重复性</div>

+ 4 - 4
Desmos-Desktop-master/README.md

@@ -18,7 +18,7 @@ git clone https://github.com/DingShizhe/Desmos-Desktop.git
 cd Desmos-Desktop
 npm install -d
 npm run dist
-cd dist && ls   # WOW! Then move the package wherever you want. 
+cd dist && ls   # WOW! Then move the package wherever you want.
 ```
 On linux, you need edit ./res/appimagekit-desmos.desktop properly and move it to ./local/share/applications.
 
@@ -43,10 +43,10 @@ Now you can use this simple app to
 
 Try open `.des` files in 'examples'.
 
-<img src="res/Cardioid.png" width="200"/> <img src="res/Folded Conic Section.png" width="200"/> <img src="res/Folded Conic Section2.png" width="200"/>
+<img src="./res/Cardioid.png" width="200"/> <img src="./res/Folded Conic Section.png" width="200"/> <img src="./res/Folded Conic Section2.png" width="200"/>
 
-<img src="res/Folded Conic Section3.png" width="200"/> <img src="res/Brain.png" width="200"/> <img src="res/Mobius2.png" width="200"/>
+<img src="./res/Folded Conic Section3.png" width="200"/> <img src="./res/Brain.png" width="200"/> <img src="./res/Mobius2.png" width="200"/>
 
-<img src="res/Mobius.png" width="200"/> <img src="res/Astroid.png" width="200"/> <img src="res/Powerpuff Grils.png" width="200"/>
+<img src="./res/Mobius.png" width="200"/> <img src="./res/Astroid.png" width="200"/> <img src="./res/Powerpuff Grils.png" width="200"/>
 
 Hope this helpful. Enjoy ;)

+ 9 - 9
FuncGen/index.html

@@ -5,9 +5,9 @@
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>函数拟合工具</title>
-    <link rel="stylesheet" href="styles.css">
-    <link rel="stylesheet" href="enhanced-styles.css">
-    <link rel="stylesheet" href="excel-table.css">
+    <link rel="stylesheet" href="./styles.css">
+    <link rel="stylesheet" href="./enhanced-styles.css">
+    <link rel="stylesheet" href="./excel-table.css">
     <!-- 引入数学计算库 -->
     <script src="./math.min.js"></script>
     <!-- 引入绘图库 -->
@@ -198,12 +198,12 @@
         </div>
     </div>
 
-    <script src="utils-new.js"></script>
-    <script src="script.js"></script>
-    <script src="fit.js"></script>
-    <script src="regression.js"></script>
-    <script src="math-keyboard.js"></script>
-    <script src="data-table.js"></script>
+    <script src="./utils-new.js"></script>
+    <script src="./script.js"></script>
+    <script src="./fit.js"></script>
+    <script src="./regression.js"></script>
+    <script src="./math-keyboard.js"></script>
+    <script src="./data-table.js"></script>
 </body>
 
 </html>

+ 1 - 1
GeoGebra_Self/index.html

@@ -5,7 +5,7 @@
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>GeoGebra 几何画板</title>
-    <script src="deployggb.js"></script>
+    <script src="./deployggb.js"></script>
     <style>
         body {
             margin: 0;

+ 9 - 9
LabStatistics/common.js

@@ -183,7 +183,7 @@ function updateProjectTitle() {
     const titleInput = document.getElementById('project-title');
     const title = titleInput.value.trim() || '无标题';
     updateDocumentTitle();
-    setCookie('projectTitle', title, 365);
+    setLocalStorage('projectTitle', title, 365);
 }
 
 function updateDocumentTitle() {
@@ -274,26 +274,26 @@ function clearAllData() {
         span.innerText = '-';
     });
 
-    // 清除cookies
-    deleteCookie('repeatabilityData');
-    deleteCookie('stabilityData');
-    deleteCookie('errorData');
-    deleteCookie('customParamsData');
+    // 清除localStorage数据
+    removeLocalStorage('repeatabilityData');
+    removeLocalStorage('stabilityData');
+    removeLocalStorage('errorData');
+    removeLocalStorage('customParamsData');
 }
 
 function initializePage() {
     // 加载项目标题
-    const savedTitle = getCookie('projectTitle');
+    const savedTitle = getLocalStorage('projectTitle');
     if (savedTitle) {
         document.getElementById('project-title').value = savedTitle;
         updateDocumentTitle();
     }
 
     // 加载自定义参数
-    loadCustomParamsFromCookies();
+    loadCustomParamsFromLocalStorage();
 
     // 加载重复性、稳定性和示值误差数据
-    loadDataFromCookies();
+    loadDataFromLocalStorage();
 }
 
 // 更新当前时间显示

+ 4 - 4
LabStatistics/index.html

@@ -588,10 +588,10 @@
 
         <script src="./chart.js"></script>
         <script src="./utils.js"></script>
-        <script src="./data.js"></script>
-        <script src="./repeatability.js"></script>
-        <script src="./stability.js"></script>
-        <script src="./error.js"></script>
+        <script src="./pageData.js"></script>
+        <script src="./pageRepeatability.js"></script>
+        <script src="./pageStability.js"></script>
+        <script src="./pageError.js"></script>
         <script src="./common.js"></script>
 </body>
 

+ 53 - 51
LabStatistics/data.js → LabStatistics/pageData.js

@@ -1,7 +1,7 @@
 // data.js - 数据管理、导入导出相关功能
 
-// 收集并保存数据到cookie
-function collectAndSaveData(selector, timeSelector, resultIds, cookieName, days = 365) {
+// 收集并保存数据到localStorage
+function collectAndSaveData(selector, timeSelector, resultIds, cookieName) {
     // 收集输入数据
     const inputs = Array.from(document.querySelectorAll(selector)).map((input, index) => {
         const timeSpan = document.getElementById(`${timeSelector}-${index + 1}`);
@@ -22,25 +22,27 @@ function collectAndSaveData(selector, timeSelector, resultIds, cookieName, days
         });
     }
 
-    // 保存到cookie
+    // 保存到localStorage
     const data = {
         inputs: inputs,
         results: results
     };
+    console.log(data);
+    
 
-    setCookie(cookieName, JSON.stringify(data), days);
+    setLocalStorage(cookieName, JSON.stringify(data));
 }
 
 // 添加自定义参数
 function addCustomParam() {
     const container = document.getElementById('custom-params-container');
-    
+
     const paramRow = document.createElement('div');
     paramRow.className = 'custom-param-row';
     paramRow.style.display = 'flex';
     paramRow.style.alignItems = 'center';
     paramRow.style.gap = '0.5rem';
-    
+
     const nameInput = document.createElement('input');
     nameInput.type = 'text';
     nameInput.className = 'param-name';
@@ -50,7 +52,7 @@ function addCustomParam() {
     nameInput.style.border = '1px solid #ccc';
     nameInput.style.borderRadius = '4px';
     nameInput.oninput = saveCustomParamsData;
-    
+
     const valueInput = document.createElement('input');
     valueInput.type = 'text';
     valueInput.className = 'param-value';
@@ -60,7 +62,7 @@ function addCustomParam() {
     valueInput.style.border = '1px solid #ccc';
     valueInput.style.borderRadius = '4px';
     valueInput.oninput = saveCustomParamsData;
-    
+
     const deleteBtn = document.createElement('span');
     deleteBtn.className = 'delete-btn';
     deleteBtn.innerHTML = '×';
@@ -68,7 +70,7 @@ function addCustomParam() {
         container.removeChild(paramRow);
         saveCustomParamsData();
     };
-    
+
     paramRow.appendChild(nameInput);
     paramRow.appendChild(valueInput);
     paramRow.appendChild(deleteBtn);
@@ -81,23 +83,23 @@ function saveCustomParamsData() {
         name: row.querySelector('.param-name').value,
         value: row.querySelector('.param-value').value
     }));
-    
-    setCookie('customParamsData', JSON.stringify(customParams), 365);
+
+    setLocalStorage('customParamsData', JSON.stringify(customParams), 365);
 }
 
-// 从cookies加载自定义参数
-function loadCustomParamsFromCookies() {
-    const savedParams = getCookie('customParamsData');
+// 从localStorage加载自定义参数
+function loadCustomParamsFromLocalStorage() {
+    const savedParams = getLocalStorage('customParamsData');
     if (savedParams) {
         try {
             const params = JSON.parse(savedParams);
             const container = document.getElementById('custom-params-container');
-            
+
             // 清除现有参数
             while (container.firstChild) {
                 container.removeChild(container.firstChild);
             }
-            
+
             // 添加保存的自定义参数
             params.forEach(param => {
                 const paramRow = document.createElement('div');
@@ -105,7 +107,7 @@ function loadCustomParamsFromCookies() {
                 paramRow.style.display = 'flex';
                 paramRow.style.alignItems = 'center';
                 paramRow.style.gap = '0.5rem';
-                
+
                 const nameInput = document.createElement('input');
                 nameInput.type = 'text';
                 nameInput.className = 'param-name';
@@ -116,7 +118,7 @@ function loadCustomParamsFromCookies() {
                 nameInput.style.borderRadius = '4px';
                 nameInput.value = param.name;
                 nameInput.oninput = saveCustomParamsData;
-                
+
                 const valueInput = document.createElement('input');
                 valueInput.type = 'text';
                 valueInput.className = 'param-value';
@@ -127,7 +129,7 @@ function loadCustomParamsFromCookies() {
                 valueInput.style.borderRadius = '4px';
                 valueInput.value = param.value;
                 valueInput.oninput = saveCustomParamsData;
-                
+
                 const deleteBtn = document.createElement('span');
                 deleteBtn.className = 'delete-btn';
                 deleteBtn.innerHTML = '×';
@@ -135,7 +137,7 @@ function loadCustomParamsFromCookies() {
                     container.removeChild(paramRow);
                     saveCustomParamsData();
                 };
-                
+
                 paramRow.appendChild(nameInput);
                 paramRow.appendChild(valueInput);
                 paramRow.appendChild(deleteBtn);
@@ -147,42 +149,42 @@ function loadCustomParamsFromCookies() {
     }
 }
 
-// 从cookies加载数据
-function loadDataFromCookies() {
+// 从localStorage加载数据
+function loadDataFromLocalStorage() {
     // 加载重复性数据
-    const savedRepeatabilityData = getCookie('repeatabilityData');
+    const savedRepeatabilityData = getLocalStorage('repeatabilityData');
     if (savedRepeatabilityData) {
         try {
             const data = JSON.parse(savedRepeatabilityData);
-            
+
             // 清除现有的额外输入框(保留前6个)
             const repeatabilityInputs = document.querySelectorAll('#repeatability-inputs .input-row');
             for (let i = 6; i < repeatabilityInputs.length; i++) {
                 repeatabilityInputs[i].remove();
             }
-            
+
             // 清除现有输入值
             document.querySelectorAll('#repeatability-inputs input[type="number"]').forEach(input => {
                 input.value = '';
             });
-            
+
             // 填充保存的数据
             if (data.inputs && data.inputs.length > 0) {
                 data.inputs.forEach((item, index) => {
                     const value = typeof item === 'object' ? item.value : item;
                     const time = typeof item === 'object' ? item.time : '';
-                    
+
                     // 如果索引超出现有输入框数量,添加新的输入框
                     if (index >= 6) {
                         addRepeatabilityInput();
                     }
-                    
+
                     // 设置值
                     const input = document.querySelector(`#repeatability-inputs .input-row:nth-child(${index + 1}) input`);
                     if (input) {
                         input.value = value;
                     }
-                    
+
                     // 设置时间
                     if (time) {
                         const timeSpan = document.getElementById(`repeatability-time-text-${index + 1}`);
@@ -192,7 +194,7 @@ function loadDataFromCookies() {
                         }
                     }
                 });
-                
+
                 // 计算结果
                 calculateRepeatability();
             }
@@ -200,41 +202,41 @@ function loadDataFromCookies() {
             console.error('加载重复性数据失败:', e);
         }
     }
-    
+
     // 加载稳定性数据
-    const savedStabilityData = getCookie('stabilityData');
+    const savedStabilityData = getLocalStorage('stabilityData');
     if (savedStabilityData) {
         try {
             const data = JSON.parse(savedStabilityData);
-            
+
             // 清除现有的额外输入框(保留前6个)
             const stabilityInputs = document.querySelectorAll('#stability-inputs .input-row');
             for (let i = 6; i < stabilityInputs.length; i++) {
                 stabilityInputs[i].remove();
             }
-            
+
             // 清除现有输入值
             document.querySelectorAll('#stability-inputs input[type="number"]').forEach(input => {
                 input.value = '';
             });
-            
+
             // 填充保存的数据
             if (data.inputs && data.inputs.length > 0) {
                 data.inputs.forEach((item, index) => {
                     const value = typeof item === 'object' ? item.value : item;
                     const time = typeof item === 'object' ? item.time : '';
-                    
+
                     // 如果索引超出现有输入框数量,添加新的输入框
                     if (index >= 6) {
                         addStabilityInput();
                     }
-                    
+
                     // 设置值
                     const input = document.querySelector(`#stability-inputs .input-row:nth-child(${index + 1}) input`);
                     if (input) {
                         input.value = value;
                     }
-                    
+
                     // 设置时间
                     if (time) {
                         const timeSpan = document.getElementById(`stability-time-text-${index + 1}`);
@@ -244,7 +246,7 @@ function loadDataFromCookies() {
                         }
                     }
                 });
-                
+
                 // 计算结果
                 calculateStability();
             }
@@ -252,24 +254,24 @@ function loadDataFromCookies() {
             console.error('加载稳定性数据失败:', e);
         }
     }
-    
+
     // 加载示值误差数据
-    const savedErrorData = getCookie('errorData');
+    const savedErrorData = getLocalStorage('errorData');
     if (savedErrorData) {
         try {
             const errorData = JSON.parse(savedErrorData);
-            
+
             // 清除现有的测试点
             const errorContainer = document.getElementById('error-inputs');
             while (errorContainer.firstChild) {
                 errorContainer.removeChild(errorContainer.firstChild);
             }
-            
+
             // 添加保存的测试点
             errorData.forEach(item => {
                 const pointContainer = createErrorPointContainer(item.point);
                 errorContainer.appendChild(pointContainer);
-                
+
                 // 填充输入值
                 const inputs = pointContainer.querySelectorAll('.error-input');
                 item.inputs.forEach((value, index) => {
@@ -278,7 +280,7 @@ function loadDataFromCookies() {
                     }
                 });
             });
-            
+
             // 计算结果
             calculateError();
             updateErrorPoints();
@@ -348,8 +350,8 @@ function exportData() {
      document.body.removeChild(a);
      URL.revokeObjectURL(url);
 
-     // 保存所有数据到cookies
-     saveDataToCookies();
+     // 保存所有数据到localStorage
+     saveDataToLocalStorage();
  }
 
 // 导入数据
@@ -567,8 +569,8 @@ function importData() {
                  });
              }
 
-             // 保存所有数据到cookies
-             saveDataToCookies();
+             // 保存所有数据到localStorage
+             saveDataToLocalStorage();
 
              alert('数据导入成功!');
          } catch (error) {
@@ -579,8 +581,8 @@ function importData() {
      reader.readAsText(file);
  }
 
-// 保存所有数据到cookies(兼容性函数)
-function saveDataToCookies() {
+// 保存所有数据到localStorage(兼容性函数)
+function saveDataToLocalStorage() {
     saveRepeatabilityData();
     saveStabilityData();
     saveErrorData();

+ 4 - 4
LabStatistics/error.js → LabStatistics/pageError.js

@@ -62,7 +62,7 @@ function createErrorPointContainer(pointValue = '') {
     pointInput.style.marginRight = '0.5rem';
     pointInput.oninput = function () {
         updateErrorPoint(this);
-        // 保存示值误差数据到cookies
+        // 保存示值误差数据到localStorage
         saveErrorData();
     };
 
@@ -76,7 +76,7 @@ function createErrorPointContainer(pointValue = '') {
             addErrorPoint();
         }
         calculateError();
-        // 保存误差数据到cookies
+        // 保存误差数据到localStorage
         saveErrorData();
     };
 
@@ -103,7 +103,7 @@ function createErrorPointContainer(pointValue = '') {
         input.style.minWidth = '100px';
         input.oninput = function () {
             calculateError();
-            // 保存误差数据到cookies
+            // 保存误差数据到localStorage
             saveErrorData();
         };
         inputsContainer.appendChild(input);
@@ -287,5 +287,5 @@ function saveErrorData() {
         };
     });
 
-    setCookie('errorData', JSON.stringify(errorData), 365);
+    setLocalStorage('errorData', JSON.stringify(errorData), 365);
 }

+ 0 - 0
LabStatistics/repeatability.js → LabStatistics/pageRepeatability.js


+ 6 - 6
LabStatistics/stability.js → LabStatistics/psgeStability.js

@@ -154,9 +154,9 @@ function saveStabilityData() {
 
 // 加载计时器设置
 function loadTimerSettings() {
-    const savedMinutes = getCookie('timerMinutes');
-    const savedSeconds = getCookie('timerSeconds');
-    const savedAutoCountdown = getCookie('autoCountdownEnabled');
+    const savedMinutes = getLocalStorage('timerMinutes');
+    const savedSeconds = getLocalStorage('timerSeconds');
+    const savedAutoCountdown = getLocalStorage('autoCountdownEnabled');
 
     if (savedMinutes !== null && savedSeconds !== null) {
         const minutes = parseInt(savedMinutes);
@@ -176,12 +176,12 @@ function loadTimerSettings() {
 
 // 保存计时器设置
 function saveTimerSettings(minutes, seconds) {
-    setCookie('timerMinutes', minutes, 30);
-    setCookie('timerSeconds', seconds, 30);
+    setLocalStorage('timerMinutes', minutes, 30);
+    setLocalStorage('timerSeconds', seconds, 30);
 
     // 保存自动倒计时设置
     const autoCountdownEnabled = document.getElementById('auto-countdown-enabled').checked;
-    setCookie('autoCountdownEnabled', autoCountdownEnabled ? '1' : '0', 30);
+    setLocalStorage('autoCountdownEnabled', autoCountdownEnabled ? '1' : '0', 30);
 }
 
 // 打开计时器对话框

+ 3 - 7
LabStatistics/utils.js

@@ -1,9 +1,7 @@
 // utils.js - 通用工具函数
 
 // 保存数据到localStorage
-function setCookie(name, value, days) {
-    // 直接使用localStorage,不再使用cookie
-    // days参数保留但不使用,保持函数签名兼容性
+function setLocalStorage(name, value) {
     try {
         localStorage.setItem(name, value);
     } catch (e) {
@@ -12,8 +10,7 @@ function setCookie(name, value, days) {
 }
 
 // 从localStorage获取数据
-function getCookie(name) {
-    // 直接从localStorage获取,不再使用cookie
+function getLocalStorage(name) {
     try {
         return localStorage.getItem(name);
     } catch (e) {
@@ -23,8 +20,7 @@ function getCookie(name) {
 }
 
 // 从localStorage删除数据
-function deleteCookie(name) {
-    // 直接从localStorage删除,不再使用cookie
+function removeLocalStorage(name) {
     try {
         localStorage.removeItem(name);
     } catch (e) {

+ 132 - 104
RT_Table/RT_Table_Import.html

@@ -5,18 +5,18 @@
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>RT Table Import</title>
-    <link rel="stylesheet" href="styles.css">
+    <link rel="stylesheet" href="./styles.css">
 </head>
 
 <body>
     <header>
         <h1>RT Table Generator</h1>
         <ul class="nav-tabs">
-            <li><a href="RT_Table_NTC.html">NTC</a></li>
-            <li><a href="RT_Table_PT100.html">PT100</a></li>
-            <li><a href="RT_Table_PT1000.html">PT1000</a></li>
-            <li><a href="VT_Table_TJ.html">Thermocouple</a></li>
-            <li><a href="RT_Table_Import.html" class="active">Import Data</a></li>
+            <li><a href="./RT_Table_NTC.html">NTC</a></li>
+            <li><a href="./RT_Table_PT100.html">PT100</a></li>
+            <li><a href="./RT_Table_PT1000.html">PT1000</a></li>
+            <li><a href="./VT_Table_TJ.html">Thermocouple</a></li>
+            <li><a href="./RT_Table_Import.html" class="active">Import Data</a></li>
         </ul>
     </header>
 
@@ -141,6 +141,14 @@
                             <input type="number" id="output-step" name="output-step" value="1" min="0.1" step="0.1" class="tableInput">
                         </td>
                     </tr>
+                    <tr>
+                        <td>
+                            <label for="result-coefficient">Result Coefficient:</label>
+                        </td>
+                        <td>
+                            <input type="number" id="result-coefficient" name="result-coefficient" value="1" min="0.001" step="0.001" class="tableInput">
+                        </td>
+                    </tr>
                     <tr>
                         <td colspan="2">
                             <button onclick="generateOutputTable()">Generate Output Table</button>
@@ -182,24 +190,24 @@
         // 全局变量
         let importedData = [];
         let processedData = [];
-        
+
         // 页面加载时初始化
         document.addEventListener('DOMContentLoaded', function() {
             // 设置默认数据类型为RT
             document.getElementById('data-type').value = 'RT';
-            
+
             // 初始化输出温度范围
             document.getElementById('output_T_min').value = 0;
             document.getElementById('output_T_max').value = 0;
         });
-        
+
         // 检测分隔符
         function detectDelimiter(text) {
             const lines = text.trim().split(/\r?\n/);
             if (lines.length === 0) return 'tab';
-            
+
             const firstLine = lines[0];
-            
+
             // 检查各种分隔符的出现次数
             const delimiters = {
                 'tab': (firstLine.match(/\t/g) || []).length,
@@ -207,21 +215,21 @@
                 'semicolon': (firstLine.match(/;/g) || []).length,
                 'space': (firstLine.match(/ /g) || []).length
             };
-            
+
             // 找出出现次数最多的分隔符
             let maxCount = 0;
             let detectedDelimiter = 'tab';
-            
+
             for (const [delimiter, count] of Object.entries(delimiters)) {
                 if (count > maxCount) {
                     maxCount = count;
                     detectedDelimiter = delimiter;
                 }
-            }
-            
+                        }
+
             return detectedDelimiter;
         }
-        
+
         // 处理导入的数据
         function processImportedData() {
             const importText = document.getElementById("importData").value.trim();
@@ -229,56 +237,56 @@
                 alert("Please paste data first!");
                 return;
             }
-            
+
             // 获取用户选择的分隔符或自动检测
             let delimiterChoice = document.getElementById("delimiter").value;
             let delimiterChar;
-            
+
             if (delimiterChoice === 'auto') {
                 delimiterChoice = detectDelimiter(importText);
             }
-            
+
             // 设置实际的分隔符字符
             switch (delimiterChoice) {
-                case 'tab': delimiterChar = '\t'; break;
-                case 'comma': delimiterChar = ','; break;
+                            case 'tab': delimiterChar = '\t'; break;
+                        case 'comma': delimiterChar = ','; break;
                 case 'space': delimiterChar = ' '; break;
                 case 'semicolon': delimiterChar = ';'; break;
                 default: delimiterChar = '\t';
             }
-            
-            // 分割文本为行
+
+                        // 分割文本为行
             const lines = importText.split(/\r?\n/);
             importedData = [];
-            
+
             // 处理每一行
             for (const line of lines) {
                 if (!line.trim()) continue; // 跳过空行
-                
+
                 // 分割行为列
-                let columns;
+                            let columns;
                 if (delimiterChoice === 'space') {
                     // 对于空格分隔,处理多个连续空格的情况
                     columns = line.trim().split(/\s+/);
                 } else {
                     columns = line.split(delimiterChar);
                 }
-                
+
                 // 确保至少有两列
                 if (columns.length >= 2) {
-                    const temp = parseFloat(columns[0]);
+                                const temp = parseFloat(columns[0]);
                     const value = parseFloat(columns[1]);
-                    
+
                     // 确保两个值都是有效的数字
                     if (!isNaN(temp) && !isNaN(value)) {
                         importedData.push({ temperature: temp, value: value });
                     }
                 }
             }
-            
+
             // 按温度排序
             importedData.sort((a, b) => a.temperature - b.temperature);
-            
+
             // 更新数据类型标题
             const dataType = document.getElementById("data-type").value;
             const valueHeader = document.getElementById("value-header");
@@ -287,28 +295,28 @@
             } else {
                 valueHeader.textContent = "Voltage (mV)";
             }
-            
+
             // 显示导入的数据
             displayTable(importedData);
-            
-            // 更新参数
+
+                        // 更新参数
             if (importedData.length > 0) {
                 // 设置温度范围
-                const minTemp = importedData[0].temperature;
+                            const minTemp = importedData[0].temperature;
                 const maxTemp = importedData[importedData.length - 1].temperature;
-                
+
                 document.getElementById("param_T_min").value = minTemp;
                 document.getElementById("param_T_max").value = maxTemp;
-                
+
                 // 同时更新输出温度范围
-                document.getElementById("output_T_min").value = minTemp;
+                                document.getElementById("output_T_min").value = minTemp;
                 document.getElementById("output_T_max").value = maxTemp;
-                
+
                 // 计算平均步长
                 if (importedData.length > 1) {
                     let totalSteps = 0;
                     let stepCount = 0;
-                    
+
                     for (let i = 1; i < importedData.length; i++) {
                         const step = importedData[i].temperature - importedData[i-1].temperature;
                         if (step > 0) {
@@ -316,39 +324,39 @@
                             stepCount++;
                         }
                     }
-                    
+
                     const avgStep = stepCount > 0 ? (totalSteps / stepCount) : 1;
                     document.getElementById("param_step").value = avgStep.toFixed(2);
                     document.getElementById("output-step").value = avgStep.toFixed(2);
                 }
             }
-            
+
             // 显示JSON数据
             displayJsonData(importedData);
         }
-        
+
         // 线性插值函数
         function linearInterpolate(x, x0, y0, x1, y1) {
             return y0 + (x - x0) * (y1 - y0) / (x1 - x0);
         }
-        
+
         // 多项式拟合函数
         function polynomialFit(data, degree) {
             // 简单实现,实际应用中可能需要更复杂的算法
-            // 这里使用最小二乘法拟合多项式
+                    // 这里使用最小二乘法拟合多项式
             const n = data.length;
             const x = data.map(d => d.temperature);
             const y = data.map(d => d.value);
-            
+
             // 创建矩阵
             const X = [];
             for (let i = 0; i < n; i++) {
-                X[i] = [];
+                            X[i] = [];
                 for (let j = 0; j <= degree; j++) {
                     X[i][j] = Math.pow(x[i], j);
                 }
             }
-            
+
             // 转置矩阵
             const Xt = [];
             for (let j = 0; j <= degree; j++) {
@@ -357,7 +365,7 @@
                     Xt[j][i] = X[i][j];
                 }
             }
-            
+
             // 计算 Xt * X
             const XtX = [];
             for (let i = 0; i <= degree; i++) {
@@ -369,22 +377,22 @@
                     }
                 }
             }
-            
+
             // 计算 Xt * y
             const Xty = [];
-            for (let i = 0; i <= degree; i++) {
+                        for (let i = 0; i <= degree; i++) {
                 Xty[i] = 0;
                 for (let j = 0; j < n; j++) {
                     Xty[i] += Xt[i][j] * y[j];
                 }
             }
-            
+
             // 解线性方程组 XtX * coeffs = Xty
-            // 使用高斯消元法
+                        // 使用高斯消元法
             const coeffs = solveLinearSystem(XtX, Xty);
-            
+
             // 返回多项式函数
-            return function(x) {
+                        return function(x) {
                 let result = 0;
                 for (let i = 0; i <= degree; i++) {
                     result += coeffs[i] * Math.pow(x, i);
@@ -392,13 +400,13 @@
                 return result;
             };
         }
-        
+
         // 解线性方程组
-        function solveLinearSystem(A, b) {
+                function solveLinearSystem(A, b) {
             const n = b.length;
             const x = new Array(n).fill(0);
-            
-            // 高斯消元法
+
+                        // 高斯消元法
             for (let i = 0; i < n; i++) {
                 // 寻找主元
                 let maxEl = Math.abs(A[i][i]);
@@ -409,13 +417,13 @@
                         maxRow = k;
                     }
                 }
-                
+
                 // 交换行
                 if (maxRow !== i) {
                     [A[i], A[maxRow]] = [A[maxRow], A[i]];
                     [b[i], b[maxRow]] = [b[maxRow], b[i]];
-                }
-                
+                                }
+
                 // 消元
                 for (let k = i + 1; k < n; k++) {
                     const c = -A[k][i] / A[i][i];
@@ -427,33 +435,33 @@
                         }
                     }
                     b[k] += c * b[i];
-                }
+                            }
             }
-            
+
             // 回代
             for (let i = n - 1; i >= 0; i--) {
                 x[i] = b[i] / A[i][i];
                 for (let k = i - 1; k >= 0; k--) {
                     b[k] -= A[k][i] * x[i];
-                }
+                            }
             }
-            
+
             return x;
         }
-        
+
         // 生成输出表格
         function generateOutputTable() {
             if (importedData.length === 0) {
                 alert("Please import and process data first!");
                 return;
             }
-            
+
             // 使用用户设置的输出温度范围,如果未设置则使用数据的温度范围
             let Tmin = parseFloat(document.getElementById("output_T_min").value);
             let Tmax = parseFloat(document.getElementById("output_T_max").value);
             const dataTmin = parseFloat(document.getElementById("param_T_min").value);
             const dataTmax = parseFloat(document.getElementById("param_T_max").value);
-            
+
             // 验证输出温度范围
             if (isNaN(Tmin) || Tmin < dataTmin) {
                 Tmin = dataTmin;
@@ -470,29 +478,30 @@
                 document.getElementById("output_T_max").value = dataTmax;
                 alert("Output temperature min cannot be greater than max. Using data range instead.");
             }
-            
+
             const step = parseFloat(document.getElementById("output-step").value);
+            const resultCoefficient = parseFloat(document.getElementById("result-coefficient").value);
             const interpolationMethod = document.getElementById("interpolation").value;
-            
+
             processedData = [];
-            
+
             if (interpolationMethod === "linear") {
                 // 线性插值
                 for (let T = Tmin; T <= Tmax; T += step) {
                     // 找到T所在的区间
                     let value;
-                    
+
                     // 如果T小于第一个点或大于最后一个点,使用外推
                     if (T <= importedData[0].temperature) {
                         value = importedData[0].value;
                     } else if (T >= importedData[importedData.length - 1].temperature) {
                         value = importedData[importedData.length - 1].value;
-                    } else {
+                                } else {
                         // 找到T所在的区间
                         for (let i = 0; i < importedData.length - 1; i++) {
                             if (T >= importedData[i].temperature && T <= importedData[i + 1].temperature) {
                                 value = linearInterpolate(
-                                    T,
+                                                        T,
                                     importedData[i].temperature,
                                     importedData[i].value,
                                     importedData[i + 1].temperature,
@@ -502,67 +511,82 @@
                             }
                         }
                     }
-                    
-                    processedData.push({ temperature: T, value: value });
+
+                    // 应用系数并限制小数位数为6位,并去除末尾的0
+                    const roundedT = Number(T.toFixed(6));
+                    const roundedValue = Number((value * resultCoefficient).toFixed(6));
+                    processedData.push({ temperature: roundedT, value: roundedValue });
                 }
             } else if (interpolationMethod === "polynomial") {
                 // 多项式拟合
                 const degree = parseInt(document.getElementById("polynomial-degree").value);
                 const polyFunc = polynomialFit(importedData, degree);
-                
+
                 for (let T = Tmin; T <= Tmax; T += step) {
-                    const value = polyFunc(T);
-                    processedData.push({ temperature: T, value: value });
+                    // 应用系数并限制小数位数为6位,并去除末尾的0
+                    const roundedT = Number(T.toFixed(6));
+                    const value = Number((polyFunc(T) * resultCoefficient).toFixed(6));
+                    processedData.push({ temperature: roundedT, value: value });
                 }
             }
-            
+
             // 显示处理后的数据
             displayTable(processedData);
             displayJsonData(processedData);
             displayCArrayData(processedData);
         }
-        
+
         // 显示表格数据
         function displayTable(data) {
             const tbody = document.getElementById("rtTable").querySelector("tbody");
             tbody.innerHTML = "";  // 清空表格内容
-            
+
             const dataType = document.getElementById("data-type").value;
-            
+
             data.forEach(row => {
                 const tr = document.createElement("tr");
+                // 限制小数位数为6位,并去除末尾的0
+                const displayValue = Number(row.value.toFixed(6));
+                const tempValue = Number(row.temperature.toFixed(6));
                 if (dataType === "RT") {
-                    tr.innerHTML = `<td>${row.temperature}</td><td>${row.value}</td>`;
+                    tr.innerHTML = `<td>${tempValue}</td><td>${displayValue}</td>`;
                 } else {
-                    tr.innerHTML = `<td>${row.temperature}</td><td>${row.value}</td>`;
+                    tr.innerHTML = `<td>${tempValue}</td><td>${displayValue}</td>`;
                 }
                 tbody.appendChild(tr);
             });
         }
-        
+
         // 显示 JSON 数据到文本框
         function displayJsonData(data) {
-            const jsonData = JSON.stringify(data, null, 4); // 格式化JSON
+            // 应用小数位数限制,并去除末尾的0
+            const dataWithLimitedDecimals = data.map(item => ({
+                temperature: Number(item.temperature.toFixed(6)), // 限制温度小数位数为6位并去除末尾的0
+                value: Number(item.value.toFixed(6)) // 限制值小数位数为6位并去除末尾的0
+            }));
+
+            const jsonData = JSON.stringify(dataWithLimitedDecimals, null, 4); // 格式化JSON
             const textarea = document.getElementById("jsonData");
             textarea.value = jsonData;
         }
-        
+
         // 显示 C 语言数组到文本框
         function displayCArrayData(data) {
             if (data.length === 0) return;
-            
-            const temperatures = data.map(row => row.temperature); // 提取温度值
-            const values = data.map(row => row.value);   // 提取值
-            
+
+            // 提取温度值和值,并限制小数位数为6位,去除末尾的0
+            const temperatures = data.map(row => Number(row.temperature.toFixed(6))); // 限制温度小数位数为6位并去除末尾的0
+            const values = data.map(row => Number(row.value.toFixed(6)));   // 限制值小数位数为6位并去除末尾的0
+
             const dataType = document.getElementById("data-type").value;
             const namePrefix = document.getElementById("param_name").value;
-            const Tmin = data[0].temperature;
-            const Tmax = data[data.length - 1].temperature;
-            const step = parseFloat(document.getElementById("output-step").value);
-            
+            const Tmin = Number(data[0].temperature.toFixed(6));
+            const Tmax = Number(data[data.length - 1].temperature.toFixed(6));
+            const step = Number(parseFloat(document.getElementById("output-step").value).toFixed(6));
+
             const prefix = (Tmin < 0 ? 'N' : 'P') + Math.abs(Tmin).toString() + 'to' + (Tmax < 0 ? 'N' : 'P') + Math.abs(Tmax).toString() + '_' + step.toString();
-            
-            let arrayPrefix, valueArrayName;
+
+                    let arrayPrefix, valueArrayName;
             if (dataType === "RT") {
                 arrayPrefix = `RT_table_${namePrefix}_${prefix}`;
                 valueArrayName = "R";
@@ -570,15 +594,19 @@
                 arrayPrefix = `VT_table_${namePrefix}_${prefix}`;
                 valueArrayName = "V";
             }
-            
+
+            // 格式化数组元素,确保使用6位小数,并去除末尾的0
+            const formattedTemperatures = temperatures.map(t => Number(t.toFixed(6)).toString());
+            const formattedValues = values.map(v => Number(v.toFixed(6)).toString());
+
             const cArrayTempSize = `const uint16_t ${arrayPrefix}_size = ${temperatures.length};`;
-            const cArrayTemp = `const double ${arrayPrefix}_T[${temperatures.length}] = { ${temperatures.join(", ")} };`;
-            const cArrayValue = `const double ${arrayPrefix}_${valueArrayName}[${values.length}] = { ${values.join(", ")} };`;
-            
+            const cArrayTemp = `const double ${arrayPrefix}_T[${temperatures.length}] = { ${formattedTemperatures.join(", ")} };`;
+            const cArrayValue = `const double ${arrayPrefix}_${valueArrayName}[${values.length}] = { ${formattedValues.join(", ")} };`;
+
             const textarea = document.getElementById("cArrayData");
             textarea.value = `${cArrayTempSize}\n\n${cArrayTemp}\n\n${cArrayValue}`;
         }
-        
+
         // 监听插值方法选择变化
         document.getElementById("interpolation").addEventListener("change", function() {
             const polynomialRow = document.getElementById("polynomial-degree-row");

+ 6 - 6
RT_Table/RT_Table_NTC.html

@@ -5,18 +5,18 @@
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>RT Table NTC</title>
-    <link rel="stylesheet" href="styles.css">
+    <link rel="stylesheet" href="./styles.css">
 </head>
 
 <body>
     <header>
         <h1>RT Table Generator</h1>
         <ul class="nav-tabs">
-            <li><a href="RT_Table_NTC.html" class="active">NTC</a></li>
-            <li><a href="RT_Table_PT100.html">PT100</a></li>
-            <li><a href="RT_Table_PT1000.html">PT1000</a></li>
-            <li><a href="VT_Table_TJ.html">Thermocouple</a></li>
-            <li><a href="RT_Table_Import.html">Import Data</a></li>
+            <li><a href="./RT_Table_NTC.html" class="active">NTC</a></li>
+            <li><a href="./RT_Table_PT100.html">PT100</a></li>
+            <li><a href="./RT_Table_PT1000.html">PT1000</a></li>
+            <li><a href="./VT_Table_TJ.html">Thermocouple</a></li>
+            <li><a href="./RT_Table_Import.html">Import Data</a></li>
         </ul>
     </header>
 

+ 6 - 6
RT_Table/RT_Table_PT100.html

@@ -5,18 +5,18 @@
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>RT Table PT100</title>
-    <link rel="stylesheet" href="styles.css">
+    <link rel="stylesheet" href="./styles.css">
 </head>
 
 <body>
     <header>
         <h1>RT Table Generator</h1>
         <ul class="nav-tabs">
-            <li><a href="RT_Table_NTC.html">NTC</a></li>
-            <li><a href="RT_Table_PT100.html" class="active">PT100</a></li>
-            <li><a href="RT_Table_PT1000.html">PT1000</a></li>
-            <li><a href="VT_Table_TJ.html">Thermocouple</a></li>
-            <li><a href="RT_Table_Import.html">Import Data</a></li>
+            <li><a href="./RT_Table_NTC.html">NTC</a></li>
+            <li><a href="./RT_Table_PT100.html" class="active">PT100</a></li>
+            <li><a href="./RT_Table_PT1000.html">PT1000</a></li>
+            <li><a href="./VT_Table_TJ.html">Thermocouple</a></li>
+            <li><a href="./RT_Table_Import.html">Import Data</a></li>
         </ul>
     </header>
 

+ 6 - 6
RT_Table/RT_Table_PT1000.html

@@ -5,18 +5,18 @@
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>RT Table PT1000</title>
-    <link rel="stylesheet" href="styles.css">
+    <link rel="stylesheet" href="./styles.css">
 </head>
 
 <body>
     <header>
         <h1>RT Table Generator</h1>
         <ul class="nav-tabs">
-            <li><a href="RT_Table_NTC.html">NTC</a></li>
-            <li><a href="RT_Table_PT100.html">PT100</a></li>
-            <li><a href="RT_Table_PT1000.html" class="active">PT1000</a></li>
-            <li><a href="VT_Table_TJ.html">Thermocouple</a></li>
-            <li><a href="RT_Table_Import.html">Import Data</a></li>
+            <li><a href="./RT_Table_NTC.html">NTC</a></li>
+            <li><a href="./RT_Table_PT100.html">PT100</a></li>
+            <li><a href="./RT_Table_PT1000.html" class="active">PT1000</a></li>
+            <li><a href="./VT_Table_TJ.html">Thermocouple</a></li>
+            <li><a href="./RT_Table_Import.html">Import Data</a></li>
         </ul>
     </header>
 

+ 6 - 6
RT_Table/VT_Table_TJ.html

@@ -5,18 +5,18 @@
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>RT Table Generator</title>
-    <link rel="stylesheet" href="styles.css">
+    <link rel="stylesheet" href="./styles.css">
 </head>
 
 <body>
     <header>
         <h1>RT Table Generator</h1>
         <ul class="nav-tabs">
-            <li><a href="RT_Table_NTC.html">NTC</a></li>
-            <li><a href="RT_Table_PT100.html">PT100</a></li>
-            <li><a href="RT_Table_PT1000.html">PT1000</a></li>
-            <li><a href="VT_Table_TJ.html" class="active">Thermocouple</a></li>
-            <li><a href="RT_Table_Import.html">Import Data</a></li>
+            <li><a href="./RT_Table_NTC.html">NTC</a></li>
+            <li><a href="./RT_Table_PT100.html">PT100</a></li>
+            <li><a href="./RT_Table_PT1000.html">PT1000</a></li>
+            <li><a href="./VT_Table_TJ.html" class="active">Thermocouple</a></li>
+            <li><a href="./RT_Table_Import.html">Import Data</a></li>
         </ul>
     </header>
 

+ 10 - 16
index.html

@@ -76,59 +76,53 @@
             <div class="card">
                 <h2>DO_FREEZE APP密码加密生成</h2>
                 <p>牛奶冰点仪、渗透压摩尔浓度检测仪 APP登录明文加密。</p>
-                <a href="QrGen/index.html">进入工具 →</a>
+                <a href="./QrGen/index.html">进入工具 →</a>
             </div>
             <div class="card">
                 <h2>DIPM结果统计</h2>
                 <p>牛奶冰点仪结果评估。</p>
-                <a href="DIPM_resultStatistics/index.html">进入工具 →</a>
+                <a href="./DIPM_resultStatistics/index.html">进入工具 →</a>
             </div>
             <div class="card">
                 <h2>OSMO结果统计</h2>
                 <p>渗透压摩尔浓度检测仪结果评估。(暂时与DIPM共用)</p>
-                <a href="DIPM_resultStatistics/index.html">进入工具 →</a>
+                <a href="./DIPM_resultStatistics/index.html">进入工具 →</a>
             </div>
             <div class="card">
                 <h2>实验结果统计</h2>
                 <p>基本的重复性、稳定性、示值误差计算分析。</p>
-                <a href="LabStatistics/index.html">进入工具 →</a>
+                <a href="./LabStatistics/index.html">进入工具 →</a>
             </div>
             <div class="card">
                 <h2>GeoGebra</h2>
                 <p>用于生成和可视化各种数学函数的工具。</p>
-                <a href="GeoGebra_Self/index.html">进入工具 →</a>
+                <a href="./GeoGebra_Self/index.html">进入工具 →</a>
             </div>
             <div class="card">
                 <h2>函数统计</h2>
                 <p>用于生成和可视化各种数学函数的工具。</p>
-                <a href="FuncGen/index.html">进入工具 →</a>
+                <a href="./FuncGen/index.html">进入工具 →</a>
             </div>
             <!-- <div class="card">
                 <h2>Desmos Desktop</h2>
                 <p>用于生成和可视化各种数学函数的工具。</p>
-                <a href="Desmos-Desktop-master/index.html">进入工具 →</a>
+                <a href="./Desmos-Desktop-master/index.html">进入工具 →</a>
             </div> -->
             <div class="card">
                 <h2>RT表格工具</h2>
                 <p>包含NTC、PT100、PT1000和TJ的RT表格查询工具。</p>
-                <a href="RT_Table/RT_Table_NTC.html">NTC表格 →</a>
-                <br>
-                <a href="RT_Table/RT_Table_PT100.html">PT100表格 →</a>
-                <br>
-                <a href="RT_Table/RT_Table_PT1000.html">PT1000表格 →</a>
-                <br>
-                <a href="RT_Table/VT_Table_TJ.html">TJ表格 →</a>
+                <a href="./RT_Table/RT_Table_NTC.html">NTC表格 →</a>
             </div>
 
             <!-- <div class="card">
                 <h2>NFC线圈设计工具</h2>
                 <p>用于设计和计算NFC线圈参数的专业工具,支持多种参数调整和实时预览。</p>
-                <a href="NfcCoilDesignTool/index.html">进入工具 →</a>
+                <a href="./NfcCoilDesignTool/index.html">进入工具 →</a>
             </div>
             <div class="card">
                 <h2>十六进制格式化</h2>
                 <p>提供十六进制数据的格式化和转换功能。</p>
-                <a href="HexFormat/index.html">进入工具 →</a>
+                <a href="./HexFormat/index.html">进入工具 →</a>
             </div> -->
         </div>
     </div>