Skip to content
Snippets Groups Projects
Select Git revision
  • ec74fd44e38e849cf0d26b18a71fe96c9723fc25
  • master default
  • cgnsUnstructured
  • partitioning
  • poppler
  • HighOrderBLCurving
  • gmsh_3_0_4
  • gmsh_3_0_3
  • gmsh_3_0_2
  • gmsh_3_0_1
  • gmsh_3_0_0
  • gmsh_2_16_0
  • gmsh_2_15_0
  • gmsh_2_14_1
  • gmsh_2_14_0
  • gmsh_2_13_2
  • gmsh_2_13_1
  • gmsh_2_12_0
  • gmsh_2_11_0
  • gmsh_2_10_1
  • gmsh_2_10_0
  • gmsh_2_9_3
  • gmsh_2_9_2
  • gmsh_2_9_1
  • gmsh_2_9_0
  • gmsh_2_8_6
26 results

LuaBindings.h

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    onelabWindow.cpp 48.13 KiB
    // Gmsh - Copyright (C) 1997-2012 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // bugs and problems to <gmsh@geuz.org>.
    
    #include <FL/Fl.H>
    #include "GmshConfig.h"
    #include "GmshMessage.h"
    
    #if defined(HAVE_ONELAB)
    #include "onelab.h"
    #endif
    
    #if defined(HAVE_ONELAB) && (FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 3)
    
    #include <FL/Fl_Check_Button.H>
    #include <FL/Fl_Box.H>
    #include <FL/Fl_Input_Choice.H>
    #include <FL/Fl_Output.H>
    #include <FL/fl_ask.H>
    #include "inputRange.h"
    #include "Context.h"
    #include "GModel.h"
    #include "GmshDefines.h"
    #include "Options.h"
    #include "OS.h"
    #include "StringUtils.h"
    #include "OpenFile.h"
    #include "CreateFile.h"
    #include "drawContext.h"
    #include "PView.h"
    #include "PViewData.h"
    #include "PViewOptions.h"
    #include "FlGui.h"
    #include "paletteWindow.h"
    #include "menuWindow.h"
    #include "fileDialogs.h"
    #include "onelabWindow.h"
    
    // This file contains the Gmsh/FLTK specific parts of the OneLab
    // interface. You'll need to reimplement this if you plan to build
    // a different OneLab server.
    
    class onelabGmshServer : public GmshServer{
     private:
      onelab::localNetworkClient *_client;
     public:
      onelabGmshServer(onelab::localNetworkClient *client)
        : GmshServer(), _client(client) {}
      ~onelabGmshServer(){}
      int NonBlockingSystemCall(const char *str){ return SystemCall(str); }
      int NonBlockingWait(int socket, double waitint, double timeout)
      {
        double start = GetTimeInSeconds();
        while(1){
          if(timeout > 0 && GetTimeInSeconds() - start > timeout)
            return 2; // timout
          if(_client->getPid() < 0 || (_client->getExecutable().empty() &&
                                       !CTX::instance()->solver.listen))
            return 1; // process has been killed or we stopped listening
          // check if there is data (call select with a zero timeout to
          // return immediately, i.e., do polling)
          int ret = Select(0, 0, socket);
          if(ret == 0){ // nothing available
            // if asked, refresh the onelab GUI
            std::vector<onelab::string> ps;
            onelab::server::instance()->get(ps, "Gmsh/Action");
            if(ps.size() && ps[0].getValue() == "refresh"){
              ps[0].setVisible(false);
              ps[0].setValue("");