Beispiel #1
0
bool
CycleTimerHelper::Start()
{
    debugOutput( DEBUG_LEVEL_VERBOSE, "Start %p...\n", this);

    if(!initValues()) {
        debugFatal("(%p) Could not init values\n", this);
        return false;
    }

    m_Thread = new Util::PosixThread(this, "CTRHLP", m_realtime, m_priority, 
                                     PTHREAD_CANCEL_DEFERRED);
    if(!m_Thread) {
        debugFatal("No thread\n");
        return false;
    }
    // register the thread with the RT watchdog
    Util::Watchdog *watchdog = m_Parent.getWatchdog();
    if(watchdog) {
        if(!watchdog->registerThread(m_Thread)) {
            debugWarning("could not register update thread with watchdog\n");
        }
    } else {
        debugWarning("could not find valid watchdog\n");
    }
    
    if (m_Thread->Start() != 0) {
        debugFatal("Could not start update thread\n");
        return false;
    }
    return true;
}
Beispiel #2
0
BlockGroupingDialog::BlockGroupingDialog( wxWindow* parent, iONode props, bool save )
{
  m_TabAlign = wxGetApp().getTabAlign();
  m_CondSel = wxNOT_FOUND;
  Create(parent, -1, wxGetApp().getMsg("blockgrouptable") );
  m_Props = props;
  m_bSave = save;
  initLabels();

  initIndex();
  if( m_Props != NULL ) {
    initValues();
    //m_Notebook->SetSelection( 1 );
    wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, ID_PANEL_LINK_GENERAL );
    wxPostEvent( this, event );
  }

  m_IndexPanel->GetSizer()->Layout();
  m_GeneralPanel->GetSizer()->Layout();
  m_PropertiesPanel->GetSizer()->Layout();
  m_ConditionsPanel->GetSizer()->Layout();
  m_Notebook->Fit();
  GetSizer()->Fit(this);
  GetSizer()->SetSizeHints(this);
}
Beispiel #3
0
PowerCtrlDlg::PowerCtrlDlg( wxWindow* parent ):powerctrlgen( parent )
{
  m_SelBooster = NULL;
  m_BoosterMap = MapOp.inst();
  m_SelectedRow = -1;
  initLabels();
  initValues(NULL);

  GetSizer()->Layout();
  GetSizer()->Fit(this);
  GetSizer()->SetSizeHints(this);

/*
  wxFont* font = new wxFont( m_TracksGrid->GetDefaultCellFont() );
  font->SetPointSize( (int)(font->GetPointSize() - 1 ) );
  m_Boosters->SetDefaultCellFont( *font );
*/
  m_Boosters->AutoSizeColumns();
  m_Boosters->AutoSizeRows();

  m_Boosters->AutoSizeColumns();
  m_Boosters->FitInside();
  GetSizer()->Layout();

  iONode ini = wxGetApp().getIni();
  iONode powerctrl = wGui.getpowerctrl(ini);
  if( powerctrl != NULL ) {
    if( wPowerCtrl.getcx(powerctrl) > 0 && wPowerCtrl.getcy(powerctrl) > 0 ) {
      SetSize(wPowerCtrl.getx(powerctrl), wPowerCtrl.gety(powerctrl), wPowerCtrl.getcx(powerctrl), wPowerCtrl.getcy(powerctrl));
    }
    else
      SetSize(wPowerCtrl.getx(powerctrl), wPowerCtrl.gety(powerctrl));
  }

}
int main(int argc, char *argv[]) {
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA | GLUT_DEPTH);
    glutInitWindowSize(800,800);
    glutInitWindowPosition(10,10);
    glutCreateWindow("Super Ellipsoid");

    glutDisplayFunc(display);
    glutKeyboardFunc(keyboard);
    glutSpecialFunc(specialKeyboard);
    glutMouseFunc(mouse);
    glutMotionFunc(mouseMotion);
    glutIdleFunc(idle);

    glutCreateMenu(displayMenu);
    glutAddMenuEntry("Increase m",1);
    glutAddMenuEntry("Decrease m",2);
    glutAddMenuEntry("Increase n",3);
    glutAddMenuEntry("Decrease n",4);
    glutAddMenuEntry("Exit",5);
    glutAttachMenu(GLUT_RIGHT_BUTTON);

    installShaders();
    setCamera();

    matrixIdentity(Projection);
    matrixPerspective(Projection,
                      40, 1.0, (GLfloat) 1, 750);

    initValues();
    glClearColor(0.0,0.0,0.0,1.0);

    glutMainLoop();
    return 0;
}
Beispiel #5
0
Camera::Camera(Field* field) {
	m_field = field;
	m_coloredWorld = ColoredWorld::getInstance();
	setTrigger(Message::MSG_CAMERA_INITIALIZED);
	setTrigger(Message::MSG_COL_PLAYER_FLY);
	initValues();
}
Beispiel #6
0
void Camera::trigger(Message msg){

	switch(msg.messageType){
	case Message::MSG_CAMERA_INITIALIZED:
		initValues();
		break;

	case Message::MSG_COL_PLAYER_FLY:
		switch(msg.additionalInfo){
		case FlyingObject::FOM_BAD:
			shakeCamera();
			setColorFilter(btVector3(1,0,0));
			Cleaner::getInstance()->deleteBody(m_colorFilter, 500);
			break;
		case FlyingObject::FOM_GOOD:
			setColorFilter(btVector3(0,1,0));
			Cleaner::getInstance()->deleteBody(m_colorFilter, 75);
			break;

		case FlyingObject::FOM_REFLECT:
//			setColorFilter(btVector3(0,0,.5));
//			Cleaner::getInstance()->deleteBody(m_colorFilter, 75);
			break;
		}
		break;
	}
}
Softwareupdates::Softwareupdates( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
    Init();
    Create(parent, -1, wxGetApp().getMsg("softwareupdates") );
    initLabels();

    m_Timer = new wxTimer( this, ME_UpdateTimer );
    m_Progress = NULL;
    m_TimerCount = 0;
    m_Ready = false;
    m_Connected = false;
    m_Release = NULL;
    m_ReleaseNode = NULL;

    checkForNew();

    bool rc = m_Timer->Start( 100, true );

    m_Progress = new wxProgressDialog(wxGetApp().getMsg( "softwareupdates" ), wxGetApp().getMsg( "searchingupdates" ), 
        2, NULL, wxPD_CAN_ABORT | wxPD_AUTO_HIDE | wxPD_APP_MODAL );

    m_Progress->ShowModal();

    initValues();

}
Beispiel #8
0
StageDlg::StageDlg( wxWindow* parent, iONode p_Props ):stagedlggen( parent )
{
  TraceOp.trc( "stagedlg", TRCLEVEL_INFO, __LINE__, 9999, "stagedlg" );
  m_TabAlign = wxGetApp().getTabAlign();
  m_Props = p_Props;
  m_Section = NULL;
  m_SortCol = 0;
  m_SortOrder = true;
  initLabels();

  m_General->GetSizer()->Layout();
  m_Sections->GetSizer()->Layout();

  m_Notebook->Fit();

  GetSizer()->Fit(this);
  GetSizer()->SetSizeHints(this);

  m_Notebook->Connect( wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( StageDlg::OnSetPage ), NULL, this );
  m_SetPage = 0;

  if( m_Props != NULL ) {
    initValues();
    m_SetPage = wxGetApp().getFrame()->isAutoMode()?2:1;
  }
  initIndex();

  wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, ID_STAGEBOOK );
  wxPostEvent( m_Notebook, event );

}
Beispiel #9
0
void BlockGroupingDialog::initIndex() {
  TraceOp.trc( "app", TRCLEVEL_INFO, __LINE__, 9999, "InitIndex" );
  m_List->Clear();

  iONode model = wxGetApp().getModel();
  if( model != NULL ) {
    iONode linklist = wPlan.getlinklist( model );
    if( linklist != NULL ) {
      int cnt = NodeOp.getChildCnt( linklist );
      for( int i = 0; i < cnt; i++ ) {
        iONode link = NodeOp.getChild( linklist, i );
        const char* id = wLink.getid( link );
        if( id != NULL ) {
          m_List->Append( wxString(id,wxConvUTF8) );
        }
      }
      if( m_Props != NULL ) {
        m_List->SetStringSelection( wxString(wLink.getid( m_Props ),wxConvUTF8) );
        m_List->SetFirstItem( wxString(wLink.getid( m_Props ),wxConvUTF8) );
        initValues();
      }

    }

  }
}
Beispiel #10
0
// ------------- setup
void EyeLinker::setup(){
    initValues();
    eye eye;
    eyes.push_back(eye);
    eyes[0].closeEyeSpeed = 0.2;
    eyes[0].openEyeSpeed = 0.2;
//    eyes[0].delay = 2;
    eyes[0].setup(pos, width, height);
    eyes[0].setEyeColor(ofColor::darkGreen);
    for (int i = 0; i < 2; i++){
        particle myParticle;
        myParticle.setInitialCondition(pos.x, pos.y ,0,0);
        particles.push_back(myParticle);
    }
    
    for (int i = 0; i < (particles.size()-1); i++){
        spring mySpring;
        mySpring.distance		= 0;
        mySpring.springiness	= 0.03f;
        mySpring.particleA = & (particles[i]);
        mySpring.particleB = & (particles[(i+1)%particles.size()]);
        springs.push_back(mySpring);
    }
    glow.load("assets/glow.png");
}
Beispiel #11
0
void WeatherDlg::onAddWeather( wxCommandEvent& event ) {
  int i = m_IndexList->FindString( _T("NEW") );
  if( i == wxNOT_FOUND ) {
    m_IndexList->Append( _T("NEW") );
    iONode model = wxGetApp().getModel();
    if( model != NULL ) {
      iONode weatherlist = wPlan.getweatherlist( model );
      if( weatherlist == NULL ) {
        weatherlist = NodeOp.inst( wWeatherList.name(), model, ELEMENT_NODE );
        NodeOp.addChild( model, weatherlist );
      }

      if( weatherlist != NULL ) {
        iONode weather = NodeOp.inst( wWeather.name(), weatherlist, ELEMENT_NODE );
        NodeOp.addChild( weatherlist, weather );
        wWeather.setid( weather, "NEW" );
        m_Props = weather;
        m_RGBWPanel->setWeather(m_Props, m_SelectedRow, m_ColorWhite->IsChecked(), m_ColorBrightness->IsChecked(), m_ColorSaturation->IsChecked(), m_ColorWhite2->IsChecked());

      }
    }
  }
  m_IndexList->SetStringSelection( _T("NEW") );
  m_IndexList->SetFirstItem( _T("NEW") );
  initValues();
  initThemeIndex();

}
Beispiel #12
0
void Tetrahedron::initTetrahedron(GLfloat x, GLfloat y, GLfloat z)
{
	this->centerX = x;
	this->centerY = y;
	this->centerZ = z;
	offsetX = 0;
	offsetY = 0;
	offsetZ = 0;
	NumVertices = 12;
	numberOfTriangles = NumVertices/3;
	vertices = new glm::vec4[4];
	points = new glm::vec4[NumVertices];
	colors = new glm::vec4[NumVertices];
	this->halfWidthExtentX = 0.5;
	this->halfWidthExtentY = 0.5;
	this->halfWidthExtentZ = 0.5;

	// Vertices of a unit Tetrahedron centered at origin, sides aligned with axes
	vertices[0] = glm::vec4( -halfWidthExtentX + centerX, -halfWidthExtentY + centerY,  halfWidthExtentZ + centerZ, 1.0 );//left
	vertices[1] = glm::vec4( halfWidthExtentX + centerX,  -halfWidthExtentY + centerY,  halfWidthExtentZ + centerZ, 1.0 );//right
	vertices[2] = glm::vec4(  0.0 + centerX,  halfWidthExtentY + centerY,  0.0 + centerZ, 1.0 );//top
	vertices[3] = glm::vec4(  0.0 + centerX, -halfWidthExtentY + centerY,  halfWidthExtentZ + centerZ, 1.0 );//back

	collider = new AABB(glm::vec3(x, y, z), halfWidthExtentX * 0.5, halfWidthExtentY, halfWidthExtentZ * 0.5);

	initValues();
}
Beispiel #13
0
RigidBody::RigidBody(float mass, Matrix3 Ibody ,
		  Vector3 position, Vector3 velocity,
		  Quaternion rotation , Vector3 angularMomentum ) {
	initValues( mass, Ibody ,
		  position, velocity,
		  rotation , angularMomentum);
}
Beispiel #14
0
void Octahedron::initOctahedron(GLfloat x, GLfloat y, GLfloat z, GLfloat halfX, GLfloat halfY, GLfloat halfZ)
{
	this->centerX = x;
	this->centerY = y;
	this->centerZ = z;
	offsetX = 0;
	offsetY = 0;
	offsetZ = 0;
	NumVertices = 24;
	numberOfTriangles = NumVertices/3;
	vertices = new glm::vec4[6];
	points = new glm::vec4[NumVertices];
	colors = new glm::vec4[NumVertices];

	this->halfWidthExtentX = halfX;
	this->halfWidthExtentY = halfY;
	this->halfWidthExtentZ = halfZ;

	// Vertices of a unit Octahedron centered at origin, sides aligned with axes
	vertices[0] = glm::vec4(  0.0 + centerX,  halfWidthExtentY + centerY,  0.0 + centerZ, 1.0 );//top
	vertices[1] = glm::vec4( -halfWidthExtentX + centerX, 0.0 + centerY,  0.0 + centerZ, 1.0 );//left
	vertices[2] = glm::vec4( 0.0 + centerX,  0.0 + centerY,  halfWidthExtentZ + centerZ, 1.0);//front
	vertices[3] = glm::vec4( halfWidthExtentX + centerX, 0.0 + centerY, 0.0 + centerZ, 1.0);//right
	vertices[4] = glm::vec4(  0.0 + centerX, 0.0 + centerY,  -halfWidthExtentZ + centerZ, 1.0 );//back
	vertices[5] = glm::vec4(0.0 + centerX, -halfWidthExtentY + centerY, 0.0 + centerZ, 1.0);//bottom
	
	collider = new AABB(glm::vec3(x, y, z), 0.5, 0.5, 0.5);

	initValues();
}
DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, D_PAD* aPad ) :
    DIALOG_PAD_PROPERTIES_BASE( aParent ),
    m_OrientValidator( 1, &m_OrientValue )
{
    m_canUpdate  = false;
    m_parent     = aParent;
    m_currentPad = aPad;        // aPad can be NULL, if the dialog is called
                                // from the footprint editor to set default pad setup

    m_board      = m_parent->GetBoard();

    m_OrientValidator.SetRange( -360.0, 360.0 );
    m_PadOrientCtrl->SetValidator( m_OrientValidator );
    m_OrientValidator.SetWindow( m_PadOrientCtrl );

    m_padMaster  = &m_parent->GetDesignSettings().m_Pad_Master;
    m_dummyPad   = new D_PAD( (MODULE*) NULL );

    if( aPad )
        *m_dummyPad = *aPad;
    else    // We are editing a "master" pad, i.e. a template to create new pads
        *m_dummyPad = *m_padMaster;

    // Show the X and Y axis. It is usefull because pad shape can have an offset
    // or be a complex shape.
    m_axisOrigin = new KIGFX::ORIGIN_VIEWITEM( KIGFX::COLOR4D(0.0, 0.0, 0.8, 1.0),
                                               KIGFX::ORIGIN_VIEWITEM::CROSS,
                                               Millimeter2iu( 0.2 ),
                                               VECTOR2D( m_dummyPad->GetPosition() ) );
    m_axisOrigin->SetDrawAtZero( true );

    if( m_parent->IsGalCanvasActive() )
    {
        m_panelShowPadGal->UseColorScheme( m_board->GetColorsSettings() );
        m_panelShowPadGal->SwitchBackend( m_parent->GetGalCanvas()->GetBackend() );
        m_panelShowPadGal->Show();
        m_panelShowPad->Hide();
        m_panelShowPadGal->GetView()->Add( m_dummyPad );
        m_panelShowPadGal->GetView()->Add( m_axisOrigin );
        m_panelShowPadGal->StartDrawing();
        Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_PAD_PROPERTIES::OnResize ) );
    }
    else
    {
        m_panelShowPad->Show();
        m_panelShowPadGal->Hide();
    }

    initValues();
    TransferDataToWindow();

    m_sdbSizerOK->SetDefault();
    m_PadNumCtrl->SetFocus();
    m_canUpdate = true;

    FixOSXCancelButtonIssue();

    // Now all widgets have the size fixed, call FinishDialogSettings
    FinishDialogSettings();
}
Beispiel #16
0
ECoSCtrlDialog::ECoSCtrlDialog( wxWindow* parent, iONode props, const char* devices )
{
  Create(parent, -1, wxString::From8BitData(wDigInt.getlib(props)).Upper());
  m_Props = props;
  m_Devices = devices;
  initLabels();
  initValues();

  if( StrOp.equals( wDigInt.mcs2, wDigInt.getlib( m_Props ) ) || StrOp.equals( wDigInt.mgbox, wDigInt.getlib( m_Props ) ) ) {
    m_Port->Enable(false);
    this->SetTitle( _T("CS2") );
    if( wDigInt.getmcs2(m_Props) == NULL ) {
      iONode mcs2 = NodeOp.inst(wMCS2.name(), m_Props, ELEMENT_NODE);
      NodeOp.addChild(m_Props, mcs2);
    }
  }
  else {
    m_FBMod->Enable(false);
    m_Discovery->Enable(false);
    m_SLCAN->Enable(false);
  }

  GetSizer()->Fit(this);
  GetSizer()->SetSizeHints(this);

  GetSizer()->Layout();
}
void VolumeBarLogic::openConnection (bool init)
{
    /*
     * Check the connection first, maybe this function
     * only called because of lost connection
     */
    if ((dbus_conn != NULL) && (dbus_connection_get_is_connected (dbus_conn)))
        return;

    DBusError dbus_err;
    char *pa_bus_address = getenv ("PULSE_DBUS_SERVER");

    if (pa_bus_address == NULL)
        pa_bus_address = (char *) DEFAULT_ADDRESS;

    dbus_error_init (&dbus_err);

    dbus_conn = dbus_connection_open (pa_bus_address, &dbus_err);

    DBUS_ERR_CHECK (dbus_err);

    if (dbus_conn != NULL) {
        dbus_connection_setup_with_g_main (dbus_conn, NULL);

        dbus_connection_add_filter (
            dbus_conn,
            (DBusHandleMessageFunction) VolumeBarLogic::stepsUpdatedSignal,
            (void *) this, NULL);

        if (init == true)
            initValues ();
    }
}
InternalGraph::InternalGraph(unsigned int nodes, unsigned int stores, unsigned int vm, unsigned int st, // request set and network parameters
                             std::vector<unsigned long> & res, // current physical resources capacity
                             std::vector<unsigned long> & cap, // maximum physical resources capacity
                             std::vector<unsigned long> & ramRes, // current virtual machine memory capacity
                             std::vector<unsigned long> & ramCap, // maximum virtual machine memory capacity
                             std::vector<unsigned long> & ramReq, // amount of memory requested by virtual machines
                             std::vector<unsigned long> & req, // resources demanded by requests
                             std::vector<unsigned int> & types, // physical store types
                             std::vector<unsigned int> & reqTypes, // virtual storage types
                             std::vector<Element *> & pn, // pointers to physical nodes
                             std::vector<Element *> & ps, // pointers to physical stores
                             std::vector<Element *> & virtElems // pointer to virtual requests
                             )
: nodesNum(nodes)
, storesNum(stores)
, vmNum(vm)
, stNum(st)
, heurDeg(0)
, pherDeg(0)
{
    srand((unsigned)time(NULL));
//    srand(2);

    GraphComponent::heurCalc = new MoreResourceFirst(0);
    if (!init(res, cap, ramRes, ramCap, req, ramReq, reqTypes, pn, ps, virtElems)) success = false;
    else
    {
        success = true;
        initValues(req, types);
    }
}
Beispiel #19
0
ToursDlg::ToursDlg( wxWindow* parent, iONode tour, bool save, const char* startblock )
  :toursdlggen( parent )
{
  m_Props = tour;
  m_bSave = save;
  m_StartBlock = startblock;
  m_StartBlockID->SetValue((startblock==NULL)?_T(""):wxString(startblock,wxConvUTF8));

  initLabels();
  initIndex();
  initScheduleCombo();

  m_IndexPanel->GetSizer()->Layout();
  m_SchedulesPanel->GetSizer()->Layout();

  m_TourBook->Fit();
  m_TourBook->SetSelection(0);

  GetSizer()->Fit(this);
  GetSizer()->SetSizeHints(this);

  m_TourList->SetFocus();

  if( m_Props != NULL ) {
    initValues();
  }

}
Beispiel #20
0
void ToursDlg::onAddTour( wxCommandEvent& event ) {
  int i = m_TourList->FindString( _T("NEW") );
  if( i == wxNOT_FOUND ) {
    m_TourList->Append( _T("NEW") );
    iONode model = wxGetApp().getModel();
    if( model != NULL ) {
      iONode tourlist = wPlan.gettourlist( model );
      if( tourlist == NULL ) {
        tourlist = NodeOp.inst( wTourList.name(), model, ELEMENT_NODE );
        NodeOp.addChild( model, tourlist );
      }

      if( tourlist != NULL ) {
        iONode tour = NodeOp.inst( wTour.name(), tourlist, ELEMENT_NODE );
        NodeOp.addChild( tourlist, tour );
        wTour.setid( tour, "NEW" );
        m_Props = tour;
      }
    }
  }
  m_TourList->SetStringSelection( _T("NEW") );
  m_TourList->SetFirstItem( _T("NEW") );
  initValues();

}
DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, D_PAD* aPad ) :
    DIALOG_PAD_PROPERTIES_BASE( aParent ),
    // use aParent's parent, which is the original BOARD, not the dummy module editor BOARD,
    // since FOOTPRINT_EDIT_FRAME::GetDesignSettings() is tricked out to use the PCB_EDIT_FRAME's
    // BOARD, not its own BOARD.
    m_padMaster( aParent->GetDesignSettings().m_Pad_Master )
{
    m_canUpdate  = false;
    m_parent     = aParent;
    m_currentPad = aPad;
    m_board      = m_parent->GetBoard();
    m_dummyPad   = new D_PAD( (MODULE*) NULL );

    if( aPad )
        m_dummyPad->Copy( aPad );
    else
        m_dummyPad->Copy( &m_padMaster );

    initValues();

    m_sdbSizer1OK->SetDefault();
    GetSizer()->SetSizeHints( this );

    m_PadNumCtrl->SetFocus();
    m_canUpdate = true;
}
Beispiel #22
0
void StageDlg::onIndexNew( wxCommandEvent& event ) {
  int i = findID("NEW");
  if( i == wxNOT_FOUND ) {
    iONode model = wxGetApp().getModel();
    if( model != NULL ) {
      iONode sblist = wPlan.getsblist( model );
      if( sblist == NULL ) {
        sblist = NodeOp.inst( wStageList.name(), model, ELEMENT_NODE );
        NodeOp.addChild( model, sblist );
      }
      if( sblist != NULL ) {
        iONode stage = NodeOp.inst( wStage.name(), sblist, ELEMENT_NODE );
        NodeOp.addChild( sblist, stage );
        wStage.setid( stage, "NEW" );
        wStage.setx( stage, 0 );
        wStage.sety( stage, 0 );
        wStage.setz( stage, 0 );
        m_Props = stage;
        initValues();
        initIndex();
        setSelection(wStage.getid( stage ));
      }
    }
  }
}
Beispiel #23
0
ActionsCtrlDlg::ActionsCtrlDlg( wxWindow* parent, iONode node, const char* states )
{
  Init();
  Create(parent, -1, wxGetApp().getMsg("actionctrl"));

  m_Props = node;
  m_iCursel = wxNOT_FOUND;
  m_iCurCondsel = wxNOT_FOUND;

  initLabels();

  SetTitle(wxGetApp().getMsg("actionctrl") + wxT(": ") + wxString(wItem.getid(m_Props), wxConvUTF8));

  m_ConditionsPanel->Enable(false);

  initIndex(-1);
  initValues();

  m_IndexPanel->GetSizer()->Layout();
  m_ConditionsPanel->GetSizer()->Layout();

  m_Notebook->Fit();

  GetSizer()->Fit(this);
  GetSizer()->SetSizeHints(this);
  GetSizer()->Layout();

  if( states != NULL ) {
    iOStrTok tok = StrTokOp.inst(states, ',');
    while( StrTokOp.hasMoreTokens(tok) ) {
      m_State->Append( wxString( StrTokOp.nextToken(tok), wxConvUTF8 ) );
    }
    StrTokOp.base.del(tok);
  }
}
Beispiel #24
0
void ConfigCenter::onConfigFileValue(const StringVector& path, 
		       const std::string& sectArg,
		       const std::string& value,
				     bool adding,
				     const ConfigFilePosInfo& pos)
{
  assert(!path.empty());
  if (path[0] == "repo")
    {
      if (trim(sectArg).empty())
	throw NotImplementedException("Empty configuration file section argument");
      ConfRepoVector::size_type i = 0;
      while(i < m_root.repo.size() && m_root.repo[i].name != sectArg)
	i++;
      if (i >= m_root.repo.size())
	{
	  m_root.repo.push_back(ConfRepo(sectArg));
	  m_stringValues.clear();
	  m_stringListValues.clear();
	  m_booleanValues.clear();
	  m_uintValues.clear();
	  initValues();
	  initRepoValues();
	  initProvideValues();
	}
    }
  if (path[0] == "provide")
    {
      if (trim(sectArg).empty())
	throw NotImplementedException("Empty configuration file section argument");
      ConfProvideVector::size_type i = 0;
      while(i < m_root.provide.size() && m_root.provide[i].name != sectArg)
	i++;
      if (i >= m_root.provide.size())
	{
	  m_root.provide.push_back(ConfProvide(sectArg));
	  m_stringValues.clear();
	  m_stringListValues.clear();
	  m_booleanValues.clear();
	  m_uintValues.clear();
	  initValues();
	  initRepoValues();
	  initProvideValues();
	}
    }
  ConfigAdapter::onValue(path, sectArg, value, adding, pos);
}
Beispiel #25
0
void StageDlg::onStageList( wxListEvent& event ) {
  int index = event.GetIndex();
  m_Props = (iONode)m_StageList->GetItemData(index);
  if( m_Props != NULL )
    initValues();
  else
    TraceOp.trc( "stagedlg", TRCLEVEL_INFO, __LINE__, 9999, "no selection..." );
}
Beispiel #26
0
void AccDecDlg::onSelected( wxListEvent& event ) {
    int index = event.GetIndex();
    m_Props = (iONode)m_IndexList->GetItemData(index);
    if( m_Props != NULL )
        initValues();
    else
        TraceOp.trc( "accdecdlg", TRCLEVEL_INFO, __LINE__, 9999, "no selection..." );
}
Beispiel #27
0
ShotgunPellet::ShotgunPellet(glm::vec3 position, glm::vec3 direction, int pID, int bID, int tID)
{
    type = BULLET_TYPE::SHOTGUN_PELLET;
    initValues(position, direction, pID, bID, tID);
    vel = glm::vec3(95.0f);
    damage = 5;
    maxttl = ttl = 0.4f;
}
Beispiel #28
0
Sphere::Sphere(GLdouble x, GLdouble y, GLdouble z, GLfloat rad, GLfloat r, GLfloat g, GLfloat b, GLfloat alpha){
  initValues();//Init predef values
  //We Give the new values
  _posX = x, _posZ = z;
  setPosY(y);
  _radius = rad;
  _arrayColor[0] = r, _arrayColor[1] = g, _arrayColor[2] = b,_arrayColor[3] = alpha;
}
Beispiel #29
0
void VariableDlg::onListSelected( wxListEvent& event ) {
  int index = event.GetIndex();
  m_Props = (iONode)m_VarList->GetItemData(index);
  if( m_Props != NULL )
    initValues();
  else
    TraceOp.trc( "vardlg", TRCLEVEL_INFO, __LINE__, 9999, "no selection..." );
}
Beispiel #30
0
/*!
 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_LINK_ADD_COND
 */
void BlockGroupingDialog::OnButtonLinkAddCondClick( wxCommandEvent& event )
{
  iONode cond = NodeOp.inst(wLinkCond.name(), m_Props, ELEMENT_NODE);
  NodeOp.addChild( m_Props, cond );
  wLinkCond.setfirst(cond, m_CondFrom->GetStringSelection().mb_str(wxConvUTF8));
  wLinkCond.setfree(cond, m_CondFree->GetValue().mb_str(wxConvUTF8));
  initValues();
}