Commit a85bee46 authored by Mathieu Faverge's avatar Mathieu Faverge

Move plugins in root directory

parent 4705048c
......@@ -59,7 +59,7 @@ taudir="/usr"
tauincdir="$taudir/include"
taulibdir="$taudir/lib"
qtcolordir="./externals/qtcolorpicker/"
qtcolordir="../externals/qtcolorpicker/"
qtcolorincdir="$qtcolordir/src"
qtcolorsrcdir="$qtcolordir/src"
......@@ -340,7 +340,6 @@ EOF
distclean: cleanall
EOF
fi
cat >>"$makefile" <<EOF
\$(RM) Makefile
\$(RM) src/Makefile
......
../plugins
\ No newline at end of file
This diff is collapsed.
TEMPLATE = lib
CONFIG += plugin
TARGET = Distribution
DEPENDPATH += ..
INCLUDEPATH += ..
DESTDIR = ~/.vite
OBJECTS_DIR = ../../bin
SOURCES = Distribution.cpp \
trace/Trace.cpp \
trace/values/Date.cpp \
trace/values/Name.cpp \
trace/values/Double.cpp \
trace/values/String.cpp \
trace/ContainerType.cpp \
trace/EntityType.cpp \
trace/VariableType.cpp \
trace/EventType.cpp \
trace/LinkType.cpp \
trace/StateType.cpp \
trace/Container.cpp \
trace/Entity.cpp \
trace/EntityValue.cpp \
trace/Variable.cpp \
trace/State.cpp \
trace/StateChange.cpp \
trace/Link.cpp \
trace/Event.cpp \
statistics/Statistic.cpp \
common/Tools.cpp \
common/Info.cpp \
common/Message.cpp
#include <QTextEdit>
#include <QHBoxLayout>
#include <set>
#include <stack>
#include "plugin/Plugin.hpp"
#include "trace/EntityTypes.hpp"
#include "trace/EntityValue.hpp"
#include "trace/Entitys.hpp"
#include "trace/Container.hpp"
#include "trace/tree/Node.hpp"
#include "trace/tree/BinaryTree.hpp"
#include "plugins_dir/trace_infos.hpp"
using namespace std;
Trace_infos::Trace_infos() {
QHBoxLayout *horizontalLayout = new QHBoxLayout(this);
_text_info = new QTextEdit();
horizontalLayout->addWidget(_text_info);
}
Trace_infos::~Trace_infos() {
}
void Trace_infos::set_container_infos(QString &text) const {
/* count */
list <Container *> container_list;
_trace->get_all_containers(container_list);
text += "<h2>Containers:</h2>";
text += QString("count: %1").arg(container_list.size());
}
void Trace_infos::set_states_infos(QString &text) const {
list <Container *> container_list;
BinaryTree<StateChange> *states;
_trace->get_all_containers(container_list);
set<string> state_list;
for(list<Container *>::const_iterator it = container_list.begin();
it != container_list.end();
++ it) {
states = (*it)->get_states();
if(states && states->get_root()) {
get_states_name_rec(states->get_root(), state_list);
}
}
text += "<h2>States:</h2>";
text += QString("count: %1").arg(state_list.size());
}
void Trace_infos::get_states_name_rec(Node<StateChange> *parent, set<string> &state_list) const {
if(!parent)
return;
const StateChange *top_state = parent->get_element();
const State *left_state = top_state->get_left_state();
const State *right_state = top_state->get_right_state();
if(left_state && left_state->get_value()) {
state_list.insert(left_state->get_value()->get_name().to_string());
//cout << left_state->get_value()->get_name().to_string() << endl;
get_states_name_rec(parent->get_left_child(), state_list);
}
if(right_state && right_state->get_value()) {
state_list.insert(right_state->get_value()->get_name().to_string());
//cout << right_state->get_value()->get_name().to_string() << endl;
get_states_name_rec(parent->get_right_child(), state_list);
}
}
void Trace_infos::set_events_infos(QString &text) const {
/* count */
int count = 0;
list <Container *> container_list;
_trace->get_all_containers(container_list);
for(list<Container *>::const_iterator it = container_list.begin();
it != container_list.end();
++ it) {
count += (*it)->get_event_number();
}
text += "<h2>Events:</h2>";
text += QString("count: %1").arg(count);
}
void Trace_infos::set_variables_infos(QString &text) const {
/* count */
int count = 0;
list <Container *> container_list;
_trace->get_all_containers(container_list);
for(list<Container *>::const_iterator it = container_list.begin();
it != container_list.end();
++ it) {
count += (*it)->get_variable_number();
}
text += "<h2>Variables:</h2>";
text += QString("count: %1").arg(count);
}
void Trace_infos::set_links_infos(QString &text) const {
/* count */
//const list<LinkType *> *links_types = _trace->get_link_types();
text += "<h2>Links:</h2>";
//text += QString("count: %1").arg(links_types->size());
}
void Trace_infos::init() {
//_text_info->clear();
}
void Trace_infos::clear() {
_text_info->clear();
}
void Trace_infos::set_arguments(map<string /*argname*/, QVariant */*argValue*/>) {}
string Trace_infos::get_name() {
return "Trace informations";
}
void Trace_infos::execute() {
_text_info->clear();
QString text ("<center><h1> Trace informations </h1></center>");
set_container_infos(text);
set_states_infos(text);
set_events_infos(text);
set_variables_infos(text);
set_links_infos(text);
_text_info->setHtml(text);
}
#ifndef TRACE_INFOS_HPP
#define TRACE_INFOS_HPP
class Trace_infos : public Plugin {
private:
QTextEdit *_text_info;
void set_container_infos(QString &text) const;
void set_states_infos(QString &text) const;
void get_states_name_rec(Node<StateChange> *parent, std::set<std::string> &state_list) const;
void set_events_infos(QString &text) const;
void set_variables_infos(QString &text) const;
void set_links_infos(QString &text) const;
public:
Trace_infos();
~Trace_infos();
void init();
void clear();
void set_arguments(std::map<std::string /*argname*/, QVariant */*argValue*/>);
std::string get_name();
public slots:
void execute();
};
extern "C" {
Plugin *create() { return new Trace_infos(); }
}
#endif // TRACE_INFOS_HPP
TEMPLATE = lib
CONFIG += plugin
TARGET = trace_infos
DEPENDPATH += ..
INCLUDEPATH += ..
DESTDIR = ~/.vite
OBJECTS_DIR = ../../bin
SOURCES = trace_infos.cpp \
trace/Trace.cpp \
trace/values/Date.cpp \
trace/values/Name.cpp \
trace/values/Double.cpp \
trace/values/String.cpp \
trace/ContainerType.cpp \
trace/EntityType.cpp \
trace/VariableType.cpp \
trace/EventType.cpp \
trace/LinkType.cpp \
trace/StateType.cpp \
trace/Container.cpp \
trace/Entity.cpp \
trace/EntityValue.cpp \
trace/Variable.cpp \
trace/State.cpp \
trace/StateChange.cpp \
trace/Link.cpp \
trace/Event.cpp \
statistics/Statistic.cpp \
common/Tools.cpp \
common/Info.cpp
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