File tree Expand file tree Collapse file tree 3 files changed +74
-0
lines changed Expand file tree Collapse file tree 3 files changed +74
-0
lines changed Original file line number Diff line number Diff line change @@ -1074,6 +1074,42 @@ namespace Svc {
1074
1074
1075
1075
this ->cmdResponse_out (opCode, cmdSeq, Fw::CmdResponse::OK);
1076
1076
}
1077
+
1078
+ void DpCatalog ::UPDATE_DP_PRIO_cmdHandler (FwOpcodeType opCode,
1079
+ U32 cmdSeq,
1080
+ U32 dir,
1081
+ U32 id,
1082
+ U32 tSec,
1083
+ U32 tSub,
1084
+ U32 prio) {
1085
+
1086
+ // build file name based on the entry to update
1087
+ Fw::FileNameString prioFileName;
1088
+ prioFileName.format (DP_FILENAME_FORMAT,
1089
+ this ->m_directories [dir].toChar (),
1090
+ id,
1091
+ tSec,
1092
+ tSub
1093
+ );
1094
+
1095
+ // check to see if file exists
1096
+ bool exists = Os::FileSystem::exists (
1097
+ prioFileName.toChar ());
1098
+
1099
+ if (not exists) {
1100
+ // If it doesn't exist, don't continue.
1101
+ // Don't fail the command so a long list of attempts to
1102
+ // do DP maintenance fail.
1103
+ this ->log_WARNING_LO_DpUpdateNoFileError (prioFileName);
1104
+ } else {
1105
+ // if the file exists, delete it from the tree and reinsert
1106
+ // it with the new priority
1107
+
1108
+ }
1109
+
1110
+ this ->cmdResponse_out (opCode, cmdSeq, Fw::CmdResponse::OK);
1111
+ }
1112
+
1077
1113
1078
1114
1079
1115
Original file line number Diff line number Diff line change @@ -99,6 +99,15 @@ module Svc {
99
99
) \
100
100
opcode 4
101
101
102
+ @ update existing DP priority
103
+ async command UPDATE_DP_PRIO (
104
+ dir: U32 # The directory index of the file
105
+ $id: U32 # The ID of the data product
106
+ tSec: U32 # Generation time in seconds
107
+ tSub: U32 # Generation time in subseconds
108
+ prio: U32 # Updated priority
109
+ ) \
110
+ opcode 5
102
111
103
112
# ----------------------------------------------------------------------
104
113
# Events
@@ -400,7 +409,24 @@ module Svc {
400
409
format "Couldn' t delete file {}, stat {}." \
401
410
throttle 25
402
411
412
+ event DpUpdateNoFileError(
413
+ file: string size 80 @< The file
414
+ ) \
415
+ severity warning low \
416
+ id 46 \
417
+ format " Couldn' t update priority for file {}, doesn' t exist" \
418
+ throttle 25
403
419
420
+ @ DP priority updated
421
+ event DpPrioUpdated (
422
+ $id: U32 # The ID of the data product
423
+ tSec: U32 # Generation time in seconds
424
+ tSub: U32 # Generation time in subseconds
425
+ prio: U32 # new priority
426
+ ) \
427
+ severity activity low \
428
+ id 47 \
429
+ format " Priority updated for product ID {},{},{} to {}"
404
430
405
431
# ----------------------------------------------------------------------
406
432
# Telemetry
Original file line number Diff line number Diff line change @@ -128,6 +128,18 @@ namespace Svc {
128
128
U32 tSec,
129
129
U32 tSub) override ;
130
130
131
+ // ! Handler implementation for command UPDATE_DP_PRIO
132
+ // !
133
+ // ! update existing DP priority
134
+ void UPDATE_DP_PRIO_cmdHandler (FwOpcodeType opCode, // !< The opcode
135
+ U32 cmdSeq, // !< The command sequence number
136
+ U32 dir,
137
+ U32 id,
138
+ U32 tSec,
139
+ U32 tSub,
140
+ U32 prio) override ;
141
+
142
+
131
143
// ----------------------------------
132
144
// Private data structures
133
145
// ----------------------------------
You can’t perform that action at this time.
0 commit comments