Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs1-24fa
project03
Commits
2df9f10e
Commit
2df9f10e
authored
6 months ago
by
Antonio Caceres
Browse files
Options
Download
Email Patches
Plain Diff
Remove Final from constants in src/ files.
parent
fa4f2457
master
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/morse_engine.py
+5
-6
src/morse_engine.py
src/prox_pulse.py
+3
-3
src/prox_pulse.py
src/pulse.py
+3
-4
src/pulse.py
src/symbols.py
+1
-3
src/symbols.py
with
12 additions
and
16 deletions
+12
-16
src/morse_engine.py
View file @
2df9f10e
import
time
from
typing
import
Final
from
src
import
morse_code
from
.abstract
import
LEDController
,
TouchSensor
,
ProximitySensor
# Constants (Keep same or tests will break)
THRESHOLD
:
Final
[
int
]
=
75
UNIT_TIME
:
Final
[
float
]
=
0.24
THRESHOLD
:
int
=
75
UNIT_TIME
:
float
=
0.24
RED
:
Final
[
tuple
[
int
,
int
,
int
]
]
=
(
255
,
0
,
0
)
YELLOW
:
Final
[
tuple
[
int
,
int
,
int
]
]
=
(
220
,
160
,
0
)
GREEN
:
Final
[
tuple
[
int
,
int
,
int
]
]
=
(
0
,
255
,
0
)
RED
:
tuple
[
int
,
int
,
int
]
=
(
255
,
0
,
0
)
YELLOW
:
tuple
[
int
,
int
,
int
]
=
(
220
,
160
,
0
)
GREEN
:
tuple
[
int
,
int
,
int
]
=
(
0
,
255
,
0
)
# Legacy ham radio license requirement
# - 0.24 sec unit time (5 words per minute)
...
...
This diff is collapsed.
Click to expand it.
src/prox_pulse.py
View file @
2df9f10e
...
...
@@ -2,10 +2,10 @@ import time
from
.pulse
import
pulse
from
.abstract
import
LEDController
,
ProximitySensor
THRESHOLD
=
75
THRESHOLD
:
int
=
75
RED
=
(
150
,
10
,
10
)
GREEN
=
(
30
,
100
,
10
)
RED
:
tuple
[
int
,
int
,
int
]
=
(
150
,
10
,
10
)
GREEN
:
tuple
[
int
,
int
,
int
]
=
(
30
,
100
,
10
)
def
prox_pulse
(
px
:
LEDController
,
color
:
tuple
[
int
,
int
,
int
],
prox
:
int
)
->
None
:
...
...
This diff is collapsed.
Click to expand it.
src/pulse.py
View file @
2df9f10e
import
time
from
typing
import
Final
from
.abstract
import
LEDController
THRESHOLD
:
Final
[
int
]
=
75
BLUE
:
Final
[
tuple
[
int
,
int
,
int
]
]
=
(
0
,
0
,
255
)
TIME
:
Final
[
int
]
=
1
THRESHOLD
:
int
=
75
BLUE
:
tuple
[
int
,
int
,
int
]
=
(
0
,
0
,
255
)
TIME
:
int
=
1
def
pulse
(
px
:
LEDController
,
color
:
tuple
[
int
,
int
,
int
],
duration
:
float
):
...
...
This diff is collapsed.
Click to expand it.
src/symbols.py
View file @
2df9f10e
from
typing
import
Final
MORSE_SYMBOL_TO_LETTER
:
Final
[
dict
[
str
,
str
]]
=
{
MORSE_SYMBOL_TO_LETTER
:
dict
[
str
,
str
]
=
{
".-"
:
"A"
,
"-..."
:
"B"
,
"-.-."
:
"C"
,
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help