Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
skylivex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
astronomy
skylivex
Commits
f7c2a279
Commit
f7c2a279
authored
Feb 19, 2013
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Without a continue idle timer the cpu usage is lower...
parent
b6ff20d0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
14 deletions
+11
-14
skproto.cpp
plugins/skproto.cpp
+9
-4
skproto.h
plugins/skproto.h
+2
-0
main.cpp
src/main.cpp
+0
-5
skylivex.cpp
src/skylivex.cpp
+0
-4
skylivex.h
src/skylivex.h
+0
-1
No files found.
plugins/skproto.cpp
View file @
f7c2a279
...
@@ -46,10 +46,9 @@ void SkyliveProtocol::startPlugin()
...
@@ -46,10 +46,9 @@ void SkyliveProtocol::startPlugin()
std
::
cout
<<
"SkyliveProtocol initialized in thread "
<<
thread
()
<<
std
::
endl
;
std
::
cout
<<
"SkyliveProtocol initialized in thread "
<<
thread
()
<<
std
::
endl
;
registerHandler
((
QString
)
"connectTelescopes"
,
&
SkyliveProtocol
::
handle_connect
);
registerHandler
((
QString
)
"connectTelescopes"
,
&
SkyliveProtocol
::
handle_connect
);
QTimer
*
parsetimer
=
new
QTimer
();
pktTimer
=
new
QTimer
();
QObject
::
connect
(
parsetimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
processPackets
()));
QObject
::
connect
(
pktTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
processPackets
()));
parsetimer
->
start
();
pktTimer
->
start
();
}
}
...
@@ -63,6 +62,9 @@ void SkyliveProtocol::processPackets()
...
@@ -63,6 +62,9 @@ void SkyliveProtocol::processPackets()
QString
cmd
(
pkt
.
cmd
);
QString
cmd
(
pkt
.
cmd
);
std
::
cout
<<
"Packages in Queue: "
<<
cmd
.
toStdString
()
<<
std
::
endl
;
std
::
cout
<<
"Packages in Queue: "
<<
cmd
.
toStdString
()
<<
std
::
endl
;
}
else
{
if
(
pktTimer
->
isActive
())
pktTimer
->
stop
();
}
}
}
}
...
@@ -144,6 +146,9 @@ void SkyliveProtocol::readFromNetwork()
...
@@ -144,6 +146,9 @@ void SkyliveProtocol::readFromNetwork()
}
}
case
PROTO_END
:
case
PROTO_END
:
protoQueue
.
enqueue
(
protoMsg
);
protoQueue
.
enqueue
(
protoMsg
);
//processPackets();
if
(
!
pktTimer
->
isActive
())
pktTimer
->
start
();
case
CMD_END
:
case
CMD_END
:
case
PARAM_END
:
case
PARAM_END
:
SM_TCPCLIENT
=
CONNECTED
;
SM_TCPCLIENT
=
CONNECTED
;
...
...
plugins/skproto.h
View file @
f7c2a279
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
//#include <QNetworkSession>
//#include <QNetworkSession>
#include <QByteArray>
#include <QByteArray>
#include <QQueue>
#include <QQueue>
#include <QTimer>
#include "pluginsinterfaces.h"
#include "pluginsinterfaces.h"
#include "ipcmsg.h"
#include "ipcmsg.h"
...
@@ -93,6 +94,7 @@ class SkyliveProtocol : public QObject, SkylivexPluginInterface
...
@@ -93,6 +94,7 @@ class SkyliveProtocol : public QObject, SkylivexPluginInterface
_SM_TCPCLIENT
SM_TCPCLIENT
;
_SM_TCPCLIENT
SM_TCPCLIENT
;
SKProtoMsg
protoMsg
;
SKProtoMsg
protoMsg
;
QQueue
<
SKProtoMsg
>
protoQueue
;
QQueue
<
SKProtoMsg
>
protoQueue
;
QTimer
*
pktTimer
;
public
:
public
:
...
...
src/main.cpp
View file @
f7c2a279
...
@@ -72,11 +72,6 @@ int main(int argc, char *argv[])
...
@@ -72,11 +72,6 @@ int main(int argc, char *argv[])
// and give a slot to the ITC/IPC in the main loop
// and give a slot to the ITC/IPC in the main loop
QTimer
::
singleShot
(
0
,
skx
,
SLOT
(
initialize
()));
QTimer
::
singleShot
(
0
,
skx
,
SLOT
(
initialize
()));
// process IPC events when we are in idle from the main window
QTimer
*
skxprocess
=
new
QTimer
(
skx
);
QObject
::
connect
(
skxprocess
,
SIGNAL
(
timeout
()),
skx
,
SLOT
(
process
()));
skxprocess
->
start
();
// connect core with the mainwin
// connect core with the mainwin
QObject
::
connect
(
skx
,
SIGNAL
(
msgForMainWin
(
SKMessage
::
SKMessage
&
)),
&
mainw
,
SLOT
(
msgFromCore
(
SKMessage
::
SKMessage
&
)));
QObject
::
connect
(
skx
,
SIGNAL
(
msgForMainWin
(
SKMessage
::
SKMessage
&
)),
&
mainw
,
SLOT
(
msgFromCore
(
SKMessage
::
SKMessage
&
)));
QObject
::
connect
(
&
mainw
,
SIGNAL
(
putMessage
(
SKMessage
::
SKMessage
&
)),
skx
,
SLOT
(
receiveFromMainWin
(
SKMessage
::
SKMessage
&
)));
QObject
::
connect
(
&
mainw
,
SIGNAL
(
putMessage
(
SKMessage
::
SKMessage
&
)),
skx
,
SLOT
(
receiveFromMainWin
(
SKMessage
::
SKMessage
&
)));
...
...
src/skylivex.cpp
View file @
f7c2a279
...
@@ -55,10 +55,6 @@ void SkyliveX::initialize()
...
@@ -55,10 +55,6 @@ void SkyliveX::initialize()
}
}
void
SkyliveX
::
process
()
{
}
void
SkyliveX
::
loadPlugins
()
void
SkyliveX
::
loadPlugins
()
{
{
...
...
src/skylivex.h
View file @
f7c2a279
...
@@ -66,7 +66,6 @@ class SkyliveX : public QObject
...
@@ -66,7 +66,6 @@ class SkyliveX : public QObject
public
slots
:
public
slots
:
void
initialize
();
void
initialize
();
void
process
();
void
receiveFromMainWin
(
SKMessage
::
SKMessage
&
msg
);
void
receiveFromMainWin
(
SKMessage
::
SKMessage
&
msg
);
void
receiveFromPlugins
(
SKMessage
::
SKMessage
msg
);
void
receiveFromPlugins
(
SKMessage
::
SKMessage
msg
);
...
...
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