diff --git a/NexButton.cpp b/NexButton.cpp index 5d92d3ce..675d5e32 100755 --- a/NexButton.cpp +++ b/NexButton.cpp @@ -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 "; @@ -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 "; @@ -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 "; @@ -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 "; @@ -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 "; @@ -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 "; @@ -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 "; @@ -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 "; @@ -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 "; @@ -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 "; @@ -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 "; @@ -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(); } diff --git a/NexButton.h b/NexButton.h index 1e827a32..320c8f2e 100755 --- a/NexButton.h +++ b/NexButton.h @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/NexCheckbox.cpp b/NexCheckbox.cpp index 4b03b47d..088d5ed4 100755 --- a/NexCheckbox.cpp +++ b/NexCheckbox.cpp @@ -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); @@ -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 "; @@ -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 "; @@ -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(); } \ No newline at end of file diff --git a/NexCheckbox.h b/NexCheckbox.h index 23e848f7..e85e16ba 100755 --- a/NexCheckbox.h +++ b/NexCheckbox.h @@ -46,9 +46,9 @@ class NexCheckbox: public NexTouch * Get val attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure */ - uint32_t getValue(uint32_t *number); + bool getValue(uint32_t *number); /** * Set val attribute of component @@ -62,9 +62,9 @@ class NexCheckbox: public NexTouch * Get bco attribute of component * * @param number - buffer storing data retur - * @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 @@ -78,9 +78,9 @@ class NexCheckbox: public NexTouch * Get pco attribute of component * * @param number - buffer storing data retur - * @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 diff --git a/NexDualStateButton.cpp b/NexDualStateButton.cpp index 270fa9f1..381cf932 100755 --- a/NexDualStateButton.cpp +++ b/NexDualStateButton.cpp @@ -77,7 +77,7 @@ bool NexDSButton::setText(const char *buffer) return recvRetCommandFinished(); } -uint32_t NexDSButton::Get_state0_color_bco0(uint32_t *number) +bool NexDSButton::Get_state0_color_bco0(uint32_t *number) { String cmd; cmd += "get "; @@ -97,15 +97,10 @@ bool NexDSButton::Set_state0_color_bco0(uint32_t number) cmd += ".bco0="; cmd += buf; sendCommand(cmd.c_str()); - - cmd=""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } -uint32_t NexDSButton::Get_state1_color_bco1(uint32_t *number) +bool NexDSButton::Get_state1_color_bco1(uint32_t *number) { String cmd; cmd += "get "; @@ -125,15 +120,10 @@ bool NexDSButton::Set_state1_color_bco1(uint32_t number) cmd += ".bco1="; cmd += buf; sendCommand(cmd.c_str()); - - cmd=""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } -uint32_t NexDSButton::Get_font_color_pco(uint32_t *number) +bool NexDSButton::Get_font_color_pco(uint32_t *number) { String cmd; cmd += "get "; @@ -153,15 +143,10 @@ bool NexDSButton::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 NexDSButton::Get_place_xcen(uint32_t *number) +bool NexDSButton::Get_place_xcen(uint32_t *number) { String cmd; cmd += "get "; @@ -181,15 +166,10 @@ bool NexDSButton::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 NexDSButton::Get_place_ycen(uint32_t *number) +bool NexDSButton::Get_place_ycen(uint32_t *number) { String cmd; cmd += "get "; @@ -209,15 +189,10 @@ bool NexDSButton::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 NexDSButton::getFont(uint32_t *number) +bool NexDSButton::getFont(uint32_t *number) { String cmd; cmd += "get "; @@ -237,15 +212,10 @@ bool NexDSButton::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 NexDSButton::Get_state0_crop_picc0(uint32_t *number) +bool NexDSButton::Get_state0_crop_picc0(uint32_t *number) { String cmd; cmd += "get "; @@ -265,15 +235,10 @@ bool NexDSButton::Set_state0_crop_picc0(uint32_t number) cmd += ".picc0="; cmd += buf; sendCommand(cmd.c_str()); - - cmd = ""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } -uint32_t NexDSButton::Get_state1_crop_picc1(uint32_t *number) +bool NexDSButton::Get_state1_crop_picc1(uint32_t *number) { String cmd; cmd += "get "; @@ -293,15 +258,10 @@ bool NexDSButton::Set_state1_crop_picc1(uint32_t number) cmd += ".picc1="; cmd += buf; sendCommand(cmd.c_str()); - - cmd = ""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } -uint32_t NexDSButton::Get_state0_image_pic0(uint32_t *number) +bool NexDSButton::Get_state0_image_pic0(uint32_t *number) { String cmd; cmd += "get "; @@ -321,15 +281,10 @@ bool NexDSButton::Set_state0_image_pic0(uint32_t number) cmd += ".pic0="; cmd += buf; sendCommand(cmd.c_str()); - - cmd = ""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } -uint32_t NexDSButton::Get_state1_image_pic1(uint32_t *number) +bool NexDSButton::Get_state1_image_pic1(uint32_t *number) { String cmd; cmd += "get "; @@ -349,11 +304,6 @@ bool NexDSButton::Set_state1_image_pic1(uint32_t number) cmd += ".pic1="; cmd += buf; sendCommand(cmd.c_str()); - - cmd = ""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } diff --git a/NexDualStateButton.h b/NexDualStateButton.h index d0d5e159..8ba3d40a 100755 --- a/NexDualStateButton.h +++ b/NexDualStateButton.h @@ -91,9 +91,9 @@ class NexDSButton: public NexTouch * Get bco0 attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure */ - uint32_t Get_state0_color_bco0(uint32_t *number); + bool Get_state0_color_bco0(uint32_t *number); /** * Set bco0 attribute of component @@ -107,9 +107,9 @@ class NexDSButton: public NexTouch * Get bco1 attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure */ - uint32_t Get_state1_color_bco1(uint32_t *number); + bool Get_state1_color_bco1(uint32_t *number); /** * Set bco1 attribute of component @@ -123,9 +123,9 @@ class NexDSButton: public NexTouch * Get pco attribute of component * * @param number - buffer storing data retur - * @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 @@ -139,9 +139,9 @@ class NexDSButton: public NexTouch * Get xcen attribute of component * * @param number - buffer storing data retur - * @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 @@ -155,9 +155,9 @@ class NexDSButton: public NexTouch * Get ycen attribute of component * * @param number - buffer storing data retur - * @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 @@ -171,9 +171,9 @@ class NexDSButton: public NexTouch * Get font attribute of component * * @param number - buffer storing data retur - * @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 @@ -187,9 +187,9 @@ class NexDSButton: public NexTouch * Get picc0 attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure */ - uint32_t Get_state0_crop_picc0(uint32_t *number); + bool Get_state0_crop_picc0(uint32_t *number); /** * Set picc0 attribute of component @@ -203,9 +203,9 @@ class NexDSButton: public NexTouch * Get picc1 attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure */ - uint32_t Get_state1_crop_picc1(uint32_t *number); + bool Get_state1_crop_picc1(uint32_t *number); /** * Set picc1 attribute of component @@ -219,9 +219,9 @@ class NexDSButton: public NexTouch * Get pic0 attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure */ - uint32_t Get_state0_image_pic0(uint32_t *number); + bool Get_state0_image_pic0(uint32_t *number); /** * Set pic0 attribute of component @@ -235,9 +235,9 @@ class NexDSButton: public NexTouch * Get pic1 attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure */ - uint32_t Get_state1_image_pic1(uint32_t *number); + bool Get_state1_image_pic1(uint32_t *number); /** * Set pic1 attribute of component diff --git a/NexGauge.cpp b/NexGauge.cpp index 002e0d91..4baefca0 100755 --- a/NexGauge.cpp +++ b/NexGauge.cpp @@ -45,7 +45,7 @@ bool NexGauge::setValue(uint32_t number) return recvRetCommandFinished(); } -uint32_t NexGauge::Get_background_color_bco(uint32_t *number) +bool NexGauge::Get_background_color_bco(uint32_t *number) { String cmd; cmd += "get "; @@ -65,15 +65,10 @@ bool NexGauge::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 NexGauge::Get_font_color_pco(uint32_t *number) +bool NexGauge::Get_font_color_pco(uint32_t *number) { String cmd; cmd += "get "; @@ -92,16 +87,10 @@ bool NexGauge::Set_font_color_pco(uint32_t number) getObjGlobalPageName(cmd); cmd += ".pco="; cmd += buf; - sendCommand(cmd.c_str()); - - cmd = ""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } -uint32_t NexGauge::Get_pointer_thickness_wid(uint32_t *number) +bool NexGauge::Get_pointer_thickness_wid(uint32_t *number) { String cmd; cmd += "get "; @@ -121,15 +110,10 @@ bool NexGauge::Set_pointer_thickness_wid(uint32_t number) cmd += ".wid="; cmd += buf; sendCommand(cmd.c_str()); - - cmd = ""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } -uint32_t NexGauge::Get_background_cropi_picc(uint32_t *number) +bool NexGauge::Get_background_cropi_picc(uint32_t *number) { String cmd; cmd += "get "; @@ -149,11 +133,6 @@ bool NexGauge::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(); } diff --git a/NexGauge.h b/NexGauge.h index 19f17554..95c02593 100755 --- a/NexGauge.h +++ b/NexGauge.h @@ -60,9 +60,9 @@ class NexGauge: public NexObject * Get bco attribute of component * * @param number - buffer storing data retur - * @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 @@ -76,9 +76,9 @@ class NexGauge: public NexObject * Get pco attribute of component * * @param number - buffer storing data retur - * @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 @@ -92,9 +92,9 @@ class NexGauge: public NexObject * Get wid attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure */ - uint32_t Get_pointer_thickness_wid(uint32_t *number); + bool Get_pointer_thickness_wid(uint32_t *number); /** * Set wid attribute of component @@ -108,9 +108,9 @@ class NexGauge: public NexObject * Get picc attribute of component * * @param number - buffer storing data retur - * @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 diff --git a/NexNumber.cpp b/NexNumber.cpp index 93a6521e..b2145567 100755 --- a/NexNumber.cpp +++ b/NexNumber.cpp @@ -44,7 +44,7 @@ bool NexNumber::setValue(uint32_t number) return recvRetCommandFinished(); } -uint32_t NexNumber::Get_background_color_bco(uint32_t *number) +bool NexNumber::Get_background_color_bco(uint32_t *number) { String cmd; cmd += "get "; @@ -64,15 +64,10 @@ bool NexNumber::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 NexNumber::Get_font_color_pco(uint32_t *number) +bool NexNumber::Get_font_color_pco(uint32_t *number) { String cmd; cmd += "get "; @@ -92,15 +87,10 @@ bool NexNumber::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 NexNumber::Get_place_xcen(uint32_t *number) +bool NexNumber::Get_place_xcen(uint32_t *number) { String cmd; cmd += "get "; @@ -120,15 +110,10 @@ bool NexNumber::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 NexNumber::Get_place_ycen(uint32_t *number) +bool NexNumber::Get_place_ycen(uint32_t *number) { String cmd; cmd += "get "; @@ -148,15 +133,10 @@ bool NexNumber::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 NexNumber::getFont(uint32_t *number) +bool NexNumber::getFont(uint32_t *number) { String cmd; cmd += "get "; @@ -176,15 +156,10 @@ bool NexNumber::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 NexNumber::Get_number_lenth(uint32_t *number) +bool NexNumber::Get_number_lenth(uint32_t *number) { String cmd; cmd += "get "; @@ -205,14 +180,10 @@ bool NexNumber::Set_number_lenth(uint32_t number) cmd += buf; sendCommand(cmd.c_str()); - cmd = ""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } -uint32_t NexNumber::Get_background_crop_picc(uint32_t *number) +bool NexNumber::Get_background_crop_picc(uint32_t *number) { String cmd; cmd += "get "; @@ -232,15 +203,10 @@ bool NexNumber::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 NexNumber::Get_background_image_pic(uint32_t *number) +bool NexNumber::Get_background_image_pic(uint32_t *number) { String cmd = String("get "); getObjGlobalPageName(cmd); @@ -259,10 +225,5 @@ bool NexNumber::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(); } \ No newline at end of file diff --git a/NexNumber.h b/NexNumber.h index 487f5482..15b30f05 100755 --- a/NexNumber.h +++ b/NexNumber.h @@ -56,9 +56,9 @@ class NexNumber: public NexTouch * Get bco attribute of component * * @param number - buffer storing data retur - * @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 @@ -72,9 +72,9 @@ class NexNumber: public NexTouch * Get pco attribute of component * * @param number - buffer storing data retur - * @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 @@ -88,9 +88,9 @@ class NexNumber: public NexTouch * Get xcen attribute of component * * @param number - buffer storing data retur - * @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 @@ -104,9 +104,9 @@ class NexNumber: public NexTouch * Get ycen attribute of component * * @param number - buffer storing data retur - * @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 @@ -120,9 +120,9 @@ class NexNumber: public NexTouch * Get font attribute of component * * @param number - buffer storing data retur - * @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 @@ -136,9 +136,9 @@ class NexNumber: public NexTouch * Get lenth attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure */ - uint32_t Get_number_lenth(uint32_t *number); + bool Get_number_lenth(uint32_t *number); /** * Set lenth attribute of component @@ -152,9 +152,9 @@ class NexNumber: public NexTouch * Get picc attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure */ - uint32_t Get_background_crop_picc(uint32_t *number); + bool Get_background_crop_picc(uint32_t *number); /** * Set picc attribute of component @@ -168,9 +168,9 @@ class NexNumber: public NexTouch * Get pic attribute of component * * @param number - buffer storing data retur - * @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 diff --git a/NexObject.cpp b/NexObject.cpp index 4cddd24c..1f9dbf96 100644 --- a/NexObject.cpp +++ b/NexObject.cpp @@ -120,3 +120,10 @@ bool NexObject::setVisible(bool visible) return recvRetCommandFinished(); } +bool NexObject::refresh() +{ + String cmd = String("ref "); + cmd += __name; + sendCommand(cmd.c_str()); + return recvRetCommandFinished(); +} \ No newline at end of file diff --git a/NexObject.h b/NexObject.h index eb9a7f68..44fad288 100644 --- a/NexObject.h +++ b/NexObject.h @@ -74,6 +74,13 @@ class NexObject */ bool setVisible(bool visible); + /** + * Refresh componen on current page + * + * @return true if success, false for failure + */ + bool refresh(); + protected: /* methods */ /* diff --git a/NexPicture.cpp b/NexPicture.cpp index 421a2801..204426ff 100755 --- a/NexPicture.cpp +++ b/NexPicture.cpp @@ -40,7 +40,6 @@ bool NexPicture::Set_background_image_pic(uint32_t number) getObjGlobalPageName(cmd); cmd += ".pic="; cmd += buf; - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } @@ -63,7 +62,6 @@ bool NexPicture::setPic(uint32_t number) getObjGlobalPageName(cmd); cmd += ".pic="; cmd += buf; - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } diff --git a/NexProgressBar.cpp b/NexProgressBar.cpp index 8294eda0..d4137ee0 100755 --- a/NexProgressBar.cpp +++ b/NexProgressBar.cpp @@ -45,7 +45,7 @@ bool NexProgressBar::setValue(uint32_t number) return recvRetCommandFinished(); } -uint32_t NexProgressBar::Get_background_color_bco(uint32_t *number) +bool NexProgressBar::Get_background_color_bco(uint32_t *number) { String cmd; cmd += "get "; @@ -73,7 +73,7 @@ bool NexProgressBar::Set_background_color_bco(uint32_t number) return recvRetCommandFinished(); } -uint32_t NexProgressBar::Get_font_color_pco(uint32_t *number) +bool NexProgressBar::Get_font_color_pco(uint32_t *number) { String cmd; cmd += "get "; diff --git a/NexProgressBar.h b/NexProgressBar.h index 21124749..ac313c9d 100755 --- a/NexProgressBar.h +++ b/NexProgressBar.h @@ -60,9 +60,9 @@ class NexProgressBar: public NexObject * Get bco attribute of component * * @param number - buffer storing data retur - * @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 @@ -76,9 +76,9 @@ class NexProgressBar: public NexObject * Get pco attribute of component * * @param number - buffer storing data retur - * @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 diff --git a/NexRadio.cpp b/NexRadio.cpp index 90e1dce3..a6a5299e 100755 --- a/NexRadio.cpp +++ b/NexRadio.cpp @@ -21,7 +21,7 @@ NexRadio::NexRadio(uint8_t pid, uint8_t cid, const char *name, const NexObject* { } -uint32_t NexRadio::getValue(uint32_t *number) +bool NexRadio::getValue(uint32_t *number) { String cmd = String("get "); getObjGlobalPageName(cmd); @@ -44,7 +44,7 @@ bool NexRadio::setValue(uint32_t number) return recvRetCommandFinished(); } -uint32_t NexRadio::Get_background_color_bco(uint32_t *number) +bool NexRadio::Get_background_color_bco(uint32_t *number) { String cmd; cmd += "get "; @@ -72,7 +72,7 @@ bool NexRadio::Set_background_color_bco(uint32_t number) return recvRetCommandFinished(); } -uint32_t NexRadio::Get_font_color_pco(uint32_t *number) +bool NexRadio::Get_font_color_pco(uint32_t *number) { String cmd; cmd += "get "; diff --git a/NexRadio.h b/NexRadio.h index 8a08ae7b..e765c970 100755 --- a/NexRadio.h +++ b/NexRadio.h @@ -46,9 +46,9 @@ class NexRadio:public NexTouch * Get val attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure */ - uint32_t getValue(uint32_t *number); + bool getValue(uint32_t *number); /** * Set val attribute of component @@ -62,9 +62,9 @@ class NexRadio:public NexTouch * Get bco attribute of component * * @param number - buffer storing data retur - * @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 @@ -78,9 +78,9 @@ class NexRadio:public NexTouch * Get pco attribute of component * * @param number - buffer storing data retur - * @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 diff --git a/NexScrolltext.cpp b/NexScrolltext.cpp index 0bfa4bac..e5af4047 100755 --- a/NexScrolltext.cpp +++ b/NexScrolltext.cpp @@ -53,7 +53,7 @@ bool NexScrolltext::setText(const char *buffer) return recvRetCommandFinished(); } -uint32_t NexScrolltext::Get_background_color_bco(uint32_t *number) +bool NexScrolltext::Get_background_color_bco(uint32_t *number) { String cmd; cmd += "get "; @@ -73,15 +73,10 @@ bool NexScrolltext::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 NexScrolltext::Get_font_color_pco(uint32_t *number) +bool NexScrolltext::Get_font_color_pco(uint32_t *number) { String cmd; cmd += "get "; @@ -101,15 +96,10 @@ bool NexScrolltext::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 NexScrolltext::Get_place_xcen(uint32_t *number) +bool NexScrolltext::Get_place_xcen(uint32_t *number) { String cmd; cmd += "get "; @@ -129,15 +119,10 @@ bool NexScrolltext::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 NexScrolltext::Get_place_ycen(uint32_t *number) +bool NexScrolltext::Get_place_ycen(uint32_t *number) { String cmd; cmd += "get "; @@ -157,15 +142,10 @@ bool NexScrolltext::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 NexScrolltext::getFont(uint32_t *number) +bool NexScrolltext::getFont(uint32_t *number) { String cmd; cmd += "get "; @@ -185,15 +165,10 @@ bool NexScrolltext::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 NexScrolltext::Get_background_crop_picc(uint32_t *number) +bool NexScrolltext::Get_background_crop_picc(uint32_t *number) { String cmd; cmd += "get "; @@ -213,15 +188,10 @@ bool NexScrolltext::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 NexScrolltext::Get_background_image_pic(uint32_t *number) +bool NexScrolltext::Get_background_image_pic(uint32_t *number) { String cmd = String("get "); getObjGlobalPageName(cmd); @@ -240,15 +210,10 @@ bool NexScrolltext::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 NexScrolltext::Get_scroll_dir(uint32_t *number) +bool NexScrolltext::Get_scroll_dir(uint32_t *number) { String cmd = String("get "); getObjGlobalPageName(cmd); @@ -267,15 +232,10 @@ bool NexScrolltext::Set_scroll_dir(uint32_t number) cmd += ".dir="; cmd += buf; sendCommand(cmd.c_str()); - - cmd = ""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } -uint32_t NexScrolltext::Get_scroll_distance(uint32_t *number) +bool NexScrolltext::Get_scroll_distance(uint32_t *number) { String cmd = String("get "); getObjGlobalPageName(cmd); @@ -298,15 +258,10 @@ bool NexScrolltext::Set_scroll_distance(uint32_t number) cmd += ".dis="; cmd += buf; sendCommand(cmd.c_str()); - - cmd = ""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } -uint32_t NexScrolltext::Get_cycle_tim(uint32_t *number) +bool NexScrolltext::Get_cycle_tim(uint32_t *number) { String cmd = String("get "); getObjGlobalPageName(cmd); @@ -328,11 +283,6 @@ bool NexScrolltext::Set_cycle_tim(uint32_t number) cmd += ".tim="; cmd += buf; sendCommand(cmd.c_str()); - - cmd = ""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } diff --git a/NexScrolltext.h b/NexScrolltext.h index 5d40a046..6d8e63de 100755 --- a/NexScrolltext.h +++ b/NexScrolltext.h @@ -70,9 +70,9 @@ class NexScrolltext: public NexTouch * Get bco attribute of component * * @param number - buffer storing data retur - * @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 @@ -86,9 +86,9 @@ class NexScrolltext: public NexTouch * Get pco attribute of component * * @param number - buffer storing data retur - * @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 @@ -102,9 +102,9 @@ class NexScrolltext: public NexTouch * Get xcen attribute of component * * @param number - buffer storing data retur - * @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 @@ -118,9 +118,9 @@ class NexScrolltext: public NexTouch * Get ycen attribute of component * * @param number - buffer storing data retur - * @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 @@ -134,9 +134,9 @@ class NexScrolltext: public NexTouch * Get font attribute of component * * @param number - buffer storing data retur - * @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 @@ -150,9 +150,9 @@ class NexScrolltext: public NexTouch * Get picc attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure */ - uint32_t Get_background_crop_picc(uint32_t *number); + bool Get_background_crop_picc(uint32_t *number); /** * Set picc attribute of component @@ -166,9 +166,9 @@ class NexScrolltext: public NexTouch * Get pic attribute of component * * @param number - buffer storing data retur - * @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 @@ -182,9 +182,9 @@ class NexScrolltext: public NexTouch * Get dir attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure */ - uint32_t Get_scroll_dir(uint32_t *number); + bool Get_scroll_dir(uint32_t *number); /** * Set dir attribute of component @@ -198,9 +198,9 @@ class NexScrolltext: public NexTouch * Get dis attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure */ - uint32_t Get_scroll_distance(uint32_t *number); + bool Get_scroll_distance(uint32_t *number); /** * Set dis attribute of component @@ -214,9 +214,9 @@ class NexScrolltext: public NexTouch * Get tim attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure */ - uint32_t Get_cycle_tim(uint32_t *number); + bool Get_cycle_tim(uint32_t *number); /** * Set tim attribute of component diff --git a/NexSlider.cpp b/NexSlider.cpp index b8369c8d..15f534bb 100755 --- a/NexSlider.cpp +++ b/NexSlider.cpp @@ -64,11 +64,6 @@ bool NexSlider::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(); } @@ -92,11 +87,6 @@ bool NexSlider::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(); } @@ -120,11 +110,6 @@ bool NexSlider::Set_pointer_thickness_wid(uint32_t number) cmd += ".wid="; cmd += buf; sendCommand(cmd.c_str()); - - cmd = ""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } @@ -148,11 +133,6 @@ bool NexSlider::Set_cursor_height_hig(uint32_t number) cmd += ".hig="; cmd += buf; sendCommand(cmd.c_str()); - - cmd = ""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } @@ -176,11 +156,6 @@ bool NexSlider::setMaxval(uint32_t number) cmd += ".maxval="; cmd += buf; sendCommand(cmd.c_str()); - - cmd = ""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } @@ -204,15 +179,10 @@ bool NexSlider::setMinval(uint32_t number) cmd += ".minval="; cmd += buf; sendCommand(cmd.c_str()); - - cmd = ""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } -uint32_t NexSlider::Get_background_image_pic(uint32_t *number) +bool NexSlider::Get_background_image_pic(uint32_t *number) { String cmd; cmd += "get "; @@ -232,10 +202,28 @@ bool NexSlider::Set_background_image_pic(uint32_t number) cmd += ".pic="; cmd += buf; sendCommand(cmd.c_str()); - - cmd = ""; - cmd += "ref "; + return recvRetCommandFinished(); +} + +bool NexSlider::Get_background_image_picc(uint32_t *number) +{ + String cmd; + cmd += "get "; + getObjGlobalPageName(cmd); + cmd += ".picc"; + sendCommand(cmd.c_str()); + return recvRetNumber(number); +} + +bool NexSlider::Set_background_image_picc(uint32_t number) +{ + char buf[10] = {0}; + String cmd; + + utoa(number, buf, 10); getObjGlobalPageName(cmd); + cmd += ".picc="; + cmd += buf; sendCommand(cmd.c_str()); return recvRetCommandFinished(); } \ No newline at end of file diff --git a/NexSlider.h b/NexSlider.h index d5e20868..140cc601 100755 --- a/NexSlider.h +++ b/NexSlider.h @@ -156,9 +156,9 @@ class NexSlider: 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 @@ -166,7 +166,23 @@ class NexSlider: public NexTouch * @param number - To set up the data * @return true if success, false for failure */ - bool Set_background_image_pic(uint32_t number); + bool Set_background_image_pic(uint32_t number); + + /** + * Get crop image picc attribute of component + * + * @param number - buffer storing data return + * @return true if success, false for failure + */ + bool Get_background_image_picc(uint32_t *number); + + /** + * Set crop image picc attribute of component + * + * @param number - To set up the data + * @return true if success, false for failure + */ + bool Set_background_image_picc(uint32_t number); }; /** * @} diff --git a/NexText.cpp b/NexText.cpp index 210fa68c..fe281f5e 100755 --- a/NexText.cpp +++ b/NexText.cpp @@ -64,7 +64,7 @@ bool NexText::appendText(const char *buffer) return recvRetCommandFinished(); } -uint32_t NexText::Get_background_color_bco(uint32_t *number) +bool NexText::Get_background_color_bco(uint32_t *number) { String cmd; cmd += "get "; @@ -84,15 +84,10 @@ bool NexText::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 NexText::Get_font_color_pco(uint32_t *number) +bool NexText::Get_font_color_pco(uint32_t *number) { String cmd; cmd += "get "; @@ -112,15 +107,10 @@ bool NexText::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 NexText::Get_place_xcen(uint32_t *number) +bool NexText::Get_place_xcen(uint32_t *number) { String cmd; cmd += "get "; @@ -140,15 +130,10 @@ bool NexText::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 NexText::Get_place_ycen(uint32_t *number) +bool NexText::Get_place_ycen(uint32_t *number) { String cmd; cmd += "get "; @@ -168,15 +153,10 @@ bool NexText::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 NexText::getFont(uint32_t *number) +bool NexText::getFont(uint32_t *number) { String cmd; cmd += "get "; @@ -196,15 +176,10 @@ bool NexText::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 NexText::Get_background_crop_picc(uint32_t *number) +bool NexText::Get_background_crop_picc(uint32_t *number) { String cmd; cmd += "get "; @@ -224,15 +199,10 @@ bool NexText::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 NexText::Get_background_image_pic(uint32_t *number) +bool NexText::Get_background_image_pic(uint32_t *number) { String cmd = String("get "); getObjGlobalPageName(cmd); diff --git a/NexText.h b/NexText.h index 21c5096c..dd7c672a 100755 --- a/NexText.h +++ b/NexText.h @@ -78,9 +78,9 @@ class NexText : public NexTouch * Get bco attribute of component * * @param number - buffer storing data retur - * @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 @@ -94,9 +94,9 @@ class NexText : public NexTouch * Get pco attribute of component * * @param number - buffer storing data retur - * @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 @@ -110,9 +110,9 @@ class NexText : public NexTouch * Get xcen attribute of component * * @param number - buffer storing data retur - * @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 @@ -126,9 +126,9 @@ class NexText : public NexTouch * Get ycen attribute of component * * @param number - buffer storing data retur - * @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 @@ -142,9 +142,9 @@ class NexText : public NexTouch * Get font attribute of component * * @param number - buffer storing data retur - * @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 @@ -158,9 +158,9 @@ class NexText : public NexTouch * Get picc attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure. */ - uint32_t Get_background_crop_picc(uint32_t *number); + bool Get_background_crop_picc(uint32_t *number); /** * Set picc attribute of component @@ -174,9 +174,9 @@ class NexText : public NexTouch * Get pic attribute of component * * @param number - buffer storing data retur - * @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 diff --git a/NexTimer.cpp b/NexTimer.cpp index b66789fa..58008920 100755 --- a/NexTimer.cpp +++ b/NexTimer.cpp @@ -85,7 +85,7 @@ bool NexTimer::disable(void) return recvRetCommandFinished(); } -uint32_t NexTimer::Get_cycle_tim(uint32_t *number) +bool NexTimer::Get_cycle_tim(uint32_t *number) { String cmd = String("get "); getObjGlobalPageName(cmd); diff --git a/NexTimer.h b/NexTimer.h index 9b4f7a2f..89626ab8 100755 --- a/NexTimer.h +++ b/NexTimer.h @@ -101,9 +101,9 @@ class NexTimer: public NexTouch * Get tim attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure */ - uint32_t Get_cycle_tim(uint32_t *number); + bool Get_cycle_tim(uint32_t *number); /** * Set tim attribute of component diff --git a/NexUpload.cpp b/NexUpload.cpp index cf786315..88ff28fb 100644 --- a/NexUpload.cpp +++ b/NexUpload.cpp @@ -91,7 +91,7 @@ bool NexUpload::_checkFile(void) if(!SD.begin(_SD_chip_select)) { dbSerialPrintln("init sd failed"); - return 0; + return false; } if(!SD.exists(_file_name)) { @@ -102,7 +102,7 @@ bool NexUpload::_checkFile(void) dbSerialPrintln("tft file size is:"); dbSerialPrintln(_undownloadByte); dbSerialPrintln("check file ok"); - return 1; + return true; } bool NexUpload::_searchBaudrate(uint32_t baudrate) @@ -114,9 +114,9 @@ bool NexUpload::_searchBaudrate(uint32_t baudrate) this->recvRetString(string); if(string.indexOf("comok") != -1) { - return 1; + return true; } - return 0; + return false; } void NexUpload::sendCommand(const char* cmd) @@ -184,9 +184,9 @@ bool NexUpload::_setDownloadBaudrate(uint32_t baudrate) this->recvRetString(string,500); if(string.indexOf(0x05) != -1) { - return 1; + return true; } - return 0; + return false; } bool NexUpload::_downloadTftFile(void) @@ -232,9 +232,10 @@ bool NexUpload::_downloadTftFile(void) } else { - return 0; + return false; } --send_timer; - } + } + return true; } diff --git a/NexVariable.cpp b/NexVariable.cpp index 8995d4c1..371aa1d3 100755 --- a/NexVariable.cpp +++ b/NexVariable.cpp @@ -21,7 +21,7 @@ NexVariable::NexVariable(uint8_t pid, uint8_t cid, const char *name, const NexOb { } -uint32_t NexVariable::getValue(int32_t *number) +bool NexVariable::getValue(int32_t *number) { String cmd = String("get "); getObjGlobalPageName(cmd); diff --git a/NexVariable.h b/NexVariable.h index b11ce148..80954ad0 100755 --- a/NexVariable.h +++ b/NexVariable.h @@ -76,9 +76,9 @@ class NexVariable: public NexTouch * Get val attribute of component * * @param number - buffer storing data retur - * @return the length of the data + * @return true if success, false for failure */ - uint32_t getValue(int32_t *number); + bool getValue(int32_t *number); /** * Set val attribute of component diff --git a/NexWaveform.cpp b/NexWaveform.cpp index b156d0b1..39980990 100755 --- a/NexWaveform.cpp +++ b/NexWaveform.cpp @@ -57,11 +57,6 @@ bool NexWaveform::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(); } @@ -85,11 +80,6 @@ bool NexWaveform::Set_grid_color_gdc(uint32_t number) cmd += ".gdc="; cmd += buf; sendCommand(cmd.c_str()); - - cmd=""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } @@ -113,11 +103,6 @@ bool NexWaveform::Set_grid_width_gdw(uint32_t number) cmd += ".gdw="; cmd += buf; sendCommand(cmd.c_str()); - - cmd=""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } @@ -141,11 +126,6 @@ bool NexWaveform::Set_grid_height_gdh(uint32_t number) cmd += ".gdh="; cmd += buf; sendCommand(cmd.c_str()); - - cmd=""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } @@ -176,11 +156,6 @@ bool NexWaveform::Set_channel_color(uint8_t ch, uint32_t number) utoa(number, buf, 10); cmd += buf; sendCommand(cmd.c_str()); - - cmd=""; - cmd += "ref "; - getObjGlobalPageName(cmd); - sendCommand(cmd.c_str()); return recvRetCommandFinished(); } diff --git a/html/class_nex_button.html b/html/class_nex_button.html index 4d04d141..0f136730 100755 --- a/html/class_nex_button.html +++ b/html/class_nex_button.html @@ -258,7 +258,7 @@