/****************************************************************/ /* NAME: CCU_Info */ /* FILE: CCU_Info.cpp */ /****************************************************************/ #include #include #include "CCU_Info.h" #include "ColorParse.h" #include "ReleaseInfo.h" using namespace std; void showSynopsis() { blk("SYNOPSIS: "); blk("------------------------------------ "); blk(" The pCCU application is the composite controller (CCU) "); blk(" gateway between the fuel cell (FC) system and pPowerManger. "); blk(" It receives FC status, integrates & forwards to pPowerManger,"); blk(" maps pPowerManger commands to FC operations, receives CAN "); blk(" bus BMS battery frames via pCanBridge (CAN_0x* MOOS msgs), "); blk(" bridges power-distribution (配电) frames between pPowerManger"); blk(" and a real CCU device (rcu link), stores data in SQLite and "); blk(" provides a web monitoring page. "); blk(" "); } void showHelpAndExit() { blk(" "); blu("=============================================================== "); blu("Usage: pCCU file.moos [OPTIONS] "); blu("=============================================================== "); blk(" "); showSynopsis(); blk(" "); blk("Options: "); mag(" --alias","= "); blk(" Launch pCCU with the given process name "); blk(" rather than pCCU. "); mag(" --example, -e "); blk(" Display example MOOS configuration block. "); mag(" --help, -h "); blk(" Display this help message. "); mag(" --interface, -i "); blk(" Display MOOS publications and subscriptions. "); mag(" --version,-v "); blk(" Display the release version of pCCU. "); blk(" "); blk("Note: If argv[2] does not otherwise match a known option, "); blk(" then it will be interpreted as a run alias. This is "); blk(" to support pAntler launching conventions. "); blk(" "); exit(0); } void showExampleConfigAndExit() { blk(" "); blu("=============================================================== "); blu("pCCU Example MOOS Configuration "); blu("=============================================================== "); blk(" "); blk("ProcessConfig = pCCU "); blk("{ "); blk(" AppTick = 4 "); blk(" CommsTick = 4 "); blk(" "); blk(" fc_local_port = 6000 // FC 状态接收端口 "); blk(" fc_remote_ip = 192.168.1.162 // 燃料电池控制器 IP "); blk(" fc_remote_port = 7000 // FC 控制端口 "); blk(" pm_local_port = 7000 // PM 指令接收端口 "); blk(" pm_remote_ip = 192.168.0.140 // 控制主机 IP "); blk(" pm_remote_port = 5001 // 控制主机接收端口 "); blk(" rcu_enable = true // 是否启用真实CCU配电桥接 "); blk(" rcu_local_port = 7100 // 真实CCU 数据接收端口 "); blk(" rcu_remote_ip = 192.168.0.200 // 真实CCU IP(占位,按实际修改) "); blk(" rcu_remote_port= 7000 // 真实CCU 接收端口 "); blk(" // 锂电池 BMS 走 CAN 总线(经 pCanBridge 的 CAN_0x* 透传) "); blk(" dbpath = pccu_data.db // 数据库路径 "); blk(" logpath = pCCU.log // 日志路径 "); blk(" web_port = 8080 // 网页端口(避开8090/18080) "); blk(" web_enable = true // 是否启用网页 "); blk("} "); blk(" "); exit(0); } void showInterfaceAndExit() { blk(" "); blu("=============================================================== "); blu("pCCU INTERFACE "); blu("=============================================================== "); blk(" "); showSynopsis(); blk(" "); blk("SUBSCRIPTIONS: "); blk("------------------------------------ "); blk(" CAN_0x* = pCanBridge 透传的 CAN 帧(锂电池 BMS) "); blk(" CCU_FC_LINK_STATE = 运行状态字符串 "); blk(" CCU_PM_LINK_STATE = 运行状态字符串 "); blk(" CCU_RCU_LINK_STATE = 运行状态字符串 "); blk(" "); blk("PUBLICATIONS: "); blk("------------------------------------ "); blk(" CCU_FC_LINK_STATE = 运行状态字符串 "); blk(" CCU_PM_LINK_STATE = 运行状态字符串 "); blk(" CCU_RCU_LINK_STATE = 运行状态字符串 "); blk(" "); exit(0); } void showReleaseInfoAndExit() { showReleaseInfo("pCCU", "gpl"); exit(0); }