BOOL CXpTheme::GetThemeColor(int iPartId, int iStateId, int iPropId, LPCOLORREF pColor) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNGETTHEMECOLOR pf = (PFNGETTHEMECOLOR)m_ixptf[ ixptf_PFNGETTHEMECOLOR ]; if ( pf == NULL ) return FALSE; // Do the call return SetErr( pf( m_hTheme, iPartId, iStateId, iPropId, pColor ) ) == S_OK; }
BOOL CXpTheme::DrawThemeEdge(HDC hDC, int iPartId, int iStateId, LPRECT pDestRect, UINT uEdge, UINT uFlags, LPRECT pContentRect) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNDRAWTHEMEEDGE pf = (PFNDRAWTHEMEEDGE)m_ixptf[ ixptf_PFNDRAWTHEMEEDGE ]; if ( pf == NULL ) return FALSE; // Do the call return SetErr( pf( m_hTheme, hDC, iPartId, iStateId, pDestRect, uEdge, uFlags, pContentRect ) ) == S_OK; }
BOOL CXpTheme::DrawThemeIcon(HDC hDC, int iPartId, int iStateId, LPRECT pRect, HIMAGELIST himl, int iImageIndex) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNDRAWTHEMEICON pf = (PFNDRAWTHEMEICON)m_ixptf[ ixptf_PFNDRAWTHEMEICON ]; if ( pf == NULL ) return FALSE; // Do the call return SetErr( pf( m_hTheme, hDC, iPartId, iStateId, pRect, himl, iImageIndex ) ) == S_OK; }
BOOL CXpTheme::GetThemeBackgroundRegion(HDC hDC, int iPartId, int iStateId, LPRECT pRect, HRGN *pRegion) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNGETTHEMEBACKGROUNDREGION pf = (PFNGETTHEMEBACKGROUNDREGION)m_ixptf[ ixptf_PFNGETTHEMEBACKGROUNDREGION ]; if ( pf == NULL ) return FALSE; // Do the call return SetErr( pf( m_hTheme, hDC, iPartId, iStateId, pRect, pRegion ) ) == S_OK; }
BOOL CXpTheme::HitTestThemeBackground(HDC hDC, int iPartId, int iStateId, DWORD dwOptions, LPRECT pRect, HRGN hRgn, POINT ptTest, LPWORD pwHitTestCode) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNHITTESTTHEMEBACKGROUND pf = (PFNHITTESTTHEMEBACKGROUND)m_ixptf[ ixptf_PFNHITTESTTHEMEBACKGROUND ]; if ( pf == NULL ) return FALSE; // Do the call return SetErr( pf( m_hTheme, hDC, iPartId, iStateId, dwOptions, pRect, hRgn, ptTest, pwHitTestCode ) ) == S_OK; }
BOOL CXpTheme::GetThemeTextExtent(HDC hDC, int iPartId, int iStateId, LPCTSTR pszText, int iCharCount, DWORD dwTextFlags, LPRECT pBoundingRect, LPRECT pExtentRect) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNGETTHEMETEXTEXTENT pf = (PFNGETTHEMETEXTEXTENT)m_ixptf[ ixptf_PFNGETTHEMETEXTEXTENT ]; if ( pf == NULL ) return FALSE; // Do the call return SetErr( pf( m_hTheme, hDC, iPartId, iStateId, CComBSTR( pszText ), iCharCount, dwTextFlags, pBoundingRect, pExtentRect ) ) == S_OK; }
BOOL CXpTheme::GetThemeTextMetrics(HDC hDC, int iPartId, int iStateId, LPTEXTMETRIC ptm) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNGETTHEMETEXTMETRICS pf = (PFNGETTHEMETEXTMETRICS)m_ixptf[ ixptf_PFNGETTHEMETEXTMETRICS ]; if ( pf == NULL ) return FALSE; // Do the call return SetErr( pf( m_hTheme, hDC, iPartId, iStateId, ptm ) ) == S_OK; }
BOOL CXpTheme::GetThemePartSize(HDC hDC, int iPartId, int iStateId, LPRECT pRect, enum THEMESIZE eSize, LPSIZE psz) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNGETTHEMEPARTSIZE pf = (PFNGETTHEMEPARTSIZE)m_ixptf[ ixptf_PFNGETTHEMEPARTSIZE ]; if ( pf == NULL ) return FALSE; // Do the call return SetErr( pf( m_hTheme, hDC, iPartId, iStateId, pRect, eSize, psz ) ) == S_OK; }
BOOL CXpTheme::GetThemeBackgroundExtent(HDC hDC, int iPartId, int iStateId, LPRECT pContentRect, LPRECT pExtentRect) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNGETTHEMEBACKGROUNDEXTENT pf = (PFNGETTHEMEBACKGROUNDEXTENT)m_ixptf[ ixptf_PFNGETTHEMEBACKGROUNDEXTENT ]; if ( pf == NULL ) return FALSE; // Do the call return SetErr( pf( m_hTheme, hDC, iPartId, iStateId, pContentRect, pExtentRect ) ) == S_OK; }
BOOL CXpTheme::DrawThemeText(HDC hDC, int iPartId, int iStateId, LPCTSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, LPRECT pRect) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNDRAWTHEMETEXT pf = (PFNDRAWTHEMETEXT)m_ixptf[ ixptf_PFNDRAWTHEMETEXT ]; if ( pf == NULL ) return FALSE; // Do the call return SetErr( pf( m_hTheme, hDC, iPartId, iStateId, CComBSTR( pszText ), iCharCount, dwTextFlags, dwTextFlags2, pRect ) ) == S_OK; }
BOOL CXpTheme::GetThemeMetric(HDC hDC, int iPartId, int iStateId, int iPropId, int *piVal) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNGETTHEMEMETRIC pf = (PFNGETTHEMEMETRIC)m_ixptf[ ixptf_PFNGETTHEMEMETRIC ]; if ( pf == NULL ) return FALSE; // Do the call return SetErr( pf( m_hTheme, hDC, iPartId, iStateId, iPropId, piVal ) ) == S_OK; }
BOOL CXpTheme::GetThemeEnumValue(int iPartId, int iStateId, int iPropId, int *piVal) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNGETTHEMEENUMVALUE pf = (PFNGETTHEMEENUMVALUE)m_ixptf[ ixptf_PFNGETTHEMEENUMVALUE ]; if ( pf == NULL ) return FALSE; // Do the call return SetErr( pf( m_hTheme, iPartId, iStateId, iPropId, piVal ) ) == S_OK; }
/*------------------------------------------------------------ * Function Name : LoadPutinPassword * Description : 输入用户密码页 * Input : None * Output : None * Return : None *------------------------------------------------------------*/ TestStatus LoadPutinPassword( PAGE_TypeDef Page ) { if (JudgeNeedPassword() == DISABLE) { SetPage(Page); return PASSED; } /* 初始化 */ PutinPasswordInit(); /* GUI */ GUI_PutinPassword(); /* 遍历 */ ShowPutinPassword(); while (PutinPassword.ExceptionBackOut == DISABLE) { pKey->key_sta = GetKeyStatus(DISABLE_SHIFT); /* 数据输入 */ PutinPasswordPutin(PASSWORD_PUTIN); /* 上位机警告 */ PutinPassword.ExceptionBackOut = PCM_GeneralWarningHandlerProcess(COLOR_BACK); if ( pKey->key_sta == KEY_PRESS_OK) { switch ( pKey->key_value ) { case KEY_F4: SetPage(MAIN_PAGE); return PASSED; case KEY_F8: strcpy(PutinPassword.data[PASSWORD_PUTIN],TypeWriteChar); if (SystemPasswordCheck(PutinPassword.data[PASSWORD_PUTIN]) == PASSED) { SetPage(Page); return PASSED; } else { SetErr(&GeneralWarning,PCM_ERR,0xff,1,&PutinPasswordWarn[0]); } break; } } } return FAILED; }
BOOL CXpTheme::GetThemeRect(int iPartId, int iStateId, int iPropId, LPRECT pRect) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNGETTHEMERECT pf = (PFNGETTHEMERECT)m_ixptf[ ixptf_PFNGETTHEMERECT ]; if ( pf == NULL ) return FALSE; // Do the call return SetErr( pf( m_hTheme, iPartId, iStateId, iPropId, pRect ) ) == S_OK; }
BOOL CXpTheme::GetThemeBool(int iPartId, int iStateId, int iPropId, BOOL *pfVal) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNGETTHEMEBOOL pf = (PFNGETTHEMEBOOL)m_ixptf[ ixptf_PFNGETTHEMEBOOL ]; if ( pf == NULL ) return FALSE; // Do the call return SetErr( pf( m_hTheme, iPartId, iStateId, iPropId, pfVal ) ) == S_OK; }
BOOL CXpTheme::GetThemeFont(HDC hDC, int iPartId, int iStateId, int iPropId, LPLOGFONT pFont) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNGETTHEMEFONT pf = (PFNGETTHEMEFONT)m_ixptf[ ixptf_PFNGETTHEMEFONT ]; if ( pf == NULL ) return FALSE; // Do the call return SetErr( pf( m_hTheme, hDC, iPartId, iStateId, iPropId, pFont ) ) == S_OK; }
BOOL CXpTheme::GetThemePosition(int iPartId, int iStateId, int iPropId, LPPOINT pPoint) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNGETTHEMEPOSITION pf = (PFNGETTHEMEPOSITION)m_ixptf[ ixptf_PFNGETTHEMEPOSITION ]; if ( pf == NULL ) return FALSE; // Do the call return SetErr( pf( m_hTheme, iPartId, iStateId, iPropId, pPoint ) ) == S_OK; }
BOOL CXpTheme::DrawThemeBackground(HDC hDC, int iPartId, int iStateId, LPRECT pRect, LPRECT pClipRect) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNDRAWTHEMEBACKGROUND pf = (PFNDRAWTHEMEBACKGROUND)m_ixptf[ ixptf_PFNDRAWTHEMEBACKGROUND ]; if ( pf == NULL ) return FALSE; // Do the call return SetErr( pf( m_hTheme, hDC, iPartId, iStateId, pRect, pClipRect ) ) == S_OK; }
void test_calls_wptr (Workspace p, int i) { void *ptr; Reschedule (p); if (i == 0) { SetErr (p); SetErrM (p, "test"); Shutdown (p); } ptr = MAlloc (p, i); MRelease (p, ptr); }
BOOL CXpTheme::GetThemeDocumentationProperty(LPCTSTR pszThemeName, LPCTSTR pszPropertyName, LPSTR pszValueBuff, int cchMaxValChars) {_STT(); // Get function pointer PFNGETTHEMEDOCUMENTATIONPROPERTY pf = (PFNGETTHEMEDOCUMENTATIONPROPERTY)m_ixptf[ ixptf_PFNGETTHEMEDOCUMENTATIONPROPERTY ]; if ( pf == NULL ) return FALSE; CComBSTR valuebuf( cchMaxValChars ); // Do the call LRESULT ret = SetErr( pf( CComBSTR( pszThemeName ), CComBSTR( pszPropertyName ), valuebuf, cchMaxValChars ) ); wcstombs( pszValueBuff, valuebuf, cchMaxValChars ); return ( ret == S_OK ); }
BOOL CXpTheme::GetThemeSysString(int iStringId, LPSTR pszStringBuf, int cchMaxStringChars) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNGETTHEMESYSSTRING pf = (PFNGETTHEMESYSSTRING)m_ixptf[ ixptf_PFNGETTHEMESYSSTRING ]; if ( pf == NULL ) return FALSE; CComBSTR str( cchMaxStringChars ); // Do the call LRESULT ret = SetErr( pf( m_hTheme, iStringId, str, cchMaxStringChars ) ); wcstombs( pszStringBuf, str, cchMaxStringChars ); return ( ret == S_OK ); }
BOOL CXpTheme::GetThemeFilename(int iPartId, int iStateId, int iPropId, LPSTR pszThemeFileName, int cchMaxBufChars) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNGETTHEMEFILENAME pf = (PFNGETTHEMEFILENAME)m_ixptf[ ixptf_PFNGETTHEMEFILENAME ]; if ( pf == NULL ) return FALSE; CComBSTR fname( cchMaxBufChars ); // Do the call LRESULT ret = SetErr( pf( m_hTheme, iPartId, iStateId, iPropId, fname, cchMaxBufChars ) ); wcstombs( pszThemeFileName, fname, cchMaxBufChars ); return ( ret == S_OK ); }
BOOL CXpTheme::GetThemeString(int iPartId, int iStateId, int iPropId, LPSTR pszBuff, int cchMaxBufChars) {_STT(); if ( !IsTheme() ) return FALSE; // Get function pointer PFNGETTHEMESTRING pf = (PFNGETTHEMESTRING)m_ixptf[ ixptf_PFNGETTHEMESTRING ]; if ( pf == NULL ) return FALSE; CComBSTR buf( cchMaxBufChars ); // Do the call LRESULT ret = SetErr( pf( m_hTheme, iPartId, iStateId, iPropId, buf, cchMaxBufChars ) ); wcstombs( pszBuff, buf, cchMaxBufChars ); return ( ret == S_OK ); }
/*------------------------------------------------------------ * Function Name : LoadManagerLogin * Description : 加载管理员登录(纯输入密码验证) * Input : None * Output : None * Return : None *------------------------------------------------------------*/ TestStatus LoadManagerLogin( void ) { MANAGER_LOGIN: /* 初始化 */ UserLoginInit(); /* GUI */ GUI_ManagerLogin(); /* 遍历 */ ShowUserLogin(); while ((GetPage() == USER_LOGIN_PAGE) && (UserLogin.ExceptionBackOut == DISABLE)) { pKey->key_sta = GetKeyStatus(DISABLE_SHIFT); /* 数据输入 */ ManagerLoginPutin(PASSWORD_PUTIN); /* 上位机警告 */ UserLogin.ExceptionBackOut = PCM_GeneralWarningHandlerProcess(COLOR_BACK); if ( pKey->key_sta == KEY_PRESS_OK) { switch ( pKey->key_value ) { case KEY_F7: strcpy(UserLogin.data[PASSWORD_PUTIN],TypeWriteChar); if (FAILED == SuperPasswordCheck(UserLogin.data[PASSWORD_PUTIN])) { SetErr(&GeneralWarning,PCM_ERR,0xff,1,&UserLoginWarn[0]); break; } return PASSED; case KEY_F8: return FAILED; } } } goto MANAGER_LOGIN; }
/*------------------------------------------------------------ * Function Name : OnlineParameterEnterData * Description : 确认输入数据 * Input : None * Output : None * Return : None *------------------------------------------------------------*/ void OnlineParameterEnterData( uint8_t index ) { if (PutinStatus == STATUS_EDIT_COMP) { if (FAILED == OnlineParameterCheckData()) { SetErr(&GeneralWarning,PCM_ERR,0xff,1,&OnlineParameterWarn[0]); return; } usprintf(OnlineParameter.data[index],"%03d",TypeWriteInt); } ShowOnlineParameter(index); // OnlineParameterUpdateIndex(index); }
/*------------------------------------------------------------ * Function Name : UserLoginTryLogin * Description : 尝试登录 * Input : None * Output : None * Return : None *------------------------------------------------------------*/ void UserLoginTryLogin( void ) { strcpy(UserLogin.data[PASSWORD_PUTIN],TypeWriteChar); if (FAILED == SuperPasswordCheck(UserLogin.data[PASSWORD_PUTIN])) { SetErr(&GeneralWarning,PCM_ERR,0xff,1,&UserLoginWarn[0]); return; } SetEnterManageMode(); SetPage(MANAGE_MODE_PAGE); return; }
BOOL CXpTheme::GetCurrentThemeName(LPSTR pszThemeFileName, int cchMaxNameChars, LPSTR pszColorBuff, int cchMaxColorChars, LPSTR pszSizeBuff, int cchMaxSizeChars) {_STT(); // Get function pointer PFNGETCURRENTTHEMENAME pf = (PFNGETCURRENTTHEMENAME)m_ixptf[ ixptf_PFNGETCURRENTTHEMENAME ]; if ( pf == NULL ) return FALSE; CComBSTR name( cchMaxNameChars ); CComBSTR color( cchMaxColorChars ); CComBSTR size( cchMaxSizeChars ); // Do the call LRESULT ret = SetErr( pf( name, cchMaxNameChars, color, cchMaxColorChars, size, cchMaxSizeChars ) ); wcstombs( pszThemeFileName, name, cchMaxNameChars ); wcstombs( pszColorBuff, color, cchMaxColorChars ); wcstombs( pszSizeBuff, size, cchMaxSizeChars ); return ( ret == S_OK ); }
/*------------------------------------------------------------ * Function Name : EraseFlashAskHandler * Description : 擦除FLASH询问 * Input : None * Output : None * Return : None *------------------------------------------------------------*/ FunctionalState EraseFlashAskHandler( void ) { FunctionalState RETURN = DISABLE; ASK_WARN_TypeDef ASK; lcd_clear(COLOR_BACK); GUI_DateTimeMiddleLine(LIGHT_GRAY2); SetErr(&GeneralWarning,PCM_ERR,0xfe,3,&pMainWarnName[0]); MainConfigAskWarn(&ASK); while (1) { /* 上位机警告 */ RETURN = ASK_WarningHandlerProcess(&ASK); if (RETURN == ENABLE) { lcd_clear(COLOR_BACK); return ASK.NewFunc; } } }
/*------------------------------------------------------------ * Function Name : LoadSoftActiveSet * Description : 加载软件激活设置 * Input : None * Output : None * Return : None *------------------------------------------------------------*/ void LoadSoftActiveSet( void ) { /* 初始化 */ SoftActiveInit(); /* 获取数据 */ GetSoftActiveDateFromFlash(READ_FLASH); /* GUI界面 */ GUI_SoftActive(); /* 遍历 */ Traverse_SoftActive(); while ((GetPage() == SOFT_ACTIVE_PAGE) && (SoftActive.ExceptionBackOut == DISABLE)) { pKey->key_sta = GetKeyStatus(DISABLE_SHIFT); /* 索引值改变 */ SoftActiveChangeIndex(&SoftActive.now_index); /* 数据输入 */ SoftActivePutin(SoftActive.now_index); /* 改变光标 */ SoftActiveCursorChange(&SoftActive.last_index,&SoftActive.now_index); /* 虚拟按键显示 */ DummyKey.Key = GeneralKeyShow(ENABLE); /* 虚拟按键恢复默认 */ DummyKey.Check = DummyKeyClose(); /* 上位机警告 */ SoftActive.ExceptionBackOut = PCM_GeneralWarningHandlerProcess(COLOR_BACK); if ( pKey->key_sta == KEY_PRESS_OK) { switch ( pKey->key_value ) { case KEY_F1: SetPage(CONTROL_PARAMETER); break; case KEY_F2: SetPage(PID_CALIBRATION); break; case KEY_F3: SetPage(MORE_PARAMETER); break; case KEY_F4: SetPage(MAIN_PAGE); break; case KEY_F5: if (SystemPasswordCheck(SoftActive.data[PUTIN_PASSWORD]) == PASSED) { GetSoftActiveDateFromFlash(WRITE_FLASH); SetErr(&GeneralWarning,PCM_ERR,0xff,1,&ActiveStatusWarn[7]); } else { SetErr(&GeneralWarning,PCM_ERR,0xff,1,&ActiveStatusWarn[6]); } break; case KEY_F7: SoftActiveEnterData(SoftActive.now_index); break; case KEY_F8: ProdectActiveCheck(SoftActive.data[PUTIN_PASSWORD]); break; case KEY_CALI: SetPage(FORCE_CALIBRATION); break; } } } }
/*------------------------------------------------------------ * Function Name : PidCalibrationEnterData * Description : PID校准参数确认输入数据 * Input : None * Output : None * Return : None *------------------------------------------------------------*/ void PidCalibrationEnterData( uint8_t index ) { uint8_t Bit = GetPidCalPutinBit(); if (PutinStatus == STATUS_EDIT_COMP) { if (PidCalibration.Area == PID_AREA) { switch ( PidCalibration.pid_area ) { case PID_SEGS: if ((TypeWriteInt < 1) || (TypeWriteInt>PID_MAX_SEGS)) { SetErr(&GeneralWarning,PCM_ERR,0xff,2,&PID_Err[0]); } else { lcd_fill(PID_RECTANGLE_X-COLUMN_DISTANCE-1,PID_RECTANGLE_Y,SERIAL_LEN+FORCE_LEN+KP_LEN+KI_LEN+5*COLUMN_DISTANCE+3,\ PidCalibration.pid_segs*(RECTANGLE_WIDTH+ROW_DISTANCE) + 10,COLOR_BACK); PidCalibration.pid_segs = TypeWriteInt; PIDAutoFill(PidCalibration.now_index,PidCalibration.pid_segs); GUI_PIDTable(PidCalibration.ch,PID_RECTANGLE_X,PID_RECTANGLE_Y,PidCalibration.pid_segs); Traverse_PidArea(PidCalibration.pid_segs); } break; case PID_FORCE: numtochar(Bit,TypeWriteInt,PidCalibration.data_pid[index].Force); break; case PID_KP: numtochar(Bit,TypeWriteInt,PidCalibration.data_pid[index].KP); break; case PID_KI: numtochar(Bit,TypeWriteInt,PidCalibration.data_pid[index].KI); break; } } else { switch ( PidCalibration.cal_area ) { case CAL_SEGS: if ((TypeWriteInt < 1) || (TypeWriteInt>CALIBRATION_MAX_SEGS)) { SetErr(&GeneralWarning,PCM_ERR,0xff,2,&CalibrationTable_Err[0]); } else { lcd_fill(CALIBRATION_RECTANGLE_X-COLUMN_DISTANCE-1,CALIBRATION_RECTANGLE_Y,SERIAL_LEN+FORCE_LEN+CODE_LEN+4*COLUMN_DISTANCE+3,\ PidCalibration.calibration_segs*(RECTANGLE_WIDTH+ROW_DISTANCE)+ 10,COLOR_BACK); PidCalibration.calibration_segs = TypeWriteInt; CalibrationTableAutoFill(PidCalibration.now_index,PidCalibration.calibration_segs); GUI_CalibrationTable(PidCalibration.ch,CALIBRATION_RECTANGLE_X,CALIBRATION_RECTANGLE_Y,PidCalibration.calibration_segs); Traverse_CalibrationArea(PidCalibration.calibration_segs); } break; case CAL_FORCE: numtochar(Bit,TypeWriteInt,PidCalibration.data_cal[index].Force); break; case CAL_CODE: numtochar(Bit,TypeWriteInt,PidCalibration.data_cal[index].Code); break; } } } if ((PutinStatus == STATUS_EDIT_COMP) || (PutinStatus == STATUS_CANCEL_PUTIN)) { if (PidCalibration.Area == PID_AREA) { if (PidCalibration.pid_area == PID_SEGS) { ShowPidSegs(); } else { ShowPidAreaOne(index); } } else { if (PidCalibration.cal_area == CAL_SEGS) { ShowCalibrationSegs(); } else { ShowCalibrationTableAreaOne(index); } } PidCalibrationDrawSeleteGUI(PidCalibration.now_index,DISABLE); PidCalibration.last_index = 0xff; // PidCalibrationAreaInsideUpdate(index); } }