将从缓存文件中读取改成从内存数组中进行读取
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
import logging
|
||||
import time
|
||||
import threading
|
||||
from config_loader import load_config
|
||||
from plc_manager import PLCManager
|
||||
from cache_manager import CacheManager
|
||||
from api_server import APIServer
|
||||
@ -41,7 +40,7 @@ class GatewayApp:
|
||||
# 重新初始化PLC连接
|
||||
if self.plc_manager:
|
||||
self.logger.info("Reinitializing PLC connections...")
|
||||
self.plc_manager = PLCManager(config["plcs"])
|
||||
self.plc_manager = PLCManager(config["plcs"], self.reader_threads)
|
||||
self.plc_manager.connect_all()
|
||||
|
||||
# 重新初始化缓存
|
||||
@ -92,7 +91,7 @@ class GatewayApp:
|
||||
plc_name=plc_config["name"],
|
||||
area_config=area_config,
|
||||
update_interval=0.03,
|
||||
output_file_prefix="area_"
|
||||
max_array_size=10000
|
||||
)
|
||||
read_thread.start()
|
||||
# 存入线程列表,便于后续停止
|
||||
|
||||
Reference in New Issue
Block a user