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
b60a1058
Commit
b60a1058
authored
Apr 11, 2012
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Report, generate image from graph and insert in report
parent
b5f20142
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
13 deletions
+66
-13
src/exe/co_convert/src/cnv_topdf.cpp
src/exe/co_convert/src/cnv_topdf.cpp
+16
-10
src/exe/rt_report/src/rt_report.cpp
src/exe/rt_report/src/rt_report.cpp
+49
-3
src/exe/rt_report/src/rt_report.h
src/exe/rt_report/src/rt_report.h
+1
-0
No files found.
src/exe/co_convert/src/cnv_topdf.cpp
View file @
b60a1058
...
...
@@ -272,11 +272,14 @@ int CnvPdfObj::print_image()
#endif
char
c
;
if
(
strchr
(
text
,
'/'
)
!=
0
)
dcli_translate_filename
(
fname
,
text
);
else
{
// Try $pwr_doc/help/
strcpy
(
fname
,
"$pwr_doc/help/"
);
strcat
(
fname
,
text
);
dcli_translate_filename
(
fname
,
fname
);
}
sts
=
cnv_get_image
(
fname
,
&
image
,
&
pixmap
);
if
(
EVEN
(
sts
))
{
// Try $pwr_exe
...
...
@@ -912,11 +915,14 @@ int CnvToPdf::print_image( const char *filename)
im_cnt
++
;
x
=
pdf_cLeftMargin
;
if
(
strchr
(
filename
,
'/'
)
!=
0
)
dcli_translate_filename
(
fname
,
filename
);
else
{
// Try $pwr_doc/help/
strcpy
(
fname
,
"$pwr_doc/help/"
);
strcat
(
fname
,
filename
);
dcli_translate_filename
(
fname
,
fname
);
}
sts
=
cnv_get_image
(
fname
,
&
image
,
&
pixmap
);
if
(
EVEN
(
sts
))
{
// Try $pwr_exe
...
...
src/exe/rt_report/src/rt_report.cpp
View file @
b60a1058
...
...
@@ -271,10 +271,15 @@ void rt_report::create_report( pwr_sClass_Report *o)
fout
<<
"<topic> index <style> report"
<<
endl
;
while
(
fin
.
getline
(
line
,
sizeof
(
line
)))
{
if
(
cdh_NoCaseStrncmp
(
line
,
"<execute>"
,
9
)
==
0
)
{
parse
(
&
line
[
9
]);
}
else
{
replace_value
(
newline
,
sizeof
(
newline
),
line
);
fout
<<
newline
<<
endl
;
}
}
fout
<<
"</topic>"
<<
endl
;
...
...
@@ -559,7 +564,7 @@ int rt_report::replace_value( char *out, unsigned int size,
char
*
in
)
{
char
str
[
500
]
=
""
;
char
str2
[
500
];
char
str2
[
500
]
=
""
;
char
valstr
[
500
];
char
*
s1
,
*
s2
,
*
t
;
unsigned
long
len
;
...
...
@@ -875,6 +880,47 @@ void rt_report::format_cmd( char *cmd, int cmd_size,
}
}
int
rt_report
::
parse
(
char
*
line
)
{
char
line_array
[
5
][
80
];
int
num
;
num
=
dcli_parse
(
line
,
" "
,
""
,
(
char
*
)
line_array
,
sizeof
(
line_array
)
/
sizeof
(
line_array
[
0
]),
sizeof
(
line_array
[
0
]),
0
);
if
(
num
>
0
&&
cdh_NoCaseStrcmp
(
line_array
[
0
],
"print"
)
==
0
)
{
if
(
num
>
1
&&
cdh_NoCaseStrcmp
(
line_array
[
1
],
"graph"
)
==
0
)
{
ofstream
fout
;
pwr_tFileName
fname
;
pwr_tFileName
tmpfile
=
"$pwrp_tmp/report_print.rtt_com"
;
pwr_tCmd
cmd
;
if
(
num
<
4
)
return
0
;
dcli_translate_filename
(
fname
,
tmpfile
);
fout
.
open
(
fname
);
if
(
!
fout
)
return
0
;
fout
<<
"open graph /hide "
<<
line_array
[
2
]
<<
endl
;
fout
<<
"export graph /graph="
<<
line_array
[
2
]
<<
" /file=
\"
"
<<
line_array
[
3
]
<<
"
\"
"
<<
endl
;
sprintf
(
cmd
,
"rt_xtt_cmd -i -q @%s"
,
fname
);
system
(
cmd
);
sprintf
(
cmd
,
"rm %s"
,
fname
);
system
(
cmd
);
}
else
return
0
;
}
else
return
0
;
return
1
;
}
int
main
()
{
pwr_tStatus
sts
;
...
...
src/exe/rt_report/src/rt_report.h
View file @
b60a1058
...
...
@@ -80,6 +80,7 @@ class rt_report {
const
char
*
reportfile
,
const
char
*
date
);
void
periodic_scan
();
int
periodic_check
(
pwr_sClass_Report
*
o
);
int
parse
(
char
*
line
);
double
scan_time
;
pwr_sClass_ReportConfig
*
conf
;
...
...
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