E40 Process Jobs + E94 Control Jobs + E30 communication state
GEM300 layer: SEMI E40-0705 Process Job and E94-0705 Control Job state machines, plus the E30 §6.1 communication-state machine that sits between HSMS SELECT and full GEM communication. Data-driven via data/process_job_state.yaml and data/control_job_state.yaml, mirroring the existing control_state.yaml pattern. Wire coverage: S14F9/F10 CreateObject (CJ) host -> equipment S14F11/F12 DeleteObject (CJ) host -> equipment S16F5/F6 PRJobCommand host -> equipment S16F9 PRJobAlert equipment -> host S16F11/F12 PRJobCreate (simplified body) host -> equipment S16F13/F14 PRJobDequeue host -> equipment S16F27/F28 CJobCommand host -> equipment Process Job FSM exposes 8 states matching PRJOBSTATE bytes (E40 §10.3.2); HOQ is reorder-aware (move-to-head against an insertion-order vector); Stop/Abort on a Queued PJ routes through ABORTING so the host observes PRJOBSTATE=7 on the wire (§6.3); alert_enabled is settable per-PJ for PRALERT control; FSM dispatches through ProcessJobStore::on_change_ dynamically so a late set_state_change_handler() reaches existing PJs. Hardening: loader rejects NoState (sentinel) as initial/from/to and rejects `on: created` rows; static_asserts pin enum values to wire bytes; ProcessJobStore is non-movable to keep the per-PJ this-capture safe. Server simulator cascades the full CJ -> PJ lifecycle on CJSTART so the wire trace exercises every legal state. CEIDs 400/401 fire on CJ state changes via the existing event-report pipeline. Tests: 60+ new assertions across test_process_jobs, test_control_jobs, test_communication_state, test_hsms_connection, plus loader and messages round-trip coverage. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -25,11 +25,13 @@ struct EquipmentConstant {
|
||||
std::string max_str;
|
||||
};
|
||||
|
||||
// S2F16 EAC per SEMI E5: 0=OK, 1=one or more constants does not exist,
|
||||
// 2=busy, 3=one or more values out of range. Values 4-127 are reserved.
|
||||
enum class EquipmentAck : uint8_t {
|
||||
Accept = 0,
|
||||
Denied_UnknownEcid = 1,
|
||||
Denied_Busy = 3,
|
||||
Denied_OutOfRange = 4,
|
||||
Denied_Busy = 2,
|
||||
Denied_OutOfRange = 3,
|
||||
};
|
||||
|
||||
class EquipmentConstantStore {
|
||||
@@ -82,17 +84,22 @@ class EquipmentConstantStore {
|
||||
}
|
||||
|
||||
static bool extract_number(const s2::Item& item, double& out) {
|
||||
auto first = [&](const auto& v) -> bool {
|
||||
if (v.empty()) return false;
|
||||
out = static_cast<double>(v.front());
|
||||
return true;
|
||||
};
|
||||
switch (item.format()) {
|
||||
case s2::Format::U1: out = std::get<std::vector<uint8_t>>(item.storage()).front(); return true;
|
||||
case s2::Format::U2: out = std::get<std::vector<uint16_t>>(item.storage()).front(); return true;
|
||||
case s2::Format::U4: out = std::get<std::vector<uint32_t>>(item.storage()).front(); return true;
|
||||
case s2::Format::U8: out = static_cast<double>(std::get<std::vector<uint64_t>>(item.storage()).front()); return true;
|
||||
case s2::Format::I1: out = std::get<std::vector<int8_t>>(item.storage()).front(); return true;
|
||||
case s2::Format::I2: out = std::get<std::vector<int16_t>>(item.storage()).front(); return true;
|
||||
case s2::Format::I4: out = std::get<std::vector<int32_t>>(item.storage()).front(); return true;
|
||||
case s2::Format::I8: out = static_cast<double>(std::get<std::vector<int64_t>>(item.storage()).front()); return true;
|
||||
case s2::Format::F4: out = std::get<std::vector<float>>(item.storage()).front(); return true;
|
||||
case s2::Format::F8: out = std::get<std::vector<double>>(item.storage()).front(); return true;
|
||||
case s2::Format::U1: return first(std::get<std::vector<uint8_t>>(item.storage()));
|
||||
case s2::Format::U2: return first(std::get<std::vector<uint16_t>>(item.storage()));
|
||||
case s2::Format::U4: return first(std::get<std::vector<uint32_t>>(item.storage()));
|
||||
case s2::Format::U8: return first(std::get<std::vector<uint64_t>>(item.storage()));
|
||||
case s2::Format::I1: return first(std::get<std::vector<int8_t>>(item.storage()));
|
||||
case s2::Format::I2: return first(std::get<std::vector<int16_t>>(item.storage()));
|
||||
case s2::Format::I4: return first(std::get<std::vector<int32_t>>(item.storage()));
|
||||
case s2::Format::I8: return first(std::get<std::vector<int64_t>>(item.storage()));
|
||||
case s2::Format::F4: return first(std::get<std::vector<float>>(item.storage()));
|
||||
case s2::Format::F8: return first(std::get<std::vector<double>>(item.storage()));
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user