B3: HostHandler RCMD/alarm/recipe/terminal/job senders
Fleshes out the host-side message surface so the demo client app no
longer has to inline message construction. Senders added (each is a
one-line wrapper over the codegen builders + Connection::send_request):
Remote command: S2F41/F42, S2F49/F50
Alarm management: S5F3/F4 enable, S5F5/F6 list, S5F7/F8 list-enabled,
S5F13/F14 recover, S5F17/F18 recover-abort
Process programs: S7F3/F4 send, S7F5/F6 request, S7F19/F20 EPPD
Spool: S6F23/F24
Terminal: S10F1/F2 single, S10F5/F6 multi
E40 Process Jobs: S16F11/F12 create, S16F5/F6 command, S16F13/F14 dequeue
E94 Control Jobs: S14F9/F10 create, S14F11/F12 delete, S16F27/F28 command
CommandParameter is reused from store/host_commands.hpp rather than
inventing a parallel ParamPair — host and equipment talk in the same
struct now.
Closes the outbound side of the host-mode menu. The remaining piece
is an integration test that drives this against the equipment server
end-to-end (B4).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,10 @@
|
||||
#include <vector>
|
||||
|
||||
#include "secsgem/gem/store/event_reports.hpp"
|
||||
#include "secsgem/gem/store/host_commands.hpp" // CommandParameter
|
||||
#include "secsgem/gem/store/spool.hpp" // SpoolRequestCode
|
||||
#include "secsgem/hsms/connection.hpp"
|
||||
#include "secsgem/secs2/item.hpp"
|
||||
#include "secsgem/secs2/message.hpp"
|
||||
|
||||
// GEM host-side message handler. Wraps an HSMS Connection (Active mode)
|
||||
@@ -96,6 +99,70 @@ class HostHandler : public std::enable_shared_from_this<HostHandler> {
|
||||
void send_enable_events(bool enable, const std::vector<uint32_t>& ceids,
|
||||
ReplyHandler cb);
|
||||
|
||||
// ---- Remote command senders (B3) --------------------------------------
|
||||
|
||||
// S2F41/F42 Host Command. `params` reuses CommandParameter from
|
||||
// host_commands.hpp so host- and equipment-side code share the type.
|
||||
void send_remote_command(const std::string& rcmd,
|
||||
const std::vector<CommandParameter>& params,
|
||||
ReplyHandler cb);
|
||||
|
||||
// S2F49/F50 Enhanced Host Command (OBJSPEC-scoped + per-CP CPACK/CEPACK).
|
||||
void send_enhanced_remote_command(uint32_t dataid, const std::string& objspec,
|
||||
const std::string& rcmd,
|
||||
const std::vector<CommandParameter>& params,
|
||||
ReplyHandler cb);
|
||||
|
||||
// ---- Alarm management (B3) --------------------------------------------
|
||||
|
||||
// S5F3/F4 Enable/Disable Alarm. Spec uses ALED bit-7 to encode enable.
|
||||
void send_enable_alarm(uint32_t alid, bool enable, ReplyHandler cb);
|
||||
void send_list_alarms(const std::vector<uint32_t>& alids, ReplyHandler cb); // S5F5/F6
|
||||
void send_list_enabled_alarms(ReplyHandler cb); // S5F7/F8
|
||||
|
||||
// S5F13/F14 Exception Recover Request. Asks the equipment to perform
|
||||
// the named recovery action against the previously-posted EXID.
|
||||
void send_exception_recover(uint32_t exid, const std::string& exrecvra,
|
||||
ReplyHandler cb);
|
||||
void send_exception_recover_abort(uint32_t exid, ReplyHandler cb); // S5F17/F18
|
||||
|
||||
// ---- Process program transfer (B3) ------------------------------------
|
||||
|
||||
void send_request_eppd(ReplyHandler cb); // S7F19/F20
|
||||
void send_pp_data(const std::string& ppid, const std::string& body,
|
||||
ReplyHandler cb); // S7F3/F4
|
||||
void send_request_pp(const std::string& ppid, ReplyHandler cb); // S7F5/F6
|
||||
|
||||
// ---- Spool (B3) -------------------------------------------------------
|
||||
|
||||
void send_request_spool(SpoolRequestCode code, ReplyHandler cb); // S6F23/F24
|
||||
|
||||
// ---- Terminal (B3) ----------------------------------------------------
|
||||
|
||||
void send_terminal_display(uint32_t tid, const std::string& text,
|
||||
ReplyHandler cb); // S10F1/F2
|
||||
void send_terminal_display_multi(uint32_t tid,
|
||||
const std::vector<std::string>& lines,
|
||||
ReplyHandler cb); // S10F5/F6
|
||||
|
||||
// ---- E40 Process Jobs (B3) --------------------------------------------
|
||||
|
||||
void send_create_process_job(const std::string& prjobid, const std::string& ppid,
|
||||
const std::vector<std::string>& mtrloutspec,
|
||||
ReplyHandler cb); // S16F11/F12
|
||||
void send_pr_job_command(const std::string& prjobid, const std::string& prcmd,
|
||||
ReplyHandler cb); // S16F5/F6
|
||||
void send_pr_job_dequeue(const std::string& prjobid, ReplyHandler cb); // S16F13/F14
|
||||
|
||||
// ---- E94 Control Jobs (B3) --------------------------------------------
|
||||
|
||||
void send_create_control_job(const std::string& ctljobid,
|
||||
const std::vector<std::string>& prjobids,
|
||||
ReplyHandler cb); // S14F9/F10
|
||||
void send_delete_control_job(const std::string& ctljobid, ReplyHandler cb); // S14F11/F12
|
||||
void send_cj_command(const std::string& ctljobid, const std::string& ctljobcmd,
|
||||
ReplyHandler cb); // S16F27/F28
|
||||
|
||||
// ---- Low-level: forward a primary verbatim ----------------------------
|
||||
void send_request(secs2::Message msg, ReplyHandler cb);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user