Skip to content

Commit 66a88b5

Browse files
committed
fix off bug
1 parent e9acc0e commit 66a88b5

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

dp100/DP100API.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import os
44
import sys
5+
import time
56
from platform import architecture
67

78
from loguru import logger
@@ -263,8 +264,15 @@ def set_output(
263264
with self._api_lock:
264265
ret = self._api.OpenOut(*args)
265266
else:
267+
close_args = [
268+
Byte(preset),
269+
UShort(0),
270+
UShort(0),
271+
]
266272
with self._api_lock:
267-
ret = self._api.CloseOut(*args)
273+
ret = self._api.CloseOut(*close_args)
274+
time.sleep(0.04)
275+
ret &= self._api.CloseOut(*args)
268276
logger.debug(f"Set output: {output}, {v_set}, {i_set}, {preset} -> {ret}")
269277
assert ret, "Failed to set output status"
270278

gui_source/gui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
ICON_PATH = os.path.join(ABS_PATH, "icon.ico")
8686
FONT_PATH = os.path.join(ABS_PATH, "SarasaFixedSC-SemiBold.ttf")
8787
BAT_EXAMPLE_PATH = os.path.join(ABS_PATH, "Li-ion.csv")
88-
VERSION = "Ver2.0.0"
88+
VERSION = "Ver2.0.1"
8989
qdarktheme.enable_hi_dpi()
9090
app = QtWidgets.QApplication(sys.argv)
9191

gui_source/update_checker.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,5 @@ def compare_versions(version1: str, version2: str) -> int:
115115
print(f"Update URL: {url}")
116116
else:
117117
print("Failed to check for updates")
118+
119+
print(compare_versions("V2.0.0", "V2.0.1"))

0 commit comments

Comments
 (0)