Home

User Manual - Thaieasyelec.net

image

Contents

1. Venus Supply Co Ltd Page 3 Contents 1 Introduction snciiensviavnntiveraniaiinn 2 Related Piles avicnatacactwsnnidawnias 3 FeatUTE Soeria bout eeaveuesa eare Ee 4 Commands and Parameters 4 1 Command Structure 0 00008 4 2 Parameter Descriptions 00 1 RBG Register background images 2 RFONT Register fonts 3 RXFONT Register extension fonts 4 RIFONT Register image fonts 5 RIMG Register images 6 MEM Show memory status 7 SCS Screen settings cccssncsueunsevnennees 8 BG Background image settings 9 IMG Image box settings 10 BT Button settings ee 11 TXT Textbox setuines ccissisessvsices 12 LBL Label settings lt eicenecdecscasates 13 BOX Box settings eee 14 TAB Table settings ee 15 CFG Configure global parameters 16 SND Play a MP3 file wo 17 END End all settings 0 0 18 BEG Set startup options N nm nmr AA Aa Aa Aa A ana a nan nn nn nan mM ee oe oe oe ThaiEasyElec comllll Venus Supply Co Ltd thaicasyeiec comllll 5 19 BAR Percent bar Settings sess avcivesucuacaventungeaneereeovmey aylens EERE E ERKE 37 ESINI DEEI T 0 aa 101 E A A 43 6 1 CFG Configure global parameters sseseseesessesesseeesseeeeseresseresssersseeessresses 43 6 2 RGO Registe
2. End current button setting GUI DE leh Venus Supply Co Ltd Page 26 Enable Your Design ThaiEasyElec comilll On line Electronics Shop for Embedded System 5 11 TXT Textbox settings TXT O Set origin position of the textbox default is 0 0 stars Set textbox size TXTI Set insertion of the textbox disabled by default with this command the textbox can be pressed and the cursor is displayed Then new characters can be inserted between the texts Without this command default no curser shown and new characters will always be appended to the right side of the texts TXTK Set textbox active so it will receive characters from key buttons TXT B Make text on the textbox bold Venus Supply Co Ltd Page 27 ThaiEasyElec comillll TXTC Set text and background colors defaults are black GUL DXI Text Color Back Color GoGo GUL TXT C 0 OXFFFE Test COllows text Color BaCk Colors background color TXT F Set font and or extension font defaults are 0 GUI TXT F ID 1 ID 2 GoGo GU a Sree IDL 2 cOme ICID DpZ extension font ID optional oT XTi Use image font With this setting the ID 1 from TXT F will refer to image font note that bold insertion and color settings will be ignored since character images will be displayed GU Wa ab TXTA Set on text box text alignment default is left 0 GUI TXT A ALIGOment TZE SoG GU
3. Venus Supply Co Ltd Page 49 Enable Your Design ThaiEasyElec com ill Configuration Target Asse Build Com Lin Simu Sect Print Prep ARM Flash Debug z Additional Input Files qui_engine AEE EEE Additional Linker Options Additional Output Format hex E Solution SUN7_Demo 1 project Check For Memory Segment Overfl Yes C SUN _Demo Entry Point reset_handler Executable File Name OutDir ProjectN ame EXE Generate Map File Yes Heap Size 1024 Include Standard Libraries Yes Include Startup Code No Keep Symbols Library Instruction Set ARM Linker Symbol Definitions Memory Map File StudioDir targets Philips_LPC210 Post Build Command Section Placement File StudioDir targets flash_placement Stack Size Abort Mode 0 Additional Input Files Enables additional object and library files to be supplied to the linker Coree IAR Embedded Workbench IDE The library can be added directly to the project 8 3 Disabling Sound Plug in To disable sound plug in for quite applications comment out a line in app_config h include gui _ engine gui_ sound plugin v2_00 h And the I O pin functions connected to MP3 decoder IC are selected in main c comment them out for ones who need them to be GPIO PINSELS 3 lt lt 12 SCLKO PINSEL5 3 lt lt 20 MISOO PINSELS 3 lt lt 22 MOS
4. LBLC Set text color default is black GUI Wb WMesxic COlor e g GUI LBL C 0 text Colors text Color LBLT Set label text GUI LBL Tex ence GUI LBL T Name Text label ext LBLF Set font and or extension font defaults are 0 GUI LBL F ID 1 ID 2 So Gjo GUI IB iL il ILD il rome LD LDp2 2 extension font ID optional Venus Supply Co Ltd Page 30 ThaiEasyElec comli LBLi Use image font With this setting the ID 1 from LBL F will refer to image font note that bold and color settings will be ignored since character images will be displayed GUI LBL i LBLA Set on text box text alignment default is left 0 GUI LBL A Alignment type oGo GUI isin A 2 Alignment type O for left 1 for center and 2 for right LBL L Set language for label GUI LBL L Lang e g GUI LBL L 1 Lang language for label LBL n Name the label for easy identifying in software user can specify the label with a name GUI LBL n Name SoGfo GUI LBL n topic Name a text to be used as the name of label LBLE End current label setting GUL IBiy 1 Venus Supply Co Ltd Page 31 Enable Your Design ThaiEasyElec comilll On line Electronics Shop for Embedded System 5 13 BOX Box settings BOX O Set origin position of the box default is 0 0 BOX S Set box size BOX C Set box color default is black BOX E End c
5. MAX SCR_OBJ so_ obj Reserved dynamic objects ona screen see more detail about dynamic object later in this section MAX SCR guisc Reserved screen slots MAX BACKGROUND guibg Reserved background image slots MAX IMAGE guiimage Reserved image slots used for buttons and image boxes MAX BUTTON guibt Reserved button slots MAX IMAGE BOX guiimgbox Reserved image box slots MAX TEXTBOX guitxt Reserved textbox slots MAX TABLE guitab Reserved table slots MAX TEXT SIZE guiltxt Reserved text pool size MAX LABEL guilbl Reserved label slots MAX BOX guibox Reserved box slots MAX PERCENT BAR guibar Reserved percent bar slots MAX FONT guifont Reserved font slots MAX EXT FONT guixfont Reserved extension font slots MAX IMG FONT guiifont Reserved image font slots MAX SOUND FILE snd file Reserved sound file slots MAX SOUND snd Reserved sound slots MAX SOUND SEQ sndlist Longest sound sequence on a Remark All parameters must to be set to 1 or more Sound related parameters have to be set only when sound plug in is used On a screen not every object is dynamic Buttons tables and textboxes have something to do when they are pressed so they are dynamic In the same time labels image boxes and boxes are static Only dynamic objects are counted as objects on a screen and must not be over than MAX_SCR_OBJ Texts and names set with scripts are continuously concatenated in a text pool Even a textbox having length s
6. GUI BT S GUI BT O 7 160 GUI BT N 4 GUI BT P 5 GU BT n SUN7 GUL BY s sun txt GUI BT E When the button is pressed the GUI engine searches for the text lt PRESS gt in sun7 txt when found it read and execute the command line by line until the text lt END found The result is the IO0 IO7 will be driven high for 200 ER1 SUN7 ms respectively and a text SUN7 will be BND printed out from serial port 1 the baud rate is set to 9600 at the end of main txt Venus Supply Co Ltd Page 85 ThaiEasyElec com ill 11 SUN7 Studio SUN7 Studio is free graphic based software developed by ThaiEasyElec com It s used to develop GUI for SUN7 The output of the software is a script folder that the user can take it to run the board No script has to be written or learned anymore 11 1To get SUN7 Studio SUN7 Studio is a freeware downloadable from our website using this link http www thaieasyelec net archives Installer SUN7 20Studio 20Setup exe Anyway to generate output you will need a unique key to activate Please use computer ID code CID to fill in our registration form here https docs google com a thaieasyelec com spreadsheet viewform formkey dEhw LXJHdFdySzJ1W195SFZmdEo0OHc6MQ Key will be sent back via email use it to activate the software Venus Supply Co Ltd Page 86 ThaiEasyElec comillll 11 2 User Interface Description Overall Baws Menu bar F
7. return language mode Screen related functions GUIGetScrID Find screen ID by their names lnet GULESESCicID Clagie Sic neme scr name oCreecn lane TENE ULE IAL g screen ID or L when not found GUIScreenInit Initialize components in screen it s called every time that screens change User init functions init are called here inside GUIScreenInit Initializations here could be enabling disabling assignment or copying string to textbox and mores but without display related functions void GUIScreenInit void GUIScreenInit2 Initialize components in screen after the background and objects are shown Initializations here could be adding text to textboxes writing text in table contents showing images and etc void GUIScreenInit2 void GUIGotoScreen Change to target screen void GUIGotoScreen unsigned short new ser id _in w Sei idg target sereen TD Venus Supply Co Ltd Page 65 ThaiEasyElec comli GUIOpenPopup Open popup screen void GUIOpenPopup unsigned short popup _scr_id popu ser ids target sereen ID GUIClosePopup Close popup screen void GUIClosePopup void Keypad related functions GUISetKeypadNo Set keypad number Have the same effect as SCS K void GUISetKeypadNo unsigned short _scr_id unsigned char ko no _S x_icls screen 1D _kp_no keypad type see command SCS K GUIBindCustomKP3Init When use c
8. rong Colors font Color GUISkipTable Use this function with tables to skip them out and they will not be shown on screen Use GUIUnskipTable to cancel the effect void GUISkipTable unsigned short id aLGl table ID Venus Supply Co Ltd Page 74 ThaiEasyElec comli GUIUnskipTable Use this function with tables to cancel the effect of GUISkipTable void GUIUnskipTable unsigned short id iele table ID Image box related functions GUIShowImg Show images on the screen Usually follows GUIEnableImg void GUIShowImg unsigned short id iaig image ID GUIGetImgID Get image ID similar to GUIGetBtID unsigned short GUIGetImgID unsigned short _scr_id unsigned short _img_ no _ SC ils sereen ID mG noe image order in the screen it belongs to Teruras image ID GUIGetImgID2 Get image ID from its name similar to GUIGetBtID2 The image name must first be set from script with IMG n inre CUITGert Mg LDA unsigned short Ser ic char img name _ See Ieg sereen ID img name image name CSCUICA 8 image ID 1 when not found GUIGetImgID3 Get image ID from its name and screen name similar to GUIGetBtID3 ine CULESEBE LIDS Char Sic name Char slime neme s r names SCreen neme img name image name ESCUICM 8 image ID 1 when not found Venus Supply Co Ltd Page 75 Enable Your Design Th
9. 4 3 3 Copyright lt C 2068 Free Software Foundation Inc This is free software see the source for copying condition NO There warranty not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE 8 2 Add GUI Engine Library Depends on compiler making the library available for the example project are different Yagarto Put the library file a file in the library path for example C Program Files yagarto arm elf lib Note that the arm elf could be different among versions of Yagarto In such case the makefile must be modified To upgrade the library name in the makefile must be changed to the newer one see figure below Note that the lgui engine v1_07 is the option that forces the linker to search symbols from the libgui_ engine vl 07 a file placed in the library path Venus Supply Co Ltd Page 48 ThaiEasyElec com ill On line Electronics Shop for Embedded System a Ee O B Project Explorer LA app_serfunee Makefile 23 b app_config h and function names needs to he pres SUN Demo files see avr libe docs FIXME treludes H ASFLAGS Wa adhlns lt S5 1lst gstabs E ap ASFLAGS ADEFS Wa adhlns lt S 1st g I drv_Ipc24xx amp drv_onb amp drv_xdev amp fat_sd amp fonts gui_engine amp images includes_yagarto amp startup_yagarto gt sw_mod B app_config h Linker flags B hw_bluescreen_sun
10. Lang Path e g SND REO O 1 SQ 2 Seadice Sine mos SND RGC il Seaice cli mjos Lang language for MP3 file Pelicla 8 file path Venus Supply Co Ltd Page 44 ThaiEasyElec comillll 7 Writing Script 7 1 Script Structure After that you know commands Now let s see how to write your own script A script file should have a head and body parts The head part contains registering common objects to be used in the body part The word common objects whether they are used only one time or more needed to be registered here Then the body part describes what will be contains on screens and where they are Head Part Objects to be registered here are font extension font background image image and sound Notice that these objects are memory consuming So put them here and then use them again and again Ordering here is no needed since each object has an assigned ID And each register function has its own ID domain At the end of this part memory consumed is summarized so show it with GUI MEM command HEAD cegister font s GUI RFONT 0 GUI RFONT 1 cegister extension font s GUI RXFONT 0 GUI RXFONT 1 register background image s GUI RBG 0 GUI RBG 1 register image s GUI RIMG 0 GUI RIMG 1 SND CFG D SND RGO 0 SND RGC 0 SND RGO 1 SND RGC 1 show memory used GUI MEM Venus
11. Supply Co Ltd Page 45 ThaiEasyElec comillll Body Part The body part is segmented into screens Begin each screen with GUI SCS S set some screen parameters if needed and then create buttons tables or more as designed End the script with GUI END so the engine shows how many objects created Note that objects created here usually take many lines that s why we need GUI x E lines BODY t tt Screen O 4 GUI SCS S 0 GUI SCS C GUI SND GUI BG A GUI BT GUI BT GUI BT GUI BT GUI LBL GUI LBL E Screen L H HHH GUI SCS S 1 GUI SND GUI BG A GUI BT GUI BT GUI TAB GUI TAB E H screen 2HHHHH H GUI END Venus Supply Co Ltd Page 46 ThaiEasyElec comillll 7 2 Script Making Guidelines Actually the screen ordering is not needed You can even have screen 0 and then 3 Also you can put a button a table and then a button again if you like However making script should be done tidily so the one who takes care of C programming can understand it well It s recommend that script file should be made as follow L 2 Place same type objects together for easier reading Name screens and special buttons buttons that stimulate some events Buttons with name can be indentified easily Buttons with functional scripts key buttons may b
12. and the button order in the screen it belongs to use GUIGetBtID function to get its ID unsigned short CULESCBclO umsigmecd shore Ser il unsigned short _bt_no Ser ids sereen 1D or nOs burton order in che sereen it belongs ice IGS Uc button ID GUIGetBtID 2 An alternative way to get a button ID by its name The button name must first be set from script with BT n ime GULESCBic D2 umsigmec short Ser idl Char loc_meme _ See ils sereen ID bt_name button name returne D rcton IID il wasa not Towne GUIGetBtID3 Similar to GUIGetBtID2 but with screen name not screen ID ime CULESEBcID3S Char Sex neme Char or name ser names sereen name bt_name button name return loco ID il waen nor icowiacl Venus Supply Co Ltd Page 67 ThaiEasyElec comli GUIRefreshBt Use to redraw button This function is assumed to be used with current screen so it doesn t need screen ID parameter void GUIRefreshBt unsigned short or ne Isic mes burton order in che sereen it belongs ice GUIRefreshBt2 Similar to GUIRefreshBt but target button is identified by its name YOiE CUIRSricSesiabic2 Clima loi ime bt_name button name GUISkipBt Use this function with buttons to skip them out Not just disable them the buttons will not even be shown on screen Use GUIUnskipBt to cancel the effect void GUISkipBt unsigned short id id
13. b t ton ID GUIUnskipBt Use this function with buttons to cancel the effect of GUISkipBt void GUIUnskipBt unsigned short id iele oterom LID Textbox related functions GUIGetTxtID Get textbox ID similar to GUIGetBtID but with textbox type objects See GUIGetBtID for more detail unsigned shore CULESc Isc unsigned Shore Scr Lel unsigned shore ieee no Beria sereen ID EE nOs textbox order in the screen it belongs to ISSCC textbox ID Venus Supply Co Ltd Page 68 ThaiEasyElec comllll GUIGetTxtID2 Get textbox ID from its name similar to GUIGetBtID2 The textbox name must first be set from script with TXT n ine GUIEScIkcl D2 umsicinec shore Sere acl Char esx neame _ Ser 16g sereen LD txt_name textbox name TES UIE 2 cexxcloox ID L yaen moc Tone GUIGetTxtID3 Get textbox ID from its name and screen name similar to GUIGetBtID3 ime GULECc Ics Char Sem neme Char csc neme scr name screen name txt_name textbox name IeSICUIEM 3 textbox ID 1 when not found GUIGetTxtObj Get textbox object number Unlike textbox ID object number tells us the order of objects in a screen used to with so_obj This function is used mostly by the GUI engine itself In general case users can ignore this function tnsignec shore CUM Coda ObaE wnsicgned shore ser Ld unsigned short txt_no _SiGie _alel sereen TD Se NOE textbox
14. h W1 tell GCC to pass this to linker P hw_bluescreen_sun h m Ipc_util_defs h Map create map file In LPC24xx h cref add cross reference to map file a main c LDFLAGS nostartfiles W1l Map TARGET map fn system h LDFLAGS lc r mr annm sm ARTE TTT TNT NAS Arwar TTMS AAT OAIN Tarr bef LPC2478 ROM Id lt gt in Ist iia Problems 5 Tasks El console 2 a1 main o _ Makefile No consoles to display at this time E Makefile bak SUN _Demo elf RUN_MODE FORMAT TARGET SRCARM SRCARM SRCARM SRC SRC SRC SRC SRC SRC SRC SRC SRC SRC SRC SRC Additional libraries Support for newlibe lpe file libnewlibc lpc a NEWLIBLPC lnewlib lpe I MATH_LIB lm GUI_ENGINE LIB SEELEN ES A CPLUSPLUS_LIB lstde H 1 CN 0 A C CN CN CN CN C C C CN C C O A N N uVision Put the library in the library path for example C Keil ARM RV3 I LIB To upgrade put new library in the library path remove the old library from the project window and then add the new one CrossWorks Put the library file in the project and locate it in the Project Options gt Linker gt Additional Input Files as shown below
15. horizontal size unsigned short vsize vertical size unsigned long back_color background color default white unsigned long text color text color default black unsigned long border color border color unsigned short max len maximum characters 1 unsigned char pwd ch password character char text occupied string RW unsigned short font id font id unsigned short xfont id extension font id for example 7 Thai font char name stores address of name R unsigned short set internal use only bit0 3 alignment 0 left 1 center 2 right bit4 insertable set set cursor on bits receiver from key buttons bit bold characters Hits font_id set bits border on bits password mode set bit10 extension font set pitii image font set bit12 multi line set bitI3 reserved bit14 name set bitis skip this textbox 1 text is initiated in the text pool with max len size from script max_len must not be changed by software to bigger size Venus Supply Co Ltd Page 59 ThaiEasyElec comllll Type table t instance guitab gt Parameters associated with tables unsigned short horigin horizontal origin unsigned short vorigin vertical origin unsigned long text color text color default black unsig
16. images and fonts must be first read and stored to SDRAM An ID number must be assigned to each of them And after that this ID number will be used in the rest of script GUI RBG ID Image_type Lang Path erg GUI RBG 0 2 255 img bgl bmp DE ID number of background image Image type type of image O for binary files bin 1 for JPEG files 2 fom BMP miles Lang language for background image Pachas path of the file stated from current directory containing script file for example if the script file path is sr main txt here the image path must be sr img bgl bmp 5 2 RFONT Register fonts GUI RFONT ID Width Height Gap Path e g GUl REONT 0 25 24 E O a o A DDE ID number of font Width width of character block in pixel Height height of character block in pixel can only be 8 6 24 126 Gap Gap between characters for display PETINE see RBG command Venus Supply Co Ltd Page 13 ThaiEasyElec comillll Path ister extension fonts GUI RXFONT ID Width Height Adj Aux Path GUI RAPONT 25 24 1 0 fonts arial thaizox24 bin ID number of extension font width of character blocks in pixel height of character blocks in pixel can only be 8 16 24 128 anyway Thai fonts are supported up to 64 height adjustment for English font and extension font auxiliary value use dependently on extension language for Thai this is the height for shifting
17. keypad on screen bit10 change path set bitll extension script added bitl2 1 wait and close popup bit13 15 reserved unsigned short hsize horizontal size popup unsigned short vsize vertical size popup Char name stores address of screen name R void init vent before the screen drawing V void init2 event after the screen drawing y v id task100ms event every 100ms while the T screen is showing void kp char event event when keypad is pressed y void txtk_char_ event when new character passed y event to key textbox occur before writing textbox void snd end event at sound end y char xscript store address of extension 7 Type back_t instance guibg background images gt Parameters associated with unsigned char lang_mode language mode OxFF all 1 lt lt n language n default all Venus Supply Co Ltd Page 55 ThaiEasyElec comillll Type image t instance guiimage gt Parameters associated with images unsigned short hsize horizontal size unsigned short vsize vertical size unsigned char lang_mode language mode OxFF all 1 lt lt n language n default all unsigned char set internal use only bito color button bitl 7 reserved unsigned long address address of image in memory color value for color buttons unsigned long border color border color for color buttons Venus Supply Co L
18. on the screen GUI SCS K Keypad_type Soo GUL SCS K 1 keypad types keypat types are available in l 7 1 for standard 7 screen keypad 2 for standard 4 3 screen keypad 3 5 for future standard keypad unavailable now 6 7 tOr user keyoac use kpo rrom oog llo e Venus Supply Co Ltd Page 18 ThaiEasyElec comillll SCS s Extension script setting a script file text file can be set so it is read when the screen is showed See section 10 for more information Allowable screen events are lt INIT gt lt INIT2 gt and lt SND_END gt GUI SCS s Filename e g GUL SCS S ECTEENL ELE Filename the script file name refer to the script path from the example the screenl txt should be in sr folder same location with main txt 5 8 BG Background image settings BGA Add background images to associated screen can be more than one depend on number of language in the application GUI BG A ID 1 ID 2 ID 3 ID 8 e g Gul BE A il 2 DI ID of registered background images the quantity of ID can be up to MAX LANGUAGE defined in the code BGC Set background color in case of using plain color background only one of BG A or BG C should be applied to a screen GUI BG C Color CHOR GUI BG C OxFFFF Coloni color of background it s white in the example above for 16 bpp Venus Supply Co Ltd Page 19 ThaiEasyElec comillll 5 9 IMG Image box settings IMGO Set or
19. reading done all parameters are stored in object structures Here users can get and set them directly from application code Some components of structures are functions these are events that users can bind them to their own functions on purpose All structures are declared in gui_engine h and gui_sound_plugin h for sound related structures To understand better characters in RW column are described below R Parameters usually be read by users on purpose W Parameters usually be written by users on purpose RW Parameters usually be read and written by users on purpose For general use there is no need for users to read or write parameters It s true that all parameters can be read by software with no corrupt And with some objects that users intend to set their parameters by software for example a line BT E creates a bare button all parameters can be written The RW columns here are only for general use that parameters are set from script file Type scr_t instance guisc gt Parameters associated with screens unsigned short bg background image IDs 7 MAX LANGUAGE unsigned short bt start first button ID associated unsigned short bt num total buttons associated 7 un
20. script IO port O I lt enter gt Drive IO port to 0 or 1 the port number can be 0 23 These ports are in GPIO connector P8 and P12 DELAY n lt enter gt Delay n time of 100 ms BAUDRATE rate lt enter gt Set baud rate of serial port 1 The rate value can be for example 115200 57600 9600 This command might be set only once and can be placed in the main script file SERI text lt enter gt Print out text from serial port 1 10 2 Attach Script to Components A button or a screen can be set to read one extension script file by GUI command BT s and SCS s respectively see chapter 5 for more detail But to support Venus Supply Co Ltd Page 84 ThaiEasyElec comllll 10 3 Events There are more than one events can be activated by a button or a screen to support multiple event in a single script file the start and stop text must be used to separate between events The start text must be the event name for buttons events supported are lt PRESS gt and lt RELEASE gt For screens events supported are lt INIT gt lt INIT2 gt and lt SND_END gt And the stop text is lt END gt To illustrate how to use extension script file we use the sun7 txt in sr folder from the example project as an example shown on the right The script file is attached to the SUN7 button in the 4 screen with a BT s command GUI BT M2 2
21. stores address of name R void move event while moving every 10ms W void stop event when moving stopped W unsigned char set internal use only bit0 2 touch response style 0 none 1 move to the touch 2 follow the touch movement 3 slide with touch movement orientation 0 horizontal bit3 1 vertical 0 enable 1 disable bit4 name set bit5 0 image bar 1 colored bar bit6 skip this bar bit Type box t instance guibox gt Parameters associated with boxes unsigned short horigin horizontal origin unsigned short vorigin vertical origin unsigned short hsize horizontal size unsigned short vsize vertical size unsigned long color text color default black Venus Supply Co Ltd Page 61 ThaiEasyElec comillll Type label _t instance guilbl gt Parameters associated with labels unsigned short horigin horizontal origin unsigned short vorigin vertical origin unsigned long color text color default black unsigned short font id font id unsigned short xfont_id extension font id for example Thai font char text string pointer RW unsigned char lang_mode language selection OxFF all 1 lt lt n language n default all char name stores address of name R unsigned short set internal use only bit0 3 alignment 0 left 1
22. tone when upper vowel is presented see RBG command 5 4 RIFONT Register image fonts ie enem NENARE GUL INIIOINNE JUD Isic Clee aC ar ma g eC e GUL RIFONT YO 10 5 1 ID number of image font CLES CHAACCOIc Oi iOiMC umber of character for example a numeric font have 10 characters 0 9 5 Image _ ID D of image registered with RIMG only the first one Gap needed to be assigned images must be registered respectively Gap between characters for display Venus Supply Co Ltd Page 14 ThaiEasyElec comillll 5 5 RIMG Register images Q iG RIMG ID Image _type 0 Width Height Lang Path ve Z Q ID Image cyose 2 Lang Path RIMG ID Image type 3 Width Height Lang Color Border RIMG O 25 75 255 imo butr or losin RIMG 1 2 255 img button0 bmp RIMG 2 3 25 75 255 Osdrine MDE JID im IMCS types Eye OF sLMECeS 0 for binary files bin 1 for JPEG files currently not supported umber of image 2 tor BMP files 3 ror plain color Dutton Width width of image in pixel Height height of image in pixel Lang language for image Colori Color of burton loocly Border color of button border only applied when BTS SMOOTH LY see ooj lio cp Qefaulrt is 2 Path see RBG command 5 6 MEM Show memory status This should be place
23. 0 enable 1 disable bits 0 full display 1 transparent bit6 0 image button color button PA text on button set bit7 bold characters bit7 must be bits a set extension font set bito alignment 0 left center bit10 13 2 right default 1 Venus Supply Co Ltd Page 57 ThaiEasyElec comllll bitl4 inverse when pressed bitl15 interlock mode set bitl6 interlock order 0 7 bit17 19 repeat bit20 extension script added bit21 open popup window bit22 close popup window bit23 reserved bit24 30 skip this button bit31 Type image box _t instance guiimgbox gt Parameters associated with image boxes unsigned short horigin horizontal origin unsigned short vorigin vertical origin unsigned short image id image id char name stores address of name R unsigned short set internal use only bit0 2 reserved bit3 name set bit4 0 enable 1 disable bits 0 full display 1 transparent bit6 0 image box 1 color box bit7 reserved Venus Supply Co Ltd Page 58 Type textbox_t instance guitxt gt Parameters associated with textboxes Enable Your Design ThaiEasyElec com ill unsigned short horigin horizontal origin unsigned short vorigin vertical origin unsigned short hsize
24. G C Color Image box settings GUI IMG 5 9 Origin GUI IMG O X Y Image ID GUI IMG I ID Transparency GUI IMG t Venus Supply Co Ltd Page 110 ThaiEasyElec comillll Disabled at startup GUI IMG d Name GUI IMG n Name End setting GUI IMG E Button settings GUI BT 5 10 Name GUI BT n Name Origin GUI BT O X Y Normal state image GUI BT N ID Pressed state image GUI BT P ID Disabled state image GUI BT D ID Shift interlock button GUI BT I Order Movement GUI BT M X Y Screen to go all paths GUI BT G ID Screen to go multi GUI BT G ID 1 ID 2 path Disabled at startup GUI BT d Transparency GUI BT t Inverse GUI BT i On button text GUI BT T Text Fonts GUI BT F ID 1 ID 2 Bold characteristic GUI BT B Text color GUI BT C Color Text alignment GUI BT A Alignment type Save button settings GUI BT S Load button settings GUI BT L Value GUI BT V Value Special action GUI BT X Value Extension script setting GUI BT s Filename Repetition GUI BT r Open popup screen GUI BT p ID Close popup screen GUI BT c End setting GUI BT E Textbox settings GUI TXT 5 11 Origin GUI TXT O X Y Size GUI TXT S Width Height Insertion GUI TXT I Key characters receiver GUI TXT K Bold characteristic GUI TXT B Venus Supply Co Ltd Page 111 ThaiEasyElec com
25. GUI Script User Manual Document version 1 05 ThaiEasyElec com ill On line Electronics Shop for Embedded S ThaiEasyElec comli Revision History 1 00 15 Nov 2010 Original version used with GUI_ENGINE_V1_00 lib gui_engine_v3_00 h gui_sound_plugin_v2_00 h 1 01 20 Nov 2010 More description about GUI SCS W GUI CFG S added Section added about sound plug in functions Used with GUI_ENGINE_V1_01 lib gui_engine_v3_01 h gui_sound_plugin_v2_01 h 1 02 17 Feb 2011 New features added to screen New functions added in 10 3 New programming guidelines added in 10 6 Used with GUI_ENGINE_V1_07 lib gui_engine_v3_07 h gui_sound_plugin_v2_03 h 1 03 26 Mar 2011 New compiler added in chapter 9 New functions added New chapter Extension Script added Appendix added Command list moved to appendix Used with GUI __ENGINE_V1_09 lib gui_engine_v3_09 h gui_sound_plugin_v2_05 h 1 04 22 July 2011 Popup and percent bar added Used with GUI_ENGINE_V2_00 lib gui_engine_v3_10 h gui_sound_plugin_v2_05 h Venus Supply Co Ltd Page 2 Enable Your Design ThaiEasyElec comilll On line Electronics Shop for Embedded System 1 05 2 Dec 2011 Embedded script added Default alignment of textbox label and table are fixed Transparency of textboxes supported New functions added New chapter SUN7 Studio added Used with GUI_ENGINE_V2_05 lib gui_engine_v3_16 h gui_sound_plugin_v2_05 h
26. IO Venus Supply Co Ltd Page 50 ThaiEasyElec comillll 9 Application Programming Interface This section provides information on how to make application based on the GUI script First of all users should specify quantities for objects So the GUI engine can provide enough memory for them After that creates their own functions and assign them to events 9 1 Setting Parameters Images buttons and other objects need memory to store their parameters Users must specify them first so there is enough memory reserved At the final state when the new firmware revision is released users should specify quantities so more objects can be added from script in the future Specifying should be done in app_scr_func h Here default values are set Note that background images use constant size of memory whether they are assigned in script or not a part from app ser func h define MAX SCR_OBJ 40 define MAX SCR 140 all screens define MAX BACKGROUND 10 all background available define MAX IMAGE 400 all images define MAX BUTTON 400 all buttons define MAX IMAGE BOX 400 all image boxed Table below describes parameters specifiable some of them have default value and don t need to be set Venus Supply Co Ltd Page 51 Enable Your Design ThaiEasyElec com il screen
27. L IW A 2 Alignment type O for left 1 for center and 2 for right TXTL Set maximum characters in the textbox length GUI IDL Ih LENGEN 5Go GU IW Ih LO Length maximum of characters Venus Supply Co Ltd Page 28 Enable Your Design ThaiEasyElec comilll On line Electronics Shop for Embedded System TXT p Enable password mode TXT m Use multi line mode With this mode set the total text lines can be greater than lines the box can display But the text length is still limited by TXT L Up and down button should be created along and call ObjMLTextBoxUp and ObjMLTextBoxDown when a button is pressed or released respectively Note that without this mode set text can be shown only within the box And password mode will be ignored when this mode set TXT n Name the textbox for easy identifying in software user can specify the textbox with a name TXTt Set transparency of the textbox TXTE End current text box setting Venus Supply Co Ltd Page 29 ThaiEasyElec comillll 5 12 LBL Label settings LBLO Set origin position of the label default is 0 0 Unlike all other objects the alignment of label refers to its origin position So the top left corner of the label is not its origin position when the alignment set is center or right GUL Ils ene CUI IBL 100 200 xe horizontal position Ye vertical position LBLB Make text on the label bold CUS ies
28. L Lang Button sound GUI CFG S ID 1 ID 2 Repeat interval for GUI CFG r k First interval keypad Next interval 7 Repeat interval for GUI CFG r b First interval buttons Next interval 7 Add sound on screen GUI SND ID 5 16 startup End GUI settings GUI END 5 17 Set startup option GUI BEG 5 18 Startup screen GUI BEG S ID Startup path GUI BEG P Path Boot logo GUI BEG B ID 1 ID 2 X Y Percent bar settings GUI BAR 5 19 Origin GUI BAR O X Y Image ID GUI BAR I ID Vertical Setting GUI BAR v Initial value GUI BAR V Value Touch response style GUI BAR s Response style Sensitivity 7 Movement type GUI BAR m Movement type Pin size GUI BAR p Pin size Disabled at startup GUI BAR d End setting GUI BAR E Configure global SND CFG 6 1 parameters sound Sound directory SND CFG D Path Register MP3 file SND RGO ID nSegment Volume Lang 6 2 Path Register MP3 file cont SND RGC Lang Path 6 3 Remark Parameters in are optional Venus Supply Co Ltd Page 113
29. Small popcorn 16 0z can be set to the first button Using path Using path could be helpful in GUI design when there are some screens that are shared among 2 or more routs For example see figure below ScreenO Path o Screen3 _GUISCS S0 L SE GUI SCS S 3 GUISCS PO_ Screen2 GUI SCS S 2 Screenl L Screen4 GUISCSS1 GUI SCS S 4 GUI SCS P 1 cone Notice the lines GUI SCS P x from the scripts in screen 0 and 1 These set path value whenever the screen 0 or 1 begins From the screen 2 the user can determine next screen using the value of path it s scr_path in the code Further more having a Next button on screen 2 with BT G 3 4 the GUI Engine will automatically determine next screen looking from the route without any code needed Venus Supply Co Ltd Page 83 ThaiEasyElec comllll 10 Extension Script Extension script is the script that runs when events occur or specific screen shown unlike the main script main txt that is read once before the GUI start Extension script is not designed for GUI but for simple actions activated by GUI components At the time of the latest GUI Script example released extension script can be activated by buttons and screens 10 1 Commands in Extension Script There can be any console command in extension script For convenience we have created 4 more commands in the example project to support extension
30. Supply Co Ltd Page 42 ThaiEasyElec comillll 6 SND Commands This section is applicable when gui_sound_plugin c is added to the project The SND command is not the one with 5 15 GUI SND is a GUI command with a subcommand SND Now it s SND command and will be processed in the plug in source code not the GUI engine Unlike images or fonts MP3 files are not stored on SDRAM Only their paths are stored 6 1 CFG Configure global parameters CFG D Configure sound directory default is root SIND CEG ID Mercia enor SND CFG D sr snd Pathe directory contains MP3 files 6 2 RGO Register MP3 files SND RGO ID nSegment Volume Lang Path e g SND REO iI 80 255 scare ios SND RGO 1 10 80 255 numbers mp3 IDE sound ID nSegment segments in sound file this is 1 for general files playing all at once but can be more then one for segmented files For example the numbers mp3 sounds like one two three zero each segment can be played individually Volume Soundivo lume mE Can ber rromi OnO Lang language for MP3 file Parhi file path Venus Supply Co Ltd Page 43 ThaiEasyElec comillll 6 3 RGC Register MP3 files for multi language application Note that files can be assigned to an ID if their contents are the same but in multiple languages Software will play the right file with the language mode at a time automatically SND RGC
31. aiEasyElec comilll On line Electronics Shop for Embedded System GUIEnableImg Enable image similar to GUIEnableBt This may need GUIShowImg to show enabled images unless using it in screen init function init void GUIEnableImg unsigned short id LOE image ID GUIDisableImg Disable image unlike buttons disabled images are not shown on the screen Currently removing images from the screen is not supported An image may be needed to cover old one This function is useful when use in init function void GUIDisableImg unsigned short id idg image ID Percent bar related functions GUIRefreshBar Redraw bar after its value change by software To change the bar s value the user can directly set val GUIGetBarID Get bar ID similar to GUIGetBtID Venus Supply Co Ltd Page 76 __Enable Your Design ThaiEasyElec com il On line Electronics Shop for Embedded System GUIGetBarID2 Get bar ID from its name similar to GUIGetBtID2 The bar name must first be set from script with BAR n GUIGetBarID3 Get bar ID from its name and screen name similar to GUIGetBtID3 GUJEnableBar Enable bar similar to GUJEnableBt This will enable touch response of the bar GUIDisableBar Disable bar This will disable touch response of the bar Venus Supply Co Ltd Page 77 ThaiEasyElec comli 9 4 API Functions Sound Main Sound Functions Functions in this section are called by system a
32. ap 2 Width 25 Height 48 font_cordia_eng20x40 bin Gap 2 Width 20 Height 40 Venus Supply Co Ltd Page 98 Enable Your Design ThaiEasyElec comllll On line Electronics Shop for Embedded System Project Settings Extension font font_cordia25x48 bin font_cordia20x40 bin Venus Supply Co Ltd Page 99 Enable Your Design ThaiEasyElec comli On line Electronics Shop for Embedded System Project Settings Image font Venus Supply Co Ltd Page 100 Enable Your Design ThaiEasyElec comillll On line Electronics Shop for Embedded System Project Settings Images Venus Supply Co Ltd Page 101 Enable Your Design ThaiEasyElec com il On line Electronics Shop for Embedded System Project Settings Sounds Venus Supply Co Ltd Page 102 ThaiEasyElec com ill On line Electronics Shop for Embedded System Screen Settings General purpose variables Name and ID Show Time General Purpose Variables Keypad and Sound Char Type Long Type Name sec sec E Screen 0 H Sec Popup 0 H Sec E Indeo Henn Language 25s ID 0 Next screen Custom screen scso v Index1 Keypad Default v Del scr Eat Index2 Index Path Goto path Index3 Sound A Name and ID Keypad and sound Screen Settings Name and ID Name and ID Se Venus S
33. aying and prohibit list addition on the begin of screens void SndOff void SndGetCurrentSnd Get playing sound ID In addition use VSIsPlaying it returns 1 if a sound is being played unsigned short SndGetCurrentSnd void 9 5 External Variables Some variables beside of object instances are declared as external extern at the bottom of gui_engine h These can be used by users directly extern unsigned short scr_id Current screen ID this should only be read by users To change screen use GUIGotoScreen as described earlier extern unsigned short old_scr_id Screen ID prior to screen change extern unsigned char scr_path Current path can be read and written directly extern unsigned short bt_snd_normal Sound ID played when normal buttons are pressed extern unsigned short bt_snd_error Sound ID played when disabled buttons are pressed Venus Supply Co Ltd Page 79 ThaiEasyElec comillll 9 6 Programming Guidelines AppScrInit In app_scr_func c this is the place to initialize all screen init functions init Button s or other object s event functions maybe bound here or in init of the screen they belong to Example code below shows how to bind init functions Assume that user_scr_ initx functions are created by user void AppScrinit void guisc 0 init guisc 1 init user scr _init0 user scr initl Binding event functions In screen init functions init a
34. ced from snd dir Type sound t instance snd gt Parameters associated with sounds unsigned short file files from snd file 7 MAX LANGUAGE unsigned char segments how many segments in a file default 1 unsigned char vol sound volume 0 100 default 50 Type sound_list_t instance sndlist gt Parameters associated with sound playlist unsigned short snd no sound number start with 0 unsigned char segment no segment number start with 0 9 3 API Functions GUI Main GUI functions Functions in this section are called by system and users don t need to use GUMnit Initialize objects to default value Used once before reading script This is already placed in example project in app_bs_sun_demo c void GUIInit unsigned char report_on report Ons Use 1 wall allow error report On Console Venus Supply Co Ltd Page 63 ThaiEasyElec comli GUIReadCmd Function processes when GUI commands found Used from app_console c lime GUMRGaclCinel unsigned dime Cems L Cong 8 index of console buffer to be processed Ceman wrong argument 0 means no error GUISkipFileLoading On the development when users have script unchanged and users are modifying their code it may take quite long time when board is reprogrammed and boot Use this function before ReadScript called it makes script reading faster by
35. center 2 right bit4 bold characters bit extension font set bit image font set bit skip this label bit name set bit9 15 reserved Type font _ t instance guifont gt Parameters associated with fonts unsigned long address address of font in memory unsigned short width font width unsigned short height font height unsigned short gap gap between characters Type xfont_t instance guixfont gt Parameters associated with extension fonts unsigned long address address of font in memory unsigned short width font width unsigned short height font height 7 unsigned short adj different height between English font and extension font unsigned char aux_8 auxiliary value used differently by languages Type ifont_t instance guiifont gt Parameters associated with image fonts unsigned char charl first character unsigned short nchar number of characters unsigned short imagel first image ID unsigned short gap gap between characters Venus Supply Co Ltd Page 62 ThaiEasyElec comillll Sound related structures from gui_sound_plugin h Type sound file t instance snd file gt Parameters associated with sound files unsigned char lang_mode language selection OxFF all 1 lt lt n language n default all char name file name referen
36. ct C WINDOWS system32 cmd exe Copyright lt C gt 2668 Free Software Foundation Inc This is free software see the source for copying conditions There is NO warranty not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE Venus Supply Co Ltd Page 109 ThaiEasyElec comillll 2 Command List Register background GUI RBG ID Image type Lang Path 5 1 Register fonts GUI RFONT ID Width Height Gap 5 2 Path Register extension fonts GUI RXFONT ID Width Height Adj 5 3 Aux Path Register image fonts GUI RIFONT ID 1st char nChar 5 4 Image ID Gap Register images GUI RIMG 5 5 Binary files GUI RIMG ID 0 Width Height Lang Path BMP files GUI RIMG ID 2 Lang Path Color box GUI RIMG ID 3 Width Height Lang Color Border Show memory status GUI MEM 5 6 Screen settings GUI SCS 5 7 ID GUT SCS 5 ID ID popup window GUI SCS S ID Width Height Name GUI SCS n Name Switch path GUI SCS P Path Auxiliary value char GUI SCS C Index Value Auxiliary value long GUI SCS L Index Value Wait time all paths GUI SCS W Time ID Wait time multi path GUI SCS W Time ID 1 ID 2 Wait time to close GUI SCS c Time popup Keypad GUI SCS K Keypad type Extension script setting GUI SCS s Filename Background settings GUI BG 5 8 Add to screen GUI BG A ID 1 ID 2 ID 3 ID 8 Set background color GUI B
37. d continuously in the same direction with sliding S mgitawalcys Slide sensitivity Only applied when Response style ig set to 3 must be between 1 and 10 default value is 3 BAR m Bar movement 0 is default value the bar image move while its value is changing Otherwise setting to 1 and the bar image don t move See images below the bar s tube is an image that have to be shown separately Tube image Bar image m 0 value 50 m 0 value 100 Venus Supply Co Ltd Page 39 ThaiEasyElec comli On line Electronics Shop for Embedded System m 1 value 50 m 1 value 100 GUI BAR m Movement_type eign GUI BAR m 1 Movement EVES iniineiceell welue imelsic loo 0 or 1 cleiewile welue 0 Venus Supply Co Ltd Page 40 Enable Your Design ThaiEasy lec comllll BAR p Pin size in pixels This is generally be used with movement value 0 so pin is the head of bar See images below the pin size is the width in pixel of the blue box Tube image i Bar image tC m 0 value 0 z m 0 value 50 WE m 0 value 100 CO BARd Disable bar at the start up Venus Supply Co Ltd Page 41 Enable Your Design ThaiEasyElec comillll On line Electronics Shop for Embedded System BARn Name the bar for easy identifying in software user can specify the bar with a name BARE End current percent bar setting Venus
38. e Electronics Shop for Embedded System Function Bar Function Table Venus Supply Co Ltd Page 93 Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System Function Textbox IXTE E Extension fot o y Venus Supply Co Ltd Page 94 Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded Sys Function Image Button w Gear movex w Gear Move y of O Venus Supply Co Ltd Page 95 Enable Your Design ThaiEasyElec com ill On s Si or Embedded System Function Color Button D Ge Gear width 10 Height a Gear movex oj Movey E Cea Alignment Center gt Notgoto Gotonextscreen Goto screen o k pE00oopogporponmn Venus Supply Co Ltd Page 96 Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System Project Settings New Screen Generate Project Settings Background Project Settings Main F Generate background images to binary files _ Generate object images to binary files First repeat Next repeat Repeat button First repeat Next repeat Venus Supply Co Ltd Page 97 Enable Your Design ThaiEasyElec comli On line Electronics Shop for Embedded System Project Settings Normal font font_cordia_eng25x48 bin G
39. e left unnamed since user has nothing to do with them Utilize auxiliary values Auxiliary value can be assigned to screens and buttons utilizing them make the code more flexible as the value can be changed easily Use save and load for similar buttons If a screen has buttons sharing some parameters save and load reduce script lines and let you change parameters once for all Left parameters with default value unset for example black text white background Also reserve ID 0 for most common font These save many of script lines Venus Supply Co Ltd Page 47 inable Your Design ThaiEasyElec comillll 8 GUI Engine Setup Guide This section describes how to start a project with GUI script 8 1 Download Example Project First of all download latest example project from our website With the project all necessary source files needed by GUI engine library are ready Anyway the library itself needs to be purchased and will be sent to you by email Since the GUI Script version 1 09 and later example project and library for Yagarto is freely downloadable It s originally compiled with the following version of Yagarto see figure below For newer version the makefile may need to be modified for example change from arm elf gcc to arm none eabi gcc See more information about how to get and install Eclipse IDE and Yagarto compiler on the first section of appendix arpm elf gee GCC
40. e same condition with init2 Here you need object drawing functions after enabling or disabling some objects 3 Whatever does nothing with the screen or objects can be called either in init or init2 snd_end is an event added later for screens that need sound playing finished before other operations begin Every time a sound file is added to the list a flag set and the when the list ended snd_end is called But as sound can be turned off in some applications snd_end still be called once Even that sound plug in is off snd_end will be called just after the init2 Sharing event functions In some applications many buttons can have similar function The difference might be number quantity or string Consider the application of automatic popcorn vending machine The machine can sell small medium and big size of popcorn And their prices are 1 3 and 5 respectively Size small medium big Price 1 3 5 On the screen we have 3 pictures of popcorn with their size These 3 pictures can be pressed as buttons And whenever one of them is pressed the same operation Venus Supply Co Ltd Page 81 ThaiEasyElec comillll begins The screen shows total money the customer has to pay for popcorn And wait for coins to be inserted To bind these buttons to the same function they need a common parameter Here we will set their cmd with BT X p we use p for Popcorn And then we set their price to bu
41. et will has memory reserved for its text here All of these texts and names size together must not be over than MAX_TEXT_SIZE Venus Supply Co Ltd Page 52 ThaiEasyElec comli Besides of specifying numbers of objects user can configure some settings in app_scr_func h table below shows some parameters that can be set for appropriate operation SHOW ACTIVITY Define it Show activities on LCD as 0 or 1 while the script being read left it undefined here to use default value 1 show EMBED SCRIPT TO ROM Define it Embed script main txt as 0 or 1 only into FLASH memory for easier development process file2h exe needed to convert script file to header file default value 0 not embed use file from SD card originally Using EMBED_SCRIPT_TO_ROM as 1 file2h exe is needed This software is in the example folder downloadable from our website The user has to run it on Window s console or making a batch file to run it Anyway with library limitation some parameters are used as array sizes and must be fixed to the same as in the library So users must not change these values Parameters below are not to be changed they must match the GUI Script library define MAX LANGUAGE 8 can not be more than 8 define MAX PATH 8 define MAX TABLE COL 20 define AUX_INT_ NUM 4 define AUX CHAR NUM 4 Venus Supply Co Ltd Page 53 ThaiEasyElec comli 9 2 Object Structures After script
42. events occur GUI Soo GUI Hirst inmncervals CEG r b Mirgr dmeerval Next imeteryal CHERTIORSIS interval between the press and the first repeat must be more than 0 Neze aLimieerewelll amp interval between the next repeat can be 0 for best enTONE 5 16 SND Play a MP3 file Play a MP3 file at the beginning of screen gui_sound_plugin c needed GUI SND ID e g GUI SND 0 IID 3 registered sound ID 5 17 END End all settings This command shows summarized objects created or registered GUI END 5 18 BEG Set startup options BEG S Set startup screen default is 0 GUI BEG S ID a Gjo GUI BEG S 1 IDIS seireein ILD Venus Supply Co Ltd Page 36 ThaiEasyElec comillll BEG P Set startup path default is 0 GUI BG 2 Peicia eng GUI BEG P 2 Path path route in the GUI flow BEGB Show logo with progress bar while loading script GUI BEG B ID 1 ID 2 xX Y e g GUI RBG 0 2 255 bg bgl1 bmp GUI RIMGE 2 255 images boot beir omo GUI BEG B 0 0 25 440 ID 1 background ID ID 2 image ID for progress bar xe horizontal position of progress bar Wwe vertical position of progress bar After this line of script executed the background will be shown with the progress bar It s necessary that both background and image for progress bar are registered first And whether
43. gnable Fonts amp Extension fonts Accepts binary font files generated from bmp2h_conv software Language Supports up to 8 language modes Paths Support multi path applications if the hierarchy can be divided into paths and sharing some common screens path can be set for easier implementation Venus Supply Co Ltd Page 10 ThaiEasyElec comillll 4 Commands and Parameters 4 1 Command Structure GUI script is processed by console the command used here is GUI just like LS command that will show content in current directory But with so many components to be set for GUI a subcommand is needed Each subcommand needs different parameters Below is the command structure GUI subcommand parameterl parameter2 parameterX Please note that 1 Only GUI is not case sensitive since it is just a console command The rest is case sensitive 2 With console version 2 04 or later you can use space or tab to separate tokens 3 With console version 2 04 or later you can assign a number in 3 formats straight number e g 123 4 character format e g a A or hexagonal format e g OxAO OXFFFF 4 Parameters written in are optional if there is in a command it s always the last one Unless they are set default value will be used 5 Every parameter that is text type file paths names texts may contains spaces Console engine accepts all characters until the end of line f
44. h assignment means that target screen IDs are the same for all paths BTd Disable the button at startup can be enabled later by software CUMS Le BTt Set transparency without this command the button will be displayed normally showing white pixel GUI BT E BTi Set inverse mode when pressed or released button will be inversed With this mode set movement setting is discarded GUL BE al BTT Set on button text GUL BT VEKT GoGo GUI BE EMEL Text text to be displayed on the button Venus Supply Co Ltd Page 23 Enable Your Design ThaiEasyElec com BTF Set font and or extension font for on button text defaults are 0 GUI BT F ID 1 ID 2 enon c r BYP a 1 ID 1 font ID ID 2 extension font ID optional BTB Make on button text bold GUI BT B BTC Set on button text color default is black GUL BE C COLOL e g GUI BT C OxF800 Colom Color for On ourcton text Olue for the Sxamole above BTA Set on button text alignment default is center 1 GUI BT A Alignment_type enon GUI BT A 2 Alignment type BTS ioe lete il ror Center amc 2 iow iia Save current button settings GUI GUI GUI GUI GUI GUI GUI Iya sul Bi Bi Bi Ei Bi E O m z O Ss Venus Supply Co Ltd Page 24 BTL ThaiEasyElec comlllll Load settings to current button example below shows the movement setting is copied from example abo
45. id GUITCIl rT t2 UmsSigMec shore sei acl char exe mame _S els sereen LD txt_name textbox name GUICIrTxt3 Similar to GUICItTxt but target screen and target textbox are identified by their names void CULClEMxc3 Char Se ic_ name Char rxe Nene ser names screen neame CE nOg textbox name Venus Supply Co Ltd Page 70 Enable Your Design ThaiEasyElec comilll On line Electronics Shop for Embedded System GUIRefreshTxt Refresh textbox After textbox shown GUIAddTxt and GUICIrTxt won t update the screen Follow them by GUIRefreshTxt to update textboxes This function is assumed to be used with current screen so it doesn t need screen ID parameter GUIRefreshTxt2 Similar to GUIRefreshTxt but target textbox is identified by its name GUISetTxtKey In some application many key textboxes textbox that receives characters from keypad key buttons may be used on one screen Only one textbox can be active at a time In such case this function can be used to change key textbox GUICIrTxtKey Prior to set key textbox use this function to clear current key textbox GUISkipTxt Use this function with textboxes to skip them out and they will not be shown on screen Use GUIUnskipTxt to cancel the effect Venus Supply Co Ltd Page 71 ThaiEasyElec comillll GUIUnskipTxt Use this function with textboxes to cancel the effect of GUISkipTxt void GUIUnskipTxt unsigned
46. igin position of the image box default is 0 0 GU MIG OQ Xx ie e g GU MG O 100 200 xe horizontal position Y vertical position IMGI Set image ID used for the image box default is 0 GU MG ID e g GU MG 5 1DE ID of registered images IMGt Set transparency without this command the image box will be displayed normally showing white pixel GU MORE IMG d Disable the image at startup can be enabled later by software GU MG d IMG n Name the image for easy identifying in software user can specify the image with a name GU MG n Name eng GU MG n imagel Name a text to be used as the name of image Venus Supply Co Ltd Page 20 ThaiEasyElec comli IMGE End current image box setting end every image box setting with this command so the index increase for next one GU MG E 5 10 BT Button settings BTn Name the button for easy identifying in software user can specify the button with a name GUI BT n Name So Go GUI IB im INeSs lt ic Name a text to be used as the name of button BTO Set origin position of the button default is 0 0 GUL BE O x e g GUL BY 100 200 X IQ wAOMEEL jXOS aL icslOim Nas vertical position BTN Set image ID used for the button in normal state default is 0 GUI BEP N D e g GUI BI N O ICID 3 ID
47. ile Edit Tool Help EE IE a ara Screen Design your Background screens here home LBLO language BT10 button BT12 textbox BT13 imagefont BT14 A e r N 1 op bar BT16 Language Image Font popup BT17 freestyle BT18 scs7 SCS8 scsi List Color Button 1 lt lt Objects on SCA A TextBox em i Percent Bar Free Style listed here in order with their names current screen are Label b Box Background color 255 255 255 Function Property Table Set background or Selected object s III add new object Position properties are with these Selected object s shown here Dm functions position on the screen or A PopUp s I X a z Name and ID Show Time General Purpose Variables Keypad and Sound s Char Type Long Type Name sceso x El Screen 0 E sec E Popup indexo El Indexo language 255m ID 0 Index1 Keypad Default paseen E Index2 E Index ue F Index3 Sound 0 Screen Settings Settings for selected screen Venus Supply Co Ltd Page 87 Menu bar File New project Open project Save As Save Edit Copy Paste Delete Tool New screen Generate Project settings Help About SUN7 Studio Venus Supply Co Ltd ThaiEasyElec comli Create new pr
48. illll Colors GUI TXT C Text color Back color Fonts GUI TXT F ID 1 ID 2 Use image font GUI TXT i Text alignment GUI TXT A Alignment type Text length max GUI TXT L Length characters Password mode GUI TXT p Password character Multi line mode GUI TXT m Name GUI TXT n Name Transparency GUI TXT t End setting GUI TXT E Label settings GUI LBL 5 12 Origin GUI LBL O X Y Bold characteristic GUI LBL B Color GUI LBL C Text color Text GUI LBL T Text Fonts GUI LBL F ID 1 ID 2 Use image font GUI LBL i Text alignment GUI LBL A Alignment type Language GUI LBL L Lang Name GUI LBL n Name End setting GUI LBL E Box settings GUI BOX 5 13 Origin GUI BOX O X Y Size GUI BOX S Width Height Color GUI BOX C Color End setting GUI BOX E Table settings GUI TAB 5 14 Origin GUI TAB O X Y Bold characteristic GUI TAB B Color GUI TAB C Text color Border color Column parameters GUI TAB c Column Width Cap color Con color Text Row parameters GUI TAB R Height nRow Fonts GUI TAB F ID 1 ID 2 Text alignment GUI TAB A Alignment type Name GUI TAB n Name Venus Supply Co Ltd Page 112 ThaiEasyElec comli End setting GUI TAB E Configure global GUI CFG 5 15 parameters Default language GUI CFG
49. l developed to create GUI graphically Since version 1 09 GUI Script supports Extension Script for very simple projects which basic control is performed for example driving some output ports or simple communication through serial port 2 Related Files Source files related with GUI script are gui_engine h The header of GUI engine it processes GUI commands from script file gui_sound_plugin h In application with sound needed this is a plug in that works cooperatively with vs1011 c to manage MP3 files playing along the screens gui_script_bridge c With library limitation parameters defined must be stored somewhere in memory so library can be used with various settings This file stores defined settings in code memory and will be read by the GUI engine app_scr_func c and h This is the application specific source file created for users to writing their code And users need to define quantity of objects in the header file GUI_ENGINE lib The library file The source file versions this user manual referenced to are issued in Revision History Changes in source files can be seen in their header files Venus Supply Co Ltd Page 7 ThaiEasyElec comli 3 Features Screens Wait time assignable for no activity screens Namable assign name to screens for easy identification MP3 files assignable to play at the beginning of screens Multiple auxiliary values assignable for user purpose Standard keypads selec
50. nd init2 scr_id can be used to index the screen Anyway this cannot be applied to AppScrInit Example code below shows how to bind release of the 3rd button of the first screen to user_bt_release function For the first example this is done in AppScrInit void AppScrinit void guibt GUIGetBtID 0 2 release user bt release 0 first screen 2 37 button The second example biding is done in init function void user scr_init0 void guibt GUIGetBtID scr_id 2 release user bt release this affects the same as guibt GUIGetBtID 0 2 release user _bt_release since scr_id is 0 here Venus Supply Co Ltd Page 80 Enable Your Design ThaiEasyElec com ill init init2 and snd_end Care should be taken on doing something in init and init2 functions Due to the fact that init is called before everything is drawn on the screen And when finish drawing init2 is called So it s very important to know where your code should locate on or you will lose an hour for debugging There are 3 rules to remember 1 To enable disable or change some parameters on objects do it in init so the GUI engine use updated parameter to draw out objects Here you won t need to call those object drawing functions such as GUIRefreshBt GUIRefreshTxt or GUIShowImg 2 To add text to a textbox change sound in some special case reset key textbox do it in ini2 Doing anything later on the screen has th
51. nd users don t need to use SndReadCmd Function processes when GUI commands found Used from app_console c int SNDReadCmd unsigned int cons_ i Cong 1s index of console buffer to be processed return wrong argument 0 means no error SndInit Initialize objects to default value Used once before reading script This is called from GUIInit when sound plug in is applied woe Simellimalie Voro SndTask Task called from app_bs_demo c every 10ms void SndTask void Utility Functions SndClrList Stop and clear sound list can be used before SndAddList to play other sound than one that set from script void SndClrhist void SndAddList Add sound to list Using this function alone will wait until playing sound finishs To play new sound instantly use SndClrList before SndAddList void SndAddList unsigned short snd_no unsigned char segment_no snd_no sound ID segment no segment number of sound use 0 for non segmented sound SndSetOffset Vol Before a sound played the sum of offset volume and individual volume set from script will be used to set the chipset Venus Supply Co Ltd Page 78 ThaiEasyElec comillll void SndSetOffsetVol char new_offset_vol SndOn Sound is turned on by default this function turns sound on if SndOff is used void SndOn void SndOff Turn off sound Using audio commands cannot stop playing file from sound plug in This function will stop current pl
52. ned long border color border color default black unsigned short col width column width MAX TABLE _ COL char col text text in columns on the first row MAX TABLE _ captions COL unsigned short col_capt_color column s caption color default MAX TABLE white COL unsigned short col cont color column s content color default MAX TABLE white COL unsigned short row height height of each row unsigned short row num total tow unsigned short font id font id unsigned short xfont_id ext font id for example Thai z font void do_ event every case the table W associated void press function done when table pressed W char name stores address of name R unsigned char set internal use only bit0 3 alignment 0 left 1 center 2 right bit4 bold characters bits extension font set bit name set bit7 skip this table Venus Supply Co Ltd Page 60 ThaiEasyElec comillll Type percent bar t instance guibar gt Parameters associated with percent bars unsigned short horigin horizontal origin unsigned short vorigin vertical origin unsigned short image id image id unsigned short pin size pin size unsigned char val value in percent 0 100 RW unsigned char sens sensitivity applied only when touch response style is 3 unsigned short last gpos last position internal use only char name
53. nge is 0 255 The quantity of value can be set in source code default is 2 see appendix for more detail GUL SCS Inoz value e g GUL SCS C 0 5 Index index of auxiliary values Value number between 0 255 SCS L Set long type auxiliary values Its range is 0xO OxXFFFFFFFF The quantity of value can be set in source code default is 1 see appendix for more detail GUMS Come ECE Naes VaVe e g GUI SCS L O 100000 Index index of auxiliary values Value number between 0 0xFFFFFFFF Venus Supply Co Ltd Page 17 ThaiEasyElec comllll SCS W Set waiting time in case that the associated screen may show up temporary and then switch to other screen or switch to next screen The count will be reset every time an object is pressed GUL SCS W mima WD e g GUI SCS Ww 50 10 Time time in 100ms with example above the waiting time is 5 scconds TOR target screen ID to be shown after the waiting completed if ID is not entered next adjacent screen will be shown For multi path applications GUI SCS W Time ID ID 2 a e g GUL SCS W 50 L 2 3 ID n target screen ID for path 0 path 1 and so on single path assignment means that target screen IDs are the same for all paths SCS c Set waiting time to close incase of popup screen GUI SCS c Time e g GUT SCS e 50 Time time in 100ms with example above the waiting time is 5 seconds SCS K Enable keypad
54. of registered images BTP Set image ID used for the button in pressed state default is 0 GUI Br RP ID enc CUr pT P 1 DDE ID of registered images Venus Supply Co Ltd Page 21 ThaiEasyElec comli BTD Set image ID used for the button in disabled state default is 0 GUL BY D LD Sao CUL BY D 2 MDE ID of registered images BTI Enable shift interlock buttons Place 2 or more buttons on the same location disable them all but one The enabled one is shown and when it s pressed and released the next one will be in place GUL BI Order e g GUI BT O 100 200 CUMS Eas GUI BT N 0 GU Br 2 GUI BT 0 GUL BE E GUI ey thy GUL BY N 2 GUL BY P 3 GUTT BI 1 Gul iw el GW I is Order order of the sequence must start with 0 and can be up to 7 8 buttons in the sequence BTM Set the movement when the button is pressed default is 0 0 GUL Br M x X eng GUI BT M 2 2 xe rightward move in pixel We downward move in pixel Venus Supply Co Ltd Page 22 ThaiEasyElec comillll BTG Set the screen to go to when the button is released Or go to next screen CUI Bi Grae Dy a Gjo GUI BT G 4 HDE screen ID to go to if not entered go to next screen For multi path applications GUI Br EID DH e g GUL Bw EG IIPS ID n target screen ID for path 0 path 1 and so on single pat
55. oject Open an existing project Save project as a new one Save current project Copy selected object Paste copied object Delete selected object Create new screen Generate script folder Click for more detail Software information Page 88 Enable Your Design ThaiEasyElec comilll On line Electronics Shop for E led System Function File Edit Tool Help Function Background Background me Image Image Button Color Button TextBox w Label E Box Table ea N Bar oue Pop Up Venus Supply Co Ltd Page 89 Function Background Venus Supply Co Ltd F Use image background Image BG1 Image BG2 Image BG3 Image BG4 Image BG5 Image BGS Image BG7 Image BG8 7 Use color background cores LO E L Enable Your Design il ThaiEasyElec com On line Electronics Shop for Embedded System Language BG1 Language BG2 Language BG3 Language BG4 Language BGS Language BG6 Language BG7 Language BG8 Page 90 Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System Function Image Venus Supply Co Ltd Page 91 Enable Your Design ThaiEasyElec com ill line Elec System On line Electronics Shop for Embedded Function Pop Up Venus Supply Co Ltd Page 92 Enable Your Design ThaiEasyElec com ill On lin
56. order in the screen it belongs to return textbox object number GUIAddTxt For textbox that is just displayed on a screen its text can be simply assigned by strcpy or other functions Anyway for key textbox that has to be initialized on the screen init for example username setting screen old username has to be displayed on init use GUIAddTxt so cursor and position of new character are correct void CULACcliIxic unsigned shore Ser sel unsigned shore tt MO Char Sici Ser 16g sereen LD Exe MOS textbox order in the screen it belongs to STEE string to be added Venus Supply Co Ltd Page 69 ThaiEasyElec comli GUIAddTxt2 Similar to GUIAddTxt but target textbox is identified by its name void GUIAddTxt2 unsigned short _scr id Chaw exe neme Chet Sieic Psecriid screen name EzE names textbox name SET string to be added GUIAddTxt3 Similar to GUIAddTxt but target screen and target textbox are identified by their names voici CULACclixes Cher ser nene Char exc Meme Char Sicic See nanes Se Scia LD ES names Textbhoz name SET string to be added GUICIrTxt With the same reason with GUIAddTxt this is the one to be used to clear key textboxes voici CULCIisixe UaSaLeiMecl shore Sei acl unsigned shore rxt no Ser 16g sereen ILD Ie MOE textbox order in the screen it belongs to GUICIrTxt2 Similar to GUICIrTxt but target textbox is identified by its name vo
57. ound This kind of parameters is always the last one in commands 4 2 Parameter Descriptions Color color value range depends on color depth used in the application Color depth can be 8 16 or 24 bpp Below are example color values also listed in Icd_ctrl h Note that default color is black 0 parameters don t need to be set if default value used Venus Supply Co Ltd Page 11 Common color table ThaiEasyElec comillll In line Electronics Shop for Embedded System Red 0x03 0x00 1F 0x0000FF Green Ox1C 0x07E0 OxOOFFOO Blue OxEO OxF800 OxFFO000 Yellow Ox1F 0x07FF OxOOFFFF Purple OxE3 OxF81F OxFFOOFF Black 0x00 0x0000 0x000000 White OxFF OxFFFF Ox FFFFFF Language language variable in software is char type It s always one in 1 2 4 8 16 32 64 128 1 lt lt n n 0 7 Anyway the language value can be set from 1 to 255 This allows an object supports more than language In general case use 128 for single language objects and 255 for objects used for all language Object ID screen ID button ID and so on are indexed by short type variable A short type variable consumes 2 bytes so it can be 0 65535 OXFFFF is 65535 Anyway the value 65535 is used as some unset value and shouldn t be used by users Venus Supply Co Ltd Page 12 ThaiEasyElec comillll 5 GUI Commands 5 1 RBG Register background images The concept of GUI script is simple images background
58. pace required 1 6MB lt Back Next gt N Cancel Press Next until you finish the installation Now try on Windows s command make version the result should be the same here unless the Yagarto Tool may not be installed completely Venus Supply Co Ltd Page 107 ThaiEasyElec comillll ct C WINDOWS system32 cmd exe C gt make version GNU Make 3 81 Copyright lt C gt 2006 Free Software Foundation Inc This is free software see the source for copying conditions There is NO warranty not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE This program built for i686 pce mingw32 C gt And then install YAGARTO GNU ARM Toolchain until you ve got to Choose Components page select as in the picture below YAGARTO 4 3 3 Setup Choose Components Choose which features of YAGARTO 4 3 3 you want to install Check the components you want to install and uncheck the components you don t want to install Click Next to continue Select components to install Binutils 2 19 1 Newlib 1 17 0 GCC 4 3 3 GDB 6 8 50 Add YAGARTO to the PATH variable Space required 337 7MB lt Back Next gt N Cancel Venus Supply Co Ltd Page 108 ThaiEasyElec comillll Press Next until the installation is finished Now test it with command arm elf gcc version for newer version of Yagarto this might be arm none eabi gcc version
59. r MP3 files csc css aneninvvonsseisveienieanentewdetesensuievanemteneattveavmnei teeter 43 6 3 RGC Register MP3 files for multi language application eeeeeeeeeeees 44 E WAONE SCOPO aree E e E E sea EEE E 45 TA CTL Structure sisene E EEE EE REEE ERRA 45 7 2 Script Making Guidelines castes ccacescseeoneenbcence dat eoensusbicacosauedadectuenaviacerneceubiones 47 GUI Engine Setup GIGS as sesccacenceesntecestinctdcesedatdeasatnnisbbeaatedactes bl ai ei i eei 48 8 1 Download Example Project n noosessseesseeessesessseessereesseessseessserssereessreesseeessee 48 8 2 Add GUI Engine Library sesseseseseesseeesssresseresssrerseresssresssreesseessereessressseeesses 48 8 3 Disabling Sound Plug in ssessesesessessssesssresseressserssereesseessseeesserssereessreessseessee 50 9 Application Programming Interface scccsscte secu snscasenantiuadcancesntnattaavedavsdepeenceatenasiides 51 Dol SUN ParametetS ecreis arar n a E decease bee eo aarecn tuna E AARE 51 9 2 Opject SUCUT Senere e e E EAE AREE EE ER EE IEN EEST 54 9 3 API F ctions GUD escansaasesseesiecacssanuenersckteasrataeaseuchsbecssauveeecsenvaccsueiuebeeucienees 63 9 4 API Functions Sound eeeeeeeeeeeseeeeeeessseesssesesssesesessseseseseseseseseseseseseseseseseseseee 78 9 5 External Variables escesenecnsinieniisinisi aa eeii a ii aiai 79 9 6 Programming Guidelines s nsseseseeeesseeseeeesseresestesseeesssresseresssressereessreeseseese 80 10 Extension Scrip
60. rogram folder document or Internet resource and Windows will open it For you Open cmd v Type java version to see Java Runtime version on your machine ct C WINDOWS system32 cmd exe C gt java version java version 1 6 6_13 JavatCIM gt SE Runtime Environment Cbuild 1 6 6_13 h 3 gt Java HotSpot lt TM gt Client UM Cbuild 11 3 b 2 mixed mode sharing Cs gt _ If this is not installed on your machine download it from here http java sun com javase downloads index jsp The version using in this application note is Java Runtime Environment JRE 6 Update 13 Venus Supply Co Ltd Page 106 ThaiEasyElec comillll 1 2 Install Eclipse IDE for C C Developers Eclipse IDE for C C Developers can be downloaded from http www eclipse org downloads There you will get file eclipse cpp ganymede SR2 win32 zip Unzip it and install on your machine 1 3 Install Yagarto Tools and Yagarto GNU ARM Toolchain Download from http www yagarto de index html Follow the installation until Choose Components page select as in the picture below YAGARTO Tools 20070303 Setup Choose Components Choose which Features of YAGARTO Tools 20070303 you want to install Check the components you want to install and uncheck the components you don t want to install Click Next to continue Select components to install Add the make utils to the PATH variable Description S
61. s after all file registering finished where all memory used for images fonts and extension fonts are summarized GUL MEM 5 7 SCS Screen settings SCS S Set associated screen ID with this command scripts afterward will belong to this screen ID CUI SCS ID e g GUT SCS HDE sereen LD Venus Supply Co Ltd Page 15 Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System In case that the screen is popup window not full screen width and height of window must be set using the same subcommand GUL SCS S 1D Widen weighe Cn Gja GUI SCS 300 200 IID screen ID Width screen width Height screen height Note that popup window always show at the center of screen calculated from its size And all the origin positions of object inside are referenced to the window s origin top left not the LCD see image below Venus Supply Co Ltd Page 16 ThaiEasyElec comli SCS n Name the associated screen for easy identifying in software user can specify the screen with a name so the screen ID can be changed without code modification GUI SCS n Name SoGo GUI SCS n screenl Name a text to be used as the name of screen SCS P Switch path to new path when the screen is shown up Ignore this command for single path application GUI SCS P Bath So Go GUIS Com ral Pelicin 3 new path to be switched to SCS C Set char type auxiliary values Its ra
62. short id iele textbox ID GUIInsertChar Use this function to insert a character to the key textbox vondi GUslmE ms Sua nama ehan eR enk character Label related functions GUIPrintLbl Print label on the screen This is used by GUI engine itself In general case users can ignore this function void GUIPrintLbl unsigned short id idle label ID GUIGetLblID Get label ID similar to GUIGetBtID unsigned shore GUITCertLbliD unsigned shore ser id unsigned shore _ lol no Scr ide sereen TD dbl nos label order in the screen it belongs to return label ID GUIGetLblID2 Get label ID from its name similar to GUIGetBtID2 The label name must first be set from script with LBL n lnet CGUIGetLholrD unsigned short sei ic char oll name SGi ils sereen ID Lol names label name rer UUIE 2 leaeosl ID when mnor Towne Venus Supply Co Ltd Page 72 Enable Your Design ThaiEasyElec comli On line Electronics Shop for Embedded System GUIGetLbIID3 Get label ID from its name and screen name similar to GUIGetBtID3 inete GUIGertLolIiDS char Sexe neame Char loll nane ser names sereen neme lbl names label name Teruras label ID i winein mnor cowna GUISkipLbl Use this function with labels to skip them out and they will not be shown on screen Use GUIUnskipLbl to cancel the effect void GUISkipLbl un
63. signed short id id label ID GUIUnskipLbl Use this function with labels to cancel the effect of GUISkipLbl void GUIUnskipLbl unsigned short id idle label ID Table related functions GUIGetTableID Get table ID similar to GUIGetBtID GUIGetTableID2 Get table ID from its name similar to GUIGetBtID2 The table name must first be set from script with TAB n Venus Supply Co Ltd Page 73 ThaiEasyElec comli GUIGetTableID3 Get table ID from its name and screen name similar to GUIGetBtID3 ine CGUlGercTablerDs Char SCie nane Char vrao nane ser name Sereen name tao name button name IESE 3 table ID i when not found GUIWriteTable Write text in table with options defined by script void GUIWriteTable unsigned short _tab_no unsigned short row unsigned short col char text taD nog taole Ocoee im the gereen ir belongs ice row row number start with 0 conli column number start with 0 text text to be written GUIWriteTable2 An extended version of GUIWriteTable With this one parameters can be specified beyond settings from script void GUIWriteTable2 unsigned short tab_no unsigned short row unsigned short col char text unsigned long back color unsigned long font color cag nos taole Order in che gereen it oelongs ico row row number start with 0 codi column number start with 0 text text to be written back Colors back Color cell color
64. signed short txt start first textbox ID associated unsigned short txt num total textboxes associated unsigned short tab start first table ID associated 5 unsigned short tab num total tables associated unsigned short Ibl start first label ID associated unsigned short lbl num total labels associated unsigned short box start first box ID associated unsigned short box num total boxes associated z unsigned short img start first images ID associated unsigned short img num total images associated unsigned short bar start first bar ID associated unsigned short bar num total bars associated unsigned short snd sound ID from snd to be played unsigned short path target path when the screen displayed unsigned int wait time wait time in 100ms Venus Supply Co Ltd Page 54 Enable Your Design ThaiEasyElec com filename unsigned short goto _ scr target screen id when timeout MAX PATH with wait and go set long aux 32 auxiliary integer type R AUX INT NUM variable s char aux_8 auxiliary character type R AUX CHAR NUM variable s unsigned long color background color in case of plane background used unsigned short set internal use only bit0 2 background added bit3 1 plain background set bit4 1 wait and go set bit5 1 play sound at start bit6 1 screen name set bit7 9
65. skipping files loading images background fonts Beware to use this only when the board is always powered with all files loaded into SDRAM once and all scripts are unchanged program the board once with this function commented out and uncomment it for next programming without removing power Note that there may be losses of data on SDRAM these only occur with images and fonts but not with object s parameters void GUISkipFileLoading void GUIGetFreeAddress Use this function to get free memory start address in SDRAM after script reading completed The rest of memory can be used for general purpose Also mind that there is reserved memory for JPEG decoding at the end of SDRAM unsigned long GUIGetFreeAddress void Font related functions GUICfgFont Configure font from font_id use xfont_set if extension font used void CULCrE Pome ums ignecd short ront iel unsigned short xfont_id unsigned long bold unsigned long xfont_set romt telg ID O FONT xicOme ids ID OE extension Font bolele use 1 for bold text xon Set use 1 it extension Tont needed tO be configured or use 0 and xfont_id will be ignored Venus Supply Co Ltd Page 64 ThaiEasyElec comli Language related functions GUISetLang change language mode void GUISetLang unsigned char lang leng language mode must be set in 1 lt lt n where n 0 7 GUIGetLang Get language mode unsigned char GUIGetLang void
66. t eroras yoe en i E E AEAEE EE EERE 84 10 1 Commands in Extension Script ssssessesessesesssresseseessrrsseseessersssreesseeesseeessee 84 10 2 Attach Script to Components sessssessesessesesssresseseessresseeeesseessereesseeessseessee 84 IORS AE LEA E EEE 85 I SUN StudiO as seinor raene eeaeee E EEE EEEE EE EE EREEREER 86 VITTO get SUNI AIO oe ce sescciactensetsatudestinsndcesnbathen eaten vntbidatedestnaibansed E E 86 11 2 User Interface Descriptions rieira seintes tarkin bucasesheuinapaimiauateudauecenanacenmneabees 87 1 3 To create new PTOI CCL rscnissirerrrecrisnierrnireo raires iranier ern E a E E E eE ras 105 Venus Supply Co Ltd Page 5 ThaiEasyElec com ill hop for Embedded Sy PR HS TI N E ea cove eens 9d avs wan eas EEE EEE 106 1 Installation of Eclipse and V AGAR O sssecssnccsevasKeesenscdeysinnvenseaccer eeoisasamdeoneents 106 2 Command Listigi E E ee ee te 110 Venus Supply Co Ltd Page 6 ThaiEasyElec comli 1 Introduction GUI script is a new concept for GUI development on non OS application It s designed for engineers who have skill in C programming and microcontrollers GUI script makes GUI development faster upgradable and more flexible Advantages of using GUI script are described in BlueScreen SUN7 User Manual In this user manual user will have more detail on commands API and programming guidelines The last chapter introduces and describes how to use SUN7 Studio The latest software too
67. table to screens Image backgrounds with language assignable or plain color backgrounds Event before screens being drawn Event after screens being drawn Event every 100ms while the screen being displayed Event when keypad pressed Event before key textbox inserted Event when sound list ended Extension script supported Popup screen Same features as normal screens Unlike normal screen popup screen is just a window not full screen shown on a normal screen and when closed the base screen continues as it was before the opening of the popup screen Buttons Image buttons with language assignable Plain color buttons Image or color in normal pressed and disabled states Transparency supported Movement while being pressed supported in downward and rightward direction only Namable assign name to buttons for easy identification On button text with specifiable font color and bold characteristic Key buttons supported Language mode change supported Auxiliary value assignable for key buttons or user purpose Go to target screen ID when released or open close popup screen Shift interlock buttons Global sounds played when buttons are pressed Venus Supply Co Ltd Page 8 ThaiEasyElec comillll Event when pressed Event when released Event when buttons are associated in all case Extension script supported Repetition supported events repeated while pressing Images on screen Lang
68. td Page 56 Enable Your Design TI l ThaiEasyEle Type button_t instance guibt gt Parameters associated with buttons c com name set unsigned short horigin horizontal origin unsigned short vorigin vertical origin unsigned char hmove rightward shift distance when pressed unsigned char vmove downward shift distance when pressed unsigned char cmd special command int aux val auxiliary value for general R purpose for example used as a number of keypad unsigned short disa image image id for disable state unsigned short norm image image id for normal state unsigned short pres image image id for pressed state unsigned short goto scr screen to go when button is MAX PATH released void do_ event every case the button W associated void press function done when button is W pressed void release function done when button is W released char text stores address of text char name stores address of name R unsigned long text color text color default black unsigned short font id font id unsigned short xfont_id extension font id for example Thai font char xscript store address of extension filename unsigned long set internal use only bito disa _ image set bitl norm image set bit2 pres image set bit3 goto set bit4
69. the SHOW_ACTIVITY is defined to 0 or 1 or undefined if it s 1 the screen turns black and shows files being loaded the screen turns to selected background instead and the SHOW_ACTIVITY value is ignored 5 19 BAR Percent bar settings Percent bars can be used to display progress status volume and scroll bar There are many options available for example the user can set its moving style touch response orientation If bar is composed of tube and the bar itself use an image IMG for the tube Venus Supply Co Ltd Page 37 __Enable Your Design ThaiEasyElec com il On line Electronics Shop for Embedded System BARO Set origin position of the bar default is 0 0 always use the top left corner no matter what the orientation is BARI Set image ID used for the bar default is 0 BAR v Set orientation to vertical default is horizontal BAR V Set initial value in percent default is 0 Venus Supply Co Ltd Page 38 Enable Your Design ThaiEasyElec comill In line E nics Shop for Embedded System BAR s Set touch response style default is 0 GUL BAR REPONSE Style Sensaicdvalicy E38 GUI BAR s 2 RESOONSe Sicyles muimecical walue music be berwecim O 3 O no response value can be set by software only 1 move to the touch value changed only on the press 2 follow the touch movement value changed continuously Ome om Ee Ouelim mons 3 slide with touch movement value change
70. tton s value for example we set BT V 1 for the small size Scripts below show what would come out small popcorn UI BT X p U BT U BT L BI U BT U BT U BT QNAAADAAADAAAD C Hoz lt sugK Z ja medium popcorn U BT UI Br BT U BT U BT 3 AQQQAQAS C Hoz lt s big popcorn U BT UL BT BT U BT U BT 5 Ho ade QAaQnaaaQ c In the code we first have to look for popcorn buttons by their cmd This could be done in AppScrInit or the init function for the related screen And we bind their release function with popcorn_bt_release void AppScrInit void ine i for i 0 i lt MAX BUTTON i if guibt i cmd p guibt i release popcorn bt_ release Venus Supply Co Ltd Page 82 ThaiEasyElec comllll Then in popcorn_bt_release we read its value and set to a global variable price for next process void popcorn _bt_release void unsigned short cid ScrGetCurrentObj price guibt bt_id scr_id cid aux_val Notice the ScrGetCurrentObj function it returns the current object ID on the current screen The returned value reflects the button order on the current screen but not for other type of object In the same way with popcorn price if one needs to printout what s bought on the bill button name can be set For example BT n
71. uage assignable Transparency supported Namable assign name to image boxes for easy identification Textboxes Text background and border color assignable Maximum characters assignable Password mode with assignable displayed character Specifiable font color and bold characteristic for texts Text alignment left center and right Insertion allowed with cursor enabled or not no cursor Image font supported Namable assign name to textboxes for easy identification Transparency supported Tables Row quantity row height assignable Column width caption color caption text and content color assignable individually Specifiable font color and bold characteristic for texts Border color assignable Event when pressed Event when tables are associated in all case Namable assign name to tables for easy identification Labels Language assignable Alignment left center and right referenced from origin position Specifiable font color and bold characteristic for texts Namable assign name to labels for easy identification Image font supported Venus Supply Co Ltd Page 9 ThaiEasyElec comli Percent Bars Vertical and horizontal bar supported Bar with pin supported 4 touch response styles 2 movement styles Namable assign name to bars for easy identification Event on the move Event when moving stopped Boxes for making simple boxes or lines on screen Color assi
72. upply Co Ltd Page 103 Enable Your Design ThaiEasyElec comilll On line Electronics Shop for Embedded System Screen Settings Show Time Show Time SCS W C Screen Next screen SCS W Goto path o H Sec E Popup Custom screen bf SCSO Screen Settings General purpose General Purpose Variables Char Type Long Type E Indexo E Indexo E Index1 E Index2 E Index1 E Index3 Screen Settings Key and sound Keypad and Sound Language 255s Select language for display E Keypad Default v E Sound SND Venus Supply Co Ltd Page 104 ThaiEasyElec comli p for Embedded Sy 11 3 To create new project Edit Tool Help New Project Ctrl N Open Project Ctrl Step1 Select New Project Import Script Save As F12 Ctrl S New Project Project location Path Step2 Choose path to save Screen setting 7inch 4 3 inch Custom screen 16bit Step4 Choose color depth Step3 Choose screen size Tinch 4 3inch or custom size Width 8001 xels e 24bit Height 480 H pixels ox cme Venus Supply Co Ltd Page 105 ThaiEasyElec comillll Appendix 1 Installation of Eclipse and Yagarto 1 1 Install Java Runtime Environment JRE Select Start Menu from your Windows and then Run type cmd and hit enter Type the name of a p
73. urrent text box setting Venus Supply Co Ltd Page 32 ThaiEasyElec comillll 5 14 TAB Table settings TABO Set origin position of the table default is 0 0 GUNA OR E oman GUI TAB O 50 200 Xx horizontal position We vertical position TAB B Make texts on the table bold GUI TAB B TABC Set text and border colors defaults are black GUI WAS C Text Color Border Colo SoG GUI TAB C OxF800 0 Text COlors text Color Border Colors border color TAB c Set column parameters GUI WAS Columa Wicdta Cap color Con Color Texet e g GUI TAB c 0 100 00770 OxFFFF No GUI TAB c 1 200 0x07E0 OxXFFFEF Item Name GUI TAB c 2 400 0x07E0 OxFFFF Description Column column index Width column width Cap Colors caption Color the coo row Com colors Content COlor every row out tche tOp One Text caption text optional Venus Supply Co Ltd Page 33 ThaiEasyElec comllll TABR Set row parameters GUI TAB R Height nRow e g GUI TAB R 50 10 Height row height nRow number of row TABF Set font and or extension font defaults are 0 GUI TAB F ID 1 ID 2 GoGo GUI TAB F 1 1 ILD IL 2 rome ID ID 2 extension font ID TABA Set on text box text alignment default is left 0 GUI TAB A Alignment type 56x GUI TAB A 2 Alignment type O for left 1 for center and 2 for right TAB n Name the table for easy identifying in soft
74. ustomized keypad kp3 users need to bind their keypad init function to GUI engine Bound function will be called when screens that use customized keypad are shown screen with SCS K 6 or SCS K 7 Binding using GUIBindCustomKP3Init should be done in AppScrInit Vj OnGnG UME Abel Cus C OMKES MEN VO A EE Unsieonedieharikpino uns ionedd harrobien kp3 E ko FUERE customized keypad initial function Button related functions GUJEnableBt Enable buttons If the button is shown this will not redraw the button follow this function by GUIRefreshBt to redraw with enable state Enabling button in screen init function init doesn t need GUIRefreshBt void GUIEnableBt unsigned short id Lele oterom LID Venus Supply Co Ltd Page 66 ThaiEasyElec comli GUIDisableBt Disable buttons If the button is shown this will not redraw the button follow this function by GUIRefreshBt to redraw with disable state Disabling button in screen init function init doesn t need GUIRefreshBt void GUIDisableBt unsigned short id LCE ouccon LD GUIGetBtID To enable disable or read some parameters from buttons its ID must be known But from the script buttons are created and assigned ID by their order For example the first button of the first screen will have ID 0 and the first button of the second screen will have ID equal to the quantity of button in the first screen So with known screen ID
75. ve The save and load commands help users in setting common parameters for buttons GUI SoGe GUI GUI GUI GUI GUI BT V Bi Bi Bi BT Ei Bi L leal tho 4 e 2 3 300 200 Set value for the button A 32 bit integer is used to store the value so the range is 0 Ox FFFFFFFF GUI Soo GUI Value va BT X BT V BT V Value KAU lu tor che louccom Set special action for the button default is 0 GUI o Gjo GUI Value special BT X Value Bi accion Cor the louicicoms 1 for key button the value set by BT V will be used as a key character Language change button the value set by BT V will be used as new language 2B iow J Venus Supply Co Ltd Page 25 BT s ThaiEasyElec comllll Extension script setting a script file text file can be set so it is read when an action occurs with the button See section 10 for more information Allowable button events are lt PRESS gt and lt RELEASE gt GUI SoGo GUI BT s Filename BI 6 our roni s Txe Filename the script file name refer to the script path from the example the buttonl txt should be in sr folder same locacion wita maimo TE BTr Enable repetition for the button Repeat periods can be set with CFG r b GUI IB ie BT p Open popup window GUL BE D e g GUL BU p 8 TOR screen ID must be a popup screen BT c Close popup window GUI BTE igi
76. ware user can specify the table with a name GUI TAB n Name s Gjo GUI TAB n total Name a text to be used as the name of table TABE End current table setting GURAB SE Venus Supply Co Ltd Page 34 ThaiEasyElec comli 5 15 CFG Configure global parameters CFG L Configure default language default is 1 CUI CHC EEan CHOR GUI CFG L 2 Lang default initial language CFG S Configure default button sound This will be applied for all buttons GUI CFG S ID 1 ID 2 e g CUI NCH Crom Ome ID 1 sound ID used when buttons are pressed ID 2 sound ID used when disabled buttons are pressed optional CFGrk Configure repeat interval for keypad There are 2 intervals the interval for first time the interval starts when the keypad is pressed until the first action occurs and the interval for the rest GUL CRG k fixsic diacerval Nexc dmcervell e g GUL CRE zk 5 Pirgst intervals interval loeicwecin the press and the first repeat MUST be more than 0 Next intervals interval logirweem the net repeat Can be OK DEST effort Venus Supply Co Ltd Page 35 CFGrb ThaiEasyElec comillll Configure repeat interval for buttons with repeat action enabled There are 2 intervals the interval for first time the interval starts when the button is pressed until the first action occurs and the interval for the rest At any repeats both press and release

Download Pdf Manuals

image

Related Search

Related Contents

Albatros - Jurapac Pompes à chaleur  Compact Security Safe Owners Manual Model  Istruzioni per l`uso dei bollitori delle serie PSM, PSR  

Copyright © All rights reserved.
Failed to retrieve file