Commit b295f403 authored by claes's avatar claes

New ge fetched from 3.9 and fast curves implemented

parent fb0ef6e2
......@@ -71,6 +71,15 @@ static pwr_tStatus OpenCrossref( xmenu_sMenuCall *ip)
//
static pwr_tStatus OpenCrossrefFilter( xmenu_sMenuCall *ip)
{
pwr_tClassId classid;
pwr_tStatus sts;
sts = gdh_GetObjectClass( ip->Pointed.Objid, &classid);
if ( EVEN(sts)) return sts;
if ( classid == pwr_eClass_PlantHier)
return XNAV__INVISIBLE;
return 1;
}
......
/* rt_xtt.cpp -- Display plant and node hiererachy
PROVIEW/R
Copyright (C) 1996 by Comator Process AB.
<Description>. */
#include "flow_std.h"
#include <stdio.h>
#include <stdlib.h>
extern "C" {
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "rt_gdh.h"
#include "rt_gdh_msg.h"
#include "co_cdh.h"
#include "co_time.h"
#include "rt_xnav_msg.h"
}
#include <Xm/Xm.h>
#include <Xm/XmP.h>
#include <Xm/Text.h>
#include <Mrm/MrmPublic.h>
#include <X11/Intrinsic.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget.h"
#include "glow_growctx.h"
#include "glow_growapi.h"
#include "glow_growwidget.h"
#include "glow_curvectx.h"
#include "glow_curveapi.h"
#include "glow_curvewidget.h"
#include "xtt_xnav.h"
#include "rt_fast.h"
#include "xtt_fast.h"
extern "C" {
#include "flow_x.h"
}
static void fast_close_cb( void *ctx);
static void fast_scan( XttFast *fast);
XttFast::XttFast(
void *parent_ctx,
Widget parent_wid,
char *name,
Widget *w,
pwr_tObjid fast_object,
int *sts) :
xnav(parent_ctx), parent_widget(parent_wid), fast_cnt(0), close_cb(0), first_scan(1),
axis_configured(false)
{
pwr_tObjid objid = pwr_cNObjid;
char fast_name[120];
char attr_name[120];
pwr_sClass_DsFastCurve fp;
int i, j;
char title[120];
*sts = XNAV__SUCCESS;
// Get current status of the fast objects
i = 0;
objid = fast_object;
if ( cdh_ObjidIsNull( objid)) {
*sts = XNAV__FASTCONFIG;
return;
}
*sts = gdh_ObjidToName( objid, fast_name, sizeof(fast_name),
cdh_mNName);
if (EVEN(*sts)) return;
*sts = gdh_GetObjectInfo( fast_name, &fp, sizeof(fp));
if ( EVEN(*sts)) return;
max_points = fp.NoOfPoints;
fast_function = fp.Function;
strcpy( attr_name, fast_name);
strcat( attr_name, ".TriggTime");
gdh_NameToAttrref( pwr_cNObjid, attr_name, &trigg_time_attr);
if ( fast_function & fast_mFunction_BeforeTrigg) {
strcpy( attr_name, fast_name);
strcat( attr_name, ".TriggIndex");
gdh_NameToAttrref( pwr_cNObjid, attr_name, &trigg_index_attr);
strcpy( attr_name, fast_name);
strcat( attr_name, ".FirstIndex");
gdh_NameToAttrref( pwr_cNObjid, attr_name, &first_index_attr);
strcpy( attr_name, fast_name);
strcat( attr_name, ".LastIndex");
gdh_NameToAttrref( pwr_cNObjid, attr_name, &last_index_attr);
}
// Create data for time axis
gcd = new GeCurveData( curve_eDataType_DsTrend);
gcd->data[0] = (double *) malloc( 8 * max_points);
strcpy( gcd->name[0], "Time");
gcd->axis_type[0] = curve_eAxis_x;
memcpy( &time_buff, &fp.TimeBuffer, sizeof(time_buff));
fast_cnt = 0;
for ( i = 0; i < FAST_CURVES; i++) {
if ( fp.CurveValid[i]) {
gcd->data[fast_cnt + 1] = (double *) calloc( 1, 8 * max_points);
gcd->axis_type[fast_cnt + 1] = curve_eAxis_y;
memcpy( &buff[fast_cnt], &fp.Buffers[i], sizeof(buff[0]));
type[fast_cnt] = (pwr_eType) fp.AttributeType[i];
fast_idx[i] = fast_cnt + 1;
curve_idx[fast_cnt + 1] = i;
*sts = gdh_AttrrefToName( &fp.Attribute[i], attr_name,
sizeof(attr_name), cdh_mNName);
if (EVEN(*sts)) continue;
strcpy( gcd->name[fast_cnt + 1], attr_name);
fast_cnt++;
}
}
// Subscribe to object
strcpy( attr_name, fast_name);
strcat( attr_name, ".New");
*sts = gdh_RefObjectInfo( attr_name, (pwr_tAddress *)&new_p,
&new_subid, sizeof(pwr_tBoolean));
if ( EVEN(*sts)) return;
for ( i = 0; i < fast_cnt; i++) {
switch( type[i]) {
case pwr_eType_Float32:
case pwr_eType_Int32:
case pwr_eType_UInt32:
element_size[i] = 4;
break;
case pwr_eType_Float64:
element_size[i] = 8;
break;
case pwr_eType_Int16:
case pwr_eType_UInt16:
element_size[i] = 2;
break;
case pwr_eType_Int8:
case pwr_eType_UInt8:
element_size[i] = 1;
break;
default:
element_size[i] = 4;
}
}
gcd->cols = fast_cnt + 1;
gcd->rows = max_points;
axis_configured = true;
for ( i = 0; i < FAST_CURVES; i++) {
if ( fp.CurveValid[i]) {
j = fast_idx[i];
if ( fp.YMinValue[i] != fp.YMaxValue[i])
gcd->scale( gcd->axis_type[j], gcd->value_type[j],
fp.YMinValue[i], fp.YMaxValue[i],
&gcd->min_value_axis[j], &gcd->max_value_axis[j],
&gcd->lines[j], gcd->format[j],
&gcd->axis_width[j], 1, 1);
else
axis_configured = false;
}
}
if ( fp.Active)
first_scan = 0;
fast_scan( this);
gcd->select_color( 0);
if ( strcmp( fp.Title, "") != 0)
strcpy( title, fp.Title);
else
strcpy( title, name);
curve = new GeCurve( this, parent_widget, title, NULL, gcd, 0);
curve->close_cb = fast_close_cb;
// timerid = XtAppAddTimeOut(
// XtWidgetToApplicationContext(parent_widget), 1000,
// (XtTimerCallbackProc)fast_scan, this);
}
XttFast::~XttFast()
{
XtRemoveTimeOut( timerid);
for ( int i = 0; i < fast_cnt; i++) {
gdh_UnrefObjectInfo( new_subid);
}
delete curve;
}
void XttFast::pop()
{
curve->pop();
}
static void fast_close_cb( void *ctx)
{
XttFast *fast = (XttFast *) ctx;
if ( fast->close_cb)
(fast->close_cb)( fast->xnav, fast);
else
delete fast;
}
void fast_scan( XttFast *fast)
{
int i, j, k;
pwr_tStatus sts;
int trigg_index, first_index, last_index;
// Check if any new value
if ( (*fast->new_p && !fast->old_new) || fast->first_scan) {
// Update curves
if ( fast->fast_function & fast_mFunction_BeforeTrigg) {
// Get first, last and trigg index
sts = gdh_GetObjectInfoAttrref( &fast->trigg_index_attr, &trigg_index,
sizeof(trigg_index));
if ( EVEN(sts)) return;
sts = gdh_GetObjectInfoAttrref( &fast->first_index_attr, &first_index,
sizeof(first_index));
if ( EVEN(sts)) return;
sts = gdh_GetObjectInfoAttrref( &fast->last_index_attr, &last_index,
sizeof(last_index));
if ( EVEN(sts)) return;
// Read into temporary buffer
pwr_tFloat32 *tmp = (pwr_tFloat32 *)calloc( fast->max_points, 4);
sts = gdh_GetObjectInfoAttrref( &fast->time_buff, tmp,
fast->max_points * 4);
if ( EVEN(sts)) return;
k = first_index;
for ( j = 0; j < fast->max_points; j++) {
if ( k >= fast->max_points)
k = 0;
fast->gcd->data[0][j] = tmp[k] - tmp[trigg_index];
if ( k == last_index)
break;
k++;
}
// If to few points, fill with dummy data
for ( ; j < fast->max_points; j++) {
fast->gcd->data[0][j] = tmp[k] - tmp[trigg_index];
}
free( tmp);
}
else {
pwr_tFloat32 *tmp = (pwr_tFloat32 *)calloc( fast->max_points, 4);
sts = gdh_GetObjectInfoAttrref( &fast->time_buff, tmp,
fast->max_points * 4);
if ( EVEN(sts)) return;
for ( j = 0; j < fast->max_points; j++)
fast->gcd->data[0][j] = tmp[j];
free( tmp);
}
for ( i = 0; i < fast->fast_cnt; i++) {
if ( fast->fast_function & fast_mFunction_BeforeTrigg) {
// Read into temporary buffer
void *tmp = calloc( fast->max_points, fast->element_size[i]);
sts = gdh_GetObjectInfoAttrref( &fast->buff[i], tmp,
fast->max_points * fast->element_size[i]);
if ( EVEN(sts)) return;
k = first_index;
for ( j = 0; j < fast->max_points; j++) {
if ( k >= fast->max_points)
k = 0;
switch( fast->type[i]) {
case pwr_eType_Float32:
fast->gcd->data[i + 1][j] = ((pwr_tFloat32 *)tmp)[k];
break;
case pwr_eType_Float64:
fast->gcd->data[i + 1][j] = ((pwr_tFloat64 *)tmp)[k];
break;
case pwr_eType_Int32:
fast->gcd->data[i + 1][j] = ((pwr_tInt32 *)tmp)[k];
break;
case pwr_eType_UInt32:
fast->gcd->data[i + 1][j] = ((pwr_tUInt32 *)tmp)[k];
break;
case pwr_eType_Int16:
fast->gcd->data[i + 1][j] = ((pwr_tUInt16 *)tmp)[k];
break;
case pwr_eType_UInt16:
fast->gcd->data[i + 1][j] = ((pwr_tUInt16 *)tmp)[k];
break;
case pwr_eType_Int8:
fast->gcd->data[i + 1][j] = ((pwr_tInt8 *)tmp)[k];
break;
case pwr_eType_UInt8:
fast->gcd->data[i + 1][j] = ((pwr_tUInt8 *)tmp)[k];
break;
default:
;
}
if ( k == last_index)
break;
k++;
}
// If to few points, fill with 0
for ( ; j < fast->max_points; j++) {
switch( fast->type[i]) {
case pwr_eType_Float32:
fast->gcd->data[i + 1][j] = ((pwr_tFloat32 *)tmp)[k];
break;
case pwr_eType_Float64:
fast->gcd->data[i + 1][j] = ((pwr_tFloat64 *)tmp)[k];
break;
case pwr_eType_Int32:
fast->gcd->data[i + 1][j] = ((pwr_tInt32 *)tmp)[k];
break;
case pwr_eType_UInt32:
fast->gcd->data[i + 1][j] = ((pwr_tUInt32 *)tmp)[k];
break;
case pwr_eType_Int16:
fast->gcd->data[i + 1][j] = ((pwr_tInt16 *)tmp)[k];
break;
case pwr_eType_UInt16:
fast->gcd->data[i + 1][j] = ((pwr_tInt16 *)tmp)[k];
break;
case pwr_eType_Int8:
fast->gcd->data[i + 1][j] = ((pwr_tInt8 *)tmp)[k];
break;
case pwr_eType_UInt8:
fast->gcd->data[i + 1][j] = ((pwr_tUInt8 *)tmp)[k];
break;
default: ;
}
}
free(tmp);
}
else {
void *tmp = calloc( fast->max_points, fast->element_size[i]);
sts = gdh_GetObjectInfoAttrref( &fast->buff[i], tmp,
fast->max_points * fast->element_size[i]);
if ( EVEN(sts)) return;
for ( j = 0; j < fast->max_points; j++) {
switch( fast->type[i]) {
case pwr_eType_Float32:
fast->gcd->data[i + 1][j] = ((pwr_tFloat32 *)tmp)[j];
break;
case pwr_eType_Float64:
fast->gcd->data[i + 1][j] = ((pwr_tFloat64 *)tmp)[j];
break;
case pwr_eType_Int32:
fast->gcd->data[i + 1][j] = ((pwr_tInt32 *)tmp)[j];
break;
case pwr_eType_UInt32:
fast->gcd->data[i + 1][j] = ((pwr_tUInt32 *)tmp)[j];
break;
case pwr_eType_Int16:
fast->gcd->data[i + 1][j] = ((pwr_tInt16 *)tmp)[j];
break;
case pwr_eType_UInt16:
fast->gcd->data[i + 1][j] = ((pwr_tInt16 *)tmp)[j];
break;
case pwr_eType_Int8:
fast->gcd->data[i + 1][j] = ((pwr_tInt8 *)tmp)[j];
break;
case pwr_eType_UInt8:
fast->gcd->data[i + 1][j] = ((pwr_tUInt8 *)tmp)[j];
break;
default: ;
}
}
free(tmp);
}
}
// Get trigg time
pwr_tTime trigg_time;
sts = gdh_GetObjectInfoAttrref( &fast->trigg_time_attr, &trigg_time,
sizeof(trigg_time));
if ( EVEN(sts)) return;
if ( !fast->axis_configured) {
fast->gcd->get_borders();
fast->gcd->get_default_axis();
if ( !fast->first_scan) {
fast->curve->configure_curves();
fast->curve->configure_axes();
fast->curve->set_time( trigg_time);
}
}
else {
fast->gcd->get_borders();
// fast->gcd->get_default_axis();
fast->gcd->scale( fast->gcd->axis_type[0], fast->gcd->value_type[0],
fast->gcd->min_value[0], fast->gcd->max_value[0],
&fast->gcd->min_value_axis[0], &fast->gcd->max_value_axis[0],
&fast->gcd->lines[0], fast->gcd->format[0],
&fast->gcd->axis_width[0], 1, 1);
if ( !fast->first_scan) {
fast->curve->configure_curves();
// fast->curve->configure_axes();
fast->curve->set_time( trigg_time);
}
}
fast->first_scan = 0;
}
fast->old_new = *fast->new_p;
fast->timerid = XtAppAddTimeOut(
XtWidgetToApplicationContext(fast->parent_widget),
1000,
(XtTimerCallbackProc)fast_scan, fast);
}
#ifndef xtt_fast_h
#define xtt_fast_h
/* xtt_fast.h -- Fast curves
PROVIEW/R
Copyright (C) 2003 by SSAB Oxelosund AB.
<Description>. */
#if defined __cplusplus
extern "C" {
#endif
#ifndef pwr_h
# include "pwr.h"
#endif
#ifndef ge_curve_h
# include "ge_curve.h"
#endif
#ifndef rt_fast_h
# include "rt_fast.h"
#endif
/*! \file xtt_fast.h
\brief Contains the XttFast class. */
/*! \addtogroup Xtt */
/*@{*/
#define XTT_FAST_MAX 20
//! Window that displays fast curve in a DsFastCurve object.
/*!
A DsFastCurve references a data array for the time axis, and up to 10 data arrays
with stored data. These arrays are displayed in the XttFast window. The measurement
of these curves are triggered manually, on a digital signal, or on a level of one of
the attributes. When the measurement is completed this is signaled with the New attribute
in the DsFastCurve object. The XttFast window then has to read the new data and
reconfigure the curves. XttFast uses the GeCurve class to display the curves.
*/
class XttFast {
public:
//! Constructor
XttFast(
void *xn_parent_ctx,
Widget xn_parent_wid,
char *xn_name,
Widget *w,
pwr_tObjid fast_object,
int *sts);
void *xnav; //!< Pointer to parent XNav.
Widget parent_widget; //!< Parent widget.
int fast_cnt; //!< Number of fast curves.
GeCurveData *gcd; //!< Curve data for GeCurve object.
GeCurve *curve; //!< Curve window.
pwr_tRefId new_subid; //!< Subid of New attribute in DsFastCurve.
pwr_tBoolean *new_p; //!< Pointer to New attribute, which indicates new curve data.
pwr_sAttrRef time_buff; //!< Attrref to data array for time axis.
pwr_sAttrRef buff[FAST_CURVES]; //!< Attrefs to data arrays for curves.
pwr_eType type[FAST_CURVES]; //!< Types of curves.
int fast_idx[FAST_CURVES]; //!< Conversion from DsFastCurve index to GeCurveData index.
int curve_idx[XTT_FAST_MAX]; //!< Conversion from GeCurveData index to DsFastCurve index.
int element_size[XTT_FAST_MAX]; //!< Size of data element in curves.
int max_points; //!< Max number of points in curves.
XtIntervalId timerid; //!< Time id for scan.
void (*close_cb)( void *, XttFast *); //!< Close callback to parent.
pwr_tBoolean old_new; //!< Old value of new. Used to detect edge of New.
pwr_tMask fast_function; //!< Function configured in DsFastCurve object.
bool first_scan; //!< Indicates that this is the first scan.
bool axis_configured; //!< Axis range is configured in DsFastCurve object.
pwr_sAttrRef trigg_index_attr; //!< Attrref to TriggIndex attribute in DsFastCurve object.
pwr_sAttrRef first_index_attr; //!< Attrref to FirstIndex attribute in DsFastCurve object.
pwr_sAttrRef last_index_attr; //!< Attrref to LastIndex attribute in DsFastCurve object.
pwr_sAttrRef trigg_time_attr; //!< Attrref to TriggTime attribute in DsFastCurve object.
//! Pop fast window.
void pop();
//! Destructor
~XttFast();
};
/*@}*/
#if defined __cplusplus
}
#endif
#endif
......@@ -30,6 +30,7 @@ extern "C" {
#include "rt_gdh_msg.h"
#include "co_cdh.h"
#include "co_time.h"
#include "co_mrm_util.h"
}
#include "glow_growctx.h"
......@@ -49,6 +50,43 @@ extern "C" {
static void ge_message( void *ctx, char severity, char *message);
static void ge_enable_set_focus( ge_tCtx gectx)
{
gectx->set_focus_disabled--;
}
static void ge_disable_set_focus( ge_tCtx gectx, int time)
{
gectx->set_focus_disabled++;
gectx->focus_timerid = XtAppAddTimeOut(
XtWidgetToApplicationContext( gectx->toplevel), time,
(XtTimerCallbackProc)ge_enable_set_focus, gectx);
}
static void ge_action_inputfocus( Widget w, XmAnyCallbackStruct *data)
{
Arg args[1];
ge_tCtx gectx;
XtSetArg (args[0], XmNuserData, &gectx);
XtGetValues (w, args, 1);
if ( !gectx)
return;
if ( mrm_IsIconicState(w))
return;
if ( gectx->set_focus_disabled)
return;
if ( gectx->graph)
((Graph *)gectx->graph)->set_inputfocus(1);
ge_disable_set_focus( gectx, 400);
}
static void ge_graph_init_cb( void *client_data)
{
ge_tCtx gectx = (ge_tCtx) client_data;
......@@ -107,7 +145,8 @@ static void ge_change_value_cb( void *ge_ctx, void *value_object, char *text)
XtManageChild( gectx->value_dialog);
ge_message( gectx, ' ', "");
XtSetKeyboardFocus( gectx->toplevel, gectx->value_input);
XtCallAcceptFocus( gectx->value_input, CurrentTime);
// XtSetKeyboardFocus( gectx->toplevel, gectx->value_input);
XtSetArg(args[0],XmNvalue, text);
XtSetValues( gectx->value_input, args, 1);
......@@ -147,6 +186,19 @@ static void ge_popup_menu_cb( void *ge_ctx, pwr_sAttrRef attrref,
(gectx->popup_menu_cb)( gectx->parent_ctx, attrref, item_type, utility,
arg, popup);
}
static int ge_call_method_cb( void *ge_ctx, char *method, char *filter,
pwr_sAttrRef attrref, unsigned long item_type, unsigned long utility,
char *arg)
{
ge_tCtx gectx = (ge_tCtx)ge_ctx;
if ( gectx->call_method_cb)
return (gectx->call_method_cb)( gectx->parent_ctx, method, filter, attrref, item_type, utility,
arg);
else return 0;
}
static int ge_is_authorized_cb( void *ge_ctx, unsigned int access)
{
ge_tCtx gectx = (ge_tCtx)ge_ctx;
......@@ -352,12 +404,14 @@ extern "C" ge_tCtx ge_new( Widget parent_wid,
char wname[] = "Proview/R Ge";
static char translations[] =
"<ConfigureNotify>: resize()\n";
"<ConfigureNotify>: resize()\n\
<FocusIn>: ge_xtt_inputfocus()";
static XtTranslations compiled_translations = NULL;
static XtActionsRec actions[] =
{
{"resize", (XtActionProc) ge_action_resize}
{"ge_xtt_inputfocus", (XtActionProc) ge_action_inputfocus},
{"resize", (XtActionProc) ge_action_resize},
};
static MrmRegisterArg reglist[] = {
......@@ -485,6 +539,7 @@ extern "C" ge_tCtx ge_new( Widget parent_wid,
((Graph *)gectx->graph)->is_authorized_cb = &ge_is_authorized_cb;
((Graph *)gectx->graph)->get_current_objects_cb = &ge_get_current_objects_cb;
((Graph *)gectx->graph)->popup_menu_cb = &ge_popup_menu_cb;
((Graph *)gectx->graph)->call_method_cb = &ge_call_method_cb;
XtPopup( gectx->toplevel, XtGrabNone);
......
......@@ -47,9 +47,13 @@ typedef struct ge_sCtx {
int (*is_authorized_cb)(void *, unsigned int);
void (*popup_menu_cb)(void *, pwr_sAttrRef, unsigned long,
unsigned long, char *, Widget *);
int (*call_method_cb)(void *, char *, char *, pwr_sAttrRef,
unsigned long, unsigned long, char *);
int (*get_current_objects_cb)(void *, pwr_sAttrRef **, int **);
int width;
int height;
int set_focus_disabled;
XtIntervalId focus_timerid;
} *ge_tCtx;
void ge_pop( ge_tCtx gectx);
......
......@@ -834,7 +834,7 @@ void Hist::get_hist_list()
printf(" Fel vid skapande av databashandtag avslutar\n");
return;
}
if((ret = dataBaseP->open(dataBaseP, dbName, NULL, DATABASETYPE, DB_RDONLY, 0)) != 0)
if((ret = dataBaseP->open(dataBaseP, 0, dbName, NULL, DATABASETYPE, DB_RDONLY, 0)) != 0)
{
/*error opening/creating db send the mess to errh, then exit*/
printf("error db_open: %s\n", db_strerror(ret));
......
......@@ -14,7 +14,6 @@ extern "C" {
#include "co_dcli.h"
#include "pwr_baseclasses.h"
#include "co_ccm_msg.h"
#include "co_api.h"
#include "flow_x.h"
}
......@@ -44,6 +43,7 @@ extern "C" {
#include "rt_xnav_msg.h"
#include "xtt_xnav.h"
#include "xtt_menu.h"
#include "co_api.h"
pwr_dImport pwr_BindXttMethods($Object);
pwr_dImport pwr_BindXttMethods(PlcPgm);
......
......@@ -239,7 +239,7 @@ XttTrend::XttTrend(
gcd->x_reverse = 1;
gcd->get_borders();
gcd->get_default_axis();
gcd->select_color();
gcd->select_color( 0);
if ( !trend_list) {
// Use axis values from plotgroup object
......
......@@ -66,7 +66,7 @@ static void xnav_xatt_close_cb( void *xnav, void *xatt);
static void xnav_xcrr_close_cb( void *xnav, void *xcrr);
static void xnav_trace_scan( XNav *xnav);
static int xnav_trace_scan_bc( brow_tObject object, void *p);
//static void xnav_type_id_to_name( int type_id, char *type_id_name);
// static void xnav_type_id_to_name( int type_id, char *type_id_name);
static int xnav_trace_connect_bc( brow_tObject object, char *name, char *attr,
flow_eTraceType type, void **p);
static int xnav_trace_disconnect_bc( brow_tObject object);
......
......@@ -9,6 +9,7 @@
#include "flow_std.h"
# include <vector>
# include <stdio.h>
# include <string.h>
# include <stdlib.h>
......@@ -58,6 +59,7 @@ extern "C" {
#include "glow_curvewidget.h"
#include "ge_curve.h"
#include "xtt_trend.h"
#include "xtt_fast.h"
#include "xtt_xcrr.h"
#include "xtt_menu.h"
#include "xtt_url.h"
......@@ -2238,6 +2240,71 @@ static int xnav_open_func( void *client_data,
new XttTrend( xnav, xnav->parent_wid, title_str, &w, objid_vect,
pwr_cNObjid, &sts);
}
else if ( strncmp( arg1_str, "FAST", strlen( arg1_str)) == 0)
{
char name_str[80];
char *name_ptr;
char title_str[80];
pwr_tObjid objid;
Widget w;
int sts;
pwr_tClassId classid;
// Command is "OPEN FAST"
/* Get the name qualifier */
if ( ODD( dcli_get_qualifier( "dcli_arg2", name_str)))
{
if ( name_str[0] != '/')
/* Assume that this is the namestring */
name_ptr = name_str;
else
{
xnav->message('E', "Syntax error");
return XNAV__HOLDCOMMAND;
}
}
else
{
if ( ODD( dcli_get_qualifier( "/NAME", name_str)))
name_ptr = name_str;
else
{
/* Get the selected object */
sts = xnav->get_current_object( &objid, name_str,
sizeof( name_str), cdh_mName_path | cdh_mName_object);
if ( EVEN(sts))
{
xnav->message('E', "Enter name or select an object");
return XNAV__SUCCESS;
}
name_ptr = name_str;
}
}
sts = gdh_NameToObjid( name_str, &objid);
if (EVEN(sts)) {
xnav->message('E', "Object not found");
return XNAV__HOLDCOMMAND;
}
sts = gdh_GetObjectClass( objid, &classid);
if (EVEN(sts)) return sts;
switch ( classid) {
case pwr_cClass_DsFastCurve:
break;
default:
xnav->message('E', "Error in object class");
return XNAV__HOLDCOMMAND;
}
if ( EVEN( dcli_get_qualifier( "/TITLE", title_str))) {
strcpy( title_str, "Fast");
}
new XttFast( xnav, xnav->parent_wid, title_str, &w, objid,
&sts);
}
else if ( strncmp( arg1_str, "URL", strlen( arg1_str)) == 0)
{
char arg2_str[80];
......@@ -4941,6 +5008,7 @@ void XNav::open_graph( char *name, char *filename, int scrollbar, int menu,
&xnav_ge_get_current_objects_cb, &xnav_ge_is_authorized_cb);
gectx->display_in_xnav_cb = xnav_ge_display_in_xnav_cb;
gectx->popup_menu_cb = xnav_popup_menu_cb;
gectx->call_method_cb = xnav_call_method_cb;
appl.insert( applist_eType_Graph, (void *)gectx, pwr_cNObjid, filename,
object_name);
......
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