Add makefile

Signed-off-by: Terekhin Alexander <alex@bearns.me>
This commit is contained in:
2025-04-18 14:16:40 +03:00
parent ca8b0228e3
commit e8533d4186
7 changed files with 42 additions and 14 deletions
+1
View File
@@ -58,6 +58,7 @@ func main() {
{Id: yabl.CanIdLogicEnergyMode, Mask: 0xFFF},
{Id: yabl.CanIdLogicErrors, Mask: 0xFFF},
{Id: yabl.CanIdLogicWorkingMode, Mask: 0xFFF},
{Id: yabl.CanIdLogicCommunicationMode, Mask: 0xFFF},
{Id: yabl.CanIdPeripheryState, Mask: 0xFFF},
{Id: yabl.CanIdPeripheryInfo, Mask: 0xFFF},
{Id: yabl.CanIdPeripheryDebug, Mask: 0xFFF},
+1 -1
View File
@@ -1,6 +1,6 @@
module cli-mon
go 1.19
go 1.24
require (
github.com/gdamore/tcell/v2 v2.6.0
+10 -8
View File
@@ -16,14 +16,16 @@ var pu = []key{
{yabl.PPuPeriphery, yabl.FIsolationState, 11},
{yabl.PPuPeriphery, yabl.FChargingAllowed, 12},
{yabl.PPuPeriphery, yabl.FPwmEnabled, 13},
{yabl.PPuPeriphery, yabl.FCpLineVoltage, 14},
{yabl.PSeccTargetEnergy, yabl.FTargetBatteryVoltage, 15},
{yabl.PSeccTargetEnergy, yabl.FTargetGoalVoltage, 16},
{yabl.PCpuEnergySettings, yabl.FPowerMax, 17},
{yabl.PCpuEnergySettings, yabl.FCurrentMax, 18},
{yabl.PCpuEnergySettings, yabl.FVoltageMax, 19},
{yabl.PPuDebug, yabl.FDebugModeOn, 20},
{yabl.PPuErrors, yabl.FBoardReady, 21},
{yabl.PLogicCommunicationMode, yabl.FReadyToHlc, 14},
{yabl.PSeccTargetEnergy, yabl.FAllowDynamicDistribution, 15},
{yabl.PPuPeriphery, yabl.FCpLineVoltage, 16},
{yabl.PSeccTargetEnergy, yabl.FTargetBatteryVoltage, 17},
{yabl.PSeccTargetEnergy, yabl.FTargetGoalVoltage, 18},
{yabl.PCpuEnergySettings, yabl.FPowerMax, 19},
{yabl.PCpuEnergySettings, yabl.FCurrentMax, 20},
{yabl.PCpuEnergySettings, yabl.FVoltageMax, 21},
{yabl.PPuDebug, yabl.FDebugModeOn, 22},
{yabl.PPuErrors, yabl.FBoardReady, 23},
}
var pu_errors = []key{
+6 -1
View File
@@ -29,6 +29,7 @@ const (
CanIdLogicEnergyMode = 0x047
CanIdLogicErrors = 0x048
CanIdLogicWorkingMode = 0x049
CanIdLogicCommunicationMode = 0x4A
CanIdPeripheryState = 0x067
CanIdPeripheryInfo = 0x068
CanIdPeripheryDebug = 0x06C
@@ -97,6 +98,7 @@ const (
PLogicEnergyMode AName = "LogicEnergyMode"
PLogicErrors AName = "LogicErrors"
PLogicWorkingMode AName = "LogicWorkingMode"
PLogicCommunicationMode AName = "LogicCommunicationMode"
PContactorInternalState AName = "ContactorInternalState"
PContactorInternalErrors AName = "ContactorInternalErrors"
PContactorsInternalForce AName = "ContactorsInternalForce"
@@ -153,6 +155,8 @@ const (
FVoltageMax FName = "VoltageMax"
FPowerMax FName = "PowerMax"
FReadyToHlc FName = "ReadyToHlc"
// FBoardReady FName = "BoardReady"
FNotReadySettings FName = "NotReadySettings"
@@ -232,7 +236,8 @@ const (
// FTargetBatteryVoltage FName = "TargetBatteryVoltage"
// FTargetGoalVoltage FName = "TargetGoalVoltage"
FTargetCurrent FName = "TargetCurrent"
FTargetCurrent FName = "TargetCurrent"
FAllowDynamicDistribution FName = "AllowDynamicDistribution"
// FBoardReady FName = "BoardReady"
+13
View File
@@ -187,6 +187,19 @@ func (c *converter) initialize() {
}
}
for i := uint(0); i <= CONNECTOR_COUNT; i++ {
key := key{CanIdLogicCommunicationMode, i}
lcm := &LogicCommunicationMode{unit: unit(i)}
c.LogicCommunicationMode[i] = lcm
fields = entityToFields(lcm)
c.protocolMap[key] = &action{
fields: fields,
interval: 1000,
name: PLogicCommunicationMode,
object: lcm,
}
}
for i := uint(0); i < CONTACTOR_MAX; i++ {
key := key{CanIdContIntState, i}
cis := &ContactorInternalState{unit: unit(i)}
+1
View File
@@ -49,6 +49,7 @@ type converter struct {
logicEnergyMode [CONNECTOR_MAX]*LogicEnergyMode
logicErrorsInstance *LogicErrors
logicWorkingMode [CONNECTOR_MAX]*LogicWorkingMode
LogicCommunicationMode [CONNECTOR_MAX]*LogicCommunicationMode
contactorInternalStateArray [CONTACTOR_MAX]*ContactorInternalState
contactorInternalErrorsInstance *ContactorInternalErrors
contactorsInternalForce *ContactorsInternalForce
+10 -4
View File
@@ -132,6 +132,11 @@ type LogicWorkingMode struct {
Availability *BooleanType
}
type LogicCommunicationMode struct {
unit
ReadyToHlc *BooleanType
}
type CpuPresentEnergy struct {
unit
PowerDirectionMode *V2GModeType
@@ -213,10 +218,11 @@ type PuDebug struct {
type SeccTargetEnergy struct {
unit
TargetChargingAllow *BooleanType
TargetBatteryVoltage *Voltage11BitType
TargetGoalVoltage *Voltage11BitType
TargetCurrent *Current10BitType
TargetChargingAllow *BooleanType
TargetBatteryVoltage *Voltage11BitType
TargetGoalVoltage *Voltage11BitType
TargetCurrent *Current10BitType
AllowDynamicDistribution *BooleanType
}
type SeccErrors struct {