Skip to content

Commit

Permalink
Добавлено время для всех наших сигналов
Browse files Browse the repository at this point in the history
  • Loading branch information
Sasha7b9Work committed Feb 11, 2025
1 parent 3abff4a commit 9e25bf6
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 7 deletions.
1 change: 1 addition & 0 deletions doc/План.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- Исправить ввод значений в поле ввода

+ Задействовать пикалку
+ Подлючить флешку.
+ Оживить дисплей, чтобы на нём что-то двигалось при работе.
+ Выводить сообщение о том, что кнопки заблокированы (когда идёт тест).
Expand Down
21 changes: 20 additions & 1 deletion sources/Panel/src/Connector/Device/Value_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ void DrawStruct::PressKey(int _key)
index++;
}
}
else if (key == Key::Esc)
{
symbols[0] = '\0';
index = 0;
}
else if (key >= Key::_1 && key <= Key::_0)
{
if ((key == Key::_0 && index == 0) ||
Expand All @@ -143,11 +148,25 @@ void DrawStruct::SetSymbolToCurrentPos(char symbol)
{
if (index < SIZE_BUFER - 1)
{
symbols[index++] = symbol;
if (index >= NumSymbols())
{
symbols[index++] = symbol;
symbols[index] = '\0';
}
else
{
symbols[index++] = symbol;
}
}
}


int DrawStruct::NumSymbols() const
{
return (int)std::strlen(symbols);
}


bool DrawStruct::ConsistDot() const
{
for (uint i = 0; i < std::strlen(symbols); i++)
Expand Down
2 changes: 1 addition & 1 deletion sources/Panel/src/Menu/Pages/PageSignal1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace PageSignal1
{
char buffer[128];

Text("%s Äëèò: %s Ri: %s", VoltageMode::TextValue(), Duration(param_t1, param_N).ToStringValue(buffer), VoltageMode::Is12() ? "10 Îì" : "50 Îì").Write(
Text("%s Ri: %s Äëèò: %s", VoltageMode::TextValue(), VoltageMode::Is12() ? "10 Îì" : "50 Îì", Duration(param_t1, param_N).ToStringValue(buffer)).Write(
Display::xConstParameters, Display::yConstParameters, Color::WHITE
);
}
Expand Down
4 changes: 3 additions & 1 deletion sources/Panel/src/Menu/Pages/PageSignal2a.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ namespace PageSignal2a

static void AdditionDraw()
{
Text("%s Ri: 2 Îì", VoltageMode::TextValue()).Write(
char buffer[128];

Text("%s Ri: 2 Îì Äëèò: %s", VoltageMode::TextValue(), Duration(param_t1, param_N).ToStringValue(buffer)).Write(
Display::xConstParameters, Display::yConstParameters, Color::WHITE
);
}
Expand Down
4 changes: 3 additions & 1 deletion sources/Panel/src/Menu/Pages/PageSignal3a.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ namespace PageSignal3a

static void AdditionDraw()
{
Text("%s Ri: 50 Îì", VoltageMode::TextValue()).Write(
char buffer[128];

Text("%s Ri: 50 Îì Äëèò: %s", VoltageMode::TextValue(), Duration(1.0f, param_N).ToStringValue(buffer)).Write(
Display::xConstParameters, Display::yConstParameters, Color::WHITE
);
}
Expand Down
4 changes: 3 additions & 1 deletion sources/Panel/src/Menu/Pages/PageSignal3b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ namespace PageSignal3b

static void AdditionDraw()
{
Text("%s Ri: 50 Îì", VoltageMode::TextValue()).Write(
char buffer[128];

Text("%s Ri: 50 Îì Äëèò: %s", VoltageMode::TextValue(), Duration(1.0f, param_N).ToStringValue(buffer)).Write(
Display::xConstParameters, Display::yConstParameters, Color::WHITE
);
}
Expand Down
8 changes: 8 additions & 0 deletions sources/Panel/src/Settings/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,14 @@ Duration::Duration(const Parameter &period, const Parameter &N)
}


Duration::Duration(float periodSec, const Parameter &N)
{
Value val_N = N.GetValue();

timeMS = (uint)(periodSec * 1000.f * (float)val_N.ToInt());
}


pchar Duration::ToStringValue(char buffer[128]) const
{
if (RemainingTimeCounter::InProcess())
Expand Down
1 change: 1 addition & 0 deletions sources/Panel/src/Settings/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
struct Duration
{
Duration(const Parameter &period, const Parameter &N);
Duration(float periodSec, const Parameter &N);

pchar ToStringValue(char buffer[128]) const;

Expand Down
4 changes: 2 additions & 2 deletions sources/Panel/src/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#pragma once
#include "no-warnings.h"

#define VERSION_BUILD 31
#define VERSION_BUILD 32

#define DATE_BUILD "2025-02-11 10:48:41"
#define DATE_BUILD "2025-02-11 11:26:30"

#include <stdint.h>

Expand Down
1 change: 1 addition & 0 deletions sources/common/Connector/Device/Value_.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ struct DrawStruct
private:
bool ConsistDot() const;
void SetSymbolToCurrentPos(char);
int NumSymbols() const;
Parameter *parameter;
int index; // Òåêóùèé ðàçðÿä. 0 - "-", åñëè åñòü
static const int SIZE_BUFER = 10; // Ìàêñèìàëüíîå êîëè÷åñòâî õðàíèìõ ðàçðÿäîâ âìåñòå ñ çàâåðøàþùèì íóë¸ì
Expand Down

0 comments on commit 9e25bf6

Please sign in to comment.