Start of notch control + added raspberry pi CI

pull/567/head
AlexandreRouma 2021-12-26 00:22:16 +01:00
rodzic 5a19829068
commit b141c4b2a5
3 zmienionych plików z 38 dodań i 18 usunięć

Wyświetl plik

@ -276,27 +276,21 @@ jobs:
name: sdrpp_ubuntu_impish_amd64
path: ${{runner.workspace}}/sdrpp_debian_amd64.deb
# build_raspios_bullseye:
# runs-on: ubuntu-latest
build_raspios_armhf:
runs-on: raspberrypi
env:
DEBIAN_FRONTEND: 'noninteractive'
# steps:
# - uses: actions/checkout@v2
steps:
- uses: actions/checkout@v2
# - name: Create Docker Image
# run: cd $GITHUB_WORKSPACE/docker_builds/raspios_bullseye && docker build . --tag sdrpp_build
- name: Prepare CMake
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON
# - name: Run Container
# run: docker run --privileged --name build -v $GITHUB_WORKSPACE:/root/SDRPlusPlus --env BUILD_NO="-$GITHUB_RUN_NUMBER" sdrpp_build /root/do_build.sh
# - name: Recover Deb Archive
# working-directory: ${{runner.workspace}}
# run: docker cp build:/root/SDRPlusPlus/sdrpp_raspios_arm32.deb ./
# - name: Save Deb Archive
# uses: actions/upload-artifact@v2
# with:
# name: sdrpp_raspios_bullseye_arm32
# path: ${{runner.workspace}}/sdrpp_raspios_arm32.deb
- name: Build
working-directory: ${{runner.workspace}}/build
run: make VERBOSE=1 -j2
create_full_archive:
# needs: ['build_windows', 'build_macos', 'build_debian_buster', 'build_debian_bullseye', 'build_debian_sid', 'build_ubuntu_bionic', 'build_ubuntu_focal', 'build_ubuntu_groovy', 'build_ubuntu_hirsute', 'build_ubuntu_impish', 'build_raspios_bullseye']

Wyświetl plik

@ -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; }

Wyświetl plik

@ -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 {