예제 #1
0
Overhead::Overhead(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Overhead)
{
    ui->setupUi(this);
    setAttribute( Qt::WA_DeleteOnClose ); // очищать память из кучи
    Overhead::setupOH();
    ui->groupBoxEdit->hide();
    ui->groupBoxCell->hide();
    ui->groupBoxHackGet->hide();

    ui->pushOHPureDel->hide();
    ui->pushOHPrint->hide();

    // INITS
    connect(ui->pushOHEdit, SIGNAL(clicked()), this, SLOT(EditParam())); // управление редактированием
    connect(ui->pushEditApply, SIGNAL(clicked()), this, SLOT(apply())); // применение параметров редактирования
    connect(ui->pushOHDel, SIGNAL(clicked()), this, SLOT(del()));
    connect(ui->pushOHCell, SIGNAL(clicked()), this, SLOT(cell())); // хак для динамического изменения окна
    connect(ui->pushOHEditHack, SIGNAL(clicked()), this,  SLOT(edit_hack())); // тоже самое

    // коннекторы для удаления, редактирования, получения долга на товар
    connect(ui->pushOHReturnedYes, SIGNAL(clicked()), this, SLOT(isReturnedYes()));
    connect(ui->pushOHReturnedYes, SIGNAL(clicked()), this, SLOT(on_tableOH_clicked()));

    connect(ui->pushOHReturnedNo, SIGNAL(clicked()), this, SLOT(isReturnedNo()));
    connect(ui->pushOHReturnedNo, SIGNAL(clicked()), this, SLOT(on_tableOH_clicked()));

    connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(duty()));
    connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(on_tableOH_clicked()));

    // тест драйвера печати
    connect(ui->pushOHPrint, SIGNAL(clicked()), this, SLOT(printDialog()));
}
예제 #2
0
esp_err_t CLight::CLightChannel::duty(uint32_t duty_val, light_duty_mode_t duty_mode)
{
    if (check_init() != ESP_OK) {
        return ESP_FAIL;
    }
    light_handle_t light_handle = *mp_channel_handle;
    if (duty() == duty_val) {
        return ESP_OK;
    }
    esp_err_t ret = iot_light_duty_write(light_handle, m_ch_idx, duty_val, duty_mode);
    if (ret == ESP_OK) {
        m_duty = duty_val;
    }
    return ret;
}
예제 #3
0
void customPWM::setMotorDuty(unsigned long dy)
{
  motorDuty = dy;
  duty(_lowFreq + (dy/3));
}