Skip to content

Commit

Permalink
Coil64 v2.2.32 updated 2024-06-03
Browse files Browse the repository at this point in the history
  • Loading branch information
radioacoustick committed Jun 3, 2024
1 parent 9a4ccc4 commit 2fb1522
Show file tree
Hide file tree
Showing 213 changed files with 33,714 additions and 32,123 deletions.
5 changes: 4 additions & 1 deletion Coil64.pro
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ TRANSLATIONS += lang/Coil64_bg.ts \

RESOURCES += res.qrc

win32: RC_FILE = resource.rc
win32:{
RC_FILE = resource.rc
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x050200
}
unix:{
!macx:{
QMAKE_LFLAGS += -no-pie
Expand Down
34 changes: 34 additions & 0 deletions about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,26 @@ along with this program. If not, see <https://www.gnu.org/licenses
#include "ui_about.h"
#include "definitions.h"

QString reversPixmapColorHTML(QString input, int start){

int i1 = input.indexOf(".png", start);
int i2 = input.indexOf(">", start);
QString sImg1 = input.mid(start + 10, i1 - start - 6);
QPixmap *pixmap = new QPixmap();
pixmap->load(sImg1, "PNG");
QByteArray byteArray;
QBuffer buffer(&byteArray);
QImage image(pixmap->toImage());
image.invertPixels();
QPixmap am = QPixmap::fromImage(image);
am.save(&buffer, "PNG");
QString url = QString("<img src=\"data:image/png;base64,") + byteArray.toBase64() + "\" style=\"vertical-align: middle;\" />";
input.remove(start, i2 - start + 1);
input.insert(start, url);
delete pixmap;
return input;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
About::About(QWidget *parent) :
QDialog(parent),
ui(new Ui::About)
Expand Down Expand Up @@ -52,6 +71,20 @@ void About::getStyleGUI(int styleGUI)
if (styleGUI == _DarkStyle){
ui->label_27->setPixmap(revercePixmapColors(ui->label_27->pixmap()));
ui->label_18->setPixmap(revercePixmapColors(ui->label_18->pixmap()));
ui->pushButton->setIcon(reverceIconColors(ui->pushButton->icon()));
QString txt = ui->label_13->text();
int j = 0;
do {
if (j == 0){
j = txt.indexOf("<img", j);
txt = reversPixmapColorHTML(txt, j);
} else {
j = txt.indexOf("<img", j + 1);
if (j > 0)
txt = reversPixmapColorHTML(txt, j);
}
} while(j > 0);
ui->label_13->setText(txt);
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -60,3 +93,4 @@ void About::on_pushButton_clicked()
this->close();
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

1 change: 1 addition & 0 deletions about.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ along with this program. If not, see <https://www.gnu.org/licenses

#include <QDialog>
#include <QResource>
#include <QBuffer>

#include "system_functions.h"

Expand Down
10 changes: 5 additions & 5 deletions about.ui
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</property>
<property name="windowIcon">
<iconset resource="res.qrc">
<normaloff>:/menu_ico/res/icons8-info-32.png</normaloff>:/menu_ico/res/icons8-info-32.png</iconset>
<normaloff>:/menu_ico/res/ico2-info.png</normaloff>:/menu_ico/res/ico2-info.png</iconset>
</property>
<property name="toolTipDuration">
<number>2</number>
Expand Down Expand Up @@ -550,7 +550,7 @@ p, li { white-space: pre-wrap; }
<string notr="true"/>
</property>
<property name="pixmap">
<pixmap resource="res.qrc">:/menu_ico/res/icons8-cpp-50.png</pixmap>
<pixmap resource="res.qrc">:/menu_ico/res/ico2-cpp.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
Expand All @@ -563,7 +563,7 @@ p, li { white-space: pre-wrap; }
<string notr="true"/>
</property>
<property name="pixmap">
<pixmap resource="res.qrc">:/menu_ico/res/icons8-qt-50.png</pixmap>
<pixmap resource="res.qrc">:/menu_ico/res/ico2-qt.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
Expand All @@ -587,7 +587,7 @@ p, li { white-space: pre-wrap; }
</font>
</property>
<property name="text">
<string notr="true">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/menu_ico/res/icons8-windows-xp-32.png&quot; style=&quot;vertical-align: middle;&quot;/&gt;&amp;nbsp;Windows: Qt 5.13.2 (mingw32, gcc 5.5.0, 32bit, 64bit)&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;:/menu_ico/res/icons8-linux-32.png&quot; style=&quot;vertical-align: middle;&quot;/&gt;&amp;nbsp;Linux: Qt 5.12.0 (gcc 5.4.0, 64bit)&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;:/menu_ico/res/icons8-apple-logo-32.png&quot; style=&quot;vertical-align: middle;&quot;/&gt;&amp;nbsp;OS X: Qt 5.9.1 (clang-800.0.42.1, 64bit)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string notr="true">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/menu_ico/res/ico2-windows.png&quot; style=&quot;vertical-align: middle;&quot;/&gt;&amp;nbsp;Windows: Qt 5.13.2 (mingw32, gcc 5.5.0, 32bit, 64bit)&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;:/menu_ico/res/ico2-linux.png&quot; style=&quot;vertical-align: middle;&quot;/&gt;&amp;nbsp;Linux: Qt 5.12.0 (gcc 5.4.0, 64bit)&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;:/menu_ico/res/ico2-mac-os.png&quot; style=&quot;vertical-align: middle;&quot;/&gt;&amp;nbsp;OS X: Qt 5.9.1 (clang-800.0.42.1, 64bit)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
Expand Down Expand Up @@ -677,7 +677,7 @@ p, li { white-space: pre-wrap; }
</property>
<property name="icon">
<iconset resource="res.qrc">
<normaloff>:/menu_ico/res/icons8-unavailable-32.png</normaloff>:/menu_ico/res/icons8-unavailable-32.png</iconset>
<normaloff>:/menu_ico/res/ico2-unavailable.png</normaloff>:/menu_ico/res/ico2-unavailable.png</iconset>
</property>
<property name="shortcut">
<string notr="true">Esc</string>
Expand Down
30 changes: 25 additions & 5 deletions aircoretoroid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ void AirCoreToroid::getOpt(_OptionStruct gOpt)
ui->checkBox_isReverce->setChecked(isReverse);
on_checkBox_isReverce_clicked();
delete settings;
if (fOpt->styleGUI == _DarkStyle){
ui->pushButton_calculate->setIcon(reverceIconColors(ui->pushButton_calculate->icon()));
ui->pushButton_close->setIcon(reverceIconColors(ui->pushButton_close->icon()));
ui->pushButton_help->setIcon(reverceIconColors(ui->pushButton_help->icon()));
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AirCoreToroid::getCurrentLocale(QLocale locale)
Expand Down Expand Up @@ -246,10 +251,13 @@ void AirCoreToroid::on_pushButton_calculate_clicked()
showWarning(tr("Warning"), tr("One or more inputs have an illegal format!"));
return;
}
if (windingKind == 0)
if (windingKind == 0){
ind = findAirCoreRoundToroid_I(N,OD,ID,dw);
else
ind = getFerriteI(N, OD, ID, h, 1, dw / 2, &result);
lw = getToroidWireLength(OD, ID, 0, dw , N, NULL, true);
} else {
ind = getFerriteI(N, OD, ID, h, 1, dw / 2, 0, &result);
lw = getToroidWireLength(OD, ID, h, dw, N);
}
} else {
ind = loc.toDouble(ui->lineEdit_N->text(), &ok1)*fOpt->dwInductanceMultiplier;
if (ind == 0){
Expand All @@ -260,11 +268,13 @@ void AirCoreToroid::on_pushButton_calculate_clicked()
showWarning(tr("Warning"), tr("One or more inputs have an illegal format!"));
return;
}
if (windingKind == 0)
if (windingKind == 0){
N = findAirCoreRoundToroid_N(ind, OD, ID, dw);
else {
lw = getToroidWireLength(OD, ID, 0, dw , N, NULL, true);
} else {
getFerriteN(ind, OD, ID, h, dw, 1, dw / 2, &result);
N = result.N;
lw = getToroidWireLength(OD, ID, h, dw, N);
}
}
QString sInput = "<p><u>" + tr("Input data") + ":</u><br/>";
Expand All @@ -285,6 +295,16 @@ void AirCoreToroid::on_pushButton_calculate_clicked()
} else {
sResult += formattedOutput(fOpt, tr("Number of turns of the coil") + " N = ", roundTo(N, loc, fOpt->dwAccuracy));
}
if (lw > 0){
QString _wire_length = formatLength(lw, fOpt->dwLengthMultiplier);
QStringList list = _wire_length.split(QRegExp(" "), QString::SkipEmptyParts);
QString d_wire_length = list[0];
QString _ssLengthMeasureUnit = list[1];
if (d_wire_length != "-100"){
sResult += "<br/>" + formattedOutput(fOpt, tr("Length of wire without leads") + " lw = ", roundTo(d_wire_length.toDouble(), loc, fOpt->dwAccuracy),
qApp->translate("Context", _ssLengthMeasureUnit.toUtf8()));
}
}
sResult += "</p>";
emit sendResult(sCaption + LIST_SEPARATOR + sImage + LIST_SEPARATOR + sInput + LIST_SEPARATOR + sResult);
}
2 changes: 1 addition & 1 deletion aircoretoroid.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private slots:
QLocale loc;

int windingKind;
double N, ind, OD, ID, h, dw;
double N, ind, OD, ID, h, dw, lw;
};

#endif // AIRCORETOROID_H
6 changes: 3 additions & 3 deletions aircoretoroid.ui
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@
</property>
<property name="icon">
<iconset resource="res.qrc">
<normaloff>:/menu_ico/res/icons8-help-32.png</normaloff>:/menu_ico/res/icons8-help-32.png</iconset>
<normaloff>:/menu_ico/res/ico2-help.png</normaloff>:/menu_ico/res/ico2-help.png</iconset>
</property>
<property name="shortcut">
<string notr="true">F1</string>
Expand Down Expand Up @@ -408,7 +408,7 @@
</property>
<property name="icon">
<iconset resource="res.qrc">
<normaloff>:/menu_ico/res/icons8-enter-key-64.png</normaloff>:/menu_ico/res/icons8-enter-key-64.png</iconset>
<normaloff>:/menu_ico/res/ico2-enter-key.png</normaloff>:/menu_ico/res/ico2-enter-key.png</iconset>
</property>
<property name="shortcut">
<string notr="true">Enter</string>
Expand Down Expand Up @@ -440,7 +440,7 @@
</property>
<property name="icon">
<iconset resource="res.qrc">
<normaloff>:/menu_ico/res/icons8-unavailable-32.png</normaloff>:/menu_ico/res/icons8-unavailable-32.png</iconset>
<normaloff>:/menu_ico/res/ico2-unavailable.png</normaloff>:/menu_ico/res/ico2-unavailable.png</iconset>
</property>
<property name="shortcut">
<string notr="true">Esc</string>
Expand Down
4 changes: 4 additions & 0 deletions al.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ void AL::getOpt(_OptionStruct gOpt)
resize(size);
move(pos);
delete settings;
if (fOpt->styleGUI == _DarkStyle){
ui->pushButton_calculate->setIcon(reverceIconColors(ui->pushButton_calculate->icon()));
ui->pushButton_close->setIcon(reverceIconColors(ui->pushButton_close->icon()));
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AL::getCurrentLocale(QLocale locale)
Expand Down
4 changes: 2 additions & 2 deletions al.ui
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@
</property>
<property name="icon">
<iconset resource="res.qrc">
<normaloff>:/menu_ico/res/icons8-enter-key-64.png</normaloff>:/menu_ico/res/icons8-enter-key-64.png</iconset>
<normaloff>:/menu_ico/res/ico2-enter-key.png</normaloff>:/menu_ico/res/ico2-enter-key.png</iconset>
</property>
<property name="shortcut">
<string notr="true">Enter</string>
Expand Down Expand Up @@ -623,7 +623,7 @@
</property>
<property name="icon">
<iconset resource="res.qrc">
<normaloff>:/menu_ico/res/icons8-unavailable-32.png</normaloff>:/menu_ico/res/icons8-unavailable-32.png</iconset>
<normaloff>:/menu_ico/res/ico2-unavailable.png</normaloff>:/menu_ico/res/ico2-unavailable.png</iconset>
</property>
<property name="shortcut">
<string notr="true">Esc</string>
Expand Down
Loading

0 comments on commit 2fb1522

Please sign in to comment.