85 lines
1.5 KiB
C++
85 lines
1.5 KiB
C++
#include "Screen/IntensityScreen.h"
|
|
#include "Screen/SetTimeScreen.h"
|
|
#include "Screen/StartScreen.h"
|
|
#include "ExposureTimer.h"
|
|
#include "Buzzer.h"
|
|
#include "Config.h"
|
|
|
|
|
|
void IntensityScreen::printValue()
|
|
{
|
|
LiquidCrystal* display = getDisplay();
|
|
display->setCursor(0, 1);
|
|
|
|
String intensity = "100%";
|
|
uint8_t offset = (LCDWidth - intensity.length()) / 2;
|
|
|
|
for (uint8_t space = 0; space < offset; space++)
|
|
display->print(' ');
|
|
|
|
display->print(intensity);
|
|
offset += intensity.length();
|
|
|
|
if (getEditMode())
|
|
{
|
|
display->write(LCDCharUpDown);
|
|
offset++;
|
|
}
|
|
|
|
for (uint8_t space = offset; space < LCDWidth; space++)
|
|
display->print(' ');
|
|
}
|
|
|
|
|
|
void IntensityScreen::gotoPrevious()
|
|
{
|
|
buzzSelect();
|
|
getScreenManager()->show<SetTimeScreen>();
|
|
}
|
|
|
|
|
|
void IntensityScreen::gotoNext()
|
|
{
|
|
buzzSelect();
|
|
getScreenManager()->show<StartScreen>();
|
|
}
|
|
|
|
|
|
void IntensityScreen::onHide()
|
|
{
|
|
}
|
|
|
|
|
|
void IntensityScreen::onButton()
|
|
{
|
|
buzzSelect();
|
|
setEditMode(!getEditMode());
|
|
printValue();
|
|
}
|
|
|
|
|
|
void IntensityScreen::onEncoder(long lastPosition, long newPosition)
|
|
{
|
|
if (getEditMode())
|
|
{
|
|
buzzSelect();
|
|
|
|
/*
|
|
if (newPosition > lastPosition)
|
|
ExposureTime += ExposureTime >= LargeStepTreshold ? LargeStep : SmallStep;
|
|
else if (ExposureTime > 0)
|
|
ExposureTime -= ExposureTime > LargeStepTreshold ? LargeStep : SmallStep;
|
|
*/
|
|
|
|
printValue();
|
|
}
|
|
else
|
|
BaseMenuScreen::onEncoder(lastPosition, newPosition);
|
|
}
|
|
|
|
|
|
void IntensityScreen::onTick()
|
|
{
|
|
}
|
|
|