Commit 9e2fb5c7 authored by claes's avatar claes

Adapted to oo

parent 4d26f05e
...@@ -6525,7 +6525,8 @@ static int rttsys_dichanlist_add( pwr_tObjid chan_objid, ...@@ -6525,7 +6525,8 @@ static int rttsys_dichanlist_add( pwr_tObjid chan_objid,
{ {
rttsys_t_chan_list *chanlist_ptr; rttsys_t_chan_list *chanlist_ptr;
rttsys_t_chan_list *new_objectlist; rttsys_t_chan_list *new_objectlist;
char namebuf[120]; pwr_tOName namebuf;
pwr_tAName aname;
int sts; int sts;
pwr_sAttrRef attrref; pwr_sAttrRef attrref;
int signame_characters; int signame_characters;
...@@ -6594,20 +6595,17 @@ static int rttsys_dichanlist_add( pwr_tObjid chan_objid, ...@@ -6594,20 +6595,17 @@ static int rttsys_dichanlist_add( pwr_tObjid chan_objid,
/* Get signal */ /* Get signal */
sts = gdh_ObjidToName( sts = gdh_AttrrefToName(
((pwr_sClass_ChanDi *)(chanlist_ptr->chan_ptr))->SigChanCon, &((pwr_sClass_ChanDi *)(chanlist_ptr->chan_ptr))->SigChanCon,
namebuf, sizeof( namebuf), cdh_mNName); namebuf, sizeof( namebuf), cdh_mNName);
if ( EVEN(sts)) if ( EVEN(sts)) {
{
chanlist_ptr->connected = 0; chanlist_ptr->connected = 0;
strcpy( chanlist_ptr->signame, "-"); strcpy( chanlist_ptr->signame, "-");
} }
else else {
{
chanlist_ptr->connected = 1; chanlist_ptr->connected = 1;
signame_characters = 53; /* Should be fetched from menu entry... */ signame_characters = 53; /* Should be fetched from menu entry... */
if ( (int)strlen( namebuf) > signame_characters) if ( (int)strlen( namebuf) > signame_characters) {
{
/* Show the last part of the name */ /* Show the last part of the name */
strcpy( chanlist_ptr->signame, "."); strcpy( chanlist_ptr->signame, ".");
strcat( chanlist_ptr->signame, strcat( chanlist_ptr->signame,
...@@ -6617,21 +6615,18 @@ static int rttsys_dichanlist_add( pwr_tObjid chan_objid, ...@@ -6617,21 +6615,18 @@ static int rttsys_dichanlist_add( pwr_tObjid chan_objid,
strcpy( chanlist_ptr->signame, namebuf); strcpy( chanlist_ptr->signame, namebuf);
/* Get a pointer to the value */ /* Get a pointer to the value */
memset( &attrref, 0, sizeof(attrref)); strcpy( aname, namebuf);
sts = gdh_ClassAttrToAttrref( pwr_cClass_Di, ".ActualValue", &attrref); strcat( aname, ".ActualValue");
if ( EVEN(sts)) return sts; sts = gdh_NameToAttrref( pwr_cNObjid, aname, &attrref);
attrref.Objid = if ( EVEN(sts)) return sts;
((pwr_sClass_ChanDi *)(chanlist_ptr->chan_ptr))->SigChanCon; if ( local) {
if ( local)
{
/* Get a direct link to the original object */ /* Get a direct link to the original object */
sts = gdh_DLRefObjectInfoAttrref ( &attrref, sts = gdh_DLRefObjectInfoAttrref ( &attrref,
(pwr_tAddress *) &chanlist_ptr->value_ptr, (pwr_tAddress *) &chanlist_ptr->value_ptr,
&chanlist_ptr->value_subid); &chanlist_ptr->value_subid);
if (EVEN(sts)) return sts; if (EVEN(sts)) return sts;
} }
else else {
{
/* Get a subscription to the original object */ /* Get a subscription to the original object */
sts = gdh_SubRefObjectInfoAttrref( &attrref, sts = gdh_SubRefObjectInfoAttrref( &attrref,
&chanlist_ptr->value_subid); &chanlist_ptr->value_subid);
...@@ -7115,7 +7110,8 @@ static int rttsys_dochanlist_add( pwr_tObjid chan_objid, ...@@ -7115,7 +7110,8 @@ static int rttsys_dochanlist_add( pwr_tObjid chan_objid,
{ {
rttsys_t_chan_list *chanlist_ptr; rttsys_t_chan_list *chanlist_ptr;
rttsys_t_chan_list *new_objectlist; rttsys_t_chan_list *new_objectlist;
char namebuf[120]; pwr_tOName namebuf;
pwr_tAName aname;
int sts; int sts;
pwr_sAttrRef attrref; pwr_sAttrRef attrref;
int signame_characters; int signame_characters;
...@@ -7187,8 +7183,8 @@ static int rttsys_dochanlist_add( pwr_tObjid chan_objid, ...@@ -7187,8 +7183,8 @@ static int rttsys_dochanlist_add( pwr_tObjid chan_objid,
((pwr_sClass_ChanDi *)(chanlist_ptr->chan_ptr))->Identity); ((pwr_sClass_ChanDi *)(chanlist_ptr->chan_ptr))->Identity);
/* Get signal */ /* Get signal */
sts = gdh_ObjidToName( sts = gdh_AttrrefToName(
((pwr_sClass_ChanDo *)(chanlist_ptr->chan_ptr))->SigChanCon, &((pwr_sClass_ChanDo *)(chanlist_ptr->chan_ptr))->SigChanCon,
namebuf, sizeof( namebuf), cdh_mNName); namebuf, sizeof( namebuf), cdh_mNName);
if ( EVEN(sts)) if ( EVEN(sts))
{ {
...@@ -7210,11 +7206,10 @@ static int rttsys_dochanlist_add( pwr_tObjid chan_objid, ...@@ -7210,11 +7206,10 @@ static int rttsys_dochanlist_add( pwr_tObjid chan_objid,
strcpy( chanlist_ptr->signame, namebuf); strcpy( chanlist_ptr->signame, namebuf);
/* Get a pointer to the value */ /* Get a pointer to the value */
memset( &attrref, 0, sizeof(attrref)); strcpy( aname, namebuf);
sts = gdh_ClassAttrToAttrref( pwr_cClass_Di, ".ActualValue", &attrref); strcat( aname, ".ActualValue");
if ( EVEN(sts)) return sts; sts = gdh_NameToAttrref( pwr_cNObjid, aname, &attrref);
attrref.Objid = if ( EVEN(sts)) return sts;
((pwr_sClass_ChanDo *)(chanlist_ptr->chan_ptr))->SigChanCon;
if ( local) if ( local)
{ {
/* Get a direct link to the original object */ /* Get a direct link to the original object */
...@@ -7687,7 +7682,8 @@ static int rttsys_aichanlist_add( pwr_tObjid chan_objid, ...@@ -7687,7 +7682,8 @@ static int rttsys_aichanlist_add( pwr_tObjid chan_objid,
{ {
rttsys_t_chan_list *chanlist_ptr; rttsys_t_chan_list *chanlist_ptr;
rttsys_t_chan_list *new_objectlist; rttsys_t_chan_list *new_objectlist;
char namebuf[120]; pwr_tOName namebuf;
pwr_tAName aname;
int sts; int sts;
pwr_sAttrRef attrref; pwr_sAttrRef attrref;
int signame_characters; int signame_characters;
...@@ -7755,8 +7751,8 @@ static int rttsys_aichanlist_add( pwr_tObjid chan_objid, ...@@ -7755,8 +7751,8 @@ static int rttsys_aichanlist_add( pwr_tObjid chan_objid,
((pwr_sClass_ChanAi *)(chanlist_ptr->chan_ptr))->Identity); ((pwr_sClass_ChanAi *)(chanlist_ptr->chan_ptr))->Identity);
/* Get signal */ /* Get signal */
sts = gdh_ObjidToName( sts = gdh_AttrrefToName(
((pwr_sClass_ChanAi *)(chanlist_ptr->chan_ptr))->SigChanCon, &((pwr_sClass_ChanAi *)(chanlist_ptr->chan_ptr))->SigChanCon,
namebuf, sizeof( namebuf), cdh_mNName); namebuf, sizeof( namebuf), cdh_mNName);
if ( EVEN(sts)) if ( EVEN(sts))
{ {
...@@ -7778,11 +7774,10 @@ static int rttsys_aichanlist_add( pwr_tObjid chan_objid, ...@@ -7778,11 +7774,10 @@ static int rttsys_aichanlist_add( pwr_tObjid chan_objid,
strcpy( chanlist_ptr->signame, namebuf); strcpy( chanlist_ptr->signame, namebuf);
/* Get a pointer to the value */ /* Get a pointer to the value */
memset( &attrref, 0, sizeof(attrref)); strcpy( aname, namebuf);
sts = gdh_ClassAttrToAttrref( pwr_cClass_Ai, ".RawValue", &attrref); strcat( aname, ".RawValue");
if ( EVEN(sts)) return sts; sts = gdh_NameToAttrref( pwr_cNObjid, aname, &attrref);
attrref.Objid = if ( EVEN(sts)) return sts;
((pwr_sClass_ChanAi *)(chanlist_ptr->chan_ptr))->SigChanCon;
if ( local) if ( local)
{ {
/* Get a direct link to the original object */ /* Get a direct link to the original object */
...@@ -8244,7 +8239,8 @@ static int rttsys_aochanlist_add( pwr_tObjid chan_objid, ...@@ -8244,7 +8239,8 @@ static int rttsys_aochanlist_add( pwr_tObjid chan_objid,
{ {
rttsys_t_chan_list *chanlist_ptr; rttsys_t_chan_list *chanlist_ptr;
rttsys_t_chan_list *new_objectlist; rttsys_t_chan_list *new_objectlist;
char namebuf[120]; pwr_tOName namebuf;
pwr_tAName aname;
int sts; int sts;
pwr_sAttrRef attrref; pwr_sAttrRef attrref;
int signame_characters; int signame_characters;
...@@ -8312,8 +8308,8 @@ static int rttsys_aochanlist_add( pwr_tObjid chan_objid, ...@@ -8312,8 +8308,8 @@ static int rttsys_aochanlist_add( pwr_tObjid chan_objid,
((pwr_sClass_ChanAo *)(chanlist_ptr->chan_ptr))->Identity); ((pwr_sClass_ChanAo *)(chanlist_ptr->chan_ptr))->Identity);
/* Get signal */ /* Get signal */
sts = gdh_ObjidToName( sts = gdh_AttrrefToName(
((pwr_sClass_ChanAo *)(chanlist_ptr->chan_ptr))->SigChanCon, &((pwr_sClass_ChanAo *)(chanlist_ptr->chan_ptr))->SigChanCon,
namebuf, sizeof( namebuf), cdh_mNName); namebuf, sizeof( namebuf), cdh_mNName);
if ( EVEN(sts)) if ( EVEN(sts))
{ {
...@@ -8337,11 +8333,10 @@ static int rttsys_aochanlist_add( pwr_tObjid chan_objid, ...@@ -8337,11 +8333,10 @@ static int rttsys_aochanlist_add( pwr_tObjid chan_objid,
if ( !signal_test_mode) if ( !signal_test_mode)
{ {
/* Get a pointer to the value */ /* Get a pointer to the value */
memset( &attrref, 0, sizeof(attrref)); strcpy( aname, namebuf);
sts = gdh_ClassAttrToAttrref( pwr_cClass_Ao, ".ActualValue", &attrref); strcat( aname, ".ActualValue");
if ( EVEN(sts)) return sts; sts = gdh_NameToAttrref( pwr_cNObjid, aname, &attrref);
attrref.Objid = if ( EVEN(sts)) return sts;
((pwr_sClass_ChanAo *)(chanlist_ptr->chan_ptr))->SigChanCon;
if ( local) if ( local)
{ {
/* Get a direct link to the original object */ /* Get a direct link to the original object */
...@@ -8843,7 +8838,8 @@ static int rttsys_cochanlist_add( pwr_tObjid chan_objid, ...@@ -8843,7 +8838,8 @@ static int rttsys_cochanlist_add( pwr_tObjid chan_objid,
{ {
rttsys_t_chan_list *chanlist_ptr; rttsys_t_chan_list *chanlist_ptr;
rttsys_t_chan_list *new_objectlist; rttsys_t_chan_list *new_objectlist;
char namebuf[120]; pwr_tOName namebuf;
pwr_tAName aname;
int sts; int sts;
pwr_sAttrRef attrref; pwr_sAttrRef attrref;
int signame_characters; int signame_characters;
...@@ -8911,8 +8907,8 @@ static int rttsys_cochanlist_add( pwr_tObjid chan_objid, ...@@ -8911,8 +8907,8 @@ static int rttsys_cochanlist_add( pwr_tObjid chan_objid,
((pwr_sClass_ChanCo *)(chanlist_ptr->chan_ptr))->Identity); ((pwr_sClass_ChanCo *)(chanlist_ptr->chan_ptr))->Identity);
/* Get signal */ /* Get signal */
sts = gdh_ObjidToName( sts = gdh_AttrrefToName(
((pwr_sClass_ChanCo *)(chanlist_ptr->chan_ptr))->SigChanCon, &((pwr_sClass_ChanCo *)(chanlist_ptr->chan_ptr))->SigChanCon,
namebuf, sizeof( namebuf), cdh_mNName); namebuf, sizeof( namebuf), cdh_mNName);
if ( EVEN(sts)) if ( EVEN(sts))
{ {
...@@ -8934,11 +8930,10 @@ static int rttsys_cochanlist_add( pwr_tObjid chan_objid, ...@@ -8934,11 +8930,10 @@ static int rttsys_cochanlist_add( pwr_tObjid chan_objid,
strcpy( chanlist_ptr->signame, namebuf); strcpy( chanlist_ptr->signame, namebuf);
/* Get a pointer to the value */ /* Get a pointer to the value */
memset( &attrref, 0, sizeof(attrref)); strcpy( aname, namebuf);
sts = gdh_ClassAttrToAttrref( pwr_cClass_Co, ".RawValue", &attrref); strcat( aname, ".RawValue");
if ( EVEN(sts)) return sts; sts = gdh_NameToAttrref( pwr_cNObjid, aname, &attrref);
attrref.Objid = if ( EVEN(sts)) return sts;
((pwr_sClass_ChanCo *)(chanlist_ptr->chan_ptr))->SigChanCon;
if ( local) if ( local)
{ {
/* Get a direct link to the original object */ /* Get a direct link to the original object */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment