mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2026-02-04 05:15:10 +00:00
Merge branch 'DH_Raman' of https://github.com/h840473807/Uni-Lab-OS into DH_Raman
This commit is contained in:
@@ -6,7 +6,7 @@ if(rclpy.ok() == False):
|
||||
else:
|
||||
print("rclpy already initiated")
|
||||
|
||||
from unilabos.devices.dh_electrochem.dh_7000 import DH7000
|
||||
from unilabos.devices.electrochem.dh_7000 import DH7000
|
||||
from unilabos_msgs.action import SendCmd
|
||||
from std_msgs.msg import Float64, String, Int16
|
||||
from unilabos.ros.device_node_wrapper import ros2_device_node
|
||||
|
||||
@@ -6,12 +6,10 @@ if(rclpy.ok() == False):
|
||||
else:
|
||||
print("rclpy already initiated")
|
||||
|
||||
from unilabos.devices.opsky_Raman.opsky_ATR30007 import ATR30007
|
||||
from unilabos.devices.raman_uv.opsky_ATR30007 import ATR30007
|
||||
from unilabos_msgs.action import SendCmd
|
||||
from std_msgs.msg import Float64, String, Int16
|
||||
from unilabos.ros.device_node_wrapper import ros2_device_node
|
||||
import clr
|
||||
import os
|
||||
|
||||
# dll_path = r'D:\UniLab\code\DHElecChem\release64'
|
||||
# eccore_dll_path = os.path.join(dll_path, 'ECCore.dll')
|
||||
# os.environ["PATH"] = dll_path + os.pathsep + os.environ["PATH"]
|
||||
|
||||
@@ -498,7 +498,7 @@ class DH7000:
|
||||
print(f"数据已保存到 {save_root}")
|
||||
|
||||
# === Core: a unified dh_cmd method that calls start_eis or start_lsv according to methods ===
|
||||
def dh_cmd(self, command: str):
|
||||
def dh_cmd(self, method: str, command: str, resource: dict):
|
||||
"""
|
||||
Unified handler for different commands such as EIS / LSV / CV / CA.
|
||||
In the incoming command JSON, use the key "methods" to specify the measurement type: "eis", "lsv", etc.
|
||||
@@ -516,7 +516,7 @@ class DH7000:
|
||||
print(f"命令参数: {cmd_dict}")
|
||||
|
||||
# Extract measurement method, default to "EIS" if not specified
|
||||
method = cmd_dict.pop("methods", "eis").lower()
|
||||
# method = cmd_dict.pop("methods", "eis").lower()
|
||||
# Extract file save path (may not be provided)
|
||||
save_root = cmd_dict.get("save_root", r"D:\UniLab\results\test")
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import clr
|
||||
import os
|
||||
import time
|
||||
import pandas as pd
|
||||
import json
|
||||
import shutil
|
||||
import sys
|
||||
import time
|
||||
from System import Environment
|
||||
import os
|
||||
|
||||
import clr
|
||||
import pandas as pd
|
||||
|
||||
|
||||
# define class ATR30007
|
||||
# this class is used to control the ATR30007 Raman workstation
|
||||
@@ -15,6 +12,7 @@ class ATR30007:
|
||||
def __init__(self, dll_path: str = r'D:\Raman_RS'):
|
||||
self.dll_path = dll_path
|
||||
self.machine = None
|
||||
self.status = "Idle"
|
||||
self._load_dll()
|
||||
|
||||
def _load_dll(self):
|
||||
@@ -59,6 +57,7 @@ class ATR30007:
|
||||
SetC_flag = self.machine.SetCool(CCDTemp)
|
||||
print(f"SetC_flag:{SetC_flag}")
|
||||
#开始采集光谱
|
||||
self.status = "Running"
|
||||
Spect = self.machine.AcquireSpectrum()
|
||||
#开始采集光谱谱图数据转换
|
||||
Spect_data = list(Spect.get_Data())
|
||||
@@ -70,6 +69,8 @@ class ATR30007:
|
||||
Spect_bLC = list(self.machine.BaseLineCorrect(Spect_data))
|
||||
#对数据进行boxcar 平滑
|
||||
Spect_StB = list(self.machine.SmoothBoxcar(Spect_bLC, 10))
|
||||
|
||||
self.status = "Idle"
|
||||
#关闭仪器
|
||||
OFF_flag = wrapper.CloseDevice()
|
||||
print(f"OFF_flag: {OFF_flag}")
|
||||
@@ -0,0 +1,44 @@
|
||||
# 色谱表征设备
|
||||
hplc.agilent:
|
||||
description: HPLC device
|
||||
class:
|
||||
module: unilabos.devices.hplc.AgilentHPLC:HPLCDriver
|
||||
type: python
|
||||
status_types:
|
||||
device_status: String
|
||||
could_run: Bool
|
||||
driver_init_ok: Bool
|
||||
is_running: Bool
|
||||
finish_status: String
|
||||
status_text: String
|
||||
action_value_mappings:
|
||||
execute_command_from_outer:
|
||||
type: SendCmd
|
||||
goal:
|
||||
command: command
|
||||
feedback: {}
|
||||
result:
|
||||
success: success
|
||||
schema:
|
||||
properties:
|
||||
device_status:
|
||||
type: string
|
||||
could_run:
|
||||
type: boolean
|
||||
driver_init_ok:
|
||||
type: boolean
|
||||
is_running:
|
||||
type: boolean
|
||||
finish_status:
|
||||
type: string
|
||||
status_text:
|
||||
type: string
|
||||
required:
|
||||
- device_status
|
||||
- could_run
|
||||
- driver_init_ok
|
||||
- is_running
|
||||
- finish_status
|
||||
- status_text
|
||||
additionalProperties: false
|
||||
type: object
|
||||
19
unilabos/registry/devices/characterization_electric.yaml
Normal file
19
unilabos/registry/devices/characterization_electric.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
# 电化学表征设备:电化学工作站、电池测试柜
|
||||
electrochem_station.DongHua:
|
||||
description: Donghua electrochem_station
|
||||
class:
|
||||
module: unilabos.devices.electrochem.dh_7000:DH7000
|
||||
type: python
|
||||
status_types:
|
||||
status: String
|
||||
action_value_mappings:
|
||||
dh_cmd:
|
||||
type: WorkStationRun
|
||||
goal:
|
||||
wf_name: method
|
||||
params: command
|
||||
resource: resource
|
||||
feedback:
|
||||
status: status
|
||||
result:
|
||||
success: success
|
||||
@@ -1,5 +1,5 @@
|
||||
# 光学表征设备:红外、紫外可见、拉曼等
|
||||
raman_home_made:
|
||||
raman.home_made:
|
||||
description: Raman spectroscopy device
|
||||
class:
|
||||
module: unilabos.devices.raman_uv.home_made_raman:RamanObj
|
||||
@@ -22,46 +22,24 @@ raman_home_made:
|
||||
- status
|
||||
additionalProperties: false
|
||||
type: object
|
||||
hplc.agilent:
|
||||
description: HPLC device
|
||||
|
||||
raman.opsky_ATR30007:
|
||||
description: Raman spectroscopy device
|
||||
class:
|
||||
module: unilabos.devices.hplc.AgilentHPLC:HPLCDriver
|
||||
module: unilabos.devices.raman_uv.opsky_raman:ATR30007
|
||||
type: python
|
||||
status_types:
|
||||
device_status: String
|
||||
could_run: Bool
|
||||
driver_init_ok: Bool
|
||||
is_running: Bool
|
||||
finish_status: String
|
||||
status_text: String
|
||||
status: String
|
||||
action_value_mappings:
|
||||
execute_command_from_outer:
|
||||
type: SendCmd
|
||||
start_Raman:
|
||||
type: GetRaman
|
||||
goal:
|
||||
command: command
|
||||
feedback: {}
|
||||
result:
|
||||
success: success
|
||||
schema:
|
||||
properties:
|
||||
device_status:
|
||||
type: string
|
||||
could_run:
|
||||
type: boolean
|
||||
driver_init_ok:
|
||||
type: boolean
|
||||
is_running:
|
||||
type: boolean
|
||||
finish_status:
|
||||
type: string
|
||||
status_text:
|
||||
type: string
|
||||
required:
|
||||
- device_status
|
||||
- could_run
|
||||
- driver_init_ok
|
||||
- is_running
|
||||
- finish_status
|
||||
- status_text
|
||||
additionalProperties: false
|
||||
type: object
|
||||
integtime: IntegTime
|
||||
ldpower: LdPower
|
||||
ldwave: LdWave
|
||||
ccdtemp: CCDTemp
|
||||
filename: filename
|
||||
saveroot: saveroot
|
||||
feedback:
|
||||
status: status
|
||||
result: {}
|
||||
|
||||
@@ -49,6 +49,8 @@ set(action_files
|
||||
"action/Evaporate.action"
|
||||
"action/EvacuateAndRefill.action"
|
||||
|
||||
"action/GetRaman.action"
|
||||
|
||||
"action/WorkStationRun.action"
|
||||
"action/AGVTransfer.action"
|
||||
)
|
||||
|
||||
13
unilabos_msgs/action/GetRaman.action
Normal file
13
unilabos_msgs/action/GetRaman.action
Normal file
@@ -0,0 +1,13 @@
|
||||
# Goal
|
||||
int32 integtime
|
||||
int32 ldpower
|
||||
bool ldwave
|
||||
float64 ccdtemp
|
||||
string filename
|
||||
string saveroot
|
||||
---
|
||||
# Result
|
||||
string success
|
||||
---
|
||||
# Feedback
|
||||
string status
|
||||
Reference in New Issue
Block a user