mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-25 20:07:51 +02:00
Start of notch control + added raspberry pi CI
This commit is contained in:
@ -1144,11 +1144,22 @@ namespace ImGui {
|
||||
setOffset(generalOffset);
|
||||
}
|
||||
|
||||
void WaterfallVFO::setNotchOffset(double offset) {
|
||||
notchOffset = offset;
|
||||
redrawRequired = true;
|
||||
}
|
||||
|
||||
void WaterfallVFO::setNotchVisible(bool visible) {
|
||||
notchVisible = visible;
|
||||
redrawRequired = true;
|
||||
}
|
||||
|
||||
void WaterfallVFO::updateDrawingVars(double viewBandwidth, float dataWidth, double viewOffset, ImVec2 widgetPos, int fftHeight) {
|
||||
double width = (bandwidth / viewBandwidth) * (double)dataWidth;
|
||||
int center = roundf((((centerOffset - viewOffset) / (viewBandwidth / 2.0)) + 1.0) * ((double)dataWidth / 2.0));
|
||||
int left = roundf((((lowerOffset - viewOffset) / (viewBandwidth / 2.0)) + 1.0) * ((double)dataWidth / 2.0));
|
||||
int right = roundf((((upperOffset - viewOffset) / (viewBandwidth / 2.0)) + 1.0) * ((double)dataWidth / 2.0));
|
||||
int notch = roundf((((notchOffset + centerOffset - viewOffset) / (viewBandwidth / 2.0)) + 1.0) * ((double)dataWidth / 2.0));
|
||||
|
||||
// Check weather the line is visible
|
||||
if (left >= 0 && left < dataWidth && reference == REF_LOWER) {
|
||||
@ -1192,6 +1203,9 @@ namespace ImGui {
|
||||
lbwSelMax = ImVec2(rectMin.x + 2, rectMax.y);
|
||||
rbwSelMin = ImVec2(rectMax.x - 2, rectMin.y);
|
||||
rbwSelMax = ImVec2(rectMax.x + 2, rectMax.y);
|
||||
|
||||
notchMin = ImVec2(widgetPos.x + 50 + notch - 2, widgetPos.y + 9);
|
||||
notchMax = ImVec2(widgetPos.x + 50 + notch + 2, widgetPos.y + fftHeight + 9);
|
||||
}
|
||||
|
||||
void WaterfallVFO::draw(ImGuiWindow* window, bool selected) {
|
||||
@ -1200,6 +1214,10 @@ namespace ImGui {
|
||||
window->DrawList->AddLine(lineMin, lineMax, selected ? IM_COL32(255, 0, 0, 255) : IM_COL32(255, 255, 0, 255));
|
||||
}
|
||||
|
||||
if (notchVisible) {
|
||||
window->DrawList->AddRectFilled(notchMin, notchMax, IM_COL32(255, 0, 0, 127));
|
||||
}
|
||||
|
||||
if (!gui::mainWindow.lockWaterfallControls && !gui::waterfall.inputHandled) {
|
||||
ImVec2 mousePos = ImGui::GetMousePos();
|
||||
if (rectMax.x - rectMin.x < 10) { return; }
|
||||
|
@ -17,6 +17,8 @@ namespace ImGui {
|
||||
void setBandwidth(double bw);
|
||||
void setReference(int ref);
|
||||
void setSnapInterval(double interval);
|
||||
void setNotchOffset(double offset);
|
||||
void setNotchVisible(bool visible);
|
||||
void updateDrawingVars(double viewBandwidth, float dataWidth, double viewOffset, ImVec2 widgetPos, int fftHeight); // NOTE: Datawidth double???
|
||||
void draw(ImGuiWindow* window, bool selected);
|
||||
|
||||
@ -35,6 +37,9 @@ namespace ImGui {
|
||||
double snapInterval = 5000;
|
||||
int reference = REF_CENTER;
|
||||
|
||||
double notchOffset = 0;
|
||||
bool notchVisible = false;
|
||||
|
||||
bool leftClamped;
|
||||
bool rightClamped;
|
||||
|
||||
@ -54,6 +59,8 @@ namespace ImGui {
|
||||
ImVec2 wfLbwSelMax;
|
||||
ImVec2 wfRbwSelMin;
|
||||
ImVec2 wfRbwSelMax;
|
||||
ImVec2 notchMin;
|
||||
ImVec2 notchMax;
|
||||
|
||||
bool centerOffsetChanged = false;
|
||||
bool lowerOffsetChanged = false;
|
||||
@ -69,6 +76,7 @@ namespace ImGui {
|
||||
ImU32 color = IM_COL32(255, 255, 255, 50);
|
||||
|
||||
Event<double> onUserChangedBandwidth;
|
||||
Event<double> onUserChangedNotch;
|
||||
};
|
||||
|
||||
class WaterFall {
|
||||
|
Reference in New Issue
Block a user