Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kumir2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kumir
kumir2
Commits
dc5a5b92
Commit
dc5a5b92
authored
Oct 01, 2014
by
Victor Yacovlev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build fix
parent
1e93a57e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
44 deletions
+64
-44
src/shared/widgets/pultlogger.cpp
src/shared/widgets/pultlogger.cpp
+55
-0
src/shared/widgets/pultlogger.h
src/shared/widgets/pultlogger.h
+9
-44
No files found.
src/shared/widgets/pultlogger.cpp
View file @
dc5a5b92
...
...
@@ -9,6 +9,61 @@
#include <iostream>
#include "pultlogger.h"
#define SCROLL_STEP 10
#define RESP_PANEL 50
#define LOGGER_BUTTONS 140
#define TEXT_STEP 14
#define UP 1
#define DOWN 2
#define LEFT 3
#define RIGHT 4
#define TEXTT 5
#define TEXT 5
logLine
::
logLine
(
QString
KumCommand
,
QString
LogCommand
,
QString
React
,
QFrame
*
frame
,
QFrame
*
respFrame
,
uint
pos
)
{
kumCommand
=
KumCommand
;
logCommand
=
LogCommand
;
react
=
React
;
textLabel
=
new
QLabel
(
frame
);
textLabel
->
setText
(
logCommand
);
textLabel
->
move
(
4
,
pos
);
textLabel
->
resize
(
120
,
20
);
textLabel
->
show
();
respLabel
=
new
QLabel
(
respFrame
);
respLabel
->
setText
(
React
);
respLabel
->
move
(
4
,
pos
);
respLabel
->
resize
(
RESP_PANEL
,
20
);
respLabel
->
show
();
}
void
logLine
::
moveUp
()
{
textLabel
->
move
(
textLabel
->
x
(),
textLabel
->
y
()
-
SCROLL_STEP
);
respLabel
->
move
(
respLabel
->
x
(),
respLabel
->
y
()
-
SCROLL_STEP
);
}
void
logLine
::
moveDown
()
{
textLabel
->
move
(
textLabel
->
x
(),
textLabel
->
y
()
+
SCROLL_STEP
);
respLabel
->
move
(
respLabel
->
x
(),
respLabel
->
y
()
+
SCROLL_STEP
);
}
void
pultLogger
::
appendText
(
QString
kumCommand
,
QString
text
,
QString
replay
)
{
while
(
pos
>
H
-
68
)
downBtnPressed
();
lines
.
append
(
logLine
(
kumCommand
,
text
,
replay
,
dummyFrame
,
respFrame
,
pos
));
pos
=
pos
+
TEXT_STEP
;
}
void
MainButton
::
setText
(
QString
t
)
{
text
=
t
;
direction
=
TEXT
;
}
loggerButton
::
loggerButton
(
QDir
dir
,
QWidget
*
parent
)
:
QWidget
(
parent
)
{
isUpArrow
=
false
;
...
...
src/shared/widgets/pultlogger.h
View file @
dc5a5b92
...
...
@@ -18,17 +18,7 @@
#else
#include <QtGui>
#endif
#define SCROLL_STEP 10
#define RESP_PANEL 50
#define LOGGER_BUTTONS 140
#define TEXT_STEP 14
#define UP 1
#define DOWN 2
#define LEFT 3
#define RIGHT 4
#define TEXTT 5
#define TEXT 5
#ifdef WIDGETS_LIBRARY
#define WIDGETS_EXPORT Q_DECL_EXPORT
#else
...
...
@@ -72,35 +62,14 @@ private:
class
logLine
{
public:
inline
logLine
(
QString
KumCommand
,
logLine
(
QString
KumCommand
,
QString
LogCommand
,
QString
React
,
QFrame
*
frame
,
QFrame
*
respFrame
,
uint
pos
)
{
kumCommand
=
KumCommand
;
logCommand
=
LogCommand
;
react
=
React
;
textLabel
=
new
QLabel
(
frame
);
textLabel
->
setText
(
logCommand
);
textLabel
->
move
(
4
,
pos
);
textLabel
->
resize
(
120
,
20
);
textLabel
->
show
();
respLabel
=
new
QLabel
(
respFrame
);
respLabel
->
setText
(
React
);
respLabel
->
move
(
4
,
pos
);
respLabel
->
resize
(
RESP_PANEL
,
20
);
respLabel
->
show
();
}
inline
void
moveUp
()
{
textLabel
->
move
(
textLabel
->
x
(),
textLabel
->
y
()
-
SCROLL_STEP
);
respLabel
->
move
(
respLabel
->
x
(),
respLabel
->
y
()
-
SCROLL_STEP
);
}
inline
void
moveDown
()
{
textLabel
->
move
(
textLabel
->
x
(),
textLabel
->
y
()
+
SCROLL_STEP
);
respLabel
->
move
(
respLabel
->
x
(),
respLabel
->
y
()
+
SCROLL_STEP
);
}
;
void
moveUp
();
void
moveDown
();
inline
int
pos
()
{
return
textLabel
->
y
();
...
...
@@ -145,12 +114,8 @@ public:
//upButton->show();
//show();
}
inline
void
appendText
(
QString
kumCommand
,
QString
text
,
QString
replay
)
{
while
(
pos
>
H
-
68
)
downBtnPressed
();
lines
.
append
(
logLine
(
kumCommand
,
text
,
replay
,
dummyFrame
,
respFrame
,
pos
));
pos
=
pos
+
TEXT_STEP
;
}
void
appendText
(
QString
kumCommand
,
QString
text
,
QString
replay
);
QString
log
()
{
QString
toret
;
...
...
@@ -219,7 +184,7 @@ public:
*/
~
MainButton
(){};
void
setDirection
(
int
d
){
direction
=
d
;};
void
setText
(
QString
t
){
text
=
t
;
direction
=
TEXT
;}
;
void
setText
(
QString
t
)
;
bool
isChecked
(){
return
checked
;};
void
setCheckable
(
bool
flag
){
Q_UNUSED
(
flag
);
checkable
=
true
;};
void
setChecked
(
bool
flag
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment