Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feature/angular17u…
Browse files Browse the repository at this point in the history
…pdate
  • Loading branch information
Rdmkr committed Nov 27, 2023
2 parents 9441c96 + 467cbc7 commit f4ab492
Show file tree
Hide file tree
Showing 74 changed files with 1,451 additions and 907 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.exe
*.xcd
*.rcd
*.tcd
*~
*.aux
*.dvi
Expand Down
2 changes: 1 addition & 1 deletion Compiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Dependencies
* gmake
* boost 1.66.0 or later
* json_spirit (for older versions of Minsky, more recent versions have git submoduled json5_parser, so json_spirit is not needed)
* jtanx's libclipboard
* [jtanx's libclipboard](https://github.com/jtanx/libclipboard)
* TCL/Tk
* cairo
* pango
Expand Down
36 changes: 19 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,17 @@ ifneq ($(MAKECMDGOALS),clean)
ifeq ($(OS),Darwin)
NODE_HEADER=/usr/local/include/node
else
NODE_VERSION=$(shell node -v|sed -E -e 's/[^0-9]*([0-9]*).*/\1/')
ifdef MXE
NODE_HEADER=/usr/include/node$(NODE_VERSION)
NODE_API+=node-api.o
else
ifeq ($(OS),CYGWIN)
NODE_API+=node-api.o
endif
NODE_HEADER=$(call search,include/node$(NODE_VERSION))
ifeq ($(NODE_HEADER),) # Ubuntu stashes node headers at /usr/include/nodejs
NODE_HEADER=$(call search,include/node)
endif
endif
ifeq ($(OS),CYGWIN)
NODE_API+=node-api.o
endif
NODE_VERSION=$(shell node -v|sed -E -e 's/[^0-9]*([0-9]*).*/\1/')
nsearch=$(firstword $(foreach dir,$(DIRS) /usr,$(wildcard $(dir)/$(1))))
NODE_HEADER=$(call nsearch,include/node$(NODE_VERSION))
ifeq ($(NODE_HEADER),) # Ubuntu stashes node headers at /usr/include/nodejs, also if node version doesn't match, create a link in your include search path (eg ~/usr/include/node
NODE_HEADER=$(call nsearch,include/node)
endif
endif
# if we haven't found an installed version of the Node SDK, then
Expand Down Expand Up @@ -122,8 +121,8 @@ PREFIX=/usr/local
# custom one that picks up its scripts from a relative library
# directory
MODLINK=$(LIBMODS:%=$(ECOLAB_HOME)/lib/%)
MODEL_OBJS=autoLayout.o cairoItems.o canvas.o CSVDialog.o dataOp.o godleyIcon.o godleyTable.o godleyTableWindow.o godleyTab.o grid.o group.o item.o itemTab.o intOp.o lasso.o lock.o minsky.o operation.o operationRS.o operationRS1.o operationRS2.o panopticon.o phillipsDiagram.o plotTab.o plotWidget.o port.o ravelWrap.o renderNativeWindow.o selection.o sheet.o SVGItem.o switchIcon.o userFunction.o userFunction_units.o variableInstanceList.o variable.o variablePane.o windowInformation.o wire.o
ENGINE_OBJS=coverage.o clipboard.o derivative.o equationDisplay.o equations.o evalGodley.o evalOp.o flowCoef.o \
MODEL_OBJS=autoLayout.o cairoItems.o canvas.o CSVDialog.o dataOp.o equationDisplay.o godleyIcon.o godleyTable.o godleyTableWindow.o godleyTab.o grid.o group.o item.o itemTab.o intOp.o lasso.o lock.o minsky.o operation.o operationRS.o operationRS1.o operationRS2.o panopticon.o phillipsDiagram.o plotTab.o plotWidget.o port.o ravelWrap.o renderNativeWindow.o selection.o sheet.o SVGItem.o switchIcon.o userFunction.o userFunction_units.o variableInstanceList.o variable.o variablePane.o windowInformation.o wire.o
ENGINE_OBJS=coverage.o clipboard.o derivative.o equationDisplayRender.o equations.o evalGodley.o evalOp.o flowCoef.o \
godleyExport.o latexMarkup.o valueId.o variableValue.o node_latex.o node_matlab.o CSVParser.o \
minskyTensorOps.o mdlReader.o saver.o rungeKutta.o
SCHEMA_OBJS=schema3.o schema2.o schema1.o schema0.o schemaHelper.o variableType.o \
Expand Down Expand Up @@ -237,11 +236,14 @@ EXE=.exe
DL=dll
FLAGS+=-D_WIN32 -DUSE_UNROLLED -Wa,-mbig-obj
# DLLS that need to be copied into the binary directory
MXE_DLLS=libboost_filesystem-mt-x64 libboost_thread-mt-x64 libbz2 libcairo-2 libcroco-0 libcrypto-3-x64 libexpat-1 \
libffi-7 libfontconfig-1 libfreetype-6 libfribidi-0 libgcc_s_seh-1 libgdk_pixbuf-2 libgio-2 libglib-2 libgmodule-2 \
libgobject-2 libgsl-25 libgslcblas-0 libharfbuzz-0 libiconv-2 libintl-8 libjpeg-9 liblzma-5 libpango-1 libpangocairo-1 \
libpangoft2-1 libpangowin32-1 libpcre-1 libpixman-1-0 libpng16-16 libreadline8 librsvg-2-2 libssl-3-x64 libstdc++-6 \
libtermcap libwinpthread-1 libxml2-2 tcl86 zlib1
MXE_DLLS=libboost_filesystem-mt-x64 libboost_thread-mt-x64 \
libbrotlidec libbrotlicommon libbz2 libcairo-2 libcroco-0 libcrypto-3-x64 \
libexpat-1 libffi libfontconfig-1 libfreetype-6 libfribidi-0 libgcc_s_seh-1 \
libgdk_pixbuf-2 libgio-2 libglib-2 libgmodule-2 \
libgobject-2 libgsl-25 libgslcblas-0 libharfbuzz-0 libiconv-2 libintl-8 \
libjpeg-9 liblzma-5 libpango-1 libpangocairo-1 libpangoft2-1 libpangowin32-1 \
libpcre-1 libpixman-1-0 libpng16-16 libreadline8 librsvg-2-2 libssl-3-x64 \
libstdc++-6 libtermcap libwinpthread-1 libxml2-2 tcl86 zlib1
BINDIR=$(subst bin,$(MXE_PREFIX)/bin,$(dir $(shell which $(CPLUSPLUS))))
$(warning $(BINDIR))
DLLS=$(wildcard $(MXE_DLLS:%=$(BINDIR)/%*.dll))
Expand Down
20 changes: 6 additions & 14 deletions RESTService/RESTService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,23 @@ using namespace std;
#include <readline/history.h>
#endif

using namespace minsky;
RESTMinsky rminsky;

namespace minsky
{
namespace
{
Minsky* l_minsky=NULL;
}

Minsky& minsky()
{
static Minsky s_minsky;
if (l_minsky)
return *l_minsky;
return s_minsky;
return rminsky;
}

LocalMinsky::LocalMinsky(Minsky& minsky) {l_minsky=&minsky;}
LocalMinsky::~LocalMinsky() {l_minsky=NULL;}
LocalMinsky::LocalMinsky(Minsky& minsky) {}
LocalMinsky::~LocalMinsky() {}

// GUI callback needed only to solve linkage problems
void doOneEvent(bool idleTasksOnly) {}
}

using namespace minsky;

RESTMinsky rminsky;

string toREST(string x)
{
Expand Down
16 changes: 13 additions & 3 deletions RESTService/addon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,21 @@ namespace minsky

Value queueCommand(Env env, string command, const json_pack_t& arguments)
{
// TODO use string::endsWith when we change our C++ standard
auto syncPos=command.rfind(".$sync");
bool sync=syncPos==command.size()-6;
bool sync=syncPos!=string::npos && syncPos==command.size()-6;
if (sync)
{
command.erase(syncPos);
// Javascript needs the result returned as UTF-16.
return String::New(env, utf_to_utf<char16_t>(doCommand(command, arguments)));
}
#ifdef _WIN32
// renderFrame needs to be called synchronously, otherwise inexplicable hangs occur on Windows.
syncPos=command.rfind(".renderFrame");
if (syncPos!=string::npos && syncPos==command.size()-12)
return String::New(env, utf_to_utf<char16_t>(doCommand(command, arguments)));
#endif
lock_guard<mutex> lock(cmdMutex);
minskyCommands.emplace_back(new Command{env,command,arguments});
return minskyCommands.back()->promiseResolver->promise.Promise();
Expand Down Expand Up @@ -225,8 +232,11 @@ namespace minsky
try
{
lock_guard<mutex> lock(minskyCmdMutex);
LocalMinsky lm(*this); // sets this to be the global minsky object
reset();
if (reset_flag()) // check again, in case another thread got there first
{
LocalMinsky lm(*this); // sets this to be the global minsky object
reset();
}
}
catch (...)
{flags&=~reset_needed;}
Expand Down
8 changes: 8 additions & 0 deletions RESTService/node-api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ extern "C"
napi_callback cb, void* data, napi_value* result),
(env,utf8name,length,cb,data,result));

NAPIFN(napi_create_object, (napi_env env, napi_value* result), (env,result));

NAPIFN(napi_add_finalizer, (napi_env env, napi_value js_object, void* native_object,
napi_finalize finalize_cb, void* finalize_hint, napi_ref* result),
(env,js_object,native_object,finalize_cb,finalize_hint,result));
Expand Down Expand Up @@ -198,6 +200,12 @@ extern "C"
napi_threadsafe_function_call_mode is_blocking),
(func,data,is_blocking));
NAPIFN(napi_add_env_cleanup_hook, (napi_env env, void (*fun)(void* arg), void* arg), (env,fun,arg));

NAPIFN(napi_has_property, (napi_env env, napi_value object, napi_value key, bool* result),
(env, object, key, result));

NAPIFN(napi_get_property,(napi_env env, napi_value object, napi_value key, napi_value* result),
(env, object, key, result));
}


7 changes: 7 additions & 0 deletions RESTService/typescriptAPI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "dataOp.tcd"
#include "dimension.tcd"
#include "engNotation.tcd"
#include "equationDisplay.tcd"
#include "evalGodley.tcd"
#include "eventInterface.tcd"
#include "fontDisplay.tcd"
Expand Down Expand Up @@ -44,6 +45,7 @@
#include "panopticon.tcd"
#include "phillipsDiagram.tcd"
#include "plot.tcd"
#include "plotOptions.tcd"
#include "plotTab.tcd"
#include "plotWidget.tcd"
#include "polyRESTProcessBase.tcd"
Expand Down Expand Up @@ -96,6 +98,10 @@ namespace classdesc_access
template <>
struct access_typescriptAPI<std::vector<civita::any>>:
public classdesc::NullDescriptor<classdesc::typescriptAPI_t> {};

template <class T>
struct access_typescriptAPI<minsky::Optional<T>>:
public classdesc::NullDescriptor<classdesc::typescriptAPI_t> {};
}

namespace classdesc
Expand Down Expand Up @@ -248,6 +254,7 @@ int main()
api.addClass<DataSpecSchema>();
api.addClass<ecolab::Plot::LineStyle>();
api.addClass<EngNotation>();
api.addClass<EventInterface>();
api.addClass<GroupItems>();
api.addClass<HandleLockInfo>();
api.addClass<PannableTab<EquationDisplay>>();
Expand Down
2 changes: 1 addition & 1 deletion RavelCAPI
Submodule RavelCAPI updated 3 files
+13 −7 Makefile
+1 −1 civita
+1 −1 ravelRelease.h
2 changes: 1 addition & 1 deletion ecolab
Submodule ecolab updated 2 files
+2 −0 include/Makefile
+62 −13 src/plot.cc
Loading

0 comments on commit f4ab492

Please sign in to comment.