OSDN Git Service

alpha1 development in progress. (Qt)
authortkawata <takuji.kawata@gmail.com>
Sat, 10 Mar 2012 04:42:47 +0000 (13:42 +0900)
committertkawata <takuji.kawata@gmail.com>
Sat, 10 Mar 2012 04:42:47 +0000 (13:42 +0900)
- finished moving to the new container definition file format
- console out is now in window's console textbox.

14 files changed:
Source/DNContainerBuilder.cpp
Source/DNContainerBuilder.h
Source/DNEngine.cpp
Source/DNEngine.h
Source/DNFileList.cpp
Source/DNXMLElement.cpp
Source/QtDennco/mainwindow.cpp
Source/QtDennco/mainwindow.h
Source/QtDennco/mainwindow.ui
Source/QtScript/dnqscellcode.cpp
Source/QtScript/dnqscontainer.cpp
Source/QtScript/dnqscontainer.h
Source/TKCell.cpp
Source/TKContainer.h

index 1ba5a85..5ed5903 100644 (file)
@@ -63,23 +63,31 @@ bool DNContainerBuilder::buildContainerFromXHTML(const char* docRoot)
     while(!mPendingCellDefinitions.empty())
     {
         PendingCellDefinition *cellInfo = mPendingCellDefinitions.front();
-        TKCellCode *cellCode = mContainer->getCellCode(cellInfo->cellCodeName);
         TKCell *newCell = NULL;
-        if (cellCode)
+        if (cellInfo->useCellCodeClass)
         {
-            newCell = mContainer->createCell(cellInfo->location, cellInfo->cellName, cellCode, cellInfo->customScript);
+            TKCellCode *cellCode = mContainer->getCellCode(cellInfo->cellCodeClassOrType);
+            if (cellCode)
+            {
+                newCell = mContainer->createCellWithCellCodeClass(cellInfo->location, cellInfo->cellName, cellCode, cellInfo->customScript);
+            }
+            else
+            {
+                std::string message = std::string("Failed to construct cell: ").append(cellInfo->location).append("#").append(cellInfo->cellName);
+                message.append("\nCellCode '").append(cellInfo->cellCodeClassOrType).append("' couldn't be found.");
+                TKLog::printf("%s", message.c_str());
+                if (dnGlobal()->updateErrorStatus(DNGlobal::ERROR))
+                {
+                    dnGlobal()->setMessage1("Initialization failed");
+                    dnGlobal()->setMessage2(message);
+                }
+            }
         }
         else
         {
-            std::string message = std::string("Failed to construct cell: ").append(cellInfo->location).append("#").append(cellInfo->cellName);
-            message.append("\nCellCode '").append(cellInfo->cellCodeName).append("' couldn't be found.");
-            TKLog::printf("%s", message.c_str());
-            if (dnGlobal()->updateErrorStatus(DNGlobal::ERROR))
-            {
-                dnGlobal()->setMessage1("Initialization failed");
-                dnGlobal()->setMessage2(message);
-            }
+            newCell = mContainer->createCellWithoutCellCodeClass(cellInfo->location, cellInfo->cellName, cellInfo->cellCodeClassOrType, cellInfo->customScript);
         }
+
         if (newCell == NULL)
         {
             std::string message = std::string("Failed to construct cell: ").append(cellInfo->location).append("#").append(cellInfo->cellName);
@@ -121,20 +129,35 @@ bool DNContainerBuilder::buildContainerFromXHTML(const char* docRoot)
     return true;
 }
 
-void DNContainerBuilder::addCell(const char *path, std::string name, std::string cellcode, std::string customScript)
+void DNContainerBuilder::defineCellWithoutCellCodeClass(const char *path, std::string name, std::string type, std::string customScript)
+{
+    DEBUG_TRACE("\n===== Define cell (no CellCode class) ================ \nName:%s/%s\nType:%s\nCustom script:\n%s\n", path,name.c_str(), type.c_str(),customScript.c_str());
+
+    PendingCellDefinition *newCellDefine = new PendingCellDefinition();
+    newCellDefine->useCellCodeClass = false;
+    newCellDefine->location = path;
+    newCellDefine->cellName = name;
+    newCellDefine->cellCodeClassOrType = type;
+    newCellDefine->customScript = customScript;
+
+    mPendingCellDefinitions.push(newCellDefine);
+}
+
+void DNContainerBuilder::defineCellWithCellCodeClass(const char *path, std::string name, std::string cellcode, std::string customScript)
 {
-    DEBUG_TRACE("\n===== Define cell ================ \nName:%s/%s\nClass:%s\nCustom script:\n%s\n", path,name.c_str(), cellcode.c_str(),customScript.c_str());
+    DEBUG_TRACE("\n===== Define cell (CellCode class attached)=========== \nName:%s/%s\nClass:%s\nCustom script:\n%s\n", path,name.c_str(), cellcode.c_str(),customScript.c_str());
 
     PendingCellDefinition *newCellDefine = new PendingCellDefinition();
+    newCellDefine->useCellCodeClass = true;
     newCellDefine->location = path;
     newCellDefine->cellName = name;
-    newCellDefine->cellCodeName = getFQNString(path, cellcode.c_str());
+    newCellDefine->cellCodeClassOrType = getFQNString(path, cellcode.c_str());
     newCellDefine->customScript = customScript;
 
     mPendingCellDefinitions.push(newCellDefine);
 }
 
-void DNContainerBuilder::addCellCode(const char *path, std::string name, std::string type, std::string cellScript)
+void DNContainerBuilder::defineCellCodeClass(const char *path, std::string name, std::string type, std::string cellScript)
 {
     std::string fqnName = getFQNString(path, name.c_str());
 
@@ -143,7 +166,7 @@ void DNContainerBuilder::addCellCode(const char *path, std::string name, std::st
     mContainer->createCellCode(fqnName, type, cellScript);
 }
 
-void DNContainerBuilder::addConnection(const char *path, std::string origine, std::string destination, std::string name)
+void DNContainerBuilder::defineConnection(const char *path, std::string origine, std::string destination, std::string name)
 {
     PendingCellConnection *newConnection = new PendingCellConnection();
     newConnection->connectionName = name;
@@ -158,7 +181,7 @@ void DNContainerBuilder::parseXHTML(const char *docRoot, const char *path)
     DNXMLElement *element = xml->getRoot();
     
     std::string  cellName;
-    std::string  cellCodeName;
+    std::string  cellCodeClassName;
     std::string  cellAPIType;
     std::string  script;
 
@@ -188,14 +211,14 @@ void DNContainerBuilder::parseXHTML(const char *docRoot, const char *path)
                 }
                 else if (define == "cellcode")
                 {
-                    cellCodeName = element->getAttributeValue("name");
+                    cellCodeClassName = element->getAttributeValue("name");
                     cellAPIType = element->getAttributeValue("type");
                     defineDepth = element->depth;
                 }
                 else
                 {
                     std::string message = std::string("Syntax error while parsing ").append(path).append(". defnie='").append("' isn't correct.");
-                    TKLog::printf("%s", message.c_str());
+                    TKLog::printf("%s\n", message.c_str());
                     if (dnGlobal()->updateErrorStatus(DNGlobal::ERROR))
                     {
                         dnGlobal()->setMessage1("Initialization failed");
@@ -214,7 +237,19 @@ void DNContainerBuilder::parseXHTML(const char *docRoot, const char *path)
             }
             else if (parameter == "cellcode")
             {
-                cellCodeName = element->getAttributeValue("href");
+                cellCodeClassName = element->getAttributeValue("href");
+                cellAPIType = element->getAttributeValue("type");
+                if (cellCodeClassName.length() > 0 && cellAPIType.length() > 0)
+                {
+                    std::string message = std::string("Syntax error while parsing ").append(path).append(". CellCode:").append(cellName);
+                    message.append("\n'type' can't be defined here if you use CellCode class.");
+                    TKLog::printf("%s\n", message.c_str());
+                    if (dnGlobal()->updateErrorStatus(DNGlobal::ERROR))
+                    {
+                        dnGlobal()->setMessage1("Initialization failed");
+                        dnGlobal()->setMessage2(message);
+                    }
+                }
             }
             else if (parameter== "connection")
             {
@@ -224,7 +259,7 @@ void DNContainerBuilder::parseXHTML(const char *docRoot, const char *path)
                 {
                     rname = cellName;
                 }
-                addConnection(path, cellName, target, rname);
+                defineConnection(path, cellName, target, rname);
             }
             else
             {
@@ -264,15 +299,24 @@ void DNContainerBuilder::parseXHTML(const char *docRoot, const char *path)
                 defineDepth = -1;
                 if (cellName.length()>0)
                 {
-                    addCell(path, cellName, cellCodeName, script);
+                    if (cellCodeClassName.length()>0)
+                    {
+                        defineCellWithCellCodeClass(path, cellName, cellCodeClassName, script);
+                    }
+                    else
+                    {
+                        defineCellWithoutCellCodeClass(path, cellName, cellAPIType, script);
+                    }
+
                     cellName = "";
-                    cellCodeName = "";
+                    cellCodeClassName = "";
+                    cellAPIType = "";
                     script = "";
                 }
                 else
                 {
-                    addCellCode(path, cellCodeName, cellAPIType, script);
-                    cellCodeName = "";
+                    defineCellCodeClass(path, cellCodeClassName, cellAPIType, script);
+                    cellCodeClassName = "";
                     cellAPIType = "";
                     script = "";
                 }
index 836ecc4..37733aa 100644 (file)
@@ -39,16 +39,18 @@ private:
     TKLock                              mLock;
     TKContainer                         *mContainer;
 
-    void addCell(const char *path, std::string name, std::string cellcode, std::string customScript);
-    void addCellCode(const char *path, std::string name, std::string type, std::string cellScript);
-    void addConnection(const char *path, std::string origine, std::string destination, std::string name);
+    void defineCellWithoutCellCodeClass(const char *path, std::string name, std::string type, std::string customScript);
+    void defineCellWithCellCodeClass(const char *path, std::string name, std::string cellcode, std::string customScript);
+    void defineCellCodeClass(const char *path, std::string name, std::string type, std::string cellScript);
+    void defineConnection(const char *path, std::string origine, std::string destination, std::string name);
 
     class PendingCellDefinition
     {
     public:
+        bool        useCellCodeClass;
         std::string location;
         std::string cellName;
-        std::string cellCodeName;
+        std::string cellCodeClassOrType;
         std::string customScript;
     };
     
index cf5e3c5..d05b5ac 100644 (file)
 #include "DNEngine.h"
 #include "DNAlert.h"
 #include "DNXML.h"
+#include "DNXMLElement.h"
 #include "DNGlobal.h"
 #include "DNUtils.h"
+#include "TKLog.h"
 
 #include <stdlib.h>
+#include <sstream>
+#include <iostream>
 
 DNEngine::DNEngine(const char *contentPath) :
     mContainer(NULL),mPortNumber(9080),mHTTPServer(NULL),mValid(false), mDoTickThread(NULL)
 {
     mTimeKeeper = new DNTimeKeeper();
     mContainer = TKContainer::createContainer();
-    
+    mUIPath = "/ui/index.html";
+
     dnGlobal()->updateRunningStatus(DNGlobal::STOPPED);
 
     std::string basePath(contentPath);
@@ -102,13 +107,78 @@ DNEngine::~DNEngine()
 
 bool DNEngine::parseSettingFile(const char *contentRoot)
 {
+    bool valid = false;
+
     DNXML *xml = DNXML::createXMLFromFile(contentRoot, "property.xml");
     if (xml)
     {
-        //TODO
+        valid = true;
+        DNXMLElement *element = xml->getRoot();
+        if (element->name != "dennco")
+        {
+            valid = false;
+            std::string message = "First element of property.xml should be <dennco>";
+            TKLog::printf("ERROR wile parsing property.xml file.\n%s\n",message.c_str());
+            if (dnGlobal()->updateErrorStatus(DNGlobal::ERROR))
+            {
+                dnGlobal()->setMessage1("Initialization failed");
+                dnGlobal()->setMessage2(message);
+            }
+            else
+            {
+                dnGlobal()->setMessage1("Initialization failed");
+            }
+        }
+
+        if (valid)
+        {
+            DNXMLElement *e = element->inner;
+            while(e)
+            {
+                if (e->name == "TickIntervalSec")
+                {
+                    std::istringstream is(e->text);
+                    float t = 0.0;
+                    is >> t;
+                    if (t>0)
+                    {
+                        setTickIntervalSec(t);
+                    }
+                    else
+                    {
+                        valid = false;
+                        std::string message = "Error in property.xml. TickIntervalSec is not configured properly.";
+                        TKLog::printf("ERROR wile parsing property.xml file.\n%s\n",message.c_str());
+                        if (dnGlobal()->updateErrorStatus(DNGlobal::ERROR))
+                        {
+                            dnGlobal()->setMessage1("Initialization failed");
+                            dnGlobal()->setMessage2(message);
+                        }
+                        else
+                        {
+                            dnGlobal()->setMessage1("Initialization failed");
+                        }
+                    }
+                }
+                else if (e->name == "UIPath")
+                {
+                    mUIPath = e->text;
+                }
+                else if (e->name == "EnableHTTPServer")
+                {
+
+                }
+                else if (e->name == "EnableSerialServer")
+                {
+
+                }
+                e = e->next;
+            }
+        }
+
         delete xml;
     }
-    return true;
+    return valid;
 }
 
 bool DNEngine::parseContainerFile(const char *containerRoot)
@@ -230,6 +300,5 @@ std::string DNEngine::getContentPath()
 
 std::string DNEngine::getUIPath()
 {
-    //TODO 
-    return "/ui/index.html";
+    return mUIPath;
 }
index e04345c..2d1df7e 100644 (file)
@@ -63,6 +63,7 @@ private:
     DNHTTPServer    *mHTTPServer;
     DNTimeKeeper    *mTimeKeeper;
     bool            mValid;
+    std::string     mUIPath;
 
     DNThread        *mDoTickThread;
     
index b8adb29..59dced4 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "DNFileList.h"
 
-DNFileList::DNFileList(std::string f) : prev(NULL),next(NULL)
+DNFileList::DNFileList(std::string f) : next(NULL),prev(NULL)
 {
     filePath = f;
 }
index 8751689..2ea8dcc 100644 (file)
@@ -20,7 +20,7 @@
 #include "DNXMLElement.h"
 
 DNXMLElement::DNXMLElement(std::string _name):
-name(_name),outer(NULL),inner(NULL),next(NULL),depth(0),text("")
+outer(NULL),inner(NULL),next(NULL),depth(0),name(_name),text("")
 {
 }
 
index b33a813..aa32db5 100644 (file)
@@ -35,7 +35,8 @@
 MainWindow::MainWindow(QWidget *parent) :
     QMainWindow(parent),
     ui(new Ui::MainWindow),
-    mEngine(NULL), mWebInterface(NULL)
+    mEngine(NULL), mWebInterface(NULL),
+    mHasPendingConsoleMessage(false)
 {
     ui->setupUi(this);
 
@@ -43,9 +44,10 @@ MainWindow::MainWindow(QWidget *parent) :
     QVariant defaultPath(QDir::homePath());
     QString  contentPath = settings.value("content_path", defaultPath).toString();
 
-    mConsole = new TKConsole();
-    TKLog::setDestination(mConsole);
     ui->filePath->setText(contentPath);
+
+    ui->console->document()->setMaximumBlockCount(2000);
+    TKLog::setDestination(this);
 }
 
 MainWindow::~MainWindow()
@@ -173,3 +175,39 @@ void MainWindow::deleteCurrentEngine()
     }
 }
 
+void MainWindow::paintEvent( QPaintEvent * event )
+{
+    mConsoleLock.lock();
+    if (mHasPendingConsoleMessage)
+    {
+        ui->console->append(mPendingConsoleMessage);
+        mPendingConsoleMessage.clear();
+        mHasPendingConsoleMessage = false;
+    }
+    mConsoleLock.unlock();
+
+    QMainWindow::paintEvent(event);
+}
+
+void MainWindow::vprintf(const char *fmt, va_list ap)
+{
+    QString msg = QString().vsprintf(fmt,ap);
+    qDebug() << msg << endl;
+    mConsoleLock.lock();
+    if (mHasPendingConsoleMessage)
+        mPendingConsoleMessage.append("\n");
+    mPendingConsoleMessage.append(msg);
+    mHasPendingConsoleMessage = true;
+    mConsoleLock.unlock();
+    update();
+}
+
+void MainWindow::vDebugPrintf(const char *fmt, va_list ap)
+{
+#ifdef DEBUG
+    QString msg = QString().vsprintf(fmt,ap);
+    qDebug() << "DEBUG:" << msg << endl;
+#endif
+}
+
+
index 8c94b05..04887bb 100644 (file)
@@ -21,6 +21,9 @@
 
 #include <QMainWindow>
 
+#include "TKConsole.h"
+#include "TKLock.h"
+
 class DNEngine;
 class TKConsole;
 class DNWebInterface;
@@ -29,7 +32,7 @@ namespace Ui {
 class MainWindow;
 }
 
-class MainWindow : public QMainWindow
+class MainWindow : public QMainWindow, TKConsole
 {
     Q_OBJECT
     
@@ -39,6 +42,7 @@ public:
 
 protected:
     virtual void closeEvent(QCloseEvent *event);
+    virtual void paintEvent(QPaintEvent *event );
 
 private slots:
     void on_chooseDirButton_clicked();
@@ -55,6 +59,13 @@ private:
     DNEngine        *mEngine;
     TKConsole       *mConsole;
     DNWebInterface  *mWebInterface;
+
+    virtual void vprintf(const char *fmt, va_list arg);
+    virtual void vDebugPrintf(const char *fmt, va_list arg);
+    TKLock       mConsoleLock;
+    QString      mPendingConsoleMessage;
+    bool         mHasPendingConsoleMessage;
+
 };
 
 #endif // MAINWINDOW_H
index 638e76b..8bcab96 100644 (file)
@@ -96,7 +96,7 @@
    <widget class="QWidget" name="dockWidgetContents_3">
     <layout class="QVBoxLayout" name="verticalLayout_2">
      <item>
-      <widget class="QTextBrowser" name="textBrowser_2"/>
+      <widget class="QTextEdit" name="console"/>
      </item>
     </layout>
    </widget>
index 2d6e9d9..c4dd256 100644 (file)
@@ -44,7 +44,6 @@ DNQSCellCode::~DNQSCellCode()
 {
 
 }
-
 TKCellCodeInstance* DNQSCellCode::createCellCodeInstance(TKCell *owner, const void *data)
 {
     if (!mCellContainer)
@@ -71,8 +70,9 @@ TKCellCodeInstance* DNQSCellCode::createCellCodeInstance(TKCell *owner, const vo
         QScriptContext *context = scriptEngine->pushContext();
         context->setThisObject(instance);
         context->setActivationObject(instance);
-        QScriptProgram initCode(QString((const char*)data));
-        scriptEngine->evaluate(initCode);
+        QString customScriptStr((const char*)data);
+        QScriptProgram customScript(customScriptStr);
+        scriptEngine->evaluate(customScript);
 
         scriptEngine->popContext();
 
index 9a4fa27..8b5c39f 100644 (file)
@@ -77,6 +77,13 @@ DNQSContainer::DNQSContainer()
 
     mQSCellContainer = mQSEngine->newObject();
     mQSGlobalObject.setProperty("__private_DNCellContainer__",mQSCellContainer);
+
+    std::string pname = "_";
+    pname.append(CELLTYPE_JSBASIC);
+    mEmptyCellClassForB = createCellCode(pname,CELLTYPE_JSBASIC,"");
+    pname = "_";
+    pname.append(CELLTYPE_UIBASIC);
+    mEmptyCellClassForUB = createCellCode(pname,CELLTYPE_UIBASIC,"");
 }
 
 DNQSContainer::~DNQSContainer()
@@ -84,8 +91,54 @@ DNQSContainer::~DNQSContainer()
     if (mQSEngine)
         delete mQSEngine;
 }
+TKCell* DNQSContainer::createCellWithoutCellCodeClass(std::string theLocation, std::string theName, std::string type, std::string customScript)
+{
+    TKCell *cell = NULL;
+    TKCellCode *cellCode = NULL;
+    if (type == CELLTYPE_JSBASIC || type.length() == 0)
+    {
+        cell = new DNQSBasicCell(this, theLocation, theName, false);
+        cellCode = mEmptyCellClassForB;
+    }
+    else if (type == CELLTYPE_UIBASIC)
+    {
+        cell = new DNQSBasicCell(this, theLocation, theName, true);
+        cellCode = mEmptyCellClassForUB;
+    }
+    else
+    {
+        std::string message = std::string("Failed to construct cell '").append(theLocation).append("#").append(theName);
+        message.append("'\nThe cellcode requires type '").append(type).append("' but it's not a supported type.");
+        TKLog::printf("%s", message.c_str());
+        if (dnGlobal()->updateErrorStatus(DNGlobal::ERROR))
+        {
+            dnGlobal()->setMessage1("Initialization failed");
+            dnGlobal()->setMessage2(message);
+        }
+    }
+
+
+    if (cell)
+    {
+        std::string fqnName = getFQNString(theLocation.c_str(), theName.c_str());
+        mCells.insert(TKCellMap::value_type(fqnName, cell));
+        cell->setCellCode(cellCode,(const void*)customScript.c_str());
+
+        if (cell->isInterface())
+        {
+            mInterfaceCells.insert(TKCellMap::value_type(fqnName, cell));
+        }
+    }
+    else
+    {
+        std::string fqnName = getFQNString(theLocation.c_str(),theName.c_str());
+        TKLog::printf("Failed to create a cell. %s", fqnName.c_str());
+    }
+
+    return cell;
+}
 
-TKCell* DNQSContainer::createCell(std::string theLocation, std::string theName, TKCellCode *cellCode, std::string startupScript)
+TKCell* DNQSContainer::createCellWithCellCodeClass(std::string theLocation, std::string theName, TKCellCode *cellCode, std::string customScript)
 {
     TKCell *cell = NULL;
 
@@ -116,7 +169,7 @@ TKCell* DNQSContainer::createCell(std::string theLocation, std::string theName,
     {
         std::string fqnName = getFQNString(theLocation.c_str(), theName.c_str());
         mCells.insert(TKCellMap::value_type(fqnName, cell));
-        cell->setCellCode(cellCode,(const void*)startupScript.c_str());
+        cell->setCellCode(cellCode,(const void*)customScript.c_str());
 
         if (cell->isInterface())
         {
index ea73dea..cab9ca8 100644 (file)
@@ -30,13 +30,14 @@ public:
     DNQSContainer();
     virtual ~DNQSContainer();
 
-    virtual TKCell* createCell(std::string theLocation, std::string theName, TKCellCode *cellCode, std::string startupScript);
+    virtual TKCell*     createCellWithoutCellCodeClass(std::string theLocation, std::string theName, std::string type, std::string customScript);
+    virtual TKCell*     createCellWithCellCodeClass(std::string theLocation, std::string theName, TKCellCode *cellCode, std::string customScript);
     virtual TKCellCode* createCellCode(std::string theName, std::string theAPIType, std::string code);
 
-    virtual bool doTick(float time);
+    virtual bool    doTick(float time);
 
-    virtual void setValue(std::string key, float value);
-    virtual float getValue(std::string key);
+    virtual void    setValue(std::string key, float value);
+    virtual float   getValue(std::string key);
 
     inline QScriptEngine*   getScriptEngine() { return mQSEngine; }
     inline QScriptValue     getScriptGlobalObject() { return mQSGlobalObject; }
@@ -49,6 +50,8 @@ public:
     QScriptEngine   *mQSEngine;
     QScriptValue    mQSGlobalObject;
     QScriptValue    mQSCellContainer;
+    TKCellCode      *mEmptyCellClassForB;
+    TKCellCode      *mEmptyCellClassForUB;
 };
 
 #endif // DNQSCONTAINER_H
index f794f3a..ef0c36e 100644 (file)
@@ -27,7 +27,7 @@
 #include <string>
 
 TKCell::TKCell(TKContainer *container, std::string location, std::string name, bool canIntarface)
-: mContainer(container), mAxon(NULL), mCellCodeInstance(NULL), mLocation(location), mName(name), mCanInterface(canIntarface)
+: mName(name), mLocation(location), mContainer(container), mAxon(NULL), mCellCodeInstance(NULL), mCanInterface(canIntarface)
 {
     mAxon = new TKAxon(this);
 }
index 18fe130..5fc367b 100644 (file)
@@ -34,30 +34,31 @@ class TKContainer
 public:
     static TKContainer* createContainer();
 
-       virtual ~TKContainer();
+    virtual ~TKContainer();
 
     const TKCellMap* getCells() { return &mCells; } 
     const TKCellCodeMap* getCellCodes() { return &mCellCodes; }
     void setContentPath(std::string contentPath) { mContentPath = contentPath; }
     std::string getContentPath() { return mContentPath; }
-       TKCell* getCell(std::string theFQNName);
-       TKCell* getInterfaceCell(std::string theFQNName);
-       TKCellCode* getCellCode(std::string theCellCodeName);
-       
-       virtual TKCell* createCell(std::string theLocation, std::string theName, TKCellCode *cellCode, std::string startupString) = 0;
-       virtual TKCellCode* createCellCode(std::string theName, std::string theAPIType, std::string code) = 0;
+    TKCell* getCell(std::string theFQNName);
+    TKCell* getInterfaceCell(std::string theFQNName);
+    TKCellCode* getCellCode(std::string theCellCodeName);
+
+    virtual TKCell*     createCellWithoutCellCodeClass(std::string theLocation, std::string theName, std::string type, std::string customScript) = 0;
+    virtual TKCell*     createCellWithCellCodeClass(std::string theLocation, std::string theName, TKCellCode *cellCode, std::string customScript) = 0;
+    virtual TKCellCode* createCellCode(std::string theName, std::string theAPIType, std::string code) = 0;
        
-       virtual bool doTick(float time) = 0;
-       
-       virtual void setValue(std::string key, float value) = 0;
-       inline virtual float getValue(std::string key) = 0;
+    virtual bool doTick(float time) = 0;
+
+    virtual void setValue(std::string key, float value) = 0;
+    inline virtual float getValue(std::string key) = 0;
 
 protected:
     TKContainer() {}
-       TKCellMap       mCells;
+    TKCellMap       mCells;
     TKCellMap       mInterfaceCells;
     TKCellCodeMap   mCellCodes;
     std::string     mContentPath;
-       
+
 };
 #endif