Distributed Systems Network Management (DSNM) Subsystem Interface Development Guide
Sample I Process Program Code
Distributed Systems Network Management (DSNM) Subsystem Interface Development 
Guide—109759 D-23
Sample User-Written Code for SPIFFY Subsystem
Interface Process
 ! Return object type string from the SPIFFY type code
 SUBPROC typename (tname, typecode);
 STRING .EXT tname;
 INT typecode;
 BEGIN
 CASE typecode OF 
 BEGIN
 reactor -> tname ':=' "REACTOR ";
 boiler -> tname ':=' "BOILER ";
 valve -> tname ':=' "VALVE ";
 chamber -> tname ':=' "CHAMBER ";
 assembly -> tname ':=' "ASSEMBLY";
 cogwheel -> tname ':=' "COGWHEEL";
 gear -> tname ':=' "GEAR ";
 OTHERWISE -> tname ':=' "OTHER ";
 END;
 END;
 ! Return DSNM state of a thing from its subsystem info
 INT SUBPROC dsnmstate (thing^arg);
 INT .EXT thing^arg;
 BEGIN
 INT .EXT thing (spiffy^thing^def) = thing^arg;
 CASE thing.state OF
 BEGIN
 -- stopped, going, ! ASSEMBLY states
 -- locked, idle, coasting, rotating, ! COGWHEEL, GEAR states
 stopped, locked, idle -> RETURN ZDSN^STATE^RED;
 coasting -> RETURN ZDSN^STATE^YELLOW;
 going, rotating -> RETURN ZDSN^STATE^GREEN;
 OTHERWISE ->
 CASE thing.type OF 
 BEGIN
 reactor -> RETURN ZDSN^STATE^NULL;
 boiler, valve, chamber ->
 ! T 0-297 = red
 ! 298-595 = yellow
 ! 596-893 = green
 ! 894-1191 = yellow
 ! 1192-up = red
 IF thing.temp < 298D or thing.temp >= 1192D THEN
 RETURN ZDSN^STATE^RED
 ELSE IF thing.temp < 596D or thing.temp >= 894D THEN
 RETURN ZDSN^STATE^YELLOW
 ELSE
 RETURN ZDSN^STATE^GREEN;
 OTHERWISE -> RETURN ZDSN^STATE^UNKNOWN;
 END;
 END;
 END;
 ! Return true if xstate satisfies state flags (smodf flags) in
 ! in xcf; false otherwise.










