Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
2889b888
Commit
2889b888
authored
Oct 15, 2010
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SevHist, several sevhist curves in one window, sev plotgroups and plotgroup menu items in sev_xtt
parent
60dd39e9
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
1346 additions
and
366 deletions
+1346
-366
sev/exe/sev_xtt/gtk/xtt_tbl_gtk.cpp
sev/exe/sev_xtt/gtk/xtt_tbl_gtk.cpp
+4
-9
sev/exe/sev_xtt/gtk/xtt_tbl_gtk.h
sev/exe/sev_xtt/gtk/xtt_tbl_gtk.h
+1
-1
sev/exe/sev_xtt/src/xtt_tbl.cpp
sev/exe/sev_xtt/src/xtt_tbl.cpp
+49
-18
sev/exe/sev_xtt/src/xtt_tbl.h
sev/exe/sev_xtt/src/xtt_tbl.h
+3
-1
sev/exe/sev_xtt/src/xtt_tbl_command.cpp
sev/exe/sev_xtt/src/xtt_tbl_command.cpp
+119
-1
sev/exe/sev_xtt/src/xtt_tblnav.cpp
sev/exe/sev_xtt/src/xtt_tblnav.cpp
+167
-98
sev/exe/sev_xtt/src/xtt_tblnav.h
sev/exe/sev_xtt/src/xtt_tblnav.h
+38
-4
src/lib/rt/src/rt_sevcli.c
src/lib/rt/src/rt_sevcli.c
+2
-2
wb/lib/wb/src/wb_c_sevhist.cpp
wb/lib/wb/src/wb_c_sevhist.cpp
+11
-0
wb/lib/wb/src/wb_c_sevhistobject.cpp
wb/lib/wb/src/wb_c_sevhistobject.cpp
+24
-0
xtt/lib/ge/gtk/ge_curve_gtk.cpp
xtt/lib/ge/gtk/ge_curve_gtk.cpp
+2
-2
xtt/lib/ge/src/ge_curve.cpp
xtt/lib/ge/src/ge_curve.cpp
+373
-154
xtt/lib/ge/src/ge_curve.h
xtt/lib/ge/src/ge_curve.h
+2
-1
xtt/lib/glow/src/glow.h
xtt/lib/glow/src/glow.h
+1
-1
xtt/lib/glow/src/glow_growcurve.cpp
xtt/lib/glow/src/glow_growcurve.cpp
+106
-1
xtt/lib/xtt/gtk/xtt_sevhist_gtk.cpp
xtt/lib/xtt/gtk/xtt_sevhist_gtk.cpp
+11
-8
xtt/lib/xtt/gtk/xtt_sevhist_gtk.h
xtt/lib/xtt/gtk/xtt_sevhist_gtk.h
+9
-8
xtt/lib/xtt/gtk/xtt_xnav_gtk.cpp
xtt/lib/xtt/gtk/xtt_xnav_gtk.cpp
+3
-3
xtt/lib/xtt/gtk/xtt_xnav_gtk.h
xtt/lib/xtt/gtk/xtt_xnav_gtk.h
+3
-2
xtt/lib/xtt/src/xtt_fast.cpp
xtt/lib/xtt/src/xtt_fast.cpp
+1
-1
xtt/lib/xtt/src/xtt_sevhist.cpp
xtt/lib/xtt/src/xtt_sevhist.cpp
+289
-18
xtt/lib/xtt/src/xtt_sevhist.h
xtt/lib/xtt/src/xtt_sevhist.h
+11
-6
xtt/lib/xtt/src/xtt_trend.cpp
xtt/lib/xtt/src/xtt_trend.cpp
+1
-1
xtt/lib/xtt/src/xtt_xnav.h
xtt/lib/xtt/src/xtt_xnav.h
+3
-2
xtt/lib/xtt/src/xtt_xnav_command.cpp
xtt/lib/xtt/src/xtt_xnav_command.cpp
+113
-24
No files found.
sev/exe/sev_xtt/gtk/xtt_tbl_gtk.cpp
View file @
2889b888
...
...
@@ -202,19 +202,13 @@ void XttTblGtk::activate_list_layout( GtkWidget *w, gpointer data)
xtt
->
tblnav
->
show_list
();
}
XttSevHist
*
XttTblGtk
::
sevhist_new
(
pwr_tOid
oid
,
char
*
aname
,
bool
sevhistobject
)
XttSevHist
*
XttTblGtk
::
sevhist_new
(
pwr_tOid
*
oidv
,
pwr_tOName
*
anamev
,
pwr_tOName
*
onamev
,
bool
*
sevhistobjectv
)
{
GtkWidget
*
w
;
pwr_tStatus
sts
;
pwr_tOid
oidv
[
2
];
pwr_tOName
anamev
[
2
];
oidv
[
0
]
=
oid
;
oidv
[
1
]
=
pwr_cNOid
;
strncpy
(
anamev
[
0
],
aname
,
sizeof
(
anamev
[
0
]));
return
new
XttSevHistGtk
(
(
void
*
)
this
,
toplevel
,
"SevHist"
,
&
w
,
oidv
,
anamev
,
sevcli
,
&
sts
,
sevhistobject
);
return
new
XttSevHistGtk
(
(
void
*
)
this
,
toplevel
,
"SevHist"
,
&
w
,
oidv
,
anamev
,
onamev
,
sevhistobjectv
,
sevcli
,
&
sts
);
}
CoLogin
*
XttTblGtk
::
login_new
(
const
char
*
name
,
...
...
@@ -487,6 +481,7 @@ XttTblGtk::XttTblGtk( GtkWidget *a_parent_wid,
itemlist
,
item_cnt
,
&
brow_widget
,
&
sts
);
tblnav
->
message_cb
=
&
XttTbl
::
message
;
tblnav
->
is_authorized_cb
=
&
XttTbl
::
is_authorized
;
tblnav
->
command_cb
=
&
XttTbl
::
command_cb
;
gtk_box_pack_start
(
GTK_BOX
(
vbox
),
GTK_WIDGET
(
menu_bar
),
FALSE
,
FALSE
,
0
);
gtk_box_pack_start
(
GTK_BOX
(
vbox
),
GTK_WIDGET
(
tools
),
FALSE
,
FALSE
,
0
);
...
...
sev/exe/sev_xtt/gtk/xtt_tbl_gtk.h
View file @
2889b888
...
...
@@ -49,7 +49,7 @@ class XttTblGtk : public XttTbl {
CoWowEntryGtk
*
cmd_entry
;
void
message
(
char
severity
,
char
*
message
);
XttSevHist
*
sevhist_new
(
pwr_tOid
oid
,
char
*
aname
,
bool
sevhistobject
);
XttSevHist
*
sevhist_new
(
pwr_tOid
*
oidv
,
pwr_tOName
*
anamev
,
pwr_tOName
*
onamev
,
bool
*
sevhistobjectv
);
CoLogin
*
login_new
(
const
char
*
wl_name
,
const
char
*
wl_groupname
,
void
(
*
wl_bc_success
)(
void
*
),
...
...
sev/exe/sev_xtt/src/xtt_tbl.cpp
View file @
2889b888
...
...
@@ -77,6 +77,11 @@ void XttTbl::message( void *xtttbl, char severity, const char *message)
((
XttTbl
*
)
xtttbl
)
->
message
(
severity
,
message
);
}
int
XttTbl
::
command_cb
(
void
*
ctx
,
char
*
cmd
)
{
return
((
XttTbl
*
)
ctx
)
->
command
(
cmd
);
}
int
XttTbl
::
is_authorized
(
void
*
ctx
,
unsigned
int
access
,
int
msg
)
{
return
((
XttTbl
*
)
ctx
)
->
is_authorized
(
access
,
msg
);
...
...
@@ -120,29 +125,48 @@ void XttTbl::activate_print()
void
XttTbl
::
activate_opensevhist
()
{
// sevcli_sHistItem *hi
;
TblNav_sevhistobject
*
hi
;
if
(
!
tblnav
->
get_select
(
&
hi
))
{
ItemBase
*
item
;
if
(
!
tblnav
->
get_select
(
&
item
))
{
message
(
'E'
,
"Select an storage item"
);
return
;
}
bool
sevhistobject
=
hi
->
attrnum
>
1
;
if
(
!
sevhistobject
)
{
sevhist_new
(
hi
->
oid
,
hi
->
objectattrlist
[
0
].
aname
,
sevhistobject
);
}
else
{
char
*
s
;
pwr_t
AName
aname
;
s
=
strchr
(
hi
->
oname
,
'.'
)
;
if
(
!
s
)
{
//It is a complete object
aname
[
0
]
=
'\0'
;
switch
(
item
->
type
)
{
case
tblnav_eItemType_Local
:
case
tblnav_eItemType_TreeLocal
:
{
TblNav_sevhistobject
*
hi
=
&
((
ItemLocal
*
)
item
)
->
item
;
pwr_tOid
oidv
[
2
]
=
{
hi
->
oid
,
pwr_cNOid
};
pwr_tOName
anamev
[
2
]
;
pwr_t
OName
onamev
[
2
]
=
{
""
,
""
}
;
bool
sevhistobjectv
[
2
]
=
{
hi
->
attrnum
>
1
,
false
}
;
if
(
!
sevhistobjectv
[
0
]
)
{
strcpy
(
anamev
[
0
],
hi
->
objectattrlist
[
0
].
aname
);
sevhist_new
(
oidv
,
anamev
,
onamev
,
sevhistobjectv
)
;
}
else
{
strcpy
(
aname
,
s
+
1
);
else
{
char
*
s
;
pwr_tAName
aname
;
s
=
strchr
(
hi
->
oname
,
'.'
);
if
(
!
s
)
{
//It is a complete object
aname
[
0
]
=
'\0'
;
}
else
{
strcpy
(
aname
,
s
+
1
);
}
strcpy
(
anamev
[
0
],
aname
);
sevhist_new
(
oidv
,
anamev
,
onamev
,
sevhistobjectv
);
}
sevhist_new
(
hi
->
oid
,
aname
,
sevhistobject
);
break
;
}
case
tblnav_eItemType_TreeCommand
:
{
ItemTreeCommand
*
ci
=
(
ItemTreeCommand
*
)
item
;
command
(
ci
->
item
.
command
);
break
;
}
default:
;
}
}
...
...
@@ -167,13 +191,20 @@ void XttTbl::delete_item_yes( void *ctx, void *data)
void
XttTbl
::
activate_delete_item
()
{
//sevcli_sHistItem *hi;
ItemBase
*
item
;
TblNav_sevhistobject
*
hi
;
char
msg
[
300
];
if
(
!
tblnav
->
get_select
(
&
hi
))
{
if
(
!
tblnav
->
get_select
(
&
item
))
{
message
(
'E'
,
"Select an storage item"
);
return
;
}
if
(
!
(
item
->
type
==
tblnav_eItemType_Local
||
item
->
type
==
tblnav_eItemType_TreeLocal
))
{
message
(
'E'
,
"Select an storage item"
);
return
;
}
hi
=
&
((
ItemLocal
*
)
item
)
->
item
;
sprintf
(
msg
,
"Do you really wan't to delete all stored data for item
\n\n
%s.%s
\n
"
,
hi
->
oname
,
hi
->
objectattrlist
[
0
].
aname
);
...
...
sev/exe/sev_xtt/src/xtt_tbl.h
View file @
2889b888
...
...
@@ -55,7 +55,8 @@ class XttTbl {
int
quiet
;
virtual
void
message
(
char
severity
,
const
char
*
message
)
{}
virtual
XttSevHist
*
sevhist_new
(
pwr_tOid
oid
,
char
*
aname
,
bool
sevhistobject
)
{
return
0
;}
virtual
XttSevHist
*
sevhist_new
(
pwr_tOid
*
oidv
,
pwr_tOName
*
anamev
,
pwr_tOName
*
onamev
,
bool
*
sevhistobjectv
)
{
return
0
;}
virtual
CoLogin
*
login_new
(
const
char
*
wl_name
,
const
char
*
wl_groupname
,
void
(
*
wl_bc_success
)(
void
*
),
...
...
@@ -78,6 +79,7 @@ class XttTbl {
static
void
message
(
void
*
attr
,
char
severity
,
const
char
*
message
);
static
int
is_authorized
(
void
*
ctx
,
unsigned
int
access
,
int
msg
);
static
int
command_cb
(
void
*
ctx
,
char
*
cmd
);
static
void
delete_item_yes
(
void
*
ctx
,
void
*
data
);
virtual
~
XttTbl
();
...
...
sev/exe/sev_xtt/src/xtt_tbl_command.cpp
View file @
2889b888
...
...
@@ -48,6 +48,7 @@
#include "co_error.h"
#include "cow_wow.h"
#include "xtt_tbl.h"
#include "xtt_tblnav.h"
#include "co_dcli_msg.h"
#include "cow_xhelp.h"
#include "cow_login.h"
...
...
@@ -72,18 +73,25 @@ static int xtttbl_open_func( void *client_data,
void
*
client_flag
);
static
int
xtttbl_show_func
(
void
*
client_data
,
void
*
client_flag
);
static
int
xtttbl_create_func
(
void
*
client_data
,
void
*
client_flag
);
dcli_tCmdTable
xtttbl_command_table
[]
=
{
{
"OPEN"
,
&
xtttbl_open_func
,
{
"dcli_arg1"
,
""
}
{
"dcli_arg1"
,
"
dcli_arg2"
,
"/NAME"
,
"
"
}
},
{
"SHOW"
,
&
xtttbl_show_func
,
{
"dcli_arg1"
,
""
}
},
{
"CREATE"
,
&
xtttbl_create_func
,
{
"dcli_arg1"
,
"/NAME"
,
"/COMMAND"
,
""
}
},
{
"EXIT"
,
&
xtttbl_exit_func
,
...
...
@@ -360,6 +368,116 @@ static int xtttbl_open_func( void *client_data,
if
(
strncmp
(
arg1_str
,
"GRAPH"
,
strlen
(
arg1_str
))
==
0
)
{
}
else
if
(
cdh_NoCaseStrncmp
(
arg1_str
,
"HISTORY"
,
strlen
(
arg1_str
))
==
0
)
{
pwr_tAName
name_str
;
char
*
name_ptr
;
pwr_tAName
name_array
[
10
];
int
i
,
names
;
pwr_tOid
oidv
[
11
];
pwr_tOName
anamev
[
11
];
pwr_tOName
onamev
[
11
];
bool
sevhistobjectv
[
11
];
int
sts
;
// Command is "OPEN HISTORY"
/* Get the name qualifier */
if
(
ODD
(
dcli_get_qualifier
(
"dcli_arg2"
,
name_str
,
sizeof
(
name_str
))))
{
if
(
name_str
[
0
]
!=
'/'
)
/* Assume that this is the namestring */
name_ptr
=
name_str
;
else
{
xtttbl
->
message
(
'E'
,
"Syntax error"
);
return
XTTTBL__HOLDCOMMAND
;
}
}
else
{
if
(
ODD
(
dcli_get_qualifier
(
"/NAME"
,
name_str
,
sizeof
(
name_str
))))
name_ptr
=
name_str
;
else
{
/* Get the selected object */
ItemBase
*
item
;
if
(
!
xtttbl
->
tblnav
->
get_select
(
&
item
))
{
xtttbl
->
message
(
'E'
,
"Enter name or select an object"
);
return
XTTTBL__SUCCESS
;
}
xtttbl
->
activate_opensevhist
();
}
}
// The name string can contain several hists separated by ','
names
=
dcli_parse
(
name_str
,
","
,
""
,
(
char
*
)
name_array
,
sizeof
(
name_array
)
/
sizeof
(
name_array
[
0
]),
sizeof
(
name_array
[
0
]),
0
);
for
(
i
=
0
;
i
<
names
;
i
++
)
{
TblNav_sevhistobject
*
hi
;
if
(
i
==
10
)
break
;
sts
=
xtttbl
->
tblnav
->
get_item
(
name_array
[
i
],
&
hi
);
if
(
EVEN
(
sts
))
{
xtttbl
->
message
(
'E'
,
"Name object not found"
);
return
XTTTBL__SUCCESS
;
}
oidv
[
i
]
=
hi
->
oid
;
if
(
hi
->
attrnum
==
1
)
{
strcpy
(
anamev
[
i
],
hi
->
objectattrlist
[
0
].
aname
);
sevhistobjectv
[
i
]
=
false
;
strcpy
(
onamev
[
i
],
hi
->
oname
);
}
else
{
strcpy
(
anamev
[
i
],
""
);
sevhistobjectv
[
i
]
=
true
;
strcpy
(
onamev
[
i
],
hi
->
oname
);
}
}
oidv
[
i
]
=
pwr_cNOid
;
xtttbl
->
sevhist_new
(
oidv
,
anamev
,
onamev
,
sevhistobjectv
);
}
else
xtttbl
->
message
(
'E'
,
"Syntax error"
);
return
XTTTBL__SUCCESS
;
}
static
int
xtttbl_create_func
(
void
*
client_data
,
void
*
client_flag
)
{
XttTbl
*
xtttbl
=
(
XttTbl
*
)
client_data
;
char
arg1_str
[
80
];
int
arg1_sts
;
arg1_sts
=
dcli_get_qualifier
(
"dcli_arg1"
,
arg1_str
,
sizeof
(
arg1_str
));
if
(
strncmp
(
arg1_str
,
"ITEM"
,
strlen
(
arg1_str
))
==
0
)
{
pwr_tOName
name_str
;
pwr_tCmd
command_str
;
// Command is "CREATE ITEM"
if
(
EVEN
(
dcli_get_qualifier
(
"/NAME"
,
name_str
,
sizeof
(
name_str
))))
{
xtttbl
->
message
(
'E'
,
"Enter name"
);
return
XTTTBL__SUCCESS
;
}
if
(
EVEN
(
dcli_get_qualifier
(
"/COMMAND"
,
command_str
,
sizeof
(
command_str
))))
{
xtttbl
->
message
(
'E'
,
"Enter command"
);
return
XTTTBL__SUCCESS
;
}
xtttbl
->
tblnav
->
add_item_command
(
name_str
,
command_str
);
}
else
xtttbl
->
message
(
'E'
,
"Syntax error"
);
...
...
sev/exe/sev_xtt/src/xtt_tblnav.cpp
View file @
2889b888
...
...
@@ -445,10 +445,14 @@ int TblNav::create_items()
}
else
{
for
(
int
idx
=
1
;
idx
;
idx
=
tree
[
idx
].
fws
)
{
if
(
tree
[
idx
].
item
)
new
ItemTreeLocal
(
this
,
tree
[
idx
].
item
,
idx
,
NULL
,
flow_eDest_IntoLast
);
if
(
tree
[
idx
].
type
==
tblnav_eTreeItemType_SevHist
)
new
ItemTreeLocal
(
this
,
&
sevhistobjectlist
[
tree
[
idx
].
idx
],
idx
,
NULL
,
flow_eDest_IntoLast
);
if
(
tree
[
idx
].
type
==
tblnav_eTreeItemType_Command
)
new
ItemTreeCommand
(
this
,
&
commandlist
[
tree
[
idx
].
idx
],
idx
,
NULL
,
flow_eDest_IntoLast
);
else
new
ItemTreeNode
(
this
,
tree
[
idx
].
sname
,
idx
,
NULL
,
flow_eDest_IntoLast
);
new
ItemTreeNode
(
this
,
tree
[
idx
].
sname
,
idx
,
NULL
,
flow_eDest_IntoLast
);
}
}
brow_ResetNodraw
(
brow
->
ctx
);
...
...
@@ -518,6 +522,11 @@ int TblNav::init_brow_cb( FlowCtx *fctx, void *client_data)
// Create the root items
tblnav
->
create_items
();
if
(
tblnav
->
command_cb
)
{
pwr_tCmd
cmd
=
"@$HOME/sev_xtt_setup"
;
tblnav
->
command_cb
(
tblnav
->
parent_ctx
,
cmd
);
}
//sts = brow_TraceInit( ctx, tblnav_trace_connect_bc,
// tblnav_trace_disconnect_bc, tblnav_trace_scan_bc);
//tblnav->trace_started = 1;
...
...
@@ -528,24 +537,28 @@ int TblNav::init_brow_cb( FlowCtx *fctx, void *client_data)
}
int
TblNav
::
get_select
(
TblNav_sevhistobject
**
hi
)
int
TblNav
::
get_select
(
ItemBase
**
item
)
{
brow_tNode
*
node_list
;
int
node_count
;
ItemLocal
*
item
;
brow_GetSelectedNodes
(
brow
->
ctx
,
&
node_list
,
&
node_count
);
if
(
!
node_count
)
return
0
;
brow_GetUserData
(
node_list
[
0
],
(
void
**
)
&
item
);
switch
(
item
->
type
)
{
case
tblnav_eItemType_Local
:
case
tblnav_eItemType_TreeLocal
:
*
hi
=
&
item
->
item
;
return
1
;
default:
;
brow_GetUserData
(
node_list
[
0
],
(
void
**
)
item
);
return
1
;
}
int
TblNav
::
get_item
(
char
*
oname
,
TblNav_sevhistobject
**
hi
)
{
for
(
int
i
=
0
;
i
<
(
int
)
sevhistobjectlist
.
size
();
i
++
)
{
if
(
cdh_NoCaseStrcmp
(
sevhistobjectlist
[
i
].
oname
,
oname
)
==
0
)
{
*
hi
=
&
sevhistobjectlist
[
i
];
return
1
;
}
}
return
0
;
}
...
...
@@ -586,9 +599,10 @@ void TblNav::delete_item( TblNav_sevhistobject *hi)
for
(
int
i
=
1
;
i
<
(
int
)
tree
.
size
();
i
++
)
{
if
(
tree
[
i
].
deleted
)
continue
;
if
(
tree
[
i
].
item
&&
cdh_ObjidIsEqual
(
tree
[
i
].
item
->
oid
,
hi
->
oid
)
&&
strcmp
(
tree
[
i
].
item
->
objectattrlist
[
0
].
aname
,
hi
->
objectattrlist
[
0
].
aname
)
==
0
)
{
if
(
tree
[
i
].
type
==
tblnav_eTreeItemType_SevHist
&&
cdh_ObjidIsEqual
(
sevhistobjectlist
[
tree
[
i
].
idx
].
oid
,
hi
->
oid
)
&&
strcmp
(
sevhistobjectlist
[
tree
[
i
].
idx
].
objectattrlist
[
0
].
aname
,
hi
->
objectattrlist
[
0
].
aname
)
==
0
)
{
tree
[
i
].
deleted
=
1
;
}
}
...
...
@@ -617,6 +631,17 @@ void TblNav::delete_item( TblNav_sevhistobject *hi)
}
}
void
TblNav
::
add_item_command
(
char
*
name
,
char
*
command
)
{
TblNav_command
item
;
strncpy
(
item
.
oname
,
name
,
sizeof
(
item
.
oname
));
strncpy
(
item
.
command
,
command
,
sizeof
(
item
.
command
));
commandlist
.
push_back
(
item
);
tree_add
(
name
,
commandlist
.
size
()
-
1
,
tblnav_eTreeItemType_Command
);
}
ItemLocal
::
ItemLocal
(
TblNav
*
tblnav
,
TblNav_sevhistobject
*
xitem
,
brow_tNode
dest
,
flow_eDest
dest_code
)
:
ItemBase
(
tblnav_eItemType_Local
),
item
(
*
xitem
)
...
...
@@ -784,6 +809,30 @@ ItemTreeLocal::ItemTreeLocal( TblNav *tblnav, TblNav_sevhistobject *xitem, int i
brow_SetAnnotation
(
node
,
0
,
aname
,
strlen
(
aname
));
}
ItemTreeCommand
::
ItemTreeCommand
(
TblNav
*
tblnav
,
TblNav_command
*
xitem
,
int
index
,
brow_tNode
dest
,
flow_eDest
dest_code
)
:
ItemBase
(
tblnav_eItemType_TreeCommand
),
item
(
*
xitem
),
idx
(
index
)
{
pwr_tAName
aname
;
char
*
s
;
type
=
tblnav_eItemType_TreeCommand
;
if
((
s
=
strrchr
(
item
.
oname
,
'-'
)))
strcpy
(
aname
,
s
+
1
);
else
strcpy
(
aname
,
item
.
oname
);
brow_CreateNode
(
tblnav
->
brow
->
ctx
,
"TreeNodeCommand"
,
tblnav
->
brow
->
nc_attr
,
dest
,
dest_code
,
(
void
*
)
this
,
1
,
&
node
);
if
(
tblnav
->
tree
[
idx
].
fch
)
brow_SetAnnotPixmap
(
node
,
0
,
tblnav
->
brow
->
pixmap_map
);
else
brow_SetAnnotPixmap
(
node
,
0
,
tblnav
->
brow
->
pixmap_leaf
);
brow_SetAnnotation
(
node
,
0
,
aname
,
strlen
(
aname
));
}
ItemTreeNode
::
ItemTreeNode
(
TblNav
*
tblnav
,
char
*
name
,
int
index
,
brow_tNode
dest
,
flow_eDest
dest_code
)
:
ItemBase
(
tblnav_eItemType_TreeNode
),
idx
(
index
)
...
...
@@ -821,10 +870,14 @@ int ItemTreeNode::open_children( TblNav *tblnav, double x, double y)
if
(
tblnav
->
tree
[
i
].
deleted
)
continue
;
if
(
tblnav
->
tree
[
i
].
item
)
new
ItemTreeLocal
(
tblnav
,
tblnav
->
tree
[
i
].
item
,
i
,
node
,
flow_eDest_IntoLast
);
if
(
tblnav
->
tree
[
i
].
type
==
tblnav_eTreeItemType_SevHist
)
new
ItemTreeLocal
(
tblnav
,
&
tblnav
->
sevhistobjectlist
[
tblnav
->
tree
[
i
].
idx
],
i
,
node
,
flow_eDest_IntoLast
);
else
if
(
tblnav
->
tree
[
i
].
type
==
tblnav_eTreeItemType_Command
)
new
ItemTreeCommand
(
tblnav
,
&
tblnav
->
commandlist
[
tblnav
->
tree
[
i
].
idx
],
i
,
node
,
flow_eDest_IntoLast
);
else
new
ItemTreeNode
(
tblnav
,
tblnav
->
tree
[
i
].
sname
,
i
,
node
,
flow_eDest_IntoLast
);
new
ItemTreeNode
(
tblnav
,
tblnav
->
tree
[
i
].
sname
,
i
,
node
,
flow_eDest_IntoLast
);
}
brow_SetOpen
(
node
,
tblnav_mOpen_Children
);
brow_SetAnnotPixmap
(
node
,
1
,
tblnav
->
brow
->
pixmap_openmap
);
...
...
@@ -852,9 +905,7 @@ int ItemTreeNode::close( TblNav *tblnav, double x, double y)
void
TblNav
::
build_tree
()
{
pwr_tObjName
name_array
[
24
];
pwr_tAName
aname
;
int
seg
;
for
(
int
i
=
0
;
i
<
(
int
)
sevhistobjectlist
.
size
();
i
++
)
{
TblTreeNode
n
;
...
...
@@ -863,88 +914,106 @@ void TblNav::build_tree()
strcat
(
aname
,
"."
);
strcat
(
aname
,
sevhistobjectlist
[
i
].
objectattrlist
[
0
].
aname
);
seg
=
dcli_parse
(
aname
,
"-"
,
""
,
(
char
*
)
name_array
,
sizeof
(
name_array
)
/
sizeof
(
name_array
[
0
]),
sizeof
(
name_array
[
0
]),
0
);
if
(
tree
.
size
()
==
0
)
{
// First item
TblTreeNode
n0
;
strcpy
(
n0
.
sname
,
"nonode"
);
tree
.
push_back
(
n0
);
for
(
int
j
=
0
;
j
<
seg
;
j
++
)
{
TblTreeNode
n
;
n
.
fth
=
j
;
tree
[
j
].
fch
=
j
+
1
;
strcpy
(
n
.
sname
,
name_array
[
j
]);
if
(
j
==
seg
-
1
)
n
.
item
=
&
sevhistobjectlist
[
i
];
tree
.
push_back
(
n
);
tree_add
(
aname
,
i
,
tblnav_eTreeItemType_SevHist
);
}
}
void
TblNav
::
tree_add
(
char
*
name
,
int
list_index
,
tblnav_eTreeItemType
type
)
{
pwr_tObjName
name_array
[
24
];
int
seg
;
seg
=
dcli_parse
(
name
,
"-"
,
""
,
(
char
*
)
name_array
,
sizeof
(
name_array
)
/
sizeof
(
name_array
[
0
]),
sizeof
(
name_array
[
0
]),
0
);
if
(
tree
.
size
()
==
0
)
{
// First item
TblTreeNode
n0
;
strcpy
(
n0
.
sname
,
"nonode"
);
tree
.
push_back
(
n0
);
for
(
int
j
=
0
;
j
<
seg
;
j
++
)
{
TblTreeNode
n
;
n
.
fth
=
j
;
tree
[
j
].
fch
=
j
+
1
;
strcpy
(
n
.
sname
,
name_array
[
j
]);
if
(
j
==
seg
-
1
)
{
n
.
idx
=
list_index
;
n
.
type
=
type
;
}
tree
.
push_back
(
n
);
}
else
{
int
idx
=
1
;
int
last
=
idx
;
for
(
int
j
=
0
;
j
<
seg
;
j
++
)
{
int
found
=
0
;
while
(
idx
)
{
last
=
idx
;
if
(
strcmp
(
tree
[
idx
].
sname
,
name_array
[
j
])
==
0
)
{
found
=
1
;
break
;
}
idx
=
tree
[
idx
].
fws
;
}
if
(
!
found
)
{
TblTreeNode
n
;
strcpy
(
n
.
sname
,
name_array
[
j
]);
n
.
fth
=
tree
[
last
].
fth
;
n
.
bws
=
last
;
tree
[
last
].
fws
=
tree
.
size
();
if
(
j
==
seg
-
1
)
n
.
item
=
&
sevhistobjectlist
[
i
];
tree
.
push_back
(
n
);
for
(
int
k
=
j
+
1
;
k
<
seg
;
k
++
)
{
TblTreeNode
n
;
n
.
fth
=
tree
.
size
()
-
1
;
if
(
tree
[
n
.
fth
].
fch
==
0
)
tree
[
n
.
fth
].
fch
=
tree
.
size
();
strcpy
(
n
.
sname
,
name_array
[
k
]);
if
(
k
==
seg
-
1
)
n
.
item
=
&
sevhistobjectlist
[
i
];
tree
.
push_back
(
n
);
}
break
;
}
if
(
tree
[
idx
].
fch
==
0
)
{
TblTreeNode
n
;
strcpy
(
n
.
sname
,
name_array
[
j
]);
n
.
fth
=
tree
[
last
].
fth
;
n
.
bws
=
last
;
tree
[
last
].
fws
=
tree
.
size
();
if
(
j
==
seg
-
1
)
n
.
item
=
&
sevhistobjectlist
[
i
];
tree
.
push_back
(
n
);
for
(
int
k
=
j
+
1
;
k
<
seg
;
k
++
)
{
TblTreeNode
n
;
n
.
fth
=
tree
.
size
()
-
1
;
if
(
tree
[
n
.
fth
].
fch
==
0
)
tree
[
n
.
fth
].
fch
=
tree
.
size
();
strcpy
(
n
.
sname
,
name_array
[
k
]);
if
(
k
==
seg
-
1
)
n
.
item
=
&
sevhistobjectlist
[
i
];
tree
.
push_back
(
n
);
}
break
;
}
else
{
int
idx
=
1
;
int
last
=
idx
;
for
(
int
j
=
0
;
j
<
seg
;
j
++
)
{
int
found
=
0
;
while
(
idx
)
{
last
=
idx
;
if
(
strcmp
(
tree
[
idx
].
sname
,
name_array
[
j
])
==
0
)
{
found
=
1
;
break
;
}
idx
=
tree
[
idx
].
fws
;
}
if
(
!
found
)
{
TblTreeNode
n
;
strcpy
(
n
.
sname
,
name_array
[
j
]);
n
.
fth
=
tree
[
last
].
fth
;
n
.
bws
=
last
;
tree
[
last
].
fws
=
tree
.
size
();
if
(
j
==
seg
-
1
)
{
n
.
idx
=
list_index
;
n
.
type
=
type
;
}
tree
.
push_back
(
n
);
for
(
int
k
=
j
+
1
;
k
<
seg
;
k
++
)
{
TblTreeNode
n
;
n
.
fth
=
tree
.
size
()
-
1
;
if
(
tree
[
n
.
fth
].
fch
==
0
)
tree
[
n
.
fth
].
fch
=
tree
.
size
();
strcpy
(
n
.
sname
,
name_array
[
k
]);
if
(
k
==
seg
-
1
)
{
n
.
idx
=
list_index
;
n
.
type
=
type
;
}
tree
.
push_back
(
n
);
}
break
;
}
idx
=
tree
[
idx
].
fch
;
last
=
idx
;
if
(
tree
[
idx
].
fch
==
0
)
{
TblTreeNode
n
;
strcpy
(
n
.
sname
,
name_array
[
j
]);
n
.
fth
=
tree
[
last
].
fth
;
n
.
bws
=
last
;
tree
[
last
].
fws
=
tree
.
size
();
if
(
j
==
seg
-
1
)
{
n
.
idx
=
list_index
;
n
.
type
=
type
;
}
tree
.
push_back
(
n
);
for
(
int
k
=
j
+
1
;
k
<
seg
;
k
++
)
{
TblTreeNode
n
;
n
.
fth
=
tree
.
size
()
-
1
;
if
(
tree
[
n
.
fth
].
fch
==
0
)
tree
[
n
.
fth
].
fch
=
tree
.
size
();
strcpy
(
n
.
sname
,
name_array
[
k
]);
if
(
k
==
seg
-
1
)
{
n
.
idx
=
list_index
;
n
.
type
=
type
;
}
tree
.
push_back
(
n
);
}
break
;
}
idx
=
tree
[
idx
].
fch
;
last
=
idx
;
}
}
}
...
...
sev/exe/sev_xtt/src/xtt_tblnav.h
View file @
2889b888
...
...
@@ -49,12 +49,15 @@
#include "rt_sevcli.h"
#endif
class
ItemBase
;
typedef
enum
{
tblnav_eItemType_Local
,
tblnav_eItemType_LocalAttr
,
tblnav_eItemType_TreeLocal
,
tblnav_eItemType_TreeNode
tblnav_eItemType_TreeNode
,
tblnav_eItemType_TreeCommand
}
tblnav_eItemType
;
typedef
enum
{
...
...
@@ -87,17 +90,30 @@ class TblNav_sevhistobject {
vector
<
TblNav_sevhistobjectattr
>
objectattrlist
;
};
class
TblNav_command
{
public:
pwr_tAName
oname
;
pwr_tCmd
command
;
};
typedef
enum
{
tblnav_eTreeItemType_No
,
tblnav_eTreeItemType_SevHist
,
tblnav_eTreeItemType_Command
}
tblnav_eTreeItemType
;
class
TblTreeNode
{
public:
TblTreeNode
()
:
fth
(
0
),
fch
(
0
),
fws
(
0
),
bws
(
0
),
item
(
0
),
deleted
(
0
)
TblTreeNode
()
:
fth
(
0
),
fch
(
0
),
fws
(
0
),
bws
(
0
),
type
(
tblnav_eTreeItemType_No
),
idx
(
0
),
deleted
(
0
)
{
strcpy
(
sname
,
""
);}
int
fth
;
int
fch
;
int
fws
;
int
bws
;
char
sname
[
80
];
TblNav_sevhistobject
*
item
;
tblnav_eTreeItemType
type
;
int
idx
;
int
deleted
;
};
...
...
@@ -138,9 +154,11 @@ class TblNav {
TblNavBrow
*
brow
;
sevcli_sHistItem
*
itemlist
;
vector
<
TblNav_sevhistobject
>
sevhistobjectlist
;
vector
<
TblNav_command
>
commandlist
;
int
item_cnt
;
void
(
*
message_cb
)(
void
*
,
char
,
const
char
*
);
int
(
*
is_authorized_cb
)(
void
*
,
unsigned
int
,
int
);
int
(
*
command_cb
)(
void
*
,
char
*
cmd
);
vector
<
TblTreeNode
>
tree
;
int
list_layout
;
...
...
@@ -148,7 +166,9 @@ class TblNav {
int
is_authorized
(
unsigned
int
access
=
pwr_mAccess_AllSev
,
int
msg
=
1
);
int
create_items
();
void
build_tree
();
int
get_select
(
TblNav_sevhistobject
**
hi
);
void
tree_add
(
char
*
name
,
int
list_index
,
tblnav_eTreeItemType
type
);
int
get_select
(
ItemBase
**
item
);
int
get_item
(
char
*
oname
,
TblNav_sevhistobject
**
hi
);
void
get_zoom
(
double
*
zoom_factor
);
void
zoom
(
double
zoom_factor
);
void
unzoom
();
...
...
@@ -158,6 +178,8 @@ class TblNav {
void
create_objectlist
(
sevcli_sHistItem
*
xn_itemlist
,
int
xn_item_cnt
,
pwr_tStatus
*
status
);
void
add_item_command
(
char
*
name
,
char
*
command
);
virtual
void
message
(
char
sev
,
const
char
*
text
);
virtual
void
set_inputfocus
()
{}
static
int
init_brow_cb
(
FlowCtx
*
fctx
,
void
*
client_data
);
...
...
@@ -220,5 +242,17 @@ class ItemTreeNode : public ItemBase {
};
//! Item for a command object.
class
ItemTreeCommand
:
public
ItemBase
{
public:
ItemTreeCommand
(
TblNav
*
tblnav
,
TblNav_command
*
xitem
,
int
index
,
brow_tNode
dest
,
flow_eDest
dest_code
);
virtual
~
ItemTreeCommand
()
{}
TblNav_command
item
;
int
idx
;
brow_tNode
node
;
};
#endif
src/lib/rt/src/rt_sevcli.c
View file @
2889b888
...
...
@@ -348,7 +348,7 @@ int sevcli_get_itemdata( pwr_tStatus *sts, sevcli_tCtx ctx, pwr_tOid oid,
*
sts
=
rmsg
->
Status
;
if
(
EVEN
(
*
sts
))
{
qcom_Free
(
sts
,
rmsg
);
qcom_Free
(
&
l
sts
,
rmsg
);
return
0
;
}
...
...
@@ -363,7 +363,7 @@ int sevcli_get_itemdata( pwr_tStatus *sts, sevcli_tCtx ctx, pwr_tOid oid,
*
vtype
=
rmsg
->
VType
;
*
vsize
=
rmsg
->
VSize
;
qcom_Free
(
sts
,
rmsg
);
qcom_Free
(
&
l
sts
,
rmsg
);
*
sts
=
SEV__SUCCESS
;
return
1
;
...
...
wb/lib/wb/src/wb_c_sevhist.cpp
View file @
2889b888
...
...
@@ -134,6 +134,7 @@ static pwr_tStatus SyntaxCheck (
pwr_tOid
thread_oid
;
wb_session
*
sp
=
(
wb_session
*
)
Session
;
pwr_tAttrRef
dataname_aref
;
pwr_tDeltaTime
storagetime
;
wb_attribute
a
=
sp
->
attribute
(
&
Object
);
if
(
!
a
)
return
a
.
sts
();
...
...
@@ -151,6 +152,16 @@ static pwr_tStatus SyntaxCheck (
else
if
(
othread
.
cid
()
!=
pwr_cClass_SevHistThread
)
wsx_error_msg_str
(
Session
,
"Bad thread object class"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Check StorageTime
wb_attribute
storagetime_a
(
a
,
0
,
"StorageTime"
);
if
(
!
storagetime_a
)
return
storagetime_a
.
sts
();
storagetime_a
.
value
(
&
storagetime
);
if
(
!
storagetime_a
)
return
storagetime_a
.
sts
();
if
(
storagetime
.
tv_sec
==
0
&&
storagetime
.
tv_nsec
==
0
)
wsx_error_msg_str
(
Session
,
"Bad StorageTime"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Check Attribute
wb_attribute
dataname_a
(
a
,
0
,
"Attribute"
);
if
(
!
dataname_a
)
return
dataname_a
.
sts
();
...
...
wb/lib/wb/src/wb_c_sevhistobject.cpp
View file @
2889b888
...
...
@@ -71,6 +71,8 @@ static pwr_tStatus SyntaxCheck (
)
{
pwr_tOid
thread_oid
;
wb_session
*
sp
=
(
wb_session
*
)
Session
;
pwr_tAttrRef
dataname_aref
;
pwr_tDeltaTime
storagetime
;
wb_attribute
a
=
sp
->
attribute
(
&
Object
);
if
(
!
a
)
return
a
.
sts
();
...
...
@@ -88,6 +90,28 @@ static pwr_tStatus SyntaxCheck (
else
if
(
othread
.
cid
()
!=
pwr_cClass_SevHistThread
)
wsx_error_msg_str
(
Session
,
"Bad thread object class"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Check StorageTime
wb_attribute
storagetime_a
(
a
,
0
,
"StorageTime"
);
if
(
!
storagetime_a
)
return
storagetime_a
.
sts
();
storagetime_a
.
value
(
&
storagetime
);
if
(
!
storagetime_a
)
return
storagetime_a
.
sts
();
if
(
storagetime
.
tv_sec
==
0
&&
storagetime
.
tv_nsec
==
0
)
wsx_error_msg_str
(
Session
,
"Bad StorageTime"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Check Attribute
wb_attribute
dataname_a
(
a
,
0
,
"Attribute"
);
if
(
!
dataname_a
)
return
dataname_a
.
sts
();
dataname_a
.
value
(
&
dataname_aref
);
if
(
!
dataname_a
)
return
dataname_a
.
sts
();
wb_attribute
data_a
=
sp
->
attribute
(
&
dataname_aref
);
if
(
!
data_a
)
{
wsx_error_msg_str
(
Session
,
"Bad Attribute reference"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
return
PWRB__SUCCESS
;
}
return
PWRB__SUCCESS
;
}
...
...
xtt/lib/ge/gtk/ge_curve_gtk.cpp
View file @
2889b888
...
...
@@ -527,8 +527,8 @@ GeCurveGtk::GeCurveGtk( void *gc_parent_ctx,
gtk_paned_add2
(
GTK_PANED
(
vpaned1
),
vpaned2
);
gtk_widget_show_all
(
vpaned1
);
gtk_paned_
add1
(
GTK_PANED
(
vpaned2
),
hbox
);
gtk_paned_
add2
(
GTK_PANED
(
vpaned2
),
nav_widget
);
gtk_paned_
pack1
(
GTK_PANED
(
vpaned2
),
hbox
,
TRUE
,
TRUE
);
gtk_paned_
pack2
(
GTK_PANED
(
vpaned2
),
nav_widget
,
FALSE
,
TRUE
);
gtk_widget_show_all
(
vpaned2
);
GtkWidget
*
vbox
=
gtk_vbox_new
(
FALSE
,
0
);
...
...
xtt/lib/ge/src/ge_curve.cpp
View file @
2889b888
...
...
@@ -131,6 +131,12 @@ void GeCurve::activate_minmax_ok( double min_value, double max_value)
&
cd
->
x_trend_lines
[
i
],
&
cd
->
x_axis_lines
[
i
],
&
cd
->
x_axis_linelongq
[
i
],
&
cd
->
x_axis_valueq
[
i
],
cd
->
x_format
[
i
],
&
axis_width
,
1
,
1
);
if
(
cd
->
type
==
curve_eDataType_MultiTrend
)
{
for
(
i
=
1
;
i
<
cd
->
cols
;
i
++
)
{
cd
->
x_min_value_axis
[
i
]
=
cd
->
x_min_value_axis
[
0
];
cd
->
x_max_value_axis
[
i
]
=
cd
->
x_max_value_axis
[
0
];
}
}
}
// cd->min_value_axis[minmax_idx] = min_value;
...
...
@@ -152,8 +158,38 @@ int GeCurve::growcurve_cb( GlowCtx *ctx, glow_tEvent event)
grow_GetCtxUserData
(
(
GrowCtx
*
)
ctx
,
(
void
**
)
&
curve
);
switch
(
event
->
event
)
{
case
glow_eEvent_MB1Click
:
case
glow_eEvent_MB1Click
:
{
// Move mark slider to this position
double
ll_x
,
ll_y
,
ur_x
,
ur_y
;
char
str
[
40
];
double
time
;
double
values
[
CURVE_MAX_COLS
];
grow_MeasureNode
(
curve
->
curve_markobject
,
&
ll_x
,
&
ll_y
,
&
ur_x
,
&
ur_y
);
grow_MoveNode
(
curve
->
curve_markobject
,
event
->
any
.
x
-
(
ur_x
-
ll_x
)
/
2
,
ll_y
);
grow_Redraw
(
curve
->
growcurve_ctx
);
curve
->
x_to_points
(
event
->
any
.
x
,
&
time
,
values
);
for
(
int
i
=
0
;
i
<
curve
->
cd
->
cols
;
i
++
)
{
sprintf
(
str
,
"%7.2f"
,
values
[
i
]);
grow_SetAnnotation
(
curve
->
mark_annot
[
i
],
0
,
str
,
strlen
(
str
));
}
if
(
!
(
strcmp
(
curve
->
cd
->
x_format
[
0
],
"%10t"
)
==
0
||
strcmp
(
curve
->
cd
->
x_format
[
0
],
"%11t"
)
==
0
))
{
sprintf
(
str
,
"%7.2f"
,
time
);
grow_SetAnnotation
(
curve
->
mark_annot
[
curve
->
cd
->
cols
],
0
,
str
,
strlen
(
str
));
}
else
{
// Time is a date
pwr_tTime
t
;
time_Float64ToD
(
(
pwr_tDeltaTime
*
)
&
t
,
time
);
time_AtoAscii
(
&
t
,
time_eFormat_DateAndTime
,
str
,
sizeof
(
str
));
grow_SetAnnotation
(
curve
->
mark_annot
[
curve
->
cd
->
cols
],
0
,
str
,
strlen
(
str
));
}
break
;
}
case
glow_eEvent_SliderMoveStart
:
{
if
(
event
->
object
.
object_type
==
glow_eObjectType_NoObject
)
grow_SetMoveRestrictions
(
(
GrowCtx
*
)
ctx
,
glow_eMoveRestriction_Disable
,
0
,
0
,
NULL
);
...
...
@@ -190,7 +226,7 @@ int GeCurve::growcurve_cb( GlowCtx *ctx, glow_tEvent event)
pwr_tTime
t
;
time_Float64ToD
(
(
pwr_tDeltaTime
*
)
&
t
,
time
);
time_AtoAscii
(
&
t
,
time_eFormat_DateAndTime
,
str
,
sizeof
(
str
));
grow_SetAnnotation
(
curve
->
mark_annot
[
0
],
0
,
str
,
strlen
(
str
));
grow_SetAnnotation
(
curve
->
mark_annot
[
curve
->
cd
->
cols
],
0
,
str
,
strlen
(
str
));
}
#if 0
if ( !curve->cd->x_reverse)
...
...
@@ -203,9 +239,9 @@ int GeCurve::growcurve_cb( GlowCtx *ctx, glow_tEvent event)
// Approximate row
row = int ((time - curve->cd->min_value[0]) /
(curve->cd->max_value[0] - curve->cd->min_value[0]) *
(curve->cd->rows - 1) + 0.5);
if ( row > curve->cd->rows - 1)
row = curve->cd->rows - 1;
(curve->cd->rows
[0]
- 1) + 0.5);
if ( row > curve->cd->rows
[0]
- 1)
row = curve->cd->rows
[0]
- 1;
else if ( row < 0)
row = 0;
else {
...
...
@@ -219,7 +255,7 @@ int GeCurve::growcurve_cb( GlowCtx *ctx, glow_tEvent event)
break;
r++;
}
else if ( r == curve->cd->rows - 1) {
else if ( r == curve->cd->rows
[0]
- 1) {
b1 = (curve->cd->data[0][r] + curve->cd->data[0][r-1]) / 2;
if ( time >= b1)
break;
...
...
@@ -356,7 +392,7 @@ int GeCurve::init_growcurve_cb( GlowCtx *fctx, void *client_data)
grow_CreateGrowCurve
(
curve
->
growcurve_ctx
,
"curve"
,
NULL
,
0
,
0
,
200
,
30
,
curve
->
curve_border
,
2
,
glow_mDisplayLevel_1
,
1
,
1
,
curve
->
curve_color
,
curve
,
&
curve
->
curve_object
);
grow_CreateGrowAxis
(
curve
->
growcurve_ctx
,
"y_axis"
,
0
,
30
,
200
,
3
2
,
grow_CreateGrowAxis
(
curve
->
growcurve_ctx
,
"y_axis"
,
0
,
30
,
200
,
3
1.85
,
glow_eDrawType_Line
,
1
,
5
,
glow_eDrawType_TextHelvetica
,
curve
,
&
curve
->
curve_axisobject
);
...
...
@@ -367,7 +403,7 @@ int GeCurve::init_growcurve_cb( GlowCtx *fctx, void *client_data)
grow_AddRect
(
nc
,
""
,
-
MARK_WIDTH
/
2
,
30.1
,
MARK_WIDTH
,
1.8
,
glow_eDrawType_LineGray
,
1
,
0
,
glow_mDisplayLevel_1
,
0
,
0
,
1
,
glow_eDrawType_Color33
,
NULL
);
glow_sPoint
p1
[
3
]
=
{
{
-
0.1
,
30.3
},
{
-
MARK_WIDTH
/
2
+
0.1
,
31
},{
-
0.1
,
31.
7
}};
glow_sPoint
p1
[
3
]
=
{
{
-
0.1
,
30.3
},
{
-
MARK_WIDTH
/
2
+
0.1
,
31
},{
-
0.1
,
31.
85
}};
grow_AddPolyLine
(
nc
,
""
,
p1
,
3
,
glow_eDrawType_Line
,
1
,
0
,
1
,
0
,
1
,
glow_eDrawType_Color38
,
1
,
0
);
glow_sPoint
p2
[
3
]
=
{
{
0.1
,
30.3
},
{
MARK_WIDTH
/
2
-
0.1
,
31
},{
0.1
,
31.7
}};
...
...
@@ -605,32 +641,32 @@ int GeCurve::init_grownames_cb( GlowCtx *fctx, void *client_data)
x
=
0.8
;
grow_CreateGrowText
(
curve
->
grownames_ctx
,
""
,
Lng
::
translate
(
"View"
),
x
,
0.6
,
glow_eDrawType_TextHelvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
Helvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
LucidaSans
,
glow_mDisplayLevel_1
,
NULL
,
&
o1
);
x
+=
2.2
;
x
+=
1.8
;
grow_CreateGrowText
(
curve
->
grownames_ctx
,
""
,
Lng
::
translate
(
"Cursor"
),
x
,
0.6
,
glow_eDrawType_TextHelvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
Helvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
LucidaSans
,
glow_mDisplayLevel_1
,
NULL
,
&
o1
);
x
+=
time_size
+
0.2
;
grow_CreateGrowText
(
curve
->
grownames_ctx
,
""
,
Lng
::
translate
(
"Mark"
),
x
,
0.6
,
glow_eDrawType_TextHelvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
Helvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
LucidaSans
,
glow_mDisplayLevel_1
,
NULL
,
&
o1
);
x
+=
time_size
+
0.2
;
grow_CreateGrowText
(
curve
->
grownames_ctx
,
""
,
Lng
::
translate
(
"Unit"
),
x
,
0.6
,
glow_eDrawType_TextHelvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
Helvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
LucidaSans
,
glow_mDisplayLevel_1
,
NULL
,
&
o1
);
x
+=
2
;
grow_CreateGrowText
(
curve
->
grownames_ctx
,
""
,
Lng
::
translate
(
"Scale"
),
x
,
0.6
,
glow_eDrawType_TextHelvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
Helvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
LucidaSans
,
glow_mDisplayLevel_1
,
NULL
,
&
o1
);
x
+=
3
;
grow_CreateGrowText
(
curve
->
grownames_ctx
,
""
,
Lng
::
translate
(
"Attribute"
),
x
,
0.6
,
glow_eDrawType_TextHelvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
Helvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
LucidaSans
,
glow_mDisplayLevel_1
,
NULL
,
&
o1
);
for
(
int
i
=
0
;
i
<
curve
->
cd
->
cols
;
i
++
)
{
...
...
@@ -668,7 +704,7 @@ int GeCurve::init_grownames_cb( GlowCtx *fctx, void *client_data)
x
+=
time_size
+
0.6
;
grow_CreateGrowText
(
curve
->
grownames_ctx
,
""
,
curve
->
cd
->
y_unit
[
i
],
x
,
(
i
+
0.8
)
+
0.75
,
glow_eDrawType_TextHelvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
Helvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
LucidaSans
,
glow_mDisplayLevel_1
,
NULL
,
&
t1
);
// Draw button for scale
x
+=
2
;
...
...
@@ -679,8 +715,8 @@ int GeCurve::init_grownames_cb( GlowCtx *fctx, void *client_data)
// Draw attribute name
x
+=
3
;
grow_CreateGrowText
(
curve
->
grownames_ctx
,
""
,
curve
->
cd
->
y_name
[
i
],
x
,
(
i
+
0.8
)
+
0.75
,
glow_eDrawType_TextHelvetica
Bold
,
glow_eDrawType_Line
,
2
,
glow_eFont_
Helvetica
,
x
,
(
i
+
0.8
)
+
0.75
,
glow_eDrawType_TextHelvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
LucidaSans
,
glow_mDisplayLevel_1
,
NULL
,
&
t1
);
grow_SetAnnotation
(
curve
->
cursor_annot
[
i
],
0
,
"0"
,
1
);
grow_SetAnnotation
(
curve
->
mark_annot
[
i
],
0
,
"0"
,
1
);
...
...
@@ -700,7 +736,7 @@ int GeCurve::init_grownames_cb( GlowCtx *fctx, void *client_data)
x
+=
time_size
+
0.6
;
grow_CreateGrowText
(
curve
->
grownames_ctx
,
""
,
"s"
,
x
,
(
curve
->
cd
->
cols
+
0.8
)
+
0.75
,
glow_eDrawType_TextHelvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
Helvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
LucidaSans
,
glow_mDisplayLevel_1
,
NULL
,
&
t1
);
// Draw button for scale
x
+=
2
;
...
...
@@ -711,8 +747,8 @@ int GeCurve::init_grownames_cb( GlowCtx *fctx, void *client_data)
// Draw attribute name
x
+=
3
;
grow_CreateGrowText
(
curve
->
grownames_ctx
,
""
,
Lng
::
translate
(
"Time axis"
),
x
,
(
curve
->
cd
->
cols
+
0.8
)
+
0.75
,
glow_eDrawType_TextHelvetica
Bold
,
glow_eDrawType_Line
,
2
,
glow_eFont_
Helvetica
,
x
,
(
curve
->
cd
->
cols
+
0.8
)
+
0.75
,
glow_eDrawType_TextHelvetica
,
glow_eDrawType_Line
,
2
,
glow_eFont_
LucidaSans
,
glow_mDisplayLevel_1
,
NULL
,
&
t1
);
grow_SetAnnotation
(
curve
->
cursor_annot
[
curve
->
cd
->
cols
],
0
,
"0"
,
1
);
grow_SetAnnotation
(
curve
->
mark_annot
[
curve
->
cd
->
cols
],
0
,
"0"
,
1
);
...
...
@@ -827,85 +863,166 @@ int GeCurve::configure_axes()
int
GeCurve
::
configure_curves
()
{
int
i
,
idx
;
int
i
,
j
,
idx
;
glow_sCurveData
gcd
;
int
max_index
,
min_index
;
double
minval
,
maxval
;
gcd
.
type
=
glow_eCurveDataType_CommonX
;
// Get max and min index in x
max_index
=
-
1
;
min_index
=
-
1
;
if
(
cd
->
x_min_value_axis
[
0
]
>
cd
->
x_min_value
[
0
]
||
cd
->
x_max_value_axis
[
0
]
<
cd
->
x_max_value
[
0
])
{
for
(
i
=
0
;
i
<
cd
->
rows
;
i
++
)
{
if
(
min_index
==
-
1
&&
cd
->
x_data
[
0
][
i
]
>=
cd
->
x_min_value_axis
[
0
]
)
min_index
=
i
;
if
(
max_index
==
-
1
&&
cd
->
x_data
[
0
][
i
]
>=
cd
->
x_max_value_axis
[
0
]
)
max_index
=
i
-
1
;
if
(
cd
->
type
==
curve_eDataType_LogFile
||
cd
->
type
==
curve_eDataType_DsTrend
)
{
gcd
.
type
=
glow_eCurveDataType_CommonX
;
// Get max and min index in x
max_index
=
-
1
;
min_index
=
-
1
;
if
(
cd
->
x_min_value_axis
[
0
]
>
cd
->
x_min_value
[
0
]
||
cd
->
x_max_value_axis
[
0
]
<
cd
->
x_max_value
[
0
])
{
for
(
i
=
0
;
i
<
cd
->
rows
[
0
];
i
++
)
{
if
(
min_index
==
-
1
&&
cd
->
x_data
[
0
][
i
]
>=
cd
->
x_min_value_axis
[
0
]
)
min_index
=
i
;
if
(
max_index
==
-
1
&&
cd
->
x_data
[
0
][
i
]
>=
cd
->
x_max_value_axis
[
0
]
)
max_index
=
i
-
1
;
}
if
(
min_index
==
-
1
)
min_index
=
0
;
if
(
max_index
==
-
1
)
max_index
=
cd
->
rows
[
0
]
-
1
;
}
if
(
min_index
==
-
1
)
else
{
max_index
=
cd
->
rows
[
0
]
-
1
;
min_index
=
0
;
if
(
max_index
==
-
1
)
max_index
=
cd
->
rows
-
1
;
}
else
{
max_index
=
cd
->
rows
-
1
;
min_index
=
0
;
}
}
idx
=
0
;
for
(
i
=
0
;
i
<
cd
->
cols
;
i
++
)
{
if
(
!
hide
[
i
])
{
gcd
.
y_max_value
[
idx
]
=
cd
->
y_max_value_axis
[
i
];
gcd
.
y_min_value
[
idx
]
=
cd
->
y_min_value_axis
[
i
];
gcd
.
y_data
[
idx
]
=
&
cd
->
y_data
[
i
][
min_index
];
gcd
.
color
[
idx
]
=
cd
->
color
[
i
];
gcd
.
fillcolor
[
idx
]
=
cd
->
fillcolor
[
i
];
idx
++
;
if
(
idx
==
TREND_MAX_CURVES
-
1
)
idx
=
0
;
for
(
i
=
0
;
i
<
cd
->
cols
;
i
++
)
{
if
(
!
hide
[
i
])
{
gcd
.
y_max_value
[
idx
]
=
cd
->
y_max_value_axis
[
i
];
gcd
.
y_min_value
[
idx
]
=
cd
->
y_min_value_axis
[
i
];
gcd
.
y_data
[
idx
]
=
&
cd
->
y_data
[
i
][
min_index
];
gcd
.
color
[
idx
]
=
cd
->
color
[
i
];
gcd
.
fillcolor
[
idx
]
=
cd
->
fillcolor
[
i
];
idx
++
;
if
(
idx
==
TREND_MAX_CURVES
-
1
)
break
;
}
}
gcd
.
x_data
[
0
]
=
&
cd
->
x_data
[
0
][
min_index
];
gcd
.
x_max_value
[
0
]
=
cd
->
x_max_value_axis
[
0
];
gcd
.
x_min_value
[
0
]
=
cd
->
x_min_value_axis
[
0
];
gcd
.
curves
=
idx
;
gcd
.
rows
[
0
]
=
max_index
-
min_index
+
1
;
gcd
.
x_reverse
=
cd
->
x_reverse
;
// Get number of horizontal lines from first not hidden float
idx
=
1
;
for
(
i
=
0
;
i
<
cd
->
cols
;
i
++
)
{
if
(
cd
->
y_value_type
[
i
]
!=
pwr_eType_Boolean
&&
!
hide
[
i
])
{
idx
=
i
;
break
;
}
}
grow_SetTrendLines
(
curve_object
,
// int(cd->max_value_axis[0] - cd->min_value_axis[0] - 1),
cd
->
x_trend_lines
[
0
]
-
2
,
2
*
cd
->
y_trend_lines
[
idx
]
-
3
);
if
(
cd
->
x_reverse
)
{
minval
=
cd
->
x_max_value_axis
[
0
];
maxval
=
cd
->
x_min_value_axis
[
0
];
}
else
{
minval
=
cd
->
x_min_value_axis
[
0
];
maxval
=
cd
->
x_max_value_axis
[
0
];
}
}
gcd
.
x_data
[
0
]
=
&
cd
->
x_data
[
0
][
min_index
];
gcd
.
x_max_value
[
0
]
=
cd
->
x_max_value_axis
[
0
];
gcd
.
x_min_value
[
0
]
=
cd
->
x_min_value_axis
[
0
];
gcd
.
curves
=
idx
;
gcd
.
rows
=
max_index
-
min_index
+
1
;
gcd
.
x_reverse
=
cd
->
x_reverse
;
grow_SetAxisConf
(
curve_axisobject
,
minval
,
maxval
,
// 10 * int( cd->max_value_axis[0] - cd->min_value_axis[0]) + 1,
cd
->
x_axis_lines
[
0
],
cd
->
x_axis_linelongq
[
0
],
cd
->
x_axis_valueq
[
0
],
270
,
cd
->
x_format
[
0
]);
// Get number of horizontal lines from first not hidden float
idx
=
1
;
for
(
i
=
0
;
i
<
cd
->
cols
;
i
++
)
{
if
(
cd
->
y_value_type
[
i
]
!=
pwr_eType_Boolean
&&
!
hide
[
i
])
{
idx
=
i
;
break
;
}
grow_CurveConfigure
(
curve_object
,
&
gcd
);
}
else
if
(
cd
->
type
==
curve_eDataType_MultiTrend
)
{
gcd
.
type
=
glow_eCurveDataType_SeparateX
;
idx
=
0
;
for
(
i
=
0
;
i
<
cd
->
cols
;
i
++
)
{
if
(
!
hide
[
i
])
{
// Get max and min index in x
max_index
=
-
1
;
min_index
=
-
1
;
if
(
cd
->
x_min_value_axis
[
i
]
>
cd
->
x_min_value
[
i
]
||
cd
->
x_max_value_axis
[
i
]
<
cd
->
x_max_value
[
i
])
{
for
(
j
=
0
;
j
<
cd
->
rows
[
i
];
j
++
)
{
if
(
min_index
==
-
1
&&
cd
->
x_data
[
i
][
j
]
>=
cd
->
x_min_value_axis
[
i
]
)
min_index
=
j
;
if
(
max_index
==
-
1
&&
cd
->
x_data
[
i
][
j
]
>=
cd
->
x_max_value_axis
[
i
]
)
max_index
=
j
-
1
;
}
if
(
min_index
==
-
1
)
min_index
=
0
;
if
(
max_index
==
-
1
)
max_index
=
cd
->
rows
[
i
]
-
1
;
}
else
{
max_index
=
cd
->
rows
[
i
]
-
1
;
min_index
=
0
;
}
grow_SetTrendLines
(
curve_object
,
// int(cd->max_value_axis[0] - cd->min_value_axis[0] - 1),
cd
->
x_trend_lines
[
0
]
-
2
,
2
*
cd
->
y_trend_lines
[
idx
]
-
3
);
gcd
.
y_max_value
[
idx
]
=
cd
->
y_max_value_axis
[
i
];
gcd
.
y_min_value
[
idx
]
=
cd
->
y_min_value_axis
[
i
];
gcd
.
y_data
[
idx
]
=
&
cd
->
y_data
[
i
][
min_index
];
gcd
.
color
[
idx
]
=
cd
->
color
[
i
];
gcd
.
fillcolor
[
idx
]
=
cd
->
fillcolor
[
i
];
if
(
cd
->
x_reverse
)
{
minval
=
cd
->
x_max_value_axis
[
0
];
maxval
=
cd
->
x_min_value_axis
[
0
];
}
else
{
minval
=
cd
->
x_min_value_axis
[
0
];
maxval
=
cd
->
x_max_value_axis
[
0
];
}
gcd
.
x_data
[
idx
]
=
&
cd
->
x_data
[
i
][
min_index
];
gcd
.
x_max_value
[
idx
]
=
cd
->
x_max_value_axis
[
i
];
gcd
.
x_min_value
[
idx
]
=
cd
->
x_min_value_axis
[
i
];
gcd
.
rows
[
idx
]
=
max_index
-
min_index
+
1
;
idx
++
;
if
(
idx
==
TREND_MAX_CURVES
-
1
)
break
;
}
}
gcd
.
curves
=
idx
;
gcd
.
x_reverse
=
cd
->
x_reverse
;
// Get number of horizontal lines from first not hidden float
idx
=
1
;
for
(
i
=
0
;
i
<
cd
->
cols
;
i
++
)
{
if
(
cd
->
y_value_type
[
i
]
!=
pwr_eType_Boolean
&&
!
hide
[
i
])
{
idx
=
i
;
break
;
}
}
grow_SetTrendLines
(
curve_object
,
// int(cd->max_value_axis[0] - cd->min_value_axis[0] - 1),
cd
->
x_trend_lines
[
0
]
-
2
,
2
*
cd
->
y_trend_lines
[
idx
]
-
3
);
if
(
cd
->
x_reverse
)
{
minval
=
cd
->
x_max_value_axis
[
0
];
maxval
=
cd
->
x_min_value_axis
[
0
];
}
else
{
minval
=
cd
->
x_min_value_axis
[
0
];
maxval
=
cd
->
x_max_value_axis
[
0
];
}
grow_SetAxisConf
(
curve_axisobject
,
minval
,
maxval
,
// 10 * int( cd->max_value_axis[0] - cd->min_value_axis[0]) + 1,
cd
->
x_axis_lines
[
0
],
cd
->
x_axis_linelongq
[
0
],
cd
->
x_axis_valueq
[
0
],
270
,
cd
->
x_format
[
0
]);
grow_SetAxisConf
(
curve_axisobject
,
minval
,
maxval
,
// 10 * int( cd->max_value_axis[0] - cd->min_value_axis[0]) + 1,
cd
->
x_axis_lines
[
0
],
cd
->
x_axis_linelongq
[
0
],
cd
->
x_axis_valueq
[
0
],
270
,
cd
->
x_format
[
0
]);
grow_CurveConfigure
(
curve_object
,
&
gcd
);
grow_CurveConfigure
(
curve_object
,
&
gcd
);
}
return
1
;
}
...
...
@@ -927,7 +1044,7 @@ void GeCurve::points_added()
min_index
=
-
1
;
if
(
cd
->
x_min_value_axis
[
0
]
>
cd
->
x_min_value
[
0
]
||
cd
->
x_max_value_axis
[
0
]
<
cd
->
x_max_value
[
0
])
{
for
(
i
=
0
;
i
<
cd
->
rows
;
i
++
)
{
for
(
i
=
0
;
i
<
cd
->
rows
[
0
]
;
i
++
)
{
if
(
min_index
==
-
1
&&
cd
->
x_data
[
0
][
i
]
>=
cd
->
x_min_value_axis
[
0
]
)
min_index
=
i
;
if
(
max_index
==
-
1
&&
cd
->
x_data
[
0
][
i
]
>=
cd
->
x_max_value_axis
[
0
]
)
...
...
@@ -936,10 +1053,10 @@ void GeCurve::points_added()
if
(
min_index
==
-
1
)
min_index
=
0
;
if
(
max_index
==
-
1
)
max_index
=
cd
->
rows
-
1
;
max_index
=
cd
->
rows
[
0
]
-
1
;
}
else
{
max_index
=
cd
->
rows
-
1
;
max_index
=
cd
->
rows
[
0
]
-
1
;
min_index
=
0
;
}
...
...
@@ -960,7 +1077,7 @@ void GeCurve::points_added()
gcd
.
x_min_value
[
0
]
=
cd
->
x_min_value_axis
[
0
];
gcd
.
x_data
[
0
]
=
&
cd
->
x_data
[
0
][
min_index
];
gcd
.
curves
=
idx
;
gcd
.
rows
=
max_index
-
min_index
+
1
;
gcd
.
rows
[
0
]
=
max_index
-
min_index
+
1
;
gcd
.
x_reverse
=
cd
->
x_reverse
;
grow_CurveAddPoints
(
curve_object
,
&
gcd
);
...
...
@@ -1021,7 +1138,7 @@ int GeCurve::read_file( char *filename)
cd
->
x_reverse
=
0
;
cd
->
cols
=
nr
-
1
;
cd
->
rows
=
rows
;
cd
->
rows
[
0
]
=
rows
;
for
(
i
=
0
;
i
<
nr
;
i
++
)
{
if
(
i
==
0
)
{
strcpy
(
cd
->
x_name
,
item_str
[
i
]);
...
...
@@ -1053,7 +1170,7 @@ int GeCurve::read_file( char *filename)
if
(
i
==
0
)
{
printf
(
"Unreadble line %d
\n
"
,
j
);
skip_line
=
1
;
cd
->
rows
--
;
cd
->
rows
[
0
]
--
;
break
;
}
else
...
...
@@ -1145,7 +1262,7 @@ GeCurve::GeCurve( void *gc_parent_ctx,
}
GeCurveData
::
GeCurveData
(
curve_eDataType
datatype
)
:
type
(
datatype
),
rows
(
0
),
cols
(
0
),
x_reverse
(
0
),
time_format
(
curve_eTimeFormat_Float
)
type
(
datatype
),
cols
(
0
),
x_reverse
(
0
),
time_format
(
curve_eTimeFormat_Float
)
{
memset
(
x_data
,
0
,
sizeof
(
x_data
));
memset
(
y_data
,
0
,
sizeof
(
y_data
));
...
...
@@ -1153,6 +1270,7 @@ GeCurveData::GeCurveData( curve_eDataType datatype) :
strcpy
(
y_unit
[
i
],
""
);
strcpy
(
y_format
[
i
],
""
);
strcpy
(
y_name
[
i
],
""
);
rows
[
i
]
=
0
;
y_max_value
[
i
]
=
0
;
y_min_value
[
i
]
=
0
;
y_min_value_axis
[
i
]
=
0
;
...
...
@@ -1195,7 +1313,7 @@ void GeCurveData::get_borders()
y_value_type
[
i
]
=
pwr_eType_Boolean
;
for
(
int
j
=
0
;
j
<
rows
;
j
++
)
{
for
(
int
j
=
0
;
j
<
rows
[
i
]
;
j
++
)
{
if
(
y_data
[
i
][
j
]
<
y_min_value
[
i
])
y_min_value
[
i
]
=
y_data
[
i
][
j
];
if
(
y_data
[
i
][
j
]
>
y_max_value
[
i
])
...
...
@@ -1207,17 +1325,35 @@ void GeCurveData::get_borders()
}
}
}
for
(
int
i
=
0
;
i
<
1
;
i
++
)
{
x_max_value
[
i
]
=
1e-37
;
x_min_value
[
i
]
=
1e37
;
x_value_type
[
i
]
=
pwr_eType_Float64
;
if
(
type
==
curve_eDataType_MultiTrend
)
{
for
(
int
i
=
0
;
i
<
cols
;
i
++
)
{
x_max_value
[
i
]
=
1e-37
;
x_min_value
[
i
]
=
1e37
;
for
(
int
j
=
0
;
j
<
rows
;
j
++
)
{
if
(
x_data
[
i
][
j
]
<
x_min_value
[
i
])
x_min_value
[
i
]
=
x_data
[
i
][
j
];
if
(
x_data
[
i
][
j
]
>
x_max_value
[
i
])
x_max_value
[
i
]
=
x_data
[
i
][
j
];
x_value_type
[
i
]
=
pwr_eType_Float64
;
for
(
int
j
=
0
;
j
<
rows
[
i
];
j
++
)
{
if
(
x_data
[
i
][
j
]
<
x_min_value
[
i
])
x_min_value
[
i
]
=
x_data
[
i
][
j
];
if
(
x_data
[
i
][
j
]
>
x_max_value
[
i
])
x_max_value
[
i
]
=
x_data
[
i
][
j
];
}
}
}
else
{
for
(
int
i
=
0
;
i
<
1
;
i
++
)
{
x_max_value
[
i
]
=
1e-37
;
x_min_value
[
i
]
=
1e37
;
x_value_type
[
i
]
=
pwr_eType_Float64
;
for
(
int
j
=
0
;
j
<
rows
[
0
];
j
++
)
{
if
(
x_data
[
i
][
j
]
<
x_min_value
[
i
])
x_min_value
[
i
]
=
x_data
[
i
][
j
];
if
(
x_data
[
i
][
j
]
>
x_max_value
[
i
])
x_max_value
[
i
]
=
x_data
[
i
][
j
];
}
}
}
}
...
...
@@ -1234,10 +1370,32 @@ void GeCurveData::get_default_axis()
}
int
i
=
0
;
double
axis_width
;
scale
(
x_axis_type
[
i
],
x_value_type
[
i
],
x_min_value
[
i
],
x_max_value
[
i
],
&
x_min_value_axis
[
i
],
&
x_max_value_axis
[
i
],
&
x_trend_lines
[
i
],
&
x_axis_lines
[
i
],
&
x_axis_linelongq
[
i
],
&
x_axis_valueq
[
i
],
x_format
[
i
],
&
axis_width
,
0
,
0
);
if
(
type
!=
curve_eDataType_MultiTrend
)
{
scale
(
x_axis_type
[
i
],
x_value_type
[
i
],
x_min_value
[
i
],
x_max_value
[
i
],
&
x_min_value_axis
[
i
],
&
x_max_value_axis
[
i
],
&
x_trend_lines
[
i
],
&
x_axis_lines
[
i
],
&
x_axis_linelongq
[
i
],
&
x_axis_valueq
[
i
],
x_format
[
i
],
&
axis_width
,
0
,
0
);
}
else
{
double
min_value
=
1e37
;
double
max_value
=
-
1e37
;
for
(
i
=
0
;
i
<
cols
;
i
++
)
{
if
(
x_min_value
[
i
]
<
min_value
)
min_value
=
x_min_value
[
i
];
if
(
x_max_value
[
i
]
>
max_value
)
max_value
=
x_max_value
[
i
];
}
scale
(
x_axis_type
[
0
],
x_value_type
[
0
],
min_value
,
max_value
,
&
x_min_value_axis
[
0
],
&
x_max_value_axis
[
0
],
&
x_trend_lines
[
0
],
&
x_axis_lines
[
0
],
&
x_axis_linelongq
[
0
],
&
x_axis_valueq
[
0
],
x_format
[
0
],
&
axis_width
,
0
,
0
);
for
(
i
=
1
;
i
<
cols
;
i
++
)
{
x_min_value_axis
[
i
]
=
x_min_value_axis
[
0
];
x_max_value_axis
[
i
]
=
x_max_value_axis
[
0
];
}
}
}
void
GeCurveData
::
select_color
(
bool
dark_bg
)
...
...
@@ -1382,7 +1540,8 @@ void GeCurveData::scale( int axis_type, int value_type,
}
else
{
n
=
0
;
if
(
(
type
==
curve_eDataType_LogFile
||
type
==
curve_eDataType_DsTrend
)
if
(
(
type
==
curve_eDataType_LogFile
||
type
==
curve_eDataType_DsTrend
||
type
==
curve_eDataType_MultiTrend
)
&&
axis_type
==
curve_eAxis_x
)
{
// Time axis
if
(
max_value
-
min_value
<
300
)
{
...
...
@@ -1658,59 +1817,119 @@ void GeCurve::x_to_points( double x, double *t, double *values)
int
row
;
double
time
;
// Time is a date
if
(
!
cd
->
x_reverse
)
time
=
cd
->
x_min_value_axis
[
0
]
+
x
*
(
cd
->
x_max_value_axis
[
0
]
-
cd
->
x_min_value_axis
[
0
])
/
200
;
else
time
=
cd
->
x_min_value_axis
[
0
]
+
(
200.0
-
x
)
*
(
cd
->
x_max_value_axis
[
0
]
-
cd
->
x_min_value_axis
[
0
])
/
200
;
if
(
cd
->
type
!=
curve_eDataType_MultiTrend
)
{
// Time is a date
if
(
!
cd
->
x_reverse
)
time
=
cd
->
x_min_value_axis
[
0
]
+
x
*
(
cd
->
x_max_value_axis
[
0
]
-
cd
->
x_min_value_axis
[
0
])
/
200
;
else
time
=
cd
->
x_min_value_axis
[
0
]
+
(
200.0
-
x
)
*
(
cd
->
x_max_value_axis
[
0
]
-
cd
->
x_min_value_axis
[
0
])
/
200
;
// Approximate row
row
=
int
((
time
-
cd
->
x_min_value
[
0
])
/
(
cd
->
x_max_value
[
0
]
-
cd
->
x_min_value
[
0
])
*
(
cd
->
rows
-
1
)
+
0.5
);
if
(
row
>
cd
->
rows
-
1
)
row
=
cd
->
rows
-
1
;
else
if
(
row
<
0
)
row
=
0
;
else
{
// Find exact row
double
b1
,
b2
;
int
r
=
row
;
for
(
int
i
=
0
;;
i
++
)
{
if
(
r
==
0
)
{
b2
=
(
cd
->
x_data
[
0
][
row
]
+
cd
->
x_data
[
0
][
r
+
1
])
/
2
;
if
(
time
<
b2
)
break
;
r
++
;
}
else
if
(
r
==
cd
->
rows
-
1
)
{
b1
=
(
cd
->
x_data
[
0
][
r
]
+
cd
->
x_data
[
0
][
r
-
1
])
/
2
;
if
(
time
>=
b1
)
break
;
r
--
;
}
else
{
b1
=
(
cd
->
x_data
[
0
][
r
]
+
cd
->
x_data
[
0
][
r
-
1
])
/
2
;
b2
=
(
cd
->
x_data
[
0
][
r
]
+
cd
->
x_data
[
0
][
r
+
1
])
/
2
;
if
(
b1
<=
time
&&
time
<
b2
)
break
;
if
(
b1
<=
time
)
// Approximate row
row
=
int
((
time
-
cd
->
x_min_value
[
0
])
/
(
cd
->
x_max_value
[
0
]
-
cd
->
x_min_value
[
0
])
*
(
cd
->
rows
[
0
]
-
1
)
+
0.5
);
if
(
row
>
cd
->
rows
[
0
]
-
1
)
row
=
cd
->
rows
[
0
]
-
1
;
else
if
(
row
<
0
)
row
=
0
;
else
{
// Find exact row
double
b1
,
b2
;
int
r
=
row
;
for
(
int
i
=
0
;;
i
++
)
{
if
(
r
==
0
)
{
b2
=
(
cd
->
x_data
[
0
][
row
]
+
cd
->
x_data
[
0
][
r
+
1
])
/
2
;
if
(
time
<
b2
)
break
;
r
++
;
else
}
else
if
(
r
==
cd
->
rows
[
0
]
-
1
)
{
b1
=
(
cd
->
x_data
[
0
][
r
]
+
cd
->
x_data
[
0
][
r
-
1
])
/
2
;
if
(
time
>=
b1
)
break
;
r
--
;
}
else
{
b1
=
(
cd
->
x_data
[
0
][
r
]
+
cd
->
x_data
[
0
][
r
-
1
])
/
2
;
b2
=
(
cd
->
x_data
[
0
][
r
]
+
cd
->
x_data
[
0
][
r
+
1
])
/
2
;
if
(
b1
<=
time
&&
time
<
b2
)
break
;
if
(
b1
<=
time
)
r
++
;
else
r
--
;
}
if
(
i
>
cd
->
rows
[
0
])
{
// Corrupt data, se original row
r
=
row
;
break
;
}
}
if
(
i
>
cd
->
rows
)
{
// Corrupt data, se original row
r
=
row
;
break
;
}
row
=
r
;
}
row
=
r
;
for
(
int
i
=
0
;
i
<
cd
->
cols
;
i
++
)
values
[
i
]
=
cd
->
y_data
[
i
][
row
];
*
t
=
cd
->
x_data
[
0
][
row
];
}
for
(
int
i
=
0
;
i
<
cd
->
cols
;
i
++
)
values
[
i
]
=
cd
->
y_data
[
i
][
row
];
else
{
// Time is a date
if
(
!
cd
->
x_reverse
)
time
=
cd
->
x_min_value_axis
[
0
]
+
x
*
(
cd
->
x_max_value_axis
[
0
]
-
cd
->
x_min_value_axis
[
0
])
/
200
;
else
time
=
cd
->
x_min_value_axis
[
0
]
+
(
200.0
-
x
)
*
(
cd
->
x_max_value_axis
[
0
]
-
cd
->
x_min_value_axis
[
0
])
/
200
;
*
t
=
cd
->
x_data
[
0
][
row
];
// Approximate row
for
(
int
j
=
0
;
j
<
cd
->
cols
;
j
++
)
{
row
=
int
((
time
-
cd
->
x_min_value
[
j
])
/
(
cd
->
x_max_value
[
j
]
-
cd
->
x_min_value
[
j
])
*
(
cd
->
rows
[
j
]
-
1
)
+
0.5
);
if
(
row
>
cd
->
rows
[
j
]
-
1
)
row
=
cd
->
rows
[
j
]
-
1
;
else
if
(
row
<
0
)
row
=
0
;
else
{
// Find exact row
double
b1
,
b2
;
int
r
=
row
;
for
(
int
i
=
0
;;
i
++
)
{
if
(
r
==
0
)
{
b2
=
(
cd
->
x_data
[
j
][
row
]
+
cd
->
x_data
[
j
][
r
+
1
])
/
2
;
if
(
time
<
b2
)
break
;
r
++
;
}
else
if
(
r
==
cd
->
rows
[
j
]
-
1
)
{
b1
=
(
cd
->
x_data
[
j
][
r
]
+
cd
->
x_data
[
0
][
r
-
1
])
/
2
;
if
(
time
>=
b1
)
break
;
r
--
;
}
else
{
b1
=
(
cd
->
x_data
[
j
][
r
]
+
cd
->
x_data
[
j
][
r
-
1
])
/
2
;
b2
=
(
cd
->
x_data
[
j
][
r
]
+
cd
->
x_data
[
j
][
r
+
1
])
/
2
;
if
(
b1
<=
time
&&
time
<
b2
)
break
;
if
(
b1
<=
time
)
r
++
;
else
r
--
;
}
if
(
i
>
cd
->
rows
[
j
])
{
// Corrupt data, se original row
r
=
row
;
break
;
}
}
row
=
r
;
}
values
[
j
]
=
cd
->
y_data
[
j
][
row
];
if
(
j
==
0
)
*
t
=
cd
->
x_data
[
j
][
row
];
}
}
}
xtt/lib/ge/src/ge_curve.h
View file @
2889b888
...
...
@@ -36,6 +36,7 @@
typedef
enum
{
curve_eDataType_LogFile
,
curve_eDataType_DsTrend
,
curve_eDataType_MultiTrend
,
curve_eDataType_ODBC
}
curve_eDataType
;
...
...
@@ -56,7 +57,7 @@ class GeCurveData {
public:
GeCurveData
(
curve_eDataType
datatype
);
curve_eDataType
type
;
int
rows
;
int
rows
[
CURVE_MAX_COLS
]
;
int
cols
;
pwr_tAName
y_name
[
CURVE_MAX_COLS
];
pwr_tAName
x_name
;
...
...
xtt/lib/glow/src/glow.h
View file @
2889b888
...
...
@@ -1979,7 +1979,7 @@ typedef enum {
typedef
struct
{
glow_eCurveDataType
type
;
int
curves
;
//!< Number of curves
int
rows
;
//!< Number of points
int
rows
[
TREND_MAX_CURVES
];
//!< Number of points
int
x_reverse
;
//!< Reverse the curves when drawing them
double
y_max_value
[
TREND_MAX_CURVES
];
//!< Max value for every curve
double
x_max_value
[
TREND_MAX_CURVES
];
//!< Max value for every curve
...
...
xtt/lib/glow/src/glow_growcurve.cpp
View file @
2889b888
...
...
@@ -65,7 +65,7 @@ void GrowCurve::configure_curves( glow_sCurveData *data)
if
(
data
->
type
==
glow_eCurveDataType_CommonX
)
{
curve_cnt
=
data
->
curves
;
no_of_points
=
data
->
rows
;
no_of_points
=
data
->
rows
[
0
]
;
for
(
i
=
0
;
i
<
curve_cnt
;
i
++
)
{
y_max_value
[
i
]
=
data
->
y_max_value
[
i
];
...
...
@@ -162,6 +162,111 @@ void GrowCurve::configure_curves( glow_sCurveData *data)
}
free
(
(
char
*
)
pointarray
);
draw
();
}
else
if
(
data
->
type
==
glow_eCurveDataType_SeparateX
)
{
curve_cnt
=
data
->
curves
;
no_of_points
=
data
->
rows
[
0
];
for
(
i
=
0
;
i
<
curve_cnt
;
i
++
)
{
y_max_value
[
i
]
=
data
->
y_max_value
[
i
];
y_min_value
[
i
]
=
data
->
y_min_value
[
i
];
curve_drawtype
[
i
]
=
data
->
color
[
i
];
curve_fill_drawtype
[
i
]
=
data
->
fillcolor
[
i
];
}
curve_width
=
min
(
DRAW_TYPE_SIZE
,
max
(
1
,
curve_width
));
for
(
idx
=
0
;
idx
<
curve_cnt
;
idx
++
)
{
points
=
data
->
rows
[
idx
];
if
(
fill_curve
)
points
+=
2
;
pointarray
=
(
glow_sPoint
*
)
calloc
(
points
,
sizeof
(
glow_sPoint
));
point_p
=
pointarray
;
for
(
i
=
0
;
i
<
points
;
i
++
)
{
if
(
!
fill_curve
)
{
if
(
data
->
x_reverse
)
x_value
=
ur
.
x
-
(
data
->
x_data
[
idx
][
i
]
-
data
->
x_min_value
[
idx
])
/
(
data
->
x_max_value
[
idx
]
-
data
->
x_min_value
[
idx
])
*
(
ur
.
x
-
ll
.
x
);
else
x_value
=
ll
.
x
+
(
data
->
x_data
[
idx
][
i
]
-
data
->
x_min_value
[
idx
])
/
(
data
->
x_max_value
[
idx
]
-
data
->
x_min_value
[
idx
])
*
(
ur
.
x
-
ll
.
x
);
x_value
=
max
(
ll
.
x
,
min
(
x_value
,
ur
.
x
));
y_value
=
ur
.
y
-
(
data
->
y_data
[
idx
][
i
]
-
y_min_value
[
idx
])
/
(
y_max_value
[
idx
]
-
y_min_value
[
idx
])
*
(
ur
.
y
-
ll
.
y
);
y_value
=
max
(
ll
.
y
,
min
(
y_value
,
ur
.
y
));
point_p
->
y
=
y_value
;
point_p
->
x
=
x_value
;
}
else
{
if
(
i
==
0
)
{
point_p
->
y
=
ur
.
y
;
// point_p->x = ur.x;
if
(
data
->
x_reverse
)
point_p
->
x
=
ur
.
x
-
(
data
->
x_data
[
idx
][
i
]
-
data
->
x_min_value
[
idx
])
/
(
data
->
x_max_value
[
idx
]
-
data
->
x_min_value
[
idx
])
*
(
ur
.
x
-
ll
.
x
);
else
point_p
->
x
=
ll
.
x
+
(
data
->
x_data
[
0
][
i
]
-
data
->
x_min_value
[
0
])
/
(
data
->
x_max_value
[
idx
]
-
data
->
x_min_value
[
idx
])
*
(
ur
.
x
-
ll
.
x
);
}
else
if
(
i
==
points
-
1
)
{
point_p
->
y
=
ur
.
y
;
if
(
data
->
x_reverse
)
point_p
->
x
=
ur
.
x
-
(
data
->
x_data
[
0
][
i
-
2
]
-
data
->
x_min_value
[
0
])
/
(
data
->
x_max_value
[
idx
]
-
data
->
x_min_value
[
idx
])
*
(
ur
.
x
-
ll
.
x
);
else
point_p
->
x
=
ll
.
x
+
(
data
->
x_data
[
0
][
i
-
2
]
-
data
->
x_min_value
[
0
])
/
(
data
->
x_max_value
[
idx
]
-
data
->
x_min_value
[
idx
])
*
(
ur
.
x
-
ll
.
x
);
// point_p->x = ll.x;
}
else
{
if
(
data
->
x_reverse
)
x_value
=
ur
.
x
-
(
data
->
x_data
[
idx
][
i
-
1
]
-
data
->
x_min_value
[
idx
])
/
(
data
->
x_max_value
[
idx
]
-
data
->
x_min_value
[
idx
])
*
(
ur
.
x
-
ll
.
x
);
else
x_value
=
ll
.
x
+
(
data
->
x_data
[
idx
][
i
-
1
]
-
data
->
x_min_value
[
idx
])
/
(
data
->
x_max_value
[
idx
]
-
data
->
x_min_value
[
idx
])
*
(
ur
.
x
-
ll
.
x
);
x_value
=
max
(
ll
.
x
,
min
(
x_value
,
ur
.
x
));
y_value
=
ur
.
y
-
(
data
->
y_data
[
idx
][
i
-
1
]
-
y_min_value
[
idx
])
/
(
y_max_value
[
idx
]
-
y_min_value
[
idx
])
*
(
ur
.
y
-
ll
.
y
);
y_value
=
max
(
ll
.
y
,
min
(
y_value
,
ur
.
y
));
point_p
->
y
=
y_value
;
point_p
->
x
=
x_value
;
}
}
point_p
++
;
}
if
(
curve_drawtype
[
idx
]
!=
glow_eDrawType_Inherit
)
dt
=
curve_drawtype
[
idx
];
else
dt
=
draw_type
;
if
(
curve_fill_drawtype
[
idx
]
!=
glow_eDrawType_Inherit
)
dt_fill
=
curve_fill_drawtype
[
idx
];
else
dt_fill
=
draw_type
;
ctx
->
nodraw
++
;
curve
[
idx
]
=
new
GrowPolyLine
(
ctx
,
""
,
pointarray
,
points
,
dt
,
curve_width
,
0
,
fill_curve
,
1
,
0
,
dt_fill
);
ctx
->
nodraw
--
;
free
(
(
char
*
)
pointarray
);
}
draw
();
}
}
...
...
xtt/lib/xtt/gtk/xtt_sevhist_gtk.cpp
View file @
2889b888
...
...
@@ -45,14 +45,17 @@
XttSevHistGtk
::
XttSevHistGtk
(
void
*
parent_ctx
,
GtkWidget
*
parent_wid
,
const
char
*
name
,
GtkWidget
**
w
,
pwr_tOid
*
xn_oid
,
pwr_tOName
*
xn_aname
,
sevcli_tCtx
xn_scctx
,
int
*
sts
,
bool
sevhistobject
)
:
XttSevHist
(
parent_ctx
,
name
,
xn_oid
,
xn_aname
,
xn_scctx
,
sts
,
sevhistobject
),
parent_widget
(
parent_wid
)
GtkWidget
*
parent_wid
,
const
char
*
name
,
GtkWidget
**
w
,
pwr_tOid
*
xn_oidv
,
pwr_tOName
*
xn_anamev
,
pwr_tOName
*
xn_onamev
,
bool
*
sevhistobjectv
,
sevcli_tCtx
xn_scctx
,
int
*
sts
)
:
XttSevHist
(
parent_ctx
,
name
,
xn_oidv
,
xn_anamev
,
xn_onamev
,
sevhistobjectv
,
xn_scctx
,
sts
),
parent_widget
(
parent_wid
)
{
char
title
[
250
];
strncpy
(
title
,
name
,
sizeof
(
title
));
...
...
xtt/lib/xtt/gtk/xtt_sevhist_gtk.h
View file @
2889b888
...
...
@@ -31,14 +31,15 @@ class XttSevHistGtk : public XttSevHist {
GtkWidget
*
parent_widget
;
//!< Parent widget.
XttSevHistGtk
(
void
*
xn_parent_ctx
,
GtkWidget
*
xn_parent_wid
,
const
char
*
xn_name
,
GtkWidget
**
w
,
pwr_tOid
*
xn_oid
,
pwr_tOName
*
xn_aname
,
sevcli_tCtx
xn_scctx
,
int
*
sts
,
bool
sevhistobject
);
GtkWidget
*
xn_parent_wid
,
const
char
*
xn_name
,
GtkWidget
**
w
,
pwr_tOid
*
xn_oidv
,
pwr_tOName
*
xn_anamev
,
pwr_tOName
*
xn_onamev
,
bool
*
sevhistobjectv
,
sevcli_tCtx
xn_scctx
,
int
*
sts
);
~
XttSevHistGtk
();
};
...
...
xtt/lib/xtt/gtk/xtt_xnav_gtk.cpp
View file @
2889b888
...
...
@@ -223,12 +223,12 @@ XttTrend *XNavGtk::xtttrend_new( char *name, pwr_tAttrRef *objar, pwr_tAttrRef *
return
new
XttTrendGtk
(
this
,
parent_wid
,
name
,
&
w
,
objar
,
plotgroup
,
sts
);
}
XttSevHist
*
XNavGtk
::
xttsevhist_new
(
char
*
name
,
pwr_tOid
*
oid
,
pwr_tOName
*
aname
,
sevcli_tCtx
scctx
,
pwr_tStatus
*
sts
,
bool
sevhistobject
)
XttSevHist
*
XNavGtk
::
xttsevhist_new
(
char
*
name
,
pwr_tOid
*
oid
v
,
pwr_tOName
*
anamev
,
pwr_tOName
*
onamev
,
bool
*
sevhistobjectv
,
sevcli_tCtx
scctx
,
pwr_tStatus
*
sts
)
{
GtkWidget
*
w
;
return
new
XttSevHistGtk
(
this
,
parent_wid
,
name
,
&
w
,
oid
,
aname
,
scctx
,
sts
,
sevhistobject
);
return
new
XttSevHistGtk
(
this
,
parent_wid
,
name
,
&
w
,
oid
v
,
anamev
,
onamev
,
sevhistobjectv
,
scctx
,
sts
);
}
XttFast
*
XNavGtk
::
xttfast_new
(
char
*
name
,
pwr_tAttrRef
*
objar
,
pwr_tStatus
*
sts
)
...
...
xtt/lib/xtt/gtk/xtt_xnav_gtk.h
View file @
2889b888
...
...
@@ -58,8 +58,9 @@ class XNavGtk : public XNav {
Op
*
op_new
(
char
*
opplace
,
pwr_tStatus
*
sts
);
XttTrend
*
xtttrend_new
(
char
*
name
,
pwr_tAttrRef
*
objar
,
pwr_tAttrRef
*
plotgroup
,
pwr_tStatus
*
sts
);
XttSevHist
*
xttsevhist_new
(
char
*
name
,
pwr_tOid
*
oid
,
pwr_tOName
*
aname
,
sevcli_tCtx
scctx
,
pwr_tStatus
*
sts
,
bool
sevhistobject
=
false
);
XttSevHist
*
xttsevhist_new
(
char
*
name
,
pwr_tOid
*
oidv
,
pwr_tOName
*
anamev
,
pwr_tOName
*
onamev
,
bool
*
sevhistobjectv
,
sevcli_tCtx
scctx
,
pwr_tStatus
*
sts
);
XttFast
*
xttfast_new
(
char
*
name
,
pwr_tAttrRef
*
objar
,
pwr_tStatus
*
sts
);
XAttOne
*
xattone_new
(
pwr_tAttrRef
*
objar
,
char
*
title
,
unsigned
int
priv
,
pwr_tStatus
*
sts
);
...
...
xtt/lib/xtt/src/xtt_fast.cpp
View file @
2889b888
...
...
@@ -152,9 +152,9 @@ XttFast::XttFast( void *parent_ctx,
default:
element_size
[
i
]
=
4
;
}
gcd
->
rows
[
i
]
=
max_points
;
}
gcd
->
cols
=
fast_cnt
;
gcd
->
rows
=
max_points
;
axis_configured
=
true
;
for
(
i
=
0
;
i
<
FAST_CURVES
;
i
++
)
{
...
...
xtt/lib/xtt/src/xtt_sevhist.cpp
View file @
2889b888
...
...
@@ -46,20 +46,36 @@
XttSevHist
::
XttSevHist
(
void
*
parent_ctx
,
const
char
*
name
,
pwr_tOid
*
xn_oid
,
pwr_tOName
*
xn_aname
,
sevcli_tCtx
xn_scctx
,
int
*
sts
,
bool
sevhistobject
)
:
const
char
*
name
,
pwr_tOid
*
xn_oidv
,
pwr_tOName
*
xn_anamev
,
pwr_tOName
*
xn_onamev
,
bool
*
xn_sevhistobjectv
,
sevcli_tCtx
xn_scctx
,
int
*
sts
)
:
xnav
(
parent_ctx
),
gcd
(
0
),
curve
(
0
),
rows
(
0
),
vsize
(
0
),
timerid
(
0
),
close_cb
(
0
),
help_cb
(
0
),
first_scan
(
1
),
scctx
(
xn_scctx
),
oid
(
xn_oid
[
0
]),
time_low_old
(
0
),
time_high_old
(
0
),
sevhistobject
(
sevhistobject
)
first_scan
(
1
),
scctx
(
xn_scctx
),
time_low_old
(
0
),
time_high_old
(
0
)
{
strncpy
(
aname
,
xn_aname
[
0
],
sizeof
(
aname
));
get_data
(
sts
,
pwr_cNTime
,
pwr_cNTime
);
if
(
EVEN
(
*
sts
))
return
;
// Count number of curves
for
(
oid_cnt
=
0
;
xn_oidv
[
oid_cnt
].
vid
!=
0
;
oid_cnt
++
)
;
if
(
oid_cnt
>
XTT_SEVHIST_MAX
)
oid_cnt
=
XTT_SEVHIST_MAX
;
memcpy
(
oidv
,
xn_oidv
,
oid_cnt
*
sizeof
(
oidv
[
0
]));
memcpy
(
anamev
,
xn_anamev
,
oid_cnt
*
sizeof
(
anamev
[
0
]));
memcpy
(
onamev
,
xn_onamev
,
oid_cnt
*
sizeof
(
onamev
[
0
]));
memcpy
(
sevhistobjectv
,
xn_sevhistobjectv
,
oid_cnt
*
sizeof
(
sevhistobjectv
[
0
]));
if
(
oid_cnt
==
1
)
{
get_data
(
sts
,
pwr_cNTime
,
pwr_cNTime
);
if
(
EVEN
(
*
sts
))
return
;
}
else
{
get_multidata
(
sts
,
pwr_cNTime
,
pwr_cNTime
);
if
(
EVEN
(
*
sts
))
return
;
}
cdh_StrncpyCutOff
(
title
,
name
,
sizeof
(
title
),
1
);
}
...
...
@@ -71,19 +87,20 @@ XttSevHist::~XttSevHist()
int
XttSevHist
::
get_data
(
pwr_tStatus
*
sts
,
pwr_tTime
from
,
pwr_tTime
to
)
{
if
(
sevhistobject
)
{
if
(
sevhistobject
v
[
0
]
)
{
return
get_objectdata
(
sts
,
from
,
to
);
}
pwr_tTime
*
tbuf
;
void
*
vbuf
;
pwr_tDeltaTime
trange
;
sevcli_get_itemdata
(
sts
,
scctx
,
oid
,
aname
,
from
,
to
,
1000
,
&
tbuf
,
&
vbuf
,
sevcli_get_itemdata
(
sts
,
scctx
,
oid
v
[
0
],
anamev
[
0
]
,
from
,
to
,
1000
,
&
tbuf
,
&
vbuf
,
&
rows
,
&
vtype
,
&
vsize
);
if
(
EVEN
(
*
sts
))
return
0
;
if
(
rows
==
0
)
{
*
sts
=
SEV__NODATATIME
;
return
0
;
}
...
...
@@ -98,7 +115,7 @@ int XttSevHist::get_data( pwr_tStatus *sts, pwr_tTime from, pwr_tTime to)
gcd
->
x_axis_type
[
0
]
=
curve_eAxis_x
;
strcpy
(
gcd
->
x_format
[
0
],
"%10t"
);
strcpy
(
gcd
->
y_name
[
0
],
aname
);
strcpy
(
gcd
->
y_name
[
0
],
aname
v
[
0
]
);
gcd
->
y_data
[
0
]
=
(
double
*
)
calloc
(
1
,
8
*
rows
);
for
(
int
i
=
0
;
i
<
rows
;
i
++
)
{
...
...
@@ -147,7 +164,7 @@ int XttSevHist::get_data( pwr_tStatus *sts, pwr_tTime from, pwr_tTime to)
gcd
->
y_axis_type
[
0
]
=
curve_eAxis_y
;
gcd
->
cols
=
1
;
gcd
->
rows
=
rows
;
gcd
->
rows
[
0
]
=
rows
;
gcd
->
get_borders
();
gcd
->
get_default_axis
();
...
...
@@ -184,12 +201,13 @@ int XttSevHist::get_objectdata( pwr_tStatus *sts, pwr_tTime from, pwr_tTime to)
pwr_tDeltaTime
trange
;
sevcli_get_objectitemdata
(
sts
,
scctx
,
oid
,
aname
,
from
,
to
,
1000
,
&
tbuf
,
&
vbuf
,
sevcli_get_objectitemdata
(
sts
,
scctx
,
oid
v
[
0
],
anamev
[
0
]
,
from
,
to
,
1000
,
&
tbuf
,
&
vbuf
,
&
rows
,
&
histattrbuf
,
&
numAttributes
);
if
(
EVEN
(
*
sts
))
return
0
;
if
(
rows
==
0
)
{
*
sts
=
SEV__NODATATIME
;
return
0
;
}
...
...
@@ -295,7 +313,252 @@ int XttSevHist::get_objectdata( pwr_tStatus *sts, pwr_tTime from, pwr_tTime to)
gcd
->
rows
=
rows
;
for
(
int
i
=
0
;
i
<
gcd
->
cols
;
i
++
)
gcd
->
rows
[
i
]
=
rows
;
gcd
->
get_borders
();
gcd
->
get_default_axis
();
if
(
to
.
tv_sec
!=
0
&&
from
.
tv_sec
!=
0
)
{
time_Adiff
(
&
trange
,
&
to
,
&
from
);
if
(
time_DToFloat
(
0
,
&
trange
)
<
600
)
strcpy
(
gcd
->
x_format
[
0
],
"%10t"
);
else
strcpy
(
gcd
->
x_format
[
0
],
"%11t"
);
}
else
strcpy
(
gcd
->
x_format
[
0
],
"%11t"
);
gcd
->
select_color
(
0
);
if
(
curve
)
{
curve
->
set_curvedata
(
gcd
);
// This will free the old gcd
curve
->
configure_curves
();
curve
->
configure_axes
();
curve
->
redraw
();
}
*
sts
=
SEV__SUCCESS
;
return
1
;
}
int
XttSevHist
::
get_multidata
(
pwr_tStatus
*
sts
,
pwr_tTime
from
,
pwr_tTime
to
)
{
pwr_tTime
*
tbuf
;
void
*
vbuf
;
pwr_tDeltaTime
trange
;
int
curve_cnt
=
0
;
// Create data for time axis
gcd
=
new
GeCurveData
(
curve_eDataType_MultiTrend
);
strcpy
(
gcd
->
x_name
,
"Time"
);
for
(
int
k
=
0
;
k
<
oid_cnt
;
k
++
)
{
if
(
curve_cnt
>=
CURVE_MAX_COLS
)
{
printf
(
"To many columns for curve class max: %d
\n
"
,
CURVE_MAX_COLS
);
break
;
}
if
(
!
sevhistobjectv
[
k
])
{
sevcli_get_itemdata
(
sts
,
scctx
,
oidv
[
k
],
anamev
[
k
],
from
,
to
,
1000
,
&
tbuf
,
&
vbuf
,
&
rows
,
&
vtype
,
&
vsize
);
if
(
EVEN
(
*
sts
))
return
0
;
if
(
rows
==
0
)
continue
;
gcd
->
x_data
[
curve_cnt
]
=
(
double
*
)
calloc
(
1
,
8
*
rows
);
for
(
int
i
=
0
;
i
<
rows
;
i
++
)
gcd
->
x_data
[
curve_cnt
][
i
]
=
(
double
)
tbuf
[
i
].
tv_sec
+
(
double
)
1e-9
*
tbuf
[
i
].
tv_nsec
;
gcd
->
x_axis_type
[
curve_cnt
]
=
curve_eAxis_x
;
strcpy
(
gcd
->
x_format
[
curve_cnt
],
"%10t"
);
strcpy
(
gcd
->
y_name
[
curve_cnt
],
onamev
[
k
]);
if
(
strcmp
(
onamev
[
k
],
""
)
!=
0
)
strcat
(
gcd
->
y_name
[
curve_cnt
],
"."
);
strcat
(
gcd
->
y_name
[
curve_cnt
],
anamev
[
k
]);
gcd
->
y_data
[
curve_cnt
]
=
(
double
*
)
calloc
(
1
,
8
*
rows
);
for
(
int
i
=
0
;
i
<
rows
;
i
++
)
{
switch
(
vtype
)
{
case
pwr_eType_Int64
:
gcd
->
y_data
[
curve_cnt
][
i
]
=
((
pwr_tInt32
*
)
vbuf
)[
i
];
break
;
case
pwr_eType_Int32
:
gcd
->
y_data
[
curve_cnt
][
i
]
=
((
pwr_tInt32
*
)
vbuf
)[
i
];
break
;
case
pwr_eType_Int16
:
gcd
->
y_data
[
curve_cnt
][
i
]
=
((
pwr_tInt32
*
)
vbuf
)[
i
];
break
;
case
pwr_eType_Int8
:
gcd
->
y_data
[
curve_cnt
][
i
]
=
((
pwr_tInt32
*
)
vbuf
)[
i
];
break
;
case
pwr_eType_UInt64
:
gcd
->
y_data
[
curve_cnt
][
i
]
=
((
pwr_tUInt32
*
)
vbuf
)[
i
];
break
;
case
pwr_eType_UInt32
:
gcd
->
y_data
[
curve_cnt
][
i
]
=
((
pwr_tUInt32
*
)
vbuf
)[
i
];
break
;
case
pwr_eType_UInt16
:
gcd
->
y_data
[
curve_cnt
][
i
]
=
((
pwr_tUInt32
*
)
vbuf
)[
i
];
break
;
case
pwr_eType_UInt8
:
gcd
->
y_data
[
curve_cnt
][
i
]
=
((
pwr_tUInt32
*
)
vbuf
)[
i
];
break
;
case
pwr_eType_Float32
:
gcd
->
y_data
[
curve_cnt
][
i
]
=
((
pwr_tFloat32
*
)
vbuf
)[
i
];
break
;
case
pwr_eType_Float64
:
gcd
->
y_data
[
curve_cnt
][
i
]
=
((
pwr_tFloat64
*
)
vbuf
)[
i
];
break
;
case
pwr_eType_Boolean
:
gcd
->
y_data
[
curve_cnt
][
i
]
=
((
pwr_tBoolean
*
)
vbuf
)[
i
];
break
;
default:
*
sts
=
SEV__CURVETYPE
;
return
0
;
}
}
free
(
tbuf
);
free
(
vbuf
);
gcd
->
y_axis_type
[
curve_cnt
]
=
curve_eAxis_y
;
gcd
->
rows
[
curve_cnt
]
=
rows
;
curve_cnt
++
;
}
else
{
// SevHistObject object
sevcli_sHistAttr
*
histattrbuf
;
int
numAttributes
;
sevcli_get_objectitemdata
(
sts
,
scctx
,
oidv
[
k
],
anamev
[
k
],
from
,
to
,
1000
,
&
tbuf
,
&
vbuf
,
&
rows
,
&
histattrbuf
,
&
numAttributes
);
if
(
EVEN
(
*
sts
))
return
0
;
if
(
rows
==
0
)
continue
;
gcd
->
x_data
[
curve_cnt
]
=
(
double
*
)
calloc
(
1
,
8
*
rows
);
for
(
int
i
=
0
;
i
<
rows
;
i
++
)
gcd
->
x_data
[
curve_cnt
][
i
]
=
(
double
)
tbuf
[
i
].
tv_sec
+
(
double
)
1e-9
*
tbuf
[
i
].
tv_nsec
;
strcpy
(
gcd
->
x_name
,
"Time"
);
gcd
->
x_axis_type
[
curve_cnt
]
=
curve_eAxis_x
;
strcpy
(
gcd
->
x_format
[
0
],
"%10t"
);
//todo linesize br vi kunna f frn sevcli_get_objectitemdata
int
linesize
=
0
;
for
(
int
i
=
0
;
i
<
numAttributes
;
i
++
)
{
linesize
+=
histattrbuf
[
i
].
size
;
}
void
*
dataptr
=
vbuf
;
int
tmp
=
0
;
for
(
int
i
=
0
;
i
<
numAttributes
;
i
++
)
{
gcd
->
x_data
[
curve_cnt
]
=
(
double
*
)
calloc
(
1
,
8
*
rows
);
for
(
int
j
=
0
;
j
<
rows
;
j
++
)
gcd
->
x_data
[
curve_cnt
][
j
]
=
(
double
)
tbuf
[
j
].
tv_sec
+
(
double
)
1e-9
*
tbuf
[
j
].
tv_nsec
;
strcpy
(
gcd
->
x_name
,
"Time"
);
gcd
->
x_axis_type
[
curve_cnt
]
=
curve_eAxis_x
;
strcpy
(
gcd
->
x_format
[
curve_cnt
],
"%10t"
);
switch
(
histattrbuf
[
i
].
type
)
{
case
pwr_eType_Int64
:
case
pwr_eType_Int32
:
case
pwr_eType_Int16
:
case
pwr_eType_Int8
:
case
pwr_eType_UInt64
:
case
pwr_eType_UInt32
:
case
pwr_eType_UInt16
:
case
pwr_eType_UInt8
:
case
pwr_eType_Float32
:
case
pwr_eType_Float64
:
case
pwr_eType_Boolean
:
break
;
default:
tmp
+=
histattrbuf
[
i
].
size
;
continue
;
}
if
(
curve_cnt
>=
CURVE_MAX_COLS
)
{
printf
(
"To many columns for curve class max:%d
\n
"
,
CURVE_MAX_COLS
);
break
;
}
strcpy
(
gcd
->
y_name
[
curve_cnt
],
onamev
[
k
]);
if
(
strcmp
(
onamev
[
k
],
""
)
!=
0
)
strcat
(
gcd
->
y_name
[
curve_cnt
],
"."
);
strcat
(
gcd
->
y_name
[
curve_cnt
],
histattrbuf
[
i
].
aname
);
gcd
->
y_data
[
curve_cnt
]
=
(
double
*
)
calloc
(
1
,
8
*
rows
);
gcd
->
y_axis_type
[
curve_cnt
]
=
curve_eAxis_y
;
dataptr
=
(
char
*
)
vbuf
+
tmp
;
for
(
int
j
=
0
;
j
<
rows
;
j
++
)
{
dataptr
=
((
char
*
)
vbuf
)
+
j
*
linesize
+
tmp
;
switch
(
histattrbuf
[
i
].
type
)
{
case
pwr_eType_Int64
:
gcd
->
y_data
[
curve_cnt
][
j
]
=
*
(
pwr_tInt64
*
)
dataptr
;
break
;
case
pwr_eType_Int32
:
gcd
->
y_data
[
curve_cnt
][
j
]
=
*
(
pwr_tInt32
*
)
dataptr
;
break
;
case
pwr_eType_Int16
:
gcd
->
y_data
[
curve_cnt
][
j
]
=
*
(
pwr_tInt16
*
)
dataptr
;
break
;
case
pwr_eType_Int8
:
gcd
->
y_data
[
curve_cnt
][
j
]
=
*
(
pwr_tInt8
*
)
dataptr
;
break
;
case
pwr_eType_UInt64
:
gcd
->
y_data
[
curve_cnt
][
j
]
=
*
(
pwr_tUInt64
*
)
dataptr
;
break
;
case
pwr_eType_UInt32
:
gcd
->
y_data
[
curve_cnt
][
j
]
=
*
(
pwr_tUInt32
*
)
dataptr
;
break
;
case
pwr_eType_UInt16
:
gcd
->
y_data
[
curve_cnt
][
j
]
=
*
(
pwr_tUInt16
*
)
dataptr
;
break
;
case
pwr_eType_UInt8
:
gcd
->
y_data
[
curve_cnt
][
j
]
=
*
(
pwr_tUInt8
*
)
dataptr
;
break
;
case
pwr_eType_Float32
:
gcd
->
y_data
[
curve_cnt
][
j
]
=
*
(
pwr_tFloat32
*
)
dataptr
;
break
;
case
pwr_eType_Float64
:
gcd
->
y_data
[
curve_cnt
][
j
]
=
*
(
pwr_tFloat64
*
)
dataptr
;
break
;
case
pwr_eType_Boolean
:
gcd
->
y_data
[
curve_cnt
][
j
]
=
*
(
pwr_tBoolean
*
)
dataptr
;
break
;
default:
*
sts
=
SEV__CURVETYPE
;
return
0
;
}
}
tmp
+=
histattrbuf
[
i
].
size
;
gcd
->
y_axis_type
[
curve_cnt
]
=
curve_eAxis_y
;
gcd
->
rows
[
curve_cnt
]
=
rows
;
curve_cnt
++
;
}
free
(
tbuf
);
free
(
vbuf
);
free
(
histattrbuf
);
}
}
if
(
curve_cnt
==
0
)
{
delete
gcd
;
*
sts
=
SEV__NODATATIME
;
return
0
;
}
gcd
->
cols
=
curve_cnt
;
gcd
->
get_borders
();
gcd
->
get_default_axis
();
...
...
@@ -363,7 +626,10 @@ void XttSevHist::sevhist_higher_res_cb( void *ctx)
printf
(
"Low: %s, High: %s
\n
"
,
s1
,
s2
);
}
sevhist
->
get_data
(
&
sts
,
t_low
,
t_high
);
if
(
sevhist
->
oid_cnt
==
1
)
sevhist
->
get_data
(
&
sts
,
t_low
,
t_high
);
else
sevhist
->
get_multidata
(
&
sts
,
t_low
,
t_high
);
sevhist
->
time_low_old
=
0
;
sevhist
->
time_high_old
=
0
;
...
...
@@ -399,7 +665,12 @@ void XttSevHist::sevhist_lower_res_cb( void *ctx)
printf
(
"Low: %s, High: %s
\n
"
,
s1
,
s2
);
}
sevhist
->
get_data
(
&
sts
,
t_low
,
t_high
);
if
(
sevhist
->
oid_cnt
==
1
)
sevhist
->
get_data
(
&
sts
,
t_low
,
t_high
);
else
sevhist
->
get_multidata
(
&
sts
,
t_low
,
t_high
);
sevhist
->
time_low_old
=
t_low
.
tv_sec
;
sevhist
->
time_high_old
=
t_high
.
tv_sec
;
}
...
...
xtt/lib/xtt/src/xtt_sevhist.h
View file @
2889b888
...
...
@@ -66,22 +66,26 @@ class XttSevHist {
void
(
*
close_cb
)(
void
*
,
XttSevHist
*
);
//!< Close callback to parent.
void
(
*
help_cb
)(
void
*
,
const
char
*
);
//!< Open help window.
bool
first_scan
;
//!< Indicates that this is the first scan.
char
title
[
250
];
//!< Window title
char
title
[
250
];
//!< Window title
sevcli_tCtx
scctx
;
pwr_tOName
aname
;
pwr_tOid
oid
;
pwr_tOName
anamev
[
XTT_SEVHIST_MAX
];
pwr_tOName
onamev
[
XTT_SEVHIST_MAX
];
pwr_tOid
oidv
[
XTT_SEVHIST_MAX
];
int
oid_cnt
;
CoWow
*
wow
;
long
int
time_low_old
;
long
int
time_high_old
;
bool
sevhistobject
;
//!< Indicates that it is a SevHistObject
bool
sevhistobjectv
[
XTT_SEVHIST_MAX
];
//!< Indicates that it is a SevHistObject
//! Constructor
XttSevHist
(
void
*
xn_parent_ctx
,
const
char
*
xn_name
,
pwr_tOid
*
xn_oid
,
pwr_tOid
*
xn_oid
v
,
pwr_tOName
*
xn_aname
,
pwr_tOName
*
xn_oname
,
bool
*
sevhistobjectv
,
sevcli_tCtx
xn_scctx
,
int
*
sts
,
bool
sevhistobject
);
int
*
sts
);
//! Destructor
virtual
~
XttSevHist
();
...
...
@@ -90,6 +94,7 @@ class XttSevHist {
void
pop
();
int
get_data
(
pwr_tStatus
*
sts
,
pwr_tTime
from
,
pwr_tTime
to
);
int
get_objectdata
(
pwr_tStatus
*
sts
,
pwr_tTime
from
,
pwr_tTime
to
);
int
get_multidata
(
pwr_tStatus
*
sts
,
pwr_tTime
from
,
pwr_tTime
to
);
static
void
sevhist_close_cb
(
void
*
ctx
);
static
void
sevhist_higher_res_cb
(
void
*
ctx
);
...
...
xtt/lib/xtt/src/xtt_trend.cpp
View file @
2889b888
...
...
@@ -227,9 +227,9 @@ XttTrend::XttTrend( void *parent_ctx,
default:
element_size
[
i
]
=
4
;
}
gcd
->
rows
[
i
]
=
max_points
;
}
gcd
->
cols
=
trend_cnt
;
gcd
->
rows
=
max_points
;
gcd
->
x_reverse
=
1
;
gcd
->
get_borders
();
gcd
->
get_default_axis
();
...
...
xtt/lib/xtt/src/xtt_xnav.h
View file @
2889b888
...
...
@@ -341,8 +341,9 @@ class XNav {
virtual
Op
*
op_new
(
char
*
opplace
,
pwr_tStatus
*
sts
)
{
return
0
;}
virtual
XttTrend
*
xtttrend_new
(
char
*
name
,
pwr_tAttrRef
*
objar
,
pwr_tAttrRef
*
plotgroup
,
pwr_tStatus
*
sts
)
{
return
0
;}
virtual
XttSevHist
*
xttsevhist_new
(
char
*
name
,
pwr_tOid
*
oid
,
pwr_tOName
*
aname
,
sevcli_tCtx
scctx
,
pwr_tStatus
*
sts
,
bool
sevhistobject
=
false
)
{
return
0
;}
virtual
XttSevHist
*
xttsevhist_new
(
char
*
name
,
pwr_tOid
*
oidv
,
pwr_tOName
*
aname
,
pwr_tOName
*
oname
,
bool
*
sevhistobjectv
,
sevcli_tCtx
scctx
,
pwr_tStatus
*
sts
)
{
return
0
;}
virtual
XttFast
*
xttfast_new
(
char
*
name
,
pwr_tAttrRef
*
objar
,
pwr_tStatus
*
sts
)
{
return
0
;}
virtual
XAttOne
*
xattone_new
(
pwr_tAttrRef
*
objar
,
char
*
title
,
unsigned
int
priv
,
pwr_tStatus
*
sts
)
{
return
0
;}
...
...
xtt/lib/xtt/src/xtt_xnav_command.cpp
View file @
2889b888
...
...
@@ -3109,6 +3109,9 @@ static int xnav_open_func( void *client_data,
char
server_node
[
40
];
pwr_tOid
oidv
[
11
];
pwr_tOName
anamev
[
11
];
pwr_tOName
onamev
[
11
];
bool
sevhistobjectv
[
11
];
int
oid_cnt
=
0
;
int
sts
;
pwr_tAName
name_array
[
10
];
int
i
,
names
;
...
...
@@ -3177,22 +3180,100 @@ static int xnav_open_func( void *client_data,
if
(
EVEN
(
sts
))
return
sts
;
switch
(
classid
)
{
case
pwr_cClass_SevHist
:
break
;
case
pwr_cClass_SevHistObject
:
sevHistObjectFound
=
true
;
break
;
case
pwr_cClass_PlotGroup
:
xnav
->
message
(
'E'
,
"Not yet implemented"
);
return
XNAV__HOLDCOMMAND
;
default:
xnav
->
message
(
'E'
,
"Error in object class"
);
return
XNAV__HOLDCOMMAND
;
case
pwr_cClass_SevHist
:
break
;
case
pwr_cClass_SevHistObject
:
sevHistObjectFound
=
true
;
break
;
case
pwr_cClass_PlotGroup
:
plotgroup
=
sevhist_aref
;
plotgroup_found
=
1
;
break
;
default:
xnav
->
message
(
'E'
,
"Error in object class"
);
return
XNAV__HOLDCOMMAND
;
}
if
(
plotgroup_found
)
break
;
if
(
sevHistObjectFound
)
{
if
(
plotgroup_found
)
{
pwr_sClass_PlotGroup
plot
;
pwr_tCid
cid
;
int
j
;
sts
=
gdh_GetObjectInfo
(
hist_name
,
&
plot
,
sizeof
(
plot
));
if
(
EVEN
(
sts
))
return
sts
;
for
(
j
=
0
;
j
<
20
;
j
++
)
{
if
(
cdh_ObjidIsNull
(
plot
.
YObjectName
[
j
].
Objid
))
break
;
sevhist_aref
=
plot
.
YObjectName
[
j
];
sts
=
gdh_GetAttrRefTid
(
&
sevhist_aref
,
&
cid
);
if
(
EVEN
(
sts
))
return
sts
;
switch
(
cid
)
{
case
pwr_cClass_SevHist
:
{
sts
=
gdh_ArefANameToAref
(
&
sevhist_aref
,
"Attribute"
,
&
attr_aref
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
gdh_GetObjectInfoAttrref
(
&
attr_aref
,
&
aref
,
sizeof
(
aref
));
if
(
EVEN
(
sts
))
return
sts
;
sts
=
gdh_AttrrefToName
(
&
aref
,
aname
,
sizeof
(
aname
),
cdh_mNName
);
if
(
EVEN
(
sts
))
{
xnav
->
message
(
'E'
,
"Error in SevHist configuration"
);
return
XNAV__HOLDCOMMAND
;
}
s
=
strchr
(
aname
,
'.'
);
if
(
!
s
)
{
xnav
->
message
(
'E'
,
"Error in SevHist configuration"
);
return
XNAV__HOLDCOMMAND
;
}
*
s
=
0
;
strcpy
(
onamev
[
oid_cnt
],
aname
);
strcpy
(
anamev
[
oid_cnt
],
s
+
1
);
oidv
[
oid_cnt
]
=
aref
.
Objid
;
sevhistobjectv
[
oid_cnt
]
=
false
;
oid_cnt
++
;
break
;
}
case
pwr_cClass_SevHistObject
:
{
sts
=
gdh_ArefANameToAref
(
&
sevhist_aref
,
"Object"
,
&
attr_aref
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
gdh_GetObjectInfoAttrref
(
&
attr_aref
,
&
aref
,
sizeof
(
aref
));
if
(
EVEN
(
sts
))
return
sts
;
sts
=
gdh_AttrrefToName
(
&
aref
,
aname
,
sizeof
(
aname
),
cdh_mNName
);
if
(
EVEN
(
sts
))
{
xnav
->
message
(
'E'
,
"Error in SevHist configuration"
);
return
XNAV__HOLDCOMMAND
;
}
s
=
strchr
(
aname
,
'.'
);
if
(
!
s
)
{
//It is a complete object
anamev
[
oid_cnt
][
0
]
=
'\0'
;
}
else
{
strcpy
(
anamev
[
oid_cnt
],
s
+
1
);
*
s
=
0
;
}
strcpy
(
onamev
[
oid_cnt
],
aname
);
oidv
[
oid_cnt
]
=
aref
.
Objid
;
sevhistobjectv
[
oid_cnt
]
=
true
;
oid_cnt
++
;
break
;
}
default:
;
}
}
if
(
oid_cnt
==
0
)
{
xnav
->
message
(
'E'
,
"History objects in PlotGroup not found"
);
return
XNAV__SUCCESS
;
}
}
else
if
(
sevHistObjectFound
)
{
sts
=
gdh_ArefANameToAref
(
&
sevhist_aref
,
"Object"
,
&
attr_aref
);
if
(
EVEN
(
sts
))
return
sts
;
...
...
@@ -3207,12 +3288,15 @@ static int xnav_open_func( void *client_data,
s
=
strchr
(
aname
,
'.'
);
if
(
!
s
)
{
//It is a complete object
anamev
[
i
][
0
]
=
'\0'
;
anamev
[
oid_cnt
][
0
]
=
'\0'
;
}
else
{
strcpy
(
anamev
[
i
],
s
+
1
);
strcpy
(
anamev
[
oid_cnt
],
s
+
1
);
}
oidv
[
i
]
=
aref
.
Objid
;
oidv
[
oid_cnt
]
=
aref
.
Objid
;
sevhistobjectv
[
oid_cnt
]
=
true
;
strcpy
(
onamev
[
oid_cnt
],
""
);
oid_cnt
++
;
}
else
{
sts
=
gdh_ArefANameToAref
(
&
sevhist_aref
,
"Attribute"
,
&
attr_aref
);
...
...
@@ -3232,8 +3316,11 @@ static int xnav_open_func( void *client_data,
return
XNAV__HOLDCOMMAND
;
}
strcpy
(
anamev
[
i
],
s
+
1
);
oidv
[
i
]
=
aref
.
Objid
;
strcpy
(
anamev
[
oid_cnt
],
s
+
1
);
oidv
[
oid_cnt
]
=
aref
.
Objid
;
sevhistobjectv
[
oid_cnt
]
=
false
;
strcpy
(
onamev
[
oid_cnt
],
""
);
oid_cnt
++
;
}
// Get server and connect to server
...
...
@@ -3260,7 +3347,7 @@ static int xnav_open_func( void *client_data,
sevcli_set_servernode
(
&
sts
,
xnav
->
scctx
,
server_node
);
if
(
EVEN
(
sts
))
return
sts
;
}
oidv
[
i
]
=
pwr_cNOid
;
oidv
[
oid_cnt
]
=
pwr_cNOid
;
if
(
EVEN
(
dcli_get_qualifier
(
"/TITLE"
,
title_str
,
sizeof
(
title_str
))))
{
if
(
plotgroup_found
)
{
...
...
@@ -3277,17 +3364,19 @@ static int xnav_open_func( void *client_data,
}
if
(
plotgroup_found
)
{
xnav
->
message
(
'E'
,
"Not yet implemented"
);
return
XNAV__HOLDCOMMAND
;
hist
=
xnav
->
xttsevhist_new
(
title_str
,
oidv
,
anamev
,
onamev
,
sevhistobjectv
,
xnav
->
scctx
,
&
sts
);
if
(
ODD
(
sts
))
{
hist
->
help_cb
=
xnav_sevhist_help_cb
;
}
}
else
if
(
sevHistObjectFound
)
{
hist
=
xnav
->
xttsevhist_new
(
title_str
,
oidv
,
anamev
,
xnav
->
scctx
,
&
sts
,
true
);
hist
=
xnav
->
xttsevhist_new
(
title_str
,
oidv
,
anamev
,
onamev
,
sevhistobjectv
,
xnav
->
scctx
,
&
sts
);
if
(
ODD
(
sts
))
{
hist
->
help_cb
=
xnav_sevhist_help_cb
;
}
}
else
{
hist
=
xnav
->
xttsevhist_new
(
title_str
,
oidv
,
anamev
,
xnav
->
scctx
,
&
sts
);
hist
=
xnav
->
xttsevhist_new
(
title_str
,
oidv
,
anamev
,
onamev
,
sevhistobjectv
,
xnav
->
scctx
,
&
sts
);
if
(
ODD
(
sts
))
{
hist
->
help_cb
=
xnav_sevhist_help_cb
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment