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
4ba8ae87
Commit
4ba8ae87
authored
Apr 14, 2024
by
lcgamboa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Fix Oscilloscope to use all SpareParts pins.
parent
8edf0a7f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
31 deletions
+26
-31
src/lib/oscilloscope.cc
src/lib/oscilloscope.cc
+25
-30
src/lib/types.h
src/lib/types.h
+1
-1
No files found.
src/lib/oscilloscope.cc
View file @
4ba8ae87
...
...
@@ -625,40 +625,35 @@ void COscilloscope::SetBaseTimer(void) {
WindowCmd
(
PW_MAIN
,
"combo2"
,
PWA_COMBODELETEITEMS
,
NULL
);
WindowCmd
(
PW_MAIN
,
"combo3"
,
PWA_COMBODELETEITEMS
,
NULL
);
for
(
int
i
=
1
;
i
<=
PinCount
;
i
++
)
{
std
::
string
spin
;
if
(
pboard
->
GetUseSpareParts
())
{
spin
=
SpareParts
.
GetPinName
(
i
);
}
else
{
if
(
pboard
->
GetUseSpareParts
())
{
WindowCmd
(
PW_MAIN
,
"combo2"
,
PWA_COMBOSETITEMS
,
SpareParts
.
GetPinsNames
().
c_str
());
WindowCmd
(
PW_MAIN
,
"combo3"
,
PWA_COMBOSETITEMS
,
SpareParts
.
GetPinsNames
().
c_str
());
}
else
{
for
(
int
i
=
1
;
i
<=
PinCount
;
i
++
)
{
std
::
string
spin
;
spin
=
pboard
->
MGetPinName
(
i
);
}
if
(
spin
.
compare
(
"error"
))
{
WindowCmd
(
PW_MAIN
,
"combo2"
,
PWM
_COMBOADDITEM
,
(
std
::
to_string
(
i
)
+
" "
+
spin
).
c_str
());
WindowCmd
(
PW_MAIN
,
"combo3"
,
PWM_COMBOADDITEM
,
(
std
::
to_string
(
i
)
+
" "
+
spin
).
c_str
());
if
(
spin
.
compare
(
"error"
))
{
WindowCmd
(
PW_MAIN
,
"combo2"
,
PWA_COMBOADDITEM
,
(
std
::
to_string
(
i
)
+
" "
+
spin
).
c_str
());
WindowCmd
(
PW_MAIN
,
"combo3"
,
PWA
_COMBOADDITEM
,
(
std
::
to_string
(
i
)
+
" "
+
spin
).
c_str
());
}
}
}
if
(
chp
[
0
]
<=
PinCount
)
{
std
::
string
spin
;
if
(
pboard
->
GetUseSpareParts
())
{
spin
=
SpareParts
.
GetPinName
(
chp
[
0
]);
}
else
{
spin
=
pboard
->
MGetPinName
(
chp
[
0
]);
}
WindowCmd
(
PW_MAIN
,
"combo2"
,
PWA_COMBOSETTEXT
,
(
std
::
to_string
(
chp
[
0
])
+
" "
+
spin
).
c_str
());
}
else
WindowCmd
(
PW_MAIN
,
"combo2"
,
PWA_COMBOSETTEXT
,
"1"
);
if
(
chp
[
1
]
<=
PinCount
)
{
std
::
string
spin
;
if
(
pboard
->
GetUseSpareParts
())
{
spin
=
SpareParts
.
GetPinName
(
chp
[
1
]);
}
else
{
spin
=
pboard
->
MGetPinName
(
chp
[
1
]);
}
WindowCmd
(
PW_MAIN
,
"combo3"
,
PWA_COMBOSETTEXT
,
(
std
::
to_string
(
chp
[
1
])
+
" "
+
spin
).
c_str
());
}
else
WindowCmd
(
PW_MAIN
,
"combo2"
,
PWA_COMBOSETTEXT
,
"2"
);
std
::
string
spin
;
if
(
pboard
->
GetUseSpareParts
())
{
spin
=
SpareParts
.
GetPinName
(
chp
[
0
]);
}
else
{
spin
=
pboard
->
MGetPinName
(
chp
[
0
]);
}
WindowCmd
(
PW_MAIN
,
"combo2"
,
PWA_COMBOSETTEXT
,
(
std
::
to_string
(
chp
[
0
])
+
" "
+
spin
).
c_str
());
if
(
pboard
->
GetUseSpareParts
())
{
spin
=
SpareParts
.
GetPinName
(
chp
[
1
]);
}
else
{
spin
=
pboard
->
MGetPinName
(
chp
[
1
]);
}
WindowCmd
(
PW_MAIN
,
"combo3"
,
PWA_COMBOSETTEXT
,
(
std
::
to_string
(
chp
[
1
])
+
" "
+
spin
).
c_str
());
WindowCmd
(
PW_MAIN
,
"spind5"
,
PWA_SPINDGETVALUE
,
NULL
,
&
tscale
);
...
...
src/lib/types.h
View file @
4ba8ae87
...
...
@@ -42,7 +42,7 @@ enum PICSimLabWindowAction {
PWA_COMBOPROPEV
,
PWA_COMBOPARTEV
,
PWA_COMBODELETEITEMS
,
PW
M
_COMBOADDITEM
,
PW
A
_COMBOADDITEM
,
PWA_SPINDSETMAX
,
PWA_SPINDSETMIN
,
...
...
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