/*!***************************************************************************** ******************************************************************************* \note init_user_openGL \date July 1998 \remarks initializes everything needed for the graphics for this simulation ******************************************************************************* Function Parameters: [in]=input,[out]=output \param[in] argc : number of elements in argv \param[in] argv : array of argc character strings ******************************************************************************/ int init_user_openGL(int argc, char** argv) { int i,j,n; int rc; int ans; // we need the kinematics initialized init_kinematics(); // read objects readObjects(config_files[OBJECTS]); // assign contact force mappings #include "LEKin_contact.h" // create simulation windows if (!createWindows()) return FALSE; // user graphics addToUserGraphics("phantom","Display a phantom robot", displayPhantom,(N_CART+N_QUAT+n_dofs)*sizeof(float)); addToMan("comsDisplay","toggle drawing COMs per link",toggleCOMsDisplay); return TRUE; }
void initGui(ProgramData *programData, Context*** context) { guiDataChanged = 0; guiProgramData = programData; guiContext = context; cbreak(); noecho(); curs_set(0); keypad(stdscr, TRUE); createWindows(); createMenus(); refresh(); touchwin(mainMenuWin); touchwin(dataWinBox); touchwin(dataWin); touchwin(sflResultWin); touchwin(opmodeMenuWin); touchwin(spectraMenuWin); touchwin(spectraOpMenuWin); touchwin(sflCoeffMenuWin); touchwin(invariantTypesMenuWin); touchwin(invariantsMenuWinScr); touchwin(invariantsMenuWinRng); touchwin(invariantsMenuWinBmsk); touchwin(textMin); touchwin(textMax); touchwin(textFirst); touchwin(textMask); wrefresh(mainMenuWin); wrefresh(dataWinBox); wrefresh(dataWin); wrefresh(sflResultWin); wrefresh(opmodeMenuWin); wrefresh(spectraMenuWin); wrefresh(spectraOpMenuWin); wrefresh(sflCoeffMenuWin); wrefresh(invariantTypesMenuWin); wrefresh(invariantsMenuWinScr); wrefresh(invariantsMenuWinRng); wrefresh(invariantsMenuWinBmsk); mvprintw(0,0, " Software Analyzer v%d.%d.%d", VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION); mvprintw(1,0, " Delft University of Technology"); guiState = GUI_STATE_MAIN; }
/*! */ DebugMessageWindow::DebugMessageWindow( QWidget * parent, MainData & main_data ) : QMainWindow( parent ) , M_main_data( main_data ) { this->setWindowTitle( tr( "Debug Message" ) ); int i = -1; M_debug_text[++i] = tr( "System" ); M_debug_text[++i] = tr( "Sensor" ); M_debug_text[++i] = tr( "WM" ); M_debug_text[++i] = tr( "Action" ); M_debug_text[++i] = tr( "Intercept" ); M_debug_text[++i] = tr( "Kick" ); M_debug_text[++i] = tr( "Hold" ); M_debug_text[++i] = tr( "Dribble" ); M_debug_text[++i] = tr( "Pass" ); M_debug_text[++i] = tr( "Cross" ); M_debug_text[++i] = tr( "Shoot" ); M_debug_text[++i] = tr( "Clear" ); M_debug_text[++i] = tr( "Block" ); M_debug_text[++i] = tr( "Mark" ); M_debug_text[++i] = tr( "Position" ); M_debug_text[++i] = tr( "Role" ); M_debug_text[++i] = tr( "Plan" ); M_debug_text[++i] = tr( "Team" ); M_debug_text[++i] = tr( "Comm" ); M_debug_text[++i] = tr( "Analyzer" ); M_debug_text[++i] = tr( "ActChain" ); createActions(); createMenus(); createWindows(); readSettings(); this->resize( 800, 800 ); #ifndef Q_WS_MAC this->setWindowFlags( this->windowFlags() | Qt::WindowStaysOnTopHint ); #endif }
void VCSQtManager::createCanvases() { #ifndef __APPLE__ if (VCSQtManager::app()==NULL) { static char *argv[] = {"qpython"}; VCSSecondaryThread *thrd = new VCSSecondaryThread(1, argv); thrd->start(); } #endif if (VCSQtManager::owningApp()) { VCSQtManager::sendEvent(VCSQtManager::app(), new QDeferredExecutionEvent((void*)createWindows)); } else { // We are not owning the main app, so create the windows and move // them to the main thread createWindows(); for (size_t i=0; i<sizeof(pMainWindows)/sizeof(MainWindow*); i++) pMainWindows[i]->moveToThread(VCSQtManager::app()->thread()); } }
/*!***************************************************************************** ******************************************************************************* \note initSimulation \date July 1998 \remarks initializes everything needed for the simulation. ******************************************************************************* Function Parameters: [in]=input,[out]=output \param[in] argc : number of elements in argv \param[in] argv : array of argc character strings ******************************************************************************/ int initSimulation(int argc, char** argv) { int i,j,n; int rc; int ans; /* initialize the servos */ init_task_servo(); /* the first servo sets the sampling rate in collect data */ read_whichDOFs("task_sim_servo"); init_motor_servo(); read_whichDOFs("motor_sim_servo"); init_vision_servo(); read_whichDOFs("vision_sim_servo"); init_invdyn_servo(); read_whichDOFs("invdyn_sim_servo"); /* we need the dynamics initalized */ init_dynamics(); /* user specific tasks */ initUserTasks(); /* create simulation windows */ if (!createWindows()) return FALSE; /* reset motor_servo variables */ servo_enabled = 1; motor_servo_calls = 0; servo_time = 0; motor_servo_rate = SERVO_BASE_RATE; zero_integrator(); bzero((char *)&(joint_sim_state[1]),sizeof(SL_DJstate)*N_DOFS); for (i=1; i<=N_DOFS; ++i) { joint_sim_state[i].th = joint_default_state[i].th; joint_des_state[i].th = joint_default_state[i].th; } /* reset task_servo variables */ servo_enabled = 1; task_servo_calls = 0; task_servo_time = 0; task_servo_errors = 0; task_servo_rate = SERVO_BASE_RATE/(double) task_servo_ratio; setTaskByName(NO_TASK); setDefaultPosture(); changeCollectFreq(task_servo_rate); /* reset vision servo variables */ servo_enabled = 1; vision_servo_calls = 0; vision_servo_time = 0; vision_servo_errors = 0; vision_servo_rate = VISION_SERVO_RATE; /* initialize all vision variables to safe values */ init_vision_states(); init_learning(); /* reset the invdyn servo variables */ servo_enabled = 1; invdyn_servo_errors = 0; invdyn_lookup_data = 0; invdyn_learning_data = 0; /* initalize objects in the environment */ readObjects(); /* assign contact force mappings */ #include "LEKin_contact.h" initContacts(); return TRUE; }
void DemoKeeper::notifyEventAction(MainPanel::TypeEvents _action, size_t _index) { if (_action == MainPanel::EventQuit) { quit(); } else if (_action == MainPanel::EventNew) { removeRenderBoxes(); destroyWindows(); mEditorWindow->clearView(); } else if (_action == MainPanel::EventLoad) { createWindows(); } else if (_action == MainPanel::EventCreate) { MyGUI::Widget* view = mEditorWindow->getView(); const MyGUI::IntCoord& coord = view->getClientCoord(); if (_index == 0) { const MyGUI::IntSize size(80, 80); MyGUI::Window* window = view->createWidget<MyGUI::Window>(MyGUI::WidgetStyle::Overlapped, "WindowCS", MyGUI::IntCoord(getRand(0, coord.width - size.width), getRand(0, coord.height - size.height), size.width, size.height), MyGUI::Align::Default); window->setCaption("Frame"); window->setMinSize(size); } else if (_index == 1) { const MyGUI::IntSize size(180, 15); MyGUI::ScrollBar* scroll = view->createWidget<MyGUI::ScrollBar>("ScrollBarH", MyGUI::IntCoord(getRand(0, coord.width - size.width), getRand(0, coord.height - size.height), size.width, size.height), MyGUI::Align::Default); scroll->setScrollRange(200); scroll->setScrollPosition(10); scroll->setScrollPage(1); scroll->setScrollViewPage(20); } else if (_index == 2) { const MyGUI::IntSize size(15, 180); MyGUI::ScrollBar* scroll = view->createWidget<MyGUI::ScrollBar>("ScrollBarV", MyGUI::IntCoord(getRand(0, coord.width - size.width), getRand(0, coord.height - size.height), size.width, size.height), MyGUI::Align::Default); scroll->setScrollRange(200); scroll->setScrollPosition(10); scroll->setScrollPage(1); scroll->setScrollViewPage(20); } else if (_index == 3) { const MyGUI::IntSize size(80, 26); MyGUI::TextBox* text = view->createWidget<MyGUI::TextBox>("TextBox", MyGUI::IntCoord(getRand(0, coord.width - size.width), getRand(0, coord.height - size.height), size.width, size.height), MyGUI::Align::Default); text->setCaption("TextBox"); } else if (_index == 4) { const MyGUI::IntSize size(50, 50); MyGUI::ImageBox* image = view->createWidget<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(getRand(0, coord.width - size.width), getRand(0, coord.height - size.height), size.width, size.height), MyGUI::Align::Default); image->setImageTexture("HelpIcon.png"); } else if (_index == 5) { const MyGUI::IntSize size(150, 150); MyGUI::Window* window = view->createWidget<MyGUI::Window>(MyGUI::WidgetStyle::Overlapped, "WindowC", MyGUI::IntCoord(getRand(0, coord.width - size.width), getRand(0, coord.height - size.height), size.width, size.height), MyGUI::Align::Default); window->setCaption("Render"); MyGUI::Canvas* canvas = window->createWidget<MyGUI::Canvas>("Canvas", MyGUI::IntCoord(0, 0, window->getClientCoord().width, window->getClientCoord().height), MyGUI::Align::Stretch); createRenderBox(canvas); } } }