Permalink
Browse files

Updates

  • Loading branch information...
1 parent 5799658 commit 384690daedb306e85bc00e7e896cf43a9d366ca0 @bmcdorman bmcdorman committed Aug 10, 2012
View
@@ -6,21 +6,14 @@ PROJECT(libkovan)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
-FIND_PACKAGE(Qt4 REQUIRED)
-
SET(INCLUDE ${libkovan_SOURCE_DIR}/include)
SET(SRC ${libkovan_SOURCE_DIR}/src)
INCLUDE_DIRECTORIES(${INCLUDE})
-INCLUDE(${QT_USE_FILE})
-
FILE(GLOB INCLUDES ${INCLUDE}/*.h ${INCLUDE}/*.hpp)
FILE(GLOB SOURCES ${SRC}/*.cpp)
-SET(MOC_SRCS ${SRC}/draw_p.hpp)
-QT4_WRAP_CPP(SOURCES ${MOC_SRCS})
-
SET(CMAKE_CXX_FLAGS "-Wall")
IF(APPLE)
@@ -33,6 +26,7 @@ ENDIF()
SET(LIBRARY_OUTPUT_PATH ${libkovan_SOURCE_DIR}/lib )
+INCLUDE_DIRECTORIES(/usr/local/Cellar/cairo/1.12.2/include)
ADD_LIBRARY(kovan SHARED ${SOURCES})
TARGET_LINK_LIBRARIES(kovan pthread)
View
@@ -18,13 +18,25 @@
* If not, see <http://www.gnu.org/licenses/>. *
**************************************************************************/
+/*!
+ * \file console.h
+ * \brief Methods for working with the console screen
+ * \author Braden McDorman
+ * \copyright KISS Insitute for Practical Robotics
+ * \defgroup console Console
+ */
+
#ifndef _CONSOLE_H_
#define _CONSOLE_H_
#ifdef __cplusplus
extern "C" {
#endif
+/*!
+ * Clears the UI's console.
+ * \ingroup console
+ */
void console_clear();
#ifdef __cplusplus
View
@@ -18,12 +18,28 @@
* If not, see <http://www.gnu.org/licenses/>. *
**************************************************************************/
+/*!
+ * \file console.hpp
+ * \brief Classes for working with the console screen
+ * \author Braden McDorman
+ * \copyright KISS Insitute for Practical Robotics
+ * \defgroup console Console
+ */
+
#ifndef _CONSOLE_HPP_
#define _CONSOLE_HPP_
+/*!
+ * \class Console
+ * Methods for working with the console inside the UI
+ * \ingroup console
+ */
class Console
{
public:
+ /*!
+ * Clears the console.
+ */
static void clear();
};
View
@@ -18,6 +18,13 @@
* If not, see <http://www.gnu.org/licenses/>. *
**************************************************************************/
+/*!
+ * \file create_codes.h
+ * \author Braden McDorman
+ * \copyright KISS Institute for Practical Robotics
+ * \ingroup create
+ */
+
#ifndef _CREATE_CODES_H_
#define _CREATE_CODES_H_
View
@@ -0,0 +1,24 @@
+#ifndef _DATALOG_H_
+#define _DATALOG_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void datalog_remove_category(const char *name);
+
+void datalog_append_string(const char *text, const char *category);
+void datalog_append_number(double number, const char *category);
+
+void datalog_remove(int index, const char *category);
+
+int datalog_write_plain(const char *path);
+int datalog_write_csv(const char *path);
+
+void datalog_clear();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
View
@@ -0,0 +1,145 @@
+/*!
+ * \file datalog.hpp
+ * \author Braden McDorman
+ * \copyright KISS Institute for Practical Robotics
+ * \defgroup datalog Data Logging
+ */
+
+#ifndef _DATALOG_HPP_
+#define _DATALOG_HPP_
+
+#include <string>
+#include <vector>
+#include <map>
+
+class DataLog;
+
+/*!
+ * \class Category
+ * A category holds a collection of ordered and related items.
+ * This is conceptually similar to a column in a spreadsheet.
+ * \ingroup datalog
+ */
+class Category
+{
+public:
+ /*!
+ * Appends a string to this category.
+ */
+ void append(const std::string& data);
+
+ /*!
+ * Appends a number to this category.
+ */
+ void append(const double& data);
+
+ void remove(const unsigned int& index);
+
+ /*!
+ * Gets a list of all entries contained in this category.
+ * \return The entries in this category, ordered.
+ */
+ const std::vector<std::string>& entries() const;
+
+ /*!
+ * \return The name associated with this category.
+ */
+ const std::string& name() const;
+
+ friend class DataLog;
+private:
+ Category(const std::string& name);
+
+ std::string m_name;
+ std::vector<std::string> m_entries;
+};
+
+/*!
+ * \class DataLogWriter
+ * Base class for data log writers.
+ * \ingroup datalog
+ */
+class DataLogWriter
+{
+public:
+ virtual ~DataLogWriter();
+
+ virtual bool write(const DataLog *dataLog) = 0;
+};
+
+/*!
+ * \class CsvWriter
+ * Writes a data log in the CSV spreadsheet format. This can be
+ * imported into almost any spreadsheet program.
+ * \ingroup datalog
+ */
+class CsvWriter : public DataLogWriter
+{
+public:
+ CsvWriter(const std::string& path);
+ virtual bool write(const DataLog *dataLog);
+
+private:
+ std::string m_path;
+};
+
+/*!
+ * \class PlainWriter
+ * Writes a data log as plain text.
+ * \ingroup datalog
+ */
+class PlainWriter : public DataLogWriter
+{
+public:
+ PlainWriter(const std::string& path);
+ virtual bool write(const DataLog *dataLog);
+private:
+ unsigned int columnWidth(Category *category) const;
+
+ std::string m_path;
+};
+
+/*!
+ * \class DataLog
+ * Holds a collection of related categories which can be written out to various formats.
+ * This class is conceptually similar to a spreadsheet that holds multiple columns.
+ * \ingroup datalog
+ */
+class DataLog
+{
+public:
+ ~DataLog();
+ /*!
+ * Returns the category instance associated with name.
+ * \param name The name of the category. This is considered the category's title.
+ * \return A new instance of Category if the category doesn't exist yet, or the existing instance if it does.
+ */
+ Category *category(const std::string& name);
+
+ /*!
+ * Removes a previously created category.
+ * \param name The name of the category to remove.
+ */
+ void removeCategory(const std::string& name);
+
+ /*!
+ * Get a list of all created categories.
+ * \return The currently created categories.
+ */
+ std::vector<Category *> categories() const;
+
+ /*!
+ * Writes out this Data Log with the given writer.
+ * \return true on success, false otherwise.
+ */
+ bool write(DataLogWriter *writer) const;
+
+ /*!
+ * Removes all categories from this Data Log
+ */
+ void clear();
+private:
+ std::map<std::string, Category *> m_categories;
+};
+
+#endif
View
@@ -39,5 +39,6 @@
#include "util.h"
#include "general.h"
#include "console.h"
+#include "datalog.h"
#endif
View
@@ -54,5 +54,6 @@
#include "util.hpp"
#include "general.h"
#include "console.hpp"
+#include "datalog.hpp"
#endif
View
@@ -0,0 +1,86 @@
+#ifndef _REFLECTION_HPP_
+#define _REFLECTION_HPP_
+
+struct ReflectionVariant
+{
+ enum Type {
+ Void,
+ SignedChar,
+ UnsignedChar,
+ SignedShort,
+ UnsignedShort,
+ SignedInteger,
+ UnsignedInteger,
+ SignedLong,
+ UnsignedLong,
+ Double,
+ Float,
+ Bool,
+ SignedCharArray,
+ UnsignedCharArray,
+ SignedShortArray,
+ UnsignedShortArray,
+ SignedIntegerArray,
+ UnsignedIntegerArray,
+ SignedLongArray,
+ UnsignedLongArray
+ } type;
+ unsigned int size;
+
+ union {
+ signed char signedCharValue;
+ unsigned char unsignedCharValue;
+
+ signed short signedShortValue;
+ unsigned short unsignedShortValue;
+
+ signed int signedIntegerValue;
+ unsigned int unsignedIntegerValue;
+
+ signed long signedLongValue;
+ unsigned long unsignedLongValue;
+
+ double doubleValue;
+ float floatValue;
+
+ bool boolValue;
+
+ signed char *signedCharArrayValue;
+ unsigned char *unsignedCharArrayValue;
+
+ signed short *signedShortArrayValue;
+ unsigned short *unsignedShortArrayValue;
+
+ signed int *signedIntegerArrayValue;
+ unsigned int *unsignedIntegerArrayValue;
+
+ signed long *signedLongArrayValue;
+ unsigned long *unsignedLongArrayValue;
+ };
+};
+
+typedef std::vector<ReflectionVariant> ReflectionVariantVector;
+
+class ReflectionDelegate
+{
+public:
+ ReflectionVariant call(const std::string& method, const ReflectionVariantVector& parameters);
+};
+
+class ReflectionEngine
+{
+public:
+ ReflectionVariant interpret(const std::string& command);
+
+ void reset();
+
+ static ReflectionEngine *instance();
+private:
+ ReflectionEngine();
+ ReflectionEngine(const ReflectionEngine& rhs);
+ ReflectionEngine& operator=(const ReflectionEngine& rhs);
+
+ std::map<std::string, ReflectionVariant> m_variables;
+};
+
+#endif
View
@@ -21,6 +21,13 @@
#ifndef _WIFI_HPP_
#define _WIFI_HPP_
-
+class Socket
+{
+public:
+ Socket();
+ ~Socket();
+
+
+};
#endif
View
@@ -22,5 +22,6 @@
#define _BUILD_OPTIONS_H_
#define BUILD_WITH_QT 0
+#define BUILD_WITH_X11 0
#endif
Oops, something went wrong.

0 comments on commit 384690d

Please sign in to comment.