Exemplo n.º 1
0
vfo::vfo(QWidget *parent) :
    QFrame(parent),
    ui(new Ui::vfo)
{
    ui->setupUi(this);
    vfohotstep = 100;
    curstep = 2;
    setStepMark();
    selectedVFO = 'A';
    ptt = false;

//  setBandButton group ID numbers;
    ui->btnGrpBand->setId(ui->bandBtn_00, 0); // 160
    ui->btnGrpBand->setId(ui->bandBtn_01, 1); // 80
    ui->btnGrpBand->setId(ui->bandBtn_02, 2);
    ui->btnGrpBand->setId(ui->bandBtn_03, 3);
    ui->btnGrpBand->setId(ui->bandBtn_04, 4);
    ui->btnGrpBand->setId(ui->bandBtn_05, 5);
    ui->btnGrpBand->setId(ui->bandBtn_06, 6); // etc.
    ui->btnGrpBand->setId(ui->bandBtn_07, 7);
    ui->btnGrpBand->setId(ui->bandBtn_08, 8);
    ui->btnGrpBand->setId(ui->bandBtn_09, 9);
    ui->btnGrpBand->setId(ui->bandBtn_10, 10); // 6
    ui->btnGrpBand->setId(ui->bandBtn_11, 11); // GEN
    ui->btnGrpBand->setId(ui->bandBtn_12, 12); // WWV
    connect(ui->btnGrpBand, SIGNAL(buttonClicked(int)),
                this, SLOT(btnGrpClicked(int)));
    connect(ui->hSlider, SIGNAL(valueChanged(int)),
                this, SLOT(processRIT(int)));
}
Exemplo n.º 2
0
void vfo::vfohotkey(QString cmd)
{
    if (cmd.compare("FreqDown") == 0){
        emit frequencyMoved(vfohotstep, -1);
        //qDebug() <<"cmd=" <<cmd;
        return;
    }
    if (cmd.compare("FreqUp") == 0){
        emit frequencyMoved(vfohotstep, 1);
        //qDebug() <<"cmd=" <<cmd <<"vfohotstep" <<vfohotstep;
        return;
    }
    static const int mult[7] = {1,10,100,1000,10000,100000,1000000};
    if (cmd.compare("StepUp") == 0  && curstep <6){
        //qDebug() <<"Step Up old =" <<vfohotstep << " curstep" << curstep;
        curstep++;
        vfohotstep = mult[curstep];
        //qDebug() <<"new =" <<vfohotstep;
        setStepMark();
        return;
    }
    if (cmd.compare("StepUp") == 0  && curstep == 6){
        //qDebug() <<"Step Up Wrap old =" <<vfohotstep << " curstep" << curstep;
        curstep = 0;
        vfohotstep = mult[curstep];
        //qDebug() <<"new =" <<vfohotstep;
        setStepMark();
        return;
    }


    if (cmd.compare("StepDown") == 0  && curstep >0){
        //qDebug() <<"old =" <<vfohotstep;
        curstep--;
        vfohotstep = mult[curstep];
        //qDebug() <<"new =" <<vfohotstep;
        setStepMark();
        return;
    }
    return;

}
Exemplo n.º 3
0
vfo::vfo(QWidget *parent) :
    QFrame(parent),
    ui(new Ui::vfo)
{
    ui->setupUi(this);
    vfohotstep = 100;
    curstep = 2;
    setStepMark();
    selectedVFO = 'A';
    ptt = false;

//  setBandButton group ID numbers;
    ui->btnGrpBand->setId(ui->bandBtn_00, 0); // 160
    ui->btnGrpBand->setId(ui->bandBtn_01, 1); // 80
    ui->btnGrpBand->setId(ui->bandBtn_02, 2);
    ui->btnGrpBand->setId(ui->bandBtn_03, 3);
    ui->btnGrpBand->setId(ui->bandBtn_04, 4);
    ui->btnGrpBand->setId(ui->bandBtn_05, 5);
    ui->btnGrpBand->setId(ui->bandBtn_06, 6); // etc.
    ui->btnGrpBand->setId(ui->bandBtn_07, 7);
    ui->btnGrpBand->setId(ui->bandBtn_08, 8);
    ui->btnGrpBand->setId(ui->bandBtn_09, 9);
    ui->btnGrpBand->setId(ui->bandBtn_10, 10); // 6
    ui->btnGrpBand->setId(ui->bandBtn_11, 11); // GEN
    ui->btnGrpBand->setId(ui->bandBtn_12, 12); // WWV
    connect(ui->btnGrpBand, SIGNAL(buttonClicked(int)),
                this, SLOT(btnGrpClicked(int)));
    connect(ui->hSlider, SIGNAL(valueChanged(int)),
                this, SLOT(processRIT(int)));

// Powermate related stuff
#if defined(LINUX)
    PmInput *input = new PmInput();
    connect(input, SIGNAL(pressed()), this, SLOT(press()));
    connect(input, SIGNAL(released()), this, SLOT(release()));
    connect(input, SIGNAL(rotated(int)), this, SLOT(increase(int)));
    input->start();
#endif

}