高中生
最后登录1970-1-1
在线时间 小时
注册时间2018-3-17
|
#include "includes.h"
#include "app.h"
#include "DIALOG.h"
#include "string.h"
#define UTF8_MOVE "\xe5\x8a\xa8\xe4\xbd\x9c" //动作 UTF8_MOVE //步骤 UTF8_STEP //设置 UTF8_ESTABLISH //篇幅 UTF8_ARTICLE
#define UTF8_STEP "\xe6\xad\xa5\xe9\xaa\xa4" //步骤 UTF8_STEP
#define UTF8_ESTABLISH "\xe8\xae\xbe\xe7\xbd\xae" //设置 UTF8_ESTABLISH
#define UTF8_ARTICLE "\xe7\xaf\x87" //篇幅 UTF8_ARTICLE
#define UTF8_speedadds "\xe5\x8a\xa0\xe9\x80\x9f\xe5\xba\xa6" //+速度
#define UTF8_speedreduces "\xe5\x9f\xba\xe6\x9c\xac\xe9\x80\x9f\xe5\xba\xa6 " // 基本速度
#define UTF8_Heightadds "\xE6\x9D\x90\xE6\x96\x99\xE9\xAB\x98\xE5\xBA\xA6\x28\x4D\x4D\x29" //材料高度
#define UTF8_Diameteradds "\xE6\x9D\x90\xE6\x96\x99\xE7\x9B\xB4\xE5\xBE\x84\x28\x4D\x4D\x29" //线径
#define UTF8_Fuselage0 " "
static uint8_t num0, num1,num2,num3,num4; //+速度
static uint8_t sec0,sec1,sec2,sec3,sec4; //线径
static uint8_t Fuselage0, Fuselage1, Fuselage2, Fuselage3,Fuselage4, Fuselage5, Fuselage6, Fuselage7; //材料高度
static uint8_t Lowspeed0, Lowspeed1, Lowspeed2, Lowspeed3, Lowspeed4;// 基本速度
uint8_t hp=0;
#define EEP_Firstpage 0x00
uint8_t I2c_Buf_Write[256];
uint8_t I2c_Buf_Read[256];
//+速度
uint8_t test_addr1 = 0x00;
uint8_t test_addr2 = 0x01;
uint8_t test_addr3 = 0x02;
uint8_t test_addr4 = 0x03;
uint8_t test_addr5 = 0x04;
//线径
uint8_t Diameter_addr1 = 0x0b; //11
uint8_t Diameter_addr2 = 0x0c;
uint8_t Diameter_addr3 = 0x0d;
uint8_t Diameter_addr4 = 0x0e;
uint8_t Diameter_addr5 = 0x0f;
//材料高度
uint8_t Height_addr1 = 0x14; //20
uint8_t Height_addr2 = 0x15;
uint8_t Height_addr3 = 0x16;
uint8_t Height_addr4 = 0x17;
uint8_t Height_addr5 = 0x18;
uint8_t Height_addr6 = 0x19;
uint8_t Height_addr7 = 0x1a;
uint8_t Height_addr8 = 0x1b;
// 基本速度
uint8_t speedreduces_addr1 = 0x1e; //30
uint8_t speedreduces_addr2 = 0x1f;
uint8_t speedreduces_addr3 = 0x20;
uint8_t speedreduces_addr4 = 0x21;
uint8_t speedreduces_addr5 = 0x22;
/*********************************************************************
*
* _aDialogCreate
*/
static const GUI_WIDGET_CREATE_INFO _aDialogCreateRGBLED[] = {
{ FRAMEWIN_CreateIndirect, "RGBLED", 0, 0, 0, 800, 480, 0, 0x0, 0 },
{ EDIT_CreateIndirect, "rEdit0", GUI_ID_EDIT0+10, 100, 10, 30, 30, 0, 0x1, 0 },//+速度
{ EDIT_CreateIndirect, "rEdit1", GUI_ID_EDIT0+11, 125, 10, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "rEdit2", GUI_ID_EDIT0+12, 150, 10, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "rEdit3", GUI_ID_EDIT0+13, 175, 10, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "rEdit4", GUI_ID_EDIT0+14, 200, 10, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "gEdi0t", GUI_ID_EDIT1+30, 400+90, 10, 30, 30, 0, 0x1, 0 }, //线径
{ EDIT_CreateIndirect, "gEdi1t", GUI_ID_EDIT1+31, 425+90, 10, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "gEdi2t", GUI_ID_EDIT1+32, 450+90, 10, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "gEdi3t", GUI_ID_EDIT1+33, 475+90, 10, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "gEdi4t", GUI_ID_EDIT1+34, 500+90, 10, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "b0Edit", GUI_ID_EDIT2+40, 400+90, 95, 30, 30, 0, 0x1, 0 }, //材料高度
{ EDIT_CreateIndirect, "b1Edit", GUI_ID_EDIT2+41, 425+90, 95, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "b2Edit", GUI_ID_EDIT2+42, 450+90, 95, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "b3Edit", GUI_ID_EDIT2+43, 475+90, 95, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "b4Edit", GUI_ID_EDIT2+44, 500+90, 95, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "b5Edit", GUI_ID_EDIT2+45, 525+90, 95, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "b6Edit", GUI_ID_EDIT2+46, 550+90, 95, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "b7Edit", GUI_ID_EDIT2+47, 575+90, 95, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "uE0dit", GUI_ID_EDIT3+60, 100, 95, 30, 30, 0, 0x1, 0 }, // 基本速度
{ EDIT_CreateIndirect, "uE1dit", GUI_ID_EDIT3+61, 125, 95, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "uE2dit", GUI_ID_EDIT3+62, 150, 95, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "uE3dit", GUI_ID_EDIT3+63, 175, 95, 30, 30, 0, 0x1, 0 },
{ EDIT_CreateIndirect, "uE4dit", GUI_ID_EDIT3+64, 200, 95, 30, 30, 0, 0x1, 0 },
};
/*********************************************************************
*
* _cbDialog
*/
static void _cbDialogRGBLED(WM_MESSAGE * pMsg) {
WM_HWIN hItem;
int NCode;
int Id;
// USER START (Optionally insert additional variables)
char tempstr[50];
// USER END
switch (pMsg->MsgId) {
case WM_DELETE:
// USER START (Optionally insert additional code for further widget initialization)
OS_INFO("Joint4DLG delete\n");
Flag_ICON5 = 0;
UserApp_Flag = 0;
tpad_flag=0;
WM_DeleteWindow(hkeypad);
// ADC_Cmd(ADCn, DISABLE);
// USER END
break;
case WM_INIT_DIALOG:
//
// Initialization of 'RGBLED'
//
hItem = pMsg->hWin;
// sprintf(tempstr,"%s&%s",UTF8_RGBLEDDLG,UTF8_ADCONVER);
FRAMEWIN_SetText(hItem,tempstr);
FRAMEWIN_AddCloseButton(hItem,FRAMEWIN_BUTTON_RIGHT,0);
//
// Initialization of 'rEdit'
// num0=EEPROM_Byte_Read(test_addr1);
// num1=EEPROM_Byte_Read(test_addr2);
// num2=EEPROM_Byte_Read(test_addr3);
// num3=EEPROM_Byte_Read(test_addr4);
// num4=EEPROM_Byte_Read(test_addr5);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+10);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,num0,0,255);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+11);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,num1,0,255);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+12);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,num2,0,255);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+13);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,num3,0,255);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+14);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,num4,0,255);
EDIT_EnableBlink(hItem,250,1);
//
// Initialization of 'gEdit' //线径
/************************************************
sec0=EEPROM_Byte_Read(Diameter_addr1);
sec1=EEPROM_Byte_Read(Diameter_addr2);
sec2=EEPROM_Byte_Read(Diameter_addr3);
sec3=EEPROM_Byte_Read(Diameter_addr4);
sec4=EEPROM_Byte_Read(Diameter_addr5);
*************************************************/
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+30);
EDIT_SetUlongMode(hItem,sec0,0,255);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+31);
EDIT_SetUlongMode(hItem,sec1,0,255);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+32);
EDIT_SetUlongMode(hItem,sec2,0,255);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+33);
EDIT_SetUlongMode(hItem,sec3,0,255);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+34);
EDIT_SetUlongMode(hItem,sec4,0,255);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_EnableBlink(hItem,250,1);
//
// Initialization of 'bEdit'
//材料高度+40
/***********************************************
Fuselage0=EEPROM_Byte_Read(Height_addr1);
Fuselage1=EEPROM_Byte_Read(Height_addr2);
Fuselage2=EEPROM_Byte_Read(Height_addr3);
Fuselage3=EEPROM_Byte_Read(Height_addr4);
Fuselage4=EEPROM_Byte_Read(Height_addr5);
Fuselage5=EEPROM_Byte_Read(Height_addr6);
Fuselage6=EEPROM_Byte_Read(Height_addr7);
Fuselage7=EEPROM_Byte_Read(Height_addr8);
*************************************************/
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+40);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,Fuselage0,0,255);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+41);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,Fuselage1,0,255);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+42);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,Fuselage2,0,255);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+43);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,Fuselage3,0,255);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+44);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,Fuselage4,0,255);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+45);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,Fuselage5,0,255);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+46);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,Fuselage6,0,255);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+47);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,Fuselage7,0,255);
EDIT_EnableBlink(hItem,250,1);
//
// Initialization of 'aEdit'
/****************************************** // 基本速度+60
Lowspeed0=EEPROM_Byte_Read(speedreduces_addr1);
Lowspeed1=EEPROM_Byte_Read(speedreduces_addr2);
Lowspeed2=EEPROM_Byte_Read(speedreduces_addr3);
Lowspeed3=EEPROM_Byte_Read(speedreduces_addr4);
Lowspeed4=EEPROM_Byte_Read(speedreduces_addr5);
********************************************************/
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+60);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,Lowspeed0,0,255);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+61);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,Lowspeed1,0,255);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+62);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,Lowspeed2,0,255);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+63);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,Lowspeed3,0,255);
EDIT_EnableBlink(hItem,250,1);
hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+64);
EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
EDIT_SetUlongMode(hItem,Lowspeed4,0,255);
EDIT_EnableBlink(hItem,250,1);
// USER START (Optionally insert additional code for further widget initialization)
// USER END
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id) {
case GUI_ID_EDIT0+10: // Notifications sent by 'rEdit'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+10),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
Debug_USART_Config();
I2C_EE_Init();
num0=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+10));
I2C_EE_BufferWrite(&num0,test_addr1,256);
//SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER0),num);
WM_InvalidateWindow(pMsg->hWin);
// USER END
break;
// USER START (Optionally insert additional code for further notification handling)
// USER END
}
break;
case GUI_ID_EDIT0+11: // Notifications sent by 'rEdit'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// EEPROM_Byte_Write(&num1,test_addr2);
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+11),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
num1=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+11));
I2C_EE_BufferWrite(&num1,test_addr2,256);
//SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER0),num);
WM_InvalidateWindow(pMsg->hWin);
// USER END
break;
// USER START (Optionally insert additional code for further notification handling)
// USER END
}
break;
case GUI_ID_EDIT0+12: // Notifications sent by 'rEdit'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+12),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
num2=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+12));
I2C_EE_BufferWrite(&num2,test_addr3,256);
//SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER0),num2);
WM_InvalidateWindow(pMsg->hWin);
// USER END
break;
// USER START (Optionally insert additional code for further notification handling)
// USER END
}
break;
case GUI_ID_EDIT0+13: // Notifications sent by 'rEdit'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+13),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
num3=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+13));
I2C_EE_BufferWrite(&num3,test_addr4,256);
//SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER0),num3);
WM_InvalidateWindow(pMsg->hWin);
// USER END
break;
// USER START (Optionally insert additional code for further notification handling)
// USER END
}
break;
case GUI_ID_EDIT0+14: // Notifications sent by 'rEdit'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+14),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
num4=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+14));
I2C_EE_BufferWrite(&num4,test_addr5,256);
//SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER0),num4);
WM_InvalidateWindow(pMsg->hWin);
// USER END
break;
// USER START (Optionally insert additional code for further notification handling)
// USER END
}
break;
case GUI_ID_EDIT1+30: // Notifications sent by 'gEdit' //线径
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+30),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
sec0=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+30));
I2C_EE_BufferWrite(&sec0,Diameter_addr1,256); //写入保存的数据
WM_InvalidateWindow(pMsg->hWin);
// USER END
break;
}
break;
case GUI_ID_EDIT1+31: // Notifications sent by 'gEdit' //线径
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+31),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
sec1=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+31));
I2C_EE_BufferWrite(&sec1,Diameter_addr2,256); //写入保存的数据
WM_InvalidateWindow(pMsg->hWin);
// USER END
break;
}
break;
case GUI_ID_EDIT1+32: // Notifications sent by 'gEdit' //线径
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+32),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
sec2=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+32));
I2C_EE_BufferWrite(&sec2,Diameter_addr3,256); //写入保存的数据
WM_InvalidateWindow(pMsg->hWin);
// USER END
break;
}
break;
case GUI_ID_EDIT1+33: // Notifications sent by 'gEdit' //线径
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+33),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
sec3=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+33));
I2C_EE_BufferWrite(&sec3,Diameter_addr4,256); //写入保存的数据
WM_InvalidateWindow(pMsg->hWin);
// USER END
break;
}
break;
case GUI_ID_EDIT1+34: // Notifications sent by 'gEdit' //线径
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+34),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
sec4=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+34));
I2C_EE_BufferWrite(&sec4,Diameter_addr5,256); //写入保存的数据
WM_InvalidateWindow(pMsg->hWin);
// USER END
break;
}
break;
case GUI_ID_EDIT2+40: // Notifications sent by 'bEdit' //材料高度 0
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+40),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
Fuselage0=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+40));
I2C_EE_BufferWrite(&Fuselage0,Height_addr1,256); //写入保存的数据
//SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER2),Fuselage2);
WM_InvalidateWindow(pMsg->hWin);
break;
}
break;
case GUI_ID_EDIT2+41: // Notifications sent by 'bEdit' //材料高度 1
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+41),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
Fuselage1=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+41));
I2C_EE_BufferWrite(&Fuselage1,Height_addr2,256); //写入保存的数据
//SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER2),Fuselage2);
WM_InvalidateWindow(pMsg->hWin);
break;
}
break;
case GUI_ID_EDIT2+42: // Notifications sent by 'bEdit' //材料高度2
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+42),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
Fuselage2=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+42));
I2C_EE_BufferWrite(&Fuselage2,Height_addr3,256); //写入保存的数据
//SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER2),Fuselage2);
WM_InvalidateWindow(pMsg->hWin);
break;
}
break;
case GUI_ID_EDIT2+43: // Notifications sent by 'bEdit' //材料高度 3
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+43),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
Fuselage3=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+43));
I2C_EE_BufferWrite(&Fuselage3,Height_addr4,256); //写入保存的数据
//SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER2),Fuselage2);
WM_InvalidateWindow(pMsg->hWin);
break;
}
break;
case GUI_ID_EDIT2+44: // Notifications sent by 'bEdit' //材料高度4
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+44),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
Fuselage4=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+44));
I2C_EE_BufferWrite(&Fuselage4,Height_addr5,256); //写入保存的数据
//SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER2),Fuselage2);
WM_InvalidateWindow(pMsg->hWin);
break;
}
break;
case GUI_ID_EDIT2+45: // Notifications sent by 'bEdit' //材料高度 5
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+45),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
Fuselage5=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+45));
I2C_EE_BufferWrite(&Fuselage5,Height_addr6,256); //写入保存的数据
//SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER2),Fuselage2);
WM_InvalidateWindow(pMsg->hWin);
break;
}
break;
case GUI_ID_EDIT2+46: // Notifications sent by 'bEdit' //材料高度 6
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+46),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
Fuselage6=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+46));
I2C_EE_BufferWrite(&Fuselage6,Height_addr7,256); //写入保存的数据
//SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER2),Fuselage2);
WM_InvalidateWindow(pMsg->hWin);
break;
}
break;
case GUI_ID_EDIT2+47: // Notifications sent by 'bEdit' //材料高度 7
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+47),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
Fuselage7=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+47));
I2C_EE_BufferWrite(&Fuselage7,Height_addr8,256); //写入保存的数据
//SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER2),Fuselage2);
WM_InvalidateWindow(pMsg->hWin);
break;
}
break;
case GUI_ID_EDIT3+60: // Notifications sent by 'bEdit' // 基本速度0
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+60),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
Lowspeed0=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+60));
I2C_EE_BufferWrite(&Lowspeed0,speedreduces_addr1,256); //写入保存的数据
WM_InvalidateWindow(pMsg->hWin);
break;
}
break;
case GUI_ID_EDIT3+61: // Notifications sent by 'bEdit' // 基本速度01
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+61),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
Lowspeed1=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+61));
I2C_EE_BufferWrite(&Lowspeed1,speedreduces_addr2,256); //写入保存的数据Lowspeed
WM_InvalidateWindow(pMsg->hWin);
break;
}
break;
case GUI_ID_EDIT3+62: // Notifications sent by 'bEdit' // 基本速度02
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+62),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
Lowspeed2=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+62));
I2C_EE_BufferWrite(&Lowspeed2,speedreduces_addr3,256); //写入保存的数据
WM_InvalidateWindow(pMsg->hWin);
break;
}
break;
case GUI_ID_EDIT3+63: // Notifications sent by 'bEdit' // 基本速度03
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+63),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
Lowspeed3=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+63));
I2C_EE_BufferWrite(&Lowspeed3,speedreduces_addr4,256); //写入保存的数据
WM_InvalidateWindow(pMsg->hWin);
break;
}
break;
case GUI_ID_EDIT3+64: // Notifications sent by 'bEdit' // 基本速度04
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+64),0);
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
Lowspeed4=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+64));
I2C_EE_BufferWrite(&Lowspeed4,speedreduces_addr5,256); //写入保存的数据
WM_InvalidateWindow(pMsg->hWin);
break;
}
break;
}
break;
case WM_PAINT:
GUI_SetPenSize( 2 );
GUI_SetColor(GUI_MAGENTA );
GUI_SetFont(&XBF_XINSONGTI25);
GUI_SetColor(GUI_LIGHTBLUE);
// GUI_DispStringHCenterAt(UTF8_MOVE, 40,10);
GUI_DispStringHCenterAt(UTF8_speedadds, 55,15); //+速度 Fuselage0
GUI_DispStringHCenterAt(UTF8_speedreduces, 55,100); // 基本速度Fuselage3
GUI_DispStringHCenterAt(UTF8_Heightadds, 380,100); //材料高度Fuselage2
GUI_DispStringHCenterAt(UTF8_Diameteradds, 380,15); //线径 Fuselage1
default:
WM_DefaultProc(pMsg);
break;
}
}
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* CreateRGBLED
*/
void FUN_ICON5Clicked(void)
{
WM_HWIN hWin;
//
/* I2C 外设初(AT24C02)始化 */第一代STM32F429至尊板是在这里初始化OK可以的,数据保存后步进电机跑也可以的
OS_INFO("Joint4DLG create\n");
hWin=GUI_CreateDialogBox(_aDialogCreateRGBLED, GUI_COUNTOF(_aDialogCreateRGBLED), _cbDialogRGBLED, HDTWIN, 0, 0);
while(Flag_ICON5)
{
if(tpad_flag)WM_DeleteWindow(hWin);
GUI_Delay(10);
}
}
|
|