Skip to content

Commit

Permalink
Coil64 v2.1.26 updated 2022-12-27
Browse files Browse the repository at this point in the history
  • Loading branch information
radioacoustick committed Dec 27, 2022
1 parent 5d605a6 commit 3b22fbf
Show file tree
Hide file tree
Showing 79 changed files with 24,979 additions and 20,080 deletions.
1 change: 1 addition & 0 deletions Coil64.pro
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ TRANSLATIONS += lang/Coil64_bg.ts \
lang/Coil64_el.ts \
lang/Coil64_en.ts \
lang/Coil64_es.ts \
lang/Coil64_et.ts \
lang/Coil64_fa.ts \
lang/Coil64_fr.ts \
lang/Coil64_hr.ts \
Expand Down
20 changes: 10 additions & 10 deletions aircoretoroid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ void AirCoreToroid::getOpt(_OptionStruct gOpt)
dw = settings->value("dw", 0).toDouble();
settings->endGroup();
if (isReverse)
ui->lineEdit_N->setText(loc.toString(N));
ui->lineEdit_N->setText(roundTo(N, loc, fOpt->dwAccuracy));
else
ui->lineEdit_N->setText(loc.toString(ind / fOpt->dwInductanceMultiplier));
ui->lineEdit_1->setText(loc.toString(OD / fOpt->dwLengthMultiplier));
ui->lineEdit_2->setText(loc.toString(ID / fOpt->dwLengthMultiplier));
ui->lineEdit_3->setText(loc.toString(h / fOpt->dwLengthMultiplier));
ui->lineEdit_N->setText(roundTo(ind / fOpt->dwInductanceMultiplier, loc, fOpt->dwAccuracy));
ui->lineEdit_1->setText(roundTo(OD / fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy));
ui->lineEdit_2->setText(roundTo(ID / fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy));
ui->lineEdit_3->setText(roundTo(h / fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy));
if (fOpt->isAWG){
ui->label_04->setText(tr("AWG"));
ui->lineEdit_4->setValidator(awgV);
Expand All @@ -109,7 +109,7 @@ void AirCoreToroid::getOpt(_OptionStruct gOpt)
} else
ui->lineEdit_4->setText("");
} else
ui->lineEdit_4->setText(loc.toString(dw / fOpt->dwLengthMultiplier));
ui->lineEdit_4->setText(roundTo(dw / fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy));
ui->label_1->setText(tr("Outside diameter")+" OD:");
ui->label_2->setText(tr("Inside diameter")+" ID:");
ui->label_3->setText(tr("Height") + " h:");
Expand Down Expand Up @@ -159,12 +159,12 @@ void AirCoreToroid::on_radioButton_rect_clicked()
void AirCoreToroid::on_checkBox_isReverce_clicked()
{
if (ui->checkBox_isReverce->isChecked()){
ui->lineEdit_N->setText(loc.toString(N, 'f', fOpt->dwAccuracy));
ui->lineEdit_N->setText(roundTo(N, loc, fOpt->dwAccuracy));
QString tmpTxt = tr("Number of turns") + " N:";
ui->label_N->setText(tmpTxt);
ui->label_N_m->setVisible(false);
} else {
ui->lineEdit_N->setText(loc.toString(ind / fOpt->dwInductanceMultiplier, 'f', fOpt->dwAccuracy));
ui->lineEdit_N->setText(roundTo(ind / fOpt->dwInductanceMultiplier, loc, fOpt->dwAccuracy));
QString tmpTxt = tr("Inductance") + " L:";
ui->label_N->setText(tmpTxt);
ui->label_N_m->setVisible(true);
Expand Down Expand Up @@ -284,10 +284,10 @@ void AirCoreToroid::on_pushButton_calculate_clicked()
sResult += "<hr>";
sResult += "<p><u>" + tr("Result") + ":</u><br/>";
if (ui->checkBox_isReverce->isChecked()){
sResult += tr("Inductance") + " L = " + loc.toString(ind / fOpt->dwInductanceMultiplier, 'f', fOpt->dwAccuracy) + " "
sResult += 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 = " + loc.toString(N, 'f', fOpt->dwAccuracy);
sResult += tr("Number of turns of the coil") + " N = " + roundTo(N, loc, fOpt->dwAccuracy);
}
sResult += "</p><hr>";
emit sendResult(sResult);
Expand Down
2 changes: 1 addition & 1 deletion al.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void AL::on_pushButton_calculate_clicked()
return;
}
L_r = (double)N_r * N_r * al / 1000;
ui->lineEdit_L_3->setText(loc.toString(L_r / fOpt->dwInductanceMultiplier, 'f', fOpt->dwAccuracy));
ui->lineEdit_L_3->setText(roundTo(L_r / fOpt->dwInductanceMultiplier, loc, fOpt->dwAccuracy));
break;
default:
break;
Expand Down
52 changes: 26 additions & 26 deletions amidon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ void Amidon::getOpt(_OptionStruct gOpt)
int p_index = settings->value("p_index", 0).toInt();
int e_index = settings->value("e_index", 0).toInt();
settings->endGroup();
ui->lineEdit_ind->setText(loc.toString(I / fOpt->dwInductanceMultiplier));
ui->lineEdit_ind->setText(roundTo(I / fOpt->dwInductanceMultiplier, loc, fOpt->dwAccuracy));
ui->comboBox_tm->setCurrentIndex(t_material);
ui->comboBox_fm->setCurrentIndex(f_material);
ui->comboBox_bn_m->setCurrentIndex(bn_material);
Expand Down Expand Up @@ -671,9 +671,9 @@ void Amidon::on_comboBox_td_currentTextChanged(const QString &arg1){
if (accuracy == 4)
accuracy = 0;
info += tr("Dimensions") + " (OD x ID x H): " + styleInfoColor + "<br/>"
+ loc.toString(od, 'f', accuracy) + " x "
+ loc.toString(id, 'f', accuracy) + " x "
+ loc.toString(h, 'f', accuracy) +
+ roundTo(od, loc, accuracy) + " x "
+ roundTo(id, loc, accuracy) + " x "
+ roundTo(h, loc, accuracy) +
+ "</span>&nbsp;" + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "<br/>";
al = TToroid_AL[tm_index][i];
info += "A<sub>L</sub>&nbsp;" + tr("factor") + ": " + styleInfoColor
Expand Down Expand Up @@ -718,9 +718,9 @@ void Amidon::on_comboBox_fd_currentTextChanged(const QString &arg1)
if (accuracy == 4)
accuracy = 0;
info += tr("Dimensions") + " (OD x ID x H): " + styleInfoColor + "<br/>"
+ loc.toString(od, 'f', accuracy) + " x "
+ loc.toString(id, 'f', accuracy) + " x "
+ loc.toString(h, 'f', accuracy) +
+ roundTo(od, loc, accuracy) + " x "
+ roundTo(id, loc, accuracy) + " x "
+ roundTo(h, loc, accuracy) +
+ "</span>&nbsp;" + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "<br/>";
al = FToroid_AL[fm_index][i];
info += "A<sub>L</sub>&nbsp;" + tr("factor") + ": " + styleInfoColor
Expand Down Expand Up @@ -870,7 +870,7 @@ 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) + "<br/>";
Result += tr("Maximum wire diameter") + " dw_max = " + loc.toString(max_dw / fOpt->dwLengthMultiplier, 'f', fOpt->dwAccuracy)
Result += tr("Maximum wire diameter") + " dw_max = " + roundTo(max_dw / fOpt->dwLengthMultiplier, loc, fOpt->dwAccuracy)
+ "&nbsp;" + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8());
QString awg = converttoAWG(max_dw);
if (!awg.isEmpty())
Expand All @@ -894,8 +894,8 @@ QString Amidon::getPotCoreSize(QString sizes, double *average_size)
int accuracy = fOpt->indexLengthMultiplier + 1;
if (accuracy == 4)
accuracy = 0;
QString sResult = loc.toString(dw_size_average/fOpt->dwLengthMultiplier, 'f', accuracy) + "±"
+ loc.toString(deviation/fOpt->dwLengthMultiplier, 'f', accuracy);
QString sResult = roundTo(dw_size_average/fOpt->dwLengthMultiplier, loc, accuracy) + "±"
+ roundTo(deviation/fOpt->dwLengthMultiplier, loc, accuracy);
*average_size = dw_size_average;
return sResult;
}
Expand All @@ -910,8 +910,8 @@ QString Amidon::getMultiapertureCoreSize(QString sizes)
int accuracy = fOpt->indexLengthMultiplier + 1;
if (accuracy == 4)
accuracy = 0;
QString sResult = loc.toString(dw_size/fOpt->dwLengthMultiplier, 'f', accuracy) + "±"
+ loc.toString(dw_deviation/fOpt->dwLengthMultiplier, 'f', accuracy);
QString sResult = roundTo(dw_size/fOpt->dwLengthMultiplier, loc, accuracy) + "±"
+ roundTo(dw_deviation/fOpt->dwLengthMultiplier, loc, accuracy);
return sResult;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -953,13 +953,13 @@ void Amidon::resolvePotCore(int index)
if (accuracy == 4)
accuracy = 0;
info += tr("Effective magnetic path length") + " (l<sub>e</sub>): " + styleInfoColor
+ loc.toString(le/fOpt->dwLengthMultiplier, 'f', accuracy)
+ roundTo(le/fOpt->dwLengthMultiplier, loc, accuracy)
+ "</span>&nbsp;" + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "<br/>";
info += tr("Effective area of magnetic path") + " (A<sub>e</sub>): " + styleInfoColor
+ loc.toString(ae/(fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier), 'f', accuracy)
+ roundTo(ae/(fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier), loc, accuracy)
+ "</span>&nbsp;" + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "<sup>2</sup><br/>";
info += tr("Effective volume") + " (V<sub>e</sub>): " + styleInfoColor
+ loc.toString(ve/(fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier), 'f', accuracy)
+ roundTo(ve/(fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier), loc, accuracy)
+ "</span>&nbsp;" + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "<sup>3</sup><br/>";
info += "A<sub>L</sub>&nbsp;" + tr("factor") + ": " + styleInfoColor
+ al_s + "</span>&nbsp;mH/(N/1000)<sup>2</sup></p>";
Expand Down Expand Up @@ -992,25 +992,25 @@ void Amidon::resolveECore(int index)
accuracy = 0;
QString info = "<p>" + tr("Dimensions") + ":</span><br/>";
info += "A = " + styleInfoColor
+ loc.toString(A/fOpt->dwLengthMultiplier, 'f', accuracy) + "</span>&nbsp;"
+ roundTo(A/fOpt->dwLengthMultiplier, loc, accuracy) + "</span>&nbsp;"
+ qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",&nbsp;";
info += "B = " + styleInfoColor
+ loc.toString(B/fOpt->dwLengthMultiplier, 'f', accuracy) + "</span>&nbsp;"
+ roundTo(B/fOpt->dwLengthMultiplier, loc, accuracy) + "</span>&nbsp;"
+ qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",&nbsp;<br/>";
info += "C = " + styleInfoColor
+ loc.toString(C/fOpt->dwLengthMultiplier, 'f', accuracy) + "</span>&nbsp;"
+ roundTo(C/fOpt->dwLengthMultiplier, loc, accuracy) + "</span>&nbsp;"
+ qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",&nbsp;";
info += "D = " + styleInfoColor
+ loc.toString(D/fOpt->dwLengthMultiplier, 'f', accuracy) + "</span>&nbsp;"
+ roundTo(D/fOpt->dwLengthMultiplier, loc, accuracy) + "</span>&nbsp;"
+ qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",&nbsp;<br/>";
info += "E = " + styleInfoColor
+ loc.toString(E/fOpt->dwLengthMultiplier, 'f', accuracy) + "</span>&nbsp;"
+ roundTo(E/fOpt->dwLengthMultiplier, loc, accuracy) + "</span>&nbsp;"
+ qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",&nbsp;";
info += "F = " + styleInfoColor
+ loc.toString(F/fOpt->dwLengthMultiplier, 'f', accuracy) + "</span>&nbsp;"
+ roundTo(F/fOpt->dwLengthMultiplier, loc, accuracy) + "</span>&nbsp;"
+ qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + ",&nbsp;<br/>";
info += "G = " + styleInfoColor
+ loc.toString(G/fOpt->dwLengthMultiplier, 'f', accuracy) + "</span>&nbsp;"
+ roundTo(G/fOpt->dwLengthMultiplier, loc, accuracy) + "</span>&nbsp;"
+ qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "&nbsp;<br/>";
QString efeatures_str = ECore_Features[index];
QStringList efeatures = efeatures_str.split(",");
Expand All @@ -1026,15 +1026,15 @@ void Amidon::resolveECore(int index)
double ve = ve_s.toDouble();
double W = W_s.toDouble();
info += tr("Effective magnetic path length") + " (l<sub>e</sub>): " + styleInfoColor
+ loc.toString(le/fOpt->dwLengthMultiplier, 'f', accuracy)
+ roundTo(le/fOpt->dwLengthMultiplier, loc, accuracy)
+ "</span>&nbsp;" + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "<br/>";
info += tr("Effective area of magnetic path") + " (A<sub>e</sub>): " + styleInfoColor
+ loc.toString(ae/(fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier), 'f', accuracy)
+ roundTo(ae/(fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier), loc, accuracy)
+ "</span>&nbsp;" + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "<sup>2</sup><br/>";
info += tr("Effective volume") + " (V<sub>e</sub>): " + styleInfoColor
+ loc.toString(ve/(fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier), 'f', accuracy)
+ roundTo(ve/(fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier * fOpt->dwLengthMultiplier), loc, accuracy)
+ "</span>&nbsp;" + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "<sup>3</sup><br/>";
info += tr("Power") + " (W): " + styleInfoColor + loc.toString(W, 'f', accuracy) + "</span>&nbsp;W<br/>";
info += tr("Power") + " (W): " + styleInfoColor + roundTo(W, loc, accuracy) + "</span>&nbsp;W<br/>";
info += "A<sub>L</sub>&nbsp;" + tr("factor") + ": " + styleInfoColor
+ al_s + "</span>&nbsp;µH/(N/1000)<sup>2</sup></p>";
ui->label_info->setText(info);
Expand Down
16 changes: 8 additions & 8 deletions bandspread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ void Bandspread::getOpt(_OptionStruct gOpt)
settings->endGroup();
delete settings;
ui->tabWidget->setCurrentIndex(0);
ui->lineEdit_ind->setText(loc.toString(ind / fOpt->dwInductanceMultiplier));
ui->lineEdit_flo->setText(loc.toString(f_low / fOpt->dwFrequencyMultiplier));
ui->lineEdit_fhi->setText(loc.toString(f_high / fOpt->dwFrequencyMultiplier));
ui->lineEdit_cvmin->setText(loc.toString(Cv_min / fOpt->dwCapacityMultiplier));
ui->lineEdit_cvmax->setText(loc.toString(Cv_max / fOpt->dwCapacityMultiplier));
ui->lineEdit_cs->setText(loc.toString(Cs / fOpt->dwCapacityMultiplier));
ui->lineEdit_ind->setText(roundTo(ind / fOpt->dwInductanceMultiplier, loc, fOpt->dwAccuracy));
ui->lineEdit_flo->setText(roundTo(f_low / fOpt->dwFrequencyMultiplier, loc, fOpt->dwAccuracy));
ui->lineEdit_fhi->setText(roundTo(f_high / fOpt->dwFrequencyMultiplier, loc, fOpt->dwAccuracy));
ui->lineEdit_cvmin->setText(roundTo(Cv_min / fOpt->dwCapacityMultiplier, loc, fOpt->dwAccuracy));
ui->lineEdit_cvmax->setText(roundTo(Cv_max / fOpt->dwCapacityMultiplier, loc, fOpt->dwAccuracy));
ui->lineEdit_cs->setText(roundTo(Cs / fOpt->dwCapacityMultiplier, loc, fOpt->dwAccuracy));
resize(size);
move(pos);
showInductanceRange();
Expand Down Expand Up @@ -390,8 +390,8 @@ void Bandspread::on_tabWidget_currentChanged(int index)
ui->lineEdit_cs->setText(ui->lineEdit_cs_r->text());
ui->lineEdit_ind->setText(ui->lineEdit_ind_r->text());
if ((!ui->lineEdit_flo_r->text().isEmpty()) && (!ui->lineEdit_fhi_r->text().isEmpty())){
ui->lineEdit_flo->setText(loc.toString(f_low / fOpt->dwFrequencyMultiplier));
ui->lineEdit_fhi->setText(loc.toString(f_high / fOpt->dwFrequencyMultiplier));
ui->lineEdit_flo->setText(roundTo(f_low / fOpt->dwFrequencyMultiplier, loc, fOpt->dwAccuracy));
ui->lineEdit_fhi->setText(roundTo(f_high / fOpt->dwFrequencyMultiplier, loc, fOpt->dwAccuracy));
}
} else {
ui->lineEdit_cvmin_r->setText(ui->lineEdit_cvmin->text());
Expand Down
18 changes: 9 additions & 9 deletions crossover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,35 +200,35 @@ void Crossover::fillTable(QStandardItem *item, int count, double wire_d, int awg
model->setHeaderData(0, Qt::Horizontal, QObject::tr("Wire diameter") + " ["
+ qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "]\nd");
if (fOpt->isAWG)
item = new QStandardItem(loc.toString(wire_d / fOpt->dwLengthMultiplier, 'f', 2) + " - (" + QString::number(awgNumber) + " AWG)");
item = new QStandardItem(roundTo(wire_d / fOpt->dwLengthMultiplier, loc, 2) + " - (" + QString::number(awgNumber) + " AWG)");
else
item = new QStandardItem(loc.toString(wire_d / fOpt->dwLengthMultiplier, 'f', 2));
item = new QStandardItem(roundTo(wire_d / fOpt->dwLengthMultiplier, loc, 2));
model->setItem(count - 1, 0, item);
findBrooksCoil(ind, wire_d, ui->doubleSpinBox_ax->value(), ui->doubleSpinBox_rad->value(),
n, nLayer, Nc, c, lengthWire, massWire, DCR);
item = new QStandardItem(loc.toString(n, 'f', 1));
item = new QStandardItem(roundTo(n, loc, 1));
model->setItem(count - 1, 1, item);
item = new QStandardItem(QString::number(ceil(nLayer)));
model->setItem(count - 1, 2, item);
item = new QStandardItem(QString::number(round(Nc)));
model->setItem(count - 1, 3, item);
model->setHeaderData(4, Qt::Horizontal, QObject::tr("Dimensions of inductor")
+ " [" + qApp->translate("Context", fOpt->ssLengthMeasureUnit.toUtf8()) + "]\n DxHxW ");
item = new QStandardItem(loc.toString(2 * c / fOpt->dwLengthMultiplier, 'f', 1)
+ "x" + loc.toString(4 * c / fOpt->dwLengthMultiplier, 'f', 1)
+ "x" + loc.toString(c / fOpt->dwLengthMultiplier, 'f', 1));
item = new QStandardItem(roundTo(2 * c / fOpt->dwLengthMultiplier, loc, 1)
+ "x" + roundTo(4 * c / fOpt->dwLengthMultiplier, loc, 1)
+ "x" + roundTo(c / fOpt->dwLengthMultiplier, loc, 1));
model->setItem(count - 1, 4, item);
QString _wire_length = formatLength(lengthWire, fOpt->dwLengthMultiplier);
QStringList list = _wire_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_wire_length = list[0];
QString _ssLengthMeasureUnit = list[1];
model->setHeaderData(5, Qt::Horizontal, QObject::tr("Length of wire without leads") + "\n[" +
qApp->translate("Context", _ssLengthMeasureUnit.toUtf8()) + "]");
item = new QStandardItem(loc.toString(d_wire_length.toDouble(), 'f', fOpt->dwAccuracy));
item = new QStandardItem(roundTo(d_wire_length.toDouble(), loc, fOpt->dwAccuracy));
model->setItem(count - 1, 5, item);
item = new QStandardItem(loc.toString(massWire, 'f', fOpt->dwAccuracy));
item = new QStandardItem(roundTo(massWire, loc, fOpt->dwAccuracy));
model->setItem(count - 1, 6, item);
item = new QStandardItem(loc.toString(DCR, 'f', fOpt->dwAccuracy));
item = new QStandardItem(roundTo(DCR, loc, fOpt->dwAccuracy));
model->setItem(count - 1, 7, item);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ along with this program. If not, see <https://www.gnu.org/licenses
#define DEFINES

#define APP_NAME "Coil64"
#define VERSION "2.1.25"
#define VERSION "2.1.26"
#define PROGRAM_SITE "https://coil32.net"
#define VERSION_FILE "qversion.txt"
#define CLEAR_CHAR 0x274C
Expand Down
Loading

0 comments on commit 3b22fbf

Please sign in to comment.