Merge remote-tracking branch 'github/propmon' into PSI-7.0

This commit is contained in:
2024-09-06 14:56:21 +02:00
6 changed files with 65 additions and 20 deletions

View File

@ -22,6 +22,11 @@ should also be read to understand what has changed since earlier releases:
## Changes made on the 7.0 branch since 7.0.8.1
### DBE_PROPERTY event rate changed
Updating property fields now only post DBE_PROPERTY events if the
field actually changed.
### Allow to load the same alias multiple times
Aliases can now be defined multiple times as long as they still refer to the

View File

@ -1353,6 +1353,7 @@ long dbPut(DBADDR *paddr, short dbrType,
long status = 0;
dbFldDes *pfldDes;
int isValueField;
int propertyUpdate = paddr->pfldDes->prop && precord->mlis.count;
if (special == SPC_ATTRIBUTE)
return S_db_noMod;
@ -1397,12 +1398,31 @@ long dbPut(DBADDR *paddr, short dbrType,
if (nRequest < 1) {
recGblSetSevr(precord, LINK_ALARM, INVALID_ALARM);
} else {
status = dbFastPutConvertRoutine[dbrType][field_type](pbuffer,
paddr->pfield, paddr);
if (propertyUpdate && paddr->field_size <= MAX_STRING_SIZE) {
char propBuffer[MAX_STRING_SIZE];
status = dbFastPutConvertRoutine[dbrType][field_type](pbuffer,
&propBuffer, paddr);
if (!status) {
if (memcmp(paddr->pfield, &propBuffer, paddr->field_size) != 0) {
memcpy(paddr->pfield, &propBuffer, paddr->field_size);
} else {
/* suppress DBE_PROPERTY event if property did not change */
propertyUpdate = 0;
}
}
} else {
status = dbFastPutConvertRoutine[dbrType][field_type](pbuffer,
paddr->pfield, paddr);
}
nRequest = 1;
}
}
/* Post property updates before second dbPutSpecial */
/* which may post DBE_VALUE and/or DBE_LOG events */
if (propertyUpdate && !status)
db_post_events(precord, NULL, DBE_PROPERTY);
/* Always do special processing if needed */
if (special) {
long status2 = dbPutSpecial(paddr, 1);
@ -1419,12 +1439,6 @@ long dbPut(DBADDR *paddr, short dbrType,
if (precord->mlis.count &&
!(isValueField && pfldDes->process_passive))
db_post_events(precord, pfieldsave, DBE_VALUE | DBE_LOG);
/* If this field is a property (metadata) field,
* then post a property change event (even if the field
* didn't change).
*/
if (precord->mlis.count && pfldDes->prop)
db_post_events(precord, NULL, DBE_PROPERTY);
done:
paddr->pfield = pfieldsave;
return status;

View File

@ -220,12 +220,9 @@ static long special(DBADDR *paddr, int after)
return 0;
init_common(prec);
/* Note: ZRVL..FFVL are also SPC_MOD */
if (fieldIndex >= mbbiRecordZRST && fieldIndex <= mbbiRecordFFST) {
int event = DBE_PROPERTY;
if (prec->val == fieldIndex - mbbiRecordZRST)
event |= DBE_VALUE | DBE_LOG;
db_post_events(prec, &prec->val, event);
if (fieldIndex >= mbbiRecordZRST && fieldIndex <= mbbiRecordFFST
&& prec->val == fieldIndex - mbbiRecordZRST) {
db_post_events(prec, &prec->val, DBE_VALUE | DBE_LOG);
}
return 0;

View File

@ -276,6 +276,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(ONST,DBF_STRING) {
prompt("One String")
@ -284,6 +285,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(TWST,DBF_STRING) {
prompt("Two String")
@ -292,6 +294,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(THST,DBF_STRING) {
prompt("Three String")
@ -300,6 +303,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(FRST,DBF_STRING) {
prompt("Four String")
@ -308,6 +312,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(FVST,DBF_STRING) {
prompt("Five String")
@ -316,6 +321,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(SXST,DBF_STRING) {
prompt("Six String")
@ -324,6 +330,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(SVST,DBF_STRING) {
prompt("Seven String")
@ -332,6 +339,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(EIST,DBF_STRING) {
prompt("Eight String")
@ -340,6 +348,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(NIST,DBF_STRING) {
prompt("Nine String")
@ -348,6 +357,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(TEST,DBF_STRING) {
prompt("Ten String")
@ -356,6 +366,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(ELST,DBF_STRING) {
prompt("Eleven String")
@ -364,6 +375,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(TVST,DBF_STRING) {
prompt("Twelve String")
@ -372,6 +384,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(TTST,DBF_STRING) {
prompt("Thirteen String")
@ -380,6 +393,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(FTST,DBF_STRING) {
prompt("Fourteen String")
@ -388,6 +402,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(FFST,DBF_STRING) {
prompt("Fifteen String")
@ -396,6 +411,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
=head3 Alarm Parameters

View File

@ -285,12 +285,9 @@ static long special(DBADDR *paddr, int after)
return 0;
init_common(prec);
/* Note: ZRVL..FFVL are also SPC_MOD */
if (fieldIndex >= mbboRecordZRST && fieldIndex <= mbboRecordFFST) {
int event = DBE_PROPERTY;
if (prec->val == fieldIndex - mbboRecordZRST)
event |= DBE_VALUE | DBE_LOG;
db_post_events(prec, &prec->val, event);
if (fieldIndex >= mbboRecordZRST && fieldIndex <= mbboRecordFFST
&& prec->val == fieldIndex - mbboRecordZRST) {
db_post_events(prec, &prec->val, DBE_VALUE | DBE_LOG);
}
return 0;

View File

@ -354,6 +354,7 @@ for more information on simulation mode and its fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(ONST,DBF_STRING) {
prompt("One String")
@ -362,6 +363,7 @@ for more information on simulation mode and its fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(TWST,DBF_STRING) {
prompt("Two String")
@ -370,6 +372,7 @@ for more information on simulation mode and its fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(THST,DBF_STRING) {
prompt("Three String")
@ -378,6 +381,7 @@ for more information on simulation mode and its fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(FRST,DBF_STRING) {
prompt("Four String")
@ -386,6 +390,7 @@ for more information on simulation mode and its fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(FVST,DBF_STRING) {
prompt("Five String")
@ -394,6 +399,7 @@ for more information on simulation mode and its fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(SXST,DBF_STRING) {
prompt("Six String")
@ -402,6 +408,7 @@ for more information on simulation mode and its fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(SVST,DBF_STRING) {
prompt("Seven String")
@ -410,6 +417,7 @@ for more information on simulation mode and its fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(EIST,DBF_STRING) {
prompt("Eight String")
@ -418,6 +426,7 @@ for more information on simulation mode and its fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(NIST,DBF_STRING) {
prompt("Nine String")
@ -426,6 +435,7 @@ for more information on simulation mode and its fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(TEST,DBF_STRING) {
prompt("Ten String")
@ -434,6 +444,7 @@ for more information on simulation mode and its fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(ELST,DBF_STRING) {
prompt("Eleven String")
@ -442,6 +453,7 @@ for more information on simulation mode and its fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(TVST,DBF_STRING) {
prompt("Twelve String")
@ -450,6 +462,7 @@ for more information on simulation mode and its fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(TTST,DBF_STRING) {
prompt("Thirteen String")
@ -458,6 +471,7 @@ for more information on simulation mode and its fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(FTST,DBF_STRING) {
prompt("Fourteen String")
@ -466,6 +480,7 @@ for more information on simulation mode and its fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(FFST,DBF_STRING) {
prompt("Fifteen String")
@ -474,6 +489,7 @@ for more information on simulation mode and its fields.
pp(TRUE)
interest(1)
size(26)
prop(YES)
}
field(ZRSV,DBF_MENU) {
prompt("State Zero Severity")