Commit 17da3024 authored by Claes Sjofors's avatar Claes Sjofors

Ge support for multiline texts

parent bacf689e
......@@ -859,6 +859,11 @@ static attrnav_sEnumElement elem_hot_indication[] = {
{ (int) glow_eHotIndication_LightColor, "LightColor"},
{ 0, ""}};
static attrnav_sEnumElement elem_annot_type[] = {
{ (int) glow_eAnnotType_OneLine, "OneLine"},
{ (int) glow_eAnnotType_MultiLine, "MultiLine"},
{ 0, ""}};
static attrnav_sEnumElement elem_access[] = {
{ (unsigned int) pwr_mPrv_RtRead, "RtRead"},
{ (unsigned int) pwr_mPrv_RtWrite, "RtWrite"},
......@@ -982,6 +987,7 @@ static attrnav_sEnum enum_types[] = {
{ (int) ge_eAttrType_CurveDataType, (attrnav_sEnumElement *) &elem_curve_datatype},
{ (int) glow_eType_Gradient, (attrnav_sEnumElement *) &elem_gradient},
{ (int) glow_eType_HotIndication, (attrnav_sEnumElement *) &elem_hot_indication},
{ (int) glow_eType_AnnotType, (attrnav_sEnumElement *) &elem_annot_type},
{ 0, NULL}};
static attrnav_sEnum mask_types[] = {
......@@ -1034,6 +1040,7 @@ int attrnav_attr_string_to_value( int type_id, char *value_str,
case glow_eType_Int:
case glow_eType_Direction:
case glow_eType_Adjustment:
case glow_eType_AnnotType:
case glow_eType_Font:
case glow_eType_Color:
case glow_eType_Tone:
......@@ -1119,6 +1126,7 @@ void attrnav_attrvalue_to_string( int type_id, void *value_ptr,
}
case glow_eType_Direction:
case glow_eType_Adjustment:
case glow_eType_AnnotType:
case glow_eType_Font:
case glow_eType_Color:
case glow_eType_Tone:
......@@ -2174,6 +2182,7 @@ ItemLocal::ItemLocal( AttrNav *attrnav, const char *item_name, const char *attr,
{
case glow_eType_Direction:
case glow_eType_Adjustment:
case glow_eType_AnnotType:
case glow_eType_Font:
case glow_eType_Color:
case glow_eType_Tone:
......
......@@ -156,6 +156,7 @@ static int check_format( char *format, int type)
return 1;
break;
case pwr_eType_String:
case pwr_eType_Text:
if ( *s == 's')
return 1;
break;
......@@ -3728,6 +3729,7 @@ int GeValue::scan( grow_tObject object)
break;
}
case pwr_eType_String:
case pwr_eType_Text:
if ( !first_scan) {
if ( strncmp( old_value, (char *)p, size) == 0)
// No change since last time
......
......@@ -4373,7 +4373,15 @@ void Graph::string_to_type( char *type_str, pwr_eType *type,
else
*size = atoi( str + 6);
}
if ( !found && strncmp("BIT", str, 3) == 0)
else if ( !found && strncmp("TEXT", str, 4) == 0)
{
*type = pwr_eType_Text;
if ( *(str+4) == 0)
*size = 80;
else
*size = atoi( str + 4);
}
else if ( !found && strncmp("BIT", str, 3) == 0)
{
*type = (pwr_eType) graph_eType_Bit;
*size = 4;
......
......@@ -219,7 +219,7 @@ dcli_tCmdTable graph_command_table[] = {
{
"EXPORT",
&graph_export_func,
{"dcli_arg1", ""}
{"dcli_arg1", "/SIGNATURE", ""}
},
{
"DISABLE",
......@@ -1576,9 +1576,16 @@ static int graph_export_func( void *client_data,
char filename[120];
char name[80];
char graph_name[80];
char *signature_p;
char signature[80];
char *s;
int sts;
if (dcli_get_qualifier( "/SIGNATURE", signature, sizeof(signature)))
signature_p = signature;
else
signature_p = 0;
if ( ! graph->get_java_name( name)) {
// Set default name
graph->get_name( graph_name);
......@@ -1645,7 +1652,8 @@ static int graph_export_func( void *client_data,
// Compile frame
graph->get_systemname( systemname);
sprintf( cmd, "$pwr_exe/ge_javac.sh java %s %s", filename, systemname);
sprintf( cmd, "$pwr_exe/ge_javac.sh java %s %s \"%s\"", filename, systemname,
signature);
sts = system( cmd);
if ( sts != 0) {
graph->message( 'E', "Java compilation errors");
......@@ -1670,7 +1678,8 @@ static int graph_export_func( void *client_data,
// Compile applet
graph->get_systemname( systemname);
sprintf( cmd, "$pwr_exe/ge_javac.sh java_web %s %s", filename, systemname);
sprintf( cmd, "$pwr_exe/ge_javac.sh java_web %s %s \"%s\"", filename, systemname,
signature);
sts = system( cmd);
if ( sts != 0) {
graph->message( 'E', "Java compilation errors");
......
......@@ -106,6 +106,7 @@ int Graph::generate_web( ldh_tSesContext ldhses)
pwr_tString80 title;
pwr_tString80 text;
pwr_tString80 file_name;
pwr_tString80 pwrhost;
pwr_tBoolean enable_login;
pwr_tBoolean enable_alarmlist;
pwr_tBoolean enable_eventlog;
......@@ -192,6 +193,14 @@ int Graph::generate_web( ldh_tSesContext ldhses)
strcpy( text, value_p);
free( value_p);
// Attribute PwrHost
sts = ldh_GetObjectPar( ldhses, webhandler_objid, "RtBody", "PwrHost",
&value_p, &size);
if (EVEN(sts)) return sts;
strcpy( pwrhost, value_p);
free( value_p);
dcli_trim( pwrhost, pwrhost);
// Attribute EnableLogin
sts = ldh_GetObjectPar( ldhses, webhandler_objid, "RtBody", "EnableLogin",
&value_p, &size);
......@@ -241,7 +250,8 @@ int Graph::generate_web( ldh_tSesContext ldhses)
strcpy( load_archives, (char *)value_p);
free( value_p);
strcpy( arlist, "pwr_rt_client.jar,pwr_jop.jar,pwr_jopc.jar,pwr_bcomp.jar,pwr_bcompfc.jar,pwr_abb.jar");
strcpy( arlist, "pwr_rt_client.jar,pwr_jop.jar,pwr_jopc.jar");
// strcat( arlist ",pwr_bcomp.jar,pwr_bcompfc.jar,pwr_abb.jar");
dcli_trim( load_archives, load_archives);
if ( strcmp( load_archives, "") != 0) {
strcat( arlist, ",");
......@@ -509,17 +519,34 @@ graph_text << "'," << resize << "," << width+20 << "," << height+20
" <title>" << title << "</title>" << endl <<
" </head>" << endl <<
" <body>" << endl <<
"<!--[if !IE]> -->" << endl <<
" <object classid=\"java:jpwr.jop.JopOpWindowApplet.class\"" << endl <<
" type=\"application/x-java-applet\"" << endl <<
" archive=\"" << arlist << ",pwrp_" << sname << "_web.jar\"" << endl <<
" width=100% height=100% >" << endl <<
" <param name = \"code\" value=\"jpwr.jop.JopOpWindowApplet.class\" >" << endl <<
" <param name =\"archive\" value=\"" << arlist << ",pwrp_" << sname << "_web.jar\">" << endl <<
" <param name=\"persistState\" value=\"false\" />" << endl <<
" <param name=\"scriptable\" value=\"false\">" << endl;
if ( strcmp( pwrhost, "") != 0)
fp_ow <<
" <param name=\"pwrhost\" value=\"" << pwrhost << "\">" << endl;
fp_ow <<
" </object>" << endl <<
"<!--<![endif]--> " << endl <<
"<!--[if IE]>" << endl <<
" <object classid=\"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93\"" << endl <<
" width=100% height=100% codebase=\"" << codebase << "\">" << endl <<
" <param name = code value=jpwr.jop.JopOpWindowApplet.class >" << endl <<
" <param name =\"archive\" value=\"" << arlist << ",pwrp_" << sname << "_web.jar\">" << endl <<
" <param name=\"type\" value=\"application/x-java-applet;version=1.3\">" << endl <<
" <param name=\"scriptable\" value=\"false\">" << endl <<
" <embed type=\"application/x-java-applet;version=1.4\" " << endl <<
" code = jpwr.jop.JopOpWindowApplet.class " << endl <<
" archive=\"" << arlist << ",pwrp_" << sname << "_web.jar\" " << endl <<
" width = 100% height = 100% scriptable=false " << endl <<
" pluginspage=\"http://java.sun.com/products/plugin/index.html#download\">" << endl <<
" <param name=\"scriptable\" value=\"false\">" << endl;
if ( strcmp( pwrhost, "") != 0)
fp_ow <<
" <param name=\"pwrhost\" value=\"" << pwrhost << "\">" << endl;
fp_ow <<
" </object>" << endl <<
"<![endif]-->" << endl <<
" </body>" << endl <<
"</html>" << endl;
fp_ow.close();
......
......@@ -98,7 +98,8 @@ typedef enum {
glow_eType_Adjustment, //!< Type is glow_eAdjustment
glow_eType_Font, //!< Type is glow_eFont
glow_eType_Gradient, //!< Type is glow_eGradient
glow_eType_HotIndication //!< Type is glow_eHotIndication
glow_eType_HotIndication, //!< Type is glow_eHotIndication
glow_eType_AnnotType //!< Type is glow_eAnnotType
} glow_eType;
//! Type of Ctx class
......
......@@ -1601,6 +1601,11 @@ int grow_GetObjectAttrInfo( grow_tObject object, char *transtab,
attrinfo[i].type = glow_eType_Font;
attrinfo[i++].size = sizeof( op->font);
strcpy( attrinfo[i].name, "Type");
attrinfo[i].value_p = &op->annot_type;
attrinfo[i].type = glow_eType_AnnotType;
attrinfo[i++].size = sizeof( op->annot_type);
break;
}
case glow_eObjectType_GrowText:
......
......@@ -145,9 +145,12 @@ int XAttOneGtk::change_value( int set_focus)
sts = gdh_GetObjectInfoAttrref( &aref, aval, sizeof(aval));
if ( EVEN(sts)) return sts;
XNav::attrvalue_to_string( atype, atype, &aval, buf, sizeof(buf), &len, NULL);
value = buf;
if ( atype == pwr_eType_Text)
value = aval;
else {
XNav::attrvalue_to_string( atype, atype, &aval, buf, sizeof(buf), &len, NULL);
value = buf;
}
if ( !access_rw) {
gtk_label_set_text( GTK_LABEL(cmd_label), buf);
......
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