Files
douyi_guaji_main/tools/test_swipe_switch.py
T
Your Name dcded08796 feat: enhance swipe and back navigation logic
- Adjusted configuration for reset after swipes to 10 seconds and added action to go back.
- Updated flow control to skip back action if a recent reset was triggered within 5 seconds.
- Implemented a mechanism to enable back navigation when consecutive misses reach a threshold.
- Added GUI options to enable or disable back navigation on misses, ensuring consistency with user settings.
- Introduced new diagnostic tools for runtime flag checks and screenshot diagnostics.
- Created PowerShell scripts for restoring Start Menu shortcuts and performing system health checks.
- Added tests for swipe operations and back navigation to validate new logic.
2026-01-06 16:55:00 +08:00

24 lines
728 B
Python

from douyin.handlers import douyin_swipe_ops
from douyin.core.douyin_fudai import fudai_analyse
class DummyOp:
def _adb(self):
# Return path to non-existing adb to force fallback
return "adb"
def swipe(self, device_id, sx, sy, ex, ey, duration_ms):
print(f"DummyOp.swipe called device={device_id} from ({sx},{sy}) to ({ex},{ey}) duration={duration_ms}")
def simulate_once(i:int):
a = fudai_analyse()
a.operation = DummyOp()
a.device_id = f"DUMMY{i}"
a.resolution_ratio_x = 1080
a.resolution_ratio_y = 2400
print(f"--- simulate swipe #{i} ---")
douyin_swipe_ops.swipe_up_switch_live(a)
if __name__ == '__main__':
for i in range(1, 11):
simulate_once(i)