huancun::huancun(QObject *parent) : QObject(parent) { U_A = "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko (bigrats web browser 0.4.7.9r)"; manager=new QNetworkAccessManager; jar =new QNetworkCookieJar; manager->setCookieJar(jar); reply=NULL; dlmg=new downloadmg; connect(dlmg,SIGNAL(stoped()),this,SIGNAL(stoped())); connect(dlmg,SIGNAL(finished()),this,SIGNAL(finished())); connect(dlmg,SIGNAL(onefinished(QString&)),this,SIGNAL(onefinished(QString&))); connect(dlmg,SIGNAL(progress(int)),this,SIGNAL(progress(int))); connect(dlmg,SIGNAL(error()),this,SIGNAL(error())); num=-1; goon=0;//永远是0 all=0; urls=""; playrf=""; name="noname"; format="normal";//默认优先清晰度 getfiletype=0; downloading=false; isstop=false; }
void ILoopController::stop() { if (loop_) { loop_->stop(); } stoped(); }
void Executer::cleanUp() { delete engine; engine = nullptr; delete wthread; wthread = nullptr; emit(stoped()); }
void World::init() { qsrand(QDateTime::currentDateTime().toTime_t()); b2Vec2 gravity(0.0, GRAVITY); b2world = new b2World(gravity); b2world->SetContinuousPhysics(true); b2world->SetAutoClearForces(true); contactListener = new ContactListener(this); b2world->SetContactListener(contactListener); track = new Track(b2world); car = new Car(algorithm, b2world); connect(car, SIGNAL(stoped()), SLOT(carStoped())); emit creteNewCar(); qsrand(car->getBody()->GetMass()); }
Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); //rtsp://:8554/192.168.66.108 //rtsp://video.fjtu.com.cn/vs01/flws/flws_01.rm //udp://:1234/192.168.16.228 //http://:8080/192.168.16.228 rtsp = new RtspThread(this); connect(ui->openBtn,SIGNAL(clicked(bool)),this,SLOT(showVideo())); connect(rtsp,SIGNAL(stoped()),this,SLOT(showVideo())); }
/** * Sets given model to edit widget. */ void LearningWidget::setModel(LearningConfigModel* model){ this->model = model; //disables certain parts of GUI ui->startBtn->setDisabled(true); ui->stopBtn->setDisabled(true); ui->resetButton->setDisabled(true); npw->setDisabled(true); //clears widget when NULL pointer given if(model == NULL){ ui->itemName->setText(QString()); setPlot(NULL); } //fills view with model data else{ //backups saved flag state bool saved = model->isSaved(); //sets model values to GUI items ui->itemName->setText(model->name()); ui->maxErrBox->setValue(model->maxErr()); ui->maxIterBox->setValue(model->maxIter()); ui->lrnCoefBox->setValue(model->lrnCoef()); ui->maxTimeBox->setValue(model->maxTime()); //generates and selects genNetworkList(); //sets plot to show in layout setPlot(model->plot()); //connects signals of model connect(model, SIGNAL(update(int,long,double)), this, SLOT(updateLearning(int,long,double)), Qt::UniqueConnection); connect(model, SIGNAL(stoped()), this, SLOT(learningStoped()), Qt::UniqueConnection); connect(model, SIGNAL(changed(ChangeType)), this, SLOT(modelChanged(ChangeType)), Qt::UniqueConnection); //restores saved flag state model->setSaved(saved); //fills or clears table when table view selected if(ui->tableBtn->isChecked()) fillTable(); } }
void Stopwatch::clientMessage(QJsonObject msg, int id) { if(msg.contains("start")){ start(false); emit started(); sendMsgButNotTo(msg,id,true); } if(msg.contains("stop")){ stop(false); emit stoped(); sendMsgButNotTo(msg,id,true); } if(msg.contains("resume")){ resume(false); emit resumed(); sendMsgButNotTo(msg,id,true); } if(msg.contains("set")){ setTo((long)msg.value("set").toDouble(),false); emit timeSet(); sendMsgButNotTo(msg,id,true); } }
void NotifyTimer::stop() { emit stoped(); QTimer::stop(); }
void BpAlgSt::start(){ Q_ASSERT(net != NULL); Q_ASSERT(data != NULL); emit started(); //value initialization running = true; actIter = 1; actTime = 0; timer.restart(); double sumErr = 0; for(int i = 0; i < data->minPatternCount(); i++){ output = net->layerOutput(data->inputVector(i)); sumErr += calcError(i); } actError = sumErr; emit update(0, actTime, actError); //learning main cycle while(running){ for(int i = 0; i < data->minPatternCount(); i++){ //feedforward output = net->layerOutput(data->inputVector(i)); //output layer delta calculation calcOutputDelta(i); //inner layer delta calculation calcInnerDelta(); //weight adjustment adjustWeight(); } //current time actTime = timer.elapsed(); //output error calculation double sumErr = 0; for(int i = 0; i < data->minPatternCount(); i++){ output = net->layerOutput(data->inputVector(i)); sumErr += calcError(i); } actError = sumErr; //emits update signal once per each update interval if(actIter % updateInterv == 0){ emit update(actIter, actTime, actError); } //stop conditions if(actTime >= stopTimeVal) break; if(actIter >= stopIter) break; if(actError <= stopErrorVal) break; actIter++; } //running flag to false running = false; //signal that tells that learning is finished emit stoped(); }