Commit 7906800c authored by Claes Sjofors's avatar Claes Sjofors

Wb history to html conversion, help text added

parent 9a17e9ee
......@@ -180,6 +180,7 @@ void wb_log::generate_html( char *filename, pwr_tStatus *sts)
FILE *fp;
char timstr[24];
char pname[80];
pwr_tFileName help_fname, help_filename;
time_AtoAscii( 0, time_eFormat_DateAndTime, timstr, sizeof(timstr));
utl_get_projectname( pname);
......@@ -188,6 +189,21 @@ void wb_log::generate_html( char *filename, pwr_tStatus *sts)
dcli_translate_filename( fname, filename);
strcpy( help_fname, fname);
char *s = strchr(help_fname, '.');
if ( s) {
*s = 0;
strcat( help_fname, "_help.html");
s = strrchr( help_fname, '/');
if ( s)
strcpy( help_filename, s+1);
else
strcpy( help_filename, "");
}
else
strcpy( help_fname, "");
fp = fopen( fname, "w");
if ( !fp) {
*sts = WNAV__NOFILE;
......@@ -196,15 +212,54 @@ void wb_log::generate_html( char *filename, pwr_tStatus *sts)
fprintf( fp, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"\"http://www.w3.org/TR/REC-html40/loose.dtd>\n\
<!-- Generated by wb_log %s -->\n", timstr);
fprintf( fp, "<HTML>\n<HEAD>\n<META http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n\
<TITLE>\nWorkbench History\n</TITLE>\n</HEAD>\n<BODY BGCOLOR=\"white\"><XMP>\n");
<TITLE>\nWorkbench History\n</TITLE>\n</HEAD>\n<BODY BGCOLOR=\"white\">\n");
fprintf( fp, "Workbench History %s %s\n\n", pname, timstr);
fprintf( fp, "<h2>Workbench History</h2>\n<xmp> %s %s</xmp><br>\n<a href=\"%s\">Help</a>\n<XMP>\n\n", pname, timstr, help_filename);
fprintf( fp, "%-20s %-10s %-20s %-20s %s\n", "Date", "User", "Action", "Item", "Comment");
fprintf( fp, "----------------------------------------------------------------------------------------------\n");
for ( int i = cbctx.v.size() - 1; i >= 0; i--)
fprintf( fp, "%s\n", cbctx.v[i].c_str());
fprintf( fp, "</XMP>\n</BODY>\n</HTML>\n");
fclose( fp);
if ( strcmp(help_fname, "") != 0) {
fp = fopen( help_fname, "w");
if ( !fp)
return;
fprintf( fp, "\
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n\
<html>\n\
<head>\n\
<title>Wb History Help</title>\n\
</head>\n\
\n\
<body>\n\
<XMP>\n\
The Wb History shows logged actions in the development environment.\n\
Each save action can be stored with a explanatory comment. This requires that comment is \n\
enabled in the configurator.\n\
\n\
Action Description\n\
\n\
WbLogin A user logged in to Proview development environment. User displayed in item.\n\
ConfigSave Configurator saved. Saved volume displayed in item.\n\
PlcSave Plc window saved. Saved plc window diplayed in item.\n\
GeSave Ge graph saved. Saved graphs displayed in item.\n\
VolumeBuild Volume is built. Built volume displayed in item.\n\
NodeBuild Node is built. Built node displayed in item.\n\
PlcBuild Plc window compiled. Built window displayed in item.\n\
GeBuild Ge graph built. Built graph displayed in item.\n\
GeExport Ge graph exported to java. Exported graph displayed in item.\n\
UpdateClasses Classes updated.\n\
CreatePackage Distribution package created. Created package displayed in item.\n\
CopyPackage Package distributed to process or operator station. Package displayed in item.\n\
</XMP>\n\
</body>\n\
</html>\n");
fclose( fp);
}
}
void wb_log::gen_cb( void *ctx, pwr_tTime time, char *s1, char *s2, char *s3, char *s4)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment