Commit 713ec0c1 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Install the MSC tracing-related tools

parent 1d30b24a
...@@ -10,6 +10,12 @@ make || exit 1 ...@@ -10,6 +10,12 @@ make || exit 1
cp ./MSC-Antlr3/bin/msc2py.exe ${PREFIX}/share/asn1scc/ || exit 1 cp ./MSC-Antlr3/bin/msc2py.exe ${PREFIX}/share/asn1scc/ || exit 1
cp ./MSC-Antlr3/bin/taste-extract-asn-from-design.exe ${PREFIX}/share/asn1scc/ || exit 1 cp ./MSC-Antlr3/bin/taste-extract-asn-from-design.exe ${PREFIX}/share/asn1scc/ || exit 1
# Install the MSC tracing-related tools (tracerd.py, etc)
cd $DIR/../misc/AutoGUI || exit 1
TARGET=${PREFIX}/share/AutoGUI/
mkdir -p ${TARGET}
cp -u * ${TARGET}
# Update the path # Update the path
PATH_CMD='export PATH=$PATH:$HOME/.local/bin' PATH_CMD='export PATH=$PATH:$HOME/.local/bin'
UpdatePATH UpdatePATH
# The directories containing the source files, separated by ':'
VPATH=.:../../auto-src
# To make "debug" the default configuration if invoked with just "make":
#
ifeq ($(CFG),)
CFG=debug
endif
# The source files: regardless of where they reside in the source tree,
# VPATH will locate them...
Group0_SRC = project2app.cpp telecmds.cpp
Group1_SRC = DataView.c asn1crt.c real.c queue_manager.c timeInMS.c debug_messages.c acn.c xer.c ber.c PrintTypes.c PrintTypesAsASN1.c
# Build a Dependency list and an Object list, by replacing the .cpp
# extension to .d for dependency files, and .o for object files.
Group0_DEP = $(patsubst %.cpp, deps/Group0_%.d, ${Group0_SRC})
Group1_DEP = $(patsubst %.c, deps/Group1_%.d, ${Group1_SRC})
Group0_OBJ = $(patsubst %.cpp, objs.$(CFG)/Group0_%.o, ${Group0_SRC})
Group1_OBJ = $(patsubst %.c, objs.$(CFG)/Group1_%.o, ${Group1_SRC})
# Your final binary
TARGET=applicationName
# What compiler to use for generating dependencies: it will be invoked with -MM
CCDEP = g++
CXXDEP = g++
CPPFLAGS = $(shell wx-config --cppflags || exit 1)
# What include flags to pass to the compiler
INCLUDEFLAGS= -I. -I../../auto-src ${CPPFLAGS}
# Separate compile options per configuration
ifeq ($(CFG),debug)
CXXFLAGS += -g -Wall ${INCLUDEFLAGS} -DwxUSE_UNICODE
else
CXXFLAGS += -O2 -Wall ${INCLUDEFLAGS} $(shell wx-config --cxxflags) -DwxUSE_UNICODE
endif
# A common link flag for all configurations
# hardcoded "-m32" to crash 64bit distros, since the native encodings won't verifiably
# work between 32bit linux binaries and 64bit GUIs.
LDFLAGS = $(shell wx-config --libs) -lrt
all: inform ConstraintErrors.inc bin.$(CFG)/${TARGET}
ConstraintErrors.inc: DataView.h
perl ./buildErrorCheck.pl DataView.h
inform:
ifneq ($(CFG),release)
ifneq ($(CFG),debug)
@echo "Invalid configuration "$(CFG)" specified."
@echo "You must specify a configuration when running make, e.g."
@echo "make CFG=debug"
@echo
@echo "Possible choices for configuration are 'release' and 'debug'"
@exit 1
endif
endif
@echo "Configuration "$(CFG)
@echo "------------------------"
bin.$(CFG)/${TARGET}: ${Group0_OBJ} ${Group1_OBJ} | inform
@mkdir -p bin.$(CFG)
$(CXX) -g -o $@ $^ ${LDFLAGS}
objs.$(CFG)/Group0_%.o: %.cpp
@mkdir -p objs.$(CFG)
$(CXX) -c $(CXXFLAGS) -o $@ $<
objs.$(CFG)/Group1_%.o: %.c
@mkdir -p objs.$(CFG)
$(CC) -c $(subst -Wall,,$(CXXFLAGS)) -o $@ $<
deps/Group0_%.d: %.cpp ConstraintErrors.inc
@mkdir -p deps
@echo Generating dependencies for $<
@set -e ; $(CXXDEP) -MM $(INCLUDEFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,objs.$(CFG)\/Group0_\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
deps/Group1_%.d: %.c ConstraintErrors.inc
@mkdir -p deps
@echo Generating dependencies for $<
@set -e ; $(CCDEP) -MM $(INCLUDEFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,objs.$(CFG)\/Group0_\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
clean:
@rm -rf deps objs.debug objs.release bin.debug bin.release
# Unless "make clean" is called, include the dependency files
# which are auto-generated. Don't fail if they are missing
# (-include), since they will be missing in the first invocation!
ifneq ($(MAKECMDGOALS),clean)
-include ${Group0_DEP} ${Group1_DEP}
endif
<?xml version="1.0"?>
<glade-interface>
<!-- interface-requires gtk+ 2.16 -->
<!-- interface-naming-policy project-wide -->
<widget class="GtkWindow" id="MainWindow">
<property name="visible">True</property>
<property name="title" translatable="yes">Tracing MSCs</property>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<widget class="GtkMenuBar" id="menubar">
<property name="visible">True</property>
<child>
<widget class="GtkMenuItem" id="Fil">
<property name="visible">True</property>
<property name="label" translatable="yes">_File</property>
<property name="use_underline">True</property>
<child>
<widget class="GtkMenu" id="ExitItem">
<property name="visible">True</property>
<child>
<widget class="GtkImageMenuItem" id="Exit">
<property name="label">gtk-quit</property>
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<signal name="activate" handler="on_Exit_activate"/>
</widget>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="Help">
<property name="visible">True</property>
<property name="label" translatable="yes">_Help</property>
<property name="use_underline">True</property>
<child>
<widget class="GtkMenu" id="AboutItem">
<property name="visible">True</property>
<child>
<widget class="GtkImageMenuItem" id="About">
<property name="label">gtk-about</property>
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<signal name="activate" handler="on_About_activate"/>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="frameGenerateMSC">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<widget class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
<widget class="GtkVBox" id="vbox3">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<widget class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<child>
<widget class="GtkCheckButton" id="checkbuttonMSC">
<property name="label" translatable="yes">Generate MSC</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="yalign">0.75</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_checkbuttonMSC_toggled"/>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="buttonChooseFile">
<property name="label" translatable="yes">Choose MSC Filename...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_buttonChooseFile_clicked" after="yes"/>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="fileSaveAsName">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="text" translatable="yes">/var/tmp/exampleRun.msc</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes">If you want an MSC scenario to be generated from the exchanged messages,
enable the checkbox above, and choose a filename.</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="padding">10</property>
<property name="position">2</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="labelGenerateMSC">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Store messages&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="frameMSCTracer">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<widget class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
<widget class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<widget class="GtkCheckButton" id="checkbuttonTracer">
<property name="label" translatable="yes">Connect to MSC Tracer</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_checkbuttonTracer_toggled"/>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="ipAddress">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="text" translatable="yes">192.168.0.</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="yalign">1</property>
<property name="label" translatable="yes">Port of MSC Tracer</property>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="port">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="width_chars">10</property>
<property name="text" translatable="yes">9999</property>
</widget>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Enter the IP address and port where the PragmaDev MSC Tracer
is currently running.</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="padding">10</property>
<property name="position">4</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;MSC Tracer&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="buttonRun">
<property name="label" translatable="yes">Run</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_buttonRun_clicked" after="yes"/>
</widget>
<packing>
<property name="position">3</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>
#!/usr/bin/perl -w
use strict;
open OUT, ">ConstraintErrors.inc";
open DATA, "grep 'efine ERR_' ../../auto-src/".$ARGV[0]."|";
my $first = 1;
while(<DATA>) {
chomp;
my $line = $_;
if (m/^#define\s+(ERR_\w+)\s+(\d+)/) {
my $errCode = $2;
if ($first) {
$first = 0;
print OUT "if (ErrCode == $errCode) {\n";
} else {
print OUT "} else if (ErrCode == $errCode) {\n";
}
$line =~ s#^\#define\s+ERR_asn1Scc(\w+)\s+\d+\s+/\*(.*?)\*/#$1 $2#;
$line =~ s# *##g;
print OUT " msg += string(\"$line\");\n";
}
}
close DATA;
if (!$first) {
print OUT "}\n";
}
close OUT;
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include "debug_messages.h"
// debug_printf is used for logging and error reporting
void debug_printf(DebugLevel level, const char *fmt, ...)
{
static int bFirstTime = 1;
static int bPrintsEnabled = 0;
static char message[4096];
if (bFirstTime) {
bFirstTime = 0;
bPrintsEnabled = (NULL != getenv("ASSERT_DEBUG"))?1:0;
}
if (level == LVL_ERROR)
printf("%s\n", "***** ERROR just happened: *****");
if (((level == LVL_INFO || level == LVL_WARN) && bPrintsEnabled) ||
level == LVL_ERROR ||
level == LVL_PANIC)
{
va_list ap;
va_start(ap, fmt);
vsnprintf(message, sizeof message, fmt, ap);
printf("%s", message);
va_end(ap);
}
if (level == LVL_PANIC)
exit(1);
}
#ifndef __DEBUG_MESSAGES_H__
#define __DEBUG_MESSAGES_H__
#ifdef __cplusplus
extern "C" {
#endif
// debug_printf is used for logging and error reporting
//
typedef enum tagDebugLevel {
LVL_INFO,
LVL_WARN,
LVL_ERROR,
LVL_PANIC
} DebugLevel;
void debug_printf(DebugLevel level, const char *fmt, ...);
#ifdef __cplusplus
}
#endif
#endif
/////////////////////////////////////////////////////////////////////////////
// Name: project2app.cpp
// Purpose:
// Author: GUI Designer
// Modified by:
// Created: 08/07/2008 14:39:30
// RCS-ID:
// Copyright:
// Licence:
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes
////@end includes
#include "project2app.h"
#include "telecmds.h"
////@begin XPM images
////@end XPM images
/*!
* Application instance implementation
*/
////@begin implement app
IMPLEMENT_APP( Project2App )
////@end implement app
/*!
* Project2App type definition
*/
IMPLEMENT_CLASS( Project2App, wxApp )
/*!
* Project2App event table definition
*/
BEGIN_EVENT_TABLE( Project2App, wxApp )
////@begin Project2App event table entries
////@end Project2App event table entries
END_EVENT_TABLE()
/*!
* Constructor for Project2App
*/
Project2App::Project2App()
{
Init();
}
/*!
* Member initialisation
*/
void Project2App::Init()
{
////@begin Project2App member initialisation
////@end Project2App member initialisation
}
/*!
* Initialisation for Project2App
*/
bool Project2App::OnInit()
{
////@begin Project2App initialisation
// Remove the comment markers above and below this block
// to make permanent changes to the code.
#if wxUSE_XPM
wxImage::AddHandler(new wxXPMHandler);
#endif
#if wxUSE_LIBPNG
wxImage::AddHandler(new wxPNGHandler);
#endif
#if wxUSE_LIBJPEG
wxImage::AddHandler(new wxJPEGHandler);
#endif
#if wxUSE_GIF
wxImage::AddHandler(new wxGIFHandler);
#endif
////@end Project2App initialisation
TeleCmds *frame = new TeleCmds(NULL);
frame->Show(TRUE);
SetTopWindow(frame);
return true;
}
/*!
* Cleanup for Project2App
*/
int Project2App::OnExit()
{
////@begin Project2App cleanup
return wxApp::OnExit();
////@end Project2App cleanup
}
/////////////////////////////////////////////////////////////////////////////
// Name: project2app.h
// Purpose:
// Author: GUI Designer
// Modified by:
// Created: 08/07/2008 14:39:30
// RCS-ID:
// Copyright:
// Licence:
/////////////////////////////////////////////////////////////////////////////
#ifndef _PROJECT2APP_H_
#define _PROJECT2APP_H_
/*!
* Includes
*/
////@begin includes
#include "wx/image.h"
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
////@end control identifiers
/*!
* Project2App class declaration
*/
class Project2App: public wxApp
{
DECLARE_CLASS( Project2App )
DECLARE_EVENT_TABLE()
public:
/// Constructor
Project2App();
void Init();
/// Initialises the application
virtual bool OnInit();
/// Called on exit
virtual int OnExit();
////@begin Project2App event handler declarations
////@end Project2App event handler declarations
////@begin Project2App member function declarations
////@end Project2App member function declarations