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
0cb02de2
Commit
0cb02de2
authored
Feb 19, 2013
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WebView GUI window and core bridge connection established
parent
03fe344b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
5 deletions
+43
-5
SkyliveX.js
gui/SkyliveX.js
+6
-0
splash.html
gui/splash.html
+2
-1
skproto.cpp
plugins/skproto.cpp
+1
-1
mainwin.cpp
src/mainwin.cpp
+10
-0
mainwin.h
src/mainwin.h
+20
-0
skylivex.pro
src/skylivex.pro
+4
-3
No files found.
gui/SkyliveX.js
0 → 100644
View file @
0cb02de2
function
changeContent
(
id
,
content
)
{
document
.
getElementById
(
id
).
innerHTML
=
content
;
}
SkyliveX
.
changeContent
.
connect
(
changeContent
);
gui/splash.html
View file @
0cb02de2
<html>
<html>
<head>
<head>
<title>
SkyliveX
</title>
<title>
SkyliveX
</title>
<script
type=
"text/javascript"
src=
"SkyliveX.js"
></script>
<style>
<style>
#loading
{
#loading
{
color
:
#ff0000
;
color
:
#ff0000
;
...
@@ -10,7 +11,7 @@
...
@@ -10,7 +11,7 @@
<body>
<body>
<div
id=
"loading"
>
<div
id=
"loading"
>
<img
src=
"img/logo.png"
></img>
<img
src=
"img/logo.png"
></img>
<h3>
Loading...
</h3>
<h3
id=
"loadstring"
>
Loading...
</h3>
</div>
</div>
</body>
</body>
</html>
</html>
plugins/skproto.cpp
View file @
0cb02de2
...
@@ -53,7 +53,7 @@ void SkyliveProtocol::readFromNetwork()
...
@@ -53,7 +53,7 @@ void SkyliveProtocol::readFromNetwork()
while
(
tcpSocket
->
bytesAvailable
())
while
(
tcpSocket
->
bytesAvailable
())
{
{
tcpSocket
->
read
(
buffer
,
50
);
tcpSocket
->
read
(
buffer
,
50
);
std
::
cout
<<
"Received From Skylive Server"
<<
buffer
<<
std
::
endl
;
std
::
cout
<<
"Received From Skylive Server
:
"
<<
buffer
<<
std
::
endl
;
}
}
}
}
...
...
src/mainwin.cpp
View file @
0cb02de2
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
*/
*/
#include "mainwin.h"
#include "mainwin.h"
#include <QWebView>
#include <QWebView>
#include <QWebFrame>
#include <QFile>
#include <QFile>
#include <QDir>
#include <QDir>
#include <QString>
#include <QString>
...
@@ -59,6 +60,8 @@ MainWin::MainWin(QFile &htmlfile)
...
@@ -59,6 +60,8 @@ MainWin::MainWin(QFile &htmlfile)
setHtml
(
htmlFileName
,
baseUrl
);
setHtml
(
htmlFileName
,
baseUrl
);
resize
(
250
,
200
);
resize
(
250
,
200
);
page
()
->
mainFrame
()
->
addToJavaScriptWindowObject
(
"SkyliveX"
,
&
jsbridge
);
registerHandler
((
QString
)
"coreStarted"
,
&
MainWin
::
handle_corestarted
);
registerHandler
((
QString
)
"coreStarted"
,
&
MainWin
::
handle_corestarted
);
}
}
...
@@ -95,4 +98,11 @@ void MainWin::handle_corestarted(SKMessage::SKMessage &msg)
...
@@ -95,4 +98,11 @@ void MainWin::handle_corestarted(SKMessage::SKMessage &msg)
{
{
msg
.
handle
=
"connectTelescopes"
;
msg
.
handle
=
"connectTelescopes"
;
sendMessage
(
msg
);
sendMessage
(
msg
);
jsbridge
.
changePageContent
(
"loadstring"
,
"Connecting..."
);
}
void
JSBridge
::
changePageContent
(
QString
elementid
,
QString
content
)
{
emit
changeContent
(
elementid
,
content
);
}
}
src/mainwin.h
View file @
0cb02de2
...
@@ -48,6 +48,25 @@ class MainWin; // forward declaration for typedef
...
@@ -48,6 +48,25 @@ class MainWin; // forward declaration for typedef
// This is for member pointers to map messages
// This is for member pointers to map messages
typedef
void
(
MainWin
::*
SKHandlerFunction
)(
SKMessage
::
SKMessage
&
);
typedef
void
(
MainWin
::*
SKHandlerFunction
)(
SKMessage
::
SKMessage
&
);
/*
* class JSBridge
* This class connect the javascript object SkyliveX
* to c++
*/
class
JSBridge
:
public
QObject
{
Q_OBJECT
public
:
void
changePageContent
(
QString
elementid
,
QString
content
);
signals
:
void
changeContent
(
QString
elementid
,
QString
content
);
};
/*
/*
* class MainWin
* class MainWin
* This is just a little webkit transparent window
* This is just a little webkit transparent window
...
@@ -61,6 +80,7 @@ class MainWin : public QWebView
...
@@ -61,6 +80,7 @@ class MainWin : public QWebView
QUrl
baseurl
;
QUrl
baseurl
;
QFile
htmlfile
;
QFile
htmlfile
;
QString
htmlFileName
;
QString
htmlFileName
;
JSBridge
jsbridge
;
private
:
private
:
QHash
<
QString
,
SKHandlerFunction
>
_handlers
;
QHash
<
QString
,
SKHandlerFunction
>
_handlers
;
...
...
src/skylivex.pro
View file @
0cb02de2
...
@@ -10,7 +10,8 @@ HEADERS = skylivex.h \
...
@@ -10,7 +10,8 @@ HEADERS = skylivex.h \
QT
+=
core
network
webkitwidgets
widgets
QT
+=
core
network
webkitwidgets
widgets
OTHER_FILES
+=
\
OTHER_FILES
+=
..
/
gui
/
\
..
/
gui
/
splash
.
html
\
..
/
gui
/*
.js \
..
/
gui
/
img
/
logo
.
png
../gui
/*
.html \
../gui/img
/*
DESTDIR = ../build/
DESTDIR = ../build/
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