From af59e007a0cac584a33e863286a9e1d6b66a97c9 Mon Sep 17 00:00:00 2001
From: radioacoustick " + tr("Input data") + ": " + tr("Input data") + ": " + tr("Result") + ": " + tr("Result") + ":
";
- if (fOpt->isShowTitle){
- sResult = "" +QCoreApplication::applicationName() + " " + QCoreApplication::applicationVersion() +
- " - " + windowTitle();
- }
+ QString sCaption = QCoreApplication::applicationName() + " " + QCoreApplication::applicationVersion() + " - " + windowTitle();
+ QString sImage = "";
if ((ui->lineEdit_N->text().isEmpty())||(ui->lineEdit_1->text().isEmpty())||(ui->lineEdit_2->text().isEmpty())||(ui->lineEdit_4->text().isEmpty())){
showWarning(tr("Warning"), tr("One or more inputs are empty!"));
return;
@@ -217,9 +216,8 @@ void AirCoreToroid::on_pushButton_calculate_clicked()
return;
}
if(windingKind == 0){
- sResult += " (" + ui->radioButton_round->text() + + ")
";
- if (fOpt->isInsertImage)
- sResult += "";
+ sCaption += " (" + ui->radioButton_round->text() + + ")";
+ sImage = "";
} else if (windingKind == 1){
if(ui->lineEdit_3->text().isEmpty()){
showWarning(tr("Warning"), tr("One or more inputs are empty!"));
@@ -234,9 +232,8 @@ void AirCoreToroid::on_pushButton_calculate_clicked()
showWarning(tr("Warning"), tr("One or more inputs have an illegal format!"));
return;
}
- sResult += " (" + ui->radioButton_rect->text() + + ")
";
- if (fOpt->isInsertImage)
- sResult += "";
+ sCaption += " (" + ui->radioButton_rect->text() + + ")";
+ sImage = "";
}
_CoilResult result;
if (ui->checkBox_isReverce->isChecked()){
@@ -270,25 +267,24 @@ void AirCoreToroid::on_pushButton_calculate_clicked()
N = result.N;
}
}
- sResult += "
";
+ QString sInput = "
";
if (ui->checkBox_isReverce->isChecked())
- sResult += ui->label_N->text() + " " + ui->lineEdit_N->text() + "
";
+ sInput += formattedOutput(fOpt, ui->label_N->text(), ui->lineEdit_N->text()) + "
";
else
- sResult += ui->label_N->text() + " " + ui->lineEdit_N->text() + " " + ui->label_N_m->text() + "
";
- sResult += ui->label_1->text() + " " + ui->lineEdit_1->text() + " " + ui->label_01->text() + "
";
- sResult += ui->label_2->text() + " " + ui->lineEdit_2->text() + " " + ui->label_02->text() + "
";
+ sInput += formattedOutput(fOpt, ui->label_N->text(), ui->lineEdit_N->text(), ui->label_N_m->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_1->text(), ui->lineEdit_1->text(), ui->label_01->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_2->text(), ui->lineEdit_2->text(), ui->label_02->text()) + "
";
if (windingKind == 1){
- sResult += ui->label_3->text() + " " + ui->lineEdit_3->text() + " " + ui->label_03->text() + "
";
+ sInput += formattedOutput(fOpt, ui->label_3->text(), ui->lineEdit_3->text(), ui->label_03->text()) + "
";
}
- sResult += ui->label_4->text() + " " + ui->lineEdit_4->text() + " " + ui->label_04->text() + "
";
- sResult += "
";
+ sInput += formattedOutput(fOpt, ui->label_4->text(), ui->lineEdit_4->text(), ui->label_04->text()) + "
";
if (ui->checkBox_isReverce->isChecked()){
- sResult += tr("Inductance") + " L = " + roundTo(ind / fOpt->dwInductanceMultiplier, loc, fOpt->dwAccuracy) + " "
- + qApp->translate("Context", fOpt->ssInductanceMeasureUnit.toUtf8());
+ sResult += formattedOutput(fOpt, tr("Inductance") + " L = ", roundTo(ind / fOpt->dwInductanceMultiplier, loc, fOpt->dwAccuracy),
+ qApp->translate("Context", fOpt->ssInductanceMeasureUnit.toUtf8()));
} else {
- sResult += tr("Number of turns of the coil") + " N = " + roundTo(N, loc, fOpt->dwAccuracy);
+ sResult += formattedOutput(fOpt, tr("Number of turns of the coil") + " N = ", roundTo(N, loc, fOpt->dwAccuracy));
}
- sResult += "
";
- emit sendResult(sResult);
+ sResult += "
" + tr("Dimensions") + ":
";
- info += "A = " + styleInfoColor + getMultiapertureCoreSize(bn_size_val.at(1)) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
- info += "B = " + styleInfoColor + getMultiapertureCoreSize(bn_size_val.at(2)) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",
";
+ QString info = tr("Dimensions") + ":
";
+ info += "A = " + styleInfoColor + getMultiapertureCoreSize(bn_size_val.at(1)) + " "
+ + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
+ info += "B = " + styleInfoColor + getMultiapertureCoreSize(bn_size_val.at(2)) + " "
+ + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",
";
if (!(sC == "0"))
- info += "C = " + styleInfoColor + getMultiapertureCoreSize(bn_size_val.at(3)) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
- info += "E = " + styleInfoColor + getMultiapertureCoreSize(bn_size_val.at(4)) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
- info += "H = " + styleInfoColor + getMultiapertureCoreSize(bn_size_val.at(5)) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
" + info + "
"); ui->label->setText(ui->comboBox_bn_t->currentText()); onCalculate(); } @@ -650,7 +650,7 @@ void Amidon::on_comboBox_td_currentTextChanged(const QString &arg1){ int tm_index = ui->comboBox_tm->currentIndex(); QString tfeatures_str = TToroid_Features[tm_index]; QStringList tfeatures = tfeatures_str.split(","); - QString info = "" + tr("Color code") + ": " + styleInfoColor + tfeatures.at(2) + "
";
+ QString info = tr("Color code") + ": " + styleInfoColor + tfeatures.at(2) + "
";
info += tr("Material") + ": " + styleInfoColor + tfeatures.at(3) + "
";
info += tr("Resonant circuit frequency range") + ":
" + styleInfoColor + tfeatures.at(1)
+ "
";
@@ -674,13 +674,13 @@ void Amidon::on_comboBox_td_currentTextChanged(const QString &arg1){
+ roundTo(od, loc, accuracy) + " x "
+ roundTo(id, loc, accuracy) + " x "
+ roundTo(h, loc, accuracy) +
- + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
al = TToroid_AL[tm_index][i];
- info += "AL " + tr("factor") + ": " + styleInfoColor
- + QString("%1").arg(al) + " µH/(N/100)2
" + info + "
"); ui->label->setText(arg1 + "-" + ui->comboBox_tm->currentText().left(ui->comboBox_tm->currentText().indexOf(" "))); onCalculate(); } @@ -693,16 +693,16 @@ void Amidon::on_comboBox_fd_currentTextChanged(const QString &arg1) int fm_index = ui->comboBox_fm->currentIndex(); QString ffeatures_str = FToroid_Features[fm_index]; QStringList ffeatures = ffeatures_str.split(","); - QString info = "" + tr("Initial magnetic permeability") + " (μi): " + styleInfoColor + ffeatures.at(0)
+ QString info = tr("Initial magnetic permeability") + " (μi): " + styleInfoColor + ffeatures.at(0)
+ "
";
info += tr("Saturation flux density") + " (Bs): " + styleInfoColor + ffeatures.at(1)
- + " Gs
";
+ + " Gs
";
info += tr("Residual flux density") + " (Br): " + styleInfoColor + ffeatures.at(2)
- + " Gs
";
+ + " Gs
";
info += tr("Coercive Force") + " (Hc): " + styleInfoColor + ffeatures.at(3)
- + " Oe
";
+ + " Oe
";
info += tr("Curie Temperature") + ": " + styleInfoColor + ffeatures.at(4)
- + " °C
";
+ + " °C
";
for (int i = 0; i < 28; i++) {
QString fsise_str = FToroidSize[i];
QStringList f_size_val = fsise_str.split(",");
@@ -721,20 +721,20 @@ void Amidon::on_comboBox_fd_currentTextChanged(const QString &arg1)
+ roundTo(od, loc, accuracy) + " x "
+ roundTo(id, loc, accuracy) + " x "
+ roundTo(h, loc, accuracy) +
- + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
al = FToroid_AL[fm_index][i];
- info += "AL " + tr("factor") + ": " + styleInfoColor
- + QString("%1").arg(al) + " nH/N2
" + tr("Working frequency") + ":
";
+ info += "" + tr("Working frequency") + ":
";
info += tr("Resonant circuit coils") + " = " + styleInfoColor + ffeatures.at(5)
- + " " + qApp->translate("Context", "MHz") + "
";
- info += tr("Wideband transformers") + " (TLT) = " + styleInfoColor + ffeatures.at(6)
- + " " + qApp->translate("Context", "MHz") + "
";
+ + " " + qApp->translate("Context", "MHz") + "
";
+ info += tr("Wideband transformers") + " (TLT) = " + styleInfoColor + ffeatures.at(6)
+ + " " + qApp->translate("Context", "MHz") + "
";
info += tr("Chokes") + " = " + styleInfoColor + ffeatures.at(7)
- + " " + qApp->translate("Context", "MHz") + "
";
- ui->label_info->setText(info);
+ + " " + qApp->translate("Context", "MHz") + "
";
+ ui->label_info->setText("
" + info + "
"); ui->label->setText(arg1 + "-" + ui->comboBox_fm->currentText()); onCalculate(); } @@ -869,12 +869,12 @@ void Amidon::onCalculate() } if (N > 0){ double max_dw = 2 * sqrt(0.7 * hole_area / N / M_PI); - Result += tr("Number of turns of the coil") + " N = " + loc.toString(N) + "" + tr("Dimensions") + ":
";
- info += "A = " + styleInfoColor + getPotCoreSize(psize.at(0),&A) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
- info += "B = " + styleInfoColor + getPotCoreSize(psize.at(1),&B) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",
";
- info += "C = " + styleInfoColor + getPotCoreSize(psize.at(2),&C) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
- info += "D = " + styleInfoColor + getPotCoreSize(psize.at(3),&D) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",
";
- info += "E = " + styleInfoColor + getPotCoreSize(psize.at(4),&E) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
- info += "F = " + styleInfoColor + getPotCoreSize(psize.at(5),&F) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",
";
- info += "G = " + styleInfoColor + getPotCoreSize(psize.at(6),&G) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
- info += "H = " + styleInfoColor + getPotCoreSize(psize.at(7),&H) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ QString info = tr("Dimensions") + ":
";
+ info += "A = " + styleInfoColor + getPotCoreSize(psize.at(0),&A) + " "
+ + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
+ info += "B = " + styleInfoColor + getPotCoreSize(psize.at(1),&B) + " "
+ + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",
";
+ info += "C = " + styleInfoColor + getPotCoreSize(psize.at(2),&C) + " "
+ + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
+ info += "D = " + styleInfoColor + getPotCoreSize(psize.at(3),&D) + " "
+ + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",
";
+ info += "E = " + styleInfoColor + getPotCoreSize(psize.at(4),&E) + " "
+ + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
+ info += "F = " + styleInfoColor + getPotCoreSize(psize.at(5),&F) + " "
+ + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",
";
+ info += "G = " + styleInfoColor + getPotCoreSize(psize.at(6),&G) + " "
+ + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
+ info += "H = " + styleInfoColor + getPotCoreSize(psize.at(7),&H) + " "
+ + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
QString pfeatures_str = PotCore_Features[index];
QStringList pfeatures = pfeatures_str.split(",");
QString al_s = pfeatures.at(0);
@@ -954,16 +954,16 @@ void Amidon::resolvePotCore(int index)
accuracy = 0;
info += tr("Effective magnetic path length") + " (le): " + styleInfoColor
+ roundTo(le/fOpt->dwLengthMultiplier, loc, accuracy)
- + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
info += tr("Effective area of magnetic path") + " (Ae): " + styleInfoColor
+ roundTo(ae/(fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier), loc, accuracy)
- + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "2
";
+ + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "2
";
info += tr("Effective volume") + " (Ve): " + styleInfoColor
+ roundTo(ve/(fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier), loc, accuracy)
- + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "3
";
- info += "AL " + tr("factor") + ": " + styleInfoColor
- + al_s + " mH/(N/1000)2
" + info + "
"); onCalculate(); } } @@ -990,28 +990,28 @@ void Amidon::resolveECore(int index) int accuracy = fOpt->indexLengthMultiplier + 1; if (accuracy == 4) accuracy = 0; - QString info = "" + tr("Dimensions") + ":
";
+ QString info = tr("Dimensions") + ":
";
info += "A = " + styleInfoColor
- + roundTo(A/fOpt->dwLengthMultiplier, loc, accuracy) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
+ + roundTo(A/fOpt->dwLengthMultiplier, loc, accuracy) + " "
+ + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
info += "B = " + styleInfoColor
- + roundTo(B/fOpt->dwLengthMultiplier, loc, accuracy) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",
";
+ + roundTo(B/fOpt->dwLengthMultiplier, loc, accuracy) + " "
+ + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",
";
info += "C = " + styleInfoColor
- + roundTo(C/fOpt->dwLengthMultiplier, loc, accuracy) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
+ + roundTo(C/fOpt->dwLengthMultiplier, loc, accuracy) + " "
+ + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
info += "D = " + styleInfoColor
- + roundTo(D/fOpt->dwLengthMultiplier, loc, accuracy) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",
";
+ + roundTo(D/fOpt->dwLengthMultiplier, loc, accuracy) + " "
+ + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",
";
info += "E = " + styleInfoColor
- + roundTo(E/fOpt->dwLengthMultiplier, loc, accuracy) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
+ + roundTo(E/fOpt->dwLengthMultiplier, loc, accuracy) + " "
+ + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ", ";
info += "F = " + styleInfoColor
- + roundTo(F/fOpt->dwLengthMultiplier, loc, accuracy) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",
";
+ + roundTo(F/fOpt->dwLengthMultiplier, loc, accuracy) + " "
+ + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",
";
info += "G = " + styleInfoColor
- + roundTo(G/fOpt->dwLengthMultiplier, loc, accuracy) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ + roundTo(G/fOpt->dwLengthMultiplier, loc, accuracy) + " "
+ + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
QString efeatures_str = ECore_Features[index];
QStringList efeatures = efeatures_str.split(",");
QString ae_s = efeatures.at(0);
@@ -1027,17 +1027,17 @@ void Amidon::resolveECore(int index)
double W = W_s.toDouble();
info += tr("Effective magnetic path length") + " (le): " + styleInfoColor
+ roundTo(le/fOpt->dwLengthMultiplier, loc, accuracy)
- + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
info += tr("Effective area of magnetic path") + " (Ae): " + styleInfoColor
+ roundTo(ae/(fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier), loc, accuracy)
- + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "2
";
+ + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "2
";
info += tr("Effective volume") + " (Ve): " + styleInfoColor
+ roundTo(ve/(fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier), loc, accuracy)
- + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "3
";
- info += tr("Power") + " (W): " + styleInfoColor + roundTo(W, loc, accuracy) + " W
";
- info += "AL " + tr("factor") + ": " + styleInfoColor
- + al_s + " µH/(N/1000)2
" + info + "
"); onCalculate(); } } @@ -1049,31 +1049,28 @@ void Amidon::on_pushButton_export_clicked() showWarning(tr("Warning"), tr("One or more inputs are equal to null!")); return; } - QString sResult = "" + tr("Selected core") + ":
";
- sResult += "" + ui->label->text() + "
"; - if (fOpt->isInsertImage){ - QPixmap image = ui->graphArea->grab(); - QByteArray byteArray; - QBuffer buffer(&byteArray); - image.save(&buffer, "PNG"); - sResult += QString("
"; - QByteArray byteArray2; - QBuffer buffer2(&byteArray2); - ui->image->pixmap()->save(&buffer2, "PNG"); - sResult += QString("
"; + QString sCaption = QCoreApplication::applicationName() + " " + QCoreApplication::applicationVersion() + " - " + windowTitle(); + QString sImage = ""; + sCaption += "" + tr("Selected core") + ":
";
+ sCaption += "" + ui->label->text() + "
" + tr("Input data") + ":
";
+ sInput += formattedOutput(fOpt, ui->groupBox_ind->title() + " L = ", ui->lineEdit_ind->text(), ui->label_2->text()) + "
" + ui->groupBox_info->title() + ":
"; + sInput += ui->label_info->text(); } - sResult += "" + tr("Input data") + ":
";
- sResult += ui->groupBox_ind->title() + " = " + ui->lineEdit_ind->text() + " " + ui->label_2->text() + "
" + ui->groupBox_info->title() + ":"; - sResult += ui->label_info->text() + "
"; - sResult += "" + ui->groupBox_result->title() + ":
";
- sResult += ui->label_result->text() + "
" + ui->groupBox_result->title() + ":
";
+ sResult += ui->label_result->text() + "
" + ui->tabWidget->tabText(ui->tabWidget->currentIndex()) + "
"; - sResult += "" + tr("Input data") + ":
";
+ QString sCaption = QCoreApplication::applicationName() + " " + QCoreApplication::applicationVersion() + " - " + windowTitle();
+ QString sImage = "";
+ sCaption += "
" + ui->tabWidget->tabText(ui->tabWidget->currentIndex()) + "
"; + QString sInput = "" + tr("Input data") + ":
";
switch (ui->tabWidget->currentIndex()){
case 0:{
if ((!ui->lineEdit_ct->text().isEmpty()) && (!ui->lineEdit_cp->text().isEmpty())){
- sResult += ui->label_flo->text() + " " + ui->lineEdit_flo->text() + " " + ui->label_flo_m->text() + "
";
- sResult += ui->label_fhi->text() + " " + ui->lineEdit_fhi->text() + " " + ui->label_fhi_m->text() + "
";
- sResult += ui->label_cvmin->text() + " " + ui->lineEdit_cvmin->text() + " " + ui->label_cvmin_m->text() + "
";
- sResult += ui->label_cvmax->text() + " " + ui->lineEdit_cvmax->text() + " " + ui->label_cvmax_m->text() + "
";
- sResult += ui->label_cs->text() + " " + ui->lineEdit_cs->text() + " " + ui->label_cs_m->text() + "
";
- sResult += ui->label_ind->text() + " " + ui->lineEdit_ind->text() + " " + ui->label_ind_m->text() + "
" + tr("Result") + ":
";
- sResult += ui->label_ct->text() + " " + ui->lineEdit_ct->text() + " " + ui->label_ct_m->text() + "
";
- sResult += ui->label_cp->text() + " " + ui->lineEdit_cp->text() + " " + ui->label_cp_m->text() + "
" + tr("Result") + ":
";
+ sResult += formattedOutput(fOpt, ui->label_ct->text(), ui->lineEdit_ct->text(), ui->label_ct_m->text()) + "
";
+ sResult += formattedOutput(fOpt, ui->label_cp->text(), ui->lineEdit_cp->text(), ui->label_cp_m->text()) + "
" + tr("Result") + ":
";
- sResult += ui->label_flo_r->text() + " " + ui->lineEdit_flo_r->text() + " " + ui->label_flo_m_r->text() + "
";
- sResult += ui->label_fhi_r->text() + " " + ui->lineEdit_fhi_r->text() + " " + ui->label_fhi_m_r->text() + "
" + tr("Result") + ":
";
+ sResult += formattedOutput(fOpt, ui->label_flo_r->text(), ui->lineEdit_flo_r->text(), ui->label_flo_m_r->text()) + "
";
+ sResult += formattedOutput(fOpt, ui->label_fhi_r->text(), ui->lineEdit_fhi_r->text(), ui->label_fhi_m_r->text()) + "
" + tr("Input data") + ":
";
+ QString sInput = "
" + tr("Input data") + ":
";
if (ui->checkBox_isReverce->isChecked())
- sResult += ui->label_N->text() + " " + ui->lineEdit_N->text() + "
";
+ sInput += formattedOutput(fOpt, ui->label_N->text(), ui->lineEdit_N->text()) + "
";
else
- sResult += ui->label_N->text() + " " + ui->lineEdit_N->text() + " " + ui->label_N_m->text() + "
";
- sResult += ui->label_a->text() + " " + ui->lineEdit_a->text() + " " + ui->label_01->text() + "
";
- sResult += ui->label_b->text() + " " + ui->lineEdit_b->text() + " " + ui->label_02->text() + "
";
- sResult += ui->label_c->text() + " " + ui->lineEdit_c->text() + " " + ui->label_03->text() + "
";
- sResult += ui->label_d->text() + " " + ui->lineEdit_d->text() + " " + ui->label_04->text() + "
";
- sResult += ui->label_e->text() + " " + ui->lineEdit_e->text() + " " + ui->label_05->text() + "
";
- sResult += ui->label_f->text() + " " + ui->lineEdit_f->text() + " " + ui->label_06->text() + "
";
+ sInput += formattedOutput(fOpt, ui->label_N->text(), ui->lineEdit_N->text(), ui->label_N_m->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_a->text(), ui->lineEdit_a->text(), ui->label_01->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_b->text(), ui->lineEdit_b->text(), ui->label_02->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_c->text(), ui->lineEdit_c->text(), ui->label_03->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_d->text(), ui->lineEdit_d->text(), ui->label_04->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_e->text(), ui->lineEdit_e->text(), ui->label_05->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_f->text(), ui->lineEdit_f->text(), ui->label_06->text()) + "
";
if (index == 0)
- sResult += ui->label_s->text() + " " + ui->lineEdit_s->text() + " " + ui->label_07->text() + "
";
- sResult += ui->label_g->text() + " " + ui->lineEdit_g->text() + " " + ui->label_08->text() + "
" + tr("Result") + ":
";
+ sInput += formattedOutput(fOpt, ui->label_s->text(), ui->lineEdit_s->text(), ui->label_07->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_g->text(), ui->lineEdit_g->text(), ui->label_08->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_mu->text(), ui->lineEdit_mu->text()) + "
" + tr("Result") + ":
";
if (ui->checkBox_isReverce->isChecked()){
- sResult += tr("Inductance") + " L = " + roundTo(ind / fOpt->dwInductanceMultiplier, loc, fOpt->dwAccuracy) + " "
- + qApp->translate("Context", fOpt->ssInductanceMeasureUnit.toUtf8());
+ sResult += formattedOutput(fOpt, tr("Inductance") + " L = ", roundTo(ind / fOpt->dwInductanceMultiplier, loc, fOpt->dwAccuracy),
+ qApp->translate("Context", fOpt->ssInductanceMeasureUnit.toUtf8()));
} else {
- sResult += tr("Number of turns of the coil") + " N = " + QString::number(N);
+ sResult += formattedOutput(fOpt, tr("Number of turns of the coil") + " N = ", QString::number(N));
}
- sResult += "
" + tr("Effective magnetic path length") + " (le): "
- + roundTo(result.N/fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy)
- + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
- sResult += tr("Effective area of magnetic path") + " (Ae): "
- + roundTo(result.sec/(fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier), loc, fOpt->dwAccuracy)
- + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "2
";
- sResult += tr("Effective volume") + " (Ve): "
- + roundTo(result.N * result.sec/(fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier), loc, fOpt->dwAccuracy)
- + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "3
";
- sResult += tr("Effective magnetic permeability of the core") + " μe = " + roundTo(result.thd, loc, 0);
- sResult += "
" + tr("Input data") + ":
";
- sResult += ui->label_ind->text() + " = " + ui->lineEdit_ind->text() + " " + ui->label_ind_m->text() + "
";
- sResult += "
" + ui->groupBox_core->title() + ":
";
- sResult += ui->label_Dr->text() + " = " + ui->lineEdit_Dr->text() + " " + ui->label_Dr_m->text() + "
";
- sResult += ui->label_Lr->text() + " = " + ui->lineEdit_Lr->text() + " " + ui->label_Lr_m->text() + "
";
- sResult += ui->label_mu->text() + ui->lineEdit_mu->text() + "
";
- sResult += "
" + ui->groupBox_coil->title() + ":
";
- sResult += ui->label_dc->text() + " = " + ui->lineEdit_dc->text() + " " + ui->label_dc_m->text() + "
";
- sResult += ui->label_s->text() + " = " + ui->lineEdit_s->text() + " " + ui->label_s_m->text() + "
";
- sResult += ui->label_dw->text() + " = " + ui->lineEdit_dw->text() + " " + ui->label_dw_m->text() + "
";
- sResult += ui->label_p->text() + " = " + ui->lineEdit_p->text() + " " + ui->label_p_m->text() + "
" + tr("Result") + ":
";
- sResult += tr("Number of turns of the coil") + " N = " + QString::number(result.N) + "
";
- sResult += tr("Length of winding") + " lc = " + roundTo(result.thd, loc, fOpt->dwAccuracy) + "
";
- sResult += tr("Effective magnetic permeability of the core") + " μe = " + roundTo(result.sec, loc, 0);
- sResult += "
" + tr("Input data") + ":
";
+ sInput += formattedOutput(fOpt, ui->label_ind->text(), ui->lineEdit_ind->text(), ui->label_ind_m->text()) + "
";
+ sInput += "
" + ui->groupBox_core->title() + ":
";
+ sInput += formattedOutput(fOpt, ui->label_Dr->text(), ui->lineEdit_Dr->text(), ui->label_Dr_m->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_Lr->text(), ui->lineEdit_Lr->text(), ui->label_Lr_m->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_mu->text(), ui->lineEdit_mu->text()) + "
";
+ sInput += "
" + ui->groupBox_coil->title() + ":
";
+ sInput += formattedOutput(fOpt, ui->label_dc->text(), ui->lineEdit_dc->text(), ui->label_dc_m->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_s->text(), ui->lineEdit_s->text(), ui->label_s_m->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_dw->text(), ui->lineEdit_dw->text(), ui->label_dw_m->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_p->text(), ui->lineEdit_p->text(), ui->label_p_m->text()) + "
" + tr("Result") + ":
";
+ sResult += formattedOutput(fOpt, tr("Number of turns of the coil") + " N = ", QString::number(result.N)) + "
";
+ sResult += formattedOutput(fOpt, tr("Length of winding") + " lc = ", roundTo(result.thd/fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy),
+ qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(fOpt, tr("Effective magnetic permeability of the core") + " μe = ", roundTo(result.sec, loc, 0));
+ sResult += "
" + tr("Input data") + ":
";
- sResult += ui->label_ind->text() + ": L = " + ui->lineEdit_ind->text() + " " + ui->label_ind_m->text() + "
";
- sResult += ui->label_N->text() + ": N = " + ui->lineEdit_N->text() + "
";
- sResult += "" + tr("Dimensions") + ":
";
- sResult += ui->label_1->text() + " = " + ui->lineEdit_1->text() + " " + ui->label_01->text() + "
";
- sResult += ui->label_2->text() + " = " + ui->lineEdit_2->text() + " " + ui->label_02->text() + "
";
- sResult += ui->label_3->text() + " = " + ui->lineEdit_3->text() + " " + ui->label_03->text() + "
";
+ QString sCaption = QCoreApplication::applicationName() + " " + QCoreApplication::applicationVersion() + " - " + windowTitle();
+ QString sImage = "";
+ QString sInput = "
" + tr("Input data") + ":
";
+ sInput += formattedOutput(fOpt, ui->label_ind->text(), ui->lineEdit_ind->text(), ui->label_ind_m->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_N->text(), ui->lineEdit_N->text()) + "
";
+ sInput += "" + tr("Dimensions") + ":
";
+ sInput += formattedOutput(fOpt, ui->label_1->text(), ui->lineEdit_1->text(), ui->label_01->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_2->text(), ui->lineEdit_2->text(), ui->label_02->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_3->text(), ui->lineEdit_3->text(), ui->label_03->text()) + "
";
if (Ch > 0)
- sResult += ui->label_4->text() + " = " + ui->lineEdit_4->text() + " " + ui->label_04->text();
- sResult += "
" + tr("Result") + ":
";
- sResult += tr("Relative magnetic permeability of the toroid") + " μr = " + loc.toString(result.N) + "
";
- sResult += tr("Magnetic factor of the core") + " AL = " + loc.toString(result.sec, 'f', 0)+ " "
- + qApp->translate("Context","nH") + "/N2";
- sResult += "
" + tr("Result") + ":
";
+ sResult += formattedOutput(fOpt, tr("Relative magnetic permeability of the toroid") + " μr = ", loc.toString(result.N)) + "
";
+ sResult += formattedOutput(fOpt, tr("Magnetic factor of the core") + " AL = ", loc.toString(result.sec, 'f', 0),
+ qApp->translate("Context","nH") + "/N2");
+ sResult += "
" + tr("Input data") + ":
";
- sResult += ui->label_N->text() + " " + ui->lineEdit_N->text() + " " + ui->label_N_m->text() + "
";
- sResult += ui->label_3->text() + " " + ui->lineEdit_3->text() + " " + ui->label_03->text() + "
" + tr("Result") + ":
";
+ sInput = "
" + tr("Input data") + ":
";
+ sInput += formattedOutput(fOpt, ui->label_N->text(), ui->lineEdit_N->text(), ui->label_N_m->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_3->text(), ui->lineEdit_3->text(), ui->label_03->text()) + "
" + tr("Result") + ":
";
if(loopKind == 0){
a = findRoundLoop_D(ind, dw);
- sResult += tr("Loop diameter") + " D: " + roundTo(a / fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(fOpt, tr("Loop diameter") + " D: ", roundTo(a / fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy),
+ qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8())) + "
";
} else if (loopKind == 1){
a = findIsoIsoscelesTriangleLoop_a(ind, dw);
b = a;
- sResult += tr("The side of the equilateral triangle") + " a = b: " + roundTo(a / fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(fOpt, tr("The side of the equilateral triangle") + " a = b: ", roundTo(a / fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy),
+ qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8())) + "
";
} else if (loopKind == 2){
a = findRectangleLoop_a(ind, dw);
b = a;
- sResult += tr("The side of quadrate") + " a = b: " + roundTo(a / fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy) + " "
- + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(fOpt, tr("The side of quadrate") + " a = b: ", roundTo(a / fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy),
+ qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8())) + "
";
}
if (a < 0){
a = 0;
@@ -339,12 +334,11 @@ void Loop::on_pushButton_clicked()
return;
}
}
- sResult += "
" + tr("Dimensions") + ":
";
- sResult += ui->label_1->text() + " " + ui->lineEdit_1->text() + " " + ui->label_01->text() + "
";
+ sInput = "
" + tr("Dimensions") + ":
";
+ sInput += formattedOutput(fOpt, ui->label_1->text(), ui->lineEdit_1->text(), ui->label_01->text()) + "
";
if (loopKind != 0)
- sResult += ui->label_2->text() + " " + ui->lineEdit_2->text() + " " + ui->label_02->text() + "
";
- sResult += ui->label_3->text() + " " + ui->lineEdit_3->text() + " " + ui->label_03->text() + "
" + tr("Result") + ":
";
- sResult += tr("Inductance") + " L = " + roundTo(ind / fOpt->dwInductanceMultiplier, loc, fOpt->dwAccuracy) + " "
- + qApp->translate("Context", fOpt->ssInductanceMeasureUnit.toUtf8()) + "
";
+ sResult = "
" + tr("Result") + ":
";
+ sResult += formattedOutput(fOpt, tr("Inductance") + " L = ", roundTo(ind / fOpt->dwInductanceMultiplier, loc, fOpt->dwAccuracy),
+ qApp->translate("Context", fOpt->ssInductanceMeasureUnit.toUtf8())) + "
";
}
- sResult += "
"+ image + "
"; + if (myOpt->isOutputInTwoColumns){ + outputHTML += "" + sTitle + input + + " | " + result + " |
" + sTitle + input + result + "
" + tr("Input") + ":
";
- Input += mui->groupBox_1_3->title() + ": " + mui->lineEdit_1_3->text() + " " + mui->label_01_3->text() + "
";
- Input += mui->groupBox_2_3->title() + ": " + mui->lineEdit_2_3->text() + " " + mui->label_02_3->text() + "
" + tr("Result") + ":
";
- Result += tmpStr;
+ QString sCaption = windowTitle() + " - " + tr("LC tank calculation");
+ QString sImage = "";
+ QString sInput = "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->groupBox_1_3->title() + label1, mui->lineEdit_1_3->text(), mui->label_01_3->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->groupBox_2_3->title() + label2, mui->lineEdit_2_3->text(), mui->label_02_3->text()) + "
" + tr("Result") + ":
";
+ sResult += tmpStr;
if (!mui->radioButton_ZF->isChecked()){
data->zo = 1000 * sqrt(data->inductance / data->capacitance);
- Result += tr("Characteristic impedance") + " Z0 = " + roundTo(data->zo, loc, myOpt->dwAccuracy) + " " + tr("Ohm");
+ sResult += formattedOutput(myOpt, tr("Characteristic impedance") + " Z0 = ", roundTo(data->zo, loc, myOpt->dwAccuracy), tr("Ohm"));
}
- Result += "
" + tr("Input") + ":
";
- Input += mui->label_ind->text() + " " + mui->lineEdit_ind->text() + " " + mui->label_ind_m->text() + "
";
- Input += mui->label_freq->text() + " " + mui->lineEdit_freq->text() + " " + mui->label_freq_m->text() + "
";
- Input += mui->label_1->text() + " " + mui->lineEdit_1->text() + " " + mui->label_01->text() + "
";
- Input += mui->label_2->text() + " " + mui->lineEdit_2->text() + " " + mui->label_02->text();
- if ((myOpt->isWindingLengthOneLayerInit) && (FormCoil == _Onelayer_cw)){
- Input += "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_ind->text(), mui->lineEdit_ind->text(), mui->label_ind_m->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_freq->text(), mui->lineEdit_freq->text(), mui->label_freq_m->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_1->text(), mui->lineEdit_1->text(), mui->label_01->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2->text(), mui->lineEdit_2->text(), mui->label_02->text()) + "
";
+ if (!((myOpt->isWindingLengthOneLayerInit) && (FormCoil == _Onelayer_cw))){
+ if (mui->lineEdit_3->isEnabled())
+ sInput += formattedOutput(myOpt, mui->label_3->text(), mui->lineEdit_3->text(), mui->label_03->text()) + "
";
+ if (!(FormCoil == _Onelayer_cw))
+ sInput += formattedOutput(myOpt, mui->label_4->text(), mui->lineEdit_4->text(), mui->label_04->text()) + "
";
+ }
+ QString material_name = getCheckedRadioButton(mui->groupBox)->text();
+ sInput += formattedOutput(myOpt, mui->groupBox->title().mid(0, mui->groupBox->title().length() - 1) + " Mt:", material_name) + "
" + tr("Result") + ":
";
- Result += tr("Number of turns of the coil") + " N = " + roundTo(result.N, loc, myOpt->dwAccuracy) + "
";
+ sResult += "
" + tr("Result") + ":
";
+ sResult += formattedOutput(myOpt, tr("Number of turns of the coil") + " N = ", roundTo(result.N, loc, myOpt->dwAccuracy)) + "
";
QString _wire_length = formatLength(result.sec, myOpt->dwLengthMultiplier);
QStringList list = _wire_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_wire_length = list[0];
QString _ssLengthMeasureUnit = list[1];
- Result += tr("Length of wire without leads") + " lw = " + roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context",_ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Length of wire without leads") + " lw = ", roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy),
+ qApp->translate("Context",_ssLengthMeasureUnit.toUtf8())) + "
";
if ((myOpt->isWindingLengthOneLayerInit) && (FormCoil == _Onelayer_cw)){
d = result.five;
data->d = d;
if (myOpt->isAWG)
- Result += tr("Wire diameter") + " AWG# = " + converttoAWG(d) + "
";
+ sResult += formattedOutput(myOpt, tr("Wire diameter") + " AWG# = ", converttoAWG(d)) + "
";
else
- Result += tr("Wire diameter") + " dw = " + roundTo( (result.five)/myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy ) + " " +
- qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Wire diameter") + " dw = ", roundTo( (result.five)/myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy ),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
} else {
data->l = result.N * p + k;
- Result += tr("Length of winding") + " l = " + roundTo( (data->l)/myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy ) + " " +
- qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Length of winding") + " l = ", roundTo( (data->l)/myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy ),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
}
Material mt = Cu;
checkMaterial1(&mt);
@@ -4517,179 +4649,154 @@ void MainWindow::get_onelayerN_roundW_Result(_CoilResult result){
double mass = 0.25 * dencity * M_PI * d * d * result.sec;
double Resistivity = mtrl[mt][Rho]*1e6;
double R = (Resistivity * result.sec * 4) / (M_PI * d * d); // DC resistance of the wire
- Result += tr("Weight of wire") + " m = " + roundTo(mass, loc, myOpt->dwAccuracy) + " " + tr("g") + "
";
- Result += tr("Resistance of the coil") + " Rdc = " + roundTo(R, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + "
";
+ sResult += formattedOutput(myOpt, tr("Weight of wire") + " m = ", roundTo(mass, loc, myOpt->dwAccuracy), tr("g")) + "
";
+ sResult += formattedOutput(myOpt, tr("Resistance of the coil") + " Rdc = ", roundTo(R, loc, myOpt->dwAccuracy), tr("Ohm")) + "
";
double reactance = 2 * M_PI * I * f;
- Result += tr("Reactance of the coil") + " X = " + roundTo(reactance, loc, myOpt->dwAccuracy) + " " + tr("Ohm");
- Result += "
";
+ sResult += formattedOutput(myOpt, tr("Reactance of the coil") + " X = ", roundTo(reactance, loc, myOpt->dwAccuracy), tr("Ohm"));
+ sResult += "
";
if (f < 0.7 * result.fourth){
- Result += tr("Self capacitance") + " Cs = " + roundTo(result.thd/myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8()) + "
";
- Result += tr("Coil self-resonance frequency") + " Fsr = " + roundTo(result.fourth/myOpt->dwFrequencyMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssFrequencyMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Self capacitance") + " Cs = ", roundTo(result.thd/myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(myOpt, tr("Coil self-resonance frequency") + " Fsr = ", roundTo(result.fourth/myOpt->dwFrequencyMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssFrequencyMeasureUnit.toUtf8())) + "
";
double Ql = (double)result.six;
- Result += tr("Coil constructive Q-factor") + " Q = " + QString::number(result.six) + "
";
+ sResult += formattedOutput(myOpt, tr("Coil constructive Q-factor") + " Q = ", QString::number(result.six)) + "
";
double ESR = result.seven;
- Result += tr("Loss resistance") + " ESR = " + roundTo(ESR, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + "
";
- Result += "" + tr("Additional results for parallel LC circuit at the working frequency") + ":
";
+ sResult += "
";
+ sResult += "" + tr("Additional results for parallel LC circuit at the working frequency") + ":
";
data->capacitance = CalcLC2(I, f);
- Result += " => " + tr("Circuit capacitance") + ": Ck = " +
- roundTo((data->capacitance - result.thd) / myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy) + ' '
+ sResult += " => " + tr("Circuit capacitance") + ": Ck = " + roundTo((data->capacitance - result.thd) / myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy) + " "
+ qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8()) + "
";
double ro = 1000 * sqrt(I / data->capacitance);
- Result += " => " + tr("Characteristic impedance") + ": ρ = " + loc.toString(round(ro)) + " " + tr("Ohm") + "
";
+ sResult += " => " + tr("Characteristic impedance") + ": ρ = " + loc.toString(round(ro)) + " " + tr("Ohm") + "
";
double Qs= 1 / (0.001 + 1 / Ql); //Complete LC Q-factor including capacitor Q-factor equal to 1000
double Re = ro * Qs;
- Result += " => " + tr("Equivalent resistance") + ": Re = " + roundTo(Re / 1000, loc, myOpt->dwAccuracy) + " " + tr("kOhm") + "
";
+ sResult += " => " + tr("Equivalent resistance") + ": Re = " + roundTo(Re / 1000, loc, myOpt->dwAccuracy) + " " + tr("kOhm") + "
";
double deltaf = 1000 * data->frequency / Qs;
- Result += " => " + tr("Bandwidth") + ": 3dBΔf = " + roundTo(deltaf, loc, myOpt->dwAccuracy) + tr("kHz");
+ sResult += " => " + tr("Bandwidth") + ": 3dBΔf = " + roundTo(deltaf, loc, myOpt->dwAccuracy)+ " " + tr("kHz");
}
if(myOpt->isShowLTSpice){
- Result += "
";
- Result += "" + tr("Input data for LTSpice") + ":
";
- Result += "Inductance: " + QString::number(data->inductance * ((1 + Ql * Ql)/(Ql * Ql)), 'f', myOpt->dwAccuracy) + "μ" + "
";
- Result += "Series resistance: " + QString::number(R * 1000, 'f', myOpt->dwAccuracy) + "m" + "
";
- Result += "Parallel resistance: " + QString::number((ESR * (1 + Ql * Ql)) / 1000, 'f', myOpt->dwAccuracy) + "k" + "
";
- Result += "Parallel capacitance: " + QString::number(result.thd, 'f', myOpt->dwAccuracy) + "p" + "
";
+ sResult += "" + tr("Input data for LTSpice") + ":
";
+ sResult += "Inductance: " + QString::number(data->inductance * ((1 + Ql * Ql)/(Ql * Ql)), 'f', myOpt->dwAccuracy) + "μ" + "
";
+ sResult += "Series resistance: " + QString::number(R * 1000, 'f', myOpt->dwAccuracy) + "m" + "
";
+ sResult += "Parallel resistance: " + QString::number((ESR * (1 + Ql * Ql)) / 1000, 'f', myOpt->dwAccuracy) + "k" + "
";
+ sResult += "Parallel capacitance: " + QString::number(result.thd, 'f', myOpt->dwAccuracy) + "p" + "
" + tr("Input") + ":
";
- Input += mui->label_ind->text() + " " + mui->lineEdit_ind->text() + " " + mui->label_ind_m->text() + "
";
- Input += mui->label_freq->text() + " " + mui->lineEdit_freq->text() + " " + mui->label_freq_m->text() + "
";
- Input += mui->label_1->text() + " " + mui->lineEdit_1->text() + " " + mui->label_01->text() + "
";
- Input += mui->label_2->text() + " " + mui->lineEdit_2->text() + " " + mui->label_02->text() + "
";
- Input += mui->label_3->text() + " " + mui->lineEdit_3->text() + " " + mui->label_03->text() + "
";
- Input += mui->label_4->text() + " " + mui->lineEdit_4->text() + " " + mui->label_04->text() + "
";
- Input += mui->label_5->text() + " " + mui->lineEdit_5->text() + " " + mui->label_05->text() + "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_ind->text(), mui->lineEdit_ind->text(), mui->label_ind_m->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_freq->text(), mui->lineEdit_freq->text(), mui->label_freq_m->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_1->text(), mui->lineEdit_1->text(), mui->label_01->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2->text(), mui->lineEdit_2->text(), mui->label_02->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_3->text(), mui->lineEdit_3->text(), mui->label_03->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_4->text(), mui->lineEdit_4->text(), mui->label_04->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_5->text(), mui->lineEdit_5->text(), mui->label_05->text()) + "
";
+ QString material_name = getCheckedRadioButton(mui->groupBox)->text();
+ sInput += formattedOutput(myOpt, mui->groupBox->title().mid(0, mui->groupBox->title().length() - 1) + " Mt:", material_name) + "
" + tr("Result") + ":
";
- Result += tr("Number of turns of the coil") + " N = " + roundTo(result.N, loc, myOpt->dwAccuracy) + "
";
+ QString sResult = "
" + tr("Result") + ":
";
+ sResult += formattedOutput(myOpt, tr("Number of turns of the coil") + " N = ", roundTo(result.N, loc, myOpt->dwAccuracy)) + "
";
QString _wire_length = formatLength(result.sec, myOpt->dwLengthMultiplier);
QStringList list = _wire_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_wire_length = list[0];
QString _ssLengthMeasureUnit = list[1];
- Result += tr("Length of wire without leads") + " lw = " + roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context",_ssLengthMeasureUnit.toUtf8()) + "
";
- Result += tr("Length of winding") + " l = " + roundTo( (result.N * p + w)/myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy ) + " " +
- qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Length of wire without leads") + " lw = ", roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy),
+ qApp->translate("Context",_ssLengthMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(myOpt, tr("Length of winding") + " l = ", roundTo( (result.N * p + w)/myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy ),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
Material mt = Cu;
checkMaterial1(&mt);
double dencity = mtrl[mt][Dencity];
double mass = dencity * w * t * result.sec;
double Resistivity = mtrl[mt][Rho]*1e6;
double R = (Resistivity * result.sec) / (w * t); // DC resistance of the wire
- Result += tr("Weight of wire") + " m = " + roundTo(mass, loc, myOpt->dwAccuracy) + " " + tr("g") + "
";
+ sResult += formattedOutput(myOpt, tr("Weight of wire") + " m = ", roundTo(mass, loc, myOpt->dwAccuracy), tr("g")) + "
";
double reactance = 2 * M_PI * I * f;
- Result += tr("Resistance of the coil") + " Rdc = " + roundTo(R, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + "
";
- Result += tr("Reactance of the coil") + " X = " + roundTo(reactance, loc, myOpt->dwAccuracy) + " " + tr("Ohm");
- Result += "
";
+ sResult += formattedOutput(myOpt, tr("Resistance of the coil") + " Rdc = ", roundTo(R, loc, myOpt->dwAccuracy), tr("Ohm")) + "
";
+ sResult += formattedOutput(myOpt, tr("Reactance of the coil") + " X = ", roundTo(reactance, loc, myOpt->dwAccuracy), tr("Ohm"));
+ sResult += "
";
if (f < 0.7 * result.fourth){
- Result += tr("Self capacitance") + " Cs = " + roundTo(result.thd/myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8()) + "
";
- Result += tr("Coil self-resonance frequency") + " Fsr = " + roundTo(result.fourth/myOpt->dwFrequencyMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssFrequencyMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Self capacitance") + " Cs = ", roundTo(result.thd/myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(myOpt, tr("Coil self-resonance frequency") + " Fsr = ", roundTo(result.fourth/myOpt->dwFrequencyMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssFrequencyMeasureUnit.toUtf8())) + "
";
double Ql = (double)result.six;
- Result += tr("Coil constructive Q-factor") + " Q = " + QString::number(result.six) + "
";
+ sResult += formattedOutput(myOpt, tr("Coil constructive Q-factor") + " Q = ", QString::number(result.six)) + "
";
double ESR = result.seven;
- Result += tr("Loss resistance") + " ESR = " + roundTo(ESR, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + "
";
- Result += "" + tr("Additional results for parallel LC circuit at the working frequency") + ":
";
+ sResult += "
";
+ sResult += "" + tr("Additional results for parallel LC circuit at the working frequency") + ":
";
data->capacitance = CalcLC2(I, f);
- Result += " => " + tr("Circuit capacitance") + ": Ck = " +
+ sResult += " => " + tr("Circuit capacitance") + ": Ck = " +
roundTo((data->capacitance - result.thd) / myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy) + ' '
+ qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8()) + "
";
double ro = 1000 * sqrt(I / data->capacitance);
- Result += " => " + tr("Characteristic impedance") + ": ρ = " + loc.toString(round(ro)) + " " + tr("Ohm") + "
";
+ sResult += " => " + tr("Characteristic impedance") + ": ρ = " + loc.toString(round(ro)) + " " + tr("Ohm") + "
";
double Qs= 1 / (0.001 + 1 / Ql); //Complete LC Q-factor including capacitor Q-factor equal to 1000
double Re = ro * Qs;
- Result += " => " + tr("Equivalent resistance") + ": Re = " + roundTo(Re / 1000, loc, myOpt->dwAccuracy) + " " + tr("kOhm") + "
";
+ sResult += " => " + tr("Equivalent resistance") + ": Re = " + roundTo(Re / 1000, loc, myOpt->dwAccuracy) + " " + tr("kOhm") + "
";
double deltaf = 1000 * data->frequency / Qs;
- Result += " => " + tr("Bandwidth") + ": 3dBΔf = " + roundTo(deltaf, loc, myOpt->dwAccuracy) + tr("kHz");
+ sResult += " => " + tr("Bandwidth") + ": 3dBΔf = " + roundTo(deltaf, loc, myOpt->dwAccuracy) + tr("kHz");
}
if(myOpt->isShowLTSpice){
- Result += "
";
- Result += "" + tr("Input data for LTSpice") + ":
";
- Result += "Inductance: " + QString::number(data->inductance * ((1 + Ql * Ql)/(Ql * Ql)), 'f', myOpt->dwAccuracy) + "μ" + "
";
- Result += "Series resistance: " + QString::number(R * 1000, 'f', myOpt->dwAccuracy) + "m" + "
";
- Result += "Parallel resistance: " + QString::number((ESR * (1 + Ql * Ql)) / 1000, 'f', myOpt->dwAccuracy) + "k" + "
";
- Result += "Parallel capacitance: " + QString::number(result.thd, 'f', myOpt->dwAccuracy) + "p" + "
";
+ sResult += "" + tr("Input data for LTSpice") + ":
";
+ sResult += "Inductance: " + QString::number(data->inductance * ((1 + Ql * Ql)/(Ql * Ql)), 'f', myOpt->dwAccuracy) + "μ" + "
";
+ sResult += "Series resistance: " + QString::number(R * 1000, 'f', myOpt->dwAccuracy) + "m" + "
";
+ sResult += "Parallel resistance: " + QString::number((ESR * (1 + Ql * Ql)) / 1000, 'f', myOpt->dwAccuracy) + "k" + "
";
+ sResult += "Parallel capacitance: " + QString::number(result.thd, 'f', myOpt->dwAccuracy) + "p" + "
" + tr("Input") + ":
";
- Input += mui->label_ind->text() + " " + mui->lineEdit_ind->text() + " " + mui->label_ind_m->text() + "
";
- Input += mui->label_freq->text() + " " + mui->lineEdit_freq->text() + " " + mui->label_freq_m->text() + "
";
- Input += mui->label_1->text() + " " + mui->lineEdit_1->text() + " " + mui->label_01->text() + "
";
- Input += mui->label_2->text() + " " + mui->lineEdit_2->text() + " " + mui->label_02->text() + "
";
- Input += mui->label_3->text() + " " + mui->lineEdit_3->text() + " " + mui->label_03->text() + "
";
- Input += mui->label_4->text() + " " + mui->lineEdit_4->text() + " " + mui->label_04->text() + "
";
- Input += mui->label_5->text() + " " + mui->lineEdit_5->text() + "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_ind->text(), mui->lineEdit_ind->text(), mui->label_ind_m->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_freq->text(), mui->lineEdit_freq->text(), mui->label_freq_m->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_1->text(), mui->lineEdit_1->text(), mui->label_01->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2->text(), mui->lineEdit_2->text(), mui->label_02->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_3->text(), mui->lineEdit_3->text(), mui->label_03->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_4->text(), mui->lineEdit_4->text(), mui->label_04->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_5->text(), mui->lineEdit_5->text()) + "
";
+ QString material_name = getCheckedRadioButton(mui->groupBox)->text();
+ sInput += formattedOutput(myOpt, mui->groupBox->title().mid(0, mui->groupBox->title().length() - 1) + " Mt:", material_name) + "
" + tr("Result") + ":
";
- Result += tr("Number of turns of the coil") + " N = " + roundTo(result.N, loc, myOpt->dwAccuracy) + "
";
+ QString sResult = "
" + tr("Result") + ":
";
+ sResult += formattedOutput(myOpt, tr("Number of turns of the coil") + " N = ", roundTo(result.N, loc, myOpt->dwAccuracy)) + "
";
QString _wire_length = formatLength(result.thd, myOpt->dwLengthMultiplier);
QStringList list = _wire_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_wire_length = list[0];
QString _ssLengthMeasureUnit = list[1];
- Result += tr("Length of wire without leads") + " lw = " + roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context",_ssLengthMeasureUnit.toUtf8()) + "
";
- Result += tr("Length of winding") + " l = " + roundTo( (result.N * p + k)/myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy ) + " " +
- qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Length of wire without leads") + " lw = ", roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy),
+ qApp->translate("Context",_ssLengthMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(myOpt, tr("Length of winding") + " l = ", roundTo( (result.N * p + k)/myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy ),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
Material mt = Cu;
checkMaterial1(&mt);
double dencity = mtrl[mt][Dencity];
double mass = 0.25 * dencity * M_PI * d * d * result.thd;
double Resistivity = mtrl[mt][Rho]*1e6;
double R = (Resistivity * result.thd * 4) / (M_PI * d * d); // DC resistance of the wire
- Result += tr("Weight of wire") + " m = " + roundTo(mass, loc, myOpt->dwAccuracy) + " " + tr("g") + "
";
+ sResult += formattedOutput(myOpt, tr("Weight of wire") + " m = ", roundTo(mass, loc, myOpt->dwAccuracy), tr("g")) + "
";
double reactance = 2 * M_PI * I * f;
- Result += tr("Resistance of the coil") + " Rdc = " + roundTo(R, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + "
";
- Result += tr("Reactance of the coil") + " X = " + roundTo(reactance, loc, myOpt->dwAccuracy) + " " + tr("Ohm");
- Result += "
";
+ sResult += formattedOutput(myOpt, tr("Resistance of the coil") + " Rdc = ", roundTo(R, loc, myOpt->dwAccuracy), tr("Ohm")) + "
";
+ sResult += formattedOutput(myOpt, tr("Reactance of the coil") + " X = ", roundTo(reactance, loc, myOpt->dwAccuracy), tr("Ohm"));
+ sResult += "
";
if (f < 0.7 * result.five){
- Result += tr("Self capacitance") + " Cs = " + roundTo(result.fourth/myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8()) + "
";
- Result += tr("Coil self-resonance frequency") + " Fsr = " + roundTo(result.five/myOpt->dwFrequencyMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssFrequencyMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Self capacitance") + " Cs = ", roundTo(result.fourth/myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(myOpt, tr("Coil self-resonance frequency") + " Fsr = " + roundTo(result.five/myOpt->dwFrequencyMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssFrequencyMeasureUnit.toUtf8())) + "
";
double Ql = (double)result.six;
- Result += tr("Coil constructive Q-factor") + " Q = " + QString::number(result.six) + "
";
+ sResult += formattedOutput(myOpt, tr("Coil constructive Q-factor") + " Q = ", QString::number(result.six)) + "
";
double ESR = result.seven;
- Result += tr("Loss resistance") + " ESR = " + roundTo(ESR, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + "
";
- Result += "" + tr("Additional results for parallel LC circuit at the working frequency") + ":
";
+ sResult += "
";
+ sResult += "" + tr("Additional results for parallel LC circuit at the working frequency") + ":
";
data->capacitance = CalcLC2(I, f);
- Result += " => " + tr("Circuit capacitance") + ": Ck = " +
+ sResult += " => " + tr("Circuit capacitance") + ": Ck = " +
roundTo((data->capacitance - result.fourth) / myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy) + ' '
+ qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8()) + "
";
double ro = 1000 * sqrt(I / data->capacitance);
- Result += " => " + tr("Characteristic impedance") + ": ρ = " + loc.toString(round(ro)) + " " + tr("Ohm") + "
";
+ sResult += " => " + tr("Characteristic impedance") + ": ρ = " + loc.toString(round(ro)) + " " + tr("Ohm") + "
";
double Qs= 1 / (0.001 + 1 / Ql); //Complete LC Q-factor including capacitor Q-factor equal to 1000
double Re = ro * Qs;
- Result += " => " + tr("Equivalent resistance") + ": Re = " + roundTo(Re / 1000, loc, myOpt->dwAccuracy) + " " + tr("kOhm") + "
";
+ sResult += " => " + tr("Equivalent resistance") + ": Re = " + roundTo(Re / 1000, loc, myOpt->dwAccuracy) + " " + tr("kOhm") + "
";
double deltaf = 1000 * data->frequency / Qs;
- Result += " => " + tr("Bandwidth") + ": 3dBΔf = " + roundTo(deltaf, loc, myOpt->dwAccuracy) + tr("kHz");
+ sResult += " => " + tr("Bandwidth") + ": 3dBΔf = " + roundTo(deltaf, loc, myOpt->dwAccuracy) + tr("kHz");
}
if(myOpt->isShowLTSpice){
- Result += "
";
- Result += "" + tr("Input data for LTSpice") + ":
";
- Result += "Inductance: " + QString::number(data->inductance * ((1 + Ql * Ql)/(Ql * Ql)), 'f', myOpt->dwAccuracy) + "μ" + "
";
- Result += "Series resistance: " + QString::number(R * 1000, 'f', myOpt->dwAccuracy) + "m" + "
";
- Result += "Parallel resistance: " + QString::number((ESR * (1 + Ql * Ql)) / 1000, 'f', myOpt->dwAccuracy) + "k" + "
";
- Result += "Parallel capacitance: " + QString::number(result.fourth, 'f', myOpt->dwAccuracy) + "p" + "
";
+ sResult += "" + tr("Input data for LTSpice") + ":
";
+ sResult += "Inductance: " + QString::number(data->inductance * ((1 + Ql * Ql)/(Ql * Ql)), 'f', myOpt->dwAccuracy) + "μ" + "
";
+ sResult += "Series resistance: " + QString::number(R * 1000, 'f', myOpt->dwAccuracy) + "m" + "
";
+ sResult += "Parallel resistance: " + QString::number((ESR * (1 + Ql * Ql)) / 1000, 'f', myOpt->dwAccuracy) + "k" + "
";
+ sResult += "Parallel capacitance: " + QString::number(result.fourth, 'f', myOpt->dwAccuracy) + "p" + "
" + tr("Input") + ":
";
- Input += mui->label_ind->text() + " " + mui->lineEdit_ind->text() + " " + mui->label_ind_m->text() + "
";
- Input += mui->label_1->text() + " " + mui->lineEdit_1->text() + " " + mui->label_01->text() + "
";
- Input += mui->label_2->text() + " " + mui->lineEdit_2->text() + " " + mui->label_02->text() + "
";
- Input += mui->label_3->text() + " " + mui->lineEdit_3->text() + " " + mui->label_03->text() + "
";
- Input += mui->label_4->text() + " " + mui->lineEdit_4->text() + " " + mui->label_04->text() + "
";
- Input += mui->comboBox_checkMLWinding->currentText() + "
" + tr("Result") + ":
";
+void MainWindow::get_multilayerN_Result(_CoilResult result)
+{
+ QString sCaption = windowTitle() + " - " + mui->listWidget->currentItem()->text();
+ QString sImage = "";
+ if (myOpt->windingKind == 0)
+ sImage = "";
+ else
+ sImage = "";
+ QString sInput = "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_ind->text(), mui->lineEdit_ind->text(), mui->label_ind_m->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_1->text(), mui->lineEdit_1->text(), mui->label_01->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2->text(), mui->lineEdit_2->text(), mui->label_02->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_3->text(), mui->lineEdit_3->text(), mui->label_03->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_4->text(), mui->lineEdit_4->text(), mui->label_04->text()) + "
";
+ sInput += mui->comboBox_checkMLWinding->currentText() + "
" + tr("Result") + ":
";
data->N = result.six;
- Result += tr("Number of turns of the coil") + " N = " + QString::number(result.six) + "
";
+ sResult += formattedOutput(myOpt, tr("Number of turns of the coil") + " N = ", QString::number(result.six)) + "
";
data->c = result.fourth;
- Result += tr("Thickness of the coil") + " c = " + roundTo(result.fourth / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Thickness of the coil") + " c = ", roundTo(result.fourth / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
double D = loc.toDouble(mui->lineEdit_1->text())*myOpt->dwLengthMultiplier;
double width = (2 * result.fourth + D) / myOpt->dwLengthMultiplier;
- Result += tr("Dimensions of inductor") + ": " + mui->lineEdit_2->text() + "x" + loc.toString(ceil(width / myOpt->dwLengthMultiplier))
- + "x" + loc.toString(ceil(width / myOpt->dwLengthMultiplier)) + " " + qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Dimensions of inductor") + " S: ", mui->lineEdit_2->text() + "x" + loc.toString(ceil(width / myOpt->dwLengthMultiplier))
+ + "x" + loc.toString(ceil(width / myOpt->dwLengthMultiplier)), qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
QString _wire_length = formatLength(result.sec, myOpt->dwLengthMultiplier);
QStringList list = _wire_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_wire_length = list[0];
QString _ssLengthMeasureUnit = list[1];
- Result += tr("Length of wire without leads") + " lw = " + roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context",_ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Length of wire without leads") + " lw = ", roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy),
+ qApp->translate("Context",_ssLengthMeasureUnit.toUtf8())) + "
";
double d = 0;
if (myOpt->isAWG){
d = convertfromAWG(mui->lineEdit_3->text());
@@ -4821,55 +4914,42 @@ void MainWindow::get_multilayerN_Result(_CoilResult result){
double Resistivity = mtrl[Cu][Rho]*1e6;
double Rdc = (Resistivity * result.sec * 4) / (M_PI * d * d); // DC resistance of the wire
data->Rdc = Rdc;
- Result += tr("Resistance of the coil") + " Rdc = " + roundTo(Rdc, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + "
";
- Result += tr("Weight of wire") + " m = " + roundTo(mass, loc, myOpt->dwAccuracy) + " " + tr("g") + "
";
- Result += tr("Number of layers") + " Nl = " + loc.toString(result.thd);
- Result += "
" + tr("Input") + ":
";
- Input += mui->label_ind->text() + " " + mui->lineEdit_ind->text() + " " + mui->label_ind_m->text() + "
";
- Input += mui->label_1->text() + " " + mui->lineEdit_1->text() + " " + mui->label_01->text() + "
";
- Input += mui->label_2->text() + " " + mui->lineEdit_2->text() + " " + mui->label_02->text() + "
";
- Input += mui->label_3->text() + " " + mui->lineEdit_3->text() + " " + mui->label_03->text() + "
";
- Input += mui->label_4->text() + " " + mui->lineEdit_4->text() + " " + mui->label_04->text() + "
";
- Input += mui->label_5->text() + " " + mui->lineEdit_5->text() + " " + mui->label_05->text() + "
";
- Input += mui->label_6->text() + " " + mui->lineEdit_6->text() + " " + mui->label_06->text() + "
" + tr("Result") + ":
";
+void MainWindow::get_multilayerNgap_Result(_CoilResult result)
+{
+ QString sCaption = windowTitle() + " - " + mui->listWidget->currentItem()->text();
+ QString sImage = "";
+ QString sInput = "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_ind->text(), mui->lineEdit_ind->text(), mui->label_ind_m->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_1->text(), mui->lineEdit_1->text(), mui->label_01->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2->text(), mui->lineEdit_2->text(), mui->label_02->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_3->text(), mui->lineEdit_3->text(), mui->label_03->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_4->text(), mui->lineEdit_4->text(), mui->label_04->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_5->text(), mui->lineEdit_5->text(), mui->label_05->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_6->text(), mui->lineEdit_6->text(), mui->label_06->text()) + "
" + tr("Result") + ":
";
data->N = result.six;
- Result += tr("Number of turns of the coil") + " N = " + QString::number(result.six) + "
";
- Result += tr("Thickness of the coil") + " c = " + roundTo(result.fourth / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Number of turns of the coil") + " N = ", QString::number(result.six)) + "
";
+ sResult += formattedOutput(myOpt, tr("Thickness of the coil") + " c = ", roundTo(result.fourth / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
double D = loc.toDouble(mui->lineEdit_1->text())*myOpt->dwLengthMultiplier;
double width = (2 * result.fourth + D) / myOpt->dwLengthMultiplier;
- Result += tr("Dimensions of inductor") + ": " + mui->lineEdit_2->text() + "x" + loc.toString(ceil(width / myOpt->dwLengthMultiplier))
- + "x" + loc.toString(ceil(width / myOpt->dwLengthMultiplier)) + " " + qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Dimensions of inductor") + " S: ", mui->lineEdit_2->text() + "x" + loc.toString(ceil(width / myOpt->dwLengthMultiplier))
+ + "x" + loc.toString(ceil(width / myOpt->dwLengthMultiplier)), qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
QString _wire_length = formatLength(result.sec, myOpt->dwLengthMultiplier);
QStringList list = _wire_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_wire_length = list[0];
QString _ssLengthMeasureUnit = list[1];
- Result += tr("Length of wire without leads") + " lw = " + roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context",_ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Length of wire without leads") + " lw = ", roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy),
+ qApp->translate("Context",_ssLengthMeasureUnit.toUtf8())) + "
";
double d = 0;
if (myOpt->isAWG){
d = convertfromAWG(mui->lineEdit_3->text());
@@ -4881,59 +4961,46 @@ void MainWindow::get_multilayerNgap_Result(_CoilResult result){
double Resistivity = mtrl[Cu][Rho]*1e6;
double Rdc = (Resistivity * result.sec * 4) / (M_PI * d * d); // DC resistance of the wire
data->Rdc = Rdc;
- Result += tr("Resistance of the coil") + " Rdc = " + roundTo(Rdc, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + "
";
- Result += tr("Weight of wire") + " m = " + roundTo(mass, loc, myOpt->dwAccuracy) + " " + tr("g") + "
";
- Result += tr("Number of layers") + " Nl = " + loc.toString(result.thd) + "
";
- Result += tr("Number of interlayers") + " Ng = " + loc.toString(result.five);
- Result += "
" + tr("Input") + ":
";
- Input += mui->label_ind->text() + " " + mui->lineEdit_ind->text() + " " + mui->label_ind_m->text() + "
";
- Input += mui->label_1->text() + " " + mui->lineEdit_1->text() + " " + mui->label_01->text() + "
";
- Input += mui->label_2->text() + " " + mui->lineEdit_2->text() + " " + mui->label_02->text() + "
";
- Input += mui->label_3->text() + " " + mui->lineEdit_3->text() + " " + mui->label_03->text() + "
";
- Input += mui->label_4->text() + " " + mui->lineEdit_4->text() + " " + mui->label_04->text() + "
";
- Input += mui->label_5->text() + " " + mui->lineEdit_5->text() + "
" + tr("Result") + ":
";
+void MainWindow::get_multilayerN_Rect_Result(_CoilResult result)
+{
+ QString sCaption = windowTitle() + " - " + mui->listWidget->currentItem()->text();
+ QString sImage = "";
+ QString sInput = "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_ind->text(), mui->lineEdit_ind->text(), mui->label_ind_m->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_1->text(), mui->lineEdit_1->text(), mui->label_01->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2->text(), mui->lineEdit_2->text(), mui->label_02->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_3->text(), mui->lineEdit_3->text(), mui->label_03->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_4->text(), mui->lineEdit_4->text(), mui->label_04->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_5->text(), mui->lineEdit_5->text()) + "
" + tr("Result") + ":
";
data->N = result.N;
data->c = result.five;
- Result += tr("Number of turns of the coil") + " N = " + loc.toString(result.N) + "
";
- Result += tr("Number of layers") + " Nl = " + loc.toString(result.sec) + "
";
- Result += tr("Thickness of the coil") + " c = " + roundTo(result.five / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Number of turns of the coil") + " N = ", loc.toString(result.N)) + "
";
+ sResult += formattedOutput(myOpt, tr("Number of layers") + " Nl = ", loc.toString(result.sec)) + "
";
+ sResult += formattedOutput(myOpt, tr("Thickness of the coil") + " c = ", roundTo(result.five / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
double a = loc.toDouble(mui->lineEdit_1->text())*myOpt->dwLengthMultiplier;
double width = (2 * result.five + a) / myOpt->dwLengthMultiplier;
double b = loc.toDouble(mui->lineEdit_2->text())*myOpt->dwLengthMultiplier;
double height = (2 * result.five + b) / myOpt->dwLengthMultiplier;
- Result += tr("Dimensions of inductor") + ": " + mui->lineEdit_3->text() + "x" + loc.toString(ceil(width))
- + "x" + loc.toString(ceil(height)) + " " + qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Dimensions of inductor") + " S: ", mui->lineEdit_3->text() + "x" + loc.toString(ceil(width))
+ + "x" + loc.toString(ceil(height)) + " ", qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
QString _wire_length = formatLength(result.thd, myOpt->dwLengthMultiplier);
QStringList list = _wire_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_wire_length = list[0];
QString _ssLengthMeasureUnit = list[1];
- Result += tr("Length of wire without leads") + " lw = " + roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context",_ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Length of wire without leads") + " lw = ", roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy),
+ qApp->translate("Context",_ssLengthMeasureUnit.toUtf8())) + "
";
double d = 0;
if (myOpt->isAWG){
d = convertfromAWG(mui->lineEdit_4->text());
@@ -4945,240 +5012,177 @@ void MainWindow::get_multilayerN_Rect_Result(_CoilResult result){
double Resistivity = mtrl[Cu][Rho]*1e6;
double Rdc = (Resistivity * result.thd * 4) / (M_PI * d * d); // DC resistance of the wire
data->Rdc = Rdc;
- Result += tr("Weight of wire") + " m = " + roundTo(mass, loc, myOpt->dwAccuracy) + " " + tr("g") + "
";
- Result += tr("Resistance of the coil") + " Rdc = " + roundTo(result.fourth, loc, myOpt->dwAccuracy) + " " + tr("Ohm");
- Result += "
" + tr("Input") + ":
";
- Input += mui->label_ind->text() + " " + mui->lineEdit_ind->text() + " " + mui->label_ind_m->text() + "
";
- Input += mui->label_1->text() + " " + mui->lineEdit_1->text() + " " + mui->label_01->text() + "
";
- Input += mui->label_2->text() + " " + mui->lineEdit_2->text() + " " + mui->label_02->text() + "
";
- Input += mui->label_3->text() + " " + mui->lineEdit_3->text() + " " + mui->label_03->text() + "
";
- Input += mui->label_4->text() + " " + mui->lineEdit_4->text() + " " + mui->label_04->text() + "
" + tr("Result") + ":
";
+ QString sCaption = windowTitle() + " - " + mui->listWidget->currentItem()->text();
+ QString sImage = "";
+ QString sInput = "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_ind->text(), mui->lineEdit_ind->text(), mui->label_ind_m->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_1->text(), mui->lineEdit_1->text(), mui->label_01->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2->text(), mui->lineEdit_2->text(), mui->label_02->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_3->text(), mui->lineEdit_3->text(), mui->label_03->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_4->text(), mui->lineEdit_4->text(), mui->label_04->text()) + "
" + tr("Result") + ":
";
data->N = result.N;
- Result += tr("Number of turns of the coil") + " N = " + loc.toString(result.N) + "
";
- Result += tr("Outside diameter") + " Do = " + roundTo(result.thd / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Number of turns of the coil") + " N = ", loc.toString(result.N)) + "
";
+ sResult += formattedOutput(myOpt, tr("Outside diameter") + " Do = ", roundTo(result.thd / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
QString _foil_length = formatLength(result.sec, myOpt->dwLengthMultiplier);
QStringList list = _foil_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_foil_length = list[0];
QString _ssLengthMeasureUnit = list[1];
- Result += tr("Length of the foil") + " lf = " + roundTo(d_foil_length.toDouble(), loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context",_ssLengthMeasureUnit.toUtf8()) + "
";
- Result += tr("Resistance of the coil") + " Rdc = " + roundTo(result.fourth, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + " (" + tr("Copper") + ")
";
- Result += tr("Resistance of the coil") + " Rdc = " + roundTo(result.five, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + " (" + tr("Aluminum") + ")";
- Result += "
" + tr("Input") + ":
";
- Input += mui->label_ind->text() + " " + mui->lineEdit_ind->text() + " " + mui->label_ind_m->text() + "
";
- Input += mui->label_1->text() + " " + mui->lineEdit_1->text() + " " + mui->label_01->text() + "
";
- Input += mui->label_2->text() + " " + mui->lineEdit_2->text() + " " + mui->label_02->text() + "
";
- Input += mui->label_3->text() + " " + mui->lineEdit_3->text() + " " + mui->label_03->text() + "
";
- Input += mui->label_4->text() + " " + mui->lineEdit_4->text() + " " + mui->label_04->text() + "
";
- Input += mui->label_5->text() + " " + mui->lineEdit_5->text() + "
";
- Input += mui->label_6->text() + " " + mui->lineEdit_6->text() + " " + mui->label_06->text() + "
" + tr("Result") + ":
";
+void MainWindow::get_ferrToroidN_Result(_CoilResult result)
+{
+ QString sCaption = windowTitle() + " - " + mui->listWidget->currentItem()->text();
+ QString sImage = "";
+ QString sInput = "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_ind->text(), mui->lineEdit_ind->text(), mui->label_ind_m->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_1->text(), mui->lineEdit_1->text(), mui->label_01->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2->text(), mui->lineEdit_2->text(), mui->label_02->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_3->text(), mui->lineEdit_3->text(), mui->label_03->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_4->text(), mui->lineEdit_4->text(), mui->label_04->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_5->text(), mui->lineEdit_5->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_6->text(), mui->lineEdit_6->text(), mui->label_06->text()) + "
" + tr("Result") + ":
";
if (result.sec > 0) {
data->N = result.N;
- Result += tr("Number of turns of the coil") + " N = " + roundTo(result.N, loc, myOpt->dwAccuracy) + "
";
+ sResult += formattedOutput(myOpt, tr("Number of turns of the coil") + " N = ", roundTo(result.N, loc, myOpt->dwAccuracy)) + "
";
QString _wire_length = formatLength(result.sec, myOpt->dwLengthMultiplier);
QStringList list = _wire_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_wire_length = list[0];
QString _ssLengthMeasureUnit = list[1];
- Result += tr("Length of wire without leads") + " lw = " + roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context",_ssLengthMeasureUnit.toUtf8()) + "
";
- Result += "AL = " + loc.toString(result.thd)
- + " " + qApp->translate("Context","nH") + "/N2";
+ sResult += formattedOutput(myOpt, tr("Length of wire without leads") + " lw = ", roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy),
+ qApp->translate("Context",_ssLengthMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(myOpt, "AL = ", loc.toString(result.thd), qApp->translate("Context","nH") + "/N2");
} else {
- Result += "" + tr("Coil can not be realized") + "! ";
+ sResult += "" + tr("Coil can not be realized") + "! ";
mui->statusBar->showMessage(tr("Coil can not be realized") + "!");
}
- Result += "
" + tr("Input") + ":
";
- Input += mui->label_ind->text() + " " + mui->lineEdit_ind->text() + " " + mui->label_ind_m->text() + "
";
- Input += mui->label_freq->text() + " " + mui->lineEdit_freq->text() + " " + mui->label_freq_m->text() + "
";
- Input += mui->label_1->text() + " " + mui->lineEdit_1->text() + " " + mui->label_01->text() + "
";
- Input += mui->label_2->text() + " " + mui->lineEdit_2->text() + " " + mui->label_02->text() + "
";
+ QString sInput = "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_ind->text(), mui->lineEdit_ind->text(), mui->label_ind_m->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_freq->text(), mui->lineEdit_freq->text(), mui->label_freq_m->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_1->text(), mui->lineEdit_1->text(), mui->label_01->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2->text(), mui->lineEdit_2->text(), mui->label_02->text()) + "
";
if (mui->comboBox_checkPCB->currentIndex() == 2)
- Input += mui->label_3->text() + " " + mui->lineEdit_3->text() + " " + mui->label_03->text() + "
";
- Input += mui->label_4->text() + " " + mui->lineEdit_4->text() + " " + mui->label_04->text() + "
";
- Input += mui->groupBox_6->title() + " " + loc.toString((double)mui->horizontalSlider->value()/100) + "
" + tr("Result") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_3->text(), mui->lineEdit_3->text(), mui->label_03->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_4->text(), mui->lineEdit_4->text(), mui->label_04->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->groupBox_6->title(), loc.toString((double)mui->horizontalSlider->value()/100)) + "
" + tr("Result") + ":
";
if ((result.N != 0) && (result.sec != 0) && (result.thd != 0)){
data->N = result.N;
data->s = QString::number(result.sec, 'f', myOpt->dwAccuracy).toDouble();
data->w = QString::number(result.thd, 'f', myOpt->dwAccuracy).toDouble();
- Result += tr("Number of turns of the coil") + " N = " + roundTo(result.N, loc, myOpt->dwAccuracy) + "
";
- Result += tr("Winding pitch") + " s = " + roundTo(result.sec / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
- Result += tr("Width of a PCB trace") + " W = " + roundTo(result.thd / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
- Result += tr("Coil constructive Q-factor") + " Q ≈ " + QString::number(round(result.fourth));
+ sResult += formattedOutput(myOpt, tr("Number of turns of the coil") + " N = ", roundTo(result.N, loc, myOpt->dwAccuracy)) + "
";
+ sResult += formattedOutput(myOpt, tr("Winding pitch") + " s = ", roundTo(result.sec / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(myOpt, tr("Width of a PCB trace") + " W = ", roundTo(result.thd / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(myOpt, tr("Coil constructive Q-factor") + " Q ≈ ", QString::number(round(result.fourth)));
} else {
- Result += tr("Invalid input parameter combination");
+ sResult += tr("Invalid input parameter combination");
}
- Result += "
" + tr("Input") + ":
";
- Input += mui->label_ind->text() + " " + mui->lineEdit_ind->text() + " " + mui->label_ind_m->text() + "
";
- Input += mui->label_1->text() + " " + mui->lineEdit_1->text() + " " + mui->label_01->text() + "
";
- Input += mui->label_2->text() + " " + mui->lineEdit_2->text() + " " + mui->label_02->text() + "
";
- Input += mui->label_3->text() + " " + mui->lineEdit_3->text() + " " + mui->label_03->text() + "
" + tr("Result") + ":
";
+void MainWindow::get_spiralN_Result(_CoilResult result)
+{
+ QString sCaption = windowTitle() + " - " + mui->listWidget->currentItem()->text();
+ QString sImage = "";
+ QString sInput = "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_ind->text(), mui->lineEdit_ind->text(), mui->label_ind_m->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_1->text(), mui->lineEdit_1->text(), mui->label_01->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2->text(), mui->lineEdit_2->text(), mui->label_02->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_3->text(), mui->lineEdit_3->text(), mui->label_03->text()) + "
" + tr("Result") + ":
";
data->N = result.N;
data->Do = result.thd;
- Result += tr("Number of turns of the coil") + " N = " + loc.toString(result.N) + "
";
- Result += tr("Outside diameter") + " Do = " + roundTo(result.thd / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Number of turns of the coil") + " N = ", loc.toString(result.N)) + "
";
+ sResult += formattedOutput(myOpt, tr("Outside diameter") + " Do = ", roundTo(result.thd / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
QString _wire_length = formatLength(result.sec, myOpt->dwLengthMultiplier);
QStringList list = _wire_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_wire_length = list[0];
QString _ssLengthMeasureUnit = list[1];
- Result += tr("Length of wire without leads") + " lw = " + roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context",_ssLengthMeasureUnit.toUtf8()) + "
" + tr("Input") + ":
";
- Input += mui->label_N->text() + " " + mui->lineEdit_N->text() + "
";
- Input += mui->label_freq2->text() + " " + mui->lineEdit_freq2->text() + " " + mui->label_freq_m2->text() + "
";
- Input += mui->label_1_2->text() + " " + mui->lineEdit_1_2->text() + " " + mui->label_01_2->text() + "
";
- Input += mui->label_2_2->text() + " " + mui->lineEdit_2_2->text() + " " + mui->label_02_2->text() + "
";
+void MainWindow::get_onelayerI_roundW_Result(_CoilResult result)
+{
+ QString sCaption = windowTitle() + " - " + mui->listWidget->currentItem()->text();
+ QString sImage = "";
+ if (FormCoil == _Onelayer_cw)
+ sImage = "";
+ else
+ sImage = "";
+ QString sInput = "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_N->text(), mui->lineEdit_N->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_freq2->text(), mui->lineEdit_freq2->text(), mui->label_freq_m2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_1_2->text(), mui->lineEdit_1_2->text(), mui->label_01_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2_2->text(), mui->lineEdit_2_2->text(), mui->label_02_2->text()) + "
";
if (FormCoil == _Onelayer_cw)
- Input += mui->label_3_2->text() + " " + mui->lineEdit_3_2->text() + " " + mui->label_03_2->text() + "
";
+ sInput += formattedOutput(myOpt, mui->label_3_2->text(), mui->lineEdit_3_2->text(), mui->label_03_2->text()) + "
";
else {
if (mui->lineEdit_3_2->isEnabled())
- Input += mui->label_3_2->text() + " " + mui->lineEdit_3_2->text() + " " + mui->label_03_2->text() + "
";
- Input += mui->label_4_2->text() + " " + mui->lineEdit_4_2->text() + " " + mui->label_04_2->text() + "
" + tr("Result") + ":
";
+ QString sResult = "
" + tr("Result") + ":
";
double I = result.N;
data->inductance = result.N;
- Result += tr("Inductance") + " L = " + roundTo(I/myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Inductance") + " L = ", roundTo(I/myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8())) + "
";
QString _wire_length = formatLength(result.sec, myOpt->dwLengthMultiplier);
QStringList list = _wire_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_wire_length = list[0];
QString _ssLengthMeasureUnit = list[1];
- Result += tr("Length of wire without leads") + " lw = " + roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context",_ssLengthMeasureUnit.toUtf8()) + "
";
- Result += tr("Length of winding") + " l = " + roundTo( (N * p + k)/myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy ) + " " +
- qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Length of wire without leads") + " lw = ", roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy),
+ qApp->translate("Context",_ssLengthMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(myOpt, tr("Length of winding") + " l = ", roundTo( (N * p + k)/myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy ),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
Material mt = Cu;
checkMaterial2(&mt);
double dencity = mtrl[mt][Dencity];
double mass = 0.25 * dencity * M_PI * d * d * result.sec;
double Resistivity = mtrl[mt][Rho]*1e6;
double R = (Resistivity * result.sec * 4) / (M_PI * d * d); // DC resistance of the wire
- Result += tr("Weight of wire") + " m = " + roundTo(mass, loc, myOpt->dwAccuracy) + " " + tr("g") + "
";
+ sResult += formattedOutput(myOpt, tr("Weight of wire") + " m = ", roundTo(mass, loc, myOpt->dwAccuracy), tr("g")) + "
";
double reactance = 2 * M_PI * I * f;
- Result += tr("Resistance of the coil") + " Rdc = " + roundTo(R, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + "
";
- Result += tr("Reactance of the coil") + " X = " + roundTo(reactance, loc, myOpt->dwAccuracy) + " " + tr("Ohm");
- Result += "
";
+ sResult += formattedOutput(myOpt, tr("Resistance of the coil") + " Rdc = ", roundTo(R, loc, myOpt->dwAccuracy), tr("Ohm")) + "
";
+ sResult += formattedOutput(myOpt, tr("Reactance of the coil") + " X = ", roundTo(reactance, loc, myOpt->dwAccuracy), tr("Ohm"));
+ sResult += "
";
if (f < 0.7 * result.fourth){
- Result += tr("Self capacitance") + " Cs = " + roundTo(result.thd/myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8()) + "
";
- Result += tr("Coil self-resonance frequency") + " Fsr = " + roundTo(result.fourth/myOpt->dwFrequencyMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssFrequencyMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Self capacitance") + " Cs = ", roundTo(result.thd/myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(myOpt, tr("Coil self-resonance frequency") + " Fsr = ", roundTo(result.fourth/myOpt->dwFrequencyMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssFrequencyMeasureUnit.toUtf8())) + "
";
double Ql = (double)result.six;
- Result += tr("Coil constructive Q-factor") + " Q = " + QString::number(result.six) + "
";
+ sResult += formattedOutput(myOpt, tr("Coil constructive Q-factor") + " Q = ", QString::number(result.six)) + "
";
double ESR = result.seven;
- Result += tr("Loss resistance") + " ESR = " + roundTo(ESR, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + "
";
- Result += "" + tr("Additional results for parallel LC circuit at the working frequency") + ":
";
+ sResult += "
";
+ sResult += "" + tr("Additional results for parallel LC circuit at the working frequency") + ":
";
data->capacitance = CalcLC2(I, f);
- Result += " => " + tr("Circuit capacitance") + ": Ck = " +
+ sResult += " => " + tr("Circuit capacitance") + ": Ck = " +
roundTo((data->capacitance - result.thd) / myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy) + ' '
+ qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8()) + "
";
double ro = 1000 * sqrt(I / data->capacitance);
- Result += " => " + tr("Characteristic impedance") + ": ρ = " + loc.toString(round(ro)) + " " + tr("Ohm") + "
";
+ sResult += " => " + tr("Characteristic impedance") + ": ρ = " + loc.toString(round(ro)) + " " + tr("Ohm") + "
";
double Qs= 1 / (0.001 + 1 / Ql); //Complete LC Q-factor including capacitor Q-factor equal to 1000
double Re = ro * Qs;
- Result += " => " + tr("Equivalent resistance") + ": Re = " + roundTo(Re / 1000, loc, myOpt->dwAccuracy) + " " + tr("kOhm") + "
";
+ sResult += " => " + tr("Equivalent resistance") + ": Re = " + roundTo(Re / 1000, loc, myOpt->dwAccuracy) + " " + tr("kOhm") + "
";
double deltaf = 1000 * f / Qs;
- Result += " => " + tr("Bandwidth") + ": 3dBΔf = " + roundTo(deltaf, loc, myOpt->dwAccuracy) + tr("kHz");
+ sResult += " => " + tr("Bandwidth") + ": 3dBΔf = " + roundTo(deltaf, loc, myOpt->dwAccuracy) + tr("kHz");
}
if(myOpt->isShowLTSpice){
- Result += "
";
- Result += "" + tr("Input data for LTSpice") + ":
";
- Result += "Inductance: " + QString::number(data->inductance * ((1 + Ql * Ql)/(Ql * Ql)), 'f', myOpt->dwAccuracy) + "μ" + "
";
- Result += "Series resistance: " + QString::number(R * 1000, 'f', myOpt->dwAccuracy) + "m" + "
";
- Result += "Parallel resistance: " + QString::number((ESR * (1 + Ql * Ql)) / 1000, 'f', myOpt->dwAccuracy) + "k" + "
";
- Result += "Parallel capacitance: " + QString::number(result.thd, 'f', myOpt->dwAccuracy) + "p" + "
";
+ sResult += "" + tr("Input data for LTSpice") + ":
";
+ sResult += "Inductance: " + QString::number(data->inductance * ((1 + Ql * Ql)/(Ql * Ql)), 'f', myOpt->dwAccuracy) + "μ" + "
";
+ sResult += "Series resistance: " + QString::number(R * 1000, 'f', myOpt->dwAccuracy) + "m" + "
";
+ sResult += "Parallel resistance: " + QString::number((ESR * (1 + Ql * Ql)) / 1000, 'f', myOpt->dwAccuracy) + "k" + "
";
+ sResult += "Parallel capacitance: " + QString::number(result.thd, 'f', myOpt->dwAccuracy) + "p" + "
" + tr("Input") + ":
";
- Input += mui->label_N->text() + " " + mui->lineEdit_N->text() + "
";
- Input += mui->label_freq2->text() + " " + mui->lineEdit_freq2->text() + " " + mui->label_freq_m2->text() + "
";
- Input += mui->label_1_2->text() + " " + mui->lineEdit_1_2->text() + " " + mui->label_01_2->text() + "
";
- Input += mui->label_2_2->text() + " " + mui->lineEdit_2_2->text() + " " + mui->label_02_2->text() + "
";
- Input += mui->label_3_2->text() + " " + mui->lineEdit_3_2->text() + " " + mui->label_03_2->text() + "
";
- Input += mui->label_4_2->text() + " " + mui->lineEdit_4_2->text() + " " + mui->label_04_2->text() + "
";
- Input += mui->label_5_2->text() + " " + mui->lineEdit_5_2->text() + " " + mui->label_05_2->text() + "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_N->text(), mui->lineEdit_N->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_freq2->text(), mui->lineEdit_freq2->text(), mui->label_freq_m2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_1_2->text(), mui->lineEdit_1_2->text(), mui->label_01_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2_2->text(), mui->lineEdit_2_2->text(), mui->label_02_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_3_2->text(), mui->lineEdit_3_2->text(), mui->label_03_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_4_2->text(), mui->lineEdit_4_2->text(), mui->label_04_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_5_2->text(), mui->lineEdit_5_2->text(), mui->label_05_2->text()) + "
";
+ QString material_name = getCheckedRadioButton(mui->groupBox_2)->text();
+ sInput += formattedOutput(myOpt, mui->groupBox_2->title().mid(0, mui->groupBox_2->title().length() - 1) + " Mt:", material_name) + "
" + tr("Result") + ":
";
+ QString sResult = "
" + tr("Result") + ":
";
double I = result.N;
data->inductance = result.N;
- Result += tr("Inductance") + " L = " + roundTo(I/myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Inductance") + " L = ", roundTo(I/myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8())) + "
";
QString _wire_length = formatLength(result.sec, myOpt->dwLengthMultiplier);
QStringList list = _wire_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_wire_length = list[0];
QString _ssLengthMeasureUnit = list[1];
- Result += tr("Length of wire without leads") + " lw = " + roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context",_ssLengthMeasureUnit.toUtf8()) + "
";
- Result += tr("Length of winding") + " l = " + roundTo( (N * p + w)/myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy ) + " " +
- qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Length of wire without leads") + " lw = ", roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy),
+ qApp->translate("Context",_ssLengthMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(myOpt, tr("Length of winding") + " l = ", roundTo( (N * p + w)/myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy ),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
Material mt = Cu;
checkMaterial2(&mt);
double dencity = mtrl[mt][Dencity];
double mass = dencity * w * t * result.sec;
- Result += tr("Weight of wire") + " m = " + roundTo(mass, loc, myOpt->dwAccuracy) + " " + tr("g") + "
";
+ sResult += formattedOutput(myOpt, tr("Weight of wire") + " m = ", roundTo(mass, loc, myOpt->dwAccuracy), tr("g")) + "
";
double reactance = 2 * M_PI * I * f;
double Resistivity = mtrl[mt][Rho]*1e6;
double R = (Resistivity * result.sec) / (w * t); // DC resistance of the wire
- Result += tr("Resistance of the coil") + " Rdc = " + roundTo(R, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + "
";
- Result += tr("Reactance of the coil") + " X = " + roundTo(reactance, loc, myOpt->dwAccuracy) + " " + tr("Ohm");
- Result += "
";
+ sResult += formattedOutput(myOpt, tr("Resistance of the coil") + " Rdc = ", roundTo(R, loc, myOpt->dwAccuracy), tr("Ohm")) + "
";
+ sResult += formattedOutput(myOpt, tr("Reactance of the coil") + " X = ", roundTo(reactance, loc, myOpt->dwAccuracy), tr("Ohm"));
+ sResult += "
";
if (f < 0.7 * result.fourth){
- Result += tr("Self capacitance") + " Cs = " + roundTo(result.thd/myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8()) + "
";
- Result += tr("Coil self-resonance frequency") + " Fsr = " + roundTo(result.fourth/myOpt->dwFrequencyMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssFrequencyMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Self capacitance") + " Cs = ", roundTo(result.thd/myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(myOpt, tr("Coil self-resonance frequency") + " Fsr = ", roundTo(result.fourth/myOpt->dwFrequencyMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssFrequencyMeasureUnit.toUtf8())) + "
";
double Ql = (double)result.six;
- Result += tr("Coil constructive Q-factor") + " Q = " + QString::number(result.six) + "
";
+ sResult += formattedOutput(myOpt, tr("Coil constructive Q-factor") + " Q = ", QString::number(result.six)) + "
";
double ESR = result.seven;
- Result += tr("Loss resistance") + " ESR = " + roundTo(ESR, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + "
";
- Result += "" + tr("Additional results for parallel LC circuit at the working frequency") + ":
";
+ sResult += "
";
+ sResult += "" + tr("Additional results for parallel LC circuit at the working frequency") + ":
";
data->capacitance = CalcLC2(I, f);
- Result += " => " + tr("Circuit capacitance") + ": Ck = " +
+ sResult += " => " + tr("Circuit capacitance") + ": Ck = " +
roundTo((data->capacitance - result.thd) / myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy) + ' '
+ qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8()) + "
";
double ro = 1000 * sqrt(I / data->capacitance);
- Result += " => " + tr("Characteristic impedance") + ": ρ = " + loc.toString(round(ro)) + " " + tr("Ohm") + "
";
+ sResult += " => " + tr("Characteristic impedance") + ": ρ = " + loc.toString(round(ro)) + " " + tr("Ohm") + "
";
double Qs= 1 / (0.001 + 1 / Ql);// Complete LC Q-factor including capacitor Q-factor equal to 1000
double Re = ro * Qs;
- Result += " => " + tr("Equivalent resistance") + ": Re = " + roundTo(Re / 1000, loc, myOpt->dwAccuracy) + " " + tr("kOhm") + "
";
+ sResult += " => " + tr("Equivalent resistance") + ": Re = " + roundTo(Re / 1000, loc, myOpt->dwAccuracy) + " " + tr("kOhm") + "
";
double deltaf = 1000 * data->frequency / Qs;
- Result += " => " + tr("Bandwidth") + ": 3dBΔf = " + roundTo(deltaf, loc, myOpt->dwAccuracy) + tr("kHz");
+ sResult += " => " + tr("Bandwidth") + ": 3dBΔf = " + roundTo(deltaf, loc, myOpt->dwAccuracy) + tr("kHz");
}
if(myOpt->isShowLTSpice){
- Result += "
";
- Result += "" + tr("Input data for LTSpice") + ":
";
- Result += "Inductance: " + QString::number(data->inductance * ((1 + Ql * Ql)/(Ql * Ql)), 'f', myOpt->dwAccuracy) + "μ" + "
";
- Result += "Series resistance: " + QString::number(R * 1000, 'f', myOpt->dwAccuracy) + "m" + "
";
- Result += "Parallel resistance: " + QString::number((ESR * (1 + Ql * Ql)) / 1000, 'f', myOpt->dwAccuracy) + "k" + "
";
- Result += "Parallel capacitance: " + QString::number(result.thd, 'f', myOpt->dwAccuracy) + "p" + "
";
+ sResult += "" + tr("Input data for LTSpice") + ":
";
+ sResult += "Inductance: " + QString::number(data->inductance * ((1 + Ql * Ql)/(Ql * Ql)), 'f', myOpt->dwAccuracy) + "μ" + "
";
+ sResult += "Series resistance: " + QString::number(R * 1000, 'f', myOpt->dwAccuracy) + "m" + "
";
+ sResult += "Parallel resistance: " + QString::number((ESR * (1 + Ql * Ql)) / 1000, 'f', myOpt->dwAccuracy) + "k" + "
";
+ sResult += "Parallel capacitance: " + QString::number(result.thd, 'f', myOpt->dwAccuracy) + "p" + "
" + tr("Input") + ":
";
- Input += mui->label_N->text() + " " + mui->lineEdit_N->text() + "
";
- Input += mui->label_freq2->text() + " " + mui->lineEdit_freq2->text() + " " + mui->label_freq_m2->text() + "
";
- Input += mui->label_1_2->text() + " " + mui->lineEdit_1_2->text() + " " + mui->label_01_2->text() + "
";
- Input += mui->label_2_2->text() + " " + mui->lineEdit_2_2->text() + " " + mui->label_02_2->text() + "
";
- Input += mui->label_3_2->text() + " " + mui->lineEdit_3_2->text() + " " + mui->label_03_2->text() + "
";
- Input += mui->label_4_2->text() + " " + mui->lineEdit_4_2->text() + " " + mui->label_04_2->text() + "
";
- Input += mui->label_5_2->text() + " " + mui->lineEdit_5_2->text() + "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_N->text(), mui->lineEdit_N->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_freq2->text(), mui->lineEdit_freq2->text(), mui->label_freq_m2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_1_2->text(), mui->lineEdit_1_2->text(), mui->label_01_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2_2->text(), mui->lineEdit_2_2->text(), mui->label_02_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_3_2->text(), mui->lineEdit_3_2->text(), mui->label_03_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_4_2->text(), mui->lineEdit_4_2->text(), mui->label_04_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_5_2->text(), mui->lineEdit_5_2->text()) + "
";
+ QString material_name = getCheckedRadioButton(mui->groupBox_2)->text();
+ sInput += formattedOutput(myOpt, mui->groupBox_2->title().mid(0, mui->groupBox_2->title().length() - 1) + " Mt:", material_name) + "
" + tr("Result") + ":
";
+ QString sResult = "
" + tr("Result") + ":
";
double I = result.sec;
data->inductance = result.sec;
- Result += tr("Inductance") + " L = " + roundTo(I/myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Inductance") + " L = ", roundTo(I/myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8())) + "
";
double lW = result.thd;
QString _wire_length = formatLength(lW, myOpt->dwLengthMultiplier);
QStringList list = _wire_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_wire_length = list[0];
QString _ssLengthMeasureUnit = list[1];
- Result += tr("Length of wire without leads") + " lw = " + roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context",_ssLengthMeasureUnit.toUtf8()) + "
";
- Result += tr("Length of winding") + " l = " + roundTo( (N * p + k)/myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Length of wire without leads") + " lw = ", roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy),
+ qApp->translate("Context",_ssLengthMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(myOpt, tr("Length of winding") + " l = ", roundTo( (N * p + k)/myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
Material mt = Cu;
checkMaterial2(&mt);
double dencity = mtrl[mt][Dencity];
double mass = 0.25 * dencity * M_PI * d * d * lW;
- Result += tr("Weight of wire") + " m = " + roundTo(mass, loc, myOpt->dwAccuracy) + " " + tr("g") + "
";
+ sResult += formattedOutput(myOpt, tr("Weight of wire") + " m = ", roundTo(mass, loc, myOpt->dwAccuracy), tr("g")) + "
";
double reactance = 2 * M_PI * I * f;
double Resistivity = mtrl[mt][Rho]*1e6;
double R = (Resistivity * lW * 4) / (M_PI * d * d); // DC resistance of the wire
- Result += tr("Resistance of the coil") + " Rdc = " + roundTo(R, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + "
";
- Result += tr("Reactance of the coil") + " X = " + roundTo(reactance, loc, myOpt->dwAccuracy) + " " + tr("Ohm");
- Result += "
";
+ sResult += formattedOutput(myOpt, tr("Resistance of the coil") + " Rdc = ", roundTo(R, loc, myOpt->dwAccuracy), tr("Ohm")) + "
";
+ sResult += formattedOutput(myOpt, tr("Reactance of the coil") + " X = ", roundTo(reactance, loc, myOpt->dwAccuracy), tr("Ohm"));
+ sResult += "
";
if (f < 0.7 * result.five){
- Result += tr("Self capacitance") + " Cs = " + roundTo(result.fourth/myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8()) + "
";
- Result += tr("Coil self-resonance frequency") + " Fsr = " + roundTo(result.five/myOpt->dwFrequencyMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssFrequencyMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Self capacitance") + " Cs = ", roundTo(result.fourth/myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(myOpt, tr("Coil self-resonance frequency") + " Fsr = ", roundTo(result.five/myOpt->dwFrequencyMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssFrequencyMeasureUnit.toUtf8())) + "
";
double Ql = (double)result.six;
- Result += tr("Coil constructive Q-factor") + " Q = " + QString::number(result.six) + "
";
+ sResult += formattedOutput(myOpt, tr("Coil constructive Q-factor") + " Q = ", QString::number(result.six)) + "
";
double ESR = result.seven;
- Result += tr("Loss resistance") + " ESR = " + roundTo(ESR, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + "
";
- Result += "" + tr("Additional results for parallel LC circuit at the working frequency") + ":
";
+ sResult += "
";
+ sResult += "" + tr("Additional results for parallel LC circuit at the working frequency") + ":
";
data->capacitance = CalcLC2(I, f);
- Result += " => " + tr("Circuit capacitance") + ": Ck = " +
+ sResult += " => " + tr("Circuit capacitance") + ": Ck = " +
roundTo((data->capacitance - result.fourth) / myOpt->dwCapacityMultiplier, loc, myOpt->dwAccuracy) + ' '
+ qApp->translate("Context", myOpt->ssCapacityMeasureUnit.toUtf8()) + "
";
double ro = 1000 * sqrt(I / data->capacitance);
- Result += " => " + tr("Characteristic impedance") + ": ρ = " + loc.toString(round(ro)) + " " + tr("Ohm") + "
";
+ sResult += " => " + tr("Characteristic impedance") + ": ρ = " + loc.toString(round(ro)) + " " + tr("Ohm") + "
";
double Qs= 1 / (0.001 + 1 / Ql); //Complete LC Q-factor including capacitor Q-factor equal to 1000
double Re = ro * Qs;
- Result += " => " + tr("Equivalent resistance") + ": Re = " + roundTo(Re / 1000, loc, myOpt->dwAccuracy) + " " + tr("kOhm") + "
";
+ sResult += " => " + tr("Equivalent resistance") + ": Re = " + roundTo(Re / 1000, loc, myOpt->dwAccuracy) + " " + tr("kOhm") + "
";
double deltaf = 1000 * f / Qs;
- Result += " => " + tr("Bandwidth") + ": 3dBΔf = " + roundTo(deltaf, loc, myOpt->dwAccuracy) + tr("kHz");
+ sResult += " => " + tr("Bandwidth") + ": 3dBΔf = " + roundTo(deltaf, loc, myOpt->dwAccuracy) + tr("kHz");
}
if(myOpt->isShowLTSpice){
- Result += "
";
- Result += "" + tr("Input data for LTSpice") + ":
";
- Result += "Inductance: " + QString::number(data->inductance * ((1 + Ql * Ql)/(Ql * Ql)), 'f', myOpt->dwAccuracy) + "μ" + "
";
- Result += "Series resistance: " + QString::number(R * 1000, 'f', myOpt->dwAccuracy) + "m" + "
";
- Result += "Parallel resistance: " + QString::number((ESR * (1 + Ql * Ql)) / 1000, 'f', myOpt->dwAccuracy) + "k" + "
";
- Result += "Parallel capacitance: " + QString::number(result.fourth, 'f', myOpt->dwAccuracy) + "p" + "
";
+ sResult += "" + tr("Input data for LTSpice") + ":
";
+ sResult += "Inductance: " + QString::number(data->inductance * ((1 + Ql * Ql)/(Ql * Ql)), 'f', myOpt->dwAccuracy) + "μ" + "
";
+ sResult += "Series resistance: " + QString::number(R * 1000, 'f', myOpt->dwAccuracy) + "m" + "
";
+ sResult += "Parallel resistance: " + QString::number((ESR * (1 + Ql * Ql)) / 1000, 'f', myOpt->dwAccuracy) + "k" + "
";
+ sResult += "Parallel capacitance: " + QString::number(result.fourth, 'f', myOpt->dwAccuracy) + "p" + "
" + tr("Input") + ":
";
- Input += mui->label_1_2->text() + " " + mui->lineEdit_1_2->text() + " " + mui->label_01_2->text() + "
";
- Input += mui->label_2_2->text() + " " + mui->lineEdit_2_2->text() + " " + mui->label_02_2->text() + "
";
+void MainWindow::get_multilayerI_Result(_CoilResult result)
+{
+ QString sCaption = windowTitle() + " - " + mui->listWidget->currentItem()->text();
+ QString sImage = "";
+ if (myOpt->windingKind == 0)
+ sImage = "";
+ else
+ sImage = "";
+ QString sInput = "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_1_2->text(), mui->lineEdit_1_2->text(), mui->label_01_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2_2->text(), mui->lineEdit_2_2->text(), mui->label_02_2->text()) + "
";
if (mui->radioButton_6->isChecked())
- Input += mui->label_3_2->text() + " " + mui->lineEdit_3_2->text() + "
";
+ sInput += formattedOutput(myOpt, mui->label_3_2->text(), mui->lineEdit_3_2->text()) + "
";
else
- Input += mui->label_3_2->text() + " " + mui->lineEdit_3_2->text() + " " + mui->label_03_2->text() + "
";
- Input += mui->label_4_2->text() + " " + mui->lineEdit_4_2->text() + " " + mui->label_04_2->text() + "
";
- Input += mui->label_5_2->text() + " " + mui->lineEdit_5_2->text() + " " + mui->label_05_2->text() + "
";
- Input += mui->comboBox_checkMLWinding->currentText() + "
" + tr("Result") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_3_2->text(), mui->lineEdit_3_2->text(), mui->label_03_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_4_2->text(), mui->lineEdit_4_2->text(), mui->label_04_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_5_2->text(), mui->lineEdit_5_2->text(), mui->label_05_2->text()) + "
";
+ sInput += mui->comboBox_checkMLWinding->currentText() + "
" + tr("Result") + ":
";
if (mui->radioButton_6->isChecked()){
- Result += tr("Inductance") + " L = " + roundTo(result.N, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Inductance") + " L = ", roundTo(result.N, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8())) + "
";
data->inductance = result.N;
- Result += tr("Thickness of the coil") + " c = " + roundTo(result.five / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Thickness of the coil") + " c = " + roundTo(result.five / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
data->c = result.five;
- Result += tr("Resistance of the coil") + " Rdc = " + roundTo(result.fourth, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + "
";
+ sResult += formattedOutput(myOpt, tr("Resistance of the coil") + " Rdc = ", roundTo(result.fourth, loc, myOpt->dwAccuracy), tr("Ohm")) + "
";
data->Rdc = result.fourth;
QString _wire_length = formatLength(result.thd, myOpt->dwLengthMultiplier);
QStringList list = _wire_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_wire_length = list[0];
QString _ssLengthMeasureUnit = list[1];
- Result += tr("Length of wire without leads") + " lw = " + roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context",_ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Length of wire without leads") + " lw = ", roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy),
+ qApp->translate("Context",_ssLengthMeasureUnit.toUtf8())) + "
";
double d = 0;
if (myOpt->isAWG){
d = convertfromAWG(mui->lineEdit_4_2->text());
@@ -5514,107 +5484,81 @@ void MainWindow::get_multilayerI_Result(_CoilResult result){
}
double dencity = mtrl[Cu][Dencity];
double mass = 0.25 * dencity * M_PI * d * d * result.thd;
- Result += tr("Weight of wire") + " m = " + roundTo(mass, loc, myOpt->dwAccuracy) + " " + tr("g") + "
";
- Result += tr("Number of layers") + " Nl = " + loc.toString(result.sec);
+ sResult += formattedOutput(myOpt, tr("Weight of wire") + " m = ", roundTo(mass, loc, myOpt->dwAccuracy), tr("g")) + "
";
+ sResult += formattedOutput(myOpt, tr("Number of layers") + " Nl = ", loc.toString(result.sec));
} else {
double N1 = result.thd;
double N2 = result.fourth;
double L1 = result.N;
double L2 = result.sec;
- data->inductance = sqrt(L1*L2);
- Result += tr("Number of turns of the coil") + " N = " + loc.toString(N1) + "..." + loc.toString(N2) + "
";
- Result += tr("Inductance") + " L = " + roundTo(L1 / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy) + "..."
- + roundTo(L2 / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8());
+ data->inductance = (L1 + L2)/2;
+ sResult += formattedOutput(myOpt, tr("Number of turns of the coil") + " N = ", loc.toString(N1) + "..." + loc.toString(N2)) + "
";
+ sResult += formattedOutput(myOpt, tr("Inductance") + " L = ", roundTo(L1 / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy) + "..."
+ + roundTo(L2 / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8()));
}
- Result += "
" + tr("Input") + ":
";
- Input += mui->label_1_2->text() + " " + mui->lineEdit_1_2->text() + " " + mui->label_01_2->text() + "
";
- Input += mui->label_2_2->text() + " " + mui->lineEdit_2_2->text() + " " + mui->label_02_2->text() + "
";
- Input += mui->label_3_2->text() + " " + mui->lineEdit_3_2->text() + " " + mui->label_03_2->text() + "
";
- Input += mui->label_4_2->text() + " " + mui->lineEdit_4_2->text() + " " + mui->label_04_2->text() + "
";
- Input += mui->label_5_2->text() + " " + mui->lineEdit_5_2->text() + " " + mui->label_05_2->text() + "
";
- Input += mui->label_6_2->text() + " " + mui->lineEdit_6_2->text() + " " + mui->label_06_2->text() + "
";
- Input += mui->label_7_2->text() + " " + mui->lineEdit_7_2->text() + "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_1_2->text(), mui->lineEdit_1_2->text(), mui->label_01_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2_2->text(), mui->lineEdit_2_2->text(), mui->label_02_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_3_2->text(), mui->lineEdit_3_2->text(), mui->label_03_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_4_2->text(), mui->lineEdit_4_2->text(), mui->label_04_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_5_2->text(), mui->lineEdit_5_2->text(), mui->label_05_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_6_2->text(), mui->lineEdit_6_2->text(), mui->label_06_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_7_2->text(), mui->lineEdit_7_2->text()) + "
" + tr("Result") + ":
";
- Result += tr("Number of turns of the coil") + " N = " + loc.toString(N1) + "..." + loc.toString(N2) + "
";
- Result += tr("Inductance") + " L = " + roundTo(L1 / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy) + "..."
- + roundTo(L2 / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8());
- Result += "
" + tr("Input") + ":
";
- Input += mui->label_1_2->text() + " " + mui->lineEdit_1_2->text() + " " + mui->label_01_2->text() + "
";
- Input += mui->label_2_2->text() + " " + mui->lineEdit_2_2->text() + " " + mui->label_02_2->text() + "
";
- Input += mui->label_3_2->text() + " " + mui->lineEdit_3_2->text() + " " + mui->label_03_2->text() + "
";
+ data->inductance = (L1 + L2) / 2;
+ QString sResult = "
" + tr("Result") + ":
";
+ sResult += formattedOutput(myOpt, tr("Number of turns of the coil") + " N = ", loc.toString(N1) + "..." + loc.toString(N2)) + "
";
+ sResult += formattedOutput(myOpt, tr("Inductance") + " L = ", roundTo(L1 / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy) + "..."
+ + roundTo(L2 / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8()));
+ sResult += "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_1_2->text(), mui->lineEdit_1_2->text(), mui->label_01_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2_2->text(), mui->lineEdit_2_2->text(), mui->label_02_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_3_2->text(), mui->lineEdit_3_2->text(), mui->label_03_2->text()) + "
";
if (mui->radioButton_6->isChecked())
- Input += mui->label_4_2->text() + " " + mui->lineEdit_4_2->text() + "
";
+ sInput += formattedOutput(myOpt, mui->label_4_2->text(), mui->lineEdit_4_2->text()) + "
";
else
- Input += mui->label_4_2->text() + " " + mui->lineEdit_4_2->text() + " " + mui->label_04_2->text() + "
";
- Input += mui->label_5_2->text() + " " + mui->lineEdit_5_2->text() + " " + mui->label_05_2->text() + "
";
- Input += mui->label_6_2->text() + " " + mui->lineEdit_6_2->text() + " " + mui->label_06_2->text() + "
" + tr("Result") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_4_2->text(), mui->lineEdit_4_2->text(), mui->label_04_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_5_2->text(), mui->lineEdit_5_2->text(), mui->label_05_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_6_2->text(), mui->lineEdit_6_2->text(), mui->label_06_2->text()) + "
" + tr("Result") + ":
";
if (mui->radioButton_6->isChecked()){
- Result += tr("Inductance") + " L = " + roundTo(result.N, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Inductance") + " L = ", roundTo(result.N, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8())) + "
";
data->inductance = result.N;
- Result += tr("Thickness of the coil") + " c = " + roundTo(result.five / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Thickness of the coil") + " c = ", roundTo(result.five / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
data->c = result.five;
QString _wire_length = formatLength(result.thd, myOpt->dwLengthMultiplier);
QStringList list = _wire_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_wire_length = list[0];
QString _ssLengthMeasureUnit = list[1];
- Result += tr("Length of wire without leads") + " lw = " + roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context",_ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Length of wire without leads") + " lw = ", roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy),
+ qApp->translate("Context",_ssLengthMeasureUnit.toUtf8())) + "
";
double d = 0;
if (myOpt->isAWG){
d = convertfromAWG(mui->lineEdit_5_2->text());
@@ -5625,213 +5569,155 @@ void MainWindow::get_multilayerI_Rect_Result(_CoilResult result){
double mass = 0.25 * dencity * M_PI * d * d * result.thd;
double Resistivity = mtrl[Cu][Rho]*1e6;
double Rdc = (Resistivity * result.thd * 4) / (M_PI * d * d); // DC resistance of the wire
- Result += tr("Resistance of the coil") + " Rdc = " + roundTo(Rdc, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + "
";
+ sResult += formattedOutput(myOpt, tr("Resistance of the coil") + " Rdc = ", roundTo(Rdc, loc, myOpt->dwAccuracy), tr("Ohm")) + "
";
data->Rdc = result.fourth;
- Result += tr("Weight of wire") + " m = " + roundTo(mass, loc, myOpt->dwAccuracy) + " " + tr("g") + "
";
- Result += tr("Number of layers") + " Nl = " + loc.toString(result.sec);
+ sResult += formattedOutput(myOpt, tr("Weight of wire") + " m = ", roundTo(mass, loc, myOpt->dwAccuracy), tr("g")) + "
";
+ sResult += formattedOutput(myOpt, tr("Number of layers") + " Nl = ", loc.toString(result.sec));
} else {
double N1 = result.thd;
double N2 = result.fourth;
double L1 = result.N;
double L2 = result.sec;
- data->inductance = sqrt(L1*L2);
- Result += tr("Number of turns of the coil") + " N = " + loc.toString(N1) + "..." + loc.toString(N2) + "
";
- Result += tr("Inductance") + " L = " + roundTo(L1 / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy) + "..."
- + roundTo(L2 / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8());
+ data->inductance = (L1 + L2) / 2;
+ sResult += formattedOutput(myOpt, tr("Number of turns of the coil") + " N = ", loc.toString(N1) + "..." + loc.toString(N2)) + "
";
+ sResult += formattedOutput(myOpt, tr("Inductance") + " L = ", roundTo(L1 / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy) + "..."
+ + roundTo(L2 / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8()));
}
- Result += "
" + tr("Input") + ":
";
- Input += mui->label_N->text() + " " + mui->lineEdit_N->text() + "
";
- Input += mui->label_1_2->text() + " " + mui->lineEdit_1_2->text() + " " + mui->label_01_2->text() + "
";
- Input += mui->label_2_2->text() + " " + mui->lineEdit_2_2->text() + " " + mui->label_02_2->text() + "
";
- Input += mui->label_3_2->text() + " " + mui->lineEdit_3_2->text() + " " + mui->label_03_2->text() + "
";
- Input += mui->label_4_2->text() + " " + mui->lineEdit_4_2->text() + " " + mui->label_04_2->text() + "
" + tr("Result") + ":
";
+ QString sCaption = windowTitle() + " - " + mui->listWidget->currentItem()->text();
+ QString sImage = "";
+ QString sInput = "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_N->text(), mui->lineEdit_N->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_1_2->text(), mui->lineEdit_1_2->text(), mui->label_01_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2_2->text(), mui->lineEdit_2_2->text(), mui->label_02_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_3_2->text(), mui->lineEdit_3_2->text(), mui->label_03_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_4_2->text(), mui->lineEdit_4_2->text(), mui->label_04_2->text()) + "
" + tr("Result") + ":
";
data->inductance = result.N;
- Result += tr("Inductance") + " L = " + roundTo(result.N, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Inductance") + " L = ", roundTo(result.N, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8())) + "
";
QString _foil_length = formatLength(result.sec, myOpt->dwLengthMultiplier);
QStringList list = _foil_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_foil_length = list[0];
QString _ssLengthMeasureUnit = list[1];
- Result += tr("Length of the foil") + " lf = " + roundTo(d_foil_length.toDouble(), loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context",_ssLengthMeasureUnit.toUtf8()) + "
";
- Result += tr("Outside diameter") + " Do = " + roundTo(result.thd / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
- Result += tr("Resistance of the coil") + " Rdc = " + roundTo(result.fourth, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + " (" + tr("Copper") + ")
";
- Result += tr("Resistance of the coil") + " Rdc = " + roundTo(result.five, loc, myOpt->dwAccuracy) + " " + tr("Ohm") + " (" + tr("Aluminum") + ")";
- Result += "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_N->text(), mui->lineEdit_N->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_1_2->text(), mui->lineEdit_1_2->text(), mui->label_01_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2_2->text(), mui->lineEdit_2_2->text(), mui->label_02_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_3_2->text(), mui->lineEdit_3_2->text(), mui->label_03_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_4_2->text(), mui->lineEdit_4_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_5_2->text(), mui->lineEdit_5_2->text(), mui->label_05_2->text()) + "
" + tr("Result") + ":
";
+ data->inductance = result.N;
+ sResult += formattedOutput(myOpt, tr("Inductance") + " L = ", roundTo(result.N / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(myOpt, "AL = ", loc.toString(result.thd), qApp->translate("Context","nH") + "/N2");
+ sResult += "
" + tr("Input") + ":
";
- Input += mui->label_N->text() + " " + mui->lineEdit_N->text() + "
";
- Input += mui->label_1_2->text() + " " + mui->lineEdit_1_2->text() + " " + mui->label_01_2->text() + "
";
- Input += mui->label_2_2->text() + " " + mui->lineEdit_2_2->text() + " " + mui->label_02_2->text() + "
";
- Input += mui->label_3_2->text() + " " + mui->lineEdit_3_2->text() + " " + mui->label_03_2->text() + "
";
- Input += mui->label_4_2->text() + " " + mui->lineEdit_4_2->text() + "
";
- Input += mui->label_5_2->text() + " " + mui->lineEdit_5_2->text() + " " + mui->label_05_2->text() + "
" + tr("Result") + ":
";
- data->inductance = result.N;
- Result += tr("Inductance") + " L = " + roundTo(result.N / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8()) + "
";
- Result += "AL = " + loc.toString(result.thd)
- + " " + qApp->translate("Context","nH") + "/N2";
- Result += "
" + tr("Input") + ":
";
- Input += mui->label_N->text() + " " + mui->lineEdit_N->text() + "
";
- Input += mui->label_freq2->text() + " " + mui->lineEdit_freq2->text() + " " + mui->label_freq_m2->text() + "
";
+ QString sInput = "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_N->text(), mui->lineEdit_N->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_freq2->text(), mui->lineEdit_freq2->text(), mui->label_freq_m2->text()) + "
";
if (mui->comboBox_checkPCB->currentIndex() == 2)
- Input += mui->label_1_2->text() + " " + mui->lineEdit_1_2->text() + " " + mui->label_01_2->text() + "
";
- Input += mui->label_2_2->text() + " " + mui->lineEdit_2_2->text() + " " + mui->label_02_2->text() + "
";
- Input += mui->label_3_2->text() + " " + mui->lineEdit_3_2->text() + " " + mui->label_03_2->text() + "
";
- Input += mui->label_4_2->text() + " " + mui->lineEdit_4_2->text() + " " + mui->label_04_2->text() + "
";
- Input += mui->label_5_2->text() + " " + mui->lineEdit_5_2->text() + " " + mui->label_05_2->text() + "
" + tr("Result") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_1_2->text(), mui->lineEdit_1_2->text(), mui->label_01_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2_2->text(), mui->lineEdit_2_2->text(), mui->label_02_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_3_2->text(), mui->lineEdit_3_2->text(), mui->label_03_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_4_2->text(), mui->lineEdit_4_2->text(), mui->label_04_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_5_2->text(), mui->lineEdit_5_2->text(), mui->label_05_2->text()) + "
" + tr("Result") + ":
";
if (result.N > 0){
data->inductance = result.N;
- Result += tr("Inductance") + " L = " + roundTo(result.N / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Inductance") + " L = ", roundTo(result.N / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8())) + "
";
if (mui->comboBox_checkPCB->currentIndex() != 2){
- Result += tr("Outside diameter")+" D = " + roundTo(result.five / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Outside diameter")+" D = ", roundTo(result.five / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
data->Do = QString::number(result.five, 'f', myOpt->dwAccuracy).toDouble();
} else {
- Result += tr("Inside dimension")+" a = " + roundTo(result.five / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Inside dimension")+" a = ", roundTo(result.five / myOpt->dwLengthMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssLengthMeasureUnit.toUtf8())) + "
";
data->Di = QString::number(result.five, 'f', myOpt->dwAccuracy).toDouble();
}
- Result += tr("Coil constructive Q-factor") + " Q ≈ " + QString::number(round(result.fourth));
+ sResult += formattedOutput(myOpt, tr("Coil constructive Q-factor") + " Q ≈ ", QString::number(round(result.fourth)));
} else
- Result += tr("Invalid input parameter combination");
- Result += "
" + tr("Input") + ":
";
- Input += mui->label_N->text() + " " + mui->lineEdit_N->text() + "
";
- Input += mui->label_1_2->text() + " " + mui->lineEdit_1_2->text() + " " + mui->label_01_2->text() + "
";
- Input += mui->label_2_2->text() + " " + mui->lineEdit_2_2->text() + " " + mui->label_02_2->text() + "
";
- Input += mui->label_3_2->text() + " " + mui->lineEdit_3_2->text() + " " + mui->label_03_2->text() + "
" + tr("Result") + ":
";
+void MainWindow::get_spiralI_Result(_CoilResult result)
+{
+ QString sCaption = windowTitle() + " - " + mui->listWidget->currentItem()->text();
+ QString sImage = "";
+ QString sInput = "
" + tr("Input") + ":
";
+ sInput += formattedOutput(myOpt, mui->label_N->text(), mui->lineEdit_N->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_1_2->text(), mui->lineEdit_1_2->text(), mui->label_01_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_2_2->text(), mui->lineEdit_2_2->text(), mui->label_02_2->text()) + "
";
+ sInput += formattedOutput(myOpt, mui->label_3_2->text(), mui->lineEdit_3_2->text(), mui->label_03_2->text()) + "
" + tr("Result") + ":
";
data->inductance = result.N;
- Result += tr("Inductance") + " L = " + roundTo(result.N / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy) + " "
- + qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(myOpt, tr("Inductance") + " L = ", roundTo(result.N / myOpt->dwInductanceMultiplier, loc, myOpt->dwAccuracy),
+ qApp->translate("Context", myOpt->ssInductanceMeasureUnit.toUtf8())) + "
";
QString _wire_length = formatLength(result.sec, myOpt->dwLengthMultiplier);
QStringList list = _wire_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_wire_length = list[0];
QString _ssLengthMeasureUnit = list[1];
- Result += tr("Length of wire without leads") + " lw = " + roundTo(d_wire_length.toDouble(), loc, myOpt->dwAccuracy) + " " +
- qApp->translate("Context",_ssLengthMeasureUnit.toUtf8());
- Result += "
" + tr("Input data") + ":
";
- sResult += ui->label_N->text() + ": N = " + ui->lineEdit_N->text() + "
";
- sResult += "" + tr("Dimensions") + ":
";
- sResult += ui->label_1->text() + " = " + ui->lineEdit_1->text() + " " + ui->label_01->text() + "
";
- sResult += ui->label_2->text() + " = " + ui->lineEdit_2->text() + " " + ui->label_02->text() + "
";
- sResult += ui->label_3->text() + " = " + ui->lineEdit_3->text() + " " + ui->label_03->text() + "
";
- sResult += ui->label_4->text() + " = " + ui->lineEdit_4->text() + " " + ui->label_04->text() + "
" + tr("Result") + ":
";
- sResult += tr("Inductance") + " L = " + roundTo(result.N / fOpt->dwInductanceMultiplier, loc, fOpt->dwAccuracy) + " "
- + qApp->translate("Context", fOpt->ssInductanceMeasureUnit.toUtf8()) + "
";
- sResult += tr("Length of winding") + " l = " + roundTo( (result.sec)/fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy) + " " +
- qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8());
- sResult += "
" + tr("Input data") + ":
";
+ sInput += formattedOutput(fOpt, ui->label_N->text(), ui->lineEdit_N->text()) + "
";
+ sInput += "" + tr("Dimensions") + ":
";
+ sInput += formattedOutput(fOpt, ui->label_1->text(), ui->lineEdit_1->text(), ui->label_01->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_2->text(), ui->lineEdit_2->text(), ui->label_02->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_3->text(), ui->lineEdit_3->text(), ui->label_03->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_4->text(), ui->lineEdit_4->text(), ui->label_04->text()) + "
" + tr("Result") + ":
";
+ sResult += formattedOutput(fOpt, tr("Inductance") + " L = ", roundTo(result.N / fOpt->dwInductanceMultiplier, loc, fOpt->dwAccuracy),
+ qApp->translate("Context", fOpt->ssInductanceMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(fOpt, tr("Length of winding") + " l = ", roundTo( (result.sec)/fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy),
+ qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()));
+ sResult += "
" + tr("Input data") + ":
";
+ QString sCaption = QCoreApplication::applicationName() + " " + QCoreApplication::applicationVersion() + " - " + windowTitle();
+ QString sImage = "";
+ QString sInput = "
" + tr("Input data") + ":
";
QString measureUnit = "";
if (!ui->checkBox_isReverce->isChecked())
measureUnit = "";
else
measureUnit = ui->label_N_m->text();
- sResult += ui->label_N->text() + " " + ui->lineEdit_N->text() + " " + measureUnit + "
";
- sResult += "" + tr("Dimensions") + ":
";
- sResult += ui->label_1->text() + " " + ui->lineEdit_1->text() + " " + ui->label_01->text() + "
";
- sResult += ui->label_2->text() + " " + ui->lineEdit_2->text() + " " + ui->label_02->text() + "
";
- sResult += ui->label_3->text() + " " + ui->lineEdit_3->text() + " " + ui->label_03->text() + "
" + tr("Result") + ":
";
+ sInput += formattedOutput(fOpt, ui->label_N->text(), ui->lineEdit_N->text(), measureUnit) + "
";
+ sInput += "" + tr("Dimensions") + ":
";
+ sInput += formattedOutput(fOpt, ui->label_1->text(), ui->lineEdit_1->text(), ui->label_01->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_2->text(), ui->lineEdit_2->text(), ui->label_02->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_3->text(), ui->lineEdit_3->text(), ui->label_03->text()) + "
" + tr("Result") + ":
";
if (!ui->checkBox_isReverce->isChecked()){
- sResult += tr("Inductance") + " L = " + roundTo(ind / fOpt->dwInductanceMultiplier, loc, fOpt->dwAccuracy) + " "
- + qApp->translate("Context", fOpt->ssInductanceMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(fOpt, tr("Inductance") + " L = ", roundTo(ind / fOpt->dwInductanceMultiplier, loc, fOpt->dwAccuracy),
+ qApp->translate("Context", fOpt->ssInductanceMeasureUnit.toUtf8())) + "
";
} else {
- sResult += tr("Number of turns of the coil") + " N = " + roundTo(nTurns, loc, fOpt->dwAccuracy) + "
";
+ sResult += formattedOutput(fOpt, tr("Number of turns of the coil") + " N = ", roundTo(nTurns, loc, fOpt->dwAccuracy)) + "
";
}
- sResult += tr("Mean diameter") + " Dm = " + roundTo( (result.N)/fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy ) + " " +
- qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
- sResult += tr("Thickness of the coil") + " T = " + roundTo( (result.sec)/fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy) + " " +
- qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
- sResult += tr("Resistance of the coil") + " R = " + roundTo(result.fourth, loc, fOpt->dwAccuracy) + " " + tr("Ohm") + "
";
+ sResult += formattedOutput(fOpt, tr("Mean diameter") + " Dm = ", roundTo( (result.N)/fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy ),
+ qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(fOpt, tr("Thickness of the coil") + " T = ", roundTo( (result.sec)/fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy),
+ qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8())) + "
";
+ sResult += formattedOutput(fOpt, tr("Resistance of the coil") + " R = ", roundTo(result.fourth, loc, fOpt->dwAccuracy), tr("Ohm")) + "
";
QString _wire_length = formatLength(result.thd, fOpt->dwLengthMultiplier);
QStringList list = _wire_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_wire_length = list[0];
QString _ssLengthMeasureUnit = list[1];
- sResult += tr("Length of wire without leads") + " lw = " + roundTo(d_wire_length.toDouble(), loc, fOpt->dwAccuracy) + " " +
- qApp->translate("Context",_ssLengthMeasureUnit.toUtf8()) + "
";
+ sResult += formattedOutput(fOpt, tr("Length of wire without leads") + " lw = ", roundTo(d_wire_length.toDouble(), loc, fOpt->dwAccuracy),
+ qApp->translate("Context",_ssLengthMeasureUnit.toUtf8())) + "
";
double dencity = mtrl[Cu][Dencity];
double mass = 0.25 * dencity * M_PI * dw * dw * result.thd;
- sResult += tr("Weight of wire") + " m = " + roundTo(mass, loc, fOpt->dwAccuracy) + " " + tr("g") + "
";
- sResult += "
" + tr("Input data") + ":
";
+ QString sCaption = QCoreApplication::applicationName() + " " + QCoreApplication::applicationVersion() + " - " + windowTitle();
+ QString sImage = "";
+ QString sInput = "
" + tr("Input data") + ":
";
if (ui->checkBox_isReverce->isChecked())
- sResult += ui->label_N->text() + " " + ui->lineEdit_N->text() + "
";
+ sInput += formattedOutput(fOpt, ui->label_N->text(), ui->lineEdit_N->text()) + "
";
else
- sResult += ui->label_N->text() + " " + ui->lineEdit_N->text() + " " + ui->label_N_m->text() + "
";
- sResult += ui->label_d1->text() + " " + ui->lineEdit_d1->text() + " " + ui->label_01->text() + "
";
- sResult += ui->label_d2->text() + " " + ui->lineEdit_d2->text() + " " + ui->label_02->text() + "
";
- sResult += ui->label_d3->text() + " " + ui->lineEdit_d3->text() + " " + ui->label_03->text() + "
";
- sResult += ui->label_d4->text() + " " + ui->lineEdit_d4->text() + " " + ui->label_04->text() + "
";
- sResult += ui->label_h1->text() + " " + ui->lineEdit_h1->text() + " " + ui->label_05->text() + "
";
- sResult += ui->label_h2->text() + " " + ui->lineEdit_h2->text() + " " + ui->label_06->text() + "
";
- sResult += ui->label_b->text() + " " + ui->lineEdit_b->text() + " " + ui->label_07->text() + "
";
- sResult += ui->label_g->text() + " " + ui->lineEdit_g->text() + " " + ui->label_08->text() + "
";
- sResult += ui->label_mu->text() + " " + ui->lineEdit_mu->text() + "
";
- sResult += "
" + tr("Result") + ":
";
+ sInput += formattedOutput(fOpt, ui->label_N->text(), ui->lineEdit_N->text(), ui->label_N_m->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_d1->text(), ui->lineEdit_d1->text(), ui->label_01->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_d2->text(), ui->lineEdit_d2->text(), ui->label_02->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_d3->text(), ui->lineEdit_d3->text(), ui->label_03->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_d4->text(), ui->lineEdit_d4->text(), ui->label_04->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_h1->text(), ui->lineEdit_h1->text(), ui->label_05->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_h2->text(), ui->lineEdit_h2->text(), ui->label_06->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_b->text(), ui->lineEdit_b->text(), ui->label_07->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_g->text(), ui->lineEdit_g->text(), ui->label_08->text()) + "
";
+ sInput += formattedOutput(fOpt, ui->label_mu->text(), ui->lineEdit_mu->text()) + "
";
+ QString sResult = "
" + tr("Result") + ":
";
if (ui->checkBox_isReverce->isChecked()){
- sResult += tr("Inductance") + " L = " + roundTo(ind / fOpt->dwInductanceMultiplier, loc, fOpt->dwAccuracy) + " "
- + qApp->translate("Context", fOpt->ssInductanceMeasureUnit.toUtf8());
+ sResult += formattedOutput(fOpt, tr("Inductance") + " L = ", roundTo(ind / fOpt->dwInductanceMultiplier, loc, fOpt->dwAccuracy),
+ qApp->translate("Context", fOpt->ssInductanceMeasureUnit.toUtf8()));
} else {
- sResult += tr("Number of turns of the coil") + " N = " + QString::number(N);
+ sResult += formattedOutput(fOpt, tr("Number of turns of the coil") + " N = ", QString::number(N));
}
- sResult += "
" + tr("Effective magnetic path length") + " (le): "
- + roundTo(result.N/fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy)
- + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "
";
- sResult += tr("Effective area of magnetic path") + " (Ae): "
- + roundTo(result.sec/(fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier), loc, fOpt->dwAccuracy)
- + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "2
";
- sResult += tr("Effective volume") + " (Ve): "
- + roundTo(result.N * result.sec/(fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier), loc, fOpt->dwAccuracy)
- + " " + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "3
";
- sResult += tr("Effective magnetic permeability of the core") + " μe = " + roundTo(result.thd, loc, 0);
- sResult += "
Ucb$B@0Gs@5fY{lh1bvCTd=X*9)eM-;HBns=&GiU)u%>!KbWxKY$4J%6
zJSwaYCv&7^;YPAjL|zz3-kDB5;FC|3TD2!$0Swwnni`W+-;g%F
ztVquSa?>)6IRA6|3jjyo(1nW=$Qzf*4k`I`ns}f9NA;G&;(;Z&!Wq6GZ4ZzQGs#;@
z^6_}F$>nSe(1bk46PsxE7I~w1)N7m#vAJT?GL;fwSO6B#SwqN%GvuvDnz^K*X2(b^Gs+
zk_Sa9!ezdSaGx;$P__B?A?5!nOy;RqZef;&KqM;;YY6C%PKGgPvai4hgYn5Vas7YH
z|55*cL^#+jTp{xb2?_~Q_{#bll4-*2Pjp<_vY~dPVeywLG|3FdDkCwan)GU_l=b&r
z5GcL`Jzzm(L}+A$%+FsDalWzmYw7N4~DQ^^#A|>
delta 5408
zcmXZgc|c8R9|!Q?z4zR;yD)_zSxO{L2-#ASh$&<*OHz@ojD1O0t0L>wj3LUTLMd~z
z6eXnyMUo{+NX$E$ml=asue|Rs-}&qFoOACz=Q+>w`~9Bh+{8#B`;%mknf?F~Ehcg<
zg(4vrq)
zrTjoll^=NZjySEVv-$85m(|!9KF4(?&gU=uzGLrWi(iuK?8#yke}EgN=-;mJha2E5
z=pV};Q-2wkZ57{kH4Z|9`TVJQ<8eRbOscO-@L(cdSV~@>%n$hK0Va^A
g5x!D5e6<=
zE>L$1I@>_cC(x%A#vXwQotik)z=Nr-xRCV)EHJ^+)v)p*te&7TeE1a)?PjQIh8Cxw
z%>(FSfa8}zuf5Qx55|dMqP52Ky20$1xKOwamK}gqI#^?&DQl?Xk=hPjtYP+HSQZJZ
z&uJ=`CUEAvrKt(#d=iqQX;5;anY{$2F4nvmwv`i4x@PAYPVv^3CLBcHhO4(|K6K^3
zTtsrHZicQ_(9IEg&xgM6z{QVX+-aB;0du-xc`U5*hBaq37dKqtU9;(d=4PA=Pr-MZ
zn}$G6odKF#mw1sRHf!!w9_LK9P4ma?i<}S2w8ICgT4)rk7^ZdIS;IBqo)-K6UhRgk
zA>8qAptcZNorbm};mCS8Dj%9AY{J2$COG9HT;2`iKY|8pnD^Ixs{?Uf(Fxat!n(QI
z9V@wGmOHe&dpPy__h|R;vf|aQ)E?-%&$XpTdtAfkG2YttAOGO`KX$#gvv)S<{9J99
zvXaZOyY^a<9d8i2;M5
?%
h*1HpNx3ZXj6|Ey&o0`^vy_@`*xFKLjV`j}rv#
zyEQuOnp{CgU(9HPSjefxF}F$)c4adF?-mJ%^~H@Pi6``~$K`3fmfRdo)*KOr83*Bx
zW+n{RJA9)srpgLqiJee8%opcSGI=0{yihLum&Z_CW!HpxG91#$$-*m|Ypb!VRKmNB
z-(xtf7FM0Xy?o_MVdKOIJQviEk1K>PJNn@nFG<)kM!&3bM4}xyhRH9<8wn!uypaIE
zSBRvUo;dkJL_JDlafjR~vW~cq`@nV4WJfdHXC8}e*$ud*SBq@Rup%a0k!JR$0{|yC
zi#A$nF&eKFMc$hVP*^BRb-@SovqU-adD!I-$-E1q+;r@zfa#*V*brP^jbuSjQSm;!
zUuYz%JA*Oc*O_EVgXmq_VgR#qqLvKo*#-ARUykCOu^U1D9;Ts0qnoJxSOOj}#AMx0
z@!&!{y|SywK95Pu0p!f@NRLmXdJ?(PiPT1trz^<|7UUmaub)cj`cKW*3_i}K8(-YT
z5m!Fop)^Lk*-V1p626dYt;PE-y5q8&E