当前位置:首页>python>Python Tkinter搞定工业参数界面?这套绑定机制我用了三年

Python Tkinter搞定工业参数界面?这套绑定机制我用了三年

  • 2026-02-26 19:01:17
Python Tkinter搞定工业参数界面?这套绑定机制我用了三年

这篇文章就是要帮你避开这个坑。我会把这三年里在工业现场摸爬滚打总结出来的Tkinter参数绑定技巧,全部掏出来。包括:怎么让参数改动实时反馈、如何处理高频数据刷新、多参数联动的优雅实现。看完直接能用在你的项目里。

💥 问题到底出在哪儿?

传统做法的三大硬伤

很多人(包括当年的我)写工业界面,都是这么干的:

# 错误示范 - 别学我当年的蠢样子
defset_parameter():
    value = entry.get()
# 直接操作硬件或业务逻辑
    controller.set_temperature(float(value))
# 手动更新显示
    label_display.config(text=f"当前温度: {value}°C")

看着没毛病对吧?问题大了去了:

  1. 1. 显示和数据两张皮 - 你改了Entry,Label不一定跟着变;后台数据变了,前端不知道
  2. 2. 回调地狱 - 参数一多,到处都是.config(),改一处要找半天
  3. 3. 状态不同步 - 多个控件显示同一个值?祝你好运,容易改漏

我见过最狠的一个项目,一个PID调试界面,光参数刷新的代码就写了500多行。维护的哥们后来直接离职了。

根本原因是啥?

说白了就是没建立数据模型和视图的绑定关系。工业软件和普通软件最大的区别在哪?**实时性!**电机转速从1000rpm跳到1200rpm,界面得马上跟上。你要是还在手动刷新,延迟能把操作员逼疯。

🔧 核心武器:Tkinter的Variable家族

Tkinter其实给咱们准备好了工具——StringVarIntVarDoubleVarBooleanVar。这玩意儿就像一个带通知功能的变量

基本原理(用人话讲)

想象你家装了个智能门铃。

  • • 普通变量:门铃响了,你得时不时去看看有没有人
  • • Tkinter Variable:门铃自带推送,有人按就通知你

数据变了,绑定的控件自动更新。 就这么简单。

🚀 方案一:单参数绑定(入门必会)

先从最简单的来——一个温度设定界面。

完整代码示例

import tkinter as tk
from tkinter import ttk

classTemperaturePanel:
def__init__(self, root):
self.root = root

# 核心:创建绑定变量
self.temp_setpoint = tk.DoubleVar(value=25.0)
self.temp_actual = tk.DoubleVar(value=20.0)

self._build_ui()
self._bind_callbacks()

def_build_ui(self):
# 设定值输入框 - 注意这个textvariable参数
        ttk.Label(self.root, text="目标温度:").grid(row=0, column=0, padx=5, pady=5)
        entry = ttk.Entry(self.root, textvariable=self.temp_setpoint, width=10)
        entry.grid(row=0, column=1, padx=5, pady=5)
        ttk.Label(self.root, text="°C").grid(row=0, column=2)

# 实时显示 - 同样用textvariable绑定
        ttk.Label(self.root, text="当前温度:").grid(row=1, column=0, padx=5, pady=5)
        display = ttk.Label(
self.root, 
            textvariable=self.temp_actual,
            font=('Arial'20'bold'),
            foreground='red'
        )
        display.grid(row=1, column=1, padx=5, pady=5)
        ttk.Label(self.root, text="°C").grid(row=1, column=2)

# 进度条也能绑定(0-100范围)
        progress = ttk.Progressbar(
self.root, 
            variable=self.temp_actual,
            maximum=100,
            length=200
        )
        progress.grid(row=2, column=0, columnspan=3, pady=10)

def_bind_callbacks(self):
# 关键:监听变量变化
self.temp_setpoint.trace_add('write'self.on_setpoint_changed)

defon_setpoint_changed(self, *args):
        new_value = self.temp_setpoint.get()
print(f"用户设定新温度: {new_value}°C")
# 这里调用你的硬件控制代码
# hardware_controller.set_target(new_value)

defupdate_actual_temp(self, value):
"""外部调用此方法更新实际温度"""
self.temp_actual.set(value)

# 使用示例
root = tk.Tk()
root.title("温控系统")
panel = TemperaturePanel(root)

# 模拟温度数据更新(实际项目中从传感器读取)
defsimulate_data():
import random
    current = panel.temp_actual.get()
    target = panel.temp_setpoint.get()
# 简单模拟温度逐渐接近目标值
    new_temp = current + (target - current) * 0.1 + random.uniform(-0.50.5)
    panel.update_actual_temp(round(new_temp, 1))
    root.after(500, simulate_data)  # 每500ms更新一次

simulate_data()
root.mainloop()

实战效果数据

这套方案我在佛山某机械厂的加热炉项目里用过。对比之前的手动刷新:

  • • 代码量减少62%(从380行降到145行)
  • • 界面响应延迟从平均220ms降到<50ms
  • • 参数漏刷新Bug数:0(之前每月平均修2-3个)

⚠️ 新手常踩的坑

坑1:忘记保存Variable引用

# 错误写法
ttk.Entry(root, textvariable=tk.StringVar())  # 这个变量会被垃圾回收!

# 正确写法
self.my_var = tk.StringVar()
ttk.Entry(root, textvariable=self.my_var)

坑2:类型不匹配

voltage = tk.IntVar()  # 整型变量
voltage.set(3.14)  # 会被截断成3!电压测量直接废了
# 应该用DoubleVar

💡 方案二:多参数联动(进阶技巧)

工业场景里经常有这种情况——一个参数变了,其他相关参数得跟着联动

比如电机控制:改了频率,转速和扭矩的理论值都得重新计算。

实战案例:PID参数调试面板

import tkinter as tk
from tkinter import ttk
import math

classPIDTuningPanel:
def__init__(self, root):
self.root = root

# PID三参数
self.kp = tk.DoubleVar(value=1.0)
self.ki = tk.DoubleVar(value=0.1)
self.kd = tk.DoubleVar(value=0.01)

# 计算出的系统特性(联动参数)
self.settling_time = tk.DoubleVar()
self.overshoot = tk.DoubleVar()
self.stability_margin = tk.StringVar()

self._build_ui()
self._bind_all()
self._calculate_characteristics()  # 初始计算

def_build_ui(self):
# PID参数输入区
        params_frame = ttk.LabelFrame(self.root, text="PID参数设定", padding=10)
        params_frame.grid(row=0, column=0, padx=10, pady=10, sticky='ew')

        params = [
            ("比例系数 Kp:"self.kp, 0.110.0),
            ("积分系数 Ki:"self.ki, 0.012.0),
            ("微分系数 Kd:"self.kd, 0.0011.0)
        ]

for idx, (label, var, min_val, max_val) inenumerate(params):
            ttk.Label(params_frame, text=label).grid(row=idx, column=0, sticky='w', pady=5)

# 滑块 + 数值框组合
            scale = ttk.Scale(
                params_frame,
                from_=min_val,
                to=max_val,
                variable=var,
                orient='horizontal',
                length=200
            )
            scale.grid(row=idx, column=1, padx=5)

            entry = ttk.Entry(params_frame, textvariable=var, width=8)
            entry.grid(row=idx, column=2, padx=5)

# 系统特性显示区(这里是联动结果)
        result_frame = ttk.LabelFrame(self.root, text="预测系统特性", padding=10)
        result_frame.grid(row=1, column=0, padx=10, pady=10, sticky='ew')

        ttk.Label(result_frame, text="调节时间:").grid(row=0, column=0, sticky='w')
        ttk.Label(
            result_frame,
            textvariable=self.settling_time,
            font=('Arial'12'bold')
        ).grid(row=0, column=1, sticky='w')
        ttk.Label(result_frame, text="秒").grid(row=0, column=2, sticky='w')

        ttk.Label(result_frame, text="超调量:").grid(row=1, column=0, sticky='w')
        ttk.Label(
            result_frame,
            textvariable=self.overshoot,
            font=('Arial'12'bold')
        ).grid(row=1, column=1, sticky='w')
        ttk.Label(result_frame, text="%").grid(row=1, column=2, sticky='w')

        ttk.Label(result_frame, text="稳定性:").grid(row=2, column=0, sticky='w')
        stability_label = ttk.Label(
            result_frame,
            textvariable=self.stability_margin,
            font=('Arial'12'bold')
        )
        stability_label.grid(row=2, column=1, sticky='w')

def_bind_all(self):
"""把所有参数的变化都绑定到计算函数"""
for var in [self.kp, self.ki, self.kd]:
            var.trace_add('write'self._calculate_characteristics)

def_calculate_characteristics(self, *args):
"""核心联动逻辑 - PID参数变化时自动重算系统特性"""
try:
            kp = self.kp.get()
            ki = self.ki.get()
            kd = self.kd.get()

# 简化的二阶系统近似计算(实际项目用更复杂的模型)
            wn = math.sqrt(kp)  # 自然频率
            zeta = (kd * wn + 1) / (2 * wn) if wn > 0else0# 阻尼比

# 调节时间(2%误差带)
if zeta > 0and wn > 0:
                ts = 4 / (zeta * wn)
else:
                ts = 999.9
self.settling_time.set(f"{ts:.2f}")

# 超调量
if zeta < 1and zeta > 0:
                overshoot = 100 * math.exp(-math.pi * zeta / math.sqrt(1 - zeta**2))
else:
                overshoot = 0
self.overshoot.set(f"{overshoot:.1f}")

# 稳定性判断
if zeta > 1:
                status = "过阻尼(响应慢)"
                color = 'orange'
elif0.6 <= zeta <= 1:
                status = "理想阻尼 ✓"
                color = 'green'
elif0 < zeta < 0.6:
                status = "欠阻尼(振荡)"
                color = 'red'
else:
                status = "不稳定!"
                color = 'red'

self.stability_margin.set(status)

except Exception as e:
print(f"计算出错: {e}")

# 运行
root = tk.Tk()
root.title("PID调试助手")
panel = PIDTuningPanel(root)
root.mainloop()

为什么这么设计?

在现场调PID参数,工程师最怕的是啥?调完发现系统振荡停不下来

这个面板的巧妙之处——你拖动滑块的瞬间,下面马上显示预测的系统特性。看到"不稳定"三个字,立马就知道这组参数不行,根本不用下载到设备试。

我之前在东莞某注塑机厂,用这套界面帮调试工程师把平均调试时间从2小时压缩到25分钟。老师傅都说好使。

🎯 关键代码解读

def_bind_all(self):
for var in [self.kp, self.ki, self.kd]:
        var.trace_add('write'self._calculate_characteristics)

这四行是精髓。任何一个参数变了,都触发重新计算。不用你记着哪里要更新,变量自己会"喊"。

⚡ 方案三:高频数据刷新(性能优化版)

现在问题来了——如果数据更新频率特别高怎么办?

比如示波器类应用,每秒钟采集1000个点。你要是每次都刷新界面,Tkinter早卡死了。

问题场景复现

# 这样写必死无疑
defupdate_high_speed_data(self):
whileTrue:
        data = sensor.read()  # 1000Hz采样
self.display_var.set(data)  # 界面根本跟不上!
        time.sleep(0.001)

界面会卡到你怀疑人生。

优化策略:降频 + 缓冲

import tkinter as tk
from tkinter import ttk
import threading
import queue
import time

classHighSpeedMonitor:
def__init__(self, root):
self.root = root
self.data_queue = queue.Queue(maxsize=1000)

# 显示用的变量(低频更新)
self.current_value = tk.DoubleVar(value=0.0)
self.max_value = tk.DoubleVar(value=0.0)
self.min_value = tk.DoubleVar(value=0.0)
self.avg_value = tk.DoubleVar(value=0.0)

self.sample_buffer = []
self.is_running = False

self._build_ui()
self.start_monitoring()

def_build_ui(self):
# 显示区
        display_frame = ttk.Frame(self.root, padding=20)
        display_frame.pack()

        metrics = [
            ("实时值:"self.current_value, "V"),
            ("最大值:"self.max_value, "V"),
            ("最小值:"self.min_value, "V"),
            ("平均值:"self.avg_value, "V")
        ]

for idx, (label, var, unit) inenumerate(metrics):
            ttk.Label(display_frame, text=label, font=('Arial'10)).grid(
                row=idx, column=0, sticky='w', pady=5
            )
            ttk.Label(display_frame, textvariable=var, font=('Arial'16'bold')).grid(
                row=idx, column=1, padx=10
            )
            ttk.Label(display_frame, text=unit).grid(row=idx, column=2, sticky='w')

# 采样率显示
self.sample_rate_var = tk.StringVar(value="采样率: 0 Hz")
        ttk.Label(display_frame, textvariable=self.sample_rate_var).grid(
            row=4, column=0, columnspan=3, pady=10
        )

defstart_monitoring(self):
"""启动两个线程:数据采集 + 界面更新"""
self.is_running = True

# 线程1:高速采集数据(不碰界面)
        threading.Thread(target=self._data_acquisition_thread, daemon=True).start()

# 定时任务:低速更新界面(50Hz足够了)
self._update_display()

def_data_acquisition_thread(self):
"""模拟高速数据采集 - 运行在后台线程"""
import random
        sample_count = 0
        start_time = time.time()

whileself.is_running:
# 模拟传感器读数(实际项目这里调硬件API)
            data = 3.3 + random.uniform(-0.50.5)

try:
self.data_queue.put_nowait(data)
                sample_count += 1
except queue.Full:
pass# 队列满了就丢弃旧数据

            time.sleep(0.001)  # 1000Hz采样

# 每秒计算一次采样率
if time.time() - start_time >= 1.0:
                actual_rate = sample_count / (time.time() - start_time)
# 注意:不能直接在线程里操作Tkinter变量!要用after方法
self.root.after(0lambda r=actual_rate: 
self.sample_rate_var.set(f"采样率: {r:.0f} Hz"))
                sample_count = 0
                start_time = time.time()

def_update_display(self):
"""界面更新函数 - 运行在主线程(Tkinter要求)"""
# 从队列里取出所有数据
        temp_buffer = []
whilenotself.data_queue.empty():
try:
                temp_buffer.append(self.data_queue.get_nowait())
except queue.Empty:
break

if temp_buffer:
self.sample_buffer.extend(temp_buffer)
# 只保留最近100个样本用于计算
self.sample_buffer = self.sample_buffer[-100:]

# 更新显示(关键:这里才操作Variable)
self.current_value.set(f"{temp_buffer[-1]:.3f}")
self.max_value.set(f"{max(self.sample_buffer):.3f}")
self.min_value.set(f"{min(self.sample_buffer):.3f}")
self.avg_value.set(f"{sum(self.sample_buffer)/len(self.sample_buffer):.3f}")

# 50Hz刷新界面(够快了,人眼看不出区别)
self.root.after(20self._update_display)

defstop_monitoring(self):
self.is_running = False

# 使用
root = tk.Tk()
root.title("高速数据监控")
monitor = HighSpeedMonitor(root)

defon_closing():
    monitor.stop_monitoring()
    root.destroy()

root.protocol("WM_DELETE_WINDOW", on_closing)
root.mainloop()

性能对比实测

在我的笔记本上(i5-8250U)测试结果:

方案
CPU占用
界面刷新延迟
数据丢失率
直接刷新(错误)
92%
>500ms
78%
队列缓冲(本方案)
12%
<20ms
0%

差距不是一点半点。关键技巧就两个:

  1. 1. 数据采集和界面更新分离(一个后台线程,一个主线程)
  2. 2. 降低界面刷新频率(50Hz就够,人眼分辨不出来)

🎓 三个可以直接偷的模板

模板1:通用参数绑定基类

classParameterBinding:
"""可复用的参数绑定基类"""
def__init__(self):
self._observers = []

defbind(self, callback):
"""绑定回调函数"""
self._observers.append(callback)

defnotify(self, *args):
"""通知所有观察者"""
for callback inself._observers:
            callback(*args)

# 使用示例
classMyParameter(ParameterBinding):
def__init__(self):
super().__init__()
self.value = tk.DoubleVar()
self.value.trace_add('write'lambda *args: self.notify(self.value.get()))

模板2:参数配置保存/加载

import json

classParameterManager:
def__init__(self, vars_dict):
"""vars_dict: {'param_name': tk.Variable对象}"""
self.vars = vars_dict

defsave_config(self, filename):
        config = {name: var.get() for name, var inself.vars.items()}
withopen(filename, 'w'as f:
            json.dump(config, f, indent=2)
print(f"参数已保存到 {filename}")

defload_config(self, filename):
withopen(filename, 'r'as f:
            config = json.load(f)
for name, value in config.items():
if name inself.vars:
self.vars[name].set(value)
print(f"参数已从 {filename} 加载")

# 用法
params = {
'temperature': temp_var,
'pressure': pressure_var
}
manager = ParameterManager(params)
manager.load_config('last_config.json')  # 启动时加载上次配置

模板3:参数验证装饰器

defvalidate_range(min_val, max_val):
"""参数范围验证装饰器"""
defdecorator(setter_func):
defwrapper(self, value):
ifnot (min_val <= value <= max_val):
print(f"警告:参数超出范围[{min_val}{max_val}],已限幅")
                value = max(min_val, min(max_val, value))
return setter_func(self, value)
return wrapper
return decorator

# 使用
classSafeParameter:
def__init__(self):
self.var = tk.DoubleVar()

    @validate_range(0100)
defset_value(self, val):
self.var.set(val)

🎯 三个金句带回家

  1. 1. "参数绑定不是技术问题,是设计问题" —— 先想清楚数据流向,再写代码
  2. 2. "界面更新频率永远不需要超过50Hz" —— 人眼的极限,浪费CPU何必呢
  3. 3. "让Variable自己通知,别你去轮询" —— 观察者模式的精髓

📚 如果想深入学习

这三个方向可以继续挖:

  1. 1. MVC模式在工业界面中的应用 → 更大型项目必备
  2. 2. Tkinter + Matplotlib实时绘图 → 波形监控类应用
  3. 3. 基于asyncio的异步界面框架 → 处理复杂通信协议

收藏这篇文章的理由:下次写工业界面,直接复制文中的代码模板改改就能用。省下的时间够你多喝两杯咖啡。

觉得有帮助的话,顺手转发给正在做上位机开发的同事?他们会感谢你的。

#Python开发 #Tkinter #工业软件 #界面编程 #实时系统

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-28 09:01:57 HTTP/2.0 GET : https://f.mffb.com.cn/a/476316.html
  2. 运行时间 : 0.141219s [ 吞吐率:7.08req/s ] 内存消耗:4,471.85kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=aa5810645ea5adfc4fb88db4983729c2
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000868s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001629s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000724s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000673s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001338s ]
  6. SELECT * FROM `set` [ RunTime:0.000599s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001444s ]
  8. SELECT * FROM `article` WHERE `id` = 476316 LIMIT 1 [ RunTime:0.006737s ]
  9. UPDATE `article` SET `lasttime` = 1772240517 WHERE `id` = 476316 [ RunTime:0.014773s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.002316s ]
  11. SELECT * FROM `article` WHERE `id` < 476316 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000945s ]
  12. SELECT * FROM `article` WHERE `id` > 476316 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.002409s ]
  13. SELECT * FROM `article` WHERE `id` < 476316 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001555s ]
  14. SELECT * FROM `article` WHERE `id` < 476316 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.000633s ]
  15. SELECT * FROM `article` WHERE `id` < 476316 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.002438s ]
0.142804s