Exemplo n.º 1
0
void TrainingSet::setPattern(int index, const vector<double> &inputs, const vector<double> &targets)
{
	vector<double>
			prevInputs = this->inputs[index],
			prevTargets = this->targets[index];
	if(prevInputs != inputs || prevTargets != targets){
		this->inputs[index] = inputs;
		this->targets[index] = targets;

		emit patternChanged(index, inputs, targets);
		emit patternChanged(index, prevInputs, inputs, prevTargets, targets);
	}
}
Exemplo n.º 2
0
void ShotgunField::setPattern(const QString p)
{
    if (m_pattern != p) {
        m_pattern = p;
        emit patternChanged(m_pattern);
    }
}
void ResourceFilter::setPattern(QString arg)
{
    if (m_pattern == arg)
        return;

    m_pattern = arg;
    emit patternChanged(arg);
}
Exemplo n.º 4
0
void RegExpRole::setPattern(const QString& pattern)
{
    if (m_regularExpression.pattern() == pattern)
        return;

    Q_EMIT namesAboutToBeChanged();
    m_regularExpression.setPattern(pattern);
    invalidate();
    Q_EMIT patternChanged();
    Q_EMIT namesChanged();
}
Exemplo n.º 5
0
/**
 * Called when the pattern has changed. This method 
 * sets the current pattern to the value chosen.
 */
void QG_PatternBox::slotPatternChanged(int index) {

    RS_DEBUG->print("QG_PatternBox::slotPatternChanged %d\n", index);

    currentPattern = RS_PATTERNLIST->requestPattern(currentText());

    if (currentPattern!=NULL) {
        RS_DEBUG->print("Current pattern is (%d): %s\n",
                        index, currentPattern->getFileName().toLatin1().data());
    }

    emit patternChanged(currentPattern);
}
Exemplo n.º 6
0
void MainWindow::setup(){
    cntnumber = 1;
    QWidget *widget = new QWidget(this);
    QHBoxLayout *layout = new QHBoxLayout(widget);
    layout->addStretch(20);
    layout->addWidget(formheadl);
    layout->addStretch(20);
#if DUAL_SYSTEM
    layout->addWidget(formheadr);
    layout->addStretch(20);
    widget->setFixedSize(780,280);
    widget->move(10,80);
#else
    widget->setFixedSize(460,280);
    widget->move(170,80);
#endif

    connect(&hmiData,SIGNAL(time1sOuted()),this,SLOT(Timeout1s()));
    connect(&hmiData,SIGNAL(clothFinishCountChanged(int)),label_FinishCount,SLOT(setNum(int)));
    connect(&hmiData,SIGNAL(clothSetCountChanged(int)),label_setCount,SLOT(setNum(int)));
    connect(&patternData,SIGNAL(patternChanged(QString,QString)), SLOT(onpatternChange(QString,QString)));
    connect(&hmiData,SIGNAL(hmi_loopend(int)),label_loopEnd,SLOT(setNum(int)));
    connect(&hmiData,SIGNAL(hmi_loopleft(int)),label_loopLeft,SLOT(setNum(int)));
    connect(&hmiData,SIGNAL(hmi_loopStart(int)),label_loopStart,SLOT(setNum(int)));
    connect(&hmiData,SIGNAL(hmi_loopend(int)),label_loopEnd,SLOT(setNum(int)));
    connect(&hmiData,SIGNAL(hmi_loopTatal(int)),label_loopCount,SLOT(setNum(int)));
    connect(&hmiData,SIGNAL(hmi_cntNumber(unsigned short)),SLOT(runPatternRowChange(unsigned short)));
    connect(&hmiData,SIGNAL(hmi_jitouxiangduizhengshu(int)),label_zwz,SLOT(setNum(int)));
    connect(&hmiData,SIGNAL(xtGuilingError()),SLOT(onXtGuilingError()));
    connect(&hmiData,SIGNAL(xtRunOrGuiling(bool)),qMdPushButton_5,SLOT(setChecked(bool)));
    connect(&hmiData,SIGNAL(lineLock(bool)),qMdPushButton_6,SLOT(setChecked(bool)));
    connect(&hmiData,SIGNAL(speedLimit(bool)),qMdPushButton_8,SLOT(setChecked(bool)));
    connect(&hmiData,SIGNAL(stopPerOne(bool)),qMdPushButton_9,SLOT(setChecked(bool)));
    connect(&hmiData,SIGNAL(alarmLimit(bool)),qMdPushButton_10,SLOT(setChecked(bool)));
    connect(&hmiData,SIGNAL(shazuiUp(bool)),qMdPushButton_11,SLOT(setChecked(bool)));
    connect(&hmiData,SIGNAL(runing(bool)),SLOT(onHmidataRuning(bool)));
    connect(&hmiData,SIGNAL(powerDown()),SLOT(onPowerDown()));
    connect(&paramaData,SIGNAL(changed()),SLOT(onParamChanded()));
    azllist<<tr("空")<<tr("翻针")<<tr("编织");
    hzllist<<tr("空")<<tr("吊目")<<tr("接针")<<tr("吊目2")<<tr("编松2");
#if DUAL_SYSTEM
    connect(&hmiData,SIGNAL(sigDankouLock(bool)),SLOT(onDankouLock(bool)));
    label_dankoulock->setText(hmiData.dankouLock()?tr("锁定"):tr("不锁定"));
#else
    frame_dankoulock->hide();
#endif

}
Exemplo n.º 7
0
Autoreplace_Config::Autoreplace_Config(QWidget* parent, const char* name)
 : QWidget(parent)
{
  setObjectName(QString::fromLatin1(name));
  setupUi(this);

  // reset flag to defined state (used to block signals when just selecting a new item)
  m_newItemSelected=false;
  //Check if the regexp editor is installed
// it does not make sense to port / enable this since KRegExpEditor is in a very bad shape. just keep this
// code here because it will probably help at a later point to port it when KRegExpEditor is again usable.
// 2009-02-06, uwolfer
  bool installed = false;//( KServiceTypeTrader::createInstanceFromQuery<QDialog>( "KRegExpEditor/KRegExpEditor", QString(), this )!= 0 );
  regExpEditorButton->setVisible(false);

  if(installed)
  {
      regExpEditorButton->setEnabled(true);
      regExpEditorButton->setStatusTip(i18n("Click to run Regular Expression Editor (KRegExpEditor)"));
  }
  else
  {
      regExpEditorButton->setEnabled(false);
      regExpEditorButton->setStatusTip(i18n("The Regular Expression Editor (KRegExpEditor) is not installed"));
  }
  // populate combobox
  directionCombo->insertItem(DIRECTION_OUTPUT, i18n("Outgoing"));
  directionCombo->insertItem(DIRECTION_INPUT, i18n("Incoming"));
  directionCombo->insertItem(DIRECTION_BOTH, i18n("Both"));

  // populate listview
  loadSettings();

  connect(patternListView, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(entrySelected(QTreeWidgetItem*)));

  connect(directionCombo, SIGNAL(activated(int)), this, SLOT(directionChanged(int)));

  connect(patternInput, SIGNAL(textChanged(QString)), this, SLOT(patternChanged(QString)));
  connect(regExpEditorButton, SIGNAL(clicked()), this, SLOT(showRegExpEditor()));
  connect(replacementInput, SIGNAL(textChanged(QString)), this, SLOT(replacementChanged(QString)));

  connect(newButton, SIGNAL(clicked()), this, SLOT(addEntry()));
  connect(removeButton, SIGNAL(clicked()), this, SLOT(removeEntry()));
}
void QtPatternSelectorWidget::slotCurrentIndexChanged(int idx) {
    emit patternChanged(_brushes[idx]);
}
Exemplo n.º 9
0
void QuickFindMux::notifyPatternChanged()
{
    emit patternChanged( pattern_->getPattern() );
}
Exemplo n.º 10
0
Md::Result sysInit(){
    QObject::connect(&paramaData,SIGNAL(changed()),&hmiData,SLOT(onParamChanged()));
    QObject::connect(&patternData,SIGNAL(patternChanged(QString,QString)),
            &hmiData,SLOT(on_patternChange(QString,QString)));
    int commResult;
    QMdSplashScreen Splash(QPixmap("resource/image/matlab.png"));
    QMdSplashScreen *splash = &Splash;
    splash->show();
    hmiData.loadParam("./sysconfig.conf");
    INFORMLOG(QObject::tr("开机,系统初始化开始"));
    sysLog.setFile(hmiData.sysLogFilePath);
    QPattern::Result r;
    r = patternData.setFile(hmiData.patternPath);
    if(QPattern::Ok!=r){
        if(r==QPattern::NoCntFile){
            splash->showMessage(QObject::tr("载入花型:------------缺少CNT文件"),Qt::AlignBottom);
        }else if(r==QPattern::NoPatFile){
            splash->showMessage(QObject::tr("载入花型:------------缺少PAT文件"),Qt::AlignBottom);
        }else{
            splash->showMessage(QObject::tr("载入花型:------------花型文件错误"),Qt::AlignBottom);
        }
        sleep(3);
        return Md::NotPatCntSaz;
    }
    if(!paramaData.setFile(hmiData.spaFilePath))
          splash->showMessage(QObject::tr("参数载入:------------参数载入错误"),Qt::AlignBottom);

    ////start communication//////////////
    qComm.start();
    /////poll valible rom////////////////
    if(!hmiData.mainboardRomAvailable()){
        splash->showMessage(QObject::tr("检查主板固件:----------主控板无固件"),Qt::AlignBottom);
        sleep(3);
        return Md::MainBoardNoRom;
    }
    /////test comm
    if(!qComm.isAvailable()){
        splash->showMessage(QObject::tr("测试通信:------------通信异常"),Qt::AlignBottom);
        sleep(3);
        return Md::CommError;
    }

    //////togle system/////////////////
    commResult = qComm.TogSysStat(QHMIData::SysInParam);
    if(commResult == Md::CommError){
        splash->showMessage(QObject::tr("通讯错误,花型未成功下载"),Qt::AlignBottom);
        sleep(3);
        return Md::CommError;
    }
    if(patternData.isPatternAvailable()){
        ////download wrk spa
        splash->showMessage(QObject::tr("正在下载参数"),Qt::AlignBottom);
        commResult = paramaData.sendParama();
        if(commResult == Md::CommError){
            splash->showMessage(QObject::tr("通讯错误,参数未成功下载"),Qt::AlignBottom);
            return Md::CommError;
        }
        ///download szkb///////////////////////////////////
        commResult = patternData.sendShazuiKb();
        if(commResult == Md::CommError){
            splash->showMessage(QObject::tr("下载SAZ文件,通讯错误"),Qt::AlignBottom);
            sleep(3);
            return Md::CommError;
        }


        ///////下载cnt文件///////////////////////////////////
        QObject::connect(&patternData,SIGNAL(patternSendPercent(int)),splash,SLOT(showPatternSendMessage(int)),Qt::QueuedConnection);
        commResult = patternData.sendPattern();
        if(commResult == Md::CommError){
            splash->showMessage(QObject::tr("下载CNT文件,通讯错误"),Qt::AlignBottom);
            sleep(3);
            return Md::CommError;
        }
        QObject::disconnect(&patternData,SIGNAL(patternSendPercent(int)),splash,SLOT(showPatternSendMessage(int)));
        //等待下位机响应/////////////////////////////////
        int i=0;
        for(i=0;i<3;i++) {
            commResult = qComm.TogSysStat(QHMIData::SysInParam);
            if(commResult==Md::Ok)
                break;
        }
        if(3==i){
            splash->showMessage(QObject::tr("下载花型后主机未成功响应"),Qt::AlignBottom);
            sleep(3);
            return Md::CommError;
        }
    }