Commit 985a423b authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
parents 08c3228c 6ea69ccc
Subproject commit 0b280bd648268550163e53b1f33d2fb84223f093
Subproject commit 8cb1534112efda7a89eb0c26daad87b2278ab47e
Subproject commit d0211e91cb0386af115144b611617570b6d53f4b
Subproject commit a16bdca401eee8a718f377a8f67095046edf78eb
Subproject commit 327f5c86297b251223dcd30a6b4ea9891aed8095
Subproject commit 0eb073ad8906e9513264bb6a746e96d2a802f551
This diff is collapsed.
......@@ -30,13 +30,21 @@ else
fi
PGPASS="$HOME/.pgpass"
LINE='127.0.0.1:5432:*:postgres:tastevm'
echo "[-] Checking if 'taste' DB user credentials are stored in \$HOME/.pgpass..."
echo "[-] Checking if 'postgres' DB user credentials are stored in \$HOME/.pgpass..."
if ! grep "${LINE/*/\\*}" "$PGPASS" >/dev/null 2>&1 ; then
echo "[-] Adding the 'taste' DB user credentials to \$HOME/.pgpass ..."
echo "[-] Adding the 'postgres' DB user credentials to \$HOME/.pgpass ..."
echo "$LINE" >> "$PGPASS"
LINE='localhost:5432:*:postgres:tastevm'
echo "$LINE" >> "$PGPASS"
else
echo '[-] Already stored.'
fi
echo "[-] Checking if 'taste' DB user credentials are stored in \$HOME/.pgpass..."
LINE='localhost:5432:*:taste:tastedb'
if ! grep -F "${LINE}" "$PGPASS" >/dev/null 2>&1 ; then
echo "[-] Adding the 'taste' DB user credentials to \$HOME/.pgpass ..."
echo "$LINE" >> "$PGPASS"
else
echo '[-] Already stored.'
fi
chmod 600 "${PGPASS}"
......@@ -8,6 +8,30 @@ git submodule update air/pos/rtems5
cd air || exit 1
# As per request of Laura Gouveia (mail discussions at 22/10/2019):
#
# AIR doesn't check during 'make' for a changed target board; it depends on
# a 'make clean' done first, if the chosen configuration changes.
#
# To make the final delivery use LEON4-specific functionality,
# it is therefore not sufficient to choose a different number
# in the second question (see below) and just commit an updated config;
# we need to somehow trigger this 'make clean' - BUT not always!
# We only want to do this once, otherwise 'Update-TASTE.sh' will take
# a lot longer, because of AIR being rebuilt from scratch every time.
#
# So we need this hack:
# Is there a previous AIR build?
if [ -f .air_config ] ; then
# Yes, there is. Did the previous build target leon4?
OLD_TARGET=$(python3 -c 'import pickle; print(pickle.load(open(".air_config", "rb"))[1])')
if [ "$OLD_TARGET" != "leon4" ] ; then
# It didn't! Cleanup the universe, to trigger a rebuild from scratch
make clean
fi
fi
# Pass the following configuration to AIR's "configure" script:
#
# Select the target architecture:
......
......@@ -29,6 +29,11 @@ cp peek-poke/PeekPoke.glade ${PREFIX}/share/peekpoke/PeekPoke.glade || exit 1
# Helper scripts
cp -a helper-scripts/* ${PREFIX}/bin/
# GUI User-defined widgets
TARGET=${PREFIX}/share/AutoGUI
mkdir -p ${TARGET}
cp -a AutoGUI/UserWidgets.py ${TARGET}
# Copy AADL Libraries to Ocarina and ellidiss folders
make -C aadl-library install
......
......@@ -11,7 +11,7 @@ fi
INFO="${COLORON}[INFO]${COLOROFF}"
echo $PATH | sed 's,:,\n,g' | sort -u > ${TMP}/oldPaths
bash -c '. ~/.bashrc.taste ; echo $PATH' | sed 's,:,\n,g' | sort -u > ${TMP}/newPaths
bash -c '. ~/.bashrc.taste > /dev/null ; echo $PATH' | sed 's,:,\n,g' | sort -u > ${TMP}/newPaths
diff -u ${TMP}/oldPaths ${TMP}/newPaths || {
echo -e "${INFO} A new PATH folder was introduced in your ~/.bashrc.taste"
......@@ -23,4 +23,18 @@ diff -u ${TMP}/oldPaths ${TMP}/newPaths || {
echo -e "${INFO} (if you are using the TASTE VM, this has already been done)."
}
RTEMS_TOOLS=$(grep opt/rtems ${TMP}/newPaths | wc -l)
if [ $RTEMS_TOOLS -ne 1 ] ; then
echo -e "${INFO} ===================== WARNING ======================="
echo -e "${INFO} Your new PATH (check ~/.bashrc.taste) contains more than one"
echo -e "${INFO} RTEMS toolchains:"
grep opt/rtems ${TMP}/newPaths | sed 's,^,\t,'
echo -e "${INFO} Depending on the settings of your builds (target, BSP, etc),"
echo -e "${INFO} this can cause hard to diagnose failures. We strongly advise"
echo -e "${INFO} that only one RTEMS toolchain exists in your PATH; edit"
echo -e "${INFO} your .bashrc.taste and comment out (prefix with '#')"
echo -e "${INFO} all but one of the lines that update the PATH to add them in."
echo -e "${INFO} ===================== WARNING ======================="
fi
rm -f ${TMP}/oldPaths ${TMP}/newPaths
......@@ -42,7 +42,7 @@ set NUM 0
while { 1 } {
expect {
"*sparc" { send -- "0\r" }
"*leon4" { send -- "0\r" }
"*leon4" { send -- "2\r" }
"*Select if FPU is:" { send -- "0\r" }
"*Select debug monitor:" { send -- "0\r" }
"*Install All RTOS ?" { send -- "0\r" }
......
Subproject commit 697af5ff5aecafe7ab8fb8ac1ec27723fa300b17
Subproject commit 89c5cf43e05431ce2136bf5f6d48c49492ef43f2
#!/usr/bin/python
# -*- coding: utf-8 -*-
''' Edit this module at will to create custom widgets that can send TC or
receive TM - and do anything you like with the data.
(c) 2016-2019 European Space Agency
'''
__author__ = "Maxime Perrotin, Thanassis Tsiodras"
__license__ = "LGPL"
__url__ = "https://taste.tools"
import sys
import os
import importlib
from PySide.QtCore import (QObject, Signal, Slot, Qt, QTimer)
import PySide.QtGui as QtGui
from asn1_value_editor import UserWidgetsCommon
# ** IMPORTANT **
# you must list here the classes you want to expose to the GUI:
__all__ = ['CustomTC_Widget', 'CustomTM_Widget']
class CustomTC_Widget(UserWidgetsCommon.TC):
''' Fill / mimick this class to create a custom TC widget '''
name = 'My TC Widget' # name on the GUI combo button
def __init__(self, asn1_typename, parent):
''' Initialise the widget '''
super(CustomTC_Widget, self).__init__(asn1_typename, parent)
self._asn1_typename = asn1_typename
# examples of widgets
#self.widget = QtGui.QListWidget()
#self.widget.itemClicked.connect(self.select)
#self.setWidget(self.widget)
#self.widget = QtGui.QPushButton(asn1_typename)
#self.widget.clicked.connect(self.clicked))
#self.setWidget(self.widget)
# parent is the ASN.1 value editor
self.parent = parent
self.setWindowTitle("My Window")
self.show()
@staticmethod
def applicable():
''' Return True to activate this widget '''
return True
@staticmethod
def editorIsApplicable(editor):
''' Return true if this particular editor is compatible with this
widget'''
return False
def select(self, item):
''' Called when user clicks on a line of the table '''
#self.parent.asn1Instance.SetData(native_asn1scc._ptr)
def clicked(self):
''' Called when user clicks on the button '''
# Get the ASN.1 value from the database (in native an1scc format)
# self.parent.getVariable(dest=self.parent.asn1Instance)
#self.parent.tmToEditor(emit_msc=False)
def onUpdateButtonClick(self, lineNb):
''' When user clicks on Update, the content of the selected TC will
be used to feed the main GUI TC editor '''
#self.update.emit(as_asn1) # use signal to send data to the GUI
def onSendButtonClick(self, lineNb):
''' When user clicks on Send, the selected TC will be sent to the
running application '''
#self.send.emit(as_asn1) # use signal to send data to the GUI
class CustomTM_Widget(UserWidgetsCommon.TM):
'''Save telemetries in the database'''
name = 'My Widget' # name for the combo button in the GUI
def __init__(self, parent=None):
''' Initialise the widget '''
super(CustomTM_Widget, self).__init__(parent)
self.hide()
@Slot()
def new_tm(self):
''' Slot called when a TM has been received in the editor '''
# Nothing to do, the update() function does nothing thread-related
# that would need to be done here
print('Recorded a new TM in the database')
def update(self, value):
''' Receive ASN.1 value '''
pass
@staticmethod
def applicable():
''' Return True to enable this widget '''
return True
@staticmethod
def editorIsApplicable(editor):
''' Return true if this particular editor is compatible with this
widget'''
return False
if __name__ == '__main__':
print 'This module can only be imported from the main TASTE guis'
sys.exit(-1)
......@@ -14,8 +14,9 @@ install:
"$(shell ocarina-config --resources)/AADLv2/ocarina_components.aadl"
@cp TASTE*.aadl $(shell ocarina-config --resources)/AADLv2
@cp taste*.aadl $(shell ocarina-config --resources)/AADLv2
@cp TASTE*.aadl ../../ellidiss-GUI/TASTE-linux/config
@cp TASTE*.aadl ../../ellidiss-GUI/TASTE-linux64/config
@# Stop overwriting ellidiss folder, it can break the git update:
@#@cp TASTE*.aadl ../../ellidiss-GUI/TASTE-linux/config
@#@cp TASTE*.aadl ../../ellidiss-GUI/TASTE-linux64/config
@#cp TASTE*.aadl ../../ellidiss-GUI/TASTE-v1-linux/config
@mkdir -p $(shell taste-config --prefix)/share/config_ellidiss
@cp TASTE*.aadl $(shell taste-config --prefix)/share/config_ellidiss # legacy
#!/bin/bash -e
# TASTE Dataview Editor
# TASTE Dataview Creator / Editor
# Asn1 module name based on the current folder name
ASN1_MODULE=$(pwd | sed 's,^.*/[0-9]*,,g' | tr '[a-z]' '[A-Z]' | tr '_' '-')-DATAVIEW
if [ -t 1 ] ; then
COLORON="\e[1m\e[32m"
......@@ -38,18 +41,22 @@ else
then
echo -e "${INFO} Creating a dummy ASN.1 file with a few type examples - feel free to add, edit, delete..."
fi
echo 'TASTE-Dataview DEFINITIONS ::=
echo "${ASN1_MODULE} DEFINITIONS ::=
BEGIN
IMPORTS T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean FROM TASTE-BasicTypes;
TASTE-Boolean ::= BOOLEAN
My-Integer ::= INTEGER (3 .. 1415)
-- ASN.1 Type definitions must start with an uppercase
-- Field names in records (SEQUENCE) must start with a lowercase
-- Underscores are not allowed: use dash (hyphen)
-- For integers do not assume that small ranges will be translated to small
-- types in C or Ada (expect unsigned or signed 64 bits types with subtypes
-- for the range in Ada)
-- Simple types:
-- TASTE-Boolean ::= BOOLEAN
-- MyInteger ::= INTEGER (0..255)
-- MyReal ::= REAL (0.0 .. 1000.0)
-- MyBool ::= BOOLEAN
......@@ -76,17 +83,19 @@ TASTE-Boolean ::= BOOLEAN
-- myVar MySeqOf ::= { hello, world }
END
' > DataView.asn
echo 'TASTE-Dataview DEFINITIONS ::= BEGIN
" > DataView.asn
echo "${ASN1_MODULE} DEFINITIONS ::= BEGIN
-- In this ACN model, you can specify custom binary encoding rules for
-- your data types. For example if you require a specific memory layout
-- for a record, or need to add padding fields, define endianness, etc.
-- you can do that with ACN. Refer to the ACN user manual for details.
-- you can do that with ACN. Refer to the TASTE wiki for documentation:
-- https://taste.tuxfamily.org/wiki/index.php?title=Main_Page
-- TASTE-Boolean []
-- Example of custom encoding:
-- My-Integer [encoding pos-int, endianness big, size 16]
END
' > DataView.acn
" > DataView.acn
fi
if [ -z $NONINTERACTIVE ]
......@@ -103,6 +112,6 @@ if [ -z $NONINTERACTIVE ]
then
echo -e "${INFO} Data View created"
echo -e "${INFO} Run taste-edit-data-view to edit"
echo -e "${INFO} taste-create-acn-model to specify binary encodings with ACN"
echo -e "${INFO} taste-create-project to create a new TASTE project"
echo -e "${INFO} taste-edit-acn-model to specify custom binary encodings with ACN"
echo -e "${INFO} taste to create a new TASTE project"
fi
......@@ -2,6 +2,30 @@
# Build an SQL database for the current TASTE project
# Check if the project works with kazoo. If so, skip all the rest
PRJ_FOLDER=${PWD}
if [[ -f Makefile && $(grep KAZOO Makefile) != "" ]]
then
mkdir -p work
WORK_FOLDER=work
else
WORK_FOLDER="${PRJ_FOLDER}"
fi
if [ -t 1 ] ; then
COLORON="\e[1m\e[32m"
REDCOLORON="\e[1m\e[31m"
COLOROFF="\e[0m"
else
COLORON=""
REDCOLORON=""
COLOROFF=""
fi
INFO="${COLORON}[INFO]${COLOROFF}"
ERROR="${REDCOLORON}[ERROR]${COLOROFF}"
# (1) First check if a project name is given as first argument, othewise take current directory
if [ "$1" ]
then
......@@ -10,20 +34,20 @@ else
DBNAME=$(pwd | sed 's,^.*/,,g' | tr '[A-Z]' '[a-z]' | tr '-' '_')
fi
echo Creating a TASTE SQL Database for project $DBNAME
echo -e "${INFO} Creating a TASTE SQL Database for project ${DBNAME}"
# (2) Create the DB output directory
cd "${WORK_FOLDER}"
mkdir -p sql_db
# (3) Retrieve ASN.1 file and create a single ASN.1 file with all types inside
INTERFACEVIEW=InterfaceView.aadl
INTERFACEVIEW="${PRJ_FOLDER}"/InterfaceView.aadl
AADL_PROPERTIES="$(taste-config --prefix)/share/config_ellidiss/TASTE_IV_Properties.aadl"
if [ ! -f InterfaceView.aadl ]
if [ ! -f "${INTERFACEVIEW}" ]
then
echo 'Error: InterfaceView.aadl not found'
echo -e "${ERROR} InterfaceView.aadl not found: ${INTERFACEVIEW}"
exit -1
fi
......@@ -39,7 +63,7 @@ asn2dataModel -toSqlalchemy $DBNAME.asn
make -f Makefile.python
# (5) Create postgresql database
echo -e "${INFO} If you are prompted for the taste password, enter 'tastedb'"
echo "drop database if exists $DBNAME; create database $DBNAME;" | psql -h localhost -U taste postgres
cat > initdb.py <<OEF
......@@ -55,3 +79,5 @@ cat > db.info << OEF2
postgresql+psycopg2://taste:tastedb@localhost/${DBNAME}
${DBNAME}
OEF2
cd "${PWD}"
......@@ -474,7 +474,7 @@ class PeekPoker:
def on_buttonMeterSelected_clicked(self, x, defsizepos="250x250+0+0"):
'''Calls on_buttonPlotSelected_clicked to re-use spawning funtionality'''
cmd = 'cat %s | speedometer.py '
cmd = 'cat %s | speedometer '
self.on_buttonPlotSelected_clicked(x, cmd, defsizepos)
def on_buttonUnplotSelected_clicked(self, *_):
......
Subproject commit ebfa0c9a08757e0650f3a258d21f5dc4f71a8789
Subproject commit b0f9ff45467bddc42728eaf9cbbad9878d1df1af
Subproject commit 0b0b82aefcb238819686042d66061cea952ab871
Subproject commit f1370b81a40e68e127a16f1fd679751b4eb8b1e9
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment