Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
6728462
dev
Apr 9, 2023
3200346
detector
Apr 11, 2023
f9302bc
md2
qinwenming Apr 12, 2023
0d3d657
md2
qinwenming Apr 18, 2023
ee07f55
config
qinwenming Apr 25, 2023
0b41baf
Merge branch 'develop' of https://gitee.com/ssrfmx/mxcube3_bl19u into…
qinwenming Apr 26, 2023
ba42fe7
dev
qinwenming May 10, 2023
5aa32e6
dev
qinwenming May 11, 2023
47db2d4
dev
qinwenming May 18, 2023
f9f34b6
dev
qinwenming May 26, 2023
4453b54
md2
qinwenming May 29, 2023
01d3402
detect distance change update gui
qinwenming Jun 1, 2023
42d02ef
ring curret
qinwenming Jun 5, 2023
376658b
detector status
qinwenming Jun 7, 2023
26e5724
dev
qinwenming Jun 9, 2023
c1ed1d1
collect
qinwenming Jun 11, 2023
8aa93db
resolution
qinwenming Jun 11, 2023
ab50ff6
status change
qinwenming Jun 13, 2023
2e5ad1c
motor status
qinwenming Jun 14, 2023
22ca984
dev
qinwenming Jun 14, 2023
05a8ae2
dev
qinwenming Jun 14, 2023
6745690
format value
qinwenming Jun 14, 2023
1cb41b5
data format
qinwenming Jun 14, 2023
43a089a
sc
qinwenming Jun 16, 2023
baba104
refactor code
qinwenming Jun 21, 2023
4099003
login issue
qinwenming Jun 27, 2023
c58968d
dev
qinwenming Jul 5, 2023
57cd8de
dev
qinwenming Jul 26, 2023
4f9a018
front light
qinwenming Aug 17, 2023
0c676e3
backlight
qinwenming Aug 17, 2023
9c9cbeb
dev
qinwenming Aug 21, 2023
d98ae45
dev
qinwenming Aug 21, 2023
6c57093
dev
qinwenming Aug 29, 2023
de19d15
update motor status
qinwenming Sep 4, 2023
6f8da3b
circle radius
qinwenming Sep 7, 2023
5581725
dev
qinwenming Sep 20, 2023
9958d75
dev
qinwenming Oct 10, 2023
95f05c6
dev
qinwenming Oct 11, 2023
e15c42b
Merge branch 'develop' of https://gitee.com/ssrfmx/mxcube3_bl19u into…
qinwenming Oct 11, 2023
4d96f87
dev
qinwenming Oct 15, 2023
a49b5b4
dev
qinwenming Oct 17, 2023
ecaae89
dev
qinwenming Oct 31, 2023
382b1e1
dev
qinwenming Nov 1, 2023
6e3a210
dev
qinwenming Nov 7, 2023
843ba07
dev
qinwenming Nov 21, 2023
4d5192f
dev
qinwenming Dec 26, 2023
0c609da
dev
qinwenming Dec 27, 2023
cc7ad4c
20240319,继续尝试配置raster,还有问题
qinwenming Mar 19, 2024
df23035
20240320,继续配置raster scan,解决了正方形左上角和右下角相对应电机参数的问题,但还有bug
qinwenming Mar 20, 2024
ed51f6d
20240414,将机械手相关配置改回mockup版
qinwenming Apr 14, 2024
223f6b8
20240416,机械手恢复,改为正常版本
qinwenming Apr 16, 2024
325cac6
20240429,尝试解决机械手报错后的转圈问题
qinwenming Apr 29, 2024
1f3c49d
20240430,update
qinwenming Apr 30, 2024
49fbe49
20240507,进一步完善raster scan,待测试是否有bug
qinwenming May 7, 2024
9d6c3a4
开始尝试自动收数据,增加一些dubug信息
qinwenming May 22, 2024
0bd813c
20240604 add datacollection test function
qinwenming Jun 4, 2024
ca1b832
fix bug
qinwenming Sep 10, 2024
fdfca0d
update characteristic
qinwenming Sep 30, 2024
62fc9c1
fix bug
qinwenming Oct 9, 2024
e9abe93
fix bug
qinwenming Oct 9, 2024
188238f
因为前端有报错,衍射仪器相关,修改部分代码,主要是minidiff.xml,修复报错
floodfighter Oct 17, 2024
f4a72c5
在分析bug,
floodfighter Oct 23, 2024
32ab737
注释调导致
floodfighter Oct 23, 2024
da6626f
20241025,本周哦调试结束
floodfighter Oct 25, 2024
d81d2a7
20241028, 将getsamplelist from sc 的效果从展示列表改成了显示文字
floodfighter Oct 28, 2024
2db33c9
20241028, 先改回显示原5*16列表进行调试,初步实现了通过输入数字来添加到样品列表,但是还没有先约束限制用户输入内容固定为两个两位数字
floodfighter Oct 28, 2024
0306553
save for 20241029
floodfighter Oct 29, 2024
78faed2
save for 20241104
floodfighter Nov 4, 2024
0368359
save for update
floodfighter Nov 15, 2024
d580742
save for update, 可以显示是否点击过samplelist
floodfighter Nov 27, 2024
7d95553
save for update, unmount功能写好
floodfighter Nov 28, 2024
3a0b582
save for update
floodfighter Nov 29, 2024
d547ab0
save for update
floodfighter Dec 6, 2024
4ed9281
save for update,ui 完善
floodfighter Dec 10, 2024
4176352
save for update,ui输入框的默认值完善
floodfighter Dec 12, 2024
a1ef99d
save for update,ui输入框的默认值继续完善,四个基本参数可从config读取
floodfighter Dec 16, 2024
c71985e
save for update
floodfighter Dec 16, 2024
e38b12f
save for update,继续开发ui表格界面
floodfighter Dec 24, 2024
5045b78
save for update,继续开发ui表格界面,注释上一个还未完成导致报错的函数
floodfighter Dec 24, 2024
a29e066
save for update,继续开发ui表格界面,默认值基本搞定
floodfighter Dec 25, 2024
5c23571
注释掉写入探测器epics的电脑日期
qinwenming Jan 4, 2025
09afff7
save for update,继续开发ui表格界面,表格的输入,和验证完成
floodfighter Jan 17, 2025
b6d6147
Merge remote-tracking branch 'gitee/office_test' into flex_test
qinwenming Feb 7, 2025
f861816
make the original form value can be synchronized with the new form
qinwenming Feb 8, 2025
24de8ff
注释掉一些标志文字,和samplelist的ui显示
qinwenming Feb 8, 2025
d9e9f43
fix bug of taskData parameters not exists when no sample mounted
qinwenming Feb 8, 2025
3e20f6e
save the update
qinwenming Feb 8, 2025
f699bd4
注释掉please closelid first相关功能,并修复无法2d-point collection的bug
qinwenming Feb 20, 2025
d228c3f
save
qinwenming Feb 26, 2025
b231c9a
save
qinwenming Feb 27, 2025
4ef9c1f
update paging function
qinwenming Mar 1, 2025
b66169a
comment the powerOn powerOff command
qinwenming Mar 2, 2025
80267fb
save
qinwenming Mar 2, 2025
7f735e9
读取status 和samplePollLN2Level
qinwenming Mar 2, 2025
3ac6512
从18更新代码,2d point收集,可以保存centring坐标功能
qinwenming Mar 4, 2025
42d2ec3
更新输入,pin可以为1 or 01
qinwenming Mar 4, 2025
15d6d1c
和18一样,解决md2电机跳动问题
qinwenming Mar 10, 2025
9801111
修复手动上样,电机default value,pin的值为Null的问题
qinwenming Mar 11, 2025
56e1594
1、成功通过前端按钮直接生成原先3-click才会产生的point
qinwenming Mar 12, 2025
72314cd
1、data collection test 也添加save centring position 按键
qinwenming Mar 12, 2025
910f318
1、data collection test 也添加save centring position 按键
qinwenming Mar 12, 2025
9faaf73
update
qinwenming Mar 12, 2025
0a627ff
commit new direct collect button,and add time sleep
qinwenming Mar 16, 2025
addc45f
save,set taskform.sampleIds
qinwenming Mar 16, 2025
5f7b273
save for update
qinwenming Mar 16, 2025
aa7fa89
机械手上样,quickdatacollection初步成功
qinwenming Mar 16, 2025
f48869f
添加功能,机械手上的样品可以quick mount,test,无效化next sample按键,
qinwenming Mar 16, 2025
f638b56
尝试添加plate静态页面
qinwenming Mar 18, 2025
3aab28b
静态表格写好,没有前后端连接
qinwenming Mar 18, 2025
71e150f
添加quickmount组件到plate页面
qinwenming Mar 18, 2025
76fd1d4
纠正上一次提交错误,添加quickmount组件到plate页面
qinwenming Mar 18, 2025
3d96bc3
添加后端plate文件
qinwenming Mar 18, 2025
5cc277b
plate类实时读取current plate location并改变上样sample(模拟)
qinwenming Mar 18, 2025
e827c23
创建按键,显示是否为plate mode 模式,并可以点击开启关闭plate 模式,当开启plate模式时,机械手的sc的两个状态及mai…
qinwenming Mar 18, 2025
2d20776
初步测试
qinwenming Mar 18, 2025
566df69
初步解决010问题,plate页面删除quickmount组件
qinwenming Mar 20, 2025
6b360b0
修复bug
qinwenming Mar 20, 2025
6ed35a4
修复收集会自动改变能量bug
qinwenming Mar 20, 2025
5e1829b
增加了MD2S衍射仪REX冷头的切换功能
qinwenming Apr 23, 2025
2495937
20250828
qinwenming Aug 28, 2025
84b6867
20250903
qinwenming Sep 3, 2025
eeb2786
track all
qinwenming Sep 4, 2025
4730183
删除了以前的build的文件,重新生成新的build文件
qinwenming Sep 5, 2025
c3d1f86
SSRF BL19U1 Beanline
qinwenming Sep 8, 2025
267cf88
完成自动化探测器收集部分,解决路径不对的问题
qinwenming Sep 18, 2025
d7dce49
20250925
qinwenming Sep 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions mxcube3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
from gevent import monkey
#monkey.patch_all(thread=False)
monkey.patch_all()

import argparse
import mock
import os
import redis
import sys
import traceback

from gevent import monkey
monkey.patch_all(thread=False)

#monkey.patch_all()
from mxcube3.server import Server
from mxcube3.app import MXCUBEApplication
from mxcube3.config import Config
Expand All @@ -26,7 +28,7 @@ def parse_args():
os.path.join(os.path.dirname(__file__), os.pardir),
"test/HardwareObjectsMockup.xml/",
)

#XML_DIR = "/home/mxcube19u1/mxcube/mxcubecore/mxcubecore/configuration"
opt_parser = argparse.ArgumentParser(
description="mxcube-web Backend server command line utility."
)
Expand All @@ -45,6 +47,7 @@ def parse_args():
dest="static_folder",
help="Static folder",
default=f"{os.getcwd()}ui/build",
#default=f"/home/mxcube19u1/mxcube/mxcube3/ui/build",
)

opt_parser.add_argument(
Expand Down Expand Up @@ -77,7 +80,7 @@ def parse_args():
action="store_true",
dest="allow_remote",
help="Enable remote access",
default=False,
default=True,
)

opt_parser.add_argument(
Expand All @@ -91,7 +94,6 @@ def parse_args():

return opt_parser.parse_args()


def main(test=False):
global mxcube
global server
Expand Down
17 changes: 11 additions & 6 deletions mxcube3/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ def adapt_hardware_objects(app):
# Go through all hardware objects exposed by mxcubecore
# hardware repository set id to username if its deinfed
# use the name otherwise (file name without extension)
# if ho_name == "dtox" or "tox" in ho_name:
# ho_name = "/dtox"
ho = MXCUBECore.hwr.get_hardware_object(ho_name)

if not ho:
Expand All @@ -152,7 +154,8 @@ def adapt_hardware_objects(app):
# Try to use the interface exposed by abstract classes in mxcubecore to adapt
# the object
adapter_cls = get_adapter_cls_from_hardware_object(ho)

if adapter_cls is None:
print("==== adapter_cls is None! ho is: ", ho_name)
if adapter_cls:
try:
adapter_instance = adapter_cls(ho, _id, app, **dict(adapter_config))
Expand Down Expand Up @@ -211,8 +214,8 @@ class MXCUBEApplication:
USERS = {}

# Path to video device (i.e. /dev/videoX)
VIDEO_FORMAT = "MPEG1"

#VIDEO_FORMAT = "MPEG1"
VIDEO_FORMAT = "JPEG"
# Contains the complete client side ui state, managed up state_storage.py
UI_STATE = dict()
TEMP_DISABLED = []
Expand All @@ -227,7 +230,8 @@ class MXCUBEApplication:

# Enable automatic Mountie of sample when queue executed in
# "automatic/pipeline" mode
AUTO_MOUNT_SAMPLE = False
# AUTO_MOUNT_SAMPLE = False
AUTO_MOUNT_SAMPLE = True

# Automatically add and execute diffraction plans coming from
# characterizations
Expand Down Expand Up @@ -298,11 +302,12 @@ def init_sample_video(format):
:return: None
"""
try:
HWR.beamline.sample_view.camera.start_streaming(format)
#HWR.beamline.sample_view.camera.start_streaming(format)
HWR.beamline.sample_view.camera.start_streaming()
except Exception as ex:
msg = "Could not initialize video, error was: "
msg += str(ex)
logging.getLogger("HWR").info(msg)
logging.getLogger("HWR").error(msg)

@staticmethod
def init_signal_handlers():
Expand Down
Empty file.
83 changes: 83 additions & 0 deletions mxcube3/core/adapter (copy)/actuator_adapter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
from mxcube3.core.adapter.adapter_base import ActuatorAdapterBase
from mxcube3.core.util.adapterutils import export
from mxcube3.core.util.networkutils import RateLimited

from mxcube3.core.models.adaptermodels import (
HOActuatorValueChangeModel,
FloatValueModel,
)


class ActuatorAdapter(ActuatorAdapterBase):
"""
Adapter for Energy Hardware Object, a web socket is used to communicate
information on longer running processes.
"""

def __init__(self, ho, *args, **kwargs):
"""
Args:
(object): Hardware object.
"""
super(ActuatorAdapter, self).__init__(ho, *args, **kwargs)
self._event_rate = 4

@RateLimited(self._event_rate)
def _vc(value, **kwargs):
self.value_change(value, **kwargs)

self._vc = _vc

try:
ho.connect("valueChanged", self._value_change)
ho.connect("stateChanged", self.state_change)
except Exception:
pass

def _value_change(self, *args, **kwargs):
self._vc(*args, **kwargs)

def _set_value(self, value: HOActuatorValueChangeModel):
"""
Execute the sequence to set the value.
Args:
value (float): Target energy [keV].
Returns:
(float as str): The actual value set.
Raises:
ValueError: Value not valid or attemp to set a non-tunable energy.
RuntimeError: Timeout while setting the value.
StopItteration: When a value change was interrupted (abort/cancel).
"""
try:
self._ho.set_value(float(value.value))
except Exception:
raise

@export
def _get_value(self) -> FloatValueModel:
"""
Read the energy.
Returns:
(float as str): Energy [keV].
Raises:
ValueError: When value for any reason can't be retrieved.
"""
try:
return FloatValueModel(**{"value": self._ho.get_value()})
except (AttributeError, TypeError):
raise ValueError("Could not get value")

def stop(self):
"""
Stop the execution.
"""
self._ho.abort()

def read_only(self):
"""
Check if the energy is tunable or not.
Retuns:
(bool): True if tunable, False if not.
"""
return self._ho.read_only
Loading