| 2247 | //------------------------------------------------ |
| 2248 | |
| 2249 | void MainWindow::osUpdate() { |
| 2250 | if (!m_normalOs) { |
| 2251 | return; |
| 2252 | } |
| 2253 | |
| 2254 | calc_var_t var; |
| 2255 | QByteArray array; |
| 2256 | QString data; |
| 2257 | QString dataString; |
| 2258 | |
| 2259 | int index = 0; |
| 2260 | ui->opView->setRowCount(0); |
| 2261 | ui->vatView->setRowCount(0); |
| 2262 | ui->opStack->setRowCount(0); |
| 2263 | ui->fpStack->setRowCount(0); |
| 2264 | |
| 2265 | QFont monospace = QFontDatabase::systemFont(QFontDatabase::FixedFont); |
| 2266 | monospace.setStyleHint(QFont::Monospace); |
| 2267 | |
| 2268 | disconnect(ui->fpStack, &QTableWidget::itemChanged, this, &MainWindow::fpModified); |
| 2269 | disconnect(ui->opView, &QTableWidget::itemChanged, this, &MainWindow::opModified); |
| 2270 | |
| 2271 | for (uint32_t i = 0xD005F8; i < 0xD005F8+77; i += 11) { |
| 2272 | array.clear(); |
| 2273 | dataString.clear(); |
| 2274 | |
| 2275 | for (uint32_t j = i; j < i+11; j++) { |
| 2276 | uint8_t ch = mem_peek_byte(j); |
| 2277 | array.append(static_cast<char>(ch)); |
| 2278 | if ((ch < 0x20) || (ch > 0x7e)) { |
| 2279 | ch = '.'; |
| 2280 | } |
| 2281 | dataString += QChar(ch); |
| 2282 | } |
| 2283 | |
| 2284 | data_t vect(array.constData(), array.constEnd() - 2); |
| 2285 | |
| 2286 | QTableWidgetItem *opAddr = new QTableWidgetItem(int2hex(i, 6)); |
| 2287 | QTableWidgetItem *opNumber = new QTableWidgetItem(QStringLiteral("OP") + QString::number(index+1)); |
| 2288 | QTableWidgetItem *opData = new QTableWidgetItem(QString(array.toHex())); |
| 2289 | QTableWidgetItem *opString = new QTableWidgetItem(dataString); |
| 2290 | QTableWidgetItem *opValue; |
| 2291 | try { |
| 2292 | opValue = new QTableWidgetItem(QString::fromStdString(tivars::TypeHandlers::TH_GenericReal::makeStringFromData(vect))); |
| 2293 | } catch (...) { |
| 2294 | opValue = new QTableWidgetItem(TXT_NAN); |
| 2295 | } |
| 2296 | opNumber->setFlags(opNumber->flags() & ~Qt::ItemIsEditable); |
| 2297 | opAddr->setFlags(opNumber->flags() & ~Qt::ItemIsEditable); |
| 2298 | |
| 2299 | opAddr->setFont(monospace); |
| 2300 | opNumber->setFont(monospace); |
| 2301 | opData->setFont(monospace); |
| 2302 | opString->setFont(monospace); |
| 2303 | opValue->setFont(monospace); |
| 2304 | |
| 2305 | ui->opView->setRowCount(index+1); |
| 2306 |
nothing calls this directly
no test coverage detected