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
bddb110e
Commit
bddb110e
authored
Dec 06, 2013
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ge analog color, dynamics for border color added
parent
a2cb97c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
8 deletions
+36
-8
xtt/lib/ge/src/ge_dyn.cpp
xtt/lib/ge/src/ge_dyn.cpp
+32
-6
xtt/lib/ge/src/ge_dyn.h
xtt/lib/ge/src/ge_dyn.h
+4
-2
No files found.
xtt/lib/ge/src/ge_dyn.cpp
View file @
bddb110e
...
...
@@ -4725,6 +4725,11 @@ void GeAnalogColor::get_attributes( attr_sItem *attrinfo, int *item_count)
attrinfo
[
i
].
type
=
glow_eType_String
;
attrinfo
[
i
++
].
size
=
sizeof
(
attribute
);
strcpy
(
attrinfo
[
i
].
name
,
"AnalogColor.Border"
);
attrinfo
[
i
].
value
=
&
border
;
attrinfo
[
i
].
type
=
glow_eType_Boolean
;
attrinfo
[
i
++
].
size
=
sizeof
(
border
);
strcpy
(
attrinfo
[
i
].
name
,
"AnalogColor.Instances"
);
attrinfo
[
i
].
value
=
&
instance_mask
;
attrinfo
[
i
].
type
=
ge_eAttrType_InstanceMask
;
...
...
@@ -4753,6 +4758,11 @@ void GeAnalogColor::get_attributes( attr_sItem *attrinfo, int *item_count)
attrinfo
[
i
].
value
=
&
limit_type
;
attrinfo
[
i
].
type
=
ge_eAttrType_LimitType
;
attrinfo
[
i
++
].
size
=
sizeof
(
limit_type
);
sprintf
(
attrinfo
[
i
].
name
,
"AnalogColor%d.Border"
,
inst
);
attrinfo
[
i
].
value
=
&
border
;
attrinfo
[
i
].
type
=
glow_eType_Boolean
;
attrinfo
[
i
++
].
size
=
sizeof
(
border
);
}
}
*
item_count
=
i
;
...
...
@@ -4835,6 +4845,7 @@ void GeAnalogColor::save( ofstream& fp)
fp
<<
int
(
ge_eSave_AnalogColor_color
)
<<
FSPACE
<<
(
int
)
color
<<
endl
;
fp
<<
int
(
ge_eSave_AnalogColor_instance
)
<<
FSPACE
<<
int
(
instance
)
<<
endl
;
fp
<<
int
(
ge_eSave_AnalogColor_instance_mask
)
<<
FSPACE
<<
int
(
instance_mask
)
<<
endl
;
fp
<<
int
(
ge_eSave_AnalogColor_border
)
<<
FSPACE
<<
border
<<
endl
;
fp
<<
int
(
ge_eSave_End
)
<<
endl
;
}
...
...
@@ -4866,6 +4877,7 @@ void GeAnalogColor::open( ifstream& fp)
case
ge_eSave_AnalogColor_color
:
fp
>>
tmp
;
color
=
(
glow_eDrawType
)
tmp
;
break
;
case
ge_eSave_AnalogColor_instance
:
fp
>>
tmp
;
instance
=
(
ge_mInstance
)
tmp
;
break
;
case
ge_eSave_AnalogColor_instance_mask
:
fp
>>
tmp
;
instance_mask
=
(
ge_mInstance
)
tmp
;
break
;
case
ge_eSave_AnalogColor_border
:
fp
>>
tmp
;
border
=
(
int
)
tmp
;
break
;
case
ge_eSave_End
:
end_found
=
1
;
break
;
default:
cout
<<
"GeAnalogColor:open syntax error"
<<
endl
;
...
...
@@ -5045,26 +5057,40 @@ int GeAnalogColor::scan( grow_tObject object)
}
if
(
dyn
->
total_dyn_type1
&
ge_mDynType1_Tone
)
{
if
(
set_color
)
{
if
(
color
>=
(
glow_eDrawType
)
glow_eDrawTone__
)
grow_SetObjectFillColor
(
object
,
color
);
if
(
color
>=
(
glow_eDrawType
)
glow_eDrawTone__
)
{
if
(
!
border
)
grow_SetObjectFillColor
(
object
,
color
);
else
grow_SetObjectBorderColor
(
object
,
color
);
}
else
grow_SetObjectColorTone
(
object
,
(
glow_eDrawTone
)
color
);
dyn
->
ignore_color
=
true
;
}
else
{
if
(
color
>=
(
glow_eDrawType
)
glow_eDrawTone__
)
grow_ResetObjectFillColor
(
object
);
if
(
color
>=
(
glow_eDrawType
)
glow_eDrawTone__
)
{
if
(
!
border
)
grow_ResetObjectFillColor
(
object
);
else
grow_ResetObjectBorderColor
(
object
);
}
grow_ResetObjectColorTone
(
object
);
dyn
->
reset_color
=
true
;
}
}
else
{
if
(
set_color
)
{
grow_SetObjectFillColor
(
object
,
color
);
if
(
!
border
)
grow_SetObjectFillColor
(
object
,
color
);
else
grow_SetObjectBorderColor
(
object
,
color
);
dyn
->
ignore_color
=
true
;
}
else
{
grow_ResetObjectFillColor
(
object
);
if
(
!
border
)
grow_ResetObjectFillColor
(
object
);
else
grow_ResetObjectBorderColor
(
object
);
dyn
->
reset_color
=
true
;
}
}
...
...
xtt/lib/ge/src/ge_dyn.h
View file @
bddb110e
...
...
@@ -549,6 +549,7 @@
ge_eSave_AnalogColor_color
=
6103
,
ge_eSave_AnalogColor_instance
=
6104
,
ge_eSave_AnalogColor_instance_mask
=
6105
,
ge_eSave_AnalogColor_border
=
6106
,
ge_eSave_TipText_text
=
6200
,
ge_eSave_Help_topic
=
6300
,
ge_eSave_Help_bookmark
=
6400
,
...
...
@@ -1332,6 +1333,7 @@ class GeAnalogColor : public GeDynElem {
double
limit
;
//!< Limit value.
ge_eLimitType
limit_type
;
//!< Type of limit.
glow_eDrawType
color
;
//!< Color to set when limit value is exceeded.
int
border
;
bool
old_state
;
pwr_tFloat32
*
p
;
...
...
@@ -1345,12 +1347,12 @@ class GeAnalogColor : public GeDynElem {
GeAnalogColor
(
GeDyn
*
e_dyn
,
ge_mInstance
e_instance
=
ge_mInstance_1
)
:
GeDynElem
(
e_dyn
,
ge_mDynType1_AnalogColor
,
ge_mDynType2_No
,
ge_mActionType1_No
,
ge_mActionType2_No
,
ge_eDynPrio_AnalogColor
),
limit
(
0
),
limit_type
(
ge_eLimitType_Gt
),
color
(
glow_eDrawType_Inherit
),
limit
(
0
),
limit_type
(
ge_eLimitType_Gt
),
color
(
glow_eDrawType_Inherit
),
border
(
0
),
old_state
(
false
),
p
(
0
),
old_value
(
FLT_INI
),
e
(
0
)
{
strcpy
(
attribute
,
""
);
instance
=
e_instance
;}
GeAnalogColor
(
const
GeAnalogColor
&
x
)
:
GeDynElem
(
x
.
dyn
,
x
.
dyn_type1
,
x
.
dyn_type2
,
x
.
action_type1
,
x
.
action_type2
,
x
.
prio
),
limit
(
x
.
limit
),
limit_type
(
x
.
limit_type
),
color
(
x
.
color
),
old_state
(
false
),
p
(
0
),
limit_type
(
x
.
limit_type
),
color
(
x
.
color
),
border
(
x
.
border
),
old_state
(
false
),
p
(
0
),
old_value
(
FLT_INI
),
e
(
0
)
{
strcpy
(
attribute
,
x
.
attribute
);
instance
=
x
.
instance
;
instance_mask
=
x
.
instance_mask
;}
...
...
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