Exemple #1
0
void export_ramen()
{
	bpy::object package = bpy::scope();
	package.attr("__path__") = "_ramen";
	
	export_param();
	export_parameterised();
	export_manipulable();
	export_manipulator();
	export_node();
	export_composition();
	export_anim();
	export_roto();
	export_ui();
	export_image();
	export_python();

	// util modules
	export_gl();

	export_SeExpr();
	export_expressions();
}
Exemple #2
0
void  perhapsDoAction()
{
  FILE *fout;
  char buf[2*MAXOPT_DEVELOP];
  int ret = 0;

  if(opt_develop.arg_action[0]=='\0') return;
  if(opt_develop.arg_project[0]=='\0')
  {
    printf("no project given\n");
    usage();
  }
  if(strcmp(opt_develop.arg_action,"writeInitialProject") == 0)
  {
    generateInitialProject(opt_develop.arg_project);
    sprintf(buf,"qmake=%s",opt_develop.arg_project);
    action(buf);
  }
  else if(strcmp(opt_develop.arg_action,"insertMask") == 0)
  {
    sprintf(buf,"insertMask=%s",opt_develop.arg_project);
    action(buf);
  }
  else if(strcmp(opt_develop.arg_action,"make") == 0)
  {
    action("make");
  }
  else if(strcmp(opt_develop.arg_action,"makeModbus") == 0)
  {
    gmodbus("modbusdaemon.mkmodbus");
#ifdef PVUNIX
    ret = system("g++ -c modbusdaemon.cpp -o modbusdaemon.o -I/opt/pvb/rllib/lib  ; g++ modbusdaemon.o /usr/lib/librllib.so -lpthread -o modbusdaemon");
#else
    ret = system("start pvb_make_modbusdaemon.bat");
#endif
  }
  else if(strcmp(opt_develop.arg_action,"makeSiemensTCP") == 0)
  {
    gsiemens("siemensdaemon.mksiemens");
#ifdef PVUNIX
    ret = system("g++ -c siemensdaemon.cpp -o siemensdaemon.o -I/opt/pvb/rllib/lib  ; g++ siemensdaemon.o /usr/lib/librllib.so -lpthread -o siemensdaemon");
#else
    ret = system("start pvb_make_siemensdaemon.bat");
#endif
  }
  else if(strcmp(opt_develop.arg_action,"makePPI") == 0)
  {
    gppi("ppidaemon.mkppi");
#ifdef PVUNIX
    ret = system("g++ -c ppidaemon.cpp -o ppidaemon.o -I/opt/pvb/rllib/lib  ; g++ ppidaemon.o /opt/pvb/rllib/lib/nodave.o /opt/pvb/rllib/lib/setport.o /usr/lib/librllib.so -lpthread -o ppidaemon");
#else
    ret = system("start pvb_make_ppidaemon.bat");
#endif
  }
  else if(strcmp(opt_develop.arg_action,"uncommentRLLIB") == 0)
  {
    sprintf(buf,"%s.pro",opt_develop.arg_project);
    uncommentRllib(buf);
  }
  else if(strcmp(opt_develop.arg_action,"uncommentModbus") == 0)
  {
    uncommentModbus();
  }
  else if(strcmp(opt_develop.arg_action,"uncommentSiemensTCP") == 0)
  {
    uncommentSiemenstcp();
  }
  else if(strcmp(opt_develop.arg_action,"uncommentPPI") == 0)
  {
    uncommentPpi();
  }
  else if(strcmp(opt_develop.arg_action,"writeStartscript") == 0)
  {
    ret = writeStartscript(".", opt_develop.arg_project);
  }
  else if(strncmp(opt_develop.arg_action,"writeDimension:",15) == 0)
  {
    int xmax, ymax;

    xmax = 1280;
    ymax = 1024;
    sscanf(opt_develop.arg_action,"writeDimension:%d:%d",&xmax,&ymax);
    sprintf(buf,"%s.pvproject",opt_develop.arg_project);
    fout = fopen(buf,"w");
    if(fout == NULL)
    {
      printf("could not write %s\n",buf);
      exit(-1);
    }
    fprintf(fout,"target=%s\n",opt_develop.arg_project);
    fprintf(fout,"xmax=%d\n",xmax);
    fprintf(fout,"ymax=%d\n",ymax);

    // add additional language here
    if(opt_develop.script == PV_PYTHON)
    {
      fprintf(fout,"script=Python\n");
    }
    if(opt_develop.script == PV_PERL)
    {
      fprintf(fout,"script=PERL\n");
    }
    if(opt_develop.script == PV_PHP)
    {
      fprintf(fout,"script=PHP\n");
    }
    if(opt_develop.script == PV_TCL)
    {
      fprintf(fout,"script=Tcl\n");
    }
    if(opt_develop.script == PV_LUA)
    {
      fprintf(fout,"script=Lua\n");
    }
    fclose(fout);
  }
  else if(strncmp(opt_develop.arg_action,"importUi:",9) == 0)
  {
    if(strncmp(opt_develop.arg_action,"importUi:mask",13) == 0)
    {
      sscanf(opt_develop.arg_action,"importUi:mask%d", &opt_develop.arg_mask_to_generate);
    }
    else
    {
      const char *cptr = &opt_develop.arg_action[9];
      if(isdigit(*cptr))
      {
        sscanf(cptr,"%d",&opt_develop.arg_mask_to_generate);
      }
      else
      {
        cptr = strstr(cptr,"mask");
        if(cptr != NULL)
        {
          sscanf(cptr,"mask%d",&opt_develop.arg_mask_to_generate);
        }
      }
    }  
    if(opt_develop.arg_mask_to_generate > 0)
    {
      char maskname[80];
      sprintf(maskname,"mask%d", opt_develop.arg_mask_to_generate);
      Designer *designer = new Designer(maskname);
      sprintf(maskname,"mask%d.ui", opt_develop.arg_mask_to_generate);
      importUi(maskname, designer);
      delete designer;
#ifdef PVUNIX
      action("make");
#endif
    }
    else printf("error: arg_mask_to_generate <= 0\n");
  }
  else if(strncmp(opt_develop.arg_action,"exportUi:",9) == 0)
  {
    if(strncmp(opt_develop.arg_action,"exportUi:mask",13) == 0)
    {
      sscanf(opt_develop.arg_action,"exportUi:mask%d", &opt_develop.arg_mask_to_generate);
    }
    else
    {
      const char *cptr = &opt_develop.arg_action[9];
      if(isdigit(*cptr))
      {
        sscanf(cptr,"%d",&opt_develop.arg_mask_to_generate);
      }
      else
      {
        cptr = strstr(cptr,"mask");
        if(cptr != NULL)
        {
          sscanf(cptr,"mask%d",&opt_develop.arg_mask_to_generate);
        }
      }
    }  
    if(opt_develop.arg_mask_to_generate > 0)
    {
      printf("ATTENTION: You are not allowed to export an ui file, define a layout management in Qt Designer and import the ui file again to pvdevelop\n");
      printf("           You must define a possible layout management within pvdevelop instead.\n");
      export_ui(opt_develop.arg_mask_to_generate);
    }
    else printf("error: arg_mask_to_generate <= 0\n");
  }
  else if(strncmp(opt_develop.arg_action,"designerUi:",11) == 0)
  {
    if(strncmp(opt_develop.arg_action,"designerUi:mask",15) == 0)
    {
      sscanf(opt_develop.arg_action,"designerUi:mask%d", &opt_develop.arg_mask_to_generate);
    }
    else
    {
      const char *cptr = &opt_develop.arg_action[11];
      if(isdigit(*cptr))
      {
        sscanf(cptr,"%d",&opt_develop.arg_mask_to_generate);
      }
      else
      {
        cptr = strstr(cptr,"mask");
        if(cptr != NULL)
        {
          sscanf(cptr,"mask%d",&opt_develop.arg_mask_to_generate);
        }
      }
    }  
    if(opt_develop.arg_mask_to_generate > 0)
    {
      char maskname[80];
      sprintf(maskname,"mask%d", opt_develop.arg_mask_to_generate);
      Designer *designer = new Designer(maskname);
      sprintf(maskname,"mask%d.ui", opt_develop.arg_mask_to_generate);
      printf("ATTENTION: You are not allowed to export an ui file, define a layout management in Qt Designer and import the ui file again to pvdevelop\n");
      printf("           You must define a possible layout management within pvdevelop instead.\n");
      export_ui(opt_develop.arg_mask_to_generate);
      char cmd[1024];
#ifdef PVWIN32      
      sprintf(cmd,"wait \"%%QTDIR%%\\bin\\designer.exe\" %s", maskname);
      mysystem(cmd);
#else      
      sprintf(cmd,"designer %s", maskname);
      system(cmd);
#endif      
      importUi(maskname, designer);
      delete designer;
#ifdef PVUNIX
      action("make");
#endif
      printf("ATTENTION: You are not allowed to export an ui file, define a layout management in Qt Designer and import the ui file again to pvdevelop\n");
      printf("           You must define a possible layout management within pvdevelop instead.\n");
    }
    else printf("error: arg_mask_to_generate <= 0\n");
  }
  else if(strcmp(opt_develop.arg_action,"dumpTranslations") == 0)
  {
    action("dumpTranslations");
  }
  else
  {
    printf("unknown action\n");
    usage();
  }
  if(ret != 0)
  {
    printf("error\n");
  }
  exit(0);
}