Made bacepics' output more correct for VTS3 EPICS parsing.

Put command line argument checking and usage printing into their own functions,
and added an optional argument to show values instead of '?' for properties like Present_Value.
Added screening of properties that should normally be replaced with '?' on output.
Added a few enums to bactext (Node_Type, Polarity).
This commit is contained in:
tbrennan3
2010-04-16 20:52:40 +00:00
parent 4d90a024c6
commit fac19dff98
4 changed files with 173 additions and 38 deletions
+9
View File
@@ -914,6 +914,11 @@ bool bacapp_print_value(
(unsigned long)value->type.Enumerated);
}
break;
case PROP_POLARITY:
fprintf(stream, "%s",
bactext_binary_polarity_name(value->
type.Enumerated));
break;
case PROP_PRESENT_VALUE:
fprintf(stream, "%s",
bactext_binary_present_value_name(value->
@@ -932,6 +937,10 @@ bool bacapp_print_value(
fprintf(stream, "%s",
bactext_segmentation_name(value->type.Enumerated));
break;
case PROP_NODE_TYPE:
fprintf(stream, "%s",
bactext_node_type_name(value->type.Enumerated));
break;
default:
fprintf(stream, "%lu", (unsigned long)value->type.Enumerated);
break;
+51
View File
@@ -1825,6 +1825,22 @@ bool bactext_binary_present_value_index(
found_index);
}
INDTEXT_DATA bacnet_binary_polarity_names[] = {
{POLARITY_NORMAL, "normal"}
,
{POLARITY_REVERSE, "reverse"}
,
{0, NULL}
};
const char *bactext_binary_polarity_name(
unsigned index)
{
return indtext_by_index_default(bacnet_binary_polarity_names, index,
ASHRAE_Reserved_String);
}
INDTEXT_DATA bacnet_reliability_names[] = {
{RELIABILITY_NO_FAULT_DETECTED, "no-fault-detected"}
,
@@ -1899,3 +1915,38 @@ const char *bactext_segmentation_name(
return indtext_by_index_default(bacnet_segmentation_names, index,
ASHRAE_Reserved_String);
}
INDTEXT_DATA bacnet_node_type_names[] = {
{BACNET_NODE_UNKNOWN, "unknown"}
,
{BACNET_NODE_SYSTEM, "system"}
,
{BACNET_NODE_NETWORK, "network"}
,
{BACNET_NODE_DEVICE, "device"}
,
{BACNET_NODE_ORGANIZATIONAL, "organizational"}
,
{BACNET_NODE_AREA, "area"}
,
{BACNET_NODE_EQUIPMENT, "equipment"}
,
{BACNET_NODE_POINT, "point"}
,
{BACNET_NODE_COLLECTION, "collection"}
,
{BACNET_NODE_PROPERTY, "property"}
,
{BACNET_NODE_FUNCTIONAL, "functional"}
,
{BACNET_NODE_OTHER, "other"}
,
{0, NULL}
};
const char *bactext_node_type_name(
unsigned index)
{
return indtext_by_index_default(bacnet_node_type_names, index,
ASHRAE_Reserved_String);
}