added ca_dump_dbr
This commit is contained in:
@@ -122,6 +122,7 @@ height="31" width="88"></a></p>
|
||||
<li><a href="#ca_flush_io">flush outstanding requests to the server</a></li>
|
||||
<li><a href="#ca_add_exception_event">replace the default exception
|
||||
handler</a></li>
|
||||
<li><a href="#ca_dump_db">dump dbr type to standard out</a></li>
|
||||
</ul>
|
||||
|
||||
<h3><a href="#Function Call Reference">Function Call Interface Index</a></h3>
|
||||
@@ -136,6 +137,7 @@ height="31" width="88"></a></p>
|
||||
<li><a href="#ca_context_destroy">ca_context_destroy</a></li>
|
||||
<li><a href="#ca_create_channel">ca_create_channel</a></li>
|
||||
<li><a href="#ca_current_context">ca_current_context</a></li>
|
||||
<li><a href="#ca_dump_db">ca_dump_dbr()</a></li>
|
||||
<li><a href="#ca_element_count">ca_element_count</a></li>
|
||||
<li><a href="#L6925">ca_field_type</a></li>
|
||||
<li><a href="#ca_flush_io">ca_flush_io</a></li>
|
||||
@@ -2939,6 +2941,25 @@ preemptively from more than one thread.</p>
|
||||
|
||||
<p>ca_current_context()</p>
|
||||
|
||||
<h3><a name="ca_dump_db">ca_dump_dbr()</a></h3>
|
||||
|
||||
<p><code>void ca_dump_dbr ( </code><code>chtype TYPE, unsigned COUNT, const
|
||||
void * PDBR );</code></p>
|
||||
|
||||
<h4>Description</h4>
|
||||
|
||||
<p>Dumps the specified dbr data type to standard out.</p>
|
||||
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt><code>TYPE</code></dt>
|
||||
<dd>The data type (from the DBR_XXX set described in db_access.h).</dd>
|
||||
<dt><code>COUNT</code></dt>
|
||||
<dd>The array element count</dd>
|
||||
<dt><code>PDBR</code></dt>
|
||||
<dd>A pointer to data of the specified count and number.</dd>
|
||||
</dl>
|
||||
|
||||
<h2><a name="Return">Return Codes</a></h2>
|
||||
<dl>
|
||||
<dt>ECA_NORMAL</dt>
|
||||
|
||||
@@ -889,6 +889,9 @@ ca_sg_array_put (gid, type, 1u, chan, pValue)
|
||||
*/
|
||||
epicsShareFunc int epicsShareAPI ca_sg_stat (CA_SYNC_GID gid);
|
||||
|
||||
epicsShareFunc void epicsShareAPI ca_dump_dbr (chtype type, unsigned count, const void * pbuffer);
|
||||
|
||||
|
||||
/*
|
||||
* ca_v42_ok()
|
||||
*
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
\*************************************************************************/
|
||||
/*
|
||||
*
|
||||
* T E S T _ E V E N T . C
|
||||
* Author: Jeffrey O. Hill
|
||||
* simple stub for testing monitors
|
||||
* T E S T _ E V E N T . C
|
||||
* Author: Jeffrey O. Hill
|
||||
* simple stub for testing monitors
|
||||
*/
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
@@ -19,57 +19,568 @@
|
||||
|
||||
extern "C" void epicsShareAPI ca_test_event ( struct event_handler_args args )
|
||||
{
|
||||
printf ( "CAC: ~~~### in test event for [%s] ###~~~\n", ca_name(args.chid) );
|
||||
printf ( "CAC: User argument\t%p\n", args.usr);
|
||||
printf ( "CAC: Native channel data type\t%d\n", ca_field_type(args.chid) );
|
||||
printf ( "CAC: Monitor data type\t%ld\n", args.type );
|
||||
printf ( "CAC: CA Status \"%s\"\n", ca_message(args.status) );
|
||||
chtype nativeType = ca_field_type ( args.chid );
|
||||
const char * pNativeTypeName = "<invalid>";
|
||||
if ( VALID_DB_REQ ( nativeType ) ) {
|
||||
pNativeTypeName = dbr_text[nativeType];
|
||||
}
|
||||
else {
|
||||
if ( nativeType == TYPENOTCONN ) {
|
||||
pNativeTypeName = "<disconnected>";
|
||||
}
|
||||
}
|
||||
|
||||
if ( !args.dbr || !(CA_M_SUCCESS&args.status) ){
|
||||
return;
|
||||
}
|
||||
printf ( "ca_test_event() for channel \"%s\" with native type %s\n",
|
||||
ca_name(args.chid), pNativeTypeName );
|
||||
|
||||
switch ( args.type ) {
|
||||
case DBR_STRING:
|
||||
printf ( "CAC: Value:\t<%s>\n", (char *) args.dbr );
|
||||
break;
|
||||
case DBR_CHAR:
|
||||
printf ( "CAC: Value:\t<%d>\n", *(dbr_char_t *) args.dbr );
|
||||
break;
|
||||
#if DBR_INT != DBR_SHORT
|
||||
case DBR_INT:
|
||||
#endif
|
||||
case DBR_SHORT:
|
||||
case DBR_ENUM:
|
||||
printf ( "CAC: Value:\t<%d>\n", *(dbr_short_t *) args.dbr );
|
||||
break;
|
||||
case DBR_LONG:
|
||||
printf ( "CAC: Value:\t<%d>\n", *(dbr_long_t *)args.dbr );
|
||||
break;
|
||||
case DBR_FLOAT:
|
||||
printf ( "CAC: Value:\t<%f>\n", *(dbr_float_t *)args.dbr );
|
||||
break;
|
||||
case DBR_DOUBLE:
|
||||
printf ( "CAC: Value:\t<%f>\n", *(dbr_double_t *)args.dbr );
|
||||
break;
|
||||
case DBR_STS_STRING:
|
||||
printf ( "CAC: Value:\t<%s>\n", ((struct dbr_sts_string *)args.dbr)->value );
|
||||
break;
|
||||
case DBR_STS_INT:
|
||||
printf ( "CAC: Value:\t<%d>\n", ((struct dbr_sts_int *)args.dbr)->value );
|
||||
break;
|
||||
case DBR_STS_FLOAT:
|
||||
printf ( "CAC: Value:\t<%f>\n",((struct dbr_sts_float *)args.dbr)->value );
|
||||
break;
|
||||
case DBR_STS_ENUM:
|
||||
printf ( "CAC: Value:\t<%d>\n", ((struct dbr_sts_enum *)args.dbr)->value );
|
||||
break;
|
||||
case DBR_GR_FLOAT:
|
||||
printf ( "CAC: Value:\t<%f>\n", ((struct dbr_gr_float *)args.dbr)->value );
|
||||
break;
|
||||
default:
|
||||
printf ( "CAC: Sorry test_event does not handle data type %ld yet\n",
|
||||
args.type );
|
||||
}
|
||||
if ( ! ( CA_M_SUCCESS & args.status ) ) {
|
||||
printf ( "Invalid CA status \"%s\"\n", ca_message ( args.status ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( args.dbr ) {
|
||||
ca_dump_dbr ( args.type, args.count, args.dbr );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ca_dump_dbr()
|
||||
* dump the specified dbr type to stdout
|
||||
*/
|
||||
extern "C" void epicsShareAPI ca_dump_dbr (
|
||||
chtype type, unsigned count, const void * pbuffer )
|
||||
{
|
||||
unsigned i;
|
||||
char tsString[50];
|
||||
|
||||
if ( INVALID_DB_REQ ( type ) ) {
|
||||
printf ( "bad DBR type %ld\n", type );
|
||||
}
|
||||
|
||||
printf ( "%s\t", dbr_text[type] );
|
||||
|
||||
switch ( type ) {
|
||||
case DBR_STRING:
|
||||
{
|
||||
dbr_string_t *pString = (dbr_string_t *) pbuffer;
|
||||
|
||||
for(i=0; i<count && (*pString)[0]!='\0'; i++) {
|
||||
if(count!=1 && (i%5 == 0)) printf("\n");
|
||||
printf("%s ", *pString);
|
||||
pString++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_SHORT:
|
||||
{
|
||||
dbr_short_t *pvalue = (dbr_short_t *)pbuffer;
|
||||
for (i = 0; i < count; i++,pvalue++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*(short *)pvalue);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_ENUM:
|
||||
{
|
||||
dbr_enum_t *pvalue = (dbr_enum_t *)pbuffer;
|
||||
for (i = 0; i < count; i++,pvalue++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*pvalue);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_FLOAT:
|
||||
{
|
||||
dbr_float_t *pvalue = (dbr_float_t *)pbuffer;
|
||||
for (i = 0; i < count; i++,pvalue++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",*(float *)pvalue);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_CHAR:
|
||||
{
|
||||
dbr_char_t *pvalue = (dbr_char_t *) pbuffer;
|
||||
|
||||
for (i = 0; i < count; i++,pvalue++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%u ",*pvalue);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_LONG:
|
||||
{
|
||||
dbr_long_t *pvalue = (dbr_long_t *)pbuffer;
|
||||
for (i = 0; i < count; i++,pvalue++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*pvalue);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_DOUBLE:
|
||||
{
|
||||
dbr_double_t *pvalue = (dbr_double_t *)pbuffer;
|
||||
for (i = 0; i < count; i++,pvalue++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",(float)(*pvalue));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_STS_STRING:
|
||||
case DBR_GR_STRING:
|
||||
case DBR_CTRL_STRING:
|
||||
{
|
||||
struct dbr_sts_string *pvalue
|
||||
= (struct dbr_sts_string *) pbuffer;
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf("\tValue: %s",pvalue->value);
|
||||
break;
|
||||
}
|
||||
case DBR_STS_ENUM:
|
||||
{
|
||||
struct dbr_sts_enum *pvalue
|
||||
= (struct dbr_sts_enum *)pbuffer;
|
||||
dbr_enum_t *pEnum = &pvalue->value;
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pEnum++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%u ",*pEnum);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_STS_SHORT:
|
||||
{
|
||||
struct dbr_sts_short *pvalue
|
||||
= (struct dbr_sts_short *)pbuffer;
|
||||
dbr_short_t *pshort = &pvalue->value;
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pshort++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%u ",*pshort);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_STS_FLOAT:
|
||||
{
|
||||
struct dbr_sts_float *pvalue
|
||||
= (struct dbr_sts_float *)pbuffer;
|
||||
dbr_float_t *pfloat = &pvalue->value;
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pfloat++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",*pfloat);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_STS_CHAR:
|
||||
{
|
||||
struct dbr_sts_char *pvalue
|
||||
= (struct dbr_sts_char *)pbuffer;
|
||||
dbr_char_t *pchar = &pvalue->value;
|
||||
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pchar++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%u ", *pchar);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_STS_LONG:
|
||||
{
|
||||
struct dbr_sts_long *pvalue
|
||||
= (struct dbr_sts_long *)pbuffer;
|
||||
dbr_long_t *plong = &pvalue->value;
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,plong++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*plong);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_STS_DOUBLE:
|
||||
{
|
||||
struct dbr_sts_double *pvalue
|
||||
= (struct dbr_sts_double *)pbuffer;
|
||||
dbr_double_t *pdouble = &pvalue->value;
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pdouble++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",(float)(*pdouble));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_TIME_STRING:
|
||||
{
|
||||
struct dbr_time_string *pvalue
|
||||
= (struct dbr_time_string *) pbuffer;
|
||||
|
||||
epicsTimeToStrftime(tsString,sizeof(tsString),
|
||||
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf("\tTimeStamp: %s",tsString);
|
||||
printf("\tValue: ");
|
||||
printf("%s",pvalue->value);
|
||||
break;
|
||||
}
|
||||
case DBR_TIME_ENUM:
|
||||
{
|
||||
struct dbr_time_enum *pvalue
|
||||
= (struct dbr_time_enum *)pbuffer;
|
||||
dbr_enum_t *pshort = &pvalue->value;
|
||||
|
||||
epicsTimeToStrftime(tsString,sizeof(tsString),
|
||||
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf("\tTimeStamp: %s",tsString);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pshort++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*pshort);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_TIME_SHORT:
|
||||
{
|
||||
struct dbr_time_short *pvalue
|
||||
= (struct dbr_time_short *)pbuffer;
|
||||
dbr_short_t *pshort = &pvalue->value;
|
||||
epicsTimeToStrftime(tsString,sizeof(tsString),
|
||||
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
|
||||
printf("%2d %2d",
|
||||
pvalue->status,
|
||||
pvalue->severity);
|
||||
printf("\tTimeStamp: %s",tsString);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pshort++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*pshort);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_TIME_FLOAT:
|
||||
{
|
||||
struct dbr_time_float *pvalue
|
||||
= (struct dbr_time_float *)pbuffer;
|
||||
dbr_float_t *pfloat = &pvalue->value;
|
||||
|
||||
epicsTimeToStrftime(tsString,sizeof(tsString),
|
||||
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf("\tTimeStamp: %s",tsString);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pfloat++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",*pfloat);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_TIME_CHAR:
|
||||
{
|
||||
struct dbr_time_char *pvalue
|
||||
= (struct dbr_time_char *)pbuffer;
|
||||
dbr_char_t *pchar = &pvalue->value;
|
||||
|
||||
epicsTimeToStrftime(tsString,sizeof(tsString),
|
||||
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf("\tTimeStamp: %s",tsString);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pchar++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",(short)(*pchar));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_TIME_LONG:
|
||||
{
|
||||
struct dbr_time_long *pvalue
|
||||
= (struct dbr_time_long *)pbuffer;
|
||||
dbr_long_t *plong = &pvalue->value;
|
||||
|
||||
epicsTimeToStrftime(tsString,sizeof(tsString),
|
||||
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf("\tTimeStamp: %s",tsString);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,plong++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*plong);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_TIME_DOUBLE:
|
||||
{
|
||||
struct dbr_time_double *pvalue
|
||||
= (struct dbr_time_double *)pbuffer;
|
||||
dbr_double_t *pdouble = &pvalue->value;
|
||||
|
||||
epicsTimeToStrftime(tsString,sizeof(tsString),
|
||||
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf("\tTimeStamp: %s",tsString);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pdouble++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",(float)(*pdouble));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_GR_SHORT:
|
||||
{
|
||||
struct dbr_gr_short *pvalue
|
||||
= (struct dbr_gr_short *)pbuffer;
|
||||
dbr_short_t *pshort = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf("\n\t%8d %8d %8d %8d %8d %8d",
|
||||
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
|
||||
pvalue->upper_alarm_limit,pvalue->upper_warning_limit,
|
||||
pvalue->lower_warning_limit,pvalue->lower_alarm_limit);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pshort++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*pshort);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_GR_FLOAT:
|
||||
{
|
||||
struct dbr_gr_float *pvalue
|
||||
= (struct dbr_gr_float *)pbuffer;
|
||||
dbr_float_t *pfloat = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf(" %3d\n\t%8.3f %8.3f %8.3f %8.3f %8.3f %8.3f",
|
||||
pvalue->precision,
|
||||
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
|
||||
pvalue->upper_alarm_limit,pvalue->upper_warning_limit,
|
||||
pvalue->lower_warning_limit,pvalue->lower_alarm_limit);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pfloat++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",*pfloat);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_GR_ENUM:
|
||||
{
|
||||
struct dbr_gr_enum *pvalue
|
||||
= (struct dbr_gr_enum *)pbuffer;
|
||||
printf("%2d %2d",pvalue->status,
|
||||
pvalue->severity);
|
||||
printf("\tValue: %d",pvalue->value);
|
||||
if(pvalue->no_str>0) {
|
||||
printf("\n\t%3d",pvalue->no_str);
|
||||
for (i = 0; i < (unsigned) pvalue->no_str; i++)
|
||||
printf("\n\t%.26s",pvalue->strs[i]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_CTRL_ENUM:
|
||||
{
|
||||
struct dbr_ctrl_enum *pvalue
|
||||
= (struct dbr_ctrl_enum *)pbuffer;
|
||||
printf("%2d %2d",pvalue->status,
|
||||
pvalue->severity);
|
||||
printf("\tValue: %d",pvalue->value);
|
||||
if(pvalue->no_str>0) {
|
||||
printf("\n\t%3d",pvalue->no_str);
|
||||
for (i = 0; i < (unsigned) pvalue->no_str; i++)
|
||||
printf("\n\t%.26s",pvalue->strs[i]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_GR_CHAR:
|
||||
{
|
||||
struct dbr_gr_char *pvalue
|
||||
= (struct dbr_gr_char *)pbuffer;
|
||||
dbr_char_t *pchar = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf("\n\t%8d %8d %8d %8d %8d %8d",
|
||||
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
|
||||
pvalue->upper_alarm_limit,pvalue->upper_warning_limit,
|
||||
pvalue->lower_warning_limit,pvalue->lower_alarm_limit);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pchar++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%u ",*pchar);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_GR_LONG:
|
||||
{
|
||||
struct dbr_gr_long *pvalue
|
||||
= (struct dbr_gr_long *)pbuffer;
|
||||
dbr_long_t *plong = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf("\n\t%8d %8d %8d %8d %8d %8d",
|
||||
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
|
||||
pvalue->upper_alarm_limit,pvalue->upper_warning_limit,
|
||||
pvalue->lower_warning_limit,pvalue->lower_alarm_limit);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,plong++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*plong);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_GR_DOUBLE:
|
||||
{
|
||||
struct dbr_gr_double *pvalue
|
||||
= (struct dbr_gr_double *)pbuffer;
|
||||
dbr_double_t *pdouble = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf(" %3d\n\t%8.3f %8.3f %8.3f %8.3f %8.3f %8.3f",
|
||||
pvalue->precision,
|
||||
(float)(pvalue->upper_disp_limit),
|
||||
(float)(pvalue->lower_disp_limit),
|
||||
(float)(pvalue->upper_alarm_limit),
|
||||
(float)(pvalue->upper_warning_limit),
|
||||
(float)(pvalue->lower_warning_limit),
|
||||
(float)(pvalue->lower_alarm_limit));
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pdouble++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",(float)(*pdouble));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_CTRL_SHORT:
|
||||
{
|
||||
struct dbr_ctrl_short *pvalue
|
||||
= (struct dbr_ctrl_short *)pbuffer;
|
||||
dbr_short_t *pshort = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf("\n\t%8d %8d %8d %8d %8d %8d",
|
||||
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
|
||||
pvalue->upper_alarm_limit,pvalue->upper_warning_limit,
|
||||
pvalue->lower_warning_limit,pvalue->lower_alarm_limit);
|
||||
printf(" %8d %8d",
|
||||
pvalue->upper_ctrl_limit,pvalue->lower_ctrl_limit);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pshort++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*pshort);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_CTRL_FLOAT:
|
||||
{
|
||||
struct dbr_ctrl_float *pvalue
|
||||
= (struct dbr_ctrl_float *)pbuffer;
|
||||
dbr_float_t *pfloat = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf(" %3d\n\t%8.3f %8.3f %8.3f %8.3f %8.3f %8.3f",
|
||||
pvalue->precision,
|
||||
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
|
||||
pvalue->upper_alarm_limit,pvalue->upper_warning_limit,
|
||||
pvalue->lower_warning_limit,pvalue->lower_alarm_limit);
|
||||
printf(" %8.3f %8.3f",
|
||||
pvalue->upper_ctrl_limit,pvalue->lower_ctrl_limit);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pfloat++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",*pfloat);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_CTRL_CHAR:
|
||||
{
|
||||
struct dbr_ctrl_char *pvalue
|
||||
= (struct dbr_ctrl_char *)pbuffer;
|
||||
dbr_char_t *pchar = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf("\n\t%8d %8d %8d %8d %8d %8d",
|
||||
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
|
||||
pvalue->upper_alarm_limit,pvalue->upper_warning_limit,
|
||||
pvalue->lower_warning_limit,pvalue->lower_alarm_limit);
|
||||
printf(" %8d %8d",
|
||||
pvalue->upper_ctrl_limit,pvalue->lower_ctrl_limit);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pchar++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%4d ",(short)(*pchar));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_CTRL_LONG:
|
||||
{
|
||||
struct dbr_ctrl_long *pvalue
|
||||
= (struct dbr_ctrl_long *)pbuffer;
|
||||
dbr_long_t *plong = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf("\n\t%8d %8d %8d %8d %8d %8d",
|
||||
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
|
||||
pvalue->upper_alarm_limit,pvalue->upper_warning_limit,
|
||||
pvalue->lower_warning_limit,pvalue->lower_alarm_limit);
|
||||
printf(" %8d %8d",
|
||||
pvalue->upper_ctrl_limit,pvalue->lower_ctrl_limit);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,plong++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*plong);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_CTRL_DOUBLE:
|
||||
{
|
||||
struct dbr_ctrl_double *pvalue
|
||||
= (struct dbr_ctrl_double *)pbuffer;
|
||||
dbr_double_t *pdouble = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf(" %3d\n\t%8.3f %8.3f %8.3f %8.3f %8.3f %8.3f",
|
||||
pvalue->precision,
|
||||
(float)(pvalue->upper_disp_limit),
|
||||
(float)(pvalue->lower_disp_limit),
|
||||
(float)(pvalue->upper_alarm_limit),
|
||||
(float)(pvalue->upper_warning_limit),
|
||||
(float)(pvalue->lower_warning_limit),
|
||||
(float)(pvalue->lower_alarm_limit));
|
||||
printf(" %8.3f %8.3f",
|
||||
(float)(pvalue->upper_ctrl_limit),
|
||||
(float)(pvalue->lower_ctrl_limit));
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pdouble++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.6f ",(float)(*pdouble));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DBR_STSACK_STRING:
|
||||
{
|
||||
struct dbr_stsack_string *pvalue
|
||||
= (struct dbr_stsack_string *)pbuffer;
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf(" %2d %2d",pvalue->ackt,pvalue->acks);
|
||||
printf(" %s",pvalue->value);
|
||||
break;
|
||||
}
|
||||
case DBR_CLASS_NAME:
|
||||
{
|
||||
dbr_class_name_t * pvalue =
|
||||
( dbr_class_name_t * ) pbuffer;
|
||||
printf ( "%s", *pvalue );
|
||||
break;
|
||||
}
|
||||
default:
|
||||
printf (
|
||||
"unsupported by ca_dbrDump()" );
|
||||
break;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -13,21 +13,18 @@
|
||||
* Author: Bob Dalesio
|
||||
* Date: 4/15/88
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "errlog.h"
|
||||
#include "db_access.h"
|
||||
#include "dbDefs.h"
|
||||
#include "errlog.h"
|
||||
#include "cadef.h"
|
||||
#define epicsExportSharedSymbols
|
||||
#include "db_access_routines.h"
|
||||
#include "dbNotify.h"
|
||||
#include "db_test.h"
|
||||
|
||||
/* function declarations */
|
||||
static void print_returned();
|
||||
#include "db_access_routines.h"
|
||||
#include "dbNotify.h"
|
||||
#include "db_test.h"
|
||||
|
||||
|
||||
#define MAX_ELEMS 10
|
||||
@@ -70,7 +67,7 @@ int epicsShareAPI gft(char *pname)
|
||||
if(db_get_field(paddr,i,tgf_buffer,number_elements,NULL)<0)
|
||||
printf("\t%s Failed\n",dbr_text[i]);
|
||||
else
|
||||
print_returned(i,tgf_buffer,number_elements);
|
||||
ca_dump_dbr (i,number_elements,tgf_buffer);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
@@ -114,7 +111,7 @@ int epicsShareAPI pft(char *pname,char *pvalue)
|
||||
printf(" No Elements: %ld\n",addr.no_elements);
|
||||
if (db_put_field(paddr,DBR_STRING,pvalue,1) < 0) printf("\n\t failed ");
|
||||
if (db_get_field(paddr,DBR_STRING,buffer,1,NULL) < 0) printf("\n\tfailed");
|
||||
else print_returned(DBR_STRING,buffer,1);
|
||||
else ca_dump_dbr(DBR_STRING,1,buffer);
|
||||
if(addr.dbr_field_type<=DBF_STRING || addr.dbr_field_type==DBF_ENUM)
|
||||
return(0);
|
||||
if(sscanf(pvalue,"%hd",&shortvalue)==1) {
|
||||
@@ -122,21 +119,21 @@ int epicsShareAPI pft(char *pname,char *pvalue)
|
||||
printf("\n\t SHORT failed ");
|
||||
if (db_get_field(paddr,DBR_SHORT,buffer,1,NULL) < 0)
|
||||
printf("\n\t SHORT GET failed");
|
||||
else print_returned(DBR_SHORT,buffer,1);
|
||||
else ca_dump_dbr(DBR_SHORT,1,buffer);
|
||||
}
|
||||
if(sscanf(pvalue,"%ld",&longvalue)==1) {
|
||||
if (db_put_field(paddr,DBR_LONG,&longvalue,1) < 0)
|
||||
printf("\n\t LONG failed ");
|
||||
if (db_get_field(paddr,DBR_LONG,buffer,1,NULL) < 0)
|
||||
printf("\n\t LONG GET failed");
|
||||
else print_returned(DBR_LONG,buffer,1);
|
||||
else ca_dump_dbr(DBR_LONG,1,buffer);
|
||||
}
|
||||
if(sscanf(pvalue,"%f",&floatvalue)==1) {
|
||||
if (db_put_field(paddr,DBR_FLOAT,&floatvalue,1) < 0)
|
||||
printf("\n\t FLOAT failed ");
|
||||
if (db_get_field(paddr,DBR_FLOAT,buffer,1,NULL) < 0)
|
||||
printf("\n\t FLOAT GET failed");
|
||||
else print_returned(DBR_FLOAT,buffer,1);
|
||||
else ca_dump_dbr(DBR_FLOAT,1,buffer);
|
||||
}
|
||||
if(sscanf(pvalue,"%f",&floatvalue)==1) {
|
||||
doublevalue=floatvalue;
|
||||
@@ -144,7 +141,7 @@ int epicsShareAPI pft(char *pname,char *pvalue)
|
||||
printf("\n\t DOUBLE failed ");
|
||||
if (db_get_field(paddr,DBR_DOUBLE,buffer,1,NULL) < 0)
|
||||
printf("\n\t DOUBLE GET failed");
|
||||
else print_returned(DBR_DOUBLE,buffer,1);
|
||||
else ca_dump_dbr(DBR_DOUBLE,1,buffer);
|
||||
}
|
||||
if(sscanf(pvalue,"%hd",&shortvalue)==1) {
|
||||
charvalue=(unsigned char)shortvalue;
|
||||
@@ -152,25 +149,26 @@ int epicsShareAPI pft(char *pname,char *pvalue)
|
||||
printf("\n\t CHAR failed ");
|
||||
if (db_get_field(paddr,DBR_CHAR,buffer,1,NULL) < 0)
|
||||
printf("\n\t CHAR GET failed");
|
||||
else print_returned(DBR_CHAR,buffer,1);
|
||||
else ca_dump_dbr(DBR_CHAR,1,buffer);
|
||||
}
|
||||
if(sscanf(pvalue,"%hd",&shortvalue)==1) {
|
||||
if (db_put_field(paddr,DBR_ENUM,&shortvalue,1) < 0)
|
||||
printf("\n\t ENUM failed ");
|
||||
if (db_get_field(paddr,DBR_ENUM,buffer,1,NULL) < 0)
|
||||
printf("\n\t ENUM GET failed");
|
||||
else print_returned(DBR_ENUM,buffer,1);
|
||||
else ca_dump_dbr(DBR_ENUM,1,buffer);
|
||||
}
|
||||
printf("\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* PRINT_RETURNED
|
||||
*
|
||||
* print out the values in a database access interface structure
|
||||
*/
|
||||
static void print_returned(type,pbuffer,count)
|
||||
static void print_returned(type,count,pbuffer)
|
||||
short type;
|
||||
char *pbuffer;
|
||||
short count;
|
||||
@@ -633,7 +631,8 @@ static void print_returned(type,pbuffer,count)
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void tpnCallback(putNotify *ppn)
|
||||
{
|
||||
struct dbAddr *pdbaddr = (struct dbAddr *)ppn->paddr;
|
||||
|
||||
@@ -33,9 +33,8 @@ LOCAL int cagft(char *pname);
|
||||
LOCAL void printit(struct event_handler_args args);
|
||||
LOCAL int capft(char *pname, char *pvalue);
|
||||
LOCAL void verify_value(chid chan_id, chtype type);
|
||||
LOCAL void print_returned(chtype type, const void *pbuffer, unsigned count);
|
||||
|
||||
static unsigned long outstanding;
|
||||
static unsigned long outstanding;
|
||||
|
||||
|
||||
/*
|
||||
@@ -101,14 +100,23 @@ LOCAL int cagft(char *pname)
|
||||
/*
|
||||
* fetch as each type
|
||||
*/
|
||||
for(i=0; i<=DBR_CTRL_DOUBLE; i++){
|
||||
for(i=0; i<=LAST_BUFFER_TYPE; i++){
|
||||
if(ca_field_type(chan_id)==DBR_STRING) {
|
||||
if( (i!=DBR_STRING)
|
||||
&& (i!=DBR_STS_STRING)
|
||||
&& (i!=DBR_TIME_STRING)
|
||||
&& (i!=DBR_GR_STRING)
|
||||
&& (i!=DBR_CTRL_STRING)) continue;
|
||||
}
|
||||
&& (i!=DBR_CTRL_STRING)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
/* ignore write only types */
|
||||
if (
|
||||
i == DBR_PUT_ACKT ||
|
||||
i == DBR_PUT_ACKS ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
status = ca_array_get_callback(
|
||||
i,
|
||||
ca_element_count(chan_id),
|
||||
@@ -149,25 +157,18 @@ LOCAL int cagft(char *pname)
|
||||
/*
|
||||
* PRINTIT()
|
||||
*/
|
||||
LOCAL void printit(struct event_handler_args args)
|
||||
LOCAL void printit ( struct event_handler_args args )
|
||||
{
|
||||
if (args.status == ECA_NORMAL) {
|
||||
print_returned(
|
||||
args.type,
|
||||
args.dbr,
|
||||
args.count);
|
||||
if ( args.status == ECA_NORMAL ) {
|
||||
ca_dump_dbr ( args.type, args.count, args.dbr );
|
||||
}
|
||||
else {
|
||||
printf ("%s: err resp to get cb was \"%s\"\n",
|
||||
__FILE__, ca_message(args.status));
|
||||
printf ( "%s\t%s\n", dbr_text[args.type], ca_message(args.status) );
|
||||
}
|
||||
|
||||
outstanding--;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* capft
|
||||
*
|
||||
@@ -326,511 +327,3 @@ LOCAL void verify_value(chid chan_id, chtype type)
|
||||
|
||||
outstanding++;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* PRINT_RETURNED
|
||||
*
|
||||
* print out the values in a database access interface structure
|
||||
*
|
||||
* switches over the range of CA data types and reports the value
|
||||
*/
|
||||
LOCAL void print_returned(chtype type, const void *pbuffer, unsigned count)
|
||||
{
|
||||
unsigned i;
|
||||
char tsString[50];
|
||||
|
||||
printf("%s\t",dbr_text[type]);
|
||||
switch(type){
|
||||
case (DBR_STRING):
|
||||
{
|
||||
dbr_string_t *pString = (dbr_string_t *) pbuffer;
|
||||
|
||||
for(i=0; i<count && (*pString)[0]!='\0'; i++) {
|
||||
if(count!=1 && (i%5 == 0)) printf("\n");
|
||||
printf("%s ", *pString);
|
||||
pString++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_SHORT):
|
||||
{
|
||||
dbr_short_t *pvalue = (dbr_short_t *)pbuffer;
|
||||
for (i = 0; i < count; i++,pvalue++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*(short *)pvalue);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_ENUM):
|
||||
{
|
||||
dbr_enum_t *pvalue = (dbr_enum_t *)pbuffer;
|
||||
for (i = 0; i < count; i++,pvalue++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*pvalue);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_FLOAT):
|
||||
{
|
||||
dbr_float_t *pvalue = (dbr_float_t *)pbuffer;
|
||||
for (i = 0; i < count; i++,pvalue++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",*(float *)pvalue);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_CHAR):
|
||||
{
|
||||
dbr_char_t *pvalue = (dbr_char_t *) pbuffer;
|
||||
|
||||
for (i = 0; i < count; i++,pvalue++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%u ",*pvalue);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_LONG):
|
||||
{
|
||||
dbr_long_t *pvalue = (dbr_long_t *)pbuffer;
|
||||
for (i = 0; i < count; i++,pvalue++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*pvalue);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_DOUBLE):
|
||||
{
|
||||
dbr_double_t *pvalue = (dbr_double_t *)pbuffer;
|
||||
for (i = 0; i < count; i++,pvalue++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",(float)(*pvalue));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_STS_STRING):
|
||||
case (DBR_GR_STRING):
|
||||
case (DBR_CTRL_STRING):
|
||||
{
|
||||
struct dbr_sts_string *pvalue
|
||||
= (struct dbr_sts_string *) pbuffer;
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf("\tValue: %s",pvalue->value);
|
||||
break;
|
||||
}
|
||||
case (DBR_STS_ENUM):
|
||||
{
|
||||
struct dbr_sts_enum *pvalue
|
||||
= (struct dbr_sts_enum *)pbuffer;
|
||||
dbr_enum_t *pEnum = &pvalue->value;
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pEnum++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%u ",*pEnum);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_STS_SHORT):
|
||||
{
|
||||
struct dbr_sts_short *pvalue
|
||||
= (struct dbr_sts_short *)pbuffer;
|
||||
dbr_short_t *pshort = &pvalue->value;
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pshort++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%u ",*pshort);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_STS_FLOAT):
|
||||
{
|
||||
struct dbr_sts_float *pvalue
|
||||
= (struct dbr_sts_float *)pbuffer;
|
||||
dbr_float_t *pfloat = &pvalue->value;
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pfloat++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",*pfloat);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_STS_CHAR):
|
||||
{
|
||||
struct dbr_sts_char *pvalue
|
||||
= (struct dbr_sts_char *)pbuffer;
|
||||
dbr_char_t *pchar = &pvalue->value;
|
||||
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pchar++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%u ", *pchar);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_STS_LONG):
|
||||
{
|
||||
struct dbr_sts_long *pvalue
|
||||
= (struct dbr_sts_long *)pbuffer;
|
||||
dbr_long_t *plong = &pvalue->value;
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,plong++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*plong);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_STS_DOUBLE):
|
||||
{
|
||||
struct dbr_sts_double *pvalue
|
||||
= (struct dbr_sts_double *)pbuffer;
|
||||
dbr_double_t *pdouble = &pvalue->value;
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pdouble++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",(float)(*pdouble));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_TIME_STRING):
|
||||
{
|
||||
struct dbr_time_string *pvalue
|
||||
= (struct dbr_time_string *) pbuffer;
|
||||
|
||||
epicsTimeToStrftime(tsString,sizeof(tsString),
|
||||
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf("\tTimeStamp: %s",tsString);
|
||||
printf("\tValue: ");
|
||||
printf("%s",pvalue->value);
|
||||
break;
|
||||
}
|
||||
case (DBR_TIME_ENUM):
|
||||
{
|
||||
struct dbr_time_enum *pvalue
|
||||
= (struct dbr_time_enum *)pbuffer;
|
||||
dbr_enum_t *pshort = &pvalue->value;
|
||||
|
||||
epicsTimeToStrftime(tsString,sizeof(tsString),
|
||||
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf("\tTimeStamp: %s",tsString);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pshort++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*pshort);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_TIME_SHORT):
|
||||
{
|
||||
struct dbr_time_short *pvalue
|
||||
= (struct dbr_time_short *)pbuffer;
|
||||
dbr_short_t *pshort = &pvalue->value;
|
||||
|
||||
epicsTimeToStrftime(tsString,sizeof(tsString),
|
||||
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
|
||||
printf("%2d %2d",
|
||||
pvalue->status,
|
||||
pvalue->severity);
|
||||
printf("\tTimeStamp: %s",tsString);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pshort++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*pshort);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_TIME_FLOAT):
|
||||
{
|
||||
struct dbr_time_float *pvalue
|
||||
= (struct dbr_time_float *)pbuffer;
|
||||
dbr_float_t *pfloat = &pvalue->value;
|
||||
|
||||
epicsTimeToStrftime(tsString,sizeof(tsString),
|
||||
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf("\tTimeStamp: %s",tsString);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pfloat++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",*pfloat);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_TIME_CHAR):
|
||||
{
|
||||
struct dbr_time_char *pvalue
|
||||
= (struct dbr_time_char *)pbuffer;
|
||||
dbr_char_t *pchar = &pvalue->value;
|
||||
|
||||
epicsTimeToStrftime(tsString,sizeof(tsString),
|
||||
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf("\tTimeStamp: %s",tsString);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pchar++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",(short)(*pchar));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_TIME_LONG):
|
||||
{
|
||||
struct dbr_time_long *pvalue
|
||||
= (struct dbr_time_long *)pbuffer;
|
||||
dbr_long_t *plong = &pvalue->value;
|
||||
|
||||
epicsTimeToStrftime(tsString,sizeof(tsString),
|
||||
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf("\tTimeStamp: %s",tsString);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,plong++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*plong);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_TIME_DOUBLE):
|
||||
{
|
||||
struct dbr_time_double *pvalue
|
||||
= (struct dbr_time_double *)pbuffer;
|
||||
dbr_double_t *pdouble = &pvalue->value;
|
||||
|
||||
epicsTimeToStrftime(tsString,sizeof(tsString),
|
||||
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf("\tTimeStamp: %s",tsString);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pdouble++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",(float)(*pdouble));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_GR_SHORT):
|
||||
{
|
||||
struct dbr_gr_short *pvalue
|
||||
= (struct dbr_gr_short *)pbuffer;
|
||||
dbr_short_t *pshort = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf("\n\t%8d %8d %8d %8d %8d %8d",
|
||||
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
|
||||
pvalue->upper_alarm_limit,pvalue->upper_warning_limit,
|
||||
pvalue->lower_warning_limit,pvalue->lower_alarm_limit);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pshort++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*pshort);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_GR_FLOAT):
|
||||
{
|
||||
struct dbr_gr_float *pvalue
|
||||
= (struct dbr_gr_float *)pbuffer;
|
||||
dbr_float_t *pfloat = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf(" %3d\n\t%8.3f %8.3f %8.3f %8.3f %8.3f %8.3f",
|
||||
pvalue->precision,
|
||||
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
|
||||
pvalue->upper_alarm_limit,pvalue->upper_warning_limit,
|
||||
pvalue->lower_warning_limit,pvalue->lower_alarm_limit);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pfloat++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",*pfloat);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_GR_ENUM):
|
||||
case (DBR_CTRL_ENUM):
|
||||
{
|
||||
struct dbr_gr_enum *pvalue
|
||||
= (struct dbr_gr_enum *)pbuffer;
|
||||
printf("%2d %2d",pvalue->status,
|
||||
pvalue->severity);
|
||||
printf("\tValue: %d",pvalue->value);
|
||||
if(pvalue->no_str>0) {
|
||||
printf("\n\t%3d",pvalue->no_str);
|
||||
for (i = 0; i < (unsigned) pvalue->no_str; i++)
|
||||
printf("\n\t%.26s",pvalue->strs[i]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_GR_CHAR):
|
||||
{
|
||||
struct dbr_gr_char *pvalue
|
||||
= (struct dbr_gr_char *)pbuffer;
|
||||
dbr_char_t *pchar = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf("\n\t%8d %8d %8d %8d %8d %8d",
|
||||
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
|
||||
pvalue->upper_alarm_limit,pvalue->upper_warning_limit,
|
||||
pvalue->lower_warning_limit,pvalue->lower_alarm_limit);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pchar++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%u ",*pchar);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_GR_LONG):
|
||||
{
|
||||
struct dbr_gr_long *pvalue
|
||||
= (struct dbr_gr_long *)pbuffer;
|
||||
dbr_long_t *plong = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf("\n\t%8d %8d %8d %8d %8d %8d",
|
||||
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
|
||||
pvalue->upper_alarm_limit,pvalue->upper_warning_limit,
|
||||
pvalue->lower_warning_limit,pvalue->lower_alarm_limit);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,plong++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*plong);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_GR_DOUBLE):
|
||||
{
|
||||
struct dbr_gr_double *pvalue
|
||||
= (struct dbr_gr_double *)pbuffer;
|
||||
dbr_double_t *pdouble = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf(" %3d\n\t%8.3f %8.3f %8.3f %8.3f %8.3f %8.3f",
|
||||
pvalue->precision,
|
||||
(float)(pvalue->upper_disp_limit),
|
||||
(float)(pvalue->lower_disp_limit),
|
||||
(float)(pvalue->upper_alarm_limit),
|
||||
(float)(pvalue->upper_warning_limit),
|
||||
(float)(pvalue->lower_warning_limit),
|
||||
(float)(pvalue->lower_alarm_limit));
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pdouble++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",(float)(*pdouble));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_CTRL_SHORT):
|
||||
{
|
||||
struct dbr_ctrl_short *pvalue
|
||||
= (struct dbr_ctrl_short *)pbuffer;
|
||||
dbr_short_t *pshort = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf("\n\t%8d %8d %8d %8d %8d %8d",
|
||||
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
|
||||
pvalue->upper_alarm_limit,pvalue->upper_warning_limit,
|
||||
pvalue->lower_warning_limit,pvalue->lower_alarm_limit);
|
||||
printf(" %8d %8d",
|
||||
pvalue->upper_ctrl_limit,pvalue->lower_ctrl_limit);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pshort++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*pshort);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_CTRL_FLOAT):
|
||||
{
|
||||
struct dbr_ctrl_float *pvalue
|
||||
= (struct dbr_ctrl_float *)pbuffer;
|
||||
dbr_float_t *pfloat = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf(" %3d\n\t%8.3f %8.3f %8.3f %8.3f %8.3f %8.3f",
|
||||
pvalue->precision,
|
||||
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
|
||||
pvalue->upper_alarm_limit,pvalue->upper_warning_limit,
|
||||
pvalue->lower_warning_limit,pvalue->lower_alarm_limit);
|
||||
printf(" %8.3f %8.3f",
|
||||
pvalue->upper_ctrl_limit,pvalue->lower_ctrl_limit);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pfloat++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.4f ",*pfloat);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_CTRL_CHAR):
|
||||
{
|
||||
struct dbr_ctrl_char *pvalue
|
||||
= (struct dbr_ctrl_char *)pbuffer;
|
||||
dbr_char_t *pchar = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf("\n\t%8d %8d %8d %8d %8d %8d",
|
||||
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
|
||||
pvalue->upper_alarm_limit,pvalue->upper_warning_limit,
|
||||
pvalue->lower_warning_limit,pvalue->lower_alarm_limit);
|
||||
printf(" %8d %8d",
|
||||
pvalue->upper_ctrl_limit,pvalue->lower_ctrl_limit);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pchar++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%4d ",(short)(*pchar));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_CTRL_LONG):
|
||||
{
|
||||
struct dbr_ctrl_long *pvalue
|
||||
= (struct dbr_ctrl_long *)pbuffer;
|
||||
dbr_long_t *plong = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf("\n\t%8d %8d %8d %8d %8d %8d",
|
||||
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
|
||||
pvalue->upper_alarm_limit,pvalue->upper_warning_limit,
|
||||
pvalue->lower_warning_limit,pvalue->lower_alarm_limit);
|
||||
printf(" %8d %8d",
|
||||
pvalue->upper_ctrl_limit,pvalue->lower_ctrl_limit);
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,plong++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%d ",*plong);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (DBR_CTRL_DOUBLE):
|
||||
{
|
||||
struct dbr_ctrl_double *pvalue
|
||||
= (struct dbr_ctrl_double *)pbuffer;
|
||||
dbr_double_t *pdouble = &pvalue->value;
|
||||
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
|
||||
pvalue->units);
|
||||
printf(" %3d\n\t%8.3f %8.3f %8.3f %8.3f %8.3f %8.3f",
|
||||
pvalue->precision,
|
||||
(float)(pvalue->upper_disp_limit),
|
||||
(float)(pvalue->lower_disp_limit),
|
||||
(float)(pvalue->upper_alarm_limit),
|
||||
(float)(pvalue->upper_warning_limit),
|
||||
(float)(pvalue->lower_warning_limit),
|
||||
(float)(pvalue->lower_alarm_limit));
|
||||
printf(" %8.3f %8.3f",
|
||||
(float)(pvalue->upper_ctrl_limit),
|
||||
(float)(pvalue->lower_ctrl_limit));
|
||||
if(count==1) printf("\tValue: ");
|
||||
for (i = 0; i < count; i++,pdouble++){
|
||||
if(count!=1 && (i%10 == 0)) printf("\n");
|
||||
printf("%6.6f ",(float)(*pdouble));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user