| 1144 | } |
| 1145 | |
| 1146 | void |
| 1147 | ProfileConfigTab::guessParamsFromFileName(void) |
| 1148 | { |
| 1149 | QFileInfo fi(QString::fromStdString(this->profile.getPath())); |
| 1150 | std::string baseName = fi.baseName().toStdString(); |
| 1151 | SigDiggerHelpers *hlp = SigDiggerHelpers::instance(); |
| 1152 | |
| 1153 | SUFREQ fc; |
| 1154 | unsigned int fs; |
| 1155 | unsigned int date, time; |
| 1156 | bool haveFc = false; |
| 1157 | bool haveFs = false; |
| 1158 | bool haveDate = false; |
| 1159 | bool haveTime = false; |
| 1160 | bool isUTC = false; |
| 1161 | bool haveTm = false; |
| 1162 | struct tm tm; |
| 1163 | struct timeval tv = {0, 0}; |
| 1164 | |
| 1165 | memset(&tm, 0, sizeof(struct tm)); |
| 1166 | |
| 1167 | if (sscanf( |
| 1168 | baseName.c_str(), |
| 1169 | "sigdigger_%08d_%06dZ_%d_%lg_float32_iq", |
| 1170 | &date, |
| 1171 | &time, |
| 1172 | &fs, |
| 1173 | &fc) == 4) { |
| 1174 | haveFc = true; |
| 1175 | haveFs = true; |
| 1176 | haveDate = true; |
| 1177 | haveTime = true; |
| 1178 | isUTC = true; |
| 1179 | } else if (sscanf( |
| 1180 | baseName.c_str(), |
| 1181 | "sigdigger_%d_%lg_float32_iq", |
| 1182 | &fs, |
| 1183 | &fc) == 2) { |
| 1184 | haveFc = true; |
| 1185 | haveFs = true; |
| 1186 | } else if (sscanf( |
| 1187 | baseName.c_str(), |
| 1188 | "gqrx_%08d_%06d_%lg_%d_fc", |
| 1189 | &date, |
| 1190 | &time, |
| 1191 | &fc, |
| 1192 | &fs) == 4) { |
| 1193 | haveFc = true; |
| 1194 | haveFs = true; |
| 1195 | haveDate = true; |
| 1196 | haveTime = true; |
| 1197 | } else if (sscanf( |
| 1198 | baseName.c_str(), |
| 1199 | "SDRSharp_%08d_%06dZ_%lg_IQ", |
| 1200 | &date, |
| 1201 | &time, |
| 1202 | &fc) == 3) { |
| 1203 | haveFc = true; |
no test coverage detected