Move python resources into the common package
Reduces duplication of these binary files across multiple clients
@@ -0,0 +1,24 @@
|
||||
# Common Resources
|
||||
|
||||
This directory contains resources that are shared between multiple Python components in the PiSCSI project,
|
||||
such as fonts and splash screen images used by both the OLED monitor and the CtrlBoard interface.
|
||||
|
||||
## Credits
|
||||
|
||||
### DejaVuSansMono-Bold.ttf
|
||||
|
||||
* _DejaVu Sans Mono Bold_ TrueType font by the DejaVu fonts project
|
||||
* Source: https://dejavu-fonts.github.io
|
||||
* Distributed under DejaVu Fonts License (see DejaVu Fonts License.txt for full text)
|
||||
|
||||
### type_writer.ttf
|
||||
|
||||
* _Type Writer_ TrueType font by Mandy Smith (cutielou)
|
||||
* Source: https://fontstruct.com/fontstructions/show/212255/type_writer
|
||||
* Distributed under Creative Commons Attribution Share Alike license
|
||||
(http://creativecommons.org/licenses/by-sa/3.0/)
|
||||
|
||||
### splash_start_\*.bmp, splash_stop_\*.bmp
|
||||
|
||||
* Drawn by Daniel Markstedt <daniel@mindani.net>
|
||||
* Distributed under BSD 3-Clause by permission from author (see LICENSE in project root for full text)
|
||||
|
Before Width: | Height: | Size: 658 B After Width: | Height: | Size: 658 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 574 B After Width: | Height: | Size: 574 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -45,13 +45,3 @@ the raspberry pi model and enable transitions only for the following pi models:
|
||||
- Raspberry Pi Zero 2 models
|
||||
|
||||
The model detection can be overriden by adding a --transitions parameter to start.sh.
|
||||
|
||||
## Credits
|
||||
|
||||
### DejaVuSansMono-Bold.ttf
|
||||
* Source: https://dejavu-fonts.github.io
|
||||
* Distributed under DejaVu Fonts Lience (see DejaVu Fonts License.txt for full text)
|
||||
|
||||
### splash_start_\*.bmp, splash_stop_\*.bmp
|
||||
* Drawn by Daniel Markstedt
|
||||
* Distributed under BSD 3-Clause by permission from author (see LICENSE for full text)
|
||||
|
||||
|
Before Width: | Height: | Size: 574 B |
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -172,7 +172,7 @@ def main():
|
||||
menu_controller.add(CtrlBoardMenuBuilder.SCSI_ID_MENU)
|
||||
menu_controller.add(CtrlBoardMenuBuilder.ACTION_MENU)
|
||||
|
||||
menu_controller.show_splash_screen("resources/splash_start_64.bmp")
|
||||
menu_controller.show_splash_screen("../common/resources/splash_start_64.bmp")
|
||||
|
||||
menu_update_event_handler = CtrlBoardMenuUpdateEventHandler(
|
||||
menu_controller, sock_cmd=sock_cmd, piscsi_cmd=piscsi_cmd
|
||||
|
||||
@@ -14,7 +14,7 @@ class MenuRendererConfig:
|
||||
self.i2c_address = 0x3C
|
||||
self.i2c_port = 1
|
||||
self.display_type = "ssd1306" # luma-oled supported devices, "sh1106", "ssd1306", ...
|
||||
self.font_path = "resources/DejaVuSansMono-Bold.ttf"
|
||||
self.font_path = "../common/resources/DejaVuSansMono-Bold.ttf"
|
||||
self.font_size = 12
|
||||
self.row_selection_pixel_extension = 2
|
||||
self.scroll_behavior = "page" # "extend" or "page"
|
||||
|
||||
@@ -32,13 +32,3 @@ The start.sh script can also be run standalone, and will handle the venv creatio
|
||||
```
|
||||
$ ./start.sh --rotation=180 --height=64
|
||||
```
|
||||
|
||||
## Credits
|
||||
### type_writer.ttf
|
||||
* _Type Writer_ TrueType font by Mandy Smith
|
||||
* Source: https://www.dafont.com/type-writer.font
|
||||
* Distributed under BSD 3-Clause by permission from author (see LICENSE for full text)
|
||||
|
||||
### splash_start_\*.bmp, splash_stop_\*.bmp
|
||||
* Drawn by Daniel Markstedt
|
||||
* Distributed under BSD 3-Clause by permission from author (see LICENSE for full text)
|
||||
|
||||
@@ -131,8 +131,8 @@ print("Will update the OLED display every " + str(args.refresh_interval) + "ms (
|
||||
# Show a startup splash bitmap image before starting the main loop
|
||||
# Convert the image to mode '1' for 1-bit color (monochrome)
|
||||
# Make sure the splash bitmap image is in the same dir as this script
|
||||
IMAGE_STOP = Image.open(f"resources/splash_stop_{HEIGHT}.bmp").convert("1")
|
||||
IMAGE = Image.open(f"resources/splash_start_{HEIGHT}.bmp").convert("1")
|
||||
IMAGE_STOP = Image.open(f"../common/resources/splash_stop_{HEIGHT}.bmp").convert("1")
|
||||
IMAGE = Image.open(f"../common/resources/splash_start_{HEIGHT}.bmp").convert("1")
|
||||
OLED.image(IMAGE)
|
||||
OLED.show()
|
||||
|
||||
@@ -156,7 +156,7 @@ LINE_SPACING = 8
|
||||
# When using other fonts, you may need to adjust PADDING, FONT_SIZE,
|
||||
# LINE_SPACING, and LINES.
|
||||
# Some other nice fonts to try: http://www.dafont.com/bitmap.php
|
||||
FONT = ImageFont.truetype("resources/type_writer.ttf", FONT_SIZE)
|
||||
FONT = ImageFont.truetype("../common/resources/type_writer.ttf", FONT_SIZE)
|
||||
|
||||
REMOVABLE_DEVICE_TYPES = piscsi_cmd.get_removable_device_types()
|
||||
PERIPHERAL_DEVICE_TYPES = piscsi_cmd.get_peripheral_device_types()
|
||||
|
||||