Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
picsimlab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
picsimlab
Commits
dd94038e
Commit
dd94038e
authored
Feb 01, 2024
by
lcgamboa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chg: Code refactor - Fix Spin and Combo events !minor
parent
e54291ef
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
32 additions
and
9 deletions
+32
-9
VERSION
VERSION
+1
-1
src/lib/spareparts.h
src/lib/spareparts.h
+4
-0
src/parts/input_keypad.cc
src/parts/input_keypad.cc
+2
-0
src/parts/input_pot.cc
src/parts/input_pot.cc
+1
-0
src/parts/input_pot_r.cc
src/parts/input_pot_r.cc
+1
-0
src/parts/input_push_buttons.cc
src/parts/input_push_buttons.cc
+1
-0
src/parts/input_switches.cc
src/parts/input_switches.cc
+1
-0
src/parts/other_jumpers.cc
src/parts/other_jumpers.cc
+2
-0
src/parts/output_7s_Display.cc
src/parts/output_7s_Display.cc
+1
-0
src/parts/output_LCD_ili9341.cc
src/parts/output_LCD_ili9341.cc
+2
-0
src/parts/output_LEDs.cc
src/parts/output_LEDs.cc
+1
-0
src/picsimlab5.cc
src/picsimlab5.cc
+15
-8
No files found.
VERSION
View file @
dd94038e
...
@@ -2,5 +2,5 @@ PACKAGE=picsimlab
...
@@ -2,5 +2,5 @@ PACKAGE=picsimlab
MAINVER=0
MAINVER=0
MINORVER=9
MINORVER=9
VERSION=0.9.1
VERSION=0.9.1
DATE=240
13
1
DATE=240
20
1
VERSION_STABLE=0.9.1
VERSION_STABLE=0.9.1
src/lib/spareparts.h
View file @
dd94038e
...
@@ -35,14 +35,18 @@ enum PICSimLabWPropAction {
...
@@ -35,14 +35,18 @@ enum PICSimLabWPropAction {
WPA_COMBOSETITEMS
,
WPA_COMBOSETITEMS
,
WPA_COMBOSETTEXT
,
WPA_COMBOSETTEXT
,
WPA_COMBOGETTEXT
,
WPA_COMBOGETTEXT
,
WPA_COMBOENABLEEV
,
WPA_SPINDSETMAX
,
WPA_SPINDSETMAX
,
WPA_SPINDSETMIN
,
WPA_SPINDSETMIN
,
WPA_SPINDSETVALUE
,
WPA_SPINDSETVALUE
,
WPA_SPINDGETVALUE
,
WPA_SPINDGETVALUE
,
WPA_SPINSETMAX
,
WPA_SPINSETMAX
,
WPA_SPINSETMIN
,
WPA_SPINSETMIN
,
WPA_SPINSETVALUE
,
WPA_SPINSETVALUE
,
WPA_SPINGETVALUE
,
WPA_SPINGETVALUE
,
WPA_SPINENABLEEV
,
WPA_TEXTCLEAR
,
WPA_TEXTCLEAR
,
WPA_TEXTADDLINE
,
WPA_TEXTADDLINE
,
...
...
src/parts/input_keypad.cc
View file @
dd94038e
...
@@ -640,6 +640,8 @@ void cpart_keypad::ConfigurePropertiesWindow(void) {
...
@@ -640,6 +640,8 @@ void cpart_keypad::ConfigurePropertiesWindow(void) {
SpareParts
.
WPropCmd
(
"combo11"
,
WPA_COMBOSETTEXT
,
"DOWN"
);
SpareParts
.
WPropCmd
(
"combo11"
,
WPA_COMBOSETTEXT
,
"DOWN"
);
SpareParts
.
WPropCmd
(
"combo12"
,
WPA_COMBOSETITEMS
,
"4x4,4x3,2x5,"
);
SpareParts
.
WPropCmd
(
"combo12"
,
WPA_COMBOSETITEMS
,
"4x4,4x3,2x5,"
);
SpareParts
.
WPropCmd
(
"combo12"
,
WPA_COMBOENABLEEV
,
"1"
);
switch
(
type
)
{
switch
(
type
)
{
case
KT4x4
:
case
KT4x4
:
SpareParts
.
WPropCmd
(
"label1"
,
WPA_LABELSETTEXT
,
"P1 - L1"
);
SpareParts
.
WPropCmd
(
"label1"
,
WPA_LABELSETTEXT
,
"P1 - L1"
);
...
...
src/parts/input_pot.cc
View file @
dd94038e
...
@@ -267,6 +267,7 @@ void cpart_pot::ConfigurePropertiesWindow(void) {
...
@@ -267,6 +267,7 @@ void cpart_pot::ConfigurePropertiesWindow(void) {
SpareParts
.
WPropCmd
(
"spin7"
,
WPA_SPINSETMAX
,
"4"
);
SpareParts
.
WPropCmd
(
"spin7"
,
WPA_SPINSETMAX
,
"4"
);
SpareParts
.
WPropCmd
(
"spin7"
,
WPA_SPINSETMIN
,
"1"
);
SpareParts
.
WPropCmd
(
"spin7"
,
WPA_SPINSETMIN
,
"1"
);
SpareParts
.
WPropCmd
(
"spin7"
,
WPA_SPINSETVALUE
,
std
::
to_string
(
Size
).
c_str
());
SpareParts
.
WPropCmd
(
"spin7"
,
WPA_SPINSETVALUE
,
std
::
to_string
(
Size
).
c_str
());
SpareParts
.
WPropCmd
(
"spin7"
,
WPA_SPINENABLEEV
,
"1"
);
SpinChange
(
NULL
,
NULL
,
Size
);
SpinChange
(
NULL
,
NULL
,
Size
);
}
}
...
...
src/parts/input_pot_r.cc
View file @
dd94038e
...
@@ -293,6 +293,7 @@ void cpart_pot_r::ConfigurePropertiesWindow(void) {
...
@@ -293,6 +293,7 @@ void cpart_pot_r::ConfigurePropertiesWindow(void) {
SpareParts
.
WPropCmd
(
"spin7"
,
WPA_SPINSETMAX
,
"4"
);
SpareParts
.
WPropCmd
(
"spin7"
,
WPA_SPINSETMAX
,
"4"
);
SpareParts
.
WPropCmd
(
"spin7"
,
WPA_SPINSETMIN
,
"1"
);
SpareParts
.
WPropCmd
(
"spin7"
,
WPA_SPINSETMIN
,
"1"
);
SpareParts
.
WPropCmd
(
"spin7"
,
WPA_SPINSETVALUE
,
std
::
to_string
(
Size
).
c_str
());
SpareParts
.
WPropCmd
(
"spin7"
,
WPA_SPINSETVALUE
,
std
::
to_string
(
Size
).
c_str
());
SpareParts
.
WPropCmd
(
"spin7"
,
WPA_SPINENABLEEV
,
"1"
);
SpinChange
(
NULL
,
NULL
,
Size
);
SpinChange
(
NULL
,
NULL
,
Size
);
}
}
...
...
src/parts/input_push_buttons.cc
View file @
dd94038e
...
@@ -417,6 +417,7 @@ void cpart_pbuttons::ConfigurePropertiesWindow(void) {
...
@@ -417,6 +417,7 @@ void cpart_pbuttons::ConfigurePropertiesWindow(void) {
SpareParts
.
WPropCmd
(
"spin13"
,
WPA_SPINSETMAX
,
"8"
);
SpareParts
.
WPropCmd
(
"spin13"
,
WPA_SPINSETMAX
,
"8"
);
SpareParts
.
WPropCmd
(
"spin13"
,
WPA_SPINSETMIN
,
"1"
);
SpareParts
.
WPropCmd
(
"spin13"
,
WPA_SPINSETMIN
,
"1"
);
SpareParts
.
WPropCmd
(
"spin13"
,
WPA_SPINSETVALUE
,
std
::
to_string
(
Size
).
c_str
());
SpareParts
.
WPropCmd
(
"spin13"
,
WPA_SPINSETVALUE
,
std
::
to_string
(
Size
).
c_str
());
SpareParts
.
WPropCmd
(
"spin13"
,
WPA_SPINENABLEEV
,
"1"
);
SpinChange
(
NULL
,
NULL
,
Size
);
SpinChange
(
NULL
,
NULL
,
Size
);
}
}
...
...
src/parts/input_switches.cc
View file @
dd94038e
...
@@ -407,6 +407,7 @@ void cpart_switches::ConfigurePropertiesWindow(void) {
...
@@ -407,6 +407,7 @@ void cpart_switches::ConfigurePropertiesWindow(void) {
SpareParts
.
WPropCmd
(
"spin13"
,
WPA_SPINSETMAX
,
"8"
);
SpareParts
.
WPropCmd
(
"spin13"
,
WPA_SPINSETMAX
,
"8"
);
SpareParts
.
WPropCmd
(
"spin13"
,
WPA_SPINSETMIN
,
"1"
);
SpareParts
.
WPropCmd
(
"spin13"
,
WPA_SPINSETMIN
,
"1"
);
SpareParts
.
WPropCmd
(
"spin13"
,
WPA_SPINSETVALUE
,
std
::
to_string
(
Size
).
c_str
());
SpareParts
.
WPropCmd
(
"spin13"
,
WPA_SPINSETVALUE
,
std
::
to_string
(
Size
).
c_str
());
SpareParts
.
WPropCmd
(
"spin13"
,
WPA_SPINENABLEEV
,
"1"
);
SpinChange
(
NULL
,
NULL
,
Size
);
SpinChange
(
NULL
,
NULL
,
Size
);
}
}
...
...
src/parts/other_jumpers.cc
View file @
dd94038e
...
@@ -442,7 +442,9 @@ void cpart_Jumpers::ConfigurePropertiesWindow(void) {
...
@@ -442,7 +442,9 @@ void cpart_Jumpers::ConfigurePropertiesWindow(void) {
char
childname
[
256
];
char
childname
[
256
];
SpareParts
.
WPropCmd
(
"combo1"
,
WPA_COMBOSETITEMS
,
"F,M,"
);
SpareParts
.
WPropCmd
(
"combo1"
,
WPA_COMBOSETITEMS
,
"F,M,"
);
SpareParts
.
WPropCmd
(
"combo1"
,
WPA_COMBOENABLEEV
,
"1"
);
SpareParts
.
WPropCmd
(
"combo18"
,
WPA_COMBOSETITEMS
,
"F,M,"
);
SpareParts
.
WPropCmd
(
"combo18"
,
WPA_COMBOSETITEMS
,
"F,M,"
);
SpareParts
.
WPropCmd
(
"combo18"
,
WPA_COMBOENABLEEV
,
"1"
);
if
(
jtype
&
0x02
)
if
(
jtype
&
0x02
)
SpareParts
.
WPropCmd
(
"combo1"
,
WPA_COMBOSETTEXT
,
"F"
);
SpareParts
.
WPropCmd
(
"combo1"
,
WPA_COMBOSETTEXT
,
"F"
);
...
...
src/parts/output_7s_Display.cc
View file @
dd94038e
...
@@ -580,6 +580,7 @@ void cpart_7s_display::ConfigurePropertiesWindow(void) {
...
@@ -580,6 +580,7 @@ void cpart_7s_display::ConfigurePropertiesWindow(void) {
SpareParts
.
WPropCmd
(
"combo13"
,
WPA_COMBOSETTEXT
,
"LOW "
);
SpareParts
.
WPropCmd
(
"combo13"
,
WPA_COMBOSETTEXT
,
"LOW "
);
SpareParts
.
WPropCmd
(
"combo14"
,
WPA_COMBOSETITEMS
,
"4 Mux.,Single,"
);
SpareParts
.
WPropCmd
(
"combo14"
,
WPA_COMBOSETITEMS
,
"4 Mux.,Single,"
);
SpareParts
.
WPropCmd
(
"combo14"
,
WPA_COMBOENABLEEV
,
"1"
);
if
(
dtype
==
0
)
if
(
dtype
==
0
)
SpareParts
.
WPropCmd
(
"combo14"
,
WPA_COMBOSETTEXT
,
"4 Mux."
);
SpareParts
.
WPropCmd
(
"combo14"
,
WPA_COMBOSETTEXT
,
"4 Mux."
);
else
{
else
{
...
...
src/parts/output_LCD_ili9341.cc
View file @
dd94038e
...
@@ -576,6 +576,8 @@ void cpart_LCD_ili9341::ConfigurePropertiesWindow(void) {
...
@@ -576,6 +576,8 @@ void cpart_LCD_ili9341::ConfigurePropertiesWindow(void) {
}
}
break
;
break
;
}
}
SpareParts
.
WPropCmd
(
"combo6"
,
WPA_COMBOENABLEEV
,
"1"
);
}
}
void
cpart_LCD_ili9341
::
ReadPropertiesWindow
(
void
)
{
void
cpart_LCD_ili9341
::
ReadPropertiesWindow
(
void
)
{
...
...
src/parts/output_LEDs.cc
View file @
dd94038e
...
@@ -265,6 +265,7 @@ void cpart_leds::ConfigurePropertiesWindow(void) {
...
@@ -265,6 +265,7 @@ void cpart_leds::ConfigurePropertiesWindow(void) {
SpareParts
.
WPropCmd
(
"spin10"
,
WPA_SPINSETMAX
,
"8"
);
SpareParts
.
WPropCmd
(
"spin10"
,
WPA_SPINSETMAX
,
"8"
);
SpareParts
.
WPropCmd
(
"spin10"
,
WPA_SPINSETMIN
,
"1"
);
SpareParts
.
WPropCmd
(
"spin10"
,
WPA_SPINSETMIN
,
"1"
);
SpareParts
.
WPropCmd
(
"spin10"
,
WPA_SPINSETVALUE
,
std
::
to_string
(
Size
).
c_str
());
SpareParts
.
WPropCmd
(
"spin10"
,
WPA_SPINSETVALUE
,
std
::
to_string
(
Size
).
c_str
());
SpareParts
.
WPropCmd
(
"spin10"
,
WPA_SPINENABLEEV
,
"1"
);
SpareParts
.
WPropCmd
(
"combo_1"
,
WPA_COMBOSETITEMS
,
Colors
.
c_str
());
SpareParts
.
WPropCmd
(
"combo_1"
,
WPA_COMBOSETITEMS
,
Colors
.
c_str
());
SpareParts
.
WPropCmd
(
"combo_1"
,
WPA_COMBOSETTEXT
,
Colorname
[
colors
[
0
]]);
SpareParts
.
WPropCmd
(
"combo_1"
,
WPA_COMBOSETTEXT
,
Colorname
[
colors
[
0
]]);
...
...
src/picsimlab5.cc
View file @
dd94038e
...
@@ -200,7 +200,6 @@ void CPWindow5::pmenu2_Properties_EvMenuActive(CControl* control) {
...
@@ -200,7 +200,6 @@ void CPWindow5::pmenu2_Properties_EvMenuActive(CControl* control) {
combo
->
SetX
(
x
+
68
);
combo
->
SetX
(
x
+
68
);
combo
->
SetY
(
y
);
combo
->
SetY
(
y
);
wprop
.
CreateChild
(
combo
);
wprop
.
CreateChild
(
combo
);
combo
->
EvOnComboChange
=
EVONCOMBOCHANGE
&
CPWindow5
::
PropComboChange
;
break
;
break
;
case
PCW_LABEL
:
{
case
PCW_LABEL
:
{
char
lb
[
21
];
char
lb
[
21
];
...
@@ -274,7 +273,6 @@ void CPWindow5::pmenu2_Properties_EvMenuActive(CControl* control) {
...
@@ -274,7 +273,6 @@ void CPWindow5::pmenu2_Properties_EvMenuActive(CControl* control) {
spin
->
SetX
(
x
+
68
);
spin
->
SetX
(
x
+
68
);
spin
->
SetY
(
y
);
spin
->
SetY
(
y
);
wprop
.
CreateChild
(
spin
);
wprop
.
CreateChild
(
spin
);
spin
->
EvOnChangeSpin
=
EVONCHANGESPIN
&
CPWindow5
::
PropSpinChange
;
break
;
break
;
case
PCW_EDIT
:
case
PCW_EDIT
:
sprintf
(
name
,
"label%i"
,
i
+
1
);
sprintf
(
name
,
"label%i"
,
i
+
1
);
...
@@ -417,12 +415,6 @@ void CPWindow5::pmenu2_Properties_EvMenuActive(CControl* control) {
...
@@ -417,12 +415,6 @@ void CPWindow5::pmenu2_Properties_EvMenuActive(CControl* control) {
button
->
EvMouseButtonRelease
=
EVMOUSEBUTTONRELEASE
&
CPWindow5
::
PropButtonRelease
;
button
->
EvMouseButtonRelease
=
EVMOUSEBUTTONRELEASE
&
CPWindow5
::
PropButtonRelease
;
}
}
// FIXME -- Only to work with ili9341 old interface - remove
CCombo
*
combo
=
((
CCombo
*
)
wprop
.
GetChildByName
(
"combo6"
));
if
(
combo
)
{
combo
->
EvOnComboChange
=
EVONCOMBOCHANGE
&
CPWindow5
::
PropComboChange
;
}
wprop
.
SetX
(
SpareParts
.
GetPart
(
PartSelected
)
->
GetX
()
+
GetX
()
-
offsetx
);
wprop
.
SetX
(
SpareParts
.
GetPart
(
PartSelected
)
->
GetX
()
+
GetX
()
-
offsetx
);
wprop
.
SetY
(
SpareParts
.
GetPart
(
PartSelected
)
->
GetY
()
+
GetY
()
-
offsety
);
wprop
.
SetY
(
SpareParts
.
GetPart
(
PartSelected
)
->
GetY
()
+
GetY
()
-
offsety
);
...
@@ -1109,6 +1101,14 @@ int CPWindow5::OnWPropCmd(const char* ControlName, const PICSimLabWPropAction ac
...
@@ -1109,6 +1101,14 @@ int CPWindow5::OnWPropCmd(const char* ControlName, const PICSimLabWPropAction ac
strcpy
((
char
*
)
ReturnBuff
,
((
CCombo
*
)
ctrl
)
->
GetText
().
c_str
());
strcpy
((
char
*
)
ReturnBuff
,
((
CCombo
*
)
ctrl
)
->
GetText
().
c_str
());
return
strlen
((
char
*
)
ReturnBuff
);
return
strlen
((
char
*
)
ReturnBuff
);
break
;
break
;
case
WPA_COMBOENABLEEV
:
if
(
!
strcmp
(
Value
,
"1"
))
{
((
CCombo
*
)
ctrl
)
->
EvOnComboChange
=
EVONCOMBOCHANGE
&
CPWindow5
::
PropComboChange
;
}
else
{
((
CCombo
*
)
ctrl
)
->
EvOnComboChange
=
NULL
;
}
break
;
case
WPA_SPINDSETMAX
:
case
WPA_SPINDSETMAX
:
((
CSpind
*
)
ctrl
)
->
SetMax
(
std
::
stof
(
Value
));
((
CSpind
*
)
ctrl
)
->
SetMax
(
std
::
stof
(
Value
));
break
;
break
;
...
@@ -1134,6 +1134,13 @@ int CPWindow5::OnWPropCmd(const char* ControlName, const PICSimLabWPropAction ac
...
@@ -1134,6 +1134,13 @@ int CPWindow5::OnWPropCmd(const char* ControlName, const PICSimLabWPropAction ac
case
WPA_SPINGETVALUE
:
case
WPA_SPINGETVALUE
:
*
((
int
*
)
ReturnBuff
)
=
((
CSpin
*
)
ctrl
)
->
GetValue
();
*
((
int
*
)
ReturnBuff
)
=
((
CSpin
*
)
ctrl
)
->
GetValue
();
break
;
break
;
case
WPA_SPINENABLEEV
:
if
(
!
strcmp
(
Value
,
"1"
))
{
((
CSpin
*
)
ctrl
)
->
EvOnChangeSpin
=
EVONCHANGESPIN
&
CPWindow5
::
PropSpinChange
;
}
else
{
((
CSpin
*
)
ctrl
)
->
EvOnChangeSpin
=
NULL
;
}
break
;
case
WPA_TEXTCLEAR
:
case
WPA_TEXTCLEAR
:
((
CText
*
)
ctrl
)
->
Clear
();
((
CText
*
)
ctrl
)
->
Clear
();
...
...
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