Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tammo Jan Dijkema
dt_ctrl
Commits
87a30f7f
Commit
87a30f7f
authored
May 20, 2019
by
Jeroen Vreeken
Browse files
Merge branch 'jeroen' of video.vreeken.net:public_html/dt_ctrl into jeroen
parents
5c001ee5
cf1ba58d
Changes
98
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
87a30f7f
...
...
@@ -4,9 +4,12 @@
# ```
# git clone gitlab.camras.nl/dijkema/dt_ctrl
# ```
# Copy the Dockerfile to the empty directory: `cp dt_ctrl/Dockerfile .`
# Tar the source code with `tar czf dt_ctrl.tgz dt_ctrl`
# Create the docker file with `docker build --tag consoledemo .`
# This Dockerfile is hardcoded to run the websockets server at
# port 8000.
# Start the docker container with
# docker run -it -p 8081:80 -p 8000:8000 -p 11031:11031 -p 11030:11030 -p 11040:11040 -p 11041:11041 -p 11042:11042 -p 11011:11011 consoledemo
# Then visit the consoledemo from the host machine at http://localhost:8081 (NOT at port 8000, which will show a non-working HTML page)
FROM
ubuntu:16.04
RUN
apt-get
-y
update
...
...
@@ -18,8 +21,7 @@ RUN cd /root/libnova-libnova && libtoolize && autoreconf -i && ./configure && ma
RUN
cd
/root
&&
git clone https://github.com/warmcat/libwebsockets.git
RUN
cd
/root/libwebsockets
&&
mkdir
build
&&
cd
build
&&
cmake ..
&&
make
&&
make
install
ADD
dt_ctrl.tgz /root
RUN
cd
/root
tar
xf dt_ctrl.tgz
RUN
cd
/root
&&
git clone https://gitlab.camras.nl/dijkema/dt_ctrl
RUN
cd
/root/dt_ctrl
&&
autoconf
&&
./configure
--with-libwebsockets
=
/usr/local
&&
make
RUN
cd
/root/dt_ctrl
&&
make console/console/console_httpd
...
...
@@ -33,6 +35,45 @@ RUN cp -r /root/dt_ctrl/console/htdocs /var/www/
RUN
cp
-r
/root/dt_ctrl/console/js /var/www/
RUN
mkdir
-p
/var/www/htdocs/tle
&&
touch
/var/www/htdocs/tle/amateur.txt
&&
touch
/var/www/htdocs/tle/gps-ops.txt
&&
touch
/var/www/htdocs/tle/tle-new.txt
CMD
screen -d -m /root/dt_ctrl/controller/dt_ctrl /root/dt_ctrl/controller/dt_ctrl.ctrl && screen -d -m bash -c 'cd /root/dt_ctrl/console/console && ./start_console.sh' && /bin/bash
RUN
apt-get
-y
install
apache2 net-tools
RUN
mkdir
-p
/var/www/console/
&&
cp
-r
/root/dt_ctrl/console/htdocs /var/www/console
&&
cp
-r
/root/dt_ctrl/console/js /var/www/console
# Configure apache to serve the console htdocs
RUN
echo
'
\
<VirtualHost *:80>\n
\
\t
ServerAdmin webmaster@localhost\n
\
\t
DocumentRoot /var/www/console/htdocs\n
\
\t
<Directory "/var/www/console/htdocs">\n
\
\t\t
Order allow,deny\n
\
\t\t
Allow from all\n
\
\t\t
AllowOverride None\n
\
\t\t
AddHandler cgi-script .cgi\n
\
\t\t
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch\n
\
\t
</Directory>\n
\
\n\
ErrorLog ${APACHE_LOG_DIR}/error.log\n
\
CustomLog ${APACHE_LOG_DIR}/access.log combined\n
\
</VirtualHost>\n
\
'
>
/etc/apache2/sites-enabled/000-default.conf
# Configure ports for the console and controller
RUN
mkdir
/etc/dt
&&
echo
'
\
[console]\n
\
host=localhost\n
\
\n\
[controller]\n
\
host=localhost\n
\
\n\
[htdocs]\n
\
path=/var/www/console/htdocs\n
\
port=8000\n
\
'
>
/etc/dt/dt_host.ini
# Patch the console software to point the websockets port
RUN
sed
-i
-e
's/window.location.host/window.location.hostname+":8000"/'
/var/www/console/htdocs/index.html
&&
\
sed
-i
-e
's/window.location.host/window.location.hostname+":8000"/'
/var/www/console/htdocs/mech.html
CMD
screen -d -m /root/dt_ctrl/controller/dt_ctrl /root/dt_ctrl/controller/dt_ctrl.ctrl && screen -d -m bash -c 'cd /root/dt_ctrl/console/console && ./start_console.sh' && /bin/bash -c 'service apache2 start' && bash
EXPOSE
80
Makefile
View file @
87a30f7f
...
...
@@ -118,8 +118,8 @@ TARGETS:= $$($(DIR)_TMPTARGETS) $$(TARGETS)
DIR
:=
$(DIR)
endef
CFLAGS
:=
-pthread
-D_GNU_SOURCE
-Icommon
-Icommon
/include
-Icontroller
-Iconsole
/console
-Iinclude
LDFLAGS
:=
-pthread
-Lcommon
/lib
-Lcontroller
/lib
-Lconsole
/console/lib
-Llib
-Wl
,--as-needed
CFLAGS
:=
$(BUILD_CFLAGS)
-D_GNU_SOURCE
-Icommon
-Icommon
/include
-Icontroller
-Iconsole
/console
-Iinclude
LDFLAGS
:=
-Lcommon
/lib
-Lcontroller
/lib
-Lconsole
/console/lib
-Llib
-Wl
,--as-needed
VPATH
+=
common/lib controller/lib console/console/lib lib
VPATH
+=
include
...
...
README
View file @
87a30f7f
...
...
@@ -21,3 +21,5 @@ Building the software
Just run "make". To see more targets, run "make help". You may also run make in
the individual directories.
./configure --host arm-none-eabihf CFLAGS=-specs /usr/local/arm-none-eabihf/lib/atsamx70x21_flash.specs --disable-am335x --enable-embedded --disable-test --disable-ethercat --disable-vesp
build.mk
View file @
87a30f7f
...
...
@@ -26,6 +26,9 @@ endif
ifdef
HOSTSYS
CC
=
${HOSTSYS}
-gcc
LD
=
${HOSTSYS}
-ld
OBJCOPY
=
${HOSTSYS}
-objcopy
OBJDUMP
=
${HOSTSYS}
-objdump
LIBTOOL
=
${HOSTSYS}
-libtool
CONF_HOST
=
--host
=
${HOSTSYS}
HW
=
$(HOSTSYS)
...
...
@@ -41,9 +44,13 @@ endif
@
${LIBTOOL}
--quiet
--mode
=
compile
--tag
=
CC
$(CC)
-MMD
$(CFLAGS)
-c
$<
-o
$@
@
sed
-e
"s:
\.
il2c.c:
\.
il:"
-i
-i
$*
.il2c.d
%.o
:
%.ctrl
@
echo
"BLOB LD
$@
"
@
$(LD)
-r
-b
binary
$<
-o
$@
%
:
%.o
@
echo
" LD
$@
"
@
${LIBTOOL}
--quiet
--mode
=
link
--tag
=
CC
$(LINK.o)
$(
filter
%.o,
$^
)
$(LOADLIBS)
$(LDLIBS)
$
(
$@
_LDFLAGS
)
-o
$@
@
${LIBTOOL}
--quiet
--mode
=
link
--tag
=
CC
$(LINK.o)
$(
filter
%.o,
$^
)
$(LOADLIBS)
$(LDLIBS)
$
(
$@
_LDFLAGS
)
$(CFLAGS)
-o
$@
%.lo
:
%.c
@
echo
"LT CC
$<
"
...
...
@@ -96,3 +103,10 @@ endef
%.dtbo
:
%.dts
@
echo
" DTCo
$<
"
@
dtc
-I
dts
$<
-O
dtb
-o
$@
%.hex
:
%
$(OBJCOPY)
--strip-debug
--strip-unneeded
$?
-O
ihex
$?
.hex
%.asm
:
%
$(OBJDUMP)
-D
$?
>
$?
.asm
buildflags.mk.in
View file @
87a30f7f
...
...
@@ -10,5 +10,16 @@ BUILD_CONSOLE_J2000_INDI=@BUILD_CONSOLE_J2000_INDI@
BUILD_ETHERCAT=@BUILD_ETHERCAT@
BUILD_VESP=@BUILD_VESP@
BUILD_AM335X=@BUILD_AM335X@
BUILD_ATSAMX70=@BUILD_ATSAMX70@
BUILD_LINUX_JOYSTICK=@BUILD_LINUX_JOYSTICK@
BUILD_TEST=@BUILD_TEST@
BUILD_PTHREAD=@BUILD_PTHREAD@
BUILD_TCP=@BUILD_TCP@
BUILD_DYNAMICLINKING=@BUILD_DYNAMICLINKING@
BUILD_FILEIO=@BUILD_FILEIO@
BUILD_EMBEDDED=@BUILD_EMBEDDED@
BUILD_SYSTICK=@BUILD_SYSTICK@
BUILD_CFLAGS=@CFLAGS@ @CFLAGS_PTHREAD@ @CFLAGS_TCP@ @CFLAGS_SEMAPHORE@ @CFLAGS_FILEIO@ @CFLAGS_EMBEDDED@ @CFLAGS_SYSTICK@
common/command/build.mk
View file @
87a30f7f
ifdef
BUILD_TCP
COMMAND_TARGETS
+=
$(LIBDIR)
/libcommand.la
COMMAND_TARGETS
+=
$(DIR)
/command_list
$(DIR)
/command_send
if
neq
($(OS), FreeBSD)
if
def
BUILD_LINUX_JOYSTICK
COMMAND_TARGETS
+=
$(DIR)
/command_joystick
endif
...
...
@@ -46,3 +48,5 @@ CLEAN += $(COMMAND_TARGETS) $(ARCHOBJS) \
$(COMMAND_SEND_OBJS)
\
$(COMMAND_JOYSTICK_OBJS)
\
$(LIBDIR)
/libcommand.a
endif
common/command/command.h
View file @
87a30f7f
...
...
@@ -36,7 +36,8 @@ enum command_ptype {
COMMAND_PTYPE_SPEED
=
5
,
/* Simple direct 1st derivative setpoint */
COMMAND_PTYPE_SETPOINT_TIME
=
6
,
/* Setpoint to be reached @ time */
COMMAND_PTYPE_SETPOINT_TRACK
=
7
,
/* Use setpoint from track input */
COMMAND_PTYPE_SPEED_TRACK
=
8
,
/* Use 1st derivative from track input */
COMMAND_PTYPE_MAX
,
/* Always the last entry! */
};
...
...
common/command/command_joystick.c
View file @
87a30f7f
...
...
@@ -18,6 +18,9 @@
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <linux/joystick.h>
#include <command/command.h>
#include <dt_port_numbers.h>
...
...
common/log/build.mk
View file @
87a30f7f
ifdef
BUILD_TCP
ARCHSRCS
=
$(DIR)
/log.c
else
ARCHSRCS
=
$(DIR)
/log_std.c
endif
ARCHOBJS
=
$(ARCHSRCS:.c=.lo)
SRCS
+=
$(ARCHSRCS)
...
...
@@ -7,8 +12,10 @@ SRCS+=$(ARCHSRCS)
TARGETS
+=
$(LIBDIR)
/liblog.la
$(ARCHOBJS)
:
CFLAGS += -Wall -O3 -fPIC
ifdef
BUILD_TCP
$(LIBDIR)/liblog.la
:
libutils.la
$(LIBDIR)/
liblog.la_LDFLAGS
+=
-lutils
endif
$(LIBDIR)/liblog.la
:
$(ARCHOBJS)
$(LIB_LINK)
...
...
common/log/log.h
View file @
87a30f7f
...
...
@@ -22,6 +22,8 @@
#include <stdlib.h>
#include <stdint.h>
#include <time.h>
#include <inttypes.h>
enum
log_type
{
LOG_T_ERROR
,
...
...
common/log/log_std.c
0 → 100644
View file @
87a30f7f
/*
Copyright Jeroen Vreeken (jeroen@vreeken.net), 2008, 2013, 2014, 2015
Copyright Stichting C.A. Muller Radioastronomiestation, 2008, 2013
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <stdarg.h>
#include <log/log.h>
static
enum
log_type
log_level_console
;
static
enum
log_type
log_level_remote
;
static
uint64_t
def_timestamp
(
void
)
{
static
uint64_t
ctr
=
0
;
return
ctr
++
;
}
uint64_t
(
*
log_timestamp
)(
void
)
=
def_timestamp
;
static
char
*
logtype
(
enum
log_type
type
)
{
switch
(
type
)
{
case
LOG_T_ERROR
:
return
" ERROR: "
;
case
LOG_T_WARNING
:
return
"WARNING: "
;
case
LOG_T_INFO
:
return
" INFO: "
;
case
LOG_T_DEBUG
:
return
" DEBUG: "
;
default:
return
"UNKNOWN: "
;
}
}
void
log_send
(
enum
log_type
type
,
char
*
fmt
,
...)
{
va_list
ap
;
if
(
log_level_console
<
type
&&
log_level_remote
<
type
)
return
;
printf
(
"%s"
,
logtype
(
type
));
va_start
(
ap
,
fmt
);
vprintf
(
fmt
,
ap
);
va_end
(
ap
);
printf
(
"
\n
"
);
}
int
log_server_start
(
int
port
,
enum
log_type
console_level
,
enum
log_type
remote_level
)
{
log_level_console
=
console_level
;
log_level_remote
=
remote_level
;
return
0
;
}
void
log_server_flush
(
void
)
{
}
void
log_level_set
(
enum
log_type
console_level
,
enum
log_type
remote_level
)
{
log_level_console
=
console_level
;
log_level_remote
=
remote_level
;
}
int
log_time_source_set
(
uint64_t
(
*
timestamp
)(
void
),
void
(
*
stamp2spec
)(
struct
timespec
*
,
uint64_t
))
{
log_timestamp
=
timestamp
;
return
0
;
}
common/trace/build.mk
View file @
87a30f7f
ifdef
BUILD_TCP
TRACE_TARGETS
+=
$(LIBDIR)
/libtrace.la
TRACE_TARGETS
+=
$(DIR)
/trace_dump
TRACE_TARGETS
+=
$(DIR)
/trace_dumpdiff
...
...
@@ -79,3 +81,5 @@ CLEAN += $(TRACE_LIST_OBJS)
CLEAN
+=
$(TRACE_VIEW_OBJS)
CLEAN
+=
$(TRACE2FILE_OBJS)
CLEAN
+=
$(TRACE2PORT_OBJS)
endif
common/utils/build.mk
View file @
87a30f7f
ifdef
BUILD_TCP
TARGETS
+=
$(LIBDIR)
/libutils.la
TARGETS
+=
$(DIR)
/weather_test
...
...
@@ -6,8 +7,8 @@ TARGETS += $(DIR)/weather_test
WEATHER_SRCS
:=
$(DIR)
/weather_test.c
$(DIR)
/weather.c
$(DIR)
/tcp_connect.c
WEATHER_OBJS
:=
$(WEATHER_SRCS:.c=.o)
$(DIR)/
weather_test_CFLAGS
+=
-pthread
$(DIR)/
weather_test_LDFLAGS
+=
-pthread
$(DIR)/
weather_test_CFLAGS
+=
$(DIR)/
weather_test_LDFLAGS
+=
-
l
pthread
$(DIR)/weather_test
:
$(WEATHER_OBJS)
ARCHSRCS
:=
$(DIR)
/tcp_connect.c
\
...
...
@@ -22,8 +23,8 @@ ARCHSRCS := $(DIR)/tcp_connect.c \
ARCHOBJS
:=
$(ARCHSRCS:.c=.lo)
LU_CFLAGS
:=
-Wall
-O3
-fPIC
-pthread
LU_LDFLAGS
:=
-lrt
-lm
LU_CFLAGS
:=
-Wall
-O3
-fPIC
LU_LDFLAGS
:=
-lrt
-lm
-lpthread
LU_CFLAGS
+=
`
pkg-config
--cflags
glib-2.0
`
LU_LDFLAGS
+=
`
pkg-config
--libs
glib-2.0
`
...
...
@@ -39,3 +40,6 @@ CLEAN += $(DIR)/weather_test
CLEAN
+=
$(WEATHER_OBJS)
$(ARCHOBJS)
$(LIBDIR)
/libutils.a
SRCS
+=
$(ARCHSRCS)
$(WEATHER_SRCS)
endif
configure.ac
View file @
87a30f7f
...
...
@@ -31,6 +31,10 @@ AC_ARG_ENABLE([test],
[:],
[enable_test=yes])
AC_ARG_ENABLE([embedded],
[AS_HELP_STRING([--enable-embedded], [Enable/Disable embedde controller @<:@no@:>@])],
[enable_embedded=yes],
[:])
#######################################################################
#
...
...
@@ -105,13 +109,37 @@ AS_CASE(["$with_libnova"],
[AC_CHECK_HEADERS([libnova/libnova.h])]
)
#######################################################################
#
# Support for linux joystick
AC_CHECK_HEADER(linux/joystick.h,[HAVE_HEADER_LINUX_JOYSTICK=1],[HAVE_HEADER_LINUX_JOYSTICK=0])
#######################################################################
#
# Real OS or embedded?
AC_CHECK_LIB(pthread,pthread_attr_init,[HAVE_LIBPTHREAD=1],[HAVE_LIBPTHREAD=0])
AC_CHECK_LIB(c,realpath,[HAVE_FILEIO=1],[HAVE_FILEIO=0])
AC_CHECK_HEADER(sys/socket.h,[HAVE_TCP=1],[HAVE_TCP=0])
AC_CHECK_HEADER(semaphore.h,[HAVE_SEMAPHORE=1],[HAVE_SEMAPHORE=0])
AC_CHECK_HEADER(dlfcn.h,[HAVE_DYNAMICLINKING=1],[HAVE_DYNAMICLINKING=0])
AC_CHECK_HEADER(sysclk.h,[HAVE_SYSTICK=1],[HAVE_SYSTICK=0])
AC_CHECK_HEADER(samx70.h,[HAVE_ATSAMX70=1],[HAVE_ATSAMX70=0])
#######################################################################
#
# Some conclusions based on test results
#
AS_IF([test "$enable_console" = "yes"],
AS_IF([test "$enable_console" = "yes"
&& test "$HAVE_TCP" = "1"
],
[AC_SUBST(BUILD_CONSOLE,["yes"])],
[AC_SUBST(BUILD_CONSOLE,[""])])
...
...
@@ -148,6 +176,66 @@ AS_IF([test "$enable_test" = "yes"],
[AC_SUBST(BUILD_TEST,["yes"])],
[AC_SUBST(BUILD_TEST,[""])])
AS_IF([test "$HAVE_LIBPTHREAD" = "1"],
[AC_SUBST(CFLAGS_PTHREAD,["-DHAVE_PTHREAD"])],
[AC_SUBST(CFLAGS_PTHREAD,[""])])
AS_IF([test "$HAVE_LIBPTHREAD" = "1"],
[AC_SUBST(BUILD_PTHREAD,["yes"])],
[AC_SUBST(BUILD_PTHREAD,[""])])
AS_IF([test "$HAVE_TCP" = "1"],
[AC_SUBST(CFLAGS_TCP,["-DHAVE_TCP"])],
[AC_SUBST(CFLAGS_TCP,[""])])
AS_IF([test "$HAVE_TCP" = "1"],
[AC_SUBST(BUILD_TCP,["yes"])],
[AC_SUBST(BUILD_TCP,[""])])
AS_IF([test "$HAVE_SEMAPHORE" = "1"],
[AC_SUBST(CFLAGS_SEMAPHORE,["-DHAVE_SEMAPHORE"])],
[AC_SUBST(CFLAGS_SEMAPHORE,[""])])
AS_IF([test "$HAVE_HEADER_LINUX_JOYSTICK" = "1"],
[AC_SUBST(BUILD_LINUX_JOYSTICK,["yes"])],
[AC_SUBST(BUILD_LINUX_JOYSTICK,[""])])
AS_IF([test "$HAVE_DYNAMICLINKING" = "1"],
[AC_SUBST(BUILD_DYNAMICLINKING,["yes"])],
[AC_SUBST(BUILD_DYNAMICLINKING,[""])])
AS_IF([test "$HAVE_FILEIO" = "1"],
[AC_SUBST(BUILD_FILEIO,["yes"])],
[AC_SUBST(BUILD_FILEIO,[""])])
AS_IF([test "$HAVE_FILEIO" = "1"],
[AC_SUBST(CFLAGS_FILEIO,["-DHAVE_FILEIO"])],
[AC_SUBST(CFLAGS_FILEIO,[""])])
AS_IF([test "$enable_embedded" = "yes"],
[AC_SUBST(BUILD_EMBEDDED,["yes"])],
[AC_SUBST(BUILD_EMBEDDED,[""])])
AS_IF([test "$enable_embedded" = "yes"],
[AC_SUBST(CFLAGS_EMBEDDED,["-DHAVE_EMBEDDED"])],
[AC_SUBST(CFLAGS_EMBEDDED,[""])])
AS_IF([test "$HAVE_SYSTICK" = "1"],
[AC_SUBST(BUILD_SYSTICK,["yes"])],
[AC_SUBST(BUILD_SYSTICK,[""])])
AS_IF([test "$HAVE_SYSTICK" = "1"],
[AC_SUBST(CFLAGS_SYSTICK,["-DHAVE_SYSTICK -D_POSIX_TIMERS"])],
[AC_SUBST(CFLAGS_SYSTICK,[""])])
AS_IF([test "$HAVE_ATSAMX70" = "1"],
[AC_SUBST(BUILD_ATSAMX70,["yes"])],
[AC_SUBST(BUILD_ATSAMX70,[""])])
AS_IF([test "$HAVE_ATSAMX70" = "1"],
[AC_SUBST(CFLAGS_ATSAMX70,["-DHAVE_ATSAMX70"])],
[AC_SUBST(CFLAGS_ATSAMX70,[""])])
#######################################################################
#
# Output
...
...
@@ -192,10 +280,26 @@ AS_IF([test "$BUILD_VESP" != ""],
AC_MSG_NOTICE([ vesp: yes]),
AC_MSG_NOTICE([ vesp: no]))
AS_IF([test "$BUILD_LINUX_JOYSTICK" != ""],
AC_MSG_NOTICE([ linux joystick: yes]),
AC_MSG_NOTICE([ linux joystick: no]))
AS_IF([test "$BUILD_AM335X" != ""],
AC_MSG_NOTICE([ am335x: yes]),
AC_MSG_NOTICE([ am335x: no]))
AS_IF([test "$BUILD_ATSAMX70" != ""],
AC_MSG_NOTICE([ atsamx70: yes]),
AC_MSG_NOTICE([ atsamx70: no]))
AS_IF([test "$BUILD_SYSTICK" != ""],
AC_MSG_NOTICE([ systick: yes]),
AC_MSG_NOTICE([ systick: no]))
AS_IF([test "$BUILD_EMBEDDED" != ""],
AC_MSG_NOTICE([ embedded: yes]),
AC_MSG_NOTICE([ embedded: no]))
AS_IF([test "$BUILD_TEST" != ""],
AC_MSG_NOTICE([ test: yes]),
AC_MSG_NOTICE([ test: no]))
console/console/console_httpd.c
View file @
87a30f7f
...
...
@@ -692,7 +692,9 @@ static int callback_http(struct lws *wsi,
switch
(
reason
)
{
case
LWS_CALLBACK_RECEIVE
:
{
char
*
rcv
=
in
;
char
rcv
[
len
+
1
];
memcpy
(
rcv
,
in
,
len
);
rcv
[
len
]
=
0
;
struct
ws_client
*
ws_client
;
printf
(
"lws receive: %s
\n
"
,
rcv
);
...
...
@@ -836,7 +838,11 @@ static int callback_http(struct lws *wsi,
free
(
resource_path
);
break
;
}
case
LWS_CALLBACK_HTTP_FILE_COMPLETION
:
/* kill the connection after we sent one file */
r
=
-
1
;
break
;
case
LWS_CALLBACK_ADD_POLL_FD
:
{
struct
lws_pollargs
*
args
=
in
;
...
...
console/console/console_j2000tracker.c
View file @
87a30f7f
...
...
@@ -136,7 +136,11 @@ void a2coord(char *ara, char *adec, struct ln_hms *ra, struct ln_dms *dec)
i
=
1
;
}
else
{
dec
->
neg
=
0
;
i
=
0
;
if
(
strlen
(
adec
)
&&
adec
[
0
]
==
'+'
)
{
i
=
1
;
}
else
{
i
=
0
;
}
}
dec
->
degrees
=
0
;
dec
->
minutes
=
0
;
...
...
console/console/start_console.sh
View file @
87a30f7f
...
...
@@ -24,6 +24,7 @@ screen -S console -X screen -t console_sattracker console_sattracker
screen
-S
console
-X
screen
-t
console_weather console_weather
screen
-S
console
-X
screen
-t
console_httpd console_httpd
screen
-S
console
-X
screen
-t
console_trace2port ../../common/trace/trace2port
-d
localhost Azimuth_Position Elevation_Position azimuth_setpoint_error.difference elevation_setpoint_error.difference Azimuth_Speed Elevation_Speed_Right Focusbox_Position
screen
-S
console
-X
screen
-t
trace_az_pos ../../common/trace/trace2file localhost 10000 Azimuth_Position /var/log/dt/traces/Azimuth_Position.trace 15000 100000 5
screen
-S
console
-X
screen
-t
trace_az_pos ../../common/trace/trace2file localhost 10000 Elevation_Position /var/log/dt/traces/Elevation_Position.trace 15000 100000 5
...
...
console/htdocs/index.html
View file @
87a30f7f
...
...
@@ -243,6 +243,7 @@ status_dt.button_disable.onclick = function() {
azimuth_enable_command
.
send
(
0
);
elevation_enable_command
.
send
(
0
);
elevation_recover_command
.
send
(
0
);
status_dt
.
fb_enable_command
.
send
(
0
);
}
...
...
console/js/dt_status.js
View file @
87a30f7f
...
...
@@ -55,8 +55,8 @@ function dt_status(element_name) {
this
.
val_az_safe
=
new
dt_ui_value_trace
(
element_name
+
"
_val_az_safe
"
,
"
Azimuth_Safe
"
,
0
);
this
.
val_el_safe
=
new
dt_ui_value_trace
(
element_name
+
"
_val_el_safe
"
,
"
Elevation_Safe
"
,
0
);
this
.
button_fb_p
=
new
dt_ui_
button
(
element_name
+
"
_fb_
p
"
);
this
.
button_fb_
m
=
new
dt_ui_button
(
element_name
+
"
_fb_
m
"
);
this
.
text_fb_setpoint
=
new
dt_ui_
text
(
element_name
+
"
_fb_
setpoint
"
);
this
.
button_fb_
e
=
new
dt_ui_button
(
element_name
+
"
_fb_
e
"
);
this
.
button_az_enable
=
new
dt_ui_button
(
element_name
+
"
_az_enable
"
);
this
.
button_el_enable
=
new
dt_ui_button
(
element_name
+
"
_el_enable
"
);
...
...
@@ -72,7 +72,7 @@ function dt_status(element_name) {
this
.
val_az_en
,
this
.
val_el_en
,
this
.
val_az_safe
,
this
.
val_el_safe
,
this
.
az_view
,
this
.
el_view
,
this
.
button_fb_p
,
this
.
button_fb_
m
,
this
.
text_fb_setpoint
,
this
.
button_fb_
e
,
this
.
button_az_enable
,
this
.
button_el_enable
,
this
.
button_disable
,
this
.
val_az_sp
,
this
.
val_el_sp
,
this
.
val_az_north
]);
...
...
@@ -94,10 +94,10 @@ function dt_status(element_name) {
this
.
val_az_sp
.
suffix_set
(
"
°
"
);
this
.
val_el_sp
.
suffix_set
(
"
°
"
);
this
.
button_fb_p
.
text
_set
(
"
+
"
);
this
.
button_fb_m
.
text
_set
(
"
-
"
);
this
.
button_fb_
p
.
color
_set
(
"
black
"
);
this
.
button_fb_
m
.
color_set
(
"
black
"
);
this
.
text_fb_setpoint
.
length
_set
(
3
);
this
.
text_fb_setpoint
.
width
_set
(
100
);
this
.
button_fb_
e
.
text
_set
(
"
set
"
);
this
.
button_fb_
e
.
color_set
(
"
black
"
);
this
.
button_az_enable
.
text_set
(
"
Azimuth Enable
"
);
this
.
button_el_enable
.
text_set
(
"
Elevation Enable
"
);
this
.
button_disable
.
text_set
(
"
Disable
"
);
...
...
@@ -115,8 +115,6 @@ function dt_status(element_name) {
this
.
window
.
resize_equal
([
this
.
val_az_sp
,
this
.
val_el_sp
,
this
.
val_az_north
]);
this
.
window
.
resize_equal
([
this
.
button_fb_p
,
this
.
button_fb_m
]);
this
.
window
.
resize_equal
([
this
.
button_az_enable
,
this
.
button_el_enable
,
this
.
button_disable
]);
...
...
@@ -128,7 +126,7 @@ function dt_status(element_name) {
this
.
window
.
align_horizontal
([
this
.
lbl_el
,
this
.
val_el_pos
,
this
.
val_el_en
,
this
.
val_el_safe
],
5
);
this
.
window
.
align_horizontal
([
this
.
lbl_fb
,
this
.
val_fb_pos
,
this
.
button_fb_m
,
this
.
button_fb_
p
],
5
);
this
.
lbl_fb
,
this
.
val_fb_pos
,
this
.
text_fb_setpoint
,
this
.
button_fb_
e
],
5
);
this
.
window
.
align_horizontal
([
this
.
lbl_t
,
this
.
val_t
],
5
);
...
...
@@ -286,21 +284,13 @@ function dt_status(element_name) {
this
.
button_disable
.
onclick
=
function
()
{
}
this
.
fb_
plus
_command
=
new
controller_command
(
"
focusbox_
plus
"
,
"
bool
"
);
this
.
fb_
min
_command
=
new
controller_command
(
"
focusbox_
min
"
,
"
bool
"
);
this
.
fb_
setpoint
_command
=
new
controller_command
(
"
focusbox_
setpoint
"
,
"
float
"
);
this
.
fb_
enable
_command
=
new
controller_command
(
"
focusbox_
enable
"
,
"
bool
"
);
this
.
button_fb_p
.
onmousedown
=
function
()
{
dt_status_this
.
fb_plus_command
.
send
(
1
);
}
this
.
button_fb_p
.
onmouseup
=
function
()
{
dt_status_this
.
fb_plus_command
.
send
(
0
);
}
this
.
button_fb_m
.
onmousedown
=
function
()
{
dt_status_this
.
fb_min_command
.
send
(
1
);