{switch (chet_dat) { case 1: { QString file_name1 = "datchic1.txt"; test * t = new test(); t->full_test(file_name1,nms,ftHandle1,serial1_1, tn1_1,tk1_1,Tyd1_1); t->start(); break; } case 2: { QString file_name2 = "datchic2.txt"; test * t2 = new test(); t2->full_test(file_name2,nms,ftHandle1,serial2, tn2,tk2,Tyd2); t2->start(); break; }........
void test::full_test( QString file_name,QString nms,FT_HANDLE ftHandle1,QString serial,double tna,double tk,int time_okonch ){ file_name_=file_name; nms_=nms; ftHandle1_=ftHandle1; serial_=serial; tna_=tna; tk_=tk; time_okonch_=time_okonch;}
void test::run() { bool fl=false; connect(this, SIGNAL(signal_win(QString)),SLOT(mysignal_win(QString))); connect(this, SIGNAL(signal_fail1(QString)),SLOT(mysignal_fail1(QString))); connect(this, SIGNAL(signal_fail2(QString)),SLOT(mysignal_fail2(QString))); fl=test::tempiratura_datchika(tna_,file_name_,nms_,ftHandle1_,serial_); if (fl == true) { int grad =0; grad = test::Start_test(tk_,file_name_,nms_,ftHandle1_,serial_); if (grad>=tk_-0.5) { bool time_full = false; time_full = test::time_test_2(time_okonch_,file_name_,ftHandle1_,serial_); if (time_full == true) { emit signal_win(serial_); } else { emit signal_fail2(serial_); } } else { emit signal_fail1(serial_); }} else { emit signal_fail1(serial_); } }
static int Start_test(double,QString,QString,FT_HANDLE,QString); static bool tempiratura_datchika (double,QString ,QString ,FT_HANDLE ,QString); static QString Serialnum (const QString &serial); static bool time_test_2(int,QString,FT_HANDLE,QString); static void full_test( QString,QString,FT_HANDLE,QString,double,double,int); static double preobrazovanie(QString); void run();
int test::time_test_2(int time_okonch,QString file_name,FT_HANDLE ftHandle1,QString serial,int tes) { mutex1.lock(); QString nms = "0"; QTime time_konca; int vremia_t=tes; time_okonch=(time_okonch)*1000; time_konca.start(); nms= test::ReadWrite(serial,nms,file_name,ftHandle1); vremia_t=time_konca.elapsed(); mutex1.unlock(); return vremia_t/1000; }
bool fl=false; int grad =0; int t3=0; connect(this, SIGNAL(signal_win(QString)),SLOT(mysignal_win(QString))); connect(this, SIGNAL(signal_fail1(QString)),SLOT(mysignal_fail1(QString))); connect(this, SIGNAL(signal_fail2(QString)),SLOT(mysignal_fail2(QString))); fl=test::tempiratura_datchika(tna_,file_name_,nms_,ftHandle1_,serial_); if (fl == true) { grad = test::Start_test(tk_,file_name_,nms_,ftHandle1_,serial_); if (grad>=tk_-0.5) { t3 = test::time_test_2(time_okonch_,file_name_,ftHandle1_,serial_,t3); while(t3<=time_okonch_) { t3 = test::time_test_2(time_okonch_,file_name_,ftHandle1_,serial_,t3); } if(t3>=time_okonch_) { emit signal_win(serial_); } else { emit signal_fail2(serial_); } } else { emit signal_fail1(serial_); }} else { emit signal_fail1(serial_); } }
{switch (chet_dat) { case 1: { QString file_name1 = "datchic1.txt"; test * t = new test(); t->full_test(file_name1,nms,ftHandle1,serial1_1, tn1_1,tk1_1,Tyd1_1); t->start(); break; } case 2: { QString file_name2 = "datchic2.txt"; test * t2 = new test(); t2->full_test(file_name2,nms,ftHandle1,serial2, tn2,tk2,Tyd2); t2->start(); break;и тд для 12 датчиков }