strict First{int a;int b;};struct mainST{QString A;QVector <First> fst;};
.hQVector<mainST> mST; .cppfor(int i=0;i<50;i++){mainST currMainST;currMainST.A=i;First FF;for(int j=0;j<30;j++){FF.a=...FF.b=...currMainST.fst.push_back(FF);}mST.push_back(currMainST);}
struct impuls{ int NumberImpuls_ofParcels; float Parcels_ofImpuls; float LowerCarrierFrequency_ofImpuls; float TopCarrierFrequency_ofImpuls; float Duretion_ofImpuls; float TimeInterval_betweenImpuls; float RateCangeFrequency_ofImpuls; QString NumberPicture;};struct parsel{ float AverageFrequency_ofParcels; float Band_ofParcels; float Duration_ofParcels; int CountImpuls_ofParcels; QVector<impuls> imp; QString CarrierClass;};struct base_GLS{ QString TipGls; QVector<parsel> pars; };class read_BD : public QObject{ Q_OBJECTpublic: explicit read_BD(QObject *parent = 0); QVector<base_GLS> base; QVector <QString> gls;};
.cppint read_BD::load_data(QString fliename){ QFile fp(fliename); if(!fp.open(QIODevice::ReadOnly)) return 0; QString data; int count=0; data=fp.readAll(); QStringList lst=data.split("\n"); parseData(lst); qDebug()<<count; fp.close(); }void read_BD::parseData(QStringList list){ for(int i=1;i<list.size()-1;i++) { QStringList line=list.at(i).split(";"); findGLS(line); } for(int j=0;j<gls.size();j++) { //лист строк по данному названию QStringList dataCurrentCel; qDebug()<<"list.size()"<<list.size(); for(int i=1;i<list.size()-1;i++) { //выбираем последовательно все строки из базы относящиеся к данному названию if(list.at(i).contains(gls.at(j),Qt::CaseSensitive)) { dataCurrentCel.push_back(list.at(i)); } } base_GLS currBaseGls; currBaseGls.TipGls=gls.at(j); for(int k=0;k<dataCurrentCel.size();k++) { //разбиваем строку на столбцы со значениями QStringList line=dataCurrentCel.at(k).split(";"); QStringList lineNext; if(k==150) { int yy=0; } if(k<dataCurrentCel.size()-1) { lineNext<<dataCurrentCel.at(k+1).split(";"); } qDebug()<<"line"<<line; qDebug()<<"lineNext"<<lineNext; parsel curr_par; if(control_item(line.at(3))>0 || control_item(line.at(3))==-1.f) { curr_par.CountImpuls_ofParcels=control_item(line.at(3)); curr_par.AverageFrequency_ofParcels=control_item(line.at(0))*1000.f; curr_par.Band_ofParcels=control_item(line.at(1)); curr_par.Duration_ofParcels=control_item(line.at(2)); curr_par.CarrierClass=line.at(12); } if(control_number_impuls(list.at(4))>0) { for(int t=1;t<control_number_impuls(list.at(4));t++) { impuls ii; ii.NumberImpuls_ofParcels=t; ii.Parcels_ofImpuls=control_item(line.at(5)); ii.LowerCarrierFrequency_ofImpuls=control_item(line.at(6))*1000.f; ii.TopCarrierFrequency_ofImpuls=control_item(line.at(7))*1000.f; ii.Duretion_ofImpuls=control_item(line.at(8)); ii.TimeInterval_betweenImpuls=control_item(line.at(9)); ii.RateCangeFrequency_ofImpuls=control_item(line.at(10));; ii.NumberPicture=line.at(11); curr_par.imp.append(ii); // ПРОБЛЕМА ИМЕННО ПРИ ДОБАВЛЕНИИ ДАННОЙ СТРУКТУРЫ qDebug()<<curr_par.imp.size(); } } else if(control_number_impuls(list.at(4))==0) { impuls ii; ii.NumberImpuls_ofParcels=control_item(line.at(4)); ; ii.Parcels_ofImpuls=control_item(line.at(5)); ii.LowerCarrierFrequency_ofImpuls=control_item(line.at(6))*1000.f; ii.TopCarrierFrequency_ofImpuls=control_item(line.at(7))*1000.f; ii.Duretion_ofImpuls=control_item(line.at(8)); ii.TimeInterval_betweenImpuls=control_item(line.at(9)); ii.RateCangeFrequency_ofImpuls=control_item(line.at(10));; ii.NumberPicture=line.at(11); curr_par.imp.push_back(ii); // ПРОБЛЕМА ИМЕННО ПРИ ДОБАВЛЕНИИ ДАННОЙ СТРУКТУРЫ qDebug()<<curr_par.imp.size(); } else { ; } if(k==dataCurrentCel.size()-1) currBaseGls.pars.push_back(curr_par); else if(k< dataCurrentCel.size()-1 && (control_item(lineNext.at(3))>0 || control_item(lineNext.at(3))==-1.f)) { qDebug()<<"urr_par.imp.size()"<<curr_par.imp.size(); currBaseGls.pars.push_back(curr_par); } } base.push_back(currBaseGls); }}
strict First{int a;int b;};
FF.a=a;FF.b=b;currMainST.fst.push_back(FF);
C++ (Qt)currMainST.fst.push_back(QPair(a, b));