diff --git a/Web/coolprop/wrappers/LibreOffice/TestLibreOfficePy.ods b/Web/coolprop/wrappers/LibreOffice/TestLibreOfficePy.ods new file mode 100644 index 00000000..51d0e48a Binary files /dev/null and b/Web/coolprop/wrappers/LibreOffice/TestLibreOfficePy.ods differ diff --git a/Web/coolprop/wrappers/LibreOffice/coolprop.py b/Web/coolprop/wrappers/LibreOffice/coolprop.py new file mode 100644 index 00000000..5943eef4 --- /dev/null +++ b/Web/coolprop/wrappers/LibreOffice/coolprop.py @@ -0,0 +1,16 @@ + +from CoolProp import CoolProp as cp +from CoolProp import __version__ as cpv +from CoolProp import __fluids__ as cpf +from sys import version + +def cpversion(): + return cpv + +def props(cp1,cp2,cp3,cp4,cp5,cp6): + return cp.Props(cp1,cp2,cp3,cp4,cp5,cp6) + +"""if __name__=='__main__': + print props('P','T',300,'Q',1,'Propane') + + """ diff --git a/Web/coolprop/wrappers/LibreOffice/index.rst b/Web/coolprop/wrappers/LibreOffice/index.rst index 44263c69..a4af8431 100644 --- a/Web/coolprop/wrappers/LibreOffice/index.rst +++ b/Web/coolprop/wrappers/LibreOffice/index.rst @@ -5,8 +5,32 @@ LibreOffice Wrapper ******************* +Windows using DLL (shared library) +---------------------------------- + A very simple example can be found here: :download:`TestLibreOffice.ods`. You will need to download the release 32-bit __stdcall shared library for windows from :sfdownloads:`sourceforge ` or from :bbbinaries:`the development server `. Place the downloaded DLL in c:\\CoolProp -.. warning:: - - This only works on windows. There is currently no easy way to call shared libraries from linux or OSX. +Linux using python +------------------ + +1. You will need two files - :download:`coolprop.py` and :download:`TestLibreOfficePy.ods` + +2. At the command prompt do something like:: + + # Make a folder for the script to reside in + mkdir -p ~/.config/libreoffice/4/user/Scripts/python/ + # Copy the dowloaded .py file to the folder you made (adjust download path as necessary) + cp ~/Downloads/coolprop.py ~/.config/libreoffice/4/user/Scripts/python/ + + # Install python script provider (uses python 3) + sudo apt-get install libreoffice-script-provider-python + # pyton scripting in LibreOffice uses python3, make sure we populate the right python site-packages folder + sudo apt-get install python3-pip + sudo pip3 install Cython + # Compile CoolProp v5+ manually + # you need to have numpy and matplotlib already - you can do sudo apt-get install python3-matplotlib + git clone http://github.com/CoolProp/CoolProp --recursive + cd CoolProp/wrappers/Python + sudo python3 setup.py install + +3. Open example in LibreOffice \ No newline at end of file