Commit 15d99bce authored by Claes Sjofors's avatar Claes Sjofors Committed by Claes Sjöfors

Sev import server added, and GetExt... fix for dynamic objects

parent 1fcb0b2c
......@@ -119,7 +119,7 @@ int sev_import::init(void)
if (EVEN(m_sts))
throw co_error(m_sts);
sts = gdh_GetClassList(pwr_cClass_SevServer, &conf_oid);
sts = gdh_GetClassList(pwr_cClass_SevImportServer, &conf_oid);
if (EVEN(sts)) {
errh_CErrLog(PWR__SRVNOTCONF, 0);
exit(0);
......
......@@ -92,7 +92,7 @@ public:
tree_sTable* m_refid;
unsigned int m_msg_id;
pwr_tStatus m_server_status;
pwr_sClass_SevServer* m_config;
pwr_sClass_SevImportServer* m_config;
pwr_tDlid m_config_dlid;
std::vector<sev_exportitem> m_items;
......
......@@ -78,6 +78,7 @@
#define cPrio_report (cPrio_base + 5)
#define cPrio_sevhistmon (cPrio_base + 15)
#define cPrio_sev_server (cPrio_base + 15)
#define cPrio_sev_import (cPrio_base + 15)
#define cPrio_powerlink (cPrio_base + 15)
#define cPrio_plc_init (cPrio_base + 5)
#define cPrio_remh (cPrio_base + 5)
......@@ -201,6 +202,10 @@ void ini_ProcTable(pwr_tStatus* status, ini_sContext* cp)
"sev_server", cPrio_sev_server, 0, pwr_cClass_SevServer, "", 0);
pp->proc.flags.b.system = 1;
pp = ini_ProcInsert(sts, cp, "pwr_sev_import", "pwr_sev_import_%d", 0, 1,
"sev_import", cPrio_sev_import, 0, pwr_cClass_SevImportServer, "", 0);
pp->proc.flags.b.system = 1;
pp = ini_ProcInsert(sts, cp, "pwr_powerlink", "pwr_powerlink_%d", 0, 1,
"rt_powerlink", cPrio_powerlink, 0, pwr_cClass_EplHandler, "", 0);
pp->proc.flags.b.system = 1;
......
......@@ -509,11 +509,11 @@ static void link_io_base_areas(plc_sProcess* pp)
pp->IOHandler->IiCount * sizeof(pwr_tUInt64));
dlink_area((plc_sDlink*)&pp->base.io_i, "pwrNode-active-io-io_init",
pp->IOHandler->IoCount * sizeof(pwr_tUInt64));
dlink_area((plc_sDlink*)&pp->base.atv_i, "pwrNode-active-io-iatv_init",
dlink_area((plc_sDlink*)&pp->base.atv_i, "pwrNode-active-io-atv_init",
pp->IOHandler->ATvCount * sizeof(pwr_tTime));
dlink_area((plc_sDlink*)&pp->base.dtv_i, "pwrNode-active-io-idtv_init",
dlink_area((plc_sDlink*)&pp->base.dtv_i, "pwrNode-active-io-dtv_init",
pp->IOHandler->DTvCount * sizeof(pwr_tDeltaTime));
dlink_area((plc_sDlink*)&pp->base.sv_i, "pwrNode-active-io-isv_init",
dlink_area((plc_sDlink*)&pp->base.sv_i, "pwrNode-active-io-sv_init",
pp->IOHandler->SvCount * sizeof(pwr_tString80));
dlink_area((plc_sDlink*)&pp->base.bi_i, "pwrNode-active-io-bi_init",
pp->IOHandler->BiCount * sizeof(pwr_tUInt64));
......
......@@ -3236,6 +3236,11 @@ pwr_tStatus gdh_RefObjectInfoList(
char* s;
pwr_tStatus lsts;
if ( sts == GDH__NODYNLOCOBJ) {
rsts = sts;
continue;
}
dl = 0;
/* Check if this is an erroneous local attribute */
......
......@@ -172,6 +172,8 @@ struct plc_sThread {
redu_tCtx redu;
int tim_copy_lock;
int str_copy_lock;
unsigned int ext_retry_connect;
unsigned int ext_retry_connect_cnt;
};
struct plc_sProcess {
......
......@@ -34,6 +34,8 @@
* General Public License plus this exception.
*/
#include "rt_gdh_msg.h"
/* PREPROCESSOR RUTINER */
/*_*
......@@ -631,12 +633,15 @@
*/
#define GetExtFloat32_init(obj, name) \
{ \
gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tFloat32)); \
if (gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tFloat32)) == GDH__NODYNLOCOBJ) \
obj->ExtP = 0; \
}
#define GetExtFloat32_exec(obj) \
#define GetExtFloat32_exec(obj, name) \
if (obj->ExtP) \
obj->ActVal = *obj->ExtP;
obj->ActVal = *obj->ExtP; \
else if (tp->ext_retry_connect) \
GetExtFloat32_init(obj, name);
/*_*
GetExtFloat64
......@@ -644,12 +649,15 @@
*/
#define GetExtFloat64_init(obj, name) \
{ \
gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tFloat64)); \
if (gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tFloat64)) == GDH__NODYNLOCOBJ) \
obj->ExtP = 0; \
}
#define GetExtFloat64_exec(obj) \
#define GetExtFloat64_exec(obj, name) \
if (obj->ExtP) \
obj->ActVal = *obj->ExtP;
obj->ActVal = *obj->ExtP; \
else if (tp->ext_retry_connect) \
GetExtFloat64_init(obj, name);
/*_*
GetExtInt64
......@@ -657,12 +665,15 @@
*/
#define GetExtInt64_init(obj, name) \
{ \
gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tInt64)); \
if (gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tInt64)) == GDH__NODYNLOCOBJ) \
obj->ExtP = 0; \
}
#define GetExtInt64_exec(obj) \
#define GetExtInt64_exec(obj, name) \
if (obj->ExtP) \
obj->ActVal = *obj->ExtP;
obj->ActVal = *obj->ExtP; \
else if (tp->ext_retry_connect) \
GetExtInt64_init(obj, name);
/*_*
GetExtUInt64
......@@ -670,12 +681,15 @@
*/
#define GetExtUInt64_init(obj, name) \
{ \
gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tUInt64)); \
if (gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tUInt64)) == GDH__NODYNLOCOBJ) \
obj->ExtP = 0; \
}
#define GetExtUInt64_exec(obj) \
#define GetExtUInt64_exec(obj, name) \
if (obj->ExtP) \
obj->ActVal = *obj->ExtP;
obj->ActVal = *obj->ExtP; \
else if (tp->ext_retry_connect) \
GetExtUInt64_init(obj, name);
/*_*
GetExtInt32
......@@ -683,12 +697,15 @@
*/
#define GetExtInt32_init(obj, name) \
{ \
gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tInt32)); \
if (gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tInt32)) == GDH__NODYNLOCOBJ) \
obj->ExtP = 0; \
}
#define GetExtInt32_exec(obj) \
#define GetExtInt32_exec(obj, name) \
if (obj->ExtP) \
obj->ActVal = *obj->ExtP;
obj->ActVal = *obj->ExtP; \
else if (tp->ext_retry_connect) \
GetExtInt32_init(obj, name);
/*_*
GetExtUInt32
......@@ -696,12 +713,15 @@
*/
#define GetExtUInt32_init(obj, name) \
{ \
gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tUInt32)); \
if (gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tUInt32)) == GDH__NODYNLOCOBJ) \
obj->ExtP = 0; \
}
#define GetExtUInt32_exec(obj) \
#define GetExtUInt32_exec(obj, name) \
if (obj->ExtP) \
obj->ActVal = *obj->ExtP;
obj->ActVal = *obj->ExtP; \
else if (tp->ext_retry_connect) \
GetExtUInt32_init(obj, name);
/*_*
GetExtInt16
......@@ -709,12 +729,15 @@
*/
#define GetExtInt16_init(obj, name) \
{ \
gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tInt16)); \
if (gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tInt16)) == GDH__NODYNLOCOBJ) \
obj->ExtP = 0; \
}
#define GetExtInt16_exec(obj) \
#define GetExtInt16_exec(obj, name) \
if (obj->ExtP) \
obj->ActVal = *obj->ExtP;
obj->ActVal = *obj->ExtP; \
else if (tp->ext_retry_connect) \
GetExtInt16_init(obj, name);
/*_*
GetExtUInt16
......@@ -722,12 +745,15 @@
*/
#define GetExtUInt16_init(obj, name) \
{ \
gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tUInt16)); \
if (gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tUInt16)) == GDH__NODYNLOCOBJ) \
obj->ExtP = 0; \
}
#define GetExtUInt16_exec(obj) \
#define GetExtUInt16_exec(obj, name) \
if (obj->ExtP) \
obj->ActVal = *obj->ExtP;
obj->ActVal = *obj->ExtP; \
else if (tp->ext_retry_connect) \
GetExtUInt16_init(obj, name);
/*_*
GetExtInt8
......@@ -735,12 +761,15 @@
*/
#define GetExtInt8_init(obj, name) \
{ \
gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tInt8)); \
if (gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tInt8)) == GDH__NODYNLOCOBJ) \
obj->ExtP = 0; \
}
#define GetExtInt8_exec(obj) \
#define GetExtInt8_exec(obj, name) \
if (obj->ExtP) \
obj->ActVal = *obj->ExtP;
obj->ActVal = *obj->ExtP; \
else if (tp->ext_retry_connect) \
GetExtInt8_init(obj, name);
/*_*
GetExtUInt8
......@@ -748,12 +777,15 @@
*/
#define GetExtUInt8_init(obj, name) \
{ \
gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tUInt8)); \
if (gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tUInt8)) == GDH__NODYNLOCOBJ) \
obj->ExtP = 0; \
}
#define GetExtUInt8_exec(obj) \
#define GetExtUInt8_exec(obj, name) \
if (obj->ExtP) \
obj->ActVal = *obj->ExtP;
obj->ActVal = *obj->ExtP; \
else if (tp->ext_retry_connect) \
GetExtUInt8_init(obj, name);
/*_*
GetExtBoolean
......@@ -761,12 +793,15 @@
*/
#define GetExtBoolean_init(obj, name) \
{ \
gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tBoolean)); \
if (gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tBoolean)) == GDH__NODYNLOCOBJ) \
obj->ExtP = 0; \
}
#define GetExtBoolean_exec(obj) \
#define GetExtBoolean_exec(obj, name) \
if (obj->ExtP) \
obj->ActVal = *obj->ExtP;
obj->ActVal = *obj->ExtP; \
else if (tp->ext_retry_connect) \
GetExtBoolean_init(obj, name);
/*_*
GetExtString
......@@ -774,12 +809,15 @@
*/
#define GetExtString_init(obj, name) \
{ \
gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tString80)); \
if (gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tString80)) == GDH__NODYNLOCOBJ) \
obj->ExtP = 0; \
}
#define GetExtString_exec(obj) \
#define GetExtString_exec(obj, name) \
if (obj->ExtP) \
strncpy(obj->ActVal, obj->ExtP, sizeof(pwr_tString80));
strncpy(obj->ActVal, (const char *)obj->ExtP, sizeof(pwr_tString80)); \
else if (tp->ext_retry_connect) \
GetExtString_init(obj, name);
/*_*
GetExtTime
......@@ -787,12 +825,15 @@
*/
#define GetExtTime_init(obj, name) \
{ \
gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tTime)); \
if (gdh_RefObjectInfo(name, (void**)&obj->ExtP, 0, sizeof(pwr_tTime)) == GDH__NODYNLOCOBJ) \
obj->ExtP = 0; \
}
#define GetExtTime_exec(obj) \
#define GetExtTime_exec(obj, name) \
if (obj->ExtP) \
obj->ActVal = *obj->ExtP;
obj->ActVal = *obj->ExtP; \
else if (tp->ext_retry_connect) \
GetExtTime_init(obj, name);
/*_*
Float64toA
......
......@@ -535,6 +535,15 @@ static void scan(plc_sThread* tp)
plc_sProcess* pp = tp->pp;
int delay_action = 0;
if ( tp->ext_retry_connect_cnt > (int)(5.0/tp->f_scan_time)) {
tp->ext_retry_connect = 1;
tp->ext_retry_connect_cnt = 0;
}
else {
tp->ext_retry_connect = 0;
tp->ext_retry_connect_cnt++;
}
// time_Uptime(&sts, &tp->before_scan, NULL);
time_GetTimeMonotonic(&tp->before_scan);
time_GetTime(&tp->before_scan_abs);
......
......@@ -42,6 +42,7 @@
#include "rt_vol.h"
#include "rt_cvolc.h"
#include "rt_sub.h"
#include "pwr_systemclasses.h"
gdb_sAliasServer* vol_AddAliasClient(pwr_tStatus* sts, gdb_sObject* op)
{
......@@ -532,16 +533,18 @@ mvol_sAttribute* vol_BlockNameToAttribute(pwr_tStatus* sts, mvol_sAttribute* ap,
gdb_AssumeLocked;
strcpy(aname, "");
for ( i = 0; i < pn->nObject; i++) {
for (i = 0; i < pn->nObject; i++) {
strcat(aname, pn->object[i].name.orig);
strcat(aname, "-");
}
for ( i = 0; i < pn->nAttribute; i++) {
for (i = 0; i < pn->nAttribute; i++) {
strcat(aname, pn->attribute[i].name.orig);
if ( i != pn->nAttribute - 1)
strcat(aname, "-");
}
strcat(aname, ".Value");
if (pn->hasIndex[pn->nAttribute-1])
sprintf(&aname[strlen(aname)], "[%d]", pn->index[pn->nAttribute-1]);
cdh_ParseName(sts, pn, pn->poid, aname, pn->parseFlags.m);
......@@ -668,8 +671,11 @@ gdb_sObject* vol_NameToObject(pwr_tStatus* sts, cdh_sParseName* pn,
vp = pool_Address(NULL, gdbroot->pool, pop->l.vr);
if (vp->l.flags.b.isMounted && vp->l.flags.b.isCached)
return cvolc_NameToObject(sts, pop, pn, i, trans);
else
else {
if ( vp->g.cid == pwr_cClass_SystemVolume)
*sts = GDH__NODYNLOCOBJ;
return NULL;
}
}
}
......@@ -1269,6 +1275,10 @@ gdb_sObject* vol_TranslateObject(pwr_tStatus* sts, gdb_sObject* op,
if (op != NULL && op->g.flags.b.isMountClient && trans.b.mount) {
vp = pool_Address(NULL, gdbroot->pool, op->l.vr);
if (vp->l.flags.b.transMount) {
if (cdh_ObjidIsNull(op->g.soid) && op->g.cid == pwr_cClass_MountDynObject) {
*sts = GDH__NODYNLOCOBJ;
return NULL;
}
op = vol_OidToObject(sts, op->g.soid, lo_flags, trans.m, cvol_eHint_none);
}
}
......
......@@ -103,6 +103,7 @@ readonly <Object or attribute is read only> /error
remotemount <Remotly mounted object> /error
dblock <Unable to map db lock> /error
connlost <Connection lost> /error
nodynlocobj <noexisting dynamic local object> /error
.end
!
! ProviewR Open Source Process Control.
! Copyright (C) 2005-2019 SSAB EMEA AB.
!
! This file is part of ProviewR.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with ProviewR. If not, see <http://www.gnu.org/licenses/>
!
! Linking ProviewR statically or dynamically with other modules is
! making a combined work based on ProviewR. Thus, the terms and
! conditions of the GNU General Public License cover the whole
! combination.
!
! In addition, as a special exception, the copyright holders of
! ProviewR give you permission to, from the build function in the
! ProviewR Configurator, combine ProviewR with modules generated by the
! ProviewR PLC Editor to a PLC program, regardless of the license
! terms of these modules. You may copy and distribute the resulting
! combined work under the terms of your choice, provided that every
! copy of the combined work is accompanied by a complete copy of
! the source code of ProviewR (the version used to produce the
! combined work), being distributed under the terms of the GNU
! General Public License plus this exception.
!
! pwrb_c_sevimportserver.wb_load -- Defines the class SevImportServer.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Group Servers,NodeConfiguration
! Configures the Sev import server process.
!
! Configures the server import process.
!
! @b See also
! @classlink SevHistThread pwrb_sevhistthread.html
! @classlink SevHistMonitor pwrb_sevhistmonitor.html
! @classlink SevExport pwrb_sevexport.html
!*/
Object SevImportServer $ClassDef 710
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "SevImportServer"
EndBody
!/**
! Optional description.
!*/
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Calculate mean value on all items.
!*/
Object MeanValueAll $Attribute 4
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Interval for calcuation of mean value for items
! with the MeanValue1 bit set in options.
!*/
Object MeanValueInterval1 $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! Interval for calcuation of mean value for items
! with the MeanValue2 bit set in options.
!*/
Object MeanValueInterval2 $Attribute 8
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
EndObject
Object Template SevImportServer
Body RtBody
Attr MeanValueInterval1 = 10
Attr MeanValueInterval2 = 30
EndBody
EndObject
EndObject
EndSObject
......@@ -13825,8 +13825,8 @@ int gcg_comp_m64(gcg_ctx gcgctx, vldh_t_node node)
return sts;
/* Print the execute command */
IF_PR fprintf(gcgctx->files[GCGM1_CODE_FILE], "%s_exec( %c%s);\n", name,
GCG_PREFIX_REF, vldh_IdToStr(0, node->ln.oid));
IF_PR fprintf(gcgctx->files[GCGM1_CODE_FILE], "%s_exec( %c%s, \"%s\");\n", name,
GCG_PREFIX_REF, vldh_IdToStr(0, node->ln.oid), extattr_ptr);
/* Print the init command */
IF_PR fprintf(gcgctx->files[GCGM1_REF_FILE], "%s_init( %c%s, \"%s\");\n",
......
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include "co_string.h"
#include "co_time.h"
#include "glow_growbararc.h"
#include "glow_grownode.h"
#include "glow_draw.h"
#if defined OS_OPENBSD
#define nearbyint rint
#endif
GrowBarArc::GrowBarArc(GrowCtx* glow_ctx, const char* name, double x1,
double y1, double x2, double y2, int ang1, int ang2, double width,
int border, glow_eDrawType border_d_type, int line_w,
glow_eDrawType fill_d_type, int nodraw)
: GrowArc(glow_ctx, name, x1, y1, x2, y2, ang1, ang2, border_d_type, line_w,
1, border, 0, fill_d_type, 1), max_value(100), min_value(0), bar_width(width), bar_value(35),
bar_drawtype(glow_eDrawType_Color147),
bar_bordercolor(glow_eDrawType_Color145), bar_borderwidth(1), bar_direction(0)
{
if (!nodraw)
draw(&ctx->mw, (GlowTransform*)NULL, highlight, hot, NULL, NULL);
}
GrowBarArc::~GrowBarArc()
{
if (ctx->nodraw)
return;
erase(&ctx->mw);
erase(&ctx->navw);
}
void GrowBarArc::save(std::ofstream& fp, glow_eSaveMode mode)
{
fp << int(glow_eSave_GrowBarArc) << '\n';
fp << int(glow_eSave_GrowBarArc_max_value) << FSPACE << max_value << '\n';
fp << int(glow_eSave_GrowBarArc_min_value) << FSPACE << min_value << '\n';
fp << int(glow_eSave_GrowBarArc_bar_width) << FSPACE << bar_width << '\n';
fp << int(glow_eSave_GrowBarArc_bar_direction) << FSPACE << bar_direction << '\n';
fp << int(glow_eSave_GrowBarArc_bar_value) << FSPACE << bar_value << '\n';
fp << int(glow_eSave_GrowBarArc_bar_drawtype) << FSPACE << int(bar_drawtype)
<< '\n';
fp << int(glow_eSave_GrowBarArc_bar_bordercolor) << FSPACE
<< int(bar_bordercolor) << '\n';
fp << int(glow_eSave_GrowBarArc_bar_borderwidth) << FSPACE << bar_borderwidth
<< '\n';
fp << int(glow_eSave_GrowBarArc_arc_part) << '\n';
GrowArc::save(fp, mode);
if (user_data && ctx->userdata_save_callback) {
fp << int(glow_eSave_GrowBarArc_userdata_cb) << '\n';
(ctx->userdata_save_callback)(&fp, this, glow_eUserdataCbType_Node);
}
fp << int(glow_eSave_End) << '\n';
}
void GrowBarArc::open(std::ifstream& fp)
{
int type = 0;
int end_found = 0;
char dummy[40];
int tmp;
for (;;) {
if (!fp.good()) {
fp.clear();
fp.getline(dummy, sizeof(dummy));
printf("** Read error GrowBarArc: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch (type) {
case glow_eSave_GrowBarArc:
break;
case glow_eSave_GrowBarArc_max_value:
fp >> max_value;
break;
case glow_eSave_GrowBarArc_min_value:
fp >> min_value;
break;
case glow_eSave_GrowBarArc_bar_width:
fp >> bar_width;
break;
case glow_eSave_GrowBarArc_bar_direction:
fp >> bar_direction;
break;
case glow_eSave_GrowBarArc_bar_value:
fp >> bar_value;
break;
case glow_eSave_GrowBarArc_bar_bordercolor:
fp >> tmp;
bar_bordercolor = (glow_eDrawType)tmp;
break;
case glow_eSave_GrowBarArc_bar_borderwidth:
fp >> bar_borderwidth;
break;
case glow_eSave_GrowBarArc_bar_drawtype:
fp >> tmp;
bar_drawtype = (glow_eDrawType)tmp;
break;
case glow_eSave_GrowBarArc_arc_part:
GrowArc::open(fp);
break;
case glow_eSave_GrowBarArc_userdata_cb:
if (ctx->userdata_open_callback)
(ctx->userdata_open_callback)(&fp, this, glow_eUserdataCbType_Node);
break;
case glow_eSave_End:
end_found = 1;
break;
default:
std::cout << "GrowBarArc:open syntax error\n";
fp.getline(dummy, sizeof(dummy));
}
if (end_found)
break;
}
}
void GrowBarArc::draw(GlowWind* w, int ll_x, int ll_y, int ur_x, int ur_y)
{
int tmp;
if (ll_x > ur_x) {
/* Shift */
tmp = ll_x;
ll_x = ur_x;
ur_x = tmp;
}
if (ll_y > ur_y) {
/* Shift */
tmp = ll_y;
ll_y = ur_y;
ur_y = tmp;
}
if (x_right * w->zoom_factor_x - w->offset_x >= ll_x
&& x_left * w->zoom_factor_x - w->offset_x <= ur_x
&& y_high * w->zoom_factor_y - w->offset_y >= ll_y
&& y_low * w->zoom_factor_y - w->offset_y <= ur_y) {
draw(w, (GlowTransform*)NULL, highlight, hot, NULL, NULL);
}
}
void GrowBarArc::draw(GlowWind* w, int* ll_x, int* ll_y, int* ur_x, int* ur_y)
{
int tmp;
int obj_ur_x = int(x_right * w->zoom_factor_x) - w->offset_x;
int obj_ll_x = int(x_left * w->zoom_factor_x) - w->offset_x;
int obj_ur_y = int(y_high * w->zoom_factor_y) - w->offset_y;
int obj_ll_y = int(y_low * w->zoom_factor_y) - w->offset_y;
if (*ll_x > *ur_x) {
/* Shift */
tmp = *ll_x;
*ll_x = *ur_x;
*ur_x = tmp;
}
if (*ll_y > *ur_y) {
/* Shift */
tmp = *ll_y;
*ll_y = *ur_y;
*ur_y = tmp;
}
if (obj_ur_x >= *ll_x && obj_ll_x <= *ur_x && obj_ur_y >= *ll_y
&& obj_ll_y <= *ur_y) {
draw(w, (GlowTransform*)NULL, highlight, hot, NULL, NULL);
// Increase the redraw area
if (obj_ur_x > *ur_x)
*ur_x = obj_ur_x;
if (obj_ur_y > *ur_y)
*ur_y = obj_ur_y;
if (obj_ll_x < *ll_x)
*ll_x = obj_ll_x;
if (obj_ll_y < *ll_y)
*ll_y = obj_ll_y;
}
}
void GrowBarArc::set_highlight(int on)
{
highlight = on;
draw();
}
void GrowBarArc::draw(GlowWind* w, GlowTransform* t, int highlight, int hot,
void* node, void* colornode)
{
if (ctx->nodraw)
return;
if (w == &ctx->navw) {
if (ctx->no_nav)
return;
hot = 0;
}
int idx;
double rotation;
double ang;
glow_eDrawType drawtype;
glow_eDrawType bg_drawtype;
double yscale;
int width = int(bar_width * w->zoom_factor_x);
double value = MAX(min_value, MIN(bar_value, max_value));
if (node && ((GrowNode*)node)->line_width)
idx = int(
w->zoom_factor_y / w->base_zoom_factor * ((GrowNode*)node)->line_width
- 1);
else
idx = int(w->zoom_factor_y / w->base_zoom_factor * line_width - 1);
idx += hot;
idx = MAX(0, idx);
idx = MIN(idx, DRAW_TYPE_SIZE - 1);
int x1, y1, x2, y2, ll_x, ll_y, ur_x, ur_y;
if (!t) {
x1 = int(trf.x(ll.x, ll.y) * w->zoom_factor_x) - w->offset_x;
y1 = int(trf.y(ll.x, ll.y) * w->zoom_factor_y) - w->offset_y;
x2 = int(trf.x(ur.x, ur.y) * w->zoom_factor_x) - w->offset_x;
y2 = int(trf.y(ur.x, ur.y) * w->zoom_factor_y) - w->offset_y;
rotation = (trf.rot() / 360 - floor(trf.rot() / 360)) * 360;
} else {
x1 = int(trf.x(t, ll.x, ll.y) * w->zoom_factor_x) - w->offset_x;
y1 = int(trf.y(t, ll.x, ll.y) * w->zoom_factor_y) - w->offset_y;
x2 = int(trf.x(t, ur.x, ur.y) * w->zoom_factor_x) - w->offset_x;
y2 = int(trf.y(t, ur.x, ur.y) * w->zoom_factor_y) - w->offset_y;
rotation = (trf.rot(t) / 360 - floor(trf.rot(t) / 360)) * 360;
}
ll_x = MIN(x1, x2);
ur_x = MAX(x1, x2);
ll_y = MIN(y1, y2);
ur_y = MAX(y1, y2);
yscale = double(ur_y - ll_y) / (ur_x - ll_x);
if ( width > ur_x - ll_x)
width = ur_x - ll_x;
drawtype = ctx->get_drawtype(fill_drawtype, glow_eDrawType_FillHighlight,
highlight, (GrowNode*)colornode, 0);
if ( background_drawtype == glow_eDrawType_No)
bg_drawtype = ctx->background_color;
else
bg_drawtype = background_drawtype;
// Draw circle background
ctx->gdraw->fill_arc(w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y,
0, 360, bg_drawtype, 0);
// Draw bar background
ctx->gdraw->fill_arc(w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y,
angle1 - (int)rotation, angle2, drawtype, 0);
// Draw bar
if ( bar_direction == 0)
ang = angle1 - (int)rotation;
else
ang = angle1 + angle2 * (max_value - value) / (max_value - min_value) - (int)rotation;
if ( gradient == glow_eGradient_No)
ctx->gdraw->fill_arc(w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y,
ang, angle2 * (value - min_value) / (max_value - min_value),
bar_drawtype, 0);
else {
glow_eDrawType f1, f2;
if (gradient_contrast >= 0) {
f2 = GlowColor::shift_drawtype(
bar_drawtype, -gradient_contrast / 2, 0);
f1 = GlowColor::shift_drawtype(
bar_drawtype, int(float(gradient_contrast) / 2 + 0.6), 0);
} else {
f2 = GlowColor::shift_drawtype(
bar_drawtype, -int(float(gradient_contrast) / 2 - 0.6), 0);
f1 = GlowColor::shift_drawtype(
bar_drawtype, gradient_contrast / 2, 0);
}
ctx->gdraw->gradient_fill_arc(w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y,
ang, angle2 * (value - min_value) / (max_value - min_value),
bar_drawtype, f1, f2, gradient);
}
// Draw inner circle background
ctx->gdraw->fill_arc(w, ll_x + width, ll_y + yscale * width,
ur_x - ll_x - 2 * width,
ur_y - ll_y - yscale * 2 * width,
0, 360, bg_drawtype, 0);
if ( bar_direction == 0)
ang = M_PI*(angle1 - rotation + angle2 * (value - min_value) / (max_value - min_value)) / 180;
else
ang = M_PI*(angle1 - rotation + angle2 * (max_value - value) / (max_value - min_value)) / 180;
ctx->gdraw->line(w, (ur_x + ll_x)/2 + (ur_x - ll_x)/2 * cos(ang),
(ur_y + ll_y)/2 - (ur_y - ll_y)/2 * sin(ang),
(ur_x + ll_x)/2 + ((ur_x - ll_x)/2 - width) * cos(ang),
(ur_y + ll_y)/2 - yscale * ((ur_x - ll_x)/2 - width) * sin(ang),
bar_bordercolor, bar_borderwidth, 0);
if (border) {
glow_eDrawType bordercolor = ctx->get_drawtype(draw_type, glow_eDrawType_LineHighlight,
highlight, (GrowNode*)colornode, 0);
ctx->gdraw->arc(w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y,
angle1 - (int)rotation, angle2,
bordercolor, idx, 0);
ctx->gdraw->arc(w, ll_x + width, ll_y + yscale * width, ur_x - ll_x - 2 * width,
ur_y - ll_y - yscale * 2 * width,
angle1 - (int)rotation, angle2,
bordercolor, idx, 0);
ang = M_PI*(angle1 - rotation) / 180;
ctx->gdraw->line(w, (ur_x + ll_x)/2 + (ur_x - ll_x)/2 * cos(ang),
(ur_y + ll_y)/2 - (ur_y - ll_y)/2 * sin(ang),
(ur_x + ll_x)/2 + ((ur_x - ll_x)/2 - width) * cos(ang),
(ur_y + ll_y)/2 - yscale * ((ur_x - ll_x)/2 - width) * sin(ang),
bordercolor, idx, 0);
ang = M_PI*(angle1 + angle2 - rotation) / 180;
ctx->gdraw->line(w, (ur_x + ll_x)/2 + (ur_x - ll_x)/2 * cos(ang),
(ur_y + ll_y)/2 - (ur_y - ll_y)/2 * sin(ang),
(ur_x + ll_x)/2 + ((ur_x - ll_x)/2 - width) * cos(ang),
(ur_y + ll_y)/2 - yscale * ((ur_x - ll_x)/2 - width) * sin(ang),
bordercolor, idx, 0);
}
}
void GrowBarArc::erase(GlowWind* w, GlowTransform* t, int hot, void* node)
{
if (ctx->nodraw)
return;
if (w == &ctx->navw) {
if (ctx->no_nav)
return;
hot = 0;
}
int x1, y1, x2, y2, ll_x, ll_y, ur_x, ur_y;
double rotation;
int idx;
if (hot && ctx->environment != glow_eEnv_Development
&& ctx->hot_indication != glow_eHotIndication_LineWidth)
hot = 0;
if (node && ((GrowNode*)node)->line_width)
idx = int(
w->zoom_factor_y / w->base_zoom_factor * ((GrowNode*)node)->line_width
- 1);
else
idx = int(w->zoom_factor_y / w->base_zoom_factor * line_width - 1);
idx += hot;
idx = MAX(0, idx);
idx = MIN(idx, DRAW_TYPE_SIZE - 1);
if (!t) {
x1 = int(trf.x(ll.x, ll.y) * w->zoom_factor_x) - w->offset_x;
y1 = int(trf.y(ll.x, ll.y) * w->zoom_factor_y) - w->offset_y;
x2 = int(trf.x(ur.x, ur.y) * w->zoom_factor_x) - w->offset_x;
y2 = int(trf.y(ur.x, ur.y) * w->zoom_factor_y) - w->offset_y;
rotation = int(trf.rot());
} else {
x1 = int(trf.x(t, ll.x, ll.y) * w->zoom_factor_x) - w->offset_x;
y1 = int(trf.y(t, ll.x, ll.y) * w->zoom_factor_y) - w->offset_y;
x2 = int(trf.x(t, ur.x, ur.y) * w->zoom_factor_x) - w->offset_x;
y2 = int(trf.y(t, ur.x, ur.y) * w->zoom_factor_y) - w->offset_y;
rotation = int(trf.rot(t));
}
ll_x = MIN(x1, x2);
ur_x = MAX(x1, x2);
ll_y = MIN(y1, y2);
ur_y = MAX(y1, y2);
w->set_draw_buffer_only();
ctx->gdraw->arc_erase(w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y,
angle1 - (int)rotation, angle2, idx);
ctx->gdraw->fill_rect(
w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, glow_eDrawType_LineErase);
w->reset_draw_buffer_only();
}
void GrowBarArc::draw()
{
ctx->draw(&ctx->mw,
x_left * ctx->mw.zoom_factor_x - ctx->mw.offset_x - DRAW_MP,
y_low * ctx->mw.zoom_factor_y - ctx->mw.offset_y - DRAW_MP,
x_right * ctx->mw.zoom_factor_x - ctx->mw.offset_x + DRAW_MP,
y_high * ctx->mw.zoom_factor_y - ctx->mw.offset_y + DRAW_MP);
ctx->draw(&ctx->navw,
x_left * ctx->navw.zoom_factor_x - ctx->navw.offset_x - 1,
y_low * ctx->navw.zoom_factor_y - ctx->navw.offset_y - 1,
x_right * ctx->navw.zoom_factor_x - ctx->navw.offset_x + 1,
y_high * ctx->navw.zoom_factor_y - ctx->navw.offset_y + 1);
}
void GrowBarArc::align(double x, double y, glow_eAlignDirection direction)
{
double dx, dy;
erase(&ctx->mw);
erase(&ctx->navw);
ctx->set_defered_redraw();
draw();
switch (direction) {
case glow_eAlignDirection_CenterVert:
dx = x - (x_right + x_left) / 2;
dy = 0;
break;
case glow_eAlignDirection_CenterHoriz:
dx = 0;
dy = y - (y_high + y_low) / 2;
break;
case glow_eAlignDirection_CenterCenter:
dx = x - (x_right + x_left) / 2;
dy = y - (y_high + y_low) / 2;
break;
case glow_eAlignDirection_Right:
dx = x - x_right;
dy = 0;
break;
case glow_eAlignDirection_Left:
dx = x - x_left;
dy = 0;
break;
case glow_eAlignDirection_Up:
dx = 0;
dy = y - y_high;
break;
case glow_eAlignDirection_Down:
dx = 0;
dy = y - y_low;
break;
}
trf.move(dx, dy);
x_right += dx;
x_left += dx;
y_high += dy;
y_low += dy;
draw();
ctx->redraw_defered();
}
void GrowBarArc::get_range(double *min, double *max)
{
*max = max_value;
*min = min_value;
}
void GrowBarArc::set_range(double min, double max)
{
max_value = max;
min_value = min;
draw();
}
void GrowBarArc::export_javabean(GlowTransform* t, void* node,
glow_eExportPass pass, int* shape_cnt, int node_cnt, int in_nc,
std::ofstream& fp)
{
#if 0
double x1, y1, x2, y2, ll_x, ll_y, ur_x, ur_y;
double rotation;
int bold;
int idx = int(
ctx->mw.zoom_factor_y / ctx->mw.base_zoom_factor * (text_size + 4) - 4);
idx = MIN(idx, DRAW_TYPE_SIZE - 1);
bold = (text_drawtype == glow_eDrawType_TextHelveticaBold);
if (!t) {
x1 = trf.x(ll.x, ll.y) * ctx->mw.zoom_factor_x - ctx->mw.offset_x;
y1 = trf.y(ll.x, ll.y) * ctx->mw.zoom_factor_y - ctx->mw.offset_y;
x2 = trf.x(ur.x, ur.y) * ctx->mw.zoom_factor_x - ctx->mw.offset_x;
y2 = trf.y(ur.x, ur.y) * ctx->mw.zoom_factor_y - ctx->mw.offset_y;
} else {
x1 = trf.x(t, ll.x, ll.y) * ctx->mw.zoom_factor_x - ctx->mw.offset_x;
y1 = trf.y(t, ll.x, ll.y) * ctx->mw.zoom_factor_y - ctx->mw.offset_y;
x2 = trf.x(t, ur.x, ur.y) * ctx->mw.zoom_factor_x - ctx->mw.offset_x;
y2 = trf.y(t, ur.x, ur.y) * ctx->mw.zoom_factor_y - ctx->mw.offset_y;
}
ll_x = MIN(x1, x2);
ur_x = MAX(x1, x2);
ll_y = MIN(y1, y2);
ur_y = MAX(y1, y2);
if (t)
rotation = (trf.rot(t) / 360 - floor(trf.rot(t) / 360)) * 360;
else
rotation = (trf.rot() / 360 - floor(trf.rot() / 360)) * 360;
((GrowCtx*)ctx)
->export_jbean->bararc(ll_x, ll_y, ur_x, ur_y, angle1, angle2, draw_type,
text_color_drawtype, min_value, max_value, lines, longquotient,
valuequotient, linelength, line_width, rotation, bold, idx, format,
pass, shape_cnt, node_cnt, fp);
#endif
}
int GrowBarArc::trace_scan()
{
if (!trace.p)
return 1;
if (ctx->trace_scan_func)
ctx->trace_scan_func((void*)this, trace.p);
return 1;
}
int GrowBarArc::trace_init()
{
int sts;
sts = ctx->trace_connect_func((void*)this, &trace);
return sts;
}
void GrowBarArc::trace_close()
{
if (trace.p)
ctx->trace_disconnect_func((void*)this);
}
void GrowBarArc::set_bar_info(glow_sBarInfo* info)
{
max_value = info->max_value;
min_value = info->min_value;
bar_drawtype = info->bar_drawtype;
bar_bordercolor = info->bar_bordercolor;
bar_borderwidth = info->bar_borderwidth;
}
void GrowBarArc::get_bar_info(glow_sBarInfo* info)
{
info->max_value = max_value;
info->min_value = min_value;
info->bar_drawtype = bar_drawtype;
info->bar_bordercolor = bar_bordercolor;
info->bar_borderwidth = bar_borderwidth;
}
void GrowBarArc::convert(glow_eConvert version)
{
}
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef glow_growbararc_h
#define glow_growbararc_h
#include "glow_growarc.h"
/*! \file glow_growbararc.h
\brief Contains the GrowBarArc class. */
/*! \addtogroup Glow */
/*@{*/
//! Class for drawing an axis object.
/*! A GrowBarArc object is an object that displays a circular bar.
The GrowBarArc class contains function for drawing the object, and handle
events when the
object is clicked on, moved etc.
*/
class GrowBarArc : public GrowArc {
public:
//! Constuctor
/*!
\param glow_ctx The glow context.
\param name Name (max 31 char).
\param x1 x coordinate for first corner.
\param y1 y coordinate for first corner.
\param x2 x coordinate for second corner.
\param y2 y coordinate for second corner.
\param border_d_type Border color.
\param line_w Linewidth of border.
\param t_size Text size.
\param t_drawtype Drawtype for text.
\param nodraw Don't draw the object now.
*/
GrowBarArc(GrowCtx* glow_ctx, const char* name, double x1 = 0, double y1 = 0,
double x2 = 0, double y2 = 0, int ang1 = 0, int ang2 = 0, double width = 1, int border = 0,
glow_eDrawType border_d_type = glow_eDrawType_Line, int line_w = 1,
glow_eDrawType fill_d_type = glow_eDrawType_Line, int nodraw = 0);
//! Destructorx
/*! Remove the object from context, and erase it from the screen.
*/
~GrowBarArc();
//! Save the content of the object to file.
/*!
\param fp Ouput file.
\param mode Not used.
*/
void save(std::ofstream& fp, glow_eSaveMode mode);
//! Read the content of the object from file.
/*!
\param fp Input file.
*/
void open(std::ifstream& fp);
//! Erase the object
void erase(GlowWind* w)
{
erase(w, (GlowTransform*)NULL, hot, NULL);
}
//! Draw the objects if any part is inside the drawing area.
/*!
\param ll_x Lower left x coordinate of drawing area.
\param ll_y Lower left y coordinate of drawing area.
\param ur_x Upper right x coordinate of drawing area.
\param ur_y Upper right y coordinate of drawing area.
*/
void draw(GlowWind* w, int ll_x, int ll_y, int ur_x, int ur_y);
//! Draw the objects if any part is inside the drawing area, and extends the
//! drawing area.
/*!
\param ll_x Lower left x coordinate of drawing area.
\param ll_y Lower left y coordinate of drawing area.
\param ur_x Upper right x coordinate of drawing area.
\param ur_y Upper right y coordinate of drawing area.
If some part of object is inside the drawing area, and also outside the
drawing area,
the drawingarea is extended so it contains the whole objects.
*/
void draw(GlowWind* w, int* ll_x, int* ll_y, int* ur_x, int* ur_y);
//! Set object highlight.
/*!
\param on If 1, set highlight. If 0, reset highlight.
*/
void set_highlight(int on);
//! Get the object type
/*!
\return The type of the object.
*/
glow_eObjectType type()
{
return glow_eObjectType_GrowBarArc;
}
double max_value; //!< Max value for the scale.
double min_value; //!< Min value for the scale.
double bar_width; //!< Bar width.
double bar_value; //!< Bar value.
glow_eDrawType bar_drawtype; //!< Color the bar is drawn with.
glow_eDrawType
bar_bordercolor; //!< Color the border of the bar is drawn with.
int bar_borderwidth; //!< With of the border of the bar.
int bar_direction; //!< Bar direction.
GlowTraceData trace; //!< Almost obsolete
//! Erase the object.
/*!
\param t Transform of parent node.
\param hot Draw as hot, with larger line width.
\param node Parent node. Can be zero.
*/
void erase(GlowWind* w, GlowTransform* t, int hot, void* node);
//! Draw the object.
/*!
\param t Transform of parent node. Can be zero.
\param highlight Draw with highlight colors.
\param hot Draw as hot, with larger line width.
\param node Parent node. Can be zero.
\param colornode The node that controls the color of the object. Can be
zero.
The object is drawn with border, fill and shadow. If t is not zero, the
current tranform is
multiplied with the parentnodes transform, to give the appropriate
coordinates for the drawing.
*/
void draw(GlowWind* w, GlowTransform* t, int highlight, int hot, void* node,
void* colornode);
//! Redraw the area inside the objects border.
void draw();
//! Moves object to alignment line or point.
/*!
\param x x coordinate of alignment point.
\param y y coordinate of alignment point.
\param direction Type of alignment.
*/
void align(double x, double y, glow_eAlignDirection direction);
//! Get the range for the bar value
/*!
\param min Min value.
\param max Max value.
*/
void get_range(double *min, double *max);
//! Set the range for the bar value
/*!
\param min Min value.
\param max Max value.
*/
void set_range(double min, double max);
//! Set the bar value
/*!
\param value Bar value.
*/
void set_value(double value)
{
bar_value = value;
if (!fill)
erase(&ctx->mw);
draw();
}
//! Set parameters for the bar.
/*!
\param info Info struct.
*/
void set_bar_info(glow_sBarInfo* info);
//! Get parameters for the bar.
/*!
\param info Info struct.
*/
void get_bar_info(glow_sBarInfo* info);
//! Export the object as a javabean.
/*!
\param t Transform of parent node. Can be zero.
\param node Parent node. Can be zero.
\param pass Export pass.
\param shape_cnt Current index in a shape std::vector.
\param node_cnt Counter used for javabean name. Not used for this kind
of
object.
\param in_nc Member of a nodeclass. Not used for this kind of object.
\param fp Output file.
The object is transformed to the current zoom factor, and GlowExportJBean is
used to generate
java code for the bean.
*/
void export_javabean(GlowTransform* t, void* node, glow_eExportPass pass,
int* shape_cnt, int node_cnt, int in_nc, std::ofstream& fp);
//! Scan trace
/*! Calls the trace scan callback for the object.
*/
int trace_scan();
//! Init trace
/*! Calls the trace connect callback for the object.
*/
int trace_init();
//! Close trace
/*! Calls the trace disconnect callback for the object.
*/
void trace_close();
//! Conversion between different versions of Glow
/*!
\param version Version to convert to.
*/
void convert(glow_eConvert version);
};
/*@}*/
#endif
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