packServer/desktop/Services/Scan/ScanDeviceKind.cs
liufumingren f8aa4c4899 feat(工作台): 成员扫码登入、面单摄像头与虚拟通道
- 工作台成员扫码登入:workstation_login_records 记录谁在什么时候登入/下线了哪台工作台,
  超时(团购 1h / 散单 30min)由 schedule/workstation_idle_offline 自动下线;
  运单查询的 packers 取当时的登入成员
- 面单摄像头识别:workstation_cameras.is_label_camera + service/label_scan 下发本机该跑的识别配置,
  设备端(桌面端 LabelScan 工作线程)按配置做面单识别并上报
- 虚拟通道 CAM-<工作台id>:工作台没接扫码枪时,面单摄像头那一路顶替扫码枪上报,records 规则按 ws_type 区分
- 桌面端:新增 LabelScanMonitor/LabelScanWorker/ScanDeviceKind 与面单预览页,扫描通道支持改名,静默窗口 5s

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-29 17:19:24 +08:00

31 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
namespace YuncangTrace.LocalService.Services.Scan;
/// <summary>
/// 扫码设备类型判定。
///
/// <c>AndroidStation</c> 是我们自己的安卓扫码端(UDP 发现应答的型号固定为
/// <see cref="AndroidStation"/>)。桌面端识别到条码后,只有这类通道**需要**收到
/// 「扫码成功」通知(它会在现有 TCP 连接上解析控制帧并播报语音)。
/// 网口扫码枪/中控盒没有语音能力,收到通知也无事可做,而且下行字节会被透传到枪的串口,
/// 所以一律不发。
///
/// ⚠️ 这条判定**只影响通知**,不影响扫码记录:记录一律先写进待上报队列,
/// 与通道类型、设备是否在线都无关。
/// </summary>
public static class ScanDeviceKind
{
/// <summary>安卓扫码端的型号(见 AndroidStation 的 StationIdentity.MODEL)</summary>
public const string AndroidStation = "AndroidStation";
/// <summary>是否安卓扫码通道(型号大小写不敏感)</summary>
public static bool IsAndroidStation(string? model)
=> !string.IsNullOrWhiteSpace(model)
&& model.Trim().Equals(AndroidStation, StringComparison.OrdinalIgnoreCase);
/// <summary>界面上的类型标注</summary>
public static string Describe(string? model)
=> IsAndroidStation(model) ? "安卓扫描通道" : "扫码枪";
}