-
Notifications
You must be signed in to change notification settings - Fork 0
/
dc_message_payload.go
171 lines (150 loc) · 5.3 KB
/
dc_message_payload.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
package models
import "time"
// DcMessagePayload contains the parsed payload of info level messages that have been sent or received by the dc.
type DcMessagePayload struct {
SmcUID string
PodUID string
ServiceLevelID int
Value int
Time time.Time
TimeRange *TimeRange
ConnectOrDisconnectPayload *ConnectOrDisconnectPayload
DLMSLogPayload *DLMSLogPayload
IndexPayload *IndexPayload
GenericIndexProfilePayload *GenericIndexProfilePayload
MessagePayload *MessagePayload
SettingsPayload *SettingsPayload
ServiceLevelPayload *ServiceLevelPayload
SmcAddressPayload *SmcAddressParams
SmcConfigPayload *SmcConfigPayload
PodConfigPayload *PodConfigPayload
ConnectToPLCPayload *ConnectToPLCPayload
StatisticsEntryPayload *StatisticsEntryPayload
ReadIndexLowProfilesEntryPayload *ReadIndexLowProfilesEntryPayload
ReadIndexProfilesEntryPayload *ReadIndexProfilesEntryPayload
}
// ReadIndexLowProfilesEntryPayload contains the parsed --[read index low profiles]-->(SMC) entries.
type ReadIndexLowProfilesEntryPayload struct {
SmcUID string
From time.Time
To time.Time
}
// ReadIndexProfilesEntryPayload contains the parsed <--[read index profiles]--(SMC) entries.
type ReadIndexProfilesEntryPayload struct {
SmcUID string
Count int
}
// StatisticsEntryPayload contains the parsed statistics log entry sent to the SVI.
type StatisticsEntryPayload struct {
Type string
Value float64
Time time.Time
SourceID string
}
// GenericIndexProfilePayload contains the parsed index high/low profile generic payload.
type GenericIndexProfilePayload struct {
CapturePeriod int
CaptureObjects int
}
// ConnectToPLCPayload contains the parsed connect to PLC payload.
type ConnectToPLCPayload struct {
Interface string
DestinationAddress string
}
// SettingsPayload contains the parsed settings payload
// of info level messages that have been sent or received by the dc.
type SettingsPayload struct {
DcUID string
Locality string
Region string
Timezone string
GlobalFtpAddress string
TargetFirmwareVersion string
IndexCollection int
DataPublish int
LastServerCommunicationTime time.Time
DcDistroTargetFirmwareVersion string
LastDcStartTime time.Time // it might be ticks or something (eg. 1591780709)
FrequencyBandChanged bool
FrequencyBandRollBackDone bool
}
// ServiceLevelPayload contains the parsed service level related data
// in info level log entries that describe messages sent or received by the dc.
type ServiceLevelPayload struct {
MeterMode int
StartHourDailyCycle string // eg. 20h
LoadSheddingDailyEnergyBudget int
LocalSheddingDailyEnergyBudget int
MaxActivePower int
InService bool
Name string
HourlyEnergyLimits [24]HourlyEnergyLimit
LocalHourlyEnergyLimits [24]HourlyEnergyLimit
}
// HourlyEnergyLimit contains the value and the hour number of an hourly energy limit.
type HourlyEnergyLimit struct {
HourNumber int
Limit int
}
// SmcConfigPayload contains data related to the configuration of an SMC.
type SmcConfigPayload struct {
CustomerSerialNumber string
PhysicalAddress string
SmcStatus string
CurrentApp1Fw string
CurrentApp2Fw string
CurrentPlcFw string
LastSuccessfulDlmsResponseDate time.Time
NextHop int
}
// MessagePayload contains the parameters of a log entry related to a DC message.
type MessagePayload struct {
Current float64
Total float64
URL string
Topic string
}
// PodConfigPayload contains the parameters of a log entry related to a pod configuration event.
type PodConfigPayload struct {
SerialNumber int
Phase int
PositionInSmc int
SoftwareFirmwareVersion string
}
// TimeRange represents a time range.
type TimeRange struct {
From time.Time
To time.Time
}
// DLMSLogPayload contains data of a log entry related to DLMS Log contents.
type DLMSLogPayload struct {
DLMSRequestTime time.Time
DLMSResponseTime time.Time
DLMSError string
}
// IndexPayload contains data of an index log entry.
type IndexPayload struct {
PreviousTime time.Time // it might be ticks or something (eg. 1591776000)
PreviousValue int
SerialNumber int
}
// ConnectOrDisconnectPayload contains information related to a connect or disconnect event.
type ConnectOrDisconnectPayload struct {
Type int
ClientID string
URL string
Topic string
Timeout int
Connected bool
}
// Calendar contains data related to the calendar of a tariff settings log entry.
type Calendar struct {
CalendarName CalendarName
}
// CalendarName contains data related to the calendar of a tariff settings log entry.
type CalendarName struct {
IsActive bool
SeasonProfile string // for now, the exact type is unknown
WeekProfile string // for now, the exact type is unknown
DayProfile string // for now, the exact type is unknown
}