Complete Mifare Simulate function

This commit is contained in:
wh201906
2020-05-03 00:14:49 +08:00
parent afe2474fe3
commit fe8b9d6161
4 changed files with 45 additions and 5 deletions
+15 -1
View File
@@ -1,11 +1,12 @@
#include "mf_sim_simdialog.h"
#include "ui_mf_sim_simdialog.h"
MF_Sim_simDialog::MF_Sim_simDialog(QWidget *parent) :
MF_Sim_simDialog::MF_Sim_simDialog(int cardType, QWidget *parent) :
QDialog(parent),
ui(new Ui::MF_Sim_simDialog)
{
ui->setupUi(this);
this->cardType = cardType;
}
MF_Sim_simDialog::~MF_Sim_simDialog()
@@ -50,3 +51,16 @@ void MF_Sim_simDialog::on_fBox_clicked(bool checked)
ui->xBox->setEnabled(false);
}
}
void MF_Sim_simDialog::on_buttonBox_accepted()
{
QString paras;
paras += (ui->uBox->isChecked() ? "u " + ui->uEdit->text() + " " : "");
paras += (ui->nBox->isChecked() ? "n " + ui->nEdit->text() + " " : "");
paras += (ui->iBox->isChecked() ? "i " : "");
paras += (ui->xBox->isChecked() ? "x " : "");
paras += (ui->eBox->isChecked() ? "e " : "");
paras += (ui->fBox->isChecked() ? "f " + ui->fEdit->text() + " " : "");
paras += (ui->rBox->isChecked() ? "r " : "");
emit sendCMD(QString("hf mf sim ") + "*" + QString::number(cardType) + " " + paras.trimmed());
}
+7 -1
View File
@@ -2,6 +2,7 @@
#define MF_SIM_SIMDIALOG_H
#include <QDialog>
#include <QDebug>
namespace Ui
{
@@ -13,7 +14,7 @@ class MF_Sim_simDialog : public QDialog
Q_OBJECT
public:
explicit MF_Sim_simDialog(QWidget *parent = nullptr);
explicit MF_Sim_simDialog(int cardType, QWidget *parent = nullptr);
~MF_Sim_simDialog();
private slots:
@@ -23,6 +24,11 @@ private slots:
private:
Ui::MF_Sim_simDialog *ui;
int cardType;
signals:
void sendCMD(QString cmd);
private slots:
void on_buttonBox_accepted();
};
#endif // MF_SIM_SIMDIALOG_H
+19 -1
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>461</width>
<height>351</height>
<height>456</height>
</rect>
</property>
<property name="windowTitle">
@@ -46,6 +46,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item>
@@ -90,6 +96,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item>
@@ -236,6 +248,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item>