Commit 7f8c2a3c authored by claes's avatar claes

Reference attributename also for toggledig

parent 42ca1097
/*
* Proview $Id: ge_dyn.cpp,v 1.56 2007-10-16 07:57:20 claes Exp $
* Proview $Id: ge_dyn.cpp,v 1.57 2007-11-01 08:46:27 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -9174,6 +9174,9 @@ int GeToggleDig::action( grow_tObject object, glow_tEvent event)
break;
db = dyn->parse_attr_name( attribute, parsed_name, &inverted, &attr_type, &attr_size);
if ( parsed_name[0] == '&')
dyn->graph->get_reference_name( parsed_name, parsed_name);
switch ( db) {
case graph_eDatabase_Gdh:
sts = gdh_GetObjectInfo( parsed_name, &value, sizeof(value));
......
/*
* Proview $Id: ge_graph.cpp,v 1.44 2007-09-19 15:07:22 claes Exp $
* Proview $Id: ge_graph.cpp,v 1.45 2007-11-01 08:46:27 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -4093,16 +4093,14 @@ int Graph::ccm_get_variable( char *name, int type, void *data)
}
int Graph::ref_object_info( glow_eCycle cycle, char *name, void **data,
pwr_tSubid *subid, unsigned int size)
int Graph::get_reference_name( char *name, char *tname)
{
int dt;
pwr_tAName aname;
pwr_tStatus sts;
if ( name[0] == '&') {
// Name contains a reference, get the reference
pwr_tAName refname;
pwr_tAName aname;
pwr_tAName refattrname = "";
char *s;
pwr_sAttrRef aref;
......@@ -4124,6 +4122,25 @@ int Graph::ref_object_info( glow_eCycle cycle, char *name, void **data,
if ( EVEN(sts)) return sts;
strcat( aname, refattrname);
strcpy( tname, aname);
}
else
strcpy( tname, name);
return 1;
}
int Graph::ref_object_info( glow_eCycle cycle, char *name, void **data,
pwr_tSubid *subid, unsigned int size)
{
int dt;
pwr_tAName aname;
pwr_tStatus sts;
if ( name[0] == '&') {
sts = get_reference_name( name, aname);
if ( EVEN(sts)) return sts;
}
else
strcpy( aname, name);
......
/*
* Proview $Id: ge_graph.h,v 1.30 2007-09-19 15:07:22 claes Exp $
* Proview $Id: ge_graph.h,v 1.31 2007-11-01 08:46:27 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -1136,6 +1136,13 @@ class Graph {
/*! \return 1 if graph can be exported as a java frame, else 0. */
int is_javaapplication();
//! Translate a reference name.
/*!
\param name Attribute name.
\param tname Converted name.
*/
int get_reference_name( char *name, char *tname);
//! Subscribe or link to an attribute in rtdb.
/*!
\param cycle Cycle for the dynamics. This sets the subscription time.
......
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