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
6db6e530
Commit
6db6e530
authored
May 06, 2009
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix in Max object. Default values were wrong and didn't work for negative input values
parent
bdf31a73
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
13 deletions
+40
-13
src/changelog.txt
src/changelog.txt
+2
-1
src/wbl/pwrb/src/pwrb_c_max.wb_load
src/wbl/pwrb/src/pwrb_c_max.wb_load
+8
-8
wb/lib/wb/src/wb_wblnode.cpp
wb/lib/wb/src/wb_wblnode.cpp
+6
-4
wb/lib/wb/src/wb_wnav.cpp
wb/lib/wb/src/wb_wnav.cpp
+12
-0
xtt/lib/xtt/src/xtt_xnav.cpp
xtt/lib/xtt/src/xtt_xnav.cpp
+12
-0
No files found.
src/changelog.txt
View file @
6db6e530
...
...
@@ -108,4 +108,5 @@
081022 cs convert Xtthelp bookmark on header didn't work after html conversion.
081024 cs xtthelp New program co_help to view helptexts.
081124 cs qcom Quota check for max number of buffered messages in a queue added.
090224 cs xtthelp New home button in help window.
\ No newline at end of file
090224 cs xtthelp New home button in help window.
090506 cs pwrb Bugfix in Max object. Default values were wrong and didn't work for negative input values.
\ No newline at end of file
src/wbl/pwrb/src/pwrb_c_max.wb_load
View file @
6db6e530
...
...
@@ -166,14 +166,14 @@ SObject pwrb:Class
EndObject
Object Template Max
Body RtBody
Attr In1 = FLT_
MIN
Attr In2 = FLT_
MIN
Attr In3 = FLT_
MIN
Attr In4 = FLT_
MIN
Attr In5 = FLT_
MIN
Attr In6 = FLT_
MIN
Attr In7 = FLT_
MIN
Attr In8 = FLT_
MIN
Attr In1 = FLT_
NMAX
Attr In2 = FLT_
NMAX
Attr In3 = FLT_
NMAX
Attr In4 = FLT_
NMAX
Attr In5 = FLT_
NMAX
Attr In6 = FLT_
NMAX
Attr In7 = FLT_
NMAX
Attr In8 = FLT_
NMAX
EndBody
EndObject
EndObject
...
...
wb/lib/wb/src/wb_wblnode.cpp
View file @
6db6e530
...
...
@@ -2026,12 +2026,14 @@ int wb_wblnode::attrStringToValue( int type_id, char *value_str,
}
case
pwr_eType_Float32
:
{
if
(
strcmp
(
value_str
,
"FLT_MIN"
)
==
0
)
{
if
(
strcmp
(
value_str
,
"FLT_MIN"
)
==
0
)
*
(
float
*
)
buffer_ptr
=
FLT_MIN
;
}
else
if
(
strcmp
(
value_str
,
"FLT_MAX"
)
==
0
)
{
else
if
(
strcmp
(
value_str
,
"FLT_NMIN"
)
==
0
)
*
(
float
*
)
buffer_ptr
=
-
FLT_MIN
;
else
if
(
strcmp
(
value_str
,
"FLT_MAX"
)
==
0
)
*
(
float
*
)
buffer_ptr
=
FLT_MAX
;
}
else
if
(
strcmp
(
value_str
,
"FLT_NMAX"
)
==
0
)
*
(
float
*
)
buffer_ptr
=
-
FLT_MAX
;
else
if
(
sscanf
(
value_str
,
"%f"
,
(
float
*
)
buffer_ptr
)
!=
1
)
return
0
;
break
;
...
...
wb/lib/wb/src/wb_wnav.cpp
View file @
6db6e530
...
...
@@ -69,8 +69,12 @@ int wnav_attr_string_to_value( ldh_tSesContext ldhses, int type_id, char *value
case
pwr_eType_Float32
:
{
if
(
strcmp
(
value_str
,
"FLT_MIN"
)
==
0
)
*
(
float
*
)
buffer_ptr
=
FLT_MIN
;
else
if
(
strcmp
(
value_str
,
"FLT_NMIN"
)
==
0
)
*
(
float
*
)
buffer_ptr
=
-
FLT_MIN
;
else
if
(
strcmp
(
value_str
,
"FLT_MAX"
)
==
0
)
*
(
float
*
)
buffer_ptr
=
FLT_MAX
;
else
if
(
strcmp
(
value_str
,
"FLT_NMAX"
)
==
0
)
*
(
float
*
)
buffer_ptr
=
-
FLT_MAX
;
else
if
(
sscanf
(
value_str
,
"%f"
,
(
float
*
)
buffer_ptr
)
!=
1
)
return
WNAV__INPUT_SYNTAX
;
break
;
...
...
@@ -293,10 +297,18 @@ void wnav_attrvalue_to_string( ldh_tSesContext ldhses, int type_id, void *value
strcpy
(
str
,
"FLT_MIN"
);
*
len
=
strlen
(
str
);
}
else
if
(
*
(
float
*
)
value_ptr
==
-
FLT_MIN
)
{
strcpy
(
str
,
"FLT_NMIN"
);
*
len
=
strlen
(
str
);
}
else
if
(
*
(
float
*
)
value_ptr
==
FLT_MAX
)
{
strcpy
(
str
,
"FLT_MAX"
);
*
len
=
strlen
(
str
);
}
else
if
(
*
(
float
*
)
value_ptr
==
-
FLT_MAX
)
{
strcpy
(
str
,
"FLT_NMAX"
);
*
len
=
strlen
(
str
);
}
else
*
len
=
sprintf
(
str
,
"%f"
,
*
(
float
*
)
value_ptr
);
*
buff
=
str
;
...
...
xtt/lib/xtt/src/xtt_xnav.cpp
View file @
6db6e530
...
...
@@ -239,8 +239,12 @@ int XNav::attr_string_to_value( int type_id, char *value_str,
case
pwr_eType_Float32
:
{
if
(
strcmp
(
value_str
,
"FLT_MIN"
)
==
0
)
*
(
float
*
)
buffer_ptr
=
FLT_MIN
;
else
if
(
strcmp
(
value_str
,
"FLT_NMIN"
)
==
0
)
*
(
float
*
)
buffer_ptr
=
-
FLT_MIN
;
else
if
(
strcmp
(
value_str
,
"FLT_MAX"
)
==
0
)
*
(
float
*
)
buffer_ptr
=
FLT_MAX
;
else
if
(
strcmp
(
value_str
,
"FLT_NMAX"
)
==
0
)
*
(
float
*
)
buffer_ptr
=
-
FLT_MAX
;
else
if
(
sscanf
(
value_str
,
"%f"
,
(
float
*
)
buffer_ptr
)
!=
1
)
return
XNAV__INPUT_SYNTAX
;
break
;
...
...
@@ -451,10 +455,18 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
strcpy
(
str
,
"FLT_MIN"
);
*
len
=
strlen
(
str
);
}
else
if
(
*
(
float
*
)
value_ptr
==
-
FLT_MIN
)
{
strcpy
(
str
,
"FLT_NMIN"
);
*
len
=
strlen
(
str
);
}
else
if
(
*
(
float
*
)
value_ptr
==
FLT_MAX
)
{
strcpy
(
str
,
"FLT_MAX"
);
*
len
=
strlen
(
str
);
}
else
if
(
*
(
float
*
)
value_ptr
==
-
FLT_MAX
)
{
strcpy
(
str
,
"FLT_NMAX"
);
*
len
=
strlen
(
str
);
}
else
{
if
(
!
format
)
*
len
=
snprintf
(
str
,
size
,
"%g"
,
*
(
float
*
)
value_ptr
);
...
...
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