From fc8d367963a16de61dfbc4a0ff34c78c91ec2cfe Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期五, 05 九月 2025 09:21:28 +0800
Subject: [PATCH] Merge branch 'liuyang' into clh

---
 SourceCode/Bond/Servo/CControlJob.h |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/SourceCode/Bond/Servo/CControlJob.h b/SourceCode/Bond/Servo/CControlJob.h
index a9611a4..8533018 100644
--- a/SourceCode/Bond/Servo/CControlJob.h
+++ b/SourceCode/Bond/Servo/CControlJob.h
@@ -36,6 +36,7 @@
     /// CControlJob:Control Job 管理类
     class CControlJob {
     public:
+        CControlJob();
         explicit CControlJob(std::string cjId);
         explicit CControlJob(CControlJob& src);
 
@@ -44,6 +45,7 @@
         CJState            state()  const noexcept { return m_state; }
         uint8_t            priority() const noexcept { return m_priority; }
         void               setPriority(uint8_t p) noexcept { m_priority = p; }
+        std::string getStateText();
 
         // —— PJ 列表维护(去重)—— //
         bool addPJ(const std::string& pjId);                // 已存在则不重复添加
@@ -53,6 +55,7 @@
         const std::vector<std::string>& pjIds() const noexcept { return m_pjIds; }
         bool setPJs(const std::vector<CProcessJob*>& pjs);
         void clearPJs() { m_pjIds.clear(); }
+        const std::vector<CProcessJob*>& getPjs() { return m_pjs; };
 
         // —— 校验 —— //
         struct ValidationIssue { uint32_t code; std::string text; };
@@ -111,12 +114,18 @@
         static void clampString(std::string& s, size_t maxLen);
         static bool asciiPrintable(const std::string& s);
 
+        static constexpr uint32_t CJ_MAGIC = 0x434A5031; // "CJP1"
+        static constexpr uint16_t CJ_VERSION = 0x0001;
+
+        void serialize(std::ostream& os) const;
+        static bool deserialize(std::istream& is, CControlJob& out, std::string* err = nullptr);
+
     private:
         void markQueued();
         void markStart();
         void markEnd();
 
-    private:
+    protected:
         // —— 标识 & 配置 —— //
         std::string m_cjId;
         uint8_t     m_priority{ 5 }; // 缺省优先级(自定)

--
Gitblit v1.9.3