Frequency display and control added

freq9

You can tune by scrolling the mouse wheel up and down on the digits showing the frequency. The S meter is now a bar graph.

bool DrawingArea::on_scroll_event(GdkEventScroll *event)
{
    double x, dy;
    x  = event->x;
    dy = event->delta_y;
    int digit_pos;
    digit_pos = (x-10.0) / 31.0;

    int frequency_delta = 0.0;
    if(digit_pos >= 0 && digit_pos <=4) {
      frequency_delta = pow(10.0, 7-digit_pos);
    } else if(digit_pos >=6 && digit_pos <=8) {
        frequency_delta = pow(10.0, 8-digit_pos);
    }

    if(dy>0) {
        frequency_delta = -frequency_delta;
    }

    int ifreq_in_hz_new = ifreq_in_hz + frequency_delta;
    if(ifreq_in_hz_new > 0 && ifreq_in_hz_new < 60000000) {
        ifreq_in_hz = ifreq_in_hz_new;
    }
    set_freq (ifreq_in_hz);

    return true;
}

https://github.com/jh1ood/sprigmm/blob/develop/drawingarea.cpp

An analogue S meter added

smeter

Do not blame me for the poor design. At least it tells you that the connection to the rig is alive.

DrawingArea::DrawingArea ()
{
  Glib::signal_timeout().connect( sigc::mem_fun(*this, &DrawingArea::on_timeout), 250 );
  #ifndef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
  //Connect the signal handler if it isn't already a virtual method override:
  signal_draw().connect(sigc::mem_fun(*this, &DrawingArea::on_draw), false);
  #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
}

https://github.com/jh1ood/sprigmm/blob/develop/drawingarea.cpp