Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
kroxiksut authored Mar 6, 2019
1 parent ca65ffe commit edad262
Show file tree
Hide file tree
Showing 12 changed files with 1,185 additions and 0 deletions.
47 changes: 47 additions & 0 deletions CinTesting.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#-------------------------------------------------
#
# Project created by QtCreator 2019-02-13T12:51:17
#
#-------------------------------------------------

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = CinTesting
TEMPLATE = app vcapp

# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

CONFIG += c++11

SOURCES += \
main.cpp \
mainwindow.cpp \
about.cpp

HEADERS += \
mainwindow.h \
about.h

FORMS += \
mainwindow.ui \
about.ui

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

RESOURCES += \
resource.qrc
VERSION = 1.0.2
328 changes: 328 additions & 0 deletions CinTesting.pro.user

Large diffs are not rendered by default.

328 changes: 328 additions & 0 deletions CinTesting.pro.user.8fb1639

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions about.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "about.h"
#include "ui_about.h"

About::About(QWidget *parent) :
QDialog(parent),
ui(new Ui::About)
{
ui->setupUi(this);
}

About::~About()
{
delete ui;
}

void About::on_pushButton_clicked()
{
close();
}
25 changes: 25 additions & 0 deletions about.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#ifndef ABOUT_H
#define ABOUT_H

#include <QDialog>

namespace Ui {
class About;
}

class About : public QDialog
{
Q_OBJECT

public:
explicit About(QWidget *parent = nullptr);
~About();

private slots:
void on_pushButton_clicked();

private:
Ui::About *ui;
};

#endif // ABOUT_H
68 changes: 68 additions & 0 deletions about.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>About</class>
<widget class="QDialog" name="About">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>659</width>
<height>425</height>
</rect>
</property>
<property name="windowTitle">
<string>О программе</string>
</property>
<property name="modal">
<bool>true</bool>
</property>
<widget class="QTextBrowser" name="textBrowser">
<property name="geometry">
<rect>
<x>40</x>
<y>10</y>
<width>581</width>
<height>351</height>
</rect>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:7.8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt; font-weight:600;&quot;&gt;Авторы&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Малков Федор Сергеевич. Аспирант ИДСТУ СО РАН, г. Иркутск. +7-924-833-38-34; [email protected]&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;При поддержке ФГБНУ &amp;quot;Научный центр проблем здоровья семьи и репродукции человека&amp;quot;, г. Иркутск &lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt; font-weight:600;&quot;&gt;ИНСТРУКЦИЯ&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Скачать три архива с сайта &lt;/span&gt;&lt;a href=&quot;https://www.kaggle.com/c/intel-mobileodt-cervical-cancer-screening/data&quot;&gt;&lt;span style=&quot; font-size:8pt; text-decoration: underline; color:#0000ff;&quot;&gt;kaggle.com (https://www.kaggle.com/c/intel-mobileodt-cervical-cancer-screening/data)&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Скачиваем архивы &lt;/span&gt;&lt;span style=&quot; font-family:'Atlas Grotesk,sans-serif'; font-size:8pt; color:rgba(0,0,0,0.694118); background-color:rgba(225,240,246,0.294118);&quot;&gt;additional_Type_1_v2.7z, additional_Type_2_v2.7z и additional_Type_3_v2.7z (в сумме 25.7 ГБ)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Atlas Grotesk,sans-serif'; font-size:8pt; color:rgba(0,0,0,0.694118); background-color:rgba(225,240,246,0.294118);&quot;&gt;Распаковываем их в папки на компьютере.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Atlas Grotesk,sans-serif'; font-size:8pt; color:rgba(0,0,0,0.694118); background-color:rgba(225,240,246,0.294118);&quot;&gt;Переходим в папку с этой программой. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Atlas Grotesk,sans-serif'; font-size:8pt; color:rgba(0,0,0,0.694118); background-color:rgba(225,240,246,0.294118);&quot;&gt;Из папок Type_1, Type_2 и Type_3 копируем или перемещаем изображения в папки cin/1; cin/2 и cin/3&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Atlas Grotesk,sans-serif'; font-size:8pt; color:rgba(0,0,0,0.694118); background-color:rgba(225,240,246,0.294118);&quot;&gt;Перезапускаем программу&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Atlas Grotesk,sans-serif'; font-size:8pt; color:rgba(0,0,0,0.694118); background-color:rgba(225,240,246,0.294118);&quot;&gt;По умолчанию, вместе с программой поставляется по два изображения для CIN1..CIN3&lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Atlas Grotesk,sans-serif'; font-size:10pt; font-weight:600; color:rgba(0,0,0,0.694118); background-color:rgba(225,240,246,0.294118);&quot;&gt;ВЕРСИЯ&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Atlas Grotesk,sans-serif'; font-size:8pt; color:rgba(0,0,0,0.694118); background-color:rgba(225,240,246,0.294118);&quot;&gt;Версия программы 1.0.2. &lt;br /&gt;6 марта 2019 года&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Atlas Grotesk,sans-serif'; font-size:8pt; color:rgba(0,0,0,0.694118);&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>240</x>
<y>370</y>
<width>93</width>
<height>28</height>
</rect>
</property>
<property name="text">
<string>OK</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>
Binary file added icon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "mainwindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();

return a.exec();
}
121 changes: 121 additions & 0 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "about.h"
#include "ui_about.h"
#include <QDir>
#include <QFileInfoList>
#include <QString>
#include <QDebug>
#include <vector>
#include <random>
#include <time.h>

using namespace std;

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->pushButton->setEnabled(false);
ui->pushButton_2->setEnabled(false);

}

void MainWindow::traverse(const QString &pattern, const QString &dirname, int level)
{
QDir dir(dirname);
dir.setFilter(QDir::Dirs | QDir::Files | QDir::NoSymLinks | QDir::NoDot | QDir::NoDotDot);

static const QStringList stringList = pattern.split('/');
foreach (QFileInfo fileInfo, dir.entryInfoList(stringList.mid(level, 1))) {
if (fileInfo.isDir() && fileInfo.isReadable())
traverse(pattern, fileInfo.filePath(), level+1);
else if (stringList.size() == (level + 1)) {
// pth
pth.push_back(fileInfo.filePath());


// qDebug() << fileInfo.filePath();
}
}

}

MainWindow::~MainWindow()
{

delete ui;
}

void MainWindow::on_pushButton_clicked()
{

ui->lbl_descr->clear();
//qsrand(qrand());
srand (time(NULL));
MyRand = rand() % ((pth.size() - 1));
//qDebug() << pth.at(MyRand) << " - " << MyRand;
QImage *img;
img = new QImage();
img->load(pth.at(MyRand));
ui->ImgLabel->setPixmap(QPixmap::fromImage(img->scaled(
ui->ImgLabel->geometry().width(),
ui->ImgLabel->geometry().height(), Qt::IgnoreAspectRatio)));
delete img;
ui->pushButton_2->setEnabled(true);




}

unsigned int MainWindow::getNumberFPath(unsigned int V)
{
QString str = pth.at(V);
return str.split('/').at(1).toInt();
}

void MainWindow::on_pushButton_2_clicked()
{
unsigned int var = getNumberFPath(MyRand);
unsigned int rb;
if (ui->radioButton->isChecked()) {
rb = 1;
} else if (ui->radioButton_2->isChecked()) {
rb =2;
} else {
rb = 3;
}

if (rb == var) {
cinTrue+=1;
ui->lbl_true->setText("Правильных ответов - " + QString::number(cinTrue));
} else {
cinFalse +=1;
ui->lbl_false->setText("Неправильных ответов - " + QString::number(cinFalse));
}
ui->lbl_descr->setText("<<<----- это CIN"+QString::number(var));
ui->pushButton_2->setEnabled(false);

}

void MainWindow::on_pushButton_3_clicked()
{
pth.clear();
traverse("*/*", "cin", 0);
ui->pushButton->setEnabled(true);
ui->pushButton->click();
ui->pushButton_3->setEnabled(false);
ui->pushButton_2->setEnabled(true);
cinTrue = 0;
cinFalse = 0;
cnt=0;

}

void MainWindow::on_pushButton_4_clicked()
{
About* ab = new About();
ab->show();
}
47 changes: 47 additions & 0 deletions mainwindow.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QString>
#include <QImage>

#include <vector>
using namespace std;

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
Q_OBJECT

public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();



private slots:
void on_pushButton_clicked();

void on_pushButton_2_clicked();

void on_pushButton_3_clicked();

void on_pushButton_4_clicked();

private:
Ui::MainWindow *ui;
vector <QString> pth;
QImage *myimg;
unsigned int MyRand;
unsigned int cinTrue;
unsigned int cinFalse;
unsigned int cnt;
unsigned int getNumberFPath(unsigned int V);
void traverse(const QString &pattern, const QString &dirname, int level);

};

#endif // MAINWINDOW_H
Loading

0 comments on commit edad262

Please sign in to comment.