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
5a3ff742
Commit
5a3ff742
authored
May 05, 2015
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ge commmands build and create bar added
parent
b33caab3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
212 additions
and
0 deletions
+212
-0
src/doc/man/en_us/man_geref.dat
src/doc/man/en_us/man_geref.dat
+59
-0
src/msg/ge/src/ge_msg.msg
src/msg/ge/src/ge_msg.msg
+1
-0
xtt/lib/ge/src/ge_graph_command.cpp
xtt/lib/ge/src/ge_graph_command.cpp
+152
-0
No files found.
src/doc/man/en_us/man_geref.dat
View file @
5a3ff742
...
@@ -4858,6 +4858,7 @@ Below is a description of commands in Ge
...
@@ -4858,6 +4858,7 @@ Below is a description of commands in Ge
add <link>gecmd_add
add <link>gecmd_add
<t>add polyline <link>gecmd_add_polyline
<t>add polyline <link>gecmd_add_polyline
build <link>gecmd_build
create <link>gecmd_create
create <link>gecmd_create
<t>create rectangle <link>gecmd_create_rect
<t>create rectangle <link>gecmd_create_rect
<t>create arc <link>gecmd_create_arc
<t>create arc <link>gecmd_create_arc
...
@@ -4866,6 +4867,7 @@ create <link>gecmd_create
...
@@ -4866,6 +4867,7 @@ create <link>gecmd_create
<t>create rectangle <link>gecmd_create_rect
<t>create rectangle <link>gecmd_create_rect
<t>create text <link>gecmd_create_text
<t>create text <link>gecmd_create_text
<t>create subgraph <link>gecmd_create_subgraph
<t>create subgraph <link>gecmd_create_subgraph
<t>create bar <link>gecmd_create_bar
exit <link>gecmd_exit
exit <link>gecmd_exit
group <link>gecmd_group
group <link>gecmd_group
move <link>gecmd_move
move <link>gecmd_move
...
@@ -4939,6 +4941,17 @@ segments are created by 'add polyline'.
...
@@ -4939,6 +4941,17 @@ segments are created by 'add polyline'.
/y1 <t>y-coordinate for the added segment.
/y1 <t>y-coordinate for the added segment.
</topic>
</topic>
<topic>gecmd_build
build
Build the current graph.
The pwg-file is copied to $pwrp_exe.
<b>Syntax
<c>ge> build
</topic>
<topic>gecmd_create <style>function
<topic>gecmd_create <style>function
create
create
...
@@ -5047,6 +5060,21 @@ Create a subgraph object.
...
@@ -5047,6 +5060,21 @@ Create a subgraph object.
/y2
/y2
</topic>
</topic>
<topic>gecmd_create_bar
create bar
Create a bar object.
<b>Syntax
<c>ge> create bar /x1= /y1= [/x2= /y2=]
/x1 <t>x-coordinate for the upper left corner.
/y1 <t>y-coordinate for the upper left corner.
/x2 <t>If the point (x2, y2) is supplied, the bar is scaled to fit inside a
<t>rectangle with the corner points (x1, y1) and (x2, y2).
/y2
</topic>
<topic>gecmd_exit
<topic>gecmd_exit
exit
exit
...
@@ -5634,6 +5662,7 @@ functions. Here follows a list of build in functions that also can be used in Ge
...
@@ -5634,6 +5662,7 @@ functions. Here follows a list of build in functions that also can be used in Ge
GetCurrentObject <t>Returns the identity of the last created object.<link>GetCurrentObject()
GetCurrentObject <t>Returns the identity of the last created object.<link>GetCurrentObject()
GetTextExtent <t>Calculate the extent of a text. <link>GetTextExtent()
GetTextExtent <t>Calculate the extent of a text. <link>GetTextExtent()
SelectAdd <t>Add an object to select list. <link>SelectAdd()
SelectAdd <t>Add an object to select list. <link>SelectAdd()
SetDraw <t>Set drawing on or off. <link>SetDraw()
SetExtern <t>Set subgraph extern. <link>SetExtern()
SetExtern <t>Set subgraph extern. <link>SetExtern()
SetIntern <t>Set subgraph intern. <link>SetIntern()
SetIntern <t>Set subgraph intern. <link>SetIntern()
...
@@ -5748,6 +5777,36 @@ Returns the identity of the last created object.
...
@@ -5748,6 +5777,36 @@ Returns the identity of the last created object.
<c> id = GetCurrentObject();
<c> id = GetCurrentObject();
</topic>
</topic>
<topic>SetDraw() <style>function
SetDraw()
int SetDraw( int on)
<h2>Description
Set drawing on or off.
<h2>Argument
int <t>on <t>If 0, drawing is turned off. If 1, drawing is turned on.
<b>Example
<c> SetDraw(0);
<c> for ( i = 0; i < 10000; i++)
<c> x2 = x + 0.55;
<c> y2 = y + 0.55;
<c> create object/sub=pwr_indsquare/x1='x'/y1='y'/x2='x2'/y2='y2'
<c> set current attr DigLowColor.Attribute H1-DArray.Val['i']##Boolean
<c> x += 0.65;
<c> if ( i - (i / 100) * 100 == 99)
<c> y += 0.65;
<c> x = 0;
<c> endif
<c> endfor
<c> SetDraw(1);
</topic>
<topic>SetExtern() <style>function
<topic>SetExtern() <style>function
SetExtern()
SetExtern()
int SetExtern( string name)
int SetExtern( string name)
...
...
src/msg/ge/src/ge_msg.msg
View file @
5a3ff742
...
@@ -68,6 +68,7 @@ isbaseclass <Is baseclass> /info
...
@@ -68,6 +68,7 @@ isbaseclass <Is baseclass> /info
fileopen <Unable to open file> /error
fileopen <Unable to open file> /error
needconv <Unable to save, graph needs conversion> /error
needconv <Unable to save, graph needs conversion> /error
javanamesyntax <Java name syntax error> /error
javanamesyntax <Java name syntax error> /error
notsaved <Graph is not saved> /error
xtt/lib/ge/src/ge_graph_command.cpp
View file @
5a3ff742
...
@@ -115,6 +115,8 @@ static int graph_convert_func( void *client_data,
...
@@ -115,6 +115,8 @@ static int graph_convert_func( void *client_data,
void
*
client_flag
);
void
*
client_flag
);
static
int
graph_two_func
(
void
*
client_data
,
static
int
graph_two_func
(
void
*
client_data
,
void
*
client_flag
);
void
*
client_flag
);
static
int
graph_build_func
(
void
*
client_data
,
void
*
client_flag
);
dcli_tCmdTable
graph_command_table
[]
=
{
dcli_tCmdTable
graph_command_table
[]
=
{
{
{
...
@@ -232,6 +234,11 @@ dcli_tCmdTable graph_command_table[] = {
...
@@ -232,6 +234,11 @@ dcli_tCmdTable graph_command_table[] = {
&
graph_two_func
,
&
graph_two_func
,
{
""
}
{
""
}
},
},
{
"BUILD"
,
&
graph_build_func
,
{
""
}
},
{
""
,}};
{
""
,}};
static
void
graph_store_graph
(
Graph
*
graph
)
static
void
graph_store_graph
(
Graph
*
graph
)
...
@@ -319,6 +326,26 @@ static int graph_quit_func(void *client_data,
...
@@ -319,6 +326,26 @@ static int graph_quit_func(void *client_data,
return
GE__SUCCESS
;
return
GE__SUCCESS
;
}
}
static
int
graph_build_func
(
void
*
client_data
,
void
*
client_flag
)
{
Graph
*
graph
=
(
Graph
*
)
client_data
;
char
name
[
40
];
pwr_tCmd
cmd
;
graph
->
get_name
(
name
);
if
(
strcmp
(
name
,
""
)
==
0
||
graph
->
is_modified
())
{
graph
->
message
(
'E'
,
"Build error, graph is not saved"
);
return
GE__NOTSAVED
;
}
sprintf
(
cmd
,
"cp -a $pwrp_pop/%s.pwg $pwrp_exe/"
,
name
);
system
(
cmd
);
return
GE__SUCCESS
;
}
static
int
graph_exit_func
(
void
*
client_data
,
static
int
graph_exit_func
(
void
*
client_data
,
void
*
client_flag
)
void
*
client_flag
)
{
{
...
@@ -2559,6 +2586,100 @@ static int graph_create_func( void *client_data,
...
@@ -2559,6 +2586,100 @@ static int graph_create_func( void *client_data,
graph
->
current_cmd_object
=
n1
;
graph
->
current_cmd_object
=
n1
;
grow_SetModified
(
graph
->
grow
->
ctx
,
1
);
grow_SetModified
(
graph
->
grow
->
ctx
,
1
);
}
}
else
if
(
cdh_NoCaseStrncmp
(
arg1_str
,
"BAR"
,
strlen
(
arg1_str
))
==
0
)
{
char
str
[
80
];
int
sts
;
float
value
;
double
x1
,
y1
,
x2
,
y2
;
grow_tNode
n1
;
int
scale_x
,
scale_y
;
double
sx
,
sy
;
double
ll_x
,
ll_y
,
ur_x
,
ur_y
;
if
(
EVEN
(
dcli_get_qualifier
(
"/X1"
,
str
,
sizeof
(
str
))))
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
sts
=
sscanf
(
str
,
"%f"
,
&
value
);
if
(
sts
!=
1
)
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
x1
=
value
;
if
(
EVEN
(
dcli_get_qualifier
(
"/Y1"
,
str
,
sizeof
(
str
))))
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
sts
=
sscanf
(
str
,
"%f"
,
&
value
);
if
(
sts
!=
1
)
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
y1
=
value
;
if
(
ODD
(
dcli_get_qualifier
(
"/X2"
,
str
,
sizeof
(
str
))))
{
sts
=
sscanf
(
str
,
"%f"
,
&
value
);
if
(
sts
!=
1
)
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
x2
=
value
;
if
(
x1
==
x2
)
{
graph
->
message
(
'E'
,
"Invalid coordinate"
);
return
GE__COORDINATE
;
}
scale_x
=
1
;
}
else
scale_x
=
0
;
if
(
ODD
(
dcli_get_qualifier
(
"/Y2"
,
str
,
sizeof
(
str
))))
{
sts
=
sscanf
(
str
,
"%f"
,
&
value
);
if
(
sts
!=
1
)
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
y2
=
value
;
if
(
y1
==
y2
)
{
graph
->
message
(
'E'
,
"Invalid coordinate"
);
return
GE__COORDINATE
;
}
scale_y
=
1
;
}
else
scale_y
=
0
;
graph
->
create_bar
(
&
n1
,
x1
,
y1
);
if
(
scale_x
||
scale_y
)
{
grow_MeasureNode
(
n1
,
&
ll_x
,
&
ll_y
,
&
ur_x
,
&
ur_y
);
if
(
scale_x
)
sx
=
(
x2
-
x1
)
/
(
ur_x
-
ll_x
);
else
sx
=
1
;
if
(
scale_y
)
sy
=
(
y2
-
y1
)
/
(
ur_y
-
ll_y
);
else
sy
=
1
;
grow_StoreTransform
(
n1
);
grow_SetObjectScale
(
n1
,
sx
,
sy
,
x1
,
y1
,
glow_eScaleType_LowerLeft
);
}
graph
->
current_cmd_object
=
n1
;
grow_SetModified
(
graph
->
grow
->
ctx
,
1
);
}
else
else
{
{
graph
->
message
(
'E'
,
"Syntax error"
);
graph
->
message
(
'E'
,
"Syntax error"
);
...
@@ -3024,6 +3145,35 @@ static int graph_false_func(
...
@@ -3024,6 +3145,35 @@ static int graph_false_func(
return
1
;
return
1
;
}
}
static
int
graph_setdraw_func
(
void
*
filectx
,
ccm_sArg
*
arg_list
,
int
arg_count
,
int
*
return_decl
,
ccm_tFloat
*
return_float
,
ccm_tInt
*
return_int
,
char
*
return_string
)
{
Graph
*
graph
;
if
(
arg_count
!=
1
)
return
CCM__ARGMISM
;
if
(
arg_list
->
value_decl
!=
CCM_DECL_INT
)
return
CCM__ARGMISM
;
graph_get_stored_graph
(
&
graph
);
if
(
arg_list
->
value_int
==
0
)
grow_SetNodraw
(
graph
->
grow
->
ctx
);
else
{
grow_ResetNodraw
(
graph
->
grow
->
ctx
);
grow_Redraw
(
graph
->
grow
->
ctx
);
}
return
1
;
}
static
int
graph_ccm_deffilename_func
(
char
*
outfile
,
char
*
infile
,
void
*
client_data
)
static
int
graph_ccm_deffilename_func
(
char
*
outfile
,
char
*
infile
,
void
*
client_data
)
{
{
...
@@ -3133,6 +3283,8 @@ int Graph::readcmdfile( char *incommand)
...
@@ -3133,6 +3283,8 @@ int Graph::readcmdfile( char *incommand)
if
(
EVEN
(
sts
))
return
sts
;
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ccm_register_function
(
"SetIntern"
,
graph_setintern_func
);
sts
=
ccm_register_function
(
"SetIntern"
,
graph_setintern_func
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ccm_register_function
(
"SetDraw"
,
graph_setdraw_func
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ccm_register_function
(
"IsW1"
,
graph_true_func
);
sts
=
ccm_register_function
(
"IsW1"
,
graph_true_func
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ccm_register_function
(
"IsW2"
,
graph_false_func
);
sts
=
ccm_register_function
(
"IsW2"
,
graph_false_func
);
...
...
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