增加管道直径参数
This commit is contained in:
@@ -13,6 +13,9 @@ import time
|
|||||||
import sqlite3
|
import sqlite3
|
||||||
import sys
|
import sys
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
from x_ray_data_processor import processor
|
||||||
|
|
||||||
def import_sql_to_database(db_path, table_bame):
|
def import_sql_to_database(db_path, table_bame):
|
||||||
|
|
||||||
conn = sqlite3.connect(db_path)
|
conn = sqlite3.connect(db_path)
|
||||||
@@ -91,6 +94,11 @@ if __name__ == "__main__":
|
|||||||
config.update(sn = device_id)
|
config.update(sn = device_id)
|
||||||
save_config(config)
|
save_config(config)
|
||||||
|
|
||||||
|
if 'mid_pipe_diameter' in config:
|
||||||
|
val = float(config['mid_pipe_diameter'])
|
||||||
|
if val >= 100 and val <= 200:
|
||||||
|
processor.set_pipe_diameter(val)
|
||||||
|
|
||||||
ip = "101.200.29.204"
|
ip = "101.200.29.204"
|
||||||
port = 18003
|
port = 18003
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -23,6 +23,11 @@ class XRayDataProcessor:
|
|||||||
self.derivative_data = None
|
self.derivative_data = None
|
||||||
self.results = None
|
self.results = None
|
||||||
self.selected_spans = {'CH1': [], 'CH2': []}
|
self.selected_spans = {'CH1': [], 'CH2': []}
|
||||||
|
self.pipe_diameter = 130
|
||||||
|
|
||||||
|
def set_pipe_diameter(self, diameter):
|
||||||
|
"""设置管道直径"""
|
||||||
|
self.pipe_diameter = diameter
|
||||||
|
|
||||||
def load_data(self, filepath):
|
def load_data(self, filepath):
|
||||||
"""加载CSV数据文件"""
|
"""加载CSV数据文件"""
|
||||||
@@ -256,7 +261,7 @@ class XRayDataProcessor:
|
|||||||
|
|
||||||
def _model(self, index, Q0, mu, offset):
|
def _model(self, index, Q0, mu, offset):
|
||||||
"""X光束衰减模型"""
|
"""X光束衰减模型"""
|
||||||
R = 65.0
|
R = self.pipe_diameter / 2
|
||||||
t = 0.8
|
t = 0.8
|
||||||
factor = 0.04
|
factor = 0.04
|
||||||
X = factor * (index - offset)
|
X = factor * (index - offset)
|
||||||
|
|||||||
Reference in New Issue
Block a user