Bladeren bron

F407 作为网页烧录软件

liyi 1 jaar geleden
bovenliggende
commit
adf1691a10

+ 173 - 0
f407/applications/html_h/channel_display.h

@@ -0,0 +1,173 @@
+/* 自动生成的文本数据头文件 */
+/* 源文件: channel_display.js */
+/* 文件大小: 5403 字节 */
+/* 生成时间: 2025-09-12 05:42:04 */
+/* 编码: utf-8 */
+#ifndef P_CHANNEL_DISPLAY_H
+#define P_CHANNEL_DISPLAY_H
+
+#include <stddef.h>
+
+// 文本数据(UTF-8编码)
+const char *p_channel_display = 
+    "// 通道集合\n"
+    "let channelAllList = [];\n"
+    "let channelAllList1 = [];\n"
+    
+    
+    
+    "function channel_display(j_data, channel_power_infro) {\n"
+    "    channelAllList = [];\n"
+    "    channelAllList1 = [];\n"
+    "    length = channel_power_infro.length\n"
+    "    for (let j = 1; j < length; j++) {\n"
+    "        let alarm=channel_power_infro[j].alarm;\n"
+    "        num = channel_power_infro[j].info.type\n"
+    "            // 创建一个新的列表项元素\n"
+    "        const channelFormData1 = {\n"
+    
+    "        };\n"
+    "        //自动生成通道名称列\n"
+    "        channelFormData1.productChName=\"CH\" + j\n"
+    "        //自动生成通道号\n"
+    "        channelFormData1.productChId=j\n"
+    
+    "        // 开启延时\n"
+    "        channelFormData1.firingInterval=channel_power_infro[j].info.start_delay\n"
+    
+    "        // 关闭延时\n"
+    "        channelFormData1.closeInterval=channel_power_infro[j].info.stop_delay\n"
+    "        channelFormData1.channel_power_infro=channel_power_infro[j];\n"
+    "        channelAllList1.push(channelFormData1);\n"
+    "        if(productTypeData.productType=='0'){\n"
+    "            const channelFormData = {\n"
+    
+    "            };\n"
+    "            if(alarm.c_upper!=0 || alarm.p_upper!=0 || alarm.v_lower!=0 || alarm.v_upper!=0 || alarm.w_upper!=0){\n"
+    "                channelFormData.colorStyle='color: red;'\n"
+    "            }else{\n"
+    "                channelFormData.colorStyle=''\n"
+    "            }\n"
+    "            //自动生成设备名称列\n"
+    
+    "            //自动生成通道名称列\n"
+    "            channelFormData.productChName=\"CH\" + j\n"
+    "            //自动生成通道号\n"
+    "            channelFormData.productChId=j\n"
+    "            //自动生成相序列\n"
+    "            channelFormData.productPhOrder=\"L1\"\n"
+    "            // 自动生成电压列\n"
+    "            var val = channel_power_infro[j].power[0].voltage / 10.0;\n"
+    "            channelFormData.productChVoltage=val\n"
+    
+    "            // 自动生成电流列\n"
+    "            var val = channel_power_infro[j].power[0].current / 10.0;\n"
+    "            channelFormData.productChCurrent=val\n"
+    "            // 自动生成功率列\n"
+    "            var val = channel_power_infro[j].power[0].power / 1000.0;\n"
+    "            channelFormData.productChPower= val\n"
+    
+    
+    "            // 自动生成频率列\n"
+    "            var val = channel_power_infro[j].power[0].freq / 100.0;\n"
+    "            channelFormData.productChPowerFreq= val\n"
+    
+    
+    "            // 自动生成耗电量列\n"
+    "            var val = channel_power_infro[j].power[0].consump / 1000.0;\n"
+    "            channelFormData.productChConsumption=val\n"
+    
+    
+    "            // 自动生成功率因数列\n"
+    "            // const factor_td = document.createElement('td');\n"
+    "            // var val = channel_power_infro[j].power[0].factor / 100.0;\n"
+    
+    "            // 开启延时\n"
+    "            channelFormData.firingInterval=channel_power_infro[j].info.start_delay\n"
+    
+    "            // 关闭延时\n"
+    "            channelFormData.closeInterval=channel_power_infro[j].info.stop_delay\n"
+    
+    
+    "            //通道状态\n"
+    "            channel_status = channel_power_infro[j].status\n"
+    "            channelFormData.productChStatus=channel_status\n"
+    "            channelFormData.channel_power_infro=channel_power_infro[j]\n"
+    "            channelAllList.push(channelFormData);\n"
+    "        }else{\n"
+    
+    "            // 自动生成电压列\n"
+    "            for(let m = 0; m < channel_power_infro[j].power.length; m++){\n"
+    "                const channelFormData = {\n"
+    
+    "                };\n"
+    "                if(alarm.c_upper!=0 || alarm.p_upper!=0 || alarm.v_lower!=0 || alarm.v_upper!=0 || alarm.w_upper!=0){\n"
+    "                    channelFormData.colorStyle='color: red;'\n"
+    "                }else{\n"
+    "                    channelFormData.colorStyle=''\n"
+    "                }\n"
+    "                //自动生成设备名称列\n"
+    "                //自动生成通道名称列\n"
+    "                channelFormData.productChName=\"CH\" + j\n"
+    "                //自动生成通道号\n"
+    "                channelFormData.productChId=j\n"
+    "                //自动生成相序列\n"
+    "                channelFormData.productPhOrder=\"L\"+(m+1)\n"
+    
+    "                // 自动生成功率因数列\n"
+    "                // const factor_td = document.createElement('td');\n"
+    "                // var val = channel_power_infro[j].power[0].factor / 100.0;\n"
+    
+    "                // 开启延时\n"
+    "                channelFormData.firingInterval=channel_power_infro[j].info.start_delay\n"
+    
+    "                // 关闭延时\n"
+    "                channelFormData.closeInterval=channel_power_infro[j].info.stop_delay\n"
+    
+    
+    "                //通道状态\n"
+    "                channel_status = channel_power_infro[j].status\n"
+    
+    "                channelFormData.productChStatus=channel_status\n"
+    
+    "                var val = channel_power_infro[j].power[m].voltage / 10.0;\n"
+    "                channelFormData.productChVoltage=val\n"
+    
+    "                // 自动生成电流列\n"
+    "                var val = channel_power_infro[j].power[m].current / 10.0;\n"
+    "                channelFormData.productChCurrent=val\n"
+    "                // 自动生成功率列\n"
+    "                var val = channel_power_infro[j].power[m].power / 1000.0;\n"
+    "                channelFormData.productChPower= val\n"
+    
+    
+    "                // 自动生成频率列\n"
+    "                var val = channel_power_infro[j].power[m].freq / 100.0;\n"
+    "                channelFormData.productChPowerFreq= val\n"
+    
+    
+    "                // 自动生成耗电量列\n"
+    "                var val = channel_power_infro[j].power[0].consump / 1000.0;\n"
+    "                channelFormData.productChConsumption=val\n"
+    "                channelFormData.channel_power_infro=channel_power_infro[j]\n"
+    "                channelAllList.push(channelFormData);\n"
+    "            }\n"
+    
+    
+    
+    "        }\n"
+    
+    
+    
+    "    }\n"
+    "}\n"
+    
+;
+
+// 文本数据大小(包括null终止符)
+const size_t p_channel_display_size = 5404;
+
+// 文本长度(字符数)
+const size_t p_channel_display_length = 4969;
+
+#endif /* P_CHANNEL_DISPLAY_H */

File diff suppressed because it is too large
+ 1840 - 0
f407/applications/html_h/data_js.h


+ 127 - 0
f407/applications/html_h/display_data.h

@@ -0,0 +1,127 @@
+/* 自动生成的文本数据头文件 */
+/* 源文件: display_data.js */
+/* 文件大小: 3755 字节 */
+/* 生成时间: 2025-09-12 05:42:13 */
+/* 编码: utf-8 */
+#ifndef P_DISPLAY_DATA_H
+#define P_DISPLAY_DATA_H
+
+#include <stddef.h>
+
+// 文本数据(UTF-8编码)
+const char *p_display_data = 
+    "function total_Infor(j, total_data, type) {\n"
+    "    initialTotalFormList = [];\n"
+    "    len = total_data.length\n"
+    "        //显示总信息\n"
+    "    for (let i = 0; i <= len - 1; i++) {\n"
+    "        num = i + 1\n"
+    "        voltage = total_data[i].voltage.toFixed(2)\n"
+    "        current = total_data[i].current.toFixed(2)\n"
+    "        power = total_data[i].power\n"
+    "        power = power.toFixed(3)\n"
+    "        consump = total_data[i].consump.toFixed(2)\n"
+    "            // if (consump <= 0) {\n"
+    "            //     consump = 0\n"
+    "            // }\n"
+    "            // consump = consump / 1000\n"
+    "            // consump = consump.toFixed(3)\n"
+    "        freq = total_data[i].freq.toFixed(2)\n"
+    "        if (type == '0') {\n"
+    "            initialFormData.totalVoltage = voltage; // 总电压\n"
+    "            initialFormData.totalCurrent = current; // 总电流\n"
+    "            initialFormData.totalPower = power; // 总功率\n"
+    "            initialFormData.totalFrequency = freq; // 总频率\n"
+    "            initialFormData.totalEnergy = consump; // 总耗电量\n"
+    "            break\n"
+    "        } else {\n"
+    "            const initialChFormData = {};\n"
+    "            initialChFormData.totalVoltage = voltage; // 总电压\n"
+    "            initialChFormData.totalCurrent = current; // 总电流\n"
+    "            initialChFormData.totalPower = power; // 总功率\n"
+    "            initialChFormData.totalFrequency = freq; // 总频率\n"
+    "            initialChFormData.totalEnergy = consump; // 总耗电量\n"
+    "            initialTotalFormList.push(initialChFormData);\n"
+    "        }\n"
+    
+    "    }\n"
+    
+    
+    "}\n"
+    
+    "function Channel_Info(j_data, channel_power_infro) {\n"
+    "    channel_length = channel_power_infro.length\n"
+    "    channel_display(j_data, channel_power_infro, channel_infro)\n"
+    
+    "}\n"
+    
+    "function threshold_mannage(orgin_data, channel_power_infro) {\n"
+    "    // 获取要插入新行的DOM元素\n"
+    "    // const dataList = document.getElementById('threshold_mannage');\n"
+    "    // // 清空现有的列表项\n"
+    "    // dataList.innerHTML = '';\n"
+    "    initialYzFormList = [];\n"
+    "    channel_length = channel_power_infro.length\n"
+    "        //遍历数据数组\n"
+    "    for (let j = 1; j < channel_length; j++) {\n"
+    "        const initialChFormData = {};\n"
+    "        //自动生成名称列\n"
+    "        initialChFormData.productChName = \"CH\" + j;\n"
+    "        //自动生成编号列\n"
+    "        initialChFormData.productChId = j;\n"
+    "        //自动生成电流上限列\n"
+    "        initialChFormData.currentUpperAction = channel_power_infro[j].thr.c_upper / 10.0;\n"
+    
+    "        // 自动生成电压上限列\n"
+    "        initialChFormData.voltageUpperAction = channel_power_infro[j].thr.v_upper / 10.0;\n"
+    
+    "        // 自动生成电压下限列\n"
+    "        initialChFormData.voltageDownAction = channel_power_infro[j].thr.v_lower / 10.0;\n"
+    
+    "        // 自动生成功率上限列\n"
+    "        initialChFormData.powerUpperAction = channel_power_infro[j].thr.p_upper / 1000.0;\n"
+    
+    "        // 自动生成耗电量上限列\n"
+    "        initialChFormData.alarmContentUpperAction = channel_power_infro[j].thr.w_upper / 1000.0;\n"
+    "        initialChFormData.channel_power_infro = channel_power_infro[j]\n"
+    "        initialYzFormList.push(initialChFormData);\n"
+    "    }\n"
+    "}\n"
+    
+    "function now_time() {\n"
+    "    const now = new Date();\n"
+    
+    "    // 获取年、月、日、小时、分钟和秒\n"
+    "    const year = now.getFullYear();\n"
+    "    const month = now.getMonth() + 1;\n"
+    "    const day = now.getDate();\n"
+    "    const hours = now.getHours();\n"
+    "    const minutes = now.getMinutes();\n"
+    "    const seconds = now.getSeconds();\n"
+    
+    "    formattedTime = `${year}-${month < 10 ? '0' : ''}${month}-${day < 10 ? '0' : ''}${day} ${hours < 10 ? '0' : ''}${hours}:${minutes < 10 ? '0' : ''}${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;\n"
+    "    return formattedTime\n"
+    "}\n"
+    
+    "// 三相总体状态集合\n"
+    "let initialTotalFormList = [];\n"
+    
+    "// 单项总体监控对象\n"
+    "let initialFormData = {\n"
+    
+    "};\n"
+    
+    "// 阈值设置集合\n"
+    "let initialYzFormList = [];\n"
+    
+    
+    "let channel_power_infro1 = [];"
+;
+
+// 文本数据大小(包括null终止符)
+const size_t p_display_data_size = 3756;
+
+// 文本长度(字符数)
+const size_t p_display_data_length = 3439;
+
+#endif /* P_DISPLAY_DATA_H */

+ 479 - 0
f407/applications/html_h/index_css.h

@@ -0,0 +1,479 @@
+/* 自动生成的文本数据头文件 */
+/* 源文件: index.css */
+/* 文件大小: 8112 字节 */
+/* 生成时间: 2025-09-12 05:42:15 */
+/* 编码: utf-8 */
+#ifndef P_CSS_INDEX_H
+#define P_CSS_INDEX_H
+
+#include <stddef.h>
+
+// 文本数据(UTF-8编码)
+const char *p_css_index = 
+    
+    "/* 或者针对特定按钮 */\n"
+    ".swal2-confirm:hover {\n"
+    "    background-color: #d33 !important; /* 保持与正常状态相同 */\n"
+    "}\n"
+    ".swal2-cancel:hover {\n"
+    "    background-color: #3085d6 !important; /* 保持与正常状态相同 */\n"
+    "}\n"
+    "* {\n"
+    "    box-sizing: border-box;\n"
+    "}\n"
+    "body {\n"
+    "    font-family: Arial, sans-serif;\n"
+    "    margin: 0;\n"
+    "    padding: 20px;\n"
+    "    min-width: 1200px;\n"
+    "    overflow-x: auto;\n"
+    "}\n"
+    ".container {\n"
+    "    display: flex;\n"
+    "    flex-direction: column;\n"
+    "    height: 95vh;\n"
+    "    gap: 20px;\n"
+    "}\n"
+    ".summary-section {\n"
+    "    border: 1px solid #ddd;\n"
+    "    padding: 15px;\n"
+    "    border-radius: 5px;\n"
+    "    background-color: #f9f9f9;\n"
+    "}\n"
+    ".summary-table {\n"
+    "    width: 100%;\n"
+    "    border-collapse: collapse;\n"
+    "}\n"
+    ".summary-table th, .summary-table td {\n"
+    "    border: 1px solid #ddd;\n"
+    "    padding: 12px;\n"
+    "    text-align: center;\n"
+    "}\n"
+    ".summary-table th {\n"
+    "    background-color: #f2f2f2;\n"
+    "}\n"
+    ".summary-actions {\n"
+    "    display: flex;\n"
+    "    justify-content: space-between;\n"
+    "    gap: 10px;\n"
+    "    margin-top: 10px;\n"
+    "}\n"
+    ".device-section {\n"
+    "    flex: 1;\n"
+    "    height: 100px; /* 固定高度 */\n"
+    "    overflow: auto;\n"
+    "    border: 1px solid #ddd;\n"
+    "    border-radius: 5px;\n"
+    "}\n"
+    ".device-table {\n"
+    "    height: 50px; /* 容器高度 */\n"
+    "    overflow-y: auto; /* 垂直滚动条 */\n"
+    "    width: 100%;\n"
+    "    border-collapse: collapse;\n"
+    "}\n"
+    ".device-table th, .device-table td {\n"
+    "    border: 1px solid #ddd;\n"
+    "    padding: 8px;\n"
+    "    text-align: center;\n"
+    "    white-space: nowrap;\n"
+    "}\n"
+    ".device-table th {\n"
+    "    background-color: #f2f2f2;\n"
+    "    position: sticky;\n"
+    "    top: 0;\n"
+    "}\n"
+    ".status-section {\n"
+    "    border: 1px solid #ddd;\n"
+    "    padding: 15px;\n"
+    "    border-radius: 5px;\n"
+    "    background-color: #f9f9f9;\n"
+    "}\n"
+    ".status-boxes {\n"
+    "    display: flex;\n"
+    "    flex-wrap: wrap;\n"
+    "    gap: 15px;\n"
+    "}\n"
+    ".status-box {\n"
+    "    border: 1px solid #ddd;\n"
+    "    padding: 15px;\n"
+    "    min-width: 150px;\n"
+    "    text-align: center;\n"
+    "    background-color: white;\n"
+    "    border-radius: 5px;\n"
+    "    flex: 1;\n"
+    "}\n"
+    
+    ".status-active {\n"
+    "    color: #4CAF50;\n"
+    "    font-weight: bold;\n"
+    "}\n"
+    ".status-inactive {\n"
+    "    color: #f44336;\n"
+    "    font-weight: bold;\n"
+    "}\n"
+    ".left-buttons {\n"
+    "    display: flex;\n"
+    "    gap: 10px;\n"
+    "}\n"
+    ".right-buttons {\n"
+    "    display: flex;\n"
+    "    gap: 10px;\n"
+    "}\n"
+    ".button-container {\n"
+    "    /*display: flex;*/\n"
+    "    /*justify-content: center;*/\n"
+    "    /*gap: 15px;*/\n"
+    "    /*margin-top: 20px;*/\n"
+    "    margin-bottom: 10px; display: flex;\n"
+    "    justify-content: space-between; /* 左右分开 */\n"
+    "    align-items: center;\n"
+    "    padding: 15px;\n"
+    "    background-color: #f5f5f5;\n"
+    "    border-radius: 8px;\n"
+    "}\n"
+    ".btn {\n"
+    "    padding: 8px 16px;\n"
+    "    background-color: #4CAF50;\n"
+    "    color: white;\n"
+    "    border: none;\n"
+    "    border-radius: 4px;\n"
+    "    cursor: pointer;\n"
+    "    font-weight: bold;\n"
+    "}\n"
+    ".btn-energy {\n"
+    "    background-color: #2196F3;\n"
+    "}\n"
+    ".btn-close{\n"
+    "    background-color: rgb(101, 107, 139);\n"
+    "}\n"
+    ".btn-threshold {\n"
+    "    background-color: #ff9800;\n"
+    "}\n"
+    ".btn-delay {\n"
+    "    background-color: #9c27b0;\n"
+    "}\n"
+    ".scrollable-table {\n"
+    "    flex: 1;\n"
+    "    overflow-y: auto;\n"
+    "}\n"
+    ".button-footer {\n"
+    "    display: flex;\n"
+    "    justify-content: center;\n"
+    "    gap: 15px;\n"
+    "    padding: 15px;\n"
+    "    background-color: #f9f9f9;\n"
+    "    border-top: 1px solid #ddd;\n"
+    "}\n"
+    ".table-container {\n"
+    "    display: flex;\n"
+    "    flex-direction: column;\n"
+    "    height: 80vh; /* 视口高度百分比 */\n"
+    "    max-height: 500px;\n"
+    "    border: 1px solid #ddd;\n"
+    "    border-radius: 5px;\n"
+    "    min-width: 1000px; /* 最小宽度防止压缩 */\n"
+    "}\n"
+    
+    
+    
+    ".selectStyle{\n"
+    "    width: 200px;\n"
+    "    height: 40px;\n"
+    "    border-radius: 4px\n"
+    "}\n"
+    "/* 重置样式 */\n"
+    "* {\n"
+    "    margin: 0;\n"
+    "    padding: 0;\n"
+    "    box-sizing: border-box;\n"
+    "}\n"
+    
+    
+    
+    ".tab-container {\n"
+    "    width: 100%;\n"
+    "    height: 100%;\n"
+    "    margin: 0 auto;\n"
+    "    background: white;\n"
+    "    border-radius: 8px;\n"
+    "    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n"
+    "    overflow: hidden;\n"
+    "}\n"
+    
+    ".tab-header {\n"
+    "    display: flex;\n"
+    "    background-color: #f1f1f1;\n"
+    "    border-bottom: 1px solid #ddd;\n"
+    "}\n"
+    
+    ".tab-btn {\n"
+    "    border-radius: 10px;\n"
+    "    padding: 12px 20px;\n"
+    "    background: none;\n"
+    "    border: none;\n"
+    "    cursor: pointer;\n"
+    "    font-size: 16px;\n"
+    "    transition: all 0.3s;\n"
+    "    position: relative;\n"
+    "}\n"
+    
+    ".tab-btn:hover {\n"
+    "    background-color: #ddd;\n"
+    "}\n"
+    
+    ".tab-btn.active {\n"
+    "    background-color: #4CAF50;\n"
+    "    color: white;\n"
+    "}\n"
+    
+    ".tab-content {\n"
+    "    height: 100%;\n"
+    "    padding: 20px;\n"
+    "    display: none;\n"
+    "}\n"
+    
+    ".tab-content.active {\n"
+    "    display: block;\n"
+    "    animation: fadeIn 0.5s;\n"
+    "}\n"
+    
+    "@keyframes fadeIn {\n"
+    "    from { opacity: 0; }\n"
+    "    to { opacity: 1; }\n"
+    "}\n"
+    
+    ".tab-iframe {\n"
+    "    width: 100%;\n"
+    "    height: 100%;\n"
+    "    border: none;\n"
+    "}\n"
+    
+    
+    "html, body {\n"
+    "    height: 100%;\n"
+    "    font-family: 'Arial', sans-serif;\n"
+    "}\n"
+    
+    ".modal-content {\n"
+    "    background: white;\n"
+    "    padding: 20px;\n"
+    "    border-radius: 8px;\n"
+    "    max-width: 500px;\n"
+    "    width: 80%;\n"
+    "    max-height: 80vh;\n"
+    "    overflow-y: auto;\n"
+    "}\n"
+    
+    
+    ".form-group {\n"
+    "    margin-bottom: 15px;\n"
+    "}\n"
+    
+    ".form-group label {\n"
+    "    display: block;\n"
+    "    margin-bottom: 5px;\n"
+    "    font-weight: bold;\n"
+    "}\n"
+    
+    ".form-group input[type=\"text\"],\n"
+    ".form-group input[type=\"date\"],\n"
+    ".form-group select,\n"
+    ".form-group textarea {\n"
+    "    width: 100%;\n"
+    "    padding: 8px;\n"
+    "    border: 1px solid #ddd;\n"
+    "    border-radius: 4px;\n"
+    "}\n"
+    ".form-actions {\n"
+    "    display: flex;\n"
+    "    justify-content: flex-end;\n"
+    "    gap: 10px;\n"
+    "    margin-top: 20px;\n"
+    "}\n"
+    
+    ".btn-on {\n"
+    "    background-color: #4CAF50;\n"
+    "    color: white;\n"
+    "}\n"
+    ".btn-off {\n"
+    "    background-color: #f44336;\n"
+    "    color: white;\n"
+    "}\n"
+    ".btn-all {\n"
+    "    background-color: #2196F3;\n"
+    "    color: white;\n"
+    "}\n"
+    ".btn-energy {\n"
+    "    background-color: #2196F3;\n"
+    "}\n"
+    ".btn-close{\n"
+    "    background-color: rgb(101, 107, 139);\n"
+    "}\n"
+    ".btn-threshold {\n"
+    "    background-color: #ff9800;\n"
+    "}\n"
+    ".btn-delay {\n"
+    "    background-color: #9c27b0;\n"
+    "}\n"
+    ".modal-overlay2 {\n"
+    "    position: fixed;\n"
+    "    top: 0;\n"
+    "    left: 0;\n"
+    "    right: 0;\n"
+    "    bottom: 0;\n"
+    "    background: rgba(0,0,0,0.5);\n"
+    "    display: flex;\n"
+    "    justify-content: center;\n"
+    "    align-items: center;\n"
+    "    z-index: 1000;\n"
+    "}\n"
+    ".upload-container {\n"
+    "    padding: 25px;\n"
+    "}\n"
+    
+    ".upload-area {\n"
+    "    border: 2px dashed #cbd5e1;\n"
+    "    padding: 40px;\n"
+    "    text-align: center;\n"
+    "    background: #f8fafc;\n"
+    "    cursor: pointer;\n"
+    "}\n"
+    
+    
+    ".file-input {\n"
+    "    display: none;\n"
+    "}\n"
+    
+    ".files-list {\n"
+    "    margin-top: 30px;\n"
+    "}\n"
+    
+    ".files-list h3 {\n"
+    "    color: #334155;\n"
+    "    margin-bottom: 15px;\n"
+    "    padding-bottom: 10px;\n"
+    "    border-bottom: 1px solid #e2e8f0;\n"
+    "}\n"
+    
+    ".file-item {\n"
+    "    display: flex;\n"
+    "    align-items: center;\n"
+    "    padding: 15px;\n"
+    "    background: #f8fafc;\n"
+    "    border-radius: 8px;\n"
+    "    margin-bottom: 10px;\n"
+    "    transition: all 0.3s ease;\n"
+    "}\n"
+    
+    ".file-info {\n"
+    "    flex-grow: 1;\n"
+    "}\n"
+    
+    ".file-action-btn {\n"
+    "    width: 36px;\n"
+    "    height: 36px;\n"
+    "    border-radius: 50%;\n"
+    "    display: flex;\n"
+    "    cursor: pointer;\n"
+    "}\n"
+    
+    ".progress-bar {\n"
+    "    height: 6px;\n"
+    "    background: #e2e8f0;\n"
+    "    border-radius: 3px;\n"
+    "    margin-top: 8px;\n"
+    "    overflow: hidden;\n"
+    "}\n"
+    
+    ".modal-overlay {\n"
+    "    position: fixed;\n"
+    "    top: 0;\n"
+    "    left: 0;\n"
+    "    right: 0;\n"
+    "    bottom: 0;\n"
+    "    background: rgba(0,0,0,0.5);\n"
+    "    display: flex;\n"
+    "    justify-content: center;\n"
+    "    align-items: center;\n"
+    "    z-index: 999;\n"
+    "}\n"
+    
+    
+    
+    
+    
+    ".radio-group,\n"
+    ".checkbox-group {\n"
+    "    display: flex;\n"
+    "    flex-wrap: wrap;\n"
+    "    gap: 10px;\n"
+    "}\n"
+    
+    ".radio-group label,\n"
+    ".checkbox-group label {\n"
+    "    display: flex;\n"
+    "    align-items: center;\n"
+    "    gap: 5px;\n"
+    "    font-weight: normal;\n"
+    "}\n"
+    
+    
+    "button[type=\"submit\"] {\n"
+    "    background: #4CAF50;\n"
+    "    color: white;\n"
+    "}\n"
+    
+    "button[type=\"submit\"]:disabled {\n"
+    "    background: #ccc;\n"
+    "}\n"
+    
+    
+    "select.custom-select {\n"
+    "    padding: 12px;\n"
+    "    border: 1px solid #ddd;\n"
+    "    border-radius: 6px;\n"
+    "    background-color: white;\n"
+    "    font-size: 16px;\n"
+    "    color: #333;\n"
+    "    appearance: none;\n"
+    "    -webkit-appearance: none;\n"
+    "    background-image: url('data:image/svg+xml;utf8,<svg fill=\"%23333\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 10l5 5 5-5z\"/></svg>');\n"
+    "    background-repeat: no-repeat;\n"
+    "    background-position: right 10px center;\n"
+    "    background-size: 16px;\n"
+    "}\n"
+    
+    "/* 尝试设置option样式(效果有限) */\n"
+    "select.custom-select option {\n"
+    "    height: 40px;      /* 可能在某些浏览器中有效 */\n"
+    "    padding: 12px;     /* 可能在某些浏览器中有效 */\n"
+    "    font-size: 16px;   /* 通常有效 */\n"
+    "    line-height: 2;    /* 可能有效 */\n"
+    "}\n"
+    
+    "thead {\n"
+    "    position: sticky;  /* 固定表头 */\n"
+    "    top: 0;           /* 固定在容器顶部 */\n"
+    "    z-index: 10;      /* 确保表头在内容之上 */\n"
+    "}\n"
+    
+    
+    
+    ".divAll{\n"
+    "    width: 100%;\n"
+    "    height: 100%;\n"
+    "    margin: 0 auto;\n"
+    "    background: white;\n"
+    "    border-radius: 8px;\n"
+    "    box-shadow: 0 2px 10px rgb(0 0 0 / 10%);\n"
+    "    overflow: hidden;\n"
+    "}"
+;
+
+// 文本数据大小(包括null终止符)
+const size_t p_css_index_size = 8113;
+
+// 文本长度(字符数)
+const size_t p_css_index_length = 7864;
+
+#endif /* P_CSS_INDEX_H */

File diff suppressed because it is too large
+ 1481 - 0
f407/applications/html_h/index_html.h


+ 35 - 0
f407/applications/html_h/index_js.h

@@ -0,0 +1,35 @@
+/* 自动生成的文本数据头文件 */
+/* 源文件: index.js */
+/* 文件大小: 417 字节 */
+/* 生成时间: 2025-09-12 05:42:13 */
+/* 编码: utf-8 */
+#ifndef P_INDEX_JS_H
+#define P_INDEX_JS_H
+
+#include <stddef.h>
+
+// 文本数据(UTF-8编码)
+const char *p_index_js = 
+    "export  function    getApiBaseUrl (){\n"
+    "    const { protocol, hostname, port } = window.location;\n"
+    
+    "    // 开发环境特殊处理\n"
+    "    if (hostname === 'localhost' || hostname === '127.0.0.1') {\n"
+    "        return 'http://localhost:8084/pdu'; // 开发服务器地址\n"
+    "    }\n"
+    
+    "    // 生产环境使用当前域名\n"
+    "    return port\n"
+    "        ? `${protocol}//${hostname}:${port}/pdu`\n"
+    "        : `${protocol}//${hostname}/pdu`;\n"
+    "}\n"
+    
+;
+
+// 文本数据大小(包括null终止符)
+const size_t p_index_js_size = 418;
+
+// 文本长度(字符数)
+const size_t p_index_js_length = 367;
+
+#endif /* P_INDEX_JS_H */

+ 147 - 0
f407/applications/html_h/operation.h

@@ -0,0 +1,147 @@
+/* 自动生成的文本数据头文件 */
+/* 源文件: operation.js */
+/* 文件大小: 3700 字节 */
+/* 生成时间: 2025-09-12 05:42:14 */
+/* 编码: utf-8 */
+#ifndef P_OPERATION_H
+#define P_OPERATION_H
+
+#include <stddef.h>
+
+// 文本数据(UTF-8编码)
+const char *p_operation = 
+    "// 总开\n"
+    "function all_open() {\n"
+    "    ws.send(mk_hdr_bin(0, PKT_TYPE.PKT_TYPE_CH_ALL, 0, 0, 1, 0));\n"
+    "}\n"
+    
+    "// 总关\n"
+    "function all_close() {\n"
+    "    ws.send(mk_hdr_bin(0, PKT_TYPE.PKT_TYPE_CH_ALL, 0, 0, 0, 0));\n"
+    "}\n"
+    
+    "// 通道开启\n"
+    "function single_open(j_data, channel_power_infro, j) {\n"
+    "    j_c_data = j_data\n"
+    "    opreation_data = channel_power_infro\n"
+    "    j_status = opreation_data[j].status;\n"
+    "    if (j_status == 0) {\n"
+    "        opreation_data[j].status = 1\n"
+    "    }\n"
+    "    a = pkt_to_bin(0, PKT_TYPE.PKT_TYPE_POWER_CH, SUB_TYPE.SUB_TYPE_POWER_SWITCH, 0, 0, opreation_data[j])\n"
+    "        //var b = bin_to_pkt(a)\n"
+    "    ws.send(a)\n"
+    "}\n"
+    
+    "// 通道关闭\n"
+    "function single_close(j_data, channel_power_infro, j) {\n"
+    "    j_c_data = j_data\n"
+    "    opreation_data = channel_power_infro\n"
+    "    j_status = opreation_data[j].status;\n"
+    "    if (j_status == 1) {\n"
+    "        opreation_data[j].status = 0\n"
+    "    }\n"
+    "    a = pkt_to_bin(0, PKT_TYPE.PKT_TYPE_POWER_CH, SUB_TYPE.SUB_TYPE_POWER_SWITCH, 0, 0, opreation_data[j])\n"
+    "        //var b = bin_to_pkt(a)\n"
+    "    ws.send(a)\n"
+    "}\n"
+    
+    "// 阈值设置\n"
+    "function threshold_update(orgin_data) {\n"
+    "    translate_data = orgin_data\n"
+    "    console.log(translate_data)\n"
+    "    a = pkt_to_bin(0, PKT_TYPE.PKT_TYPE_POWER_CH, SUB_TYPE.SUB_TYPE_POWER_THRESHOLD, 0, 1, translate_data)\n"
+    "    ws.send(a)\n"
+    "}\n"
+    "// 延时设置保存\n"
+    "function delay_update(orgin_data) {\n"
+    "    a = pkt_to_bin(0, PKT_TYPE.PKT_TYPE_POWER_CH, SUB_TYPE.SUB_TYPE_POWER_OPEN_DELAY, 0, 1, orgin_data)\n"
+    "    ws.send(a)\n"
+    "    b = pkt_to_bin(0, PKT_TYPE.PKT_TYPE_POWER_CH, SUB_TYPE.SUB_TYPE_POWER_CLOSE_DELAY, 0, 1, orgin_data)\n"
+    "    ws.send(b)\n"
+    "}\n"
+    
+    "// 耗电量重置\n"
+    "function power_reset(orgin_data) {\n"
+    "    console.log(orgin_data)\n"
+    "    a = pkt_to_bin(0, PKT_TYPE.PKT_TYPE_POWER_CH, SUB_TYPE.SUB_TYPE_POWER_CONSUMER_CLEAR, 0, 1, orgin_data)\n"
+    "    ws.send(a)\n"
+    "}\n"
+    
+    "// 网络设置\n"
+    "function network_settings(data) {\n"
+    "    console.log(data)\n"
+    "    a = pkt_to_bin(0, PKT_TYPE.PKT_TYPE_PARAS, SUB_TYPE.SUB_TYPE_PARAS_NETWORK, 0, 1, data)\n"
+    "    ws.send(a)\n"
+    "}\n"
+    
+    "// 485设置\n"
+    "function modbus_settings(data) {\n"
+    "    console.log(data)\n"
+    "    a = pkt_to_bin(0, PKT_TYPE.PKT_TYPE_PARAS, SUB_TYPE.SUB_TYPE_PARAS_MODBUS, 0, 1, data)\n"
+    "    ws.send(a)\n"
+    "}\n"
+    
+    "// snmp设置\n"
+    "function snmp_settings(data) {\n"
+    "    console.log(data)\n"
+    "    a = pkt_to_bin(0, PKT_TYPE.PKT_TYPE_PARAS, SUB_TYPE.SUB_TYPE_PARAS_SNMP, 0, 1, data)\n"
+    "    ws.send(a)\n"
+    "}\n"
+    
+    "// 设备系统时间设置\n"
+    "function sys_settings(data) {\n"
+    "    console.log(data)\n"
+    "    a = pkt_to_bin(0, PKT_TYPE.PKT_TYPE_PARAS, SUB_TYPE.SUB_TYPE_PARAS_SYS, 0, 1, data)\n"
+    "    ws.send(a)\n"
+    "}\n"
+    
+    "// 设备固件升级\n"
+    "function sys_up_settings(data, file) {\n"
+    "    console.log(data)\n"
+    "    console.log(file)\n"
+    "    a = pkt_to_bin(0, PKT_TYPE.PKT_TYPE_PARAS, SUB_TYPE.SUB_TYPE_PARAS_SYS, 0, 1, data)\n"
+    "    ws.send(a)\n"
+    "}\n"
+    
+    "// 状态监控请求\n"
+    "function function1() {\n"
+    "    ws.send(mk_hdr_bin(0, PKT_TYPE.PKT_TYPE_POWER_TOTAL, 0, 0, 0));\n"
+    "    ws.send(mk_hdr_bin(0, PKT_TYPE.PKT_TYPE_POWER_CH, 0, 0, 0));\n"
+    "    ws.send(mk_hdr_bin(0, PKT_TYPE.PKT_TYPE_SENSOR, 0, 0, 0, 0));\n"
+    "    ws.send(mk_hdr_bin(0, PKT_TYPE.PKT_TYPE_PARAS, SUB_TYPE.SUB_TYPE_PARAS_SYS, 0, 0, 0));\n"
+    "}\n"
+    
+    "//获取网络配置信息\n"
+    "function function2() {\n"
+    "    ws.send(mk_hdr_bin(0, PKT_TYPE.PKT_TYPE_PARAS, SUB_TYPE.SUB_TYPE_PARAS_NETWORK, 0, 0, 0));\n"
+    "}\n"
+    "//获取485配置\n"
+    "function function3() {\n"
+    "    ws.send(mk_hdr_bin(0, PKT_TYPE.PKT_TYPE_PARAS, SUB_TYPE.SUB_TYPE_PARAS_MODBUS, 0, 0, 0));\n"
+    
+    "}\n"
+    "//获取SNMP配置\n"
+    "function function4() {\n"
+    "    ws.send(mk_hdr_bin(0, PKT_TYPE.PKT_TYPE_PARAS, SUB_TYPE.SUB_TYPE_PARAS_SNMP, 0, 0, 0));\n"
+    
+    "}\n"
+    "// 获取设备配置\n"
+    "function function5() {\n"
+    "    ws.send(mk_hdr_bin(0, PKT_TYPE.PKT_TYPE_PARAS, SUB_TYPE.SUB_TYPE_PARAS_SYS, 0, 0, 0));\n"
+    
+    "}\n"
+    "//获取传感器配置\n"
+    "function function6() {\n"
+    "    ws.send(mk_hdr_bin(0, PKT_TYPE.PKT_TYPE_SENSOR, 0, 0, 0, 0));\n"
+    
+    "}"
+;
+
+// 文本数据大小(包括null终止符)
+const size_t p_operation_size = 3701;
+
+// 文本长度(字符数)
+const size_t p_operation_length = 3532;
+
+#endif /* P_OPERATION_H */

File diff suppressed because it is too large
+ 22 - 0
f407/applications/html_h/petite-vue.min.h


+ 33 - 0
f407/applications/html_h/sys_para.h

@@ -0,0 +1,33 @@
+/* 自动生成的文本数据头文件 */
+/* 源文件: sys_paras.js */
+/* 文件大小: 240 字节 */
+/* 生成时间: 2025-09-12 05:42:14 */
+/* 编码: us-ascii */
+#ifndef P_SYS_PARA_H
+#define P_SYS_PARA_H
+
+#include <stddef.h>
+
+// 文本数据(UTF-8编码)
+const char *p_sys_para = 
+    "channle_datas = []\n"
+    "let currentNumber = 1;\n"
+    "let resultArray = [];\n"
+    "const cyclesPerNumber = 3;\n"
+    "let button_status = [];\n"
+    "const data = [];\n"
+    "const datas = []\n"
+    "const finall_data = []\n"
+    "const processing_data = {}\n"
+    "function parasd_process(parasd_data) {\n"
+    
+    "}"
+;
+
+// 文本数据大小(包括null终止符)
+const size_t p_sys_para_size = 241;
+
+// 文本长度(字符数)
+const size_t p_sys_para_length = 240;
+
+#endif /* P_SYS_PARA_H */

+ 148 - 0
f407/applications/html_h/ws.h

@@ -0,0 +1,148 @@
+/* 自动生成的文本数据头文件 */
+/* 源文件: ws.js */
+/* 文件大小: 3174 字节 */
+/* 生成时间: 2025-09-12 05:42:14 */
+/* 编码: utf-8 */
+#ifndef P_WS_H
+#define P_WS_H
+
+#include <stddef.h>
+
+// 文本数据(UTF-8编码)
+const char *p_ws = 
+    "let productTypeData = {\n"
+    
+    "};\n"
+    "let data_alarm = [];\n"
+    "let sensorc_list = [];\n"
+    "let network_data = {}\n"
+    "    // 485配置\n"
+    "let cas_data = {}\n"
+    "    // snmp\n"
+    "let snmp_data = {}\n"
+    "    // 设备信息\n"
+    "let lang_data = {}\n"
+    
+    "let sensor_data = {}\n"
+    
+    "function on_ws_msg(js) {\n"
+    "    console.log(\"执行\")\n"
+    
+    "    // debugger\n"
+    "    //总电源数据显示\n"
+    "    if (js.powert != undefined) {\n"
+    "        total_data = js.powert.total\n"
+    "        type = js.powert.type\n"
+    "        productTypeData.productType = type;\n"
+    "        total_Infor(js, total_data, type)\n"
+    "    }\n"
+    "    //通道电源数据显示\n"
+    "    if (js.powerc != undefined) {\n"
+    "        channel_power_infro = js.powerc\n"
+    "        channel_infro = channel_power_infro.power\n"
+    "        alarm = js.powerc.alarm\n"
+    "        channel_number = js.powerc.info // 通道基础信息\n"
+    "        channel_power = js.powerc.power\n"
+    "        j_data = js\n"
+    "            // 通道号\n"
+    "        Channel_Info(j_data, channel_power_infro)\n"
+    
+    "        // 阈值设置\n"
+    "        threshold_mannage(js, channel_power_infro)\n"
+    "            // systemAlarm(alarm)\n"
+    "            //populateTable(j_data,channel_power)\n"
+    "    }\n"
+    
+    "    // 警告\n"
+    "    if (js.alarmd != undefined) {\n"
+    "        alarmd_data = js.alarmd\n"
+    "        data_alarm = [];\n"
+    "        data_alarm = alarm_process(alarmd_data)\n"
+    
+    "    }\n"
+    "    // 配置信息(网络配置,485配置,snmp,设备信息)\n"
+    
+    "    if (js.cas != undefined) {\n"
+    "        cas_data = js.cas;\n"
+    "    }\n"
+    "    if (js.network != undefined) {\n"
+    "        network_data = js.network\n"
+    "    }\n"
+    "    if (js.snmp != undefined) {\n"
+    "        snmp_data = js.snmp\n"
+    "        console.log(\"snmp数据--》\")\n"
+    "        console.log(snmp_data)\n"
+    "    }\n"
+    "    if (js.sensorc != undefined) {\n"
+    "        sensor_data = js.sensorc;\n"
+    "    }\n"
+    "    // if (js.paras != undefined) {\n"
+    "    //     // 设备信息\n"
+    "    //     lang_data = js.paras.lang\n"
+    "    // }\n"
+    "    if (js.sensorc != undefined) {\n"
+    "        sensorc_list = [];\n"
+    "        // 传感器\n"
+    "        sensorc_list = js.sensorc\n"
+    "        console.log(sensorc_list)\n"
+    "    }\n"
+    "    if (js.sys != undefined) {\n"
+    "        lang_data = js.sys\n"
+    "            // console.log(lang_data)\n"
+    "    }\n"
+    
+    "}\n"
+    
+    "function alarm_process(alarmd_data) {\n"
+    "    const result = [];\n"
+    "    const alarmProperties = alarmd_data.alarm;\n"
+    
+    "    const baseProperties = {\n"
+    "        \"ch\": alarmd_data.ch,\n"
+    "        \"time\": alarmd_data.time\n"
+    "    };\n"
+    "    let idCounter = 1;\n"
+    
+    "    for (const key in alarmProperties) {\n"
+    "        if (alarmProperties.hasOwnProperty(key) && alarmProperties[key] == 1) {\n"
+    "            const newObj = {...baseProperties, [key]: alarmProperties[key], \"id\": idCounter++ };\n"
+    "            result.push(newObj);\n"
+    "        }\n"
+    "    }\n"
+    
+    "    return result;\n"
+    "}\n"
+    
+    "function ws_hdr() {\n"
+    "    var proto = window.location.protocol,\n"
+    "        ws;\n"
+    "    if (proto == 'https:') {\n"
+    "        ws = 'wss://';\n"
+    "    } else {\n"
+    "        ws = 'ws://';\n"
+    "    }\n"
+    "    return ws;\n"
+    "}\n"
+    
+    "function setActivePage(pageFunction, intervalTime) {\n"
+    
+    "    // 停止之前活动的页面定时函数\n"
+    "    if (activePageIntervalId != null) {\n"
+    "        clearInterval(activePageIntervalId);\n"
+    "    }\n"
+    "    activePageIntervalId = setInterval(pageFunction, intervalTime);\n"
+    "}\n"
+    
+    "ws = new WS('ws://' + window.location.host + '/ws', on_ws_msg);\n"
+    
+    "// ws = new WS('ws://192.168.1.134/ws', on_ws_msg);\n"
+    "// ws = new WS('ws://192.168.1.134/websocket/TMS-WebSocket', on_ws_msg);"
+;
+
+// 文本数据大小(包括null终止符)
+const size_t p_ws_size = 3175;
+
+// 文本长度(字符数)
+const size_t p_ws_length = 3016;
+
+#endif /* P_WS_H */

+ 163 - 101
f407/applications/main.c

@@ -1,122 +1,184 @@
-#include <board.h>
-#include <rtthread.h>
-#include <drv_gpio.h>
-#include <drv_usbh.h>
-#include <dfs_fs.h>
+#include <stdlib.h>
+#include <stdio.h>
 #include <unistd.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <unistd.h>
-#include "web.h"
-#include "sys.h"
-#include "power.h"
 #include "cfg.h"
-#include "paras.h"
-#include "cascade.h"
-#include "snmp.h"
-#include "net.h"
+#include "fs.h"
+#include <stdio.h>
+#include "md5.h"
+#include "led.h"
+#include "rtthread.h"
+#include "dfs_posix.h"
 
-//https://embedded-rd.blog.csdn.net/article/details/109643188
 
-extern void lwip_sys_init(void);
+#include "channel_display.h"
+#include "data_js.h"
+#include "display_data.h"
+#include "index_css.h"
+#include "index_html.h"
+#include "index_js.h"
+#include "operation.h"
+#include "petite-vue.min.h"
+#include "sys_para.h"
+#include "ws.h"
+
 
 
-#if 0
+//https://embedded-rd.blog.csdn.net/article/details/109643188
 
-static int net_init(const char *ip, int port)
+#define CHAR(b) (((b)<=9)?((b)+0x30):((b)-10+0x61));
+static void byte2char(char *chr, uint8_t b)
 {
-#define SERVER_PORT 8080
-#define BUFF_SIZE 128
-    
-    int sock, client_fd;
-    struct sockaddr_in server_addr, client_addr;
-    socklen_t client_addr_len;
-    char buff[BUFF_SIZE];
-    int bytes_read;
-    int ret;
-    
-    /* ??socket */
-    sock = socket(AF_INET, SOCK_STREAM, 0);
-    if (sock == -1) {
-        rt_kprintf("socket create failed!\n");
-        return -1;
-    }
- 
-    /* ??????? */
-    server_addr.sin_family = AF_INET;
-    server_addr.sin_port = htons(port);
-    server_addr.sin_addr.s_addr = inet_addr(ip);
- 
-    /* ??????? */
-    ret = bind(sock, (struct sockaddr *)&server_addr, sizeof(server_addr));
-    if (ret == -1) {
-        rt_kprintf("bind failed!\n");
-        goto __exit;
-    }
- 
-    /* ?????? */
-    ret = listen(sock, 5);
-    if (ret == -1) {
-        rt_kprintf("listen failed!\n");
-        goto __exit;
-    }
- 
-    rt_kprintf("TCP server waiting for client on port %d...\n", port);
- 
-    /* ??????? */
-    client_addr_len = sizeof(client_addr);
-    client_fd = accept(sock, (struct sockaddr *)&client_addr, &client_addr_len);
-    if (client_fd == -1) {
-        rt_kprintf("accept failed!\n");
-        goto __exit;
-    }
- 
-    rt_kprintf("Client accepted!\n");
- 
-    /* ????????? */
-    while (1) {
-        bytes_read = recv(client_fd, buff, BUFF_SIZE, 0);
-        if (bytes_read <= 0) {
-            rt_kprintf("recv failed, errno=%d\n", errno);
-            break;
-        }
-        /* ????????????? */
-        ret = send(client_fd, buff, bytes_read, 0);
-        if (ret < 0) {
-            rt_kprintf("send failed, errno=%d\n", errno);
-            break;
-        }
-    }
- 
-__exit:
-    if (client_fd >= 0) close(client_fd);
-    if (sock >= 0) close(sock);
-    return ret;
+    chr[0] = CHAR(b>>4);
+    chr[1] = CHAR(b&0x0f);
 }
 
-#endif
+//char * test_txt ="sadasdasjkdjalkdfnlakdfnjo'ajdfrlkasdjflkjasdlkfjasdlkfjlasdkjfmjsdlkmfasdlkfmsldfmsdlf;asldfkjsdl;fjslkjf;lskdfjlas;jfasdlkflkjsf";
+
+
 
+#define BASE_PATH  "/nor/web"
 
-static int user_init(void)
+#define API_PATH   "/nor/web/api"
+#define CSS_PATH   "/nor/web/css"
+
+
+
+static void check_path()
+{
+	DIR *dir_base = opendir(BASE_PATH);
+	DIR *dir_api = opendir(API_PATH);
+	DIR *dir_css = opendir(CSS_PATH);
+	if(!dir_base)
+	{
+		mkdir(BASE_PATH,0777);
+	}
+	if(!dir_api)
+	{
+		mkdir(API_PATH,0777);
+	}
+	if(!dir_css)
+	{
+		mkdir(CSS_PATH,0777);
+	}
+	closedir(dir_base);
+	closedir(dir_api);
+	closedir(dir_css);
+}
+
+static void check_file(const char *nor_filename,const char *dst)
 {
-    paras_data_t *p=paras_get();
-    modbus_data_t *cas=&p->cas;
-		net_init();
-    snmp2_init();
-    power_init();
-    //cascade_init();
-    web_init();
-    return 0;
+	
+	if(!nor_filename || !dst)
+		return;
+	
+	md5_ctx_t ctx;
+	md5_init(&ctx);
+	uint8_t nor_tmp[16] = {0};
+	char    nor_m1[32]={0};
+	char    str_m1[32]={0};
+	
+	uint8_t str_tmp[16] = {0};
+	char buff[1024] = {0};
+	int fd = open(nor_filename,O_CREAT | O_RDWR,0777);
+	if(fd <= 0)
+	{
+		return;
+	}
+	int read_len = 0;
+	while((read_len = read(fd,buff,1024)) != 0)
+	{
+		md5_update(&ctx,(uint8_t*)&buff,read_len);
+	}
+	md5_final(&ctx, nor_tmp);
+	
+	for (int i=0; i<16; i++)
+        byte2char(&nor_m1[i*2], nor_tmp[i]);	
+	
+	//str
+	md5_init(&ctx);	
+	uint32_t lenth = strlen(dst);
+	uint32_t count = 1000;
+	char *start = (char *)dst;
+	do{
+		if(lenth <= 1000)
+		{
+			memcpy(buff,start,lenth);
+			md5_update(&ctx,(uint8_t*)&buff,lenth);
+			lenth -= lenth;
+		}else
+		{
+			memcpy(buff,start,1000);	
+			md5_update(&ctx,(uint8_t*)&buff,1000);
+			lenth -= 1000;
+			start += 1000;
+		}
+	}while(lenth);
+	md5_final(&ctx, nor_tmp);
+	
+	for (int i=0; i<16; i++)
+        byte2char(&str_m1[i*2], nor_tmp[i]);		
+	if(memcmp(nor_m1,str_m1,sizeof(nor_m1)))
+	{
+		//write filed to nor
+		if (ftruncate(fd, 0) == -1) {
+			close(fd);
+			return;
+		}
+		lseek(fd,0,SEEK_SET);
+		lenth = strlen(dst);
+		char *start = (char *)dst;
+		
+		do{
+			if(lenth <= 1000)
+			{
+				memcpy(buff,start,lenth);
+				write(fd,buff,lenth);
+				lenth-=lenth;
+			}else
+			{
+				memcpy(buff,start,1000);
+				lenth -= 1000;
+				start += 1000;
+				write(fd,buff,1000);
+			}
+		}while(lenth);
+	}
+	
+	close(fd);
+	fd = 0;
 }
 
 
 
+
+
+
 int main(void)
 {
-    sys_init();
-    user_init();
-    while (1) {
-			
-			sleep(10);
+
+  fs_init();
+	
+	check_path();
+	
+	check_file("/nor/web/api/channel_display.js",p_channel_display);
+	check_file("/nor/web/api/data.js",p_data_js);
+	check_file("/nor/web/api/display_data.js",p_display_data);
+	check_file("/nor/web/api/index.js",p_index_js);
+	check_file("/nor/web/api/operation.js",p_operation);
+	check_file("/nor/web/api/petite-vue.min.js",p_petite_vue);
+	check_file("/nor/web/api/sys_paras.js",p_sys_para);
+	check_file("/nor/web/api/ws.js",p_ws);
+	
+	
+	check_file("/nor/web/css/index.css",p_css_index);
+	
+	check_file("/nor/web/index.html",p_index_html);
+	
+	
+	led_init();
+	led_set(0);
+
+	while (1) {
+			sleep(2);
     }
 }

File diff suppressed because it is too large
+ 509 - 420
f407/project/app/app.uvoptx


File diff suppressed because it is too large
+ 15 - 5
f407/project/app/app.uvprojx


+ 95 - 0
f427/applications/fifo/fifo.c

@@ -0,0 +1,95 @@
+#include "fifo.h"
+#include "rtthread.h"
+#include "stdlib.h"
+#include "string.h"
+
+
+GenericNode* generic_node_create(const void *data, size_t data_size) {
+    GenericNode *new_node = (GenericNode*)malloc(sizeof(GenericNode));
+    if (!new_node) return NULL;
+    
+    new_node->data = malloc(data_size);
+    if (!new_node->data) {
+        free(new_node);
+        return NULL;
+    }
+    
+    memcpy(new_node->data, data, data_size);
+    new_node->data_size = data_size;
+    new_node->next = NULL;
+    return new_node;
+}
+
+
+GenericFixedList* generic_list_create(int max_size) {
+    GenericFixedList *list = (GenericFixedList*)malloc(sizeof(GenericFixedList));
+    if (!list) return NULL;
+    
+    list->head = NULL;
+    list->tail = NULL;
+    list->max_size = max_size;
+    list->current_size = 0;
+    return list;
+}
+
+bool generic_list_append(GenericFixedList *list, const void *data, size_t data_size) {
+    if (list->max_size == 0) return false;
+    
+    if (list->current_size == 0) {
+        GenericNode *new_node = generic_node_create(data, data_size);
+        if (!new_node) return false;
+        
+        new_node->next = new_node;
+        list->head = new_node;
+        list->tail = new_node;
+        list->current_size = 1;
+        return true;
+    }
+    else if (list->current_size >= list->max_size) {
+        if (list->head->data_size != data_size) {
+
+            free(list->head->data);
+            list->head->data = malloc(data_size);
+            if (!list->head->data) return false;
+            list->head->data_size = data_size;
+        }
+        
+        memcpy(list->head->data, data, data_size);
+        
+        list->tail = list->head;
+        list->head = list->head->next;
+        return true;
+    }
+    else {
+        GenericNode *new_node = generic_node_create(data, data_size);
+        if (!new_node) return false;
+        
+        new_node->next = list->head;
+        list->tail->next = new_node;
+        list->tail = new_node;
+        list->current_size++;
+        return true;
+    }
+}
+
+
+void generic_list_destroy(GenericFixedList *list) {
+    if (list->current_size > 0) {
+        GenericNode *current = list->head;
+        GenericNode *next_node = NULL;
+        
+        for (int i = 0; i < list->current_size; i++) {
+            next_node = current->next;
+            free(current->data);
+            free(current);
+            current = next_node;
+        }
+    }
+    free(list);
+}
+
+
+int generic_list_get_count(GenericFixedList *list)
+{
+	return list->current_size;
+}

+ 46 - 0
f427/applications/fifo/fifo.h

@@ -0,0 +1,46 @@
+#ifndef X_FIFO_H_
+#define X_FIFO_H_
+
+
+#include "stddef.h"
+#include "stdbool.h"
+
+
+
+
+
+typedef struct GenericNode {
+    void *data;                
+    size_t data_size;           
+    struct GenericNode *next;
+} GenericNode;
+
+
+typedef struct {
+    GenericNode *head;
+    GenericNode *tail;
+    int max_size;
+    int current_size;
+} GenericFixedList;
+
+
+GenericNode* generic_node_create(const void *data, size_t data_size);
+GenericFixedList* generic_list_create(int max_size);
+
+bool generic_list_append(GenericFixedList *list, const void *data, size_t data_size);
+
+
+void generic_list_destroy(GenericFixedList *list);
+
+
+int generic_list_get_count(GenericFixedList *list);
+
+
+
+
+
+
+
+
+
+#endif