Skip to content

Commit

Permalink
Почистил мусор
Browse files Browse the repository at this point in the history
  • Loading branch information
MimusTriurus committed Feb 9, 2019
1 parent c66685a commit be6527b
Show file tree
Hide file tree
Showing 13 changed files with 85 additions and 46 deletions.
2 changes: 1 addition & 1 deletion lib/static/CvVideoCapture/Capture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <QDebug>

Capture::Capture( QObject *parent ) :
QObject( parent ) {
QObject{ parent } {

}

Expand Down
8 changes: 8 additions & 0 deletions lib/static/FpsChecker/FpsChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ void FpsChecker::reset( ) {
_counter = 0;
}

FpsChecker::FpsChecker( ) :
_counter{ 0 },
_sumTime{ 0 },
_startTime{ 0 }
{

}

void FpsChecker::start( ) {
_startTime = cv::getTickCount( );
}
Expand Down
8 changes: 5 additions & 3 deletions lib/static/FpsChecker/FpsChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@

class FpsChecker {
public:
FpsChecker( );

void start( );
void stop( );

int fps( ) const;

void reset( );
private:
int64 _counter{ 0 };
int64 _sumTime{ 0 };
int64 _startTime{ 0 };
int64 _counter;
int64 _sumTime;
int64 _startTime;

int64 getTimeTicks( ) const;
double getTimeMicro( ) const;
Expand Down
9 changes: 5 additions & 4 deletions lib/static/VideoReceiver/VideoReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
#include <QDebug>

VideoReciever::VideoReciever( QObject *parent ) :
QThread( parent ),
_imgSize { -1 },
_port { 10000 },
_interval { 5 }
QThread { parent },
_imgSize { -1 },
_port { 10000 },
_interval { 5 },
_workInProgress { false }
{

}
Expand Down
2 changes: 1 addition & 1 deletion lib/static/VideoReceiver/VideoReceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class VideoReciever : public QThread {
QByteArray _imgBuffer;
quint16 _port;
double _interval;
bool _workInProgress{ false };
bool _workInProgress;

mutable QMutex _mutex;
};
Expand Down
8 changes: 5 additions & 3 deletions lib/static/VideoTransmitter/VideoTransmitter.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#include "VideoTransmitter.h"

VideoTransmitter::VideoTransmitter( QString host, quint16 port, QObject *parent ) :
QObject{ parent },
_host{ host },
_port{ port }
QObject { parent },
_packetSize { 8192 },
_quality { 55 },
_host { host },
_port { port }
{

}
Expand Down
5 changes: 3 additions & 2 deletions lib/static/VideoTransmitter/VideoTransmitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class VideoTransmitter : public QObject {
Q_OBJECT
public:
VideoTransmitter( QString host = "localhost", quint16 port = 10000, QObject *parent = nullptr );
VideoTransmitter( ) = delete;
void setQuality( const int quality );
void host( const QString &host );
void port( const quint16 port );
Expand All @@ -19,8 +20,8 @@ class VideoTransmitter : public QObject {
public slots:
void sendFrameData( const std::vector<uchar> &imgData );
private:
int _packetSize { 8192 };
int _quality { 55 };
int _packetSize;
int _quality;
QUdpSocket _socket;
QHostAddress _host;
quint16 _port;
Expand Down
9 changes: 6 additions & 3 deletions test/CvReceiverTest/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
#include <MatSerialization.h>

MainWindow::MainWindow( QWidget *parent ) :
QMainWindow( parent ),
ui( new Ui::MainWindow )
QMainWindow { parent },
ui { new Ui::MainWindow },
_isListen { false },
_btnListen { "Start" },
_port { "10000" }
{
ui->setupUi(this);
ui->setupUi( this );

connect( &_receiver, SIGNAL( imgDataReceived( QByteArray ) ),
this, SLOT( onReceiveData( QByteArray ) ) );
Expand Down
6 changes: 3 additions & 3 deletions test/CvReceiverTest/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class MainWindow : public QMainWindow {
private:
Ui::MainWindow *ui;
VideoReciever _receiver;
bool _isListen { false };
QPushButton _btnListen { "Start" };
QLineEdit _port { "10000" };
bool _isListen;
QPushButton _btnListen;
QLineEdit _port;
FpsChecker _fpsChecker;

QTimer _tmrUpdate;
Expand Down
21 changes: 19 additions & 2 deletions test/CvTransmitterTest/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,25 @@
#include <iostream>

MainWindow::MainWindow( QWidget *parent ) :
QMainWindow( parent ),
ui( new Ui::MainWindow )
QMainWindow { parent },
ui { new Ui::MainWindow },
_cameraIsOpen { false },
_showFrameWindow{ false },
_grayScale { false },
_link { false },
_resizeFrame { false },
_qual { 50 },
_cameraId { "0" },
_host { "127.0.0.1" },
_port { "10000" },
_showFrameWin { "Show frame window" },
_toGrayscale { "Convert BGR2RGB" },
_resize { "Resize to 320x240" },
_quality { "50" },
_width { "640" },
_height { "480" },
_fps { "30" },
_btnStart { "Start" }
{
ui->setupUi( this );
initInterface( );
Expand Down
34 changes: 17 additions & 17 deletions test/CvTransmitterTest/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,32 @@ class MainWindow : public QMainWindow {
private:
Ui::MainWindow *ui;

bool _cameraIsOpen { false };
bool _showFrameWindow{ false };
bool _grayScale { false };
bool _link { false };
bool _resizeFrame { false };
int _qual { 50 };
bool _cameraIsOpen;
bool _showFrameWindow;
bool _grayScale;
bool _link;
bool _resizeFrame;
int _qual;

Capture _capture;
QTimer _tmrFrameUpdate;
VideoTransmitter _transmitter;

QLineEdit _cameraId { "0" };
QLineEdit _host { "192.168.1.51" };
QLineEdit _port { "10000" };
QLineEdit _cameraId;
QLineEdit _host;
QLineEdit _port;
QTextEdit _log;
QCheckBox _showFrameWin{ "Show frame window" };
QCheckBox _toGrayscale { "Convert BGR2RGB" };
QCheckBox _resize { "Resize to 320x240" };
QLineEdit _quality { "50" };
QCheckBox _showFrameWin;
QCheckBox _toGrayscale;
QCheckBox _resize;
QLineEdit _quality;

QLineEdit _width { "640" };
QLineEdit _height { "480" };
QLineEdit _width;
QLineEdit _height;

QLineEdit _fps { "30" };
QLineEdit _fps;

QPushButton _btnStart { "Start" };
QPushButton _btnStart;

FpsChecker _fpsChecker;
void initInterface( );
Expand Down
9 changes: 7 additions & 2 deletions test/VideoCaptureTest/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
#include <QTimer>

MainWindow::MainWindow( QWidget *parent ) :
QMainWindow( parent ),
ui( new Ui::MainWindow )
QMainWindow { parent },
ui { new Ui::MainWindow },
_start { false },
_camIndex { "0" },
_camFps { "30" },
_showCameraWin { "Show Camera Win" },
_btnStart { "Start" }
{
ui->setupUi( this );
_showCameraWin.setChecked( true );
Expand Down
10 changes: 5 additions & 5 deletions test/VideoCaptureTest/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class MainWindow : public QMainWindow {
Capture _capture;
FpsChecker _fpsChecker;
QTimer _tmrFrameUpdate;
bool _start{ false };
bool _start;

QLineEdit _camIndex { "0" };
QLineEdit _camFps { "30" };
QCheckBox _showCameraWin { "Show Camera Win" };
QPushButton _btnStart { "Start" };
QLineEdit _camIndex;
QLineEdit _camFps;
QCheckBox _showCameraWin;
QPushButton _btnStart;
void initInterface( );
private slots:
void onNewCvFrame( );
Expand Down

0 comments on commit be6527b

Please sign in to comment.