void PageConfigData::UpDataCurve(ArrayFlyWeight<7>& ref,double dParam[],int nNum) { GetCurKey(m_cmbCurveype,m_nType); ref.SetValue(m_nType,0); ref.SetValue(nNum,1); ref.SetValue(float(dParam[0]),2); ref.SetValue(float(dParam[1]),3); ref.SetValue(float(dParam[2]),4); ref.SetValue(float(dParam[3]),5); ref.SetValue(float(dParam[4]),6); }
void CKeyboardWidget::PaintWidget(CPaintingParms* pPaintingParms, CScreenEngine* pEngine) { CHTString sCurKey = TranslateCharToImageName(GetCurKey(pEngine)); for (int iImage = 0; iImage < m_asKeyboardKeys.size(); iImage++) { if (sCurKey.CompareWithCase(m_asKeyboardKeys[iImage]) == 0) { SDL_Surface* pCurImage = m_apKeyboardImages[iImage]; m_pImageWidget->SetImage(pCurImage); m_pImageWidget->PaintWidget(pPaintingParms, pEngine); } } }
void PagePumpTrans::OnSelchangeModel() { // TODO: Add your control notification handler code here GetCurKey(m_cmbTransModel,m_nTransModel); CombineDlg(m_nTransModel); if(m_nTransModel>0&&m_nTransModel<8) { PumpTransient temp; temp.m_TranModel.SetValue(m_nTransModel); temp.m_FourQuadrantData.SetValue(72,1); m_ModelArray[m_nTransModel-1]->Init(temp); InitTransModel(m_nType,m_strUnit,m_nTransModel); } VariableSpeed(); }
BOOL PageOther::Updata() { UpdateData(TRUE); SteadySet::ms_FlowRelaxation.SetValue(m_strFlowRelax); SteadySet::ms_PresRelaxation.SetValue(m_strPressRelax); SteadySet::ms_MaxIterations.SetValue(m_strMaxIter); SteadySet::ms_AutoDetect.SetValue(m_strIterSpan); if(m_bKeep) { m_nKeep = -1; } else { m_nKeep = 0; } GetCurKey(m_cmbMatrix,m_nMatrixMethod); SteadySet::ms_KeepHistory.SetValue(m_nKeep); SteadySet::ms_MatrixMethod.SetValue(m_nMatrixMethod); return TRUE; }
void PageConfigData::OnSelchangeType() { // TODO: Add your control notification handler code here GetCurKey(m_cmbCurveype,m_nType); CurverStatus(); }
int keyCheck(int longCheck) { // get key press or use macro extern int GetCurKey(); int i, keystroke; unsigned int curkey; static int keydown = 0; if(keydown) { // we are waiting for key up or long timer to expire curkey = GetCurKey(); if(curkey != keydown) { // the key is up - return it *P_TimeBaseB_Ctrl = 0; // stop timer // logKeystroke(keydown | 0x8000); curkey = keydown; keydown = 0; return curkey; } else if (keydown_counter > KEY_LONG_DOWN_THRESH) { *P_TimeBaseB_Ctrl = 0; // stop timer curkey = keydown | LONG_KEY_STROKE; keydown = 0; // logKeystroke(curkey | 0xc000); logKeystroke(curkey); return (curkey); // return long key stroke } } // loop allows time for service loop to stabilize on keys // based on C_DebounceCnt = 8 in IOKeyScan.asm (i < 12 was too short) KeyScan_ServiceLoop(); if (longCheck) { for (i = 0; i < 15; i++) { KeyScan_ServiceLoop(); } } keystroke = (int)SP_GetCh(); // BUG: Combo keys are not working. Not sure why yet. // if (keystroke == ADMIN_COMBO_KEYS) // adminOptions(); //might also want to move this to control tracks if (MACRO_FILE) { keystroke = nextMacroKey(keystroke); logKeystroke(keystroke); return(keystroke); } // we have debounced key down, start timer and wait for key up or long key press time to expire if (keystroke) { __asm__("irq off"); __asm__("fiq off"); *P_TimeBaseB_Ctrl = TIMEBASE_B_16HZ; // enable int & divide second into 16 chunks (could be 8,16,32,64) keydown_counter = 0; __asm__("irq on"); __asm__("fiq on"); keydown = keystroke; } if(longCheck && keydown) { while(((curkey = GetCurKey()) == keydown) && (keydown_counter <= KEY_LONG_DOWN_THRESH)) ; curkey = keydown; if (keydown_counter > KEY_LONG_DOWN_THRESH) curkey |= LONG_KEY_STROKE; keydown = 0; logKeystroke(curkey); return(curkey); } return (0); // return keystroke; }