Пример #1
0
bool SimManager::is_done() {
  bool done = sim_done || timeout();
  if(done && !sim_done) {
    set_done();
  }
  return done;
}
Пример #2
0
int PluginDialogShared::handle_event()
{ 
//	dialog->attach_shared(get_selection_number(0, 0)); 
//	deactivate();
	set_done(0); 
	return 1;
}
Пример #3
0
string Light::elaborate_triggers(string triggers, libxbee::XBee* xbee,  libxbee::Con* con)
{
    cout<<"elaborate triggers di Light"<<endl;
    std::list<std::string> state_list;
    state_list = this->split(triggers,'_');
    std::list<std::string>::iterator it = state_list.begin();
    while(it != state_list.end())
    {
        std::string state = *it;
        int value = std::atoi(state.c_str());
        if(!strcmp(state.c_str(),"on"))
        {
            cout<<"Light::elaborate_triggers() value è >1 accendo"<<value<<endl;         
            this->turnon(xbee,con);
        }else if(!strcmp(state.c_str(),"off")){
        cout<<"Light::elaborate_triggers() value è 0 spengo"<<value<<endl;
        this->turnoff(xbee,con);
        }
        it++;
    }
    
    
    
    set_done();
    return triggers;
}
Пример #4
0
static_param_command_t::static_param_command_t( param_set_t& pset, const std::string& id) : undo::command_t( "Param Changed"), pset_( pset)
{
    id_ = id;
    set_done( true);
    param_t& p = pset_.find( id_);
    old_value_ = p.value();
}
Пример #5
0
	~ThreadProcessor() {
		set_done();
		cond_.notify_all();
		//actors_.interrupt_all();
		actors_.join_all();

	}
Пример #6
0
int PluginDialogModules::handle_event()
{ 
//	dialog->attach_module(get_selection_number(0, 0)); 
//	deactivate();

	set_done(0); 
	return 1;
}
Пример #7
0
int SynthWindow::keypress_event()
{
	if(ctrl_down() && get_keypress() == 'w')
	{
		set_done(1);
		return 1;
	}
	return 0;
}
Пример #8
0
int BatchRenderGUI::close_event()
{
// Stop batch rendering
	unlock_window();
	thread->stop_rendering();
	lock_window("BatchRenderGUI::close_event");
	set_done(1);
	return 1;
}
Пример #9
0
int BC_FileBox::keypress_event()
{
	switch(get_keypress())
	{
		case 'w':
			if(ctrl_down()) set_done(1);
			return 1;
			break;
	}
	return 0;
}
Пример #10
0
    bool start()
    {
        /*update_display_message("Connecting to patch server...");

        thread = boost::thread(patch_thread);*/

		update_display_message("Welcome to VTank. Click \"PLAY\" to begin.");
		set_progress(100);
		set_done(true);

        return true;
    }
Пример #11
0
image_input_command_t::image_input_command_t( image::input_node_t& node, int proxy_level) : undo::command_t( "Param changed"), node_( node)
{
	proxy_level_ = proxy_level;
	old_clip_ = node.clips()[proxy_level_];
	
	if( proxy_level_ == 0)
	{
		channels_ = node.get_channels();
		aspect_ = node.get_aspect_param_value();
	}
	
    set_done( true);
}
Пример #12
0
BOOL WINAPI ConsoleHandler(DWORD dwType)
{
    switch(dwType) {
    case CTRL_CLOSE_EVENT:
    case CTRL_LOGOFF_EVENT:
    case CTRL_SHUTDOWN_EVENT:

        set_done();//signal the main thread to terminate

        //Returning would make the process exit!
        //We just make the handler sleep until the main thread exits,
        //or until the maximum execution time for this handler is reached.
        Sleep(10000);

        return TRUE;
    default:
        break;
    }
    return FALSE;
}
Пример #13
0
string Device::elaborate_triggers(string triggers,libxbee::XBee* xbee,  libxbee::Con* con)
{
    cout<<"elaborate triggers di Device"<<endl;
    std::list<std::string> state_list;
    state_list = this->split(triggers,'_');
    std::list<std::string>::iterator it = state_list.begin();
    while(it != state_list.end())
    {
        string value = *it;
        cout<<"elaborate triggers is doing something with value:"<<value<<endl;        
        it++;
    }

     Xbee_com *p;
                p->xbee_get_atid(*xbee,*con);
    
    set_done();
    
    return triggers;
    
}
Пример #14
0
int usb_close(int usb_number)
{
  struct usb_state* state = usb_states+usb_number;

  if(state->devh)
  {
    if(state->type == C_TYPE_XONE_PAD)
    {
      unsigned char power_off[] = { 0x05, 0x20, 0x00, 0x01, 0x04 };
      usb_send_interrupt_out_sync(usb_number, power_off, sizeof(power_off));
    }

    cancel_transfers();//TODO MLA: selective cancels

    libusb_release_interface(state->devh, controller[state->type].interface);
#if !defined(LIBUSB_API_VERSION) && !defined(LIBUSBX_API_VERSION)
#ifndef WIN32
    libusb_attach_kernel_driver(state->devh, 0);
#endif
#endif
    libusb_close(state->devh);
    state->devh = NULL;
    --nb_opened;
    if(!nb_opened)
    {
      libusb_free_device_list(devs, 1);
      devs = NULL;
      if(ctx) {
        libusb_exit(ctx);
        ctx = NULL;
      }
    }
  }

  set_done();

  return 1;
}
Пример #15
0
int QuestionYesButton::handle_event()
{
	set_done(2);
}
Пример #16
0
int YUVConfigVideo::close_event()
{
	set_done(0);
	return 1;
}
Пример #17
0
int VorbisConfigAudio::close_event()
{
	set_done(0);
	return 1;
}
Пример #18
0
int AC3ConfigAudio::close_event()
{
	set_done(0);
	return 1;
}
Пример #19
0
int BC_FileBox::close_event()
{
	set_done(1);
	return 1;
}
Пример #20
0
void terminate(int sig)
{
    set_done();
}
Пример #21
0
int EditPopupTitleWindow::close_event()
{
	set_done(1);
	return 1;
}
Пример #22
0
int ReverbLoadDialog::cancel_event()
{
    set_done(1);
    return 0;
}
Пример #23
0
int QuestionNoButton::handle_event()
{
	set_done(0);
}
Пример #24
0
int ReverbSaveDialog::ok_event()
{
    set_done(0);
    return 0;
}
Пример #25
0
int CreateDVD_GUI::close_event()
{
        set_done(1);
        return 1;
}
Пример #26
0
	int close_event()
	{
		set_done(0);
		return 1;
	};
Пример #27
0
int ReFrameWindow::close_event()
{
	set_done(0);
	return 1;
}
Пример #28
0
int ReverbLoadDialog::ok_event()
{
    set_done(0);
    return 0;
}
Пример #29
0
int SvgWin::close_event()
{
	set_done(1);
	return 1;
}
Пример #30
0
/*
 * Use keys to calibrate the mouse.
 */
void cal_key(int device_id, int sym, int down)
{
  s_mouse_control* mc = cfg_get_mouse_control(current_mouse);
  e_current_cal prev = current_cal;

  switch (sym)
  {
    case GE_KEY_LEFTCTRL:
      lctrl = down ? 1 : 0;
      break;
    case GE_KEY_RIGHTCTRL:
      rctrl = down ? 1 : 0;
      break;

    case GE_KEY_LEFTSHIFT:
      lshift = down ? 1 : 0;
      break;
    case GE_KEY_RIGHTSHIFT:
      rshift = down ? 1 : 0;
      break;

    case GE_KEY_LEFTALT:
      lalt = down ? 1 : 0;
      break;
    case GE_KEY_RIGHTALT:
      ralt = down ? 1 : 0;
      break;
  }

  switch (sym)
  {
    case GE_KEY_ESC:
      if(current_cal != NONE)
      {
        current_cal = NONE;
      }
      if(lshift)
      {
        set_done();
      }
      break;
    case GE_KEY_F1:
      if (down)
      {
        if(rctrl || lctrl)
        {
          if (current_cal == NONE)
          {
            if(GE_GetMKMode() == GE_MK_MODE_MULTIPLE_INPUTS)
            {
              current_cal = MC;
              gprintf(_("mouse selection\n"));
            }
            else
            {
              current_cal = CC;
              gprintf(_("config selection\n"));
            }
          }
          else
          {
            current_cal = NONE;
            if (cfgw_modify_file(gimx_params.config_file))
            {
              gprintf(_("error writting the config file %s\n"), gimx_params.config_file);
            }
            gprintf(_("calibration done\n"));
          }
        }
        else if(current_cal != NONE)
        {
          if(GE_GetMKMode() == GE_MK_MODE_MULTIPLE_INPUTS)
          {
            current_cal = MC;
            gprintf(_("mouse selection\n"));
          }
        }
      }
      break;
    case GE_KEY_F2:
      if (down && current_cal != NONE)
      {
        current_cal = CC;
        gprintf(_("config selection\n"));
      }
      break;
    case GE_KEY_F9:
      if (down && current_cal != NONE)
      {
        gprintf(_("calibrating sensitivity\n"));
        current_cal = MX;
      }
      break;
    case GE_KEY_F12:
      if (down && current_cal != NONE)
      {
        gprintf(_("calibrating x/y ratio\n"));
        current_cal = MY;
      }
      break;
    case GE_KEY_F3:
      if (down && current_cal != NONE)
      {
        gprintf(_("calibrating dead zone x\n"));
        current_cal = DZX;
        mc->merge_x[mc->index] = 1;
        mc->merge_y[mc->index] = 0;
        mc->change = 1;
      }
      break;
    case GE_KEY_F4:
      if (down && current_cal != NONE)
      {
        gprintf(_("calibrating dead zone y\n"));
        current_cal = DZY;
        mc->merge_x[mc->index] = 0;
        mc->merge_y[mc->index] = 1;
        mc->change = 1;
      }
      break;
    case GE_KEY_F5:
      if (down && current_cal != NONE)
      {
        gprintf(_("calibrating dead zone shape\n"));
        current_cal = DZS;
        mc->merge_x[mc->index] = 1;
        mc->merge_y[mc->index] = 1;
        mc->change = 1;
      }
      break;
    case GE_KEY_F7:
      if (down && current_cal != NONE)
      {
        gprintf(_("calibrating acceleration x\n"));
        current_cal = EX;
      }
      break;
    case GE_KEY_F8:
      if (down && current_cal != NONE)
      {
        gprintf(_("calibrating acceleration y\n"));
        current_cal = EY;
      }
      break;
    case GE_KEY_F10:
      if (down && current_cal != NONE)
      {
        if(current_cal != RD && current_cal != VEL)
        {
          circle_step = 0;
        }
        gprintf(_("adjusting circle test radius\n"));
        current_cal = RD;
      }
      break;
    case GE_KEY_F11:
      if (down && current_cal != NONE)
      {
        if(current_cal != RD && current_cal != VEL)
        {
          circle_step = 0;
        }
        gprintf(_("adjusting circle test velocity\n"));
        current_cal = VEL;
      }
      break;
    case GE_KEY_F6:
      if (down && current_cal != NONE)
      {
        if(current_cal != TEST)
        {
          distance = 0.1; //0.1 inches
          dots = 0;
          direction = 1;
          step = 1;
        }
        gprintf(_("translation test started\n"));
        current_cal = TEST;
      }
      break;
  }

  if(prev != current_cal)
  {
    if(gimx_params.curses)
    {
      display_calibration();
    }
    else
    {
      cal_display();
    }
  }

  /*
   * Following code is not calibration code... it should be moved somewhere else!
   */
  if (lshift && rshift)
  {
    if (gimx_params.status)
    {
      gimx_params.status = 0;
    }
    else
    {
      if(!gimx_params.curses)
      {
        gimx_params.status = 1;
      }
    }
  }

  if (lalt && ralt)
  {
    GE_grab_toggle();
  }
}