Ticket #276 (new wishlist)

Opened 8 years ago

Last modified 8 years ago

Use consistent names for TYPE_*_ALARM identifiers

Reported by: baker Owned by: somebody
Priority: trivial Milestone: All Platforms
Component: ALL modules Version: 7.6
Keywords: TYPE_ALARM Cc:

Description

I'd like to standardize on TYPE_*_ALARM for the format of alarm message type identifiers used for structural monitoring in ewaccel.c, ewnotify.c, ewshear.c, and ewthresh.c.:

# Structural monitoring specific message types
Message  TYPE_SPECTRA_DATA  161
Message  TYPE_THRESH_ALARM  162
Message  TYPE_SHEAR_ALARM   163
Message  TYPE_ACCEL_ALARM   164

RIght now they are kind of a jumble:

# some building monitoring specific messages
 Message  TYPE_SPECTRA_DATA    114
 Message  TYPE_THRESHALARM     115
 Message  TYPE_EWSHEAR_ALARM   116
 Message  TYPE_ACCELALARM      117

Attachments

message_types.patch (19.4 KB) - added by baker 8 years ago.
Replace "alarm" with "notify/notification", ALARM_RING with STATUS_RING

Change History

comment:1 Changed 8 years ago by baker

Here are patches to update the TYPE_*_ALARM message type identifiers used for structural monitoring.

--- seismic_processing/ewaccel/ewaccel.c.orig	2013-05-31 11:15:27.000000000 -0700
+++ seismic_processing/ewaccel/ewaccel.c	2013-05-31 11:15:27.000000000 -0700
@@ -824,4 +824,4 @@
   }
-  if ( GetType( "TYPE_THRESHALARM", &TypeThreshAlarm ) != 0 ) {
-     fprintf(stderr, "%s: Invalid message type <TYPE_THRESHALARM>!\n", Argv0 );
+  if ( GetType( "TYPE_THRESH_ALARM", &TypeThreshAlarm ) != 0 ) {
+     fprintf(stderr, "%s: Invalid message type <TYPE_THRESH_ALARM>!\n", Argv0 );
      exit( -1 );
--- seismic_processing/ewnotify/ewnotify.c.orig	2013-05-31 11:15:27.000000000 -0700
+++ seismic_processing/ewnotify/ewnotify.c	2013-05-31 11:15:27.000000000 -0700
@@ -638,5 +638,5 @@
 	   	GetLogo[1] = GetLogo[2] = GetLogo[3] = GetLogo[4] = GetLogo[0];
-	   	gett1 = GetType( "TYPE_THRESHALARM", &(GetLogo[1].type) );
-	   	gett2 = GetType( "TYPE_ACCELALARM", &(GetLogo[2].type) );
-	   	gett3 = GetType( "TYPE_EWSHEAR_ALARM", &(GetLogo[3].type) );
+	   	gett1 = GetType( "TYPE_THRESH_ALARM", &(GetLogo[1].type) );
+	   	gett2 = GetType( "TYPE_ACCEL_ALARM", &(GetLogo[2].type) );
+	   	gett3 = GetType( "TYPE_SHEAR_ALARM", &(GetLogo[3].type) );
 	   	gett4 = GetType( "TYPE_RSAM_ALARM", &(GetLogo[4].type) );
@@ -651,7 +651,7 @@
 	   		if ( gett1 )
-	   			logit( "e", "%s: TYPE_THRESHALARM unknown; exiting!\n", Argv0 );
+	   			logit( "e", "%s: TYPE_THRESH_ALARM unknown; exiting!\n", Argv0 );
 	   		if ( gett2 )
-	   			logit( "e", "%s: TYPE_ACCELALARM unknown; exiting!\n", Argv0 );
+	   			logit( "e", "%s: TYPE_ACCEL_ALARM unknown; exiting!\n", Argv0 );
 	   		if ( gett3 )
-	   			logit( "e", "%s: TYPE_EWSHEAR_ALARM unknown; exiting!\n", Argv0 );
+	   			logit( "e", "%s: TYPE_SHEAR_ALARM unknown; exiting!\n", Argv0 );
 	   		if ( MSrawmsg==NULL )
--- seismic_processing/ewshear/ewshear.c.orig	2013-05-31 11:15:27.000000000 -0700
+++ seismic_processing/ewshear/ewshear.c	2013-05-31 11:15:27.000000000 -0700
@@ -1267,5 +1267,5 @@
    }
-   if ( GetType( "TYPE_EWSHEAR_ALARM", &TypeAlarm ) != 0 ) {
+   if ( GetType( "TYPE_SHEAR_ALARM", &TypeAlarm ) != 0 ) {
       fprintf( stderr,
-              "%s: Invalid message type <TYPE_EWSHEAR_ALARM>; exiting!\n", Argv0 );
+              "%s: Invalid message type <TYPE_SHEAR_ALARM>; exiting!\n", Argv0 );
       exit( -1 );
--- seismic_processing/ewthresh/ewthresh.c.orig	2013-05-31 11:15:27.000000000 -0700
+++ seismic_processing/ewthresh/ewthresh.c	2013-05-31 11:15:27.000000000 -0700
@@ -288,4 +288,4 @@
   }
-  if ( GetType( "TYPE_THRESHALARM", &ThreshAlarmType ) != 0 ) {
-     fprintf(stderr, "%s: Invalid message type <TYPE_THRESHALARM>!\n", argv[0] );
+  if ( GetType( "TYPE_THRESH_ALARM", &ThreshAlarmType ) != 0 ) {
+     fprintf(stderr, "%s: Invalid message type <TYPE_THRESH_ALARM>!\n", argv[0] );
      exit( -1 );

comment:2 Changed 8 years ago by baker

Last edited 8 years ago by baker (previous) (diff)

comment:3 Changed 8 years ago by baker

How about moving the structural monitoring modules out of seismic_processing and into structural_monitoring, and giving me permission to commit changes to the structural_monitoring subtree?

comment:4 Changed 8 years ago by paulf

Sure we can do that, but we don't have time right now...and that reorg would take a bit of doing....unless you are volunteering to do the reorg and validate that the compiles all work on Windows and Unix systems :)

comment:5 Changed 8 years ago by baker

There is only one other place where an alarm message type identifier is mentioned that is not of the form TYPE_*_ALARM, in a comment.

--- src/libsrc/earlybird/report.c
+++ src/libsrc/earlybird/report.c
@@ -29,3 +29,3 @@
    int          lineLen;
-   char         line[256]; /* TYPE_PICKALARM format message */
+   char         line[256]; /* TYPE_PICK_ALARM format message */
 

comment:6 Changed 8 years ago by baker

Paul,

As you know, in anticipation of our upcoming discussion with the DOI lawyer, we are removing anything from the structural monitoring code that says "alarm". This will include renaming the message type identifiers to replace ALARM with NOTIFICATION, and replacing all instances of ALARM_RING with STATUS_RING. So, ignore these patches. I will post a patch later that has all the changes we will be using at the One RIncon Hill Tower and all the VA installations.

Larry

Changed 8 years ago by baker

Replace "alarm" with "notify/notification", ALARM_RING with STATUS_RING

comment:7 Changed 8 years ago by baker

Paul,

I uploaded the message_types.patch file which changes all occurrences of TYPE_...ALARM to TYPE_... NOTIFICATION and ALARM_RING to STATUS_RING in the structural monitoring code. There will no longer be any mention of alarms in the structural monitoring code. That should facilitate approval by the DOI lawyer to run this code at the One Rincon Hill Tower in SF.

Larry

Note: See TracTickets for help on using tickets.