📄 housecontrol.c
字号:
/********************************************************************** SEGGER MICROCONTROLLER SYSTEME GmbH ** Solutions for real time microcontroller applications ************************************************************************ ** (c) 2002 SEGGER Microcontroller Systeme GmbH ** ** Internet: www.segger.com Support: support@segger.com ** *************************************************************************** emWin/GSC Grafical user interface for embedded applications ****emWin is protected by international copyright laws. Knowledge of thesource code may not be used to write a similar product. This file mayonly be used in accordance with a license and should not be re-distributed in any way. We appreciate your understanding and fairness.----------------------------------------------------------------------File : HouseControl.cPurpose : house control demo---------------------------END-OF-HEADER------------------------------*/#include <stdlib.h>#include <string.h>#include <math.h>#include "GUI.h"#include "FRAMEWIN.h"#include "MULTIPAGE.h"static void _cbWinAlert(WM_MESSAGE* pMsg);typedef void SERIAL_Callback(const char* pStr, int v1, int v2);/*********************************************************************** defines and statics for serial interface* (defined for target hardware only)************************************************************************/#ifndef WIN32 #include "RTOS.h" /********************************************************************* * * defines */ #define EOL 13 /* sign marking end of line */ #define BUFFER_SIZE 512 /* size of receive buffer */ #define STRING_SIZE 32 /* size of string buffer */ /********************************************************************* * * structures */ typedef struct { OS_U8* pDataEnd; OS_U8* pWrite; OS_U8* pRead; U16 Size; } BUFFER; /********************************************************************* * * static data */ static SERIAL_Callback* _pfcbReceiveCommand; /* buffer to hold string */ static char _acString[STRING_SIZE + 2]; static char* _pString = _acString; /* buffer for receiving */ static OS_U8 _Buffer[BUFFER_SIZE]; static BUFFER _RxBuffer = {_Buffer + BUFFER_SIZE, _Buffer, _Buffer, BUFFER_SIZE};#endif /* #ifndef WIN32 *//*********************************************************************** defines************************************************************************/#define PI2 6.2831853f#define RPM 10#define UPS 100#define ARRAY(aItems) aItems, GUI_COUNTOF(aItems)/*********************************************************************** structures************************************************************************/typedef struct { I16 ActV; I16 NewV; const GUI_RECT Rect;} OBJECT;typedef struct { OBJECT Light; I16 Elevator;} LEVEL;typedef struct { OBJECT Itself; OBJECT Door; I16 NumToDo; I16 ToDo[6]; I16 Move; I16 Pause; I16 Level; I16 LastLevel; int Time; WM_HWIN Handle;} ELEVATOR;/*********************************************************************** static data************************************************************************/static SCROLLBAR_Handle _hScroll;static WM_HWIN _hAlert[2];static WM_HWIN _hDialogLight;static WM_HWIN _hWinHouse;static WM_HWIN _hWinControl;static WM_HWIN _hWinMap;static const char _acAlertText[2][12] = {"Fire", "Burglary"};static int _AlertCnt[2];static int _SlidePrevTime;static int _ScrollPrevTime;static int _InitDialog;static int _ExecuteCommands;static int _LogoRPM = RPM;static int _LogoWaitTime = 1000 / UPS;static int _LogoPrevTime;static int _LogoPrevMulX;static int _LogoMulX;static float _LogoDivisor;static float _LogoAngle;static LEVEL _Level[6] = { {{0, 0, { 35, 650, 164, 780}}, 0}, {{0, 0, { 35, 520, 164, 650}}, 0}, {{0, 0, { 35, 390, 164, 520}}, 0}, {{0, 0, { 35, 260, 164, 390}}, 0}, {{0, 0, { 35, 130, 164, 260}}, 0}, {{0, 0, { 35, 0, 164, 130}}, 0},};static ELEVATOR _Elevator = { {0, 0, { 57, 130, 83, 780}}, // the elevator itself {0, 0, { 57, 82, 83, 125}}, // the elevator door 0, {0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0};static OBJECT _Garage = {0, 0, { 40, 732, 90, 776}};static OBJECT _Jalousie1 = {0, 0, {165, 400, 167, 493}};static OBJECT _Jalousie2 = {0, 0, { 32, 140, 34, 233}};static OBJECT _Marquee1 = {0, 0, {165, 549, 196, 566}};static OBJECT _Marquee2 = {0, 0, { 3, 289, 34, 306}};static OBJECT _Scroll = {0, 0, { 0, 0, 199, 780}};static OBJECT _LogoArrow = {0, 0, { 58, 69, 139, 100}};static OBJECT _Logo = {0, 0, { 58, 46, 139, 69}};static OBJECT _LogoSmall = {0, 0, { 7, 8, 47, 19}};static OBJECT _GarageSmall = {0, 0, { 10, 220, 24, 232}};static OBJECT _Jalousie1Small = {0, 0, { 48, 120, 49, 147}};static OBJECT _Jalousie2Small = {0, 0, { 6, 42, 7, 69}};static OBJECT _Marquee1Small = {0, 0, { 48, 166, 55, 170}};static OBJECT _Marquee2Small = {0, 0, { 0, 88, 7, 92}};static OBJECT _ElevatorSmall = {0, 0, { 14, 40, 23, 233}};static OBJECT _LightSmall[6] = { {0, 0, { 8, 195, 48, 234}}, {0, 0, { 8, 156, 48, 195}}, {0, 0, { 8, 117, 48, 156}}, {0, 0, { 8, 78, 48, 117}}, {0, 0, { 8, 39, 48, 78}}, {0, 0, { 8, 0, 48, 39}},};/*********************************************************************** static data, dialog resource************************************************************************//*********************************************************************** DialogLight*/static const GUI_WIDGET_CREATE_INFO _aDialogLight[] = { { WINDOW_CreateIndirect, "", 0, 0, 0, 113, 140, WM_CF_SHOW }, { TEXT_CreateIndirect, "5.Floor:", 0, 5, 8, 40, 23, TEXT_CF_LEFT }, { TEXT_CreateIndirect, "4.Floor:", 0, 5, 33, 40, 23, TEXT_CF_LEFT }, { TEXT_CreateIndirect, "3.Floor:", 0, 5, 58, 40, 23, TEXT_CF_LEFT }, { TEXT_CreateIndirect, "2.Floor:", 0, 5, 83, 40, 23, TEXT_CF_LEFT }, { TEXT_CreateIndirect, "1.Floor:", 0, 5, 108, 40, 23, TEXT_CF_LEFT }, { SLIDER_CreateIndirect, NULL, GUI_ID_SLIDER4, 45, 4, 64, 23 }, { SLIDER_CreateIndirect, NULL, GUI_ID_SLIDER3, 45, 29, 64, 23 }, { SLIDER_CreateIndirect, NULL, GUI_ID_SLIDER2, 45, 54, 64, 23 }, { SLIDER_CreateIndirect, NULL, GUI_ID_SLIDER1, 45, 79, 64, 23 }, { SLIDER_CreateIndirect, NULL, GUI_ID_SLIDER0, 45, 104, 64, 23 }};/*********************************************************************** DialogMisc*/static const GUI_WIDGET_CREATE_INFO _aDialogMisc[] = { { WINDOW_CreateIndirect, "", 0, 0, 0, 113, 140, WM_CF_SHOW }, { BUTTON_CreateIndirect, "Jalousie 1", GUI_ID_BUTTON0, 5, 3, 103, 19, TEXT_CF_HCENTER }, { BUTTON_CreateIndirect, "Jalousie 2", GUI_ID_BUTTON1, 5, 24, 103, 19, TEXT_CF_HCENTER }, { BUTTON_CreateIndirect, "Marquee 1", GUI_ID_BUTTON2, 5, 45, 103, 19, TEXT_CF_HCENTER }, { BUTTON_CreateIndirect, "Marquee 2", GUI_ID_BUTTON3, 5, 66, 103, 19, TEXT_CF_HCENTER }, { BUTTON_CreateIndirect, "Garage", GUI_ID_BUTTON4, 5, 87, 103, 19, TEXT_CF_HCENTER }, { BUTTON_CreateIndirect, "<", GUI_ID_BUTTON5, 5, 108, 20, 19, TEXT_CF_HCENTER }, { BUTTON_CreateIndirect, "LogoStop", GUI_ID_BUTTON6, 27, 108, 59, 19, TEXT_CF_HCENTER }, { BUTTON_CreateIndirect, ">", GUI_ID_BUTTON7, 88, 108, 20, 19, TEXT_CF_HCENTER }};/*********************************************************************** DialogElev*/static const GUI_WIDGET_CREATE_INFO _aDialogElev[] = { { WINDOW_CreateIndirect, "", 0, 9, 8, 113, 140, WM_CF_SHOW }, { BUTTON_CreateIndirect, "", GUI_ID_BUTTON4, 16, 21, 16, 16, TEXT_CF_HCENTER}, { BUTTON_CreateIndirect, "", GUI_ID_BUTTON3, 16, 39, 16, 16, TEXT_CF_HCENTER}, { BUTTON_CreateIndirect, "", GUI_ID_BUTTON2, 16, 57, 16, 16, TEXT_CF_HCENTER}, { BUTTON_CreateIndirect, "", GUI_ID_BUTTON1, 16, 75, 16, 16, TEXT_CF_HCENTER}, { BUTTON_CreateIndirect, "", GUI_ID_BUTTON0, 16, 93, 16, 16, TEXT_CF_HCENTER}, { BUTTON_CreateIndirect, "Door", GUI_ID_BUTTON5, 42, 21, 53, 16, TEXT_CF_HCENTER}, { BUTTON_CreateIndirect, "Pause", GUI_ID_BUTTON6, 42, 39, 53, 16, TEXT_CF_HCENTER}};/*********************************************************************** static data, polygons************************************************************************//*********************************************************************** Arrows*/static const GUI_POINT _aArrowUp[] = { {1, 0}, {4, 3}, { 1, 3}, {1, 8}, {0, 8}, {0, 3}, {-3, 3}, {0, 0}};static const GUI_POINT _aArrowDown[] = { {1, 8}, {4, 5}, { 1, 5}, {1, 0}, {0, 0}, {0, 5}, {-3, 5}, {0, 8}};static GUI_POINT _aArrowRight[] = { {0, 0}, {5, 0}, { 5,-3}, {8, 0}, {8, 1}, {5, 4}, { 5, 1}, {0, 1}};static GUI_POINT _aArrowLeft[] = { {0, 0}, {3,-3}, { 3, 0}, {8, 0}, {8, 1}, {3, 1}, { 3, 4}, {0, 1}};/*********************************************************************** Roof*/static GUI_POINT _aRoof[] = { {0, 0}, {75, 60}, {-75, 60}};static GUI_POINT _aRoofMini[] = { {0, 0}, {119, 90}, {-119, 90}};/*********************************************************************** static data, bitmaps************************************************************************//*********************************************************************** NEC_Logo*/static const GUI_COLOR _ColorsNEC_Logo[] = { 0x000000,0x960000,0xA10000,0x9B0000 ,0xA90000,0xB00000,0xB80000,0xBD0000 ,0xCC2323,0xC21919,0xB50000,0xAC0000 ,0xC92020,0xBA0000,0xC70000,0xA40000};static const GUI_LOGPALETTE _PalNEC_Logo = { 16, /* number of entries */ 1, /* No transparency */ &_ColorsNEC_Logo[0]};static const unsigned char _acNEC_Logo[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x22, 0x22, 0x22, 0x20, 0x00, 0x00, 0x00, 0x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xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x00, 0x01, 0xAC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCE, 0x88, 0x8E, 0xCC, 0xCC, 0x70, 0x02, 0xCC, 0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1D, 0xCC, 0xCC, 0xCC, 0xCC, 0xC3, 0x00, 0x03, 0x7C, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x00, 0x00, 0x03, 0xAE, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x70, 0x03, 0xAA, 0xA4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x25, 0xAA, 0xAA, 0xAA, 0xA1, 0x00, 0x00, 0x02, 0xB6, 0x77, 0x79, 0x88, 0x88, 0x88, 0x88, 0x77, 0x77, 0x6A, 0x00, 0x00, 0x00, 0x01, 0xF5, 0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xC8, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x32, 0x22, 0x22, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};static const GUI_BITMAP _NEC_Logo = { 82, /* XSize */ 26, /* YSize */ 41, /* BytesPerLine */ 4, /* BitsPerPixel */ _acNEC_Logo, /* Pointer to picture data (indices) */ &_PalNEC_Logo /* Pointer to palette */};/*********************************************************************** TouchCursor*/static const GUI_COLOR _ColorsTouchCursor[] = { 0x0000FF,0x000000,0xFFFFFF};static const GUI_LOGPALETTE _PalTouchCursor = { 3, /* number of entries */ 1, /* Has transparency */ &_ColorsTouchCursor[0]};static const unsigned char _acTouchCursor[] = { 0x00, 0x00, 0x00, 0x01, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x94, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0x56, 0xA5, 0x55, 0x55, 0x55, 0x40, 0x6A, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x40, 0x55, 0x55, 0x55, 0x56, 0xA5, 0x55, 0x55, 0x55, 0x40, 0x00, 0x00, 0x00, 0x05, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x50, 0x00, 0x00, 0x00, 0x00};static const GUI_BITMAP _bmTouchCursor = { 33, /* XSize */ 17, /* YSize */ 9, /* BytesPerLine */ 2, /* BitsPerPixel */ _acTouchCursor, /* Pointer to picture data (indices) */ &_PalTouchCursor /* Pointer to palette */};static const GUI_CURSOR _TouchCursor = { &_bmTouchCursor, 15, 7};/*********************************************************************** static code, serial interface* (defined for target hardware only)************************************************************************/#ifndef WIN32 /********************************************************************* * * _cbReceiveData */ static void _cbReceiveData(OS_U8 Data) { *(_RxBuffer.pWrite)++ = Data; if (_RxBuffer.pWrite == _RxBuffer.pDataEnd) { _RxBuffer.pWrite -= _RxBuffer.Size; } } /********************************************************************* * * _SendString */ static void _SendString(const char* pStr) { OS_SendString(pStr); } /********************************************************************* * * _ConvIntToStr */ static char* _ConvIntToStr(char* pStr, int Value) { char* Ptr = pStr + 4; int v = Value; *Ptr = 0; do { *(--Ptr) = (v % 10) + '0'; v /= 10; } while (v && (Ptr != pStr)); strcpy(pStr, Ptr); return pStr; } /********************************************************************* * * _ConvStrToInt */ static int _ConvStrToInt(char* pStr) { char* Ptr = pStr; int r = 0; while (*Ptr) { r *= 10; r += *(Ptr++) - '0'; } return r; } /********************************************************************* * * _ReceivedString */ static void _ReceivedString(const char* pStr) { int v1 = -1, v2 = -1; char* Ptr; Ptr = strrchr(pStr, ' '); if (Ptr != NULL) { v1 = _ConvStrToInt(Ptr + 1); *Ptr = 0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -