mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-08 00:27:39 +03:00
Compare commits
8 Commits
2abe7d9231
...
e0f4b32e00
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0f4b32e00 | ||
|
|
78d6e5931c | ||
|
|
dac11c3fdd | ||
|
|
a9016c683b | ||
|
|
4b4af14bd0 | ||
|
|
78699e1a5c | ||
|
|
00fa98be30 | ||
|
|
fc94455e27 |
@ -102,13 +102,18 @@ After flashing the new features, it’s recommended to capture detailed logs fro
|
|||||||
First, make sure all required Python packages are installed:
|
First, make sure all required Python packages are installed:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
python3 -m pip install serial colorama matplotlib
|
python3 -m pip install pyserial colorama matplotlib
|
||||||
```
|
```
|
||||||
after that run the script:
|
after that run the script:
|
||||||
```sh
|
```sh
|
||||||
|
# For Linux
|
||||||
|
# This was tested on Debian and should work on most Linux systems.
|
||||||
python3 scripts/debugging_monitor.py
|
python3 scripts/debugging_monitor.py
|
||||||
|
|
||||||
|
# For macOS
|
||||||
|
python3 scripts/debugging_monitor.py /dev/cu.usbmodem2101
|
||||||
```
|
```
|
||||||
This was tested on Debian and should work on most Linux systems. Minor adjustments may be required for Windows or macOS.
|
Minor adjustments may be required for Windows.
|
||||||
|
|
||||||
## Internals
|
## Internals
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "Battery.h"
|
#include "Battery.h"
|
||||||
|
#include "CrossPointSettings.h"
|
||||||
#include "fontIds.h"
|
#include "fontIds.h"
|
||||||
|
|
||||||
void ScreenComponents::drawBattery(const GfxRenderer& renderer, const int left, const int top,
|
void ScreenComponents::drawBattery(const GfxRenderer& renderer, const int left, const int top,
|
||||||
@ -80,9 +81,24 @@ void ScreenComponents::drawBookProgressBar(const GfxRenderer& renderer, const si
|
|||||||
&vieweableMarginLeft);
|
&vieweableMarginLeft);
|
||||||
|
|
||||||
const int progressBarMaxWidth = renderer.getScreenWidth() - vieweableMarginLeft - vieweableMarginRight;
|
const int progressBarMaxWidth = renderer.getScreenWidth() - vieweableMarginLeft - vieweableMarginRight;
|
||||||
const int progressBarY = renderer.getScreenHeight() - vieweableMarginBottom - BOOK_PROGRESS_BAR_HEIGHT;
|
const int progressBarY = renderer.getScreenHeight() - vieweableMarginBottom - bookProgressBarHeight();
|
||||||
const int barWidth = progressBarMaxWidth * bookProgress / 100;
|
const int barWidth = progressBarMaxWidth * bookProgress / 100;
|
||||||
renderer.fillRect(vieweableMarginLeft, progressBarY, barWidth, BOOK_PROGRESS_BAR_HEIGHT, true);
|
renderer.fillRect(vieweableMarginLeft, progressBarY, barWidth, bookProgressBarHeight(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ScreenComponents::bookProgressBarHeight() {
|
||||||
|
const auto orientation = SETTINGS.orientation;
|
||||||
|
const bool isVertical = (orientation == CrossPointSettings::ORIENTATION::PORTRAIT ||
|
||||||
|
orientation == CrossPointSettings::ORIENTATION::INVERTED);
|
||||||
|
|
||||||
|
constexpr int bookProgressBarVerticalHeight = 4;
|
||||||
|
constexpr int bookProgressBarHorizontalHeight = 2;
|
||||||
|
|
||||||
|
if (isVertical) {
|
||||||
|
return bookProgressBarVerticalHeight;
|
||||||
|
} else {
|
||||||
|
return bookProgressBarHorizontalHeight;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int ScreenComponents::drawTabBar(const GfxRenderer& renderer, const int y, const std::vector<TabInfo>& tabs) {
|
int ScreenComponents::drawTabBar(const GfxRenderer& renderer, const int y, const std::vector<TabInfo>& tabs) {
|
||||||
|
|||||||
@ -13,7 +13,7 @@ struct TabInfo {
|
|||||||
|
|
||||||
class ScreenComponents {
|
class ScreenComponents {
|
||||||
public:
|
public:
|
||||||
static const int BOOK_PROGRESS_BAR_HEIGHT = 4;
|
static int bookProgressBarHeight();
|
||||||
|
|
||||||
struct PopupLayout {
|
struct PopupLayout {
|
||||||
int x;
|
int x;
|
||||||
|
|||||||
@ -520,7 +520,7 @@ void WifiSelectionActivity::renderNetworkList() const {
|
|||||||
const auto height = renderer.getLineHeight(UI_10_FONT_ID);
|
const auto height = renderer.getLineHeight(UI_10_FONT_ID);
|
||||||
const auto top = (pageHeight - height) / 2;
|
const auto top = (pageHeight - height) / 2;
|
||||||
renderer.drawCenteredText(UI_10_FONT_ID, top, "No networks found");
|
renderer.drawCenteredText(UI_10_FONT_ID, top, "No networks found");
|
||||||
renderer.drawCenteredText(SMALL_FONT_ID, top + height + 10, "Press OK to scan again");
|
renderer.drawCenteredText(SMALL_FONT_ID, top + height + 10, "Press Connect to scan again");
|
||||||
} else {
|
} else {
|
||||||
// Calculate how many networks we can display
|
// Calculate how many networks we can display
|
||||||
constexpr int startY = 60;
|
constexpr int startY = 60;
|
||||||
|
|||||||
@ -353,7 +353,7 @@ void EpubReaderActivity::renderScreen() {
|
|||||||
const bool showProgressBar = SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::FULL_WITH_PROGRESS_BAR ||
|
const bool showProgressBar = SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::FULL_WITH_PROGRESS_BAR ||
|
||||||
SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::ONLY_PROGRESS_BAR;
|
SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::ONLY_PROGRESS_BAR;
|
||||||
orientedMarginBottom += statusBarMargin - SETTINGS.screenMargin +
|
orientedMarginBottom += statusBarMargin - SETTINGS.screenMargin +
|
||||||
(showProgressBar ? (ScreenComponents::BOOK_PROGRESS_BAR_HEIGHT + progressBarMarginTop) : 0);
|
(showProgressBar ? (ScreenComponents::bookProgressBarHeight() + progressBarMarginTop) : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!section) {
|
if (!section) {
|
||||||
|
|||||||
@ -174,7 +174,7 @@ void TxtReaderActivity::initializeReader() {
|
|||||||
const bool showProgressBar = SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::FULL_WITH_PROGRESS_BAR ||
|
const bool showProgressBar = SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::FULL_WITH_PROGRESS_BAR ||
|
||||||
SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::ONLY_PROGRESS_BAR;
|
SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::ONLY_PROGRESS_BAR;
|
||||||
orientedMarginBottom += statusBarMargin - cachedScreenMargin +
|
orientedMarginBottom += statusBarMargin - cachedScreenMargin +
|
||||||
(showProgressBar ? (ScreenComponents::BOOK_PROGRESS_BAR_HEIGHT + progressBarMarginTop) : 0);
|
(showProgressBar ? (ScreenComponents::bookProgressBarHeight() + progressBarMarginTop) : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
viewportWidth = renderer.getScreenWidth() - orientedMarginLeft - orientedMarginRight;
|
viewportWidth = renderer.getScreenWidth() - orientedMarginLeft - orientedMarginRight;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user