Skip to content

Commit

Permalink
- fixed a bug in systemimpl.c that caused an endless loop in System.s…
Browse files Browse the repository at this point in the history
…tringReplace

- fixed the OMShell code to compile on Unix (added OMShell.pro)

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2379 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed May 15, 2006
1 parent 8f1f15b commit cbe0b20
Show file tree
Hide file tree
Showing 11 changed files with 1,712 additions and 1,200 deletions.
244 changes: 244 additions & 0 deletions OMShell/Makefile
@@ -0,0 +1,244 @@
#############################################################################
# Makefile for building: OMShell
# Generated by qmake (2.00a) (Qt 4.1.1) on: Mon May 15 05:56:06 2006
# Project: OMShell.pro
# Template: app
# Command: /usr/local/qt-4.1.1/bin/qmake -unix -o Makefile OMShell.pro
#############################################################################

####### Compiler, tools and options

CC = gcc
CXX = g++
LEX = flex
YACC = yacc
DEFINES = -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
CFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES)
CXXFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES)
LEXFLAGS =
YACCFLAGS = -d
INCPATH = -I/usr/local/qt-4.1.1/mkspecs/linux-g++ -I. -I/usr/local/qt-4.1.1/include/QtCore -I/usr/local/qt-4.1.1/include/QtNetwork -I/usr/local/qt-4.1.1/include/QtGui -I/usr/local/qt-4.1.1/include/QtXml -I/usr/local/qt-4.1.1/include -I../../mico-2.3.12/include -I. -I.
LINK = g++
LFLAGS = -Wl,-rpath,/usr/local/qt-4.1.1/lib
LIBS = $(SUBLIBS) -L/usr/local/qt-4.1.1/lib -L/home/adrpo/dev/mico-2.3.12/lib -lmico2.3.12 -lssl -lcrypto -lbsd -lQtXml_debug -L/home/andbe/src/qt-x11-opensource-src-4.1.1/lib -lQtGui_debug -L/usr/X11R6/lib -lpng -lSM -lICE -lXi -lXrender -lXrandr -lXcursor -lXinerama -lfreetype -lfontconfig -lXext -lX11 -lQtNetwork_debug -lQtCore_debug -lz -lm -ldl -lpthread
AR = ar cqs
RANLIB =
QMAKE = /usr/local/qt-4.1.1/bin/qmake
TAR = tar -cf
COMPRESS = gzip -9f
COPY = cp -f
COPY_FILE = $(COPY)
COPY_DIR = $(COPY) -r
INSTALL_FILE = $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)
DEL_FILE = rm -f
SYMLINK = ln -sf
DEL_DIR = rmdir
MOVE = mv -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p

####### Output directory

OBJECTS_DIR = ./

####### Files

SOURCES = commandcompletion.cpp \
omc_communication.cc \
omc_communicator.cpp \
omcinteractiveenvironment.cpp \
oms.cpp \
main.cpp moc_commandcompletion.cpp \
moc_omc_communicator.cpp \
moc_oms.cpp
OBJECTS = commandcompletion.o \
omc_communication.o \
omc_communicator.o \
omcinteractiveenvironment.o \
oms.o \
main.o \
moc_commandcompletion.o \
moc_omc_communicator.o \
moc_oms.o
DIST = /usr/local/qt-4.1.1/mkspecs/qconfig.pri \
/usr/local/qt-4.1.1/mkspecs/features/qt_config.prf \
/usr/local/qt-4.1.1/mkspecs/features/exclusive_builds.prf \
/usr/local/qt-4.1.1/mkspecs/features/default_pre.prf \
/usr/local/qt-4.1.1/mkspecs/features/debug.prf \
/usr/local/qt-4.1.1/mkspecs/features/default_post.prf \
/usr/local/qt-4.1.1/mkspecs/features/warn_on.prf \
/usr/local/qt-4.1.1/mkspecs/features/qt.prf \
/usr/local/qt-4.1.1/mkspecs/features/unix/thread.prf \
/usr/local/qt-4.1.1/mkspecs/features/moc.prf \
/usr/local/qt-4.1.1/mkspecs/features/resources.prf \
/usr/local/qt-4.1.1/mkspecs/features/uic.prf \
OMShell.pro
QMAKE_TARGET = OMShell
DESTDIR =
TARGET = OMShell

first: all
####### Implicit rules

.SUFFIXES: .c .o .cpp .cc .cxx .C

.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.C.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<

####### Build rules

all: Makefile $(TARGET)

$(TARGET): $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)

Makefile: OMShell.pro /usr/local/qt-4.1.1/mkspecs/linux-g++/qmake.conf /usr/local/qt-4.1.1/mkspecs/qconfig.pri \
/usr/local/qt-4.1.1/mkspecs/features/qt_config.prf \
/usr/local/qt-4.1.1/mkspecs/features/exclusive_builds.prf \
/usr/local/qt-4.1.1/mkspecs/features/default_pre.prf \
/usr/local/qt-4.1.1/mkspecs/features/debug.prf \
/usr/local/qt-4.1.1/mkspecs/features/default_post.prf \
/usr/local/qt-4.1.1/mkspecs/features/warn_on.prf \
/usr/local/qt-4.1.1/mkspecs/features/qt.prf \
/usr/local/qt-4.1.1/mkspecs/features/unix/thread.prf \
/usr/local/qt-4.1.1/mkspecs/features/moc.prf \
/usr/local/qt-4.1.1/mkspecs/features/resources.prf \
/usr/local/qt-4.1.1/mkspecs/features/uic.prf \
/usr/local/qt-4.1.1/lib/libQtXml_debug.prl \
/usr/local/qt-4.1.1/lib/libQtCore_debug.prl \
/usr/local/qt-4.1.1/lib/libQtGui_debug.prl \
/usr/local/qt-4.1.1/lib/libQtNetwork_debug.prl
$(QMAKE) -unix -o Makefile OMShell.pro
/usr/local/qt-4.1.1/mkspecs/qconfig.pri:
/usr/local/qt-4.1.1/mkspecs/features/qt_config.prf:
/usr/local/qt-4.1.1/mkspecs/features/exclusive_builds.prf:
/usr/local/qt-4.1.1/mkspecs/features/default_pre.prf:
/usr/local/qt-4.1.1/mkspecs/features/debug.prf:
/usr/local/qt-4.1.1/mkspecs/features/default_post.prf:
/usr/local/qt-4.1.1/mkspecs/features/warn_on.prf:
/usr/local/qt-4.1.1/mkspecs/features/qt.prf:
/usr/local/qt-4.1.1/mkspecs/features/unix/thread.prf:
/usr/local/qt-4.1.1/mkspecs/features/moc.prf:
/usr/local/qt-4.1.1/mkspecs/features/resources.prf:
/usr/local/qt-4.1.1/mkspecs/features/uic.prf:
/usr/local/qt-4.1.1/lib/libQtXml_debug.prl:
/usr/local/qt-4.1.1/lib/libQtCore_debug.prl:
/usr/local/qt-4.1.1/lib/libQtGui_debug.prl:
/usr/local/qt-4.1.1/lib/libQtNetwork_debug.prl:
qmake: FORCE
@$(QMAKE) -unix -o Makefile OMShell.pro

dist:
@$(CHK_DIR_EXISTS) ".tmp/OMShell1.0.0" || $(MKDIR) ".tmp/OMShell1.0.0"
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/OMShell1.0.0/ && $(COPY_FILE) --parents commandcompletion.h omc_communication.h omc_communicator.h omcinteractiveenvironment.h oms.h .tmp/OMShell1.0.0/ && $(COPY_FILE) --parents commandcompletion.cpp omc_communication.cc omc_communicator.cpp omcinteractiveenvironment.cpp oms.cpp main.cpp .tmp/OMShell1.0.0/ && (cd `dirname .tmp/OMShell1.0.0` && $(TAR) OMShell1.0.0.tar OMShell1.0.0 && $(COMPRESS) OMShell1.0.0.tar) && $(MOVE) `dirname .tmp/OMShell1.0.0`/OMShell1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/OMShell1.0.0


yaccclean:
lexclean:
clean:compiler_clean
-$(DEL_FILE) $(OBJECTS)
-$(DEL_FILE) *~ core *.core


####### Sub-libraries

distclean: clean
-$(DEL_FILE) $(TARGET)
-$(DEL_FILE) Makefile


/usr/local/qt-4.1.1/bin/moc:
(cd "$(QTDIR)/src/tools/moc" && $(MAKE))

mocclean: compiler_moc_header_clean compiler_moc_source_clean

mocables: compiler_moc_header_make_all compiler_moc_source_make_all

compiler_moc_header_make_all: moc_commandcompletion.cpp moc_omc_communicator.cpp moc_oms.cpp
compiler_moc_header_clean:
-$(DEL_FILE) moc_commandcompletion.cpp moc_omc_communicator.cpp moc_oms.cpp
moc_commandcompletion.cpp: commandunit.h \
commandcompletion.h \
/usr/local/qt-4.1.1/bin/moc
/usr/local/qt-4.1.1/bin/moc $(DEFINES) $(INCPATH) commandcompletion.h -o moc_commandcompletion.cpp

moc_omc_communicator.cpp: omc_communication.h \
omc_communicator.h \
/usr/local/qt-4.1.1/bin/moc
/usr/local/qt-4.1.1/bin/moc $(DEFINES) $(INCPATH) omc_communicator.h -o moc_omc_communicator.cpp

moc_oms.cpp: inputcelldelegate.h \
commandcompletion.h \
commandunit.h \
oms.h \
/usr/local/qt-4.1.1/bin/moc
/usr/local/qt-4.1.1/bin/moc $(DEFINES) $(INCPATH) oms.h -o moc_oms.cpp

compiler_rcc_make_all:
compiler_rcc_clean:
compiler_image_collection_make_all:
compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all:
compiler_uic_clean:
compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_image_collection_clean compiler_moc_source_clean compiler_uic_clean

####### Compile

commandcompletion.o: commandcompletion.cpp commandcompletion.h \
commandunit.h

omc_communication.o: omc_communication.cc omc_communication.h

omc_communicator.o: omc_communicator.cpp omc_communicator.h \
omc_communication.h

omcinteractiveenvironment.o: omcinteractiveenvironment.cpp omcinteractiveenvironment.h \
omc_communicator.h \
omc_communication.h \
inputcelldelegate.h

oms.o: oms.cpp oms.h \
inputcelldelegate.h \
commandcompletion.h \
commandunit.h \
omcinteractiveenvironment.h \
omc_communicator.h \
omc_communication.h \
otherdlg.h \
ui_OtherDlg.h

main.o: main.cpp oms.h \
inputcelldelegate.h \
commandcompletion.h \
commandunit.h

moc_commandcompletion.o: moc_commandcompletion.cpp

moc_omc_communicator.o: moc_omc_communicator.cpp

moc_oms.o: moc_oms.cpp

####### Install

install: FORCE

uninstall: FORCE

FORCE:

20 changes: 20 additions & 0 deletions OMShell/OMShell.pro
@@ -0,0 +1,20 @@
TEMPLATE = app

DEPENDPATH += .
INCLUDEPATH += /home/adrpo/dev/mico-2.3.12/include
LIBS+=-L/home/adrpo/dev/mico-2.3.12/lib -lmico2.3.12 -lssl -lcrypto -ldl -lbsd -lm -lpthread
CONFIG += warn_on
QT += network xml

HEADERS += commandcompletion.h \
omc_communication.h \
omc_communicator.h \
omcinteractiveenvironment.h \
oms.h
SOURCES += commandcompletion.cpp \
omc_communication.cc \
omc_communicator.cpp \
omcinteractiveenvironment.cpp \
oms.cpp \
main.cpp

7 changes: 4 additions & 3 deletions OMShell/commandcompletion.cpp
Expand Up @@ -58,6 +58,7 @@ licence: http://www.trolltech.com/products/qt/licensing.html
#include <exception>
#include <iostream>
#include <cstdlib>
#include <stdexcept>

//QT Headers
#include <QtCore/QFile>
Expand Down Expand Up @@ -104,7 +105,7 @@ namespace IAEX
if(!file.open(QIODevice::ReadOnly))
{
string tmp = "Could not open file: " + filename.toStdString();
throw exception( tmp.c_str() );
throw runtime_error( tmp.c_str() );
}

if( !doc_->setContent(&file) )
Expand All @@ -113,7 +114,7 @@ namespace IAEX
string tmp = "Could not read content from file: " +
filename.toStdString() +
" Probably some syntax error in the xml file";
throw exception( tmp.c_str() );
throw runtime_error( tmp.c_str() );
}
file.close();

Expand Down Expand Up @@ -387,7 +388,7 @@ namespace IAEX
void CommandCompletion::parseCommand( QDomNode node, CommandUnit *item ) const
{
if( !item )
throw exception( "ParseCommand... No ITEM set" );
throw runtime_error( "ParseCommand... No ITEM set" );

while( !node.isNull() )
{
Expand Down
6 changes: 3 additions & 3 deletions OMShell/inputcelldelegate.h
Expand Up @@ -2,7 +2,7 @@
------------------------------------------------------------------------------------
This file is part of OpenModelica.
Copyright (c) 1998-2006, Linköpings universitet,
Copyright (c) 1998-2006, Linköpings universitet,
Department of Computer and Information Science, PELAB
See also: www.ida.liu.se/projects/OpenModelica
Expand All @@ -23,7 +23,7 @@ are permitted provided that the following conditions are met:
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Linköpings universitet nor the names of its contributors
* Neither the name of Linköpings universitet nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
Expand Down Expand Up @@ -69,7 +69,7 @@ namespace IAEX
{
public:
virtual QString getResult() = 0;
virtual void evalExpression(QString &expr) = 0;
virtual void evalExpression(QString& expr) = 0;
virtual void closeConnection() = 0; // Added 2006-02-02 AF
virtual void reconnect() = 0; // Added 2006-02-09 AF
virtual bool startDelegate() = 0; // Added 2006-02-09 AF
Expand Down

0 comments on commit cbe0b20

Please sign in to comment.