Complete Mifare Simulate function

pull/3/head
wh201906 5 years ago
parent afe2474fe3
commit fe8b9d6161

@ -564,8 +564,10 @@ void Mifare::wipeE()
void Mifare::simulate()
{
MF_Sim_simDialog dialog;
dialog.exec();
MF_Sim_simDialog dialog(cardType.type);
connect(&dialog, &MF_Sim_simDialog::sendCMD, util, &Util::execCMD);
if(dialog.exec() == QDialog::Accepted)
ui->funcTab->setCurrentIndex(1);
}

@ -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());
}

@ -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

@ -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>

Loading…
Cancel
Save