| | |
| | | state.nextCollectorId(), tombstones)); |
| | | } |
| | | |
| | | /** 使用现场确认的新威检测柜 profile 新增设备,型号之外的控制语义仍保持只读。 */ |
| | | /** 按预设新威型号元数据新增模拟设备;真实协议和拓扑仍待现场验证。 */ |
| | | public synchronized int addNewareDevice(String ip, String model) |
| | | { |
| | | BtsDeviceProfile profile = newareProfile(model); |
| | |
| | | persist(next); |
| | | } |
| | | |
| | | /** 配置一个稳定 S 通道的固定或动态演示指标。 */ |
| | | /** 保存稳定 S 通道的固定测量值及自定义指标,下一次请求时形成观测。 */ |
| | | public synchronized void configureCollectorChannel(int collectorId, String channelCode, |
| | | List<CollectorMetricState> metrics) |
| | | { |
| | |
| | | return sequence; |
| | | } |
| | | |
| | | /** 返回控制页需要的运行状态快照。 */ |
| | | /** 返回模拟器配置、当前状态和最近请求,不触发新的设备观测。 */ |
| | | public synchronized StateSnapshot snapshot() |
| | | { |
| | | List<DeviceSnapshot> deviceSnapshots = state.devices().stream() |
| | |
| | | |
| | | private void persist(SimulatorState nextState) |
| | | { |
| | | // 写穿失败时保留当前内存副本,避免控制页显示未持久化状态。 |
| | | // 写穿失败时保留当前内存副本,避免模拟器页面显示未持久化状态。 |
| | | SimulatorState configured = new SimulatorState(nextState.version(), nextState.devices(), nextState.collectors(), |
| | | nextState.nextDeviceId(), nextState.nextCollectorId(), nextState.tombstones(), |
| | | state.softwareAccessible(), state.observationSequence()); |