//------------------------------------------------------------------------------ // RunScriptFolderDialog(wxWindow *parent, int numScripts, Real absTol, // const wxString &compareStr) //------------------------------------------------------------------------------ RunScriptFolderDialog::RunScriptFolderDialog(wxWindow *parent, int numScripts, Real absTol, const wxString &compareDir) : GmatDialog(parent, -1, wxT("RunScriptFolderDialog"), NULL, wxDefaultPosition, wxSize(100, 100)) { mRunScripts = false; mCompareResults = false; mSaveCompareResults = false; mOutDirChanged = false; mCreateRunFolder = false; mNumScriptsToRun = numScripts; mNumTimesToRun = 1; mAbsTol = absTol; mCompareDir = compareDir; mFilterString = wxT(""); mReplaceString = wxT("GMAT"); Create(); ShowData(); }
//------------------------------------------------------------------------------ // ThrusterCoefficientDialog(wxWindow *parent, wxWindowID id, // const wxString &title, GmatBase *obj,Integer numCoefs, // const RealArray &coefs1, const RealArray &coefs2); //------------------------------------------------------------------------------ ThrusterCoefficientDialog:: ThrusterCoefficientDialog(wxWindow *parent, wxWindowID id, const wxString &title, GmatBase *obj, Integer numCoefs, const RealArray &coefs1, const RealArray &coefs2) : GmatDialog(parent, id, title, obj, wxDefaultPosition, wxDefaultSize) { theObject = obj; isElectric = theObject->IsOfType("ElectricThruster"); coefsCount = numCoefs; coefs1Modified = false; coefs2Modified = false; coefs1Names.clear(); coefs2Names.clear(); coefs1Values.clear(); coefs2Values.clear(); coefs1Values = coefs1; coefs2Values = coefs2; #ifdef DEBUG_COEFS MessageInterface::ShowMessage("In TCD constructor, size of 1st coefs array is %d\n", (Integer) coefs1Values.size()); for (unsigned int ii = 0; ii < coefs1Values.size(); ii++) MessageInterface::ShowMessage("coefs1Values[%d] = %lf\n", ii, coefs1Values.at(ii)); MessageInterface::ShowMessage("In TCD constructor, size of K coefs array is %d\n", (Integer) coefs2Values.size()); for (unsigned int ii = 0; ii < coefs2Values.size(); ii++) MessageInterface::ShowMessage("coefs2Values[%d] = %lf\n", ii, coefs2Values.at(ii)); #endif if (obj != NULL) { Create(); ShowData(); } }
/* ****************************************************************** */ void function_menu() { uint8_t ii; uint8_t func_number; #ifdef PAGE_MODE uint8_t page_nr; uint8_t p_nr; uint8_t ff; page_nr = MODE_LAST; #ifdef WITH_ROTARY_SWITCH rotary.count = 0; #endif #endif func_number = 0; message_key_released(SELECTION_str); #ifdef POWER_OFF uint8_t ll; for (ll=0;ll<((MODE_LAST+1)*10);ll++) #else while (1) /* without end, if no power off specified */ #endif { if (func_number > MODE_LAST) func_number -= (MODE_LAST + 1); #if (LCD_LINES > 3) uint8_t mm; #ifdef PAGE_MODE ff = 0; mm = 0; do { p_nr = page_nr + mm; if (p_nr > MODE_LAST) p_nr -= (MODE_LAST + 1); if (func_number == p_nr) ff = 1; // number is found } while (++mm < MENU_LINES); if (ff == 0) { // func_number is not in page list #ifdef WITH_ROTARY_SWITCH if (rotary.count >= 0) { page_nr = (func_number + MODE_LAST -1); // page_nr = func_number - 2 } else { page_nr = func_number; // for backward, set page_nr to func_number } if (page_nr > MODE_LAST) page_nr -= (MODE_LAST + 1); #else page_nr = func_number; #endif } mm= 0; do { p_nr = page_nr + mm; if (p_nr > MODE_LAST) p_nr -= (MODE_LAST + 1); lcd_set_cursor((mm+1)*PAGES_PER_LINE,0); if (func_number == p_nr) { lcd_data('>'); } else { lcd_space(); // put a blank to 1. row of line 2 } message2line(p_nr); // show page function } while (++mm < MENU_LINES); #else /* no PAGE_MODE */ uint8_t f_nr; mm = 0; do { lcd_set_cursor((mm+1)*PAGES_PER_LINE,0); if (mm == MENU_MIDDLE) { lcd_data('>'); // put a '>' marker to row 1 of line 4 } else { lcd_space(); // put a blank to 1. row of line 2 } f_nr = func_number + MODE_LAST + 1 - MENU_MIDDLE + mm; if (f_nr > MODE_LAST) f_nr -= (MODE_LAST +1); message2line(f_nr); // show function for this line } while (++mm < MENU_LINES); #endif /* PAGE_MODE */ #else /* not LCD_LINES > 3 */ lcd_line2(); message2line(func_number); #endif /* (LCD_LINES > 3) */ #ifdef POWER_OFF ii = wait_for_key_ms(SHORT_WAIT_TIME); // wait about 5 seconds if (ii > 0) ll = 0; // reset timer, operator present if (DC_Pwr_mode == 1) ll = 0; #else ii = wait_for_key_ms(0); // wait endless #endif #ifdef WITH_ROTARY_SWITCH if ((ii >= MIN_SELECT_TIME) || ((rotary_switch_present != 0) && (ii > 0))) #else if (ii >= MIN_SELECT_TIME) #endif { // selection only with key-press if (func_number == MODE_TRANS) break; // return to TransistorTester if (func_number == MODE_FREQ) GetFrequency(0); #if PROCESSOR_TYP == 644 if (func_number == MODE_HFREQ) GetFrequency(1); // measure high frequency with 16:1 divider if (func_number == MODE_H_CRYSTAL) GetFrequency(5); // HF crystal input + 16:1 divider if (func_number == MODE_L_CRYSTAL) GetFrequency(6); // LF crystal input, 1:1 divider #endif if (func_number == MODE_FGEN) { make_frequency(); // make some sample frequencies } if (func_number == MODE_PWM) { do_10bit_PWM(); // generate 10bit PWM } if (func_number == MODE_ESR) { show_C_ESR(); // measure capacity and ESR at TP1 and TP3 } if (func_number == MODE_RESIS) { show_Resis13(); // measure resistor at TP1 and TP3 } if (func_number == MODE_CAP13) { lcd_clear(); show_Cap13(); // measure capacitor at TP1 and TP3 } if (func_number == MODE_ROTARY) { CheckRotaryEncoder(); // check rotary encoder } if (func_number == MODE_BIG_CAP_CORR) { set_big_cap_corr(); } #ifdef WITH_SELFTEST if (func_number == MODE_SELFTEST) AutoCheck(0x11); // Full selftest with calibration #endif if (func_number == MODE_VEXT) show_vext(); #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306) || (LCD_ST_TYPE == 8812) || (LCD_ST_TYPE == 8814) || defined(LCD_DOGM)) if (func_number == MODE_CONTRAST) set_contrast(); #endif if (func_number == MODE_SHOW) { ShowData(); // Show Calibration Data } if (func_number == MODE_OFF) { ON_PORT &= ~(1<<ON_PIN); //switch off power wait_for_key_ms(0); //never ending loop } // don't increase function number for easier selection the same function ii = 0; // function was executed before, do not increase func_number #ifdef WITH_ROTARY_SWITCH rotary.incre = 0; // reset all rotary information rotary.count = 0; #endif message_key_released(SELECTION_str); //write Line 1 with Selection: } /* end if (ii >= MIN_SELECT_TIME) */ #ifdef WITH_ROTARY_SWITCH if (rotary.incre >= FAST_ROTATION) break; // to much rotation #ifdef POWER_OFF if (rotary.count != 0) ll = 0; // someone is working, reset timer #endif if (rotary.count >= 0) { func_number += rotary.count; // function number is increased by rotary steps } else { func_number += (MODE_LAST + 1 + rotary.count); // function is decreased by rotary steps } #endif if (ii > 0) func_number++; // increase the function number with key press } /* end for ll */ return; } // end function_menu()
/*---------------------------------------------------------------------------*/ void wxSQLBook::ExecQuery(const wxString& sql, bool explain, bool history) { try { try { if (m_db->GetAutoCommit() && m_AutoTransact) { m_db->ExecuteUpdate(("BEGIN TRANSACTION;")); m_LogResult->AppendText(_("Started transaction.\n")); } } catch(wxSQLite3Exception& ex) { m_LogResult->AppendText(wxString::Format(_("Error %i-%i : %s\n"), ex.GetErrorCode(), ex.GetExtendedErrorCode(), ex.GetMessage().c_str())); ShowLog(); } int countrows = 0; m_Hook->Clear(); wxSQLite3ResultSet resultSet; wxSQLite3Statement statement = m_db->PrepareStatement(sql); if (statement.GetParamCount()) { wxString param, value; int count = statement.GetParamCount(); wxSQLParametersDialog paramsdlg(this); for (int i = 0; i < count; i++) { param = statement.GetParamName(i + 1); value = wxGetApp().GetSQLParameter(param); paramsdlg.AddParameter(param, value); } if (paramsdlg.ShowModal() == wxID_OK) { for (int i = 0; i < count; i++) { param = statement.GetParamName(i + 1); value = paramsdlg.GetParameter(i); wxGetApp().SetSQLParameter(param, value); statement.Bind(i + 1, value); } } else { statement.Finalize(); return; } resultSet = statement.ExecuteQuery(); } else resultSet = m_db->ExecuteQuery(ToUTF8(sql)); DisplayHookValues(); countrows = resultSet.GetColumnCount(); wxSpecGrid* grid; if (explain) grid = m_Explain; else grid = m_DataResult; if (countrows) { grid->SetTable(&g_EmptyTable); grid->ForceRefresh(); wxGridSQLite3Table* table = new wxGridSQLite3Table(&resultSet); wxColour oddColour(wxGetApp().GetParamStr(PARAM_ODDROWCOLOR)); table->SetAttrProvider(new OddRowsGridCellAttrProvider(oddColour)); grid->SetTable((wxGridTableBase*)table, true); table->AdaptColumnsSize(); grid->SetDefaultSelection(); //grid->SetSelectionMode(wxGrid::wxGridSelectRows); grid->ForceRefresh(); if (explain) ShowExplain(); else ShowData(); } else if (m_Hook->GetNbRowDeleted() || m_Hook->GetNbRowInserted() || m_Hook->GetNbRowUpdated()) ShowLog(); resultSet.Finalize(); statement.Finalize(); if (history) wxGetApp().AddHistory(sql); } catch(wxSQLite3Exception& ex) { m_LogResult->AppendText(wxString::Format(_("Error %i in : \n%s\n%i : %s\n"), ex.GetErrorCode(), sql.c_str(), ex.GetExtendedErrorCode(), ex.GetMessage().c_str())); ShowLog(); } }
BOOL CDialogEDITZBGS::OnInitDialog() { CDialog::OnInitDialog(); CMDIChildWnd* pchildfram= ((CMainFrame*)(AfxGetApp()->m_pMainWnd))->MDIGetActive(); CTaiShanDoc* pDoc=(CTaiShanDoc*)pchildfram->GetActiveDocument(); ScreenToClient(&datarect); datarect.left=235; datarect.top=205; datarect.right=400; datarect.bottom=220; if(item!=-1) { jishunow=pDoc->m_formuar_index.GetAt(item); m_name=jishunow->name; if(pDoc->m_formuar_index.GetAt(item)->isMainFiguer==1) CheckRadioButton(IDC_ZTDJ,IDC_FT,IDC_ZTDJ); else CheckRadioButton(IDC_ZTDJ,IDC_FT,IDC_FT); CString strxline; for(int k=0;k<7;k++) { if(jishunow->posX[k]>=-1.0e24) { CString test; test.Format("%.2f",jishunow->posX[k]); strxline+=test; if((k+1)%2==0) { strxline+=13; strxline+=10; } else strxline+=';'; } else break; } m_xline=strxline; m_explainbrief=jishunow->explainBrief; if(jishunow->isProtected) { m_checkmm=true; m_password=jishunow->password; } else { m_checkmm=false; m_passwordcor.EnableWindow(FALSE); } if(jishunow->isSystem) m_namecor.SetReadOnly(TRUE); numPara=jishunow->numPara; help=jishunow->help; m_input=pDoc->m_formuar_index.GetAt(item)->fomular; m_inputcor.SetFocus(); switch(numPara) { case (4): m_edit41=jishunow->namePara[3]; ShowData(m_edit42,jishunow->max[3]); ShowData(m_edit43,jishunow->min[3]); ShowData(m_edit44,jishunow->defaultVal[3]); case(3): m_edit31=jishunow->namePara[2]; ShowData(m_edit32,jishunow->max[2]); ShowData(m_edit33,jishunow->min[2]); ShowData(m_edit34,jishunow->defaultVal[2]); case(2): m_edit21=jishunow->namePara[1]; ShowData(m_edit22,jishunow->max[1]); ShowData(m_edit23,jishunow->min[1]); ShowData(m_edit24,jishunow->defaultVal[1]); case(1): m_edit11=jishunow->namePara[0]; ShowData(m_edit12,jishunow->max[0]); ShowData(m_edit13,jishunow->min[0]); ShowData(m_edit14,jishunow->defaultVal[0]); } UpdateData(FALSE); } else { help=""; CheckRadioButton(IDC_ZTDJ,IDC_FT,IDC_FT); m_checkmm=false; m_hfqs.EnableWindow(FALSE); UpdateData(FALSE); } return TRUE; }
//显示菜单 void ShowMenu(struct tagIndex *pInfo, int nInfoLen, int nBaseOffset) { char FunNum = 0; //功能号,对应1到0 char ch[2] = {0}; //system("cls"); puts("========================================"); puts("联系人信息管理"); puts("1、增加"); puts("2、删除"); puts("3、修改"); puts("4、按内容查询"); puts("5、按偏移地址查询"); puts("6、按索引查询"); puts("7、统计"); puts("8、显示存储信息"); puts("9、碎片整理"); puts("0、显示保存的信息"); //puts("A、随机添加信息"); //puts("B、重新初始化"); puts("========================================"); puts("请选择要进行的操作,然后按回车: "); fflush(stdin); scanf("%2s", ch); if (ch[0] >= 0x30 && ch[0] <= 0x39 && ch[1] == '\0') { FunNum = ch[0] - '0'; } // else if (ch[0] == 'A') // { // FunNum = 11; // } // else if (ch[0] == 'B') // { // FunNum = 12; // } else { FunNum = -1; } switch (FunNum) { case 1: //1、增加 ShowAddDisplay(pInfo, nInfoLen, nBaseOffset); break; case 2: //2、删除 ShowDelDisplay(pInfo, nInfoLen); break; case 3: //3、修改 ShowModDisplay(pInfo, nInfoLen, nBaseOffset); break; case 4: //4、按内容查询 ShowFindtext(pInfo, nInfoLen); break; case 5: //5、按地址查询 ShowFindaddr(pInfo, nInfoLen); break; case 6: //6、按索引查询 ShowFindIndex(pInfo, nInfoLen); break; case 7: //统计 ShowStringCount(pInfo, nInfoLen); break; case 8: //显示存储信息 ShowSaveCount(pInfo, nInfoLen, nBaseOffset); break; case 9: //碎片整理 Defrag(pInfo, nInfoLen, nBaseOffset); break; case 0: ShowData(pInfo, nInfoLen); fflush(stdin); break; // case 11: // RandAddForDebug(pInfo, nInfoLen, nBaseOffset, pnLastIndex); // break; // case 12: // //初始化索引表 // InitIndexInfo(pnInfo); // break; default: ShowError(); break; } system("pause"); }
wyBool BlobMgmt::OpenFromFile() { OPENFILENAME open; wyWChar filename[MAX_PATH+1] = {0}; HANDLE hfile = NULL; wyChar *buffer = {0}; DWORD dwbytesread, filesize; wyString bufferstr; memset(&open, 0, sizeof(open)); open.lStructSize = OPENFILENAME_SIZE_VERSION_400; open.hwndOwner = m_hwnddlg; open.hInstance = pGlobals->m_pcmainwin->GetHinstance(); open.lpstrFilter = L"All Files(*.*)\0*.*\0"; open.lpstrCustomFilter =(LPWSTR)NULL; open.nFilterIndex = 1L; open.lpstrFile = filename; open.nMaxFile = MAX_PATH; open.lpstrTitle = L"Open File"; if(! GetOpenFileName(&open)) return wyFalse; // else successfull. hfile = CreateFile((LPCWSTR)filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if(hfile == INVALID_HANDLE_VALUE) { DisplayErrorText(GetLastError(), _("Could not open file !")); return wyFalse; } VERIFY((filesize = GetFileSize(hfile, NULL))!= INVALID_FILE_SIZE); VERIFY (buffer =(wyChar*)malloc(filesize + 1)); SetCursor(LoadCursor(NULL, IDC_WAIT)); if(!ReadFile(hfile, buffer, filesize, &dwbytesread, NULL)) { DisplayErrorText(GetLastError(), _("Could not open file. The data is not changed")); free(buffer); SetCursor(LoadCursor(NULL, IDC_ARROW)); CloseHandle(hfile); return wyFalse; } *(buffer + dwbytesread)= NULL; SetCursor(LoadCursor(NULL, IDC_ARROW)); // now we add the new buffer. if(m_newdata && m_newdata != m_olddata) free(m_newdata); m_newdata = (wyChar *)buffer; m_newdatasize = dwbytesread; /* store the old data too */ m_piub->m_olddata = m_piub->m_data; m_piub->m_olddatasize = m_piub->m_datasize; m_piub->m_data = m_newdata; m_piub->m_datasize = dwbytesread; m_piub->m_isnull = wyFalse; VERIFY(CloseHandle(hfile)); // upddate with the new. ShowData(wyFalse); /* we need to do this after showdata coz showdata changes the modify flag to 0 */ /* now if its text data then we set the text control modification flag */ if(!memchr(buffer, 0, dwbytesread)) SendMessage(m_hwndedit, EM_SETMODIFY, TRUE, 0); return wyTrue; }
wyBool BlobMgmt::InitDlgVales() { wyString codepage; //if find dialog is open, we need to close find dialog if(pGlobals->m_pcmainwin->m_finddlg) { DestroyWindow(pGlobals->m_pcmainwin->m_finddlg); pGlobals->m_pcmainwin->m_finddlg = NULL; } VERIFY(m_hwndtab = GetDlgItem(m_hwnddlg, IDC_MAINTAB)); VERIFY(m_hwndedit = GetDlgItem(m_hwnddlg, IDC_TEXT)); VERIFY(m_hwndimage = GetDlgItem(m_hwnddlg, IDC_IMAGE)); VERIFY(m_hwndnull = GetDlgItem(m_hwnddlg, IDC_SETNULL)); VERIFY(m_hwndcombo = GetDlgItem(m_hwnddlg, IDC_COMBO)); InsertTab(m_hwndtab, 0, _(L"Text")); InsertTab(m_hwndtab, 1, _(L"Image")); // if its not word wrap then we need to destroy it. SetEditWordWrap(m_hwndedit, wyTrue, wyTrue); // just for the sake hide both of them VERIFY(ShowWindow(m_hwndimage, FALSE)); VERIFY(ShowWindow(m_hwndedit, FALSE)); if(m_piub && m_piub->m_isnull == wyTrue) { SendMessage(GetDlgItem(m_hwnddlg, IDC_SETNULL), BM_SETCHECK, BST_CHECKED, 0); DisableAll(); } SetWindowLongPtr(m_hwndimage, GWLP_USERDATA,(LONG_PTR)this); SetWindowLongPtr(m_hwndedit, GWLP_USERDATA,(LONG_PTR)this); SendMessage(m_hwndedit, SCI_SETCODEPAGE, SC_CP_UTF8, 0); //To avoid printing of special characters in scintilla on ctrl+F and ctrl+H SendMessage (m_hwndedit, SCI_CLEARCMDKEY, (SCMOD_CTRL << 16)|'F', 0); SendMessage (m_hwndedit, SCI_CLEARCMDKEY, (SCMOD_CTRL << 16)|'H', 0); //Line added because to turn off the margin SendMessage(m_hwndedit, SCI_SETMARGINWIDTHN,1,0); //m_encodingtype.SetAs(codepage.GetString()); //InitEncodingType(); m_wporigtextproc =(WNDPROC)SetWindowLongPtr(m_hwndedit, GWLP_WNDPROC,(LONG_PTR)TextProc); m_wporigpaintproc =(WNDPROC)SetWindowLongPtr(m_hwndimage, GWLP_WNDPROC,(LONG_PTR)ImageProc); //initializing text in combobox InitComboText(); ShowData(); // set the font after reading it from ini file. SetEditFont(m_hwndedit); // if its not editable then we disable all except the ok button if(m_edit == wyFalse) { DisableAll(); EnableWindow(GetDlgItem(m_hwnddlg, IDC_SETNULL), FALSE); EnableWindow(GetDlgItem(m_hwnddlg, IDC_TEXT), TRUE); SendMessage(GetDlgItem(m_hwnddlg, IDC_TEXT), EM_SETREADONLY, TRUE, TRUE); SetFocus(GetDlgItem(m_hwnddlg, IDC_TEXT)); } m_checkboxstate = SendMessage(GetDlgItem(m_hwnddlg, IDC_SETNULL), BM_GETCHECK, 0, 0); SendMessage(m_hwndedit, SCI_EMPTYUNDOBUFFER, 0, 0); return wyTrue; }
void CameraTest(void) { rt_uint32_t key_value; while(1) { LCD_Clear(); LCD_SetXY(0,0); LCD_Printf("1.ShowInfo"); LCD_SetXY(0,1); LCD_Printf("2.Handover"); LCD_SetXY(0,2); LCD_Printf("3.Pole"); LCD_SetXY(0,3); LCD_Printf("4.Circle_sta"); LCD_SetXY(0,4); LCD_Printf("5.WhiteTape"); LCD_SetXY(0,5); LCD_Printf("6.Recode"); LCD_SetXY(0,6); LCD_Printf("7.Circle_dyn"); LCD_SetXY(0,7); LCD_Printf("8.TestData"); if(rt_mb_recv(&Mb_Key, &key_value, RT_WAITING_NO) == RT_EOK) { switch(key_value) { case key1: ShowInfo(); break; case key2: Handover(TEST,NONE); break; case key3: while(rt_mb_recv(&Mb_Key, &key_value, RT_WAITING_NO) != RT_EOK) { LCD_Clear(); LCD_SetXY(0,0); LCD_Printf("1.NEW"); LCD_SetXY(0,1); LCD_Printf("2.OLD"); Delay_ms(20); } switch(key_value) { case key1: PolePutTest(); break; case key2: PolePut(TEST); break; default: break; } break; case key4: CamCircle_Static(TEST,NONE); break; case key5: CamWhiteTape(TEST); break; case key6: CamRecode(NONE,NONE,TEST); case key7: CamCircle_Dynamic(TEST); break; case key8: ShowData(); break; case keyback: return; } } Delay_ms(20); } }
MainWindow::MainWindow( const os::Rect & cFrame ):os::Window( cFrame, "MainWindow", MSG_MAINWND_TITLE ) { os::Rect cBounds = GetBounds(); os::Rect cRect = os::Rect( 0, 0, 0, 0 ); m_nDeviceSelect = -1; os::MediaManager::Get(); // Create the layouts/views pcLRoot = new os::LayoutView( cBounds, "L", NULL, os::CF_FOLLOW_ALL ); pcVLRoot = new os::VLayoutNode( "VL" ); pcVLRoot->SetBorders( os::Rect( 10, 5, 10, 5 ) ); // Create settings tree os::HLayoutNode* pcHDevice = new os::HLayoutNode( "HDevice", 0.0f ); pcHDevice->SetBorders( os::Rect( 0, 5, 0, 5 ) ); pcHDevice->AddChild( new os::StringView( os::Rect(), "DeviceLabel", MSG_MAINWND_DEVICE ), 0.0f ); pcDevice = new os::DropdownMenu( os::Rect(), "Device" ); pcDevice->SetMinPreferredSize( 18 ); pcDevice->SetSelectionMessage( new os::Message( M_MW_DEVICE ) ); pcDevice->SetTarget( this ); pcDevice->SetReadOnly( true ); pcHDevice->AddChild( new os::HLayoutSpacer( "", 5.0f, 5.0f ) ); pcHDevice->AddChild( pcDevice ); pcHDevice->AddChild( new os::HLayoutSpacer( "" ) ); pcVLRoot->AddChild( pcHDevice ); // Create settings view pcSettingsView = new os::FrameView( os::Rect(), "SettingView", "" ); pcVLRoot->AddChild( new os::VLayoutSpacer( "", 5.0f, 5.0f ) ); pcVLRoot->AddChild( pcSettingsView ); pcVLRoot->SetHAlignment( os::ALIGN_LEFT ); pcVLRoot->AddChild( new os::Separator( os::Rect(), "", os::HORIZONTAL ), 0.0f ); // Create default dropdown menus os::HLayoutNode* pcHDefaultInput = new os::HLayoutNode( "HDefaultInput", 0.0f ); pcHDefaultInput->SetBorders( os::Rect( 0, 5, 0, 5 ) ); pcHDefaultInput->AddChild( new os::StringView( os::Rect(), "DefInputString", MSG_MAINWND_DEFAULT_INPUT ) ); pcDefaultInput = new os::DropdownMenu( os::Rect(), "DefaultInput" ); pcDefaultInput->SetMinPreferredSize( 18 ); pcDefaultInput->SetSelectionMessage( new os::Message( M_MW_INPUT ) ); pcDefaultInput->SetTarget( this ); pcDefaultInput->SetReadOnly( true ); pcHDefaultInput->AddChild( new os::HLayoutSpacer( "", 5.0f, 5.0f ) ); pcHDefaultInput->AddChild( pcDefaultInput ); pcHDefaultInput->AddChild( new os::HLayoutSpacer( "" ) ); pcVLRoot->AddChild( pcHDefaultInput ); os::HLayoutNode* pcHDefaultAudioOut = new os::HLayoutNode( "HDefaultAudioOut", 0.0f ); pcHDefaultAudioOut->SetBorders( os::Rect( 0, 5, 0, 5 ) ); pcHDefaultAudioOut->AddChild( new os::StringView( os::Rect(), "DefAudioOutString", MSG_MAINWND_DEFAULT_OUTPUT_AUDIO ) ); pcDefaultAudioOut = new os::DropdownMenu( os::Rect(), "DefaultAudioOut" ); pcDefaultAudioOut->SetMinPreferredSize( 18 ); pcDefaultAudioOut->SetSelectionMessage( new os::Message( M_MW_AUDIOOUTPUT ) ); pcDefaultAudioOut->SetTarget( this ); pcDefaultAudioOut->SetReadOnly( true ); pcHDefaultAudioOut->AddChild( new os::HLayoutSpacer( "", 5.0f, 5.0f ) ); pcHDefaultAudioOut->AddChild( pcDefaultAudioOut ); pcHDefaultAudioOut->AddChild( new os::HLayoutSpacer( "" ) ); pcVLRoot->AddChild( pcHDefaultAudioOut ); os::HLayoutNode* pcHDefaultVideoOut = new os::HLayoutNode( "HDefaultVideoOut", 0.0f ); pcHDefaultVideoOut->SetBorders( os::Rect( 0, 5, 0, 5 ) ); pcHDefaultVideoOut->AddChild( new os::StringView( os::Rect(), "DefVideoOutString", MSG_MAINWND_DEFAULT_OUTPUT_VIDEO ) ); pcDefaultVideoOut = new os::DropdownMenu( os::Rect(), "DefaultVideoOut" ); pcDefaultVideoOut->SetMinPreferredSize( 18 ); pcDefaultVideoOut->SetSelectionMessage( new os::Message( M_MW_VIDEOOUTPUT ) ); pcDefaultVideoOut->SetTarget( this ); pcDefaultVideoOut->SetReadOnly( true ); pcHDefaultVideoOut->AddChild( new os::HLayoutSpacer( "", 5.0f, 5.0f ) ); pcHDefaultVideoOut->AddChild( pcDefaultVideoOut ); pcHDefaultAudioOut->AddChild( new os::HLayoutSpacer( "" ) ); pcVLRoot->AddChild( pcHDefaultVideoOut ); pcVLRoot->SameWidth( "DefInputString", "DefAudioOutString", "DefVideoOutString", NULL ); pcVLRoot->SameWidth( "DefaultInput", "DefaultAudioOut", "DefaultVideoOut", NULL ); pcVLRoot->AddChild( new os::Separator( os::Rect(), "", os::HORIZONTAL ), 0.0f ); // Create apply/revert/close buttons pcHLButtons = new os::HLayoutNode( "HLButtons" ); pcHLButtons->SetBorders( os::Rect( 0, 5, 0, 0 ) ); pcHLButtons->AddChild( new os::HLayoutSpacer( "" ) ); pcHLButtons->AddChild( pcBControls = new os::Button( cRect, "BControls", MSG_MAINWND_BUTTON_STREAMVOLUMES, new os::Message( M_MW_CONTROLS ) ) ); pcHLButtons->AddChild( new os::HLayoutSpacer( "", 5.0f, 5.0f ) ); pcHLButtons->AddChild( pcBApply = new os::Button( cRect, "BApply", MSG_MAINWND_BUTTON_APPLY, new os::Message( M_MW_APPLY ) ) ); pcHLButtons->AddChild( new os::HLayoutSpacer( "", 5.0f, 5.0f ) ); pcHLButtons->AddChild( pcBUndo = new os::Button( cRect, "BUndo", MSG_MAINWND_BUTTON_UNDO, new os::Message( M_MW_UNDO ) ) ); pcHLButtons->AddChild( new os::HLayoutSpacer( "", 5.0f, 5.0f ) ); pcHLButtons->AddChild( pcBDefault = new os::Button( cRect, "BDefault", MSG_MAINWND_BUTTON_DEFAULT, new os::Message( M_MW_DEFAULT ) ) ); pcHLButtons->AddChild( new os::HLayoutSpacer( "", 5.0f, 5.0f ) ); pcHLButtons->SameWidth( "BControls", "BApply", "BUndo", "BDefault", NULL ); pcHLButtons->SameHeight( "BControls", "BApply", "BUndo", "BDefault", NULL ); pcVLRoot->AddChild( pcHLButtons ); // Set root and add to window pcLRoot->SetRoot( pcVLRoot ); AddChild( pcLRoot ); // Set default button and initial focus this->SetDefaultButton( pcBApply ); // Set tab order int iTabOrder = 0; pcBDefault->SetTabOrder( iTabOrder++ ); pcBUndo->SetTabOrder( iTabOrder++ ); pcBApply->SetTabOrder( iTabOrder++ ); pcBControls->SetTabOrder( iTabOrder++ ); pcBApply->MakeFocus(); // Set default outputs os::MediaInput * pcDefaultInput = os::MediaManager::GetInstance()->GetDefaultInput( ); os::MediaOutput * pcDefaultVideo = os::MediaManager::GetInstance()->GetDefaultVideoOutput( ); os::MediaOutput * pcDefaultAudio = os::MediaManager::GetInstance()->GetDefaultAudioOutput( ); if ( pcDefaultInput ) { cCurrentInput = pcDefaultInput->GetIdentifier(); pcDefaultInput->Release(); } if ( pcDefaultAudio ) { cCurrentAudio = pcDefaultAudio->GetIdentifier(); pcDefaultAudio->Release(); } if ( pcDefaultVideo ) { cCurrentVideo = pcDefaultVideo->GetIdentifier(); pcDefaultVideo->Release(); } cUndoInput = cCurrentInput; cUndoVideo = cCurrentVideo; cUndoAudio = cCurrentAudio; // Set Icon os::Resources cCol( get_image_id() ); os::ResStream *pcStream = cCol.GetResourceStream( "icon48x48.png" ); os::BitmapImage *pcIcon = new os::BitmapImage( pcStream ); SetIcon( pcIcon->LockBitmap() ); delete( pcIcon ); // Show data ShowData(); // Select first item */ if( pcDevice->GetItemCount() > 0 ) pcDevice->SetSelection( 0 ); }
void OneByOne (struct nodo ** list) { /* this is my favourite function! When this function is called for the first time, the first node of the list is shown. Then the user has the possibility to look at the next, the previous, the last and the first */ struct nodo * act = NULL; int choice; if (! *list) { printf("\nEmpty List."); return; } act = *list; ShowData(act); do { printf("\n\n0 - Exit"); printf("\n1 - Next"); printf("\n2 - Previous"); printf("\n3 - First"); printf("\n4 - Last"); CHOICE(choice); switch (choice) { case 0: break; case 1: if (!act->next) /* if we have a NULL address in act->next then we are looking at the last one */ printf ("\t\tNo more entries."); else { /* we point to the address of the next structure and show it */ act = act->next; ShowData(act); } break; case 2: if (!act->prev) /* if act->prev == NULL then we are showing the first one */ printf("\t\tNo previous entries."); else { /* we point to address of the previous structure */ act = act->prev; ShowData(act); } break; case 3: /* to show the first item */ while (act->prev) act = act->prev; ShowData(act); break; case 4: /* to show the last item */ while (act->next) act = act->next; ShowData(act); break; default: printf("Invalid Choice"); break; } } while (choice != 0); }
void Preference::Show() { ShowData(ACCOUNT); this->setAttribute(Qt::WA_QuitOnClose, false); this->exec(); }
/*! \brief Demo of linear speed controller. * * Serial interface frontend to test linear speed controller. */ void main(void) { // Number of steps to move. int steps = 1000; // Accelration to use. int acceleration = 100; // Deceleration to use. int deceleration = 100; // Speed to use. int speed = 800; // Tells if the received string was a valid command. char okCmd = FALSE; Init(); // Outputs help screen. uart_SendString("\n\r"); ShowHelp(); ShowData(stepPosition, acceleration, deceleration, speed, steps); while(1) { // If a command is received, check the command and act on it. if(status.cmd == TRUE){ if(UART_RxBuffer[0] == 'm'){ // Move with... if(UART_RxBuffer[1] == ' '){ // ...number of steps given. steps = atoi((char const *)UART_RxBuffer+2); speed_cntr_Move(steps, acceleration, deceleration, speed); okCmd = TRUE; uart_SendString("\n\r "); } else if(UART_RxBuffer[1] == 'o'){ if(UART_RxBuffer[2] == 'v'){ if(UART_RxBuffer[3] == 'e'){ // ...all parameters given if(UART_RxBuffer[4] == ' '){ int i = 6; steps = atoi((char const *)UART_RxBuffer+5); while((UART_RxBuffer[i] != ' ') && (UART_RxBuffer[i] != 13)) i++; i++; acceleration = atoi((char const *)UART_RxBuffer+i); while((UART_RxBuffer[i] != ' ') && (UART_RxBuffer[i] != 13)) i++; i++; deceleration = atoi((char const *)UART_RxBuffer+i); while((UART_RxBuffer[i] != ' ') && (UART_RxBuffer[i] != 13)) i++; i++; speed = atoi((char const *)UART_RxBuffer+i); speed_cntr_Move(steps, acceleration, deceleration, speed); okCmd = TRUE; uart_SendString("\n\r "); } } } } } else if(UART_RxBuffer[0] == 'a'){ // Set acceleration. if(UART_RxBuffer[1] == ' '){ acceleration = atoi((char const *)UART_RxBuffer+2); okCmd = TRUE; } } else if(UART_RxBuffer[0] == 'd'){ // Set deceleration. if(UART_RxBuffer[1] == ' '){ deceleration = atoi((char const *)UART_RxBuffer+2); okCmd = TRUE; } } else if(UART_RxBuffer[0] == 's'){ if(UART_RxBuffer[1] == ' '){ speed = atoi((char const *)UART_RxBuffer+2); okCmd = TRUE; } } else if(UART_RxBuffer[0] == 13){ speed_cntr_Move(steps, acceleration, deceleration, speed); okCmd = TRUE; } else if(UART_RxBuffer[0] == '?'){ ShowHelp(); okCmd = TRUE; } // Send help if invalid command is received. if(okCmd != TRUE) ShowHelp(); // Clear RXbuffer. status.cmd = FALSE; uart_FlushRxBuffer(); if(status.running == TRUE){ uart_SendString("Running..."); while(status.running == TRUE); uart_SendString("OK\n\r"); } ShowData(stepPosition, acceleration, deceleration, speed, steps); }//end if(cmd) }//end while(1) }
//------------------------------------------------------------------------------ // SetPathDialog(wxWindow *parent) //------------------------------------------------------------------------------ SetPathDialog::SetPathDialog(wxWindow *parent) : GmatDialog(parent, -1, wxT("SetPathDialog")) { Create(); ShowData(); }
void GameViewer::Refresh() { LoadGames(); LoadPSF(); ShowData(); }
/* ****************************************************************** */ void function_menu() { uint8_t ii; uint8_t func_number; #ifdef PAGE_MODE uint8_t page_nr; uint8_t p_nr; uint8_t ff; page_nr = MODE_LAST; #ifdef WITH_ROTARY_SWITCH rotary.count = 0; #endif #endif func_number = 0; #ifdef POWER_OFF uint8_t ll; for (ll=0;ll<((MODE_LAST+1)*10);ll++) #else while (1) /* without end, if no power off specified */ #endif { if (func_number > MODE_LAST) func_number -= (MODE_LAST + 1); message_key_released(SELECTION_str); #ifdef FOUR_LINE_LCD #ifdef PAGE_MODE ff = 0; if (func_number == page_nr) ff = 1; // number is found p_nr = page_nr + 1; if (p_nr > MODE_LAST) p_nr -= (MODE_LAST + 1); if (func_number == p_nr) ff = 1; // number is found p_nr = page_nr + 2; if (p_nr > MODE_LAST) p_nr -= (MODE_LAST + 1); if (func_number == p_nr) ff = 1; // number is found if (ff == 0) { // func_number is not in page list #ifdef WITH_ROTARY_SWITCH if (rotary.count >= 0) { page_nr = (func_number + MODE_LAST -1); // page_nr = func_number - 2 } else { page_nr = func_number; // for backward, set page_nr to func_number } if (page_nr > MODE_LAST) page_nr -= (MODE_LAST + 1); #else page_nr = func_number; #endif } if (ff == 0) { lcd_line2(); lcd_clear_line(); // clear line 2 } lcd_line2(); // reset cursor to begin of line 2 if (func_number == page_nr) { lcd_data('>'); } else { lcd_space(); // put a blank to 1. row of line 2 } message2line(page_nr); // show first page function if (ff == 0) { lcd_line3(); lcd_clear_line(); // clear line 3 } lcd_line3(); // reset cursor to begin of line 3 p_nr = page_nr + 1; if (p_nr > MODE_LAST) p_nr -= (MODE_LAST + 1); if (func_number == p_nr) { lcd_data('>'); } else { lcd_space(); // put a blank to 1. row of line 3 } message2line(p_nr); // show 2. page function if (ff == 0) { lcd_line4(); lcd_clear_line(); // clear line 4 } lcd_line4(); // reset cursor to begin of line 4 p_nr = page_nr + 2; if (p_nr > MODE_LAST) p_nr -= (MODE_LAST + 1); if (func_number == p_nr) { lcd_data('>'); } else { lcd_space(); // put a blank to 1. row of line 4 } message2line(p_nr); // show 3. page function #else /* no PAGE_MODE */ lcd_line2(); lcd_clear_line(); // clear line 2 lcd_line2(); // reset cursor to begin of line 2 lcd_space(); // put a blank to 1. row of line 2 message2line(func_number + MODE_LAST); // show lower (previous) function lcd_line3(); lcd_clear_line(); // clear line 3 lcd_line3(); // reset cursor to begin of line 3 lcd_data('>'); // put a '>' marker to row 1 of line 3 message2line(func_number); // show selectable function lcd_line4(); lcd_clear_line(); // clear line 4 lcd_line4(); // reset cursor to begin of line 4 lcd_space(); // put a blank to 1. row of line 4 message2line(func_number + 1); // show higher (next) function #endif /* PAGE_MODE */ #else /* no FOUR_LINE_LCD */ lcd_line2(); lcd_clear_line(); // clear line 2 lcd_line2(); // reset cursor to begin of line 2 message2line(func_number); #endif /* FOUR_LINE_LCD */ #ifdef POWER_OFF ii = wait_for_key_ms(SHORT_WAIT_TIME); // wait about 5 seconds if (ii > 0) ll = 0; // reset timer, operator present #else ii = wait_for_key_ms(0); // wait endless #endif #ifdef WITH_ROTARY_SWITCH if ((ii >= MIN_SELECT_TIME) || ((rotary_switch_present != 0) && (ii > 0))) #else if (ii >= MIN_SELECT_TIME) #endif { // selection only with key-press if (func_number == MODE_TRANS) break; // return to TransistorTester if (func_number == MODE_FREQ) GetFrequency(0); #if PROCESSOR_TYP == 644 if (func_number == MODE_HFREQ) GetFrequency(1); // measure high frequency with 16:1 divider if (func_number == MODE_H_CRYSTAL) GetFrequency(5); // HF crystal input + 16:1 divider if (func_number == MODE_L_CRYSTAL) GetFrequency(6); // LF crystal input, 1:1 divider #endif if (func_number == MODE_FGEN) { make_frequency(); // make some sample frequencies } if (func_number == MODE_PWM) { do_10bit_PWM(); // generate 10bit PWM } if (func_number == MODE_ESR) { show_C_ESR(); // measure capacity and ESR at TP1 and TP3 } if (func_number == MODE_ROTARY) { CheckRotaryEncoder(); // check rotary encoder } #ifdef WITH_SELFTEST if (func_number == MODE_SELFTEST) AutoCheck(0x11); // Full selftest with calibration #endif if (func_number == MODE_VEXT) show_vext(); #if (LCD_ST_TYPE == 7565) if (func_number == MODE_CONTRAST) set_contrast(); #endif if (func_number == MODE_SHOW) { ShowData(); // Show Calibration Data } if (func_number == MODE_OFF) { ON_PORT &= ~(1<<ON_PIN); //switch off power wait_for_key_ms(0); //never ending loop } // don't increase function number for easier selection the same function ii = 0; // function was executed before, do not increase func_number #ifdef WITH_ROTARY_SWITCH rotary.incre = 0; // reset all rotary information rotary.count = 0; #endif } /* end if (ii >= MIN_SELECT_TIME) */ #ifdef WITH_ROTARY_SWITCH if (rotary.incre >= FAST_ROTATION) break; // to much rotation #ifdef POWER_OFF if (rotary.count != 0) ll = 0; // someone is working, reset timer #endif if (rotary.count >= 0) { func_number += rotary.count; // function number is increased by rotary steps } else { func_number += (MODE_LAST + 1 + rotary.count); // function is decreased by rotary steps } #endif if (ii > 0) func_number++; // increase the function number with key press } /* end for ll */ return; } // end function_menu()
void PropertiesPanel::OnCmdPropertiesRefresh( wxCommandEvent& WXUNUSED(event) ) { if (!m_wtObject) return; ShowData(m_wtObject->Getptr()); }