Change how ...Show is generated, minor refactoring and fix in ts plugin
This commit is contained in:
committed by
Michael Davidsaver
parent
d2abc71527
commit
444a200b61
@@ -642,13 +642,10 @@ void dbChannelShow(dbChannel *chan, int level, const unsigned short indent)
|
||||
int count = ellCount(&chan->filters);
|
||||
int pre = ellCount(&chan->pre_chain);
|
||||
int post = ellCount(&chan->post_chain);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < indent; i++) printf(" ");
|
||||
printf("channel name: %s\n", chan->name);
|
||||
for (i = 0; i < indent; i++) printf(" ");
|
||||
printf("%*schannel name: %s\n", indent, "", chan->name);
|
||||
/* FIXME: show field_type as text */
|
||||
printf(" field_type=%d (%dB), %ld element%s, %d filter%s",
|
||||
printf("%*s field_type=%d (%dB), %ld element%s, %d filter%s", indent, "",
|
||||
chan->addr.field_type, chan->addr.field_size, elems, elems == 1 ? "" : "s",
|
||||
count, count == 1 ? "" : "s");
|
||||
if (count)
|
||||
@@ -658,9 +655,8 @@ void dbChannelShow(dbChannel *chan, int level, const unsigned short indent)
|
||||
if (level > 0)
|
||||
dbChannelFilterShow(chan, level - 1, indent + 2);
|
||||
if (count) {
|
||||
for (i = 0; i < indent; i++) printf(" ");
|
||||
/* FIXME: show field_type as text */
|
||||
printf(" final field_type=%d (%dB), %ld element%s\n",
|
||||
printf("%*s final field_type=%d (%dB), %ld element%s\n", indent, "",
|
||||
chan->final_type, chan->final_field_size, felems, felems == 1 ? "" : "s");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <chfPlugin.h>
|
||||
#include <db_field_log.h>
|
||||
|
||||
static db_field_log* tsFilter(void* pvt, dbChannel *chan, db_field_log *pfl) {
|
||||
static db_field_log* filter(void* pvt, dbChannel *chan, db_field_log *pfl) {
|
||||
epicsTimeStamp now;
|
||||
epicsTimeGetCurrent(&now);
|
||||
|
||||
@@ -32,17 +32,15 @@ static db_field_log* tsFilter(void* pvt, dbChannel *chan, db_field_log *pfl) {
|
||||
static void channelRegisterPre(dbChannel *chan, void *pvt,
|
||||
chPostEventFunc **cb_out, void **arg_out, db_field_log *probe)
|
||||
{
|
||||
*cb_out = tsFilter;
|
||||
*cb_out = filter;
|
||||
}
|
||||
|
||||
void channel_report(dbChannel *chan, void *user, int level, const unsigned short indent)
|
||||
static void channel_report(dbChannel *chan, void *pvt, int level, const unsigned short indent)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < indent; i++) printf(" ");
|
||||
printf(" plugin ts\n");
|
||||
printf("%*s plugin ts\n", indent, "");
|
||||
}
|
||||
|
||||
static chfPluginIf tsPif = {
|
||||
static chfPluginIf pif = {
|
||||
NULL, /* allocPvt, */
|
||||
NULL, /* freePvt, */
|
||||
|
||||
@@ -63,7 +61,7 @@ static void tsInitialize(void)
|
||||
if(!firstTime) return;
|
||||
firstTime = 0;
|
||||
|
||||
chfPluginRegister("ts", &tsPif, NULL);
|
||||
chfPluginRegister("ts", &pif, NULL);
|
||||
}
|
||||
|
||||
epicsExportRegistrar(tsInitialize);
|
||||
|
||||
Reference in New Issue
Block a user