Skip to content

Commit

Permalink
- add nosendData
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10453 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Nov 11, 2011
1 parent eaba349 commit 679f18d
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 10 deletions.
25 changes: 17 additions & 8 deletions SimulationRuntime/c/sendData/CMakeLists.txt
Expand Up @@ -14,19 +14,28 @@ SET(QT_LIBRARIES "${QT_LIBRARIES}" ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT

# Quellen und Header
SET(sendData_sources sendData.cpp )
SET(sendData_headers sendData.h)



# Library sendData
#ADD_DEFINITIONS(/O2 /frtti /fexceptions /mthreads /Wall /DUNICODE /DQT_LARGEFILE_SUPPORT /DQT_NO_DEBUG /DQT_GUI_LIB /DQT_NETWORK_LIB /DQT_CORE_LIB /DQT_THREAD_SUPPORT)

SET(sendData_headers sendData.h)

ADD_LIBRARY(sendData ${sendData_sources} ${sendData_headers})
TARGET_LINK_LIBRARIES(sendData ${QT_LIBRARIES})

ELSE(QT_QTCORE_INCLUDE_DIR)
MESSAGE(" QT is not availivle use NOSENDDATA")

# Quellen und Header
SET(sendData_headers sendData.h)
ADD_DEFINITIONS(/DnosendData)
ENDIF(QT_QTCORE_INCLUDE_DIR)

SET(sendData_sources nosendData.cpp)
SET(sendData_headers sendData.h)

ADD_LIBRARY(sendData ${sendData_sources} ${sendData_headers})

# Install
INSTALL(TARGETS sendData
ARCHIVE DESTINATION lib)

ELSE(QT_QTCORE_INCLUDE_DIR)
MESSAGE(" QT is not availivle lib sendData will not be compiled, linker error will occure ")
ENDIF(QT_QTCORE_INCLUDE_DIR)
ARCHIVE DESTINATION lib)
119 changes: 119 additions & 0 deletions SimulationRuntime/c/sendData/nosendData.cpp
@@ -0,0 +1,119 @@
/*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-2010, Linköpings University,
* Department of Computer and Information Science,
* SE-58183 Linköping, Sweden.
*
* All rights reserved.
*
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF THIS OSMC PUBLIC
* LICENSE (OSMC-PL). ANY USE, REPRODUCTION OR DISTRIBUTION OF
* THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THE OSMC
* PUBLIC LICENSE.
*
* The OpenModelica software and the Open Source Modelica
* Consortium (OSMC) Public License (OSMC-PL) are obtained
* from Linköpings University, either from the above address,
* from the URL: http://www.ida.liu.se/projects/OpenModelica
* and in the OpenModelica distribution.
*
* This program is distributed WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
* IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS
* OF OSMC-PL.
*
* See the full OSMC Public License conditions for more details.
*
*
* For more information about the Qt-library visit TrollTech:s webpage regarding
* licence: http://www.trolltech.com/products/qt/licensing.html
*
*/


#include "sendData.h"



bool ellipse(double x0, double y0, double x1, double y1, const char* color, int colorR, int colorG, int colorB, const char* fillColor, int fillColorR, int fillColorG, int fillColorB)
{
return true;
}

bool rect(double x0, double y0, double x1, double y1, const char* color, int colorR, int colorG, int colorB, const char* fillColor, int fillColorR, int fillColorG, int fillColorB)
{
return true;
}

bool line(double x0, double y0, double x1, double y1, const char* color, int colorR, int colorG, int colorB, const char* fillColor, int fillColorR, int fillColorG, int fillColorB)
{
return true;
}


bool hold(int status)
{
return true;
}

bool pltWait(unsigned long msecs)
{
return true;
}

bool pltTable(double* table, size_t r, size_t c) //, const char* legend, int size)
{
return false;
}


void setDataPort(int port)
{
}

void enableSendData(int enable)
{
}

void initSendData(int variableCount, const struct omc_varInfo** names)
{
}


void sendPacket(const char* data)
{
}

void closeSendData()
{
}

void emulateStreamData(const char* data, const char* title, const char* xLabel, const char* yLabel, const char* interpolation5, int legend, int grid, int logX, int logY, int drawPoints, const char* range)
{
}



bool plt(const char* var, const char* model, const char* title, const char* xLabel, const char* yLabel, bool legend, bool grid, bool logX, bool logY, const char* interpolation, bool drawPoints, const char* range)
{
return true;
}


int getVariableListSize(const char* model)
{
return 0;
}

bool getVariableList(const char* model, char* lst)
{
return true;
}


void emulateStreamData2(const char *info, const char* data, int port)
{
}

8 changes: 7 additions & 1 deletion SimulationRuntime/c/sendData/sendData.h
Expand Up @@ -35,6 +35,8 @@
#ifndef SENDDATA_H
#define SENDDATA_H

#ifndef NOSENDDATA

//Qt headers
//#include <QApplication>
//#include <QtNetwork/QTcpSocket>
Expand All @@ -45,12 +47,14 @@ class QColor;
#include <string>
class QStringList;
//#include <QThread>
#endif

//Std headers
#include <iostream>
#include <cstdlib>
#include "../simulation/simulation_varinfo.h"

#ifndef NOSENDDATA
class Connection
{
public:
Expand Down Expand Up @@ -81,7 +85,9 @@ class Static
static bool connect(bool graphics = false);
static bool enabled_;
};

#else
typedef int QColor
#endif
#ifdef __cplusplus
using namespace std;
extern "C"
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/c/simulation/CMakeLists.txt
Expand Up @@ -18,7 +18,7 @@ SET(simulation_headers simulation_input_xml.h simulation_runtime.h
# Library util
ADD_DEFINITIONS(/DNO_INTERACTIVE_DEPENDENCY)
ADD_LIBRARY(simulation ${simulation_sources} ${simulation_headers})
TARGET_LINK_LIBRARIES(util)
#TARGET_LINK_LIBRARIES(util)

# Install
INSTALL(TARGETS simulation
Expand Down

0 comments on commit 679f18d

Please sign in to comment.