Skip to content

Commit

Permalink
component refresh removed and retrun values corrected
Browse files Browse the repository at this point in the history
function return values corrected
component refresh removed as non needed anymore
ohject new refresh function
slider bacround and crop image functions
  • Loading branch information
jyberg committed Aug 2, 2020
1 parent 649637c commit 66a444f
Show file tree
Hide file tree
Showing 58 changed files with 399 additions and 651 deletions.
77 changes: 11 additions & 66 deletions NexButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ bool NexButton::setText(const char *buffer)
}


uint32_t NexButton::Get_background_color_bco(uint32_t *number)
bool NexButton::Get_background_color_bco(uint32_t *number)
{
String cmd;
cmd += "get ";
Expand All @@ -75,15 +75,10 @@ bool NexButton::Set_background_color_bco(uint32_t number)
cmd += ".bco=";
cmd += buf;
sendCommand(cmd.c_str());

cmd="";
cmd += "ref ";
getObjGlobalPageName(cmd);
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}

uint32_t NexButton::Get_press_background_color_bco2(uint32_t *number)
bool NexButton::Get_press_background_color_bco2(uint32_t *number)
{
String cmd;
cmd += "get ";
Expand All @@ -103,15 +98,10 @@ bool NexButton::Set_press_background_color_bco2(uint32_t number)
cmd += ".bco2=";
cmd += buf;
sendCommand(cmd.c_str());

cmd="";
cmd += "ref ";
getObjGlobalPageName(cmd);
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}

uint32_t NexButton::Get_font_color_pco(uint32_t *number)
bool NexButton::Get_font_color_pco(uint32_t *number)
{
String cmd;
cmd += "get ";
Expand All @@ -131,15 +121,10 @@ bool NexButton::Set_font_color_pco(uint32_t number)
cmd += ".pco=";
cmd += buf;
sendCommand(cmd.c_str());

cmd = "";
cmd += "ref ";
getObjGlobalPageName(cmd);
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}

uint32_t NexButton::Get_press_font_color_pco2(uint32_t *number)
bool NexButton::Get_press_font_color_pco2(uint32_t *number)
{
String cmd;
cmd += "get ";
Expand All @@ -159,15 +144,10 @@ bool NexButton::Set_press_font_color_pco2(uint32_t number)
cmd += ".pco2=";
cmd += buf;
sendCommand(cmd.c_str());

cmd = "";
cmd += "ref ";
getObjGlobalPageName(cmd);
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}

uint32_t NexButton::Get_place_xcen(uint32_t *number)
bool NexButton::Get_place_xcen(uint32_t *number)
{
String cmd;
cmd += "get ";
Expand All @@ -187,15 +167,10 @@ bool NexButton::Set_place_xcen(uint32_t number)
cmd += ".xcen=";
cmd += buf;
sendCommand(cmd.c_str());

cmd = "";
cmd += "ref ";
getObjGlobalPageName(cmd);
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}

uint32_t NexButton::Get_place_ycen(uint32_t *number)
bool NexButton::Get_place_ycen(uint32_t *number)
{
String cmd;
cmd += "get ";
Expand All @@ -215,15 +190,10 @@ bool NexButton::Set_place_ycen(uint32_t number)
cmd += ".ycen=";
cmd += buf;
sendCommand(cmd.c_str());

cmd = "";
cmd += "ref ";
getObjGlobalPageName(cmd);
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}

uint32_t NexButton::getFont(uint32_t *number)
bool NexButton::getFont(uint32_t *number)
{
String cmd;
cmd += "get ";
Expand All @@ -243,15 +213,10 @@ bool NexButton::setFont(uint32_t number)
cmd += ".font=";
cmd += buf;
sendCommand(cmd.c_str());

cmd = "";
cmd += "ref ";
getObjGlobalPageName(cmd);
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}

uint32_t NexButton::Get_background_cropi_picc(uint32_t *number)
bool NexButton::Get_background_cropi_picc(uint32_t *number)
{
String cmd;
cmd += "get ";
Expand All @@ -271,15 +236,10 @@ bool NexButton::Set_background_crop_picc(uint32_t number)
cmd += ".picc=";
cmd += buf;
sendCommand(cmd.c_str());

cmd = "";
cmd += "ref ";
getObjGlobalPageName(cmd);
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}

uint32_t NexButton::Get_press_background_crop_picc2(uint32_t *number)
bool NexButton::Get_press_background_crop_picc2(uint32_t *number)
{
String cmd;
cmd += "get ";
Expand All @@ -299,15 +259,10 @@ bool NexButton::Set_press_background_crop_picc2(uint32_t number)
cmd += ".picc2=";
cmd += buf;
sendCommand(cmd.c_str());

cmd = "";
cmd += "ref ";
getObjGlobalPageName(cmd);
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}

uint32_t NexButton::Get_background_image_pic(uint32_t *number)
bool NexButton::Get_background_image_pic(uint32_t *number)
{
String cmd;
cmd += "get ";
Expand All @@ -327,15 +282,10 @@ bool NexButton::Set_background_image_pic(uint32_t number)
cmd += ".pic=";
cmd += buf;
sendCommand(cmd.c_str());

cmd = "";
cmd += "ref ";
getObjGlobalPageName(cmd);
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}

uint32_t NexButton::Get_press_background_image_pic2(uint32_t *number)
bool NexButton::Get_press_background_image_pic2(uint32_t *number)
{
String cmd;
cmd += "get ";
Expand All @@ -355,10 +305,5 @@ bool NexButton::Set_press_background_image_pic2(uint32_t number)
cmd += ".pic2=";
cmd += buf;
sendCommand(cmd.c_str());

cmd = "";
cmd += "ref ";
getObjGlobalPageName(cmd);
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
44 changes: 22 additions & 22 deletions NexButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ class NexButton: public NexTouch
* Get bco attribute of component
*
* @param number - buffer storing data return
* @return the length of the data
* @return true if success, false for failure.
*/
uint32_t Get_background_color_bco(uint32_t *number);
bool Get_background_color_bco(uint32_t *number);

/**
* Set bco attribute of component
Expand All @@ -93,9 +93,9 @@ class NexButton: public NexTouch
* Get bco2 attribute of component
*
* @param number - buffer storing data return
* @return the length of the data
* @return true if success, false for failure.
*/
uint32_t Get_press_background_color_bco2(uint32_t *number);
bool Get_press_background_color_bco2(uint32_t *number);

/**
* Set bco2 attribute of component
Expand All @@ -109,9 +109,9 @@ class NexButton: public NexTouch
* Get pco attribute of component
*
* @param number - buffer storing data return
* @return the length of the data
* @return true if success, false for failure.
*/
uint32_t Get_font_color_pco(uint32_t *number);
bool Get_font_color_pco(uint32_t *number);

/**
* Set pco attribute of component
Expand All @@ -125,9 +125,9 @@ class NexButton: public NexTouch
* Get pco2 attribute of component
*
* @param number - buffer storing data return
* @return the length of the data
* @return true if success, false for failure.
*/
uint32_t Get_press_font_color_pco2(uint32_t *number);
bool Get_press_font_color_pco2(uint32_t *number);

/**
* Set pco2 attribute of component
Expand All @@ -141,9 +141,9 @@ class NexButton: public NexTouch
* Get xcen attribute of component
*
* @param number - buffer storing data return
* @return the length of the data
* @return true if success, false for failure.
*/
uint32_t Get_place_xcen(uint32_t *number);
bool Get_place_xcen(uint32_t *number);

/**
* Set xcen attribute of component
Expand All @@ -157,9 +157,9 @@ class NexButton: public NexTouch
* Get ycen attribute of component
*
* @param number - buffer storing data return
* @return the length of the data
* @return true if success, false for failure.
*/
uint32_t Get_place_ycen(uint32_t *number);
bool Get_place_ycen(uint32_t *number);

/**
* Set ycen attribute of component
Expand All @@ -173,9 +173,9 @@ class NexButton: public NexTouch
* Get font attribute of component
*
* @param number - buffer storing data return
* @return the length of the data
* @return true if success, false for failure.
*/
uint32_t getFont(uint32_t *number);
bool getFont(uint32_t *number);

/**
* Set font attribute of component
Expand All @@ -189,9 +189,9 @@ class NexButton: public NexTouch
* Get picc attribute of component
*
* @param number - buffer storing data return
* @return the length of the data
* @return true if success, false for failure.
*/
uint32_t Get_background_cropi_picc(uint32_t *number);
bool Get_background_cropi_picc(uint32_t *number);

/**
* Set picc attribute of component
Expand All @@ -205,9 +205,9 @@ class NexButton: public NexTouch
* Get picc2 attribute of component
*
* @param number - buffer storing data return
* @return the length of the data
* @return true if success, false for failure.
*/
uint32_t Get_press_background_crop_picc2(uint32_t *number);
bool Get_press_background_crop_picc2(uint32_t *number);

/**
* Set picc2 attribute of component
Expand All @@ -221,9 +221,9 @@ class NexButton: public NexTouch
* Get pic attribute of component
*
* @param number - buffer storing data return
* @return the length of the data
* @return true if success, false for failure.
*/
uint32_t Get_background_image_pic(uint32_t *number);
bool Get_background_image_pic(uint32_t *number);

/**
* Set pic attribute of component
Expand All @@ -237,9 +237,9 @@ class NexButton: public NexTouch
* Get pic2 attribute of component
*
* @param number - buffer storing data return
* @return the length of the data
* @return true if success, false for failure
*/
uint32_t Get_press_background_image_pic2(uint32_t *number);
bool Get_press_background_image_pic2(uint32_t *number);

/**
* Set pic2 attribute of component
Expand Down
16 changes: 3 additions & 13 deletions NexCheckbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ NexCheckbox::NexCheckbox(uint8_t pid, uint8_t cid, const char *name, const NexOb
{
}

uint32_t NexCheckbox::getValue(uint32_t *number)
bool NexCheckbox::getValue(uint32_t *number)
{
String cmd = String("get ");
getObjGlobalPageName(cmd);
Expand All @@ -44,7 +44,7 @@ bool NexCheckbox::setValue(uint32_t number)
return recvRetCommandFinished();
}

uint32_t NexCheckbox::Get_background_color_bco(uint32_t *number)
bool NexCheckbox::Get_background_color_bco(uint32_t *number)
{
String cmd;
cmd += "get ";
Expand All @@ -64,15 +64,10 @@ bool NexCheckbox::Set_background_color_bco(uint32_t number)
cmd += ".bco=";
cmd += buf;
sendCommand(cmd.c_str());

cmd="";
cmd += "ref ";
getObjGlobalPageName(cmd);
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}

uint32_t NexCheckbox::Get_font_color_pco(uint32_t *number)
bool NexCheckbox::Get_font_color_pco(uint32_t *number)
{
String cmd;
cmd += "get ";
Expand All @@ -92,10 +87,5 @@ bool NexCheckbox::Set_font_color_pco(uint32_t number)
cmd += ".pco=";
cmd += buf;
sendCommand(cmd.c_str());

cmd = "";
cmd += "ref ";
getObjGlobalPageName(cmd);
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
Loading

0 comments on commit 66a444f

Please sign in to comment.