DaveSDK helpcontents


DAVE™ SDK help

9/19/2015 9:17PM


How to import APP
Manifest
How to require multiple apps
MF
Sharability
Resource Group
Signal and SignalConnection
Deveice Explorer
Signal Design
Advanced Widegets
Error Report







How to import APP

8/25/2015 4:19 PM
如何在DAVE4 SDK import已有的APP

1.在 -> Dave -> Model -> APPS 中找到app源文件 ALT+ENTER 找到文件地址。

2.找到Uimodel文件夾下的.ui文件 將它更名去除”_0” 例如:CLOCK_XMC1.ui

3.打開DAVE4 SDK 新建dave sdk project 命名爲CLOCK_XMC1

4.把app源文件對應複製到新工程中

5.打開template,manifest 文件註釋如圖:

6.保存

返回頂部












Mainifest

8/25/2015 4:19 PM
什麼是Manifest?

       Manifest是用戶對APP進行控制的文件。它可以和Widgets窗體部件互相交互,顯示給用戶,讀寫窗體上的數據,所以在恰當的邏輯下APP可以與寄存器交互申請必要的硬件資源和聲明適當的信號。有對象用於準備生成代碼,從manifest對象中獲取數值和使用templates生成 .c 文件。
Manifest的結構由Manifest Structure決定,它主要是一個Groovy類,用戶應該在構造函數中寫APP的程序和generateFiles()方法。

爲什麼需要Manifest?
       基本上manifest是APP 的核心,沒有它你可以生成不錯的app GUI但它不能生成任何代碼,不能與GUI上的部件交互也不能申請硬件資源。

Manifest在哪裏?
在DAVE Apps Explorer → → MANIFEST → .manifest


Manifest Properties

每一個DAVE™ APP 必須要有一個manifest文件。例如:DEMOAPP.manifest.
Manifest包含下面部分:

1. 加載聲明(Import statements)
2. 類(Class object for DAVE™ APP (e.g. DEMOAPP))

       所有的屬性必須在app類中定義。如果它們沒有被聲明,在生成app時就會產生錯誤。
這些屬性不能被app的GUI改變。它們能以任何順序被定義,能在templates file 中被讀取。
屬性應該這樣定義:

def <property_name> = <value>
<Type> <property_name> = <value>

在下面的程序你能看到默認生成的manifest file 和其中的定義和各個屬性:


// Import statements
import ifx.davex.app.manifest.*

class DEMOAPP extends DEMOAPP_GUI {

   // Note : Following APP properties are mandatory and important
   // Begin : APP property section

   /**
    * APP version
    * Format: a string with three digit separated by a dot.
    */
    def version = '1.0.0'

   /**
    * APP categories declaration. 
    * It is list of strings. Subcategories are separated by slash.
    * No limits on number of categories and subcategories depth.
    */
    def categoriesDescription = ["Category/Sub Category"] 

   /** 
    * Minimum DAVE version required for this APP.
    * 
    * It is string with three digit separated by a dot.
    */
    def minDaveVersion = '4.0.0'

   /** 
    * Keywords used by search feature in APPs selection view
    * 
    * It is a list of string.
    */
    def keywords = ['My keyword']

   /** 
    * softwareIDs is used to declare which devices are compatible with this APP.
    * It is a map with key a string containing a pattern that shall match the SW id of
    * the device and as value the minimal version of the APP.
    */

    // Any step of XMC4500F144 and XMC4400F144
    // Any step of XMC4400F100 and XMC4400F64
    // Any step, any variant and any packages of XMC1300
    def softwareIDs = [
        "XMC4.[4-5].00.F144.*":"1.0.0",
        "XMC4.4.00.(F100|F64).*":"1.0.0",
        "XMC1.3.*.*.*":"1.0.0"
    ]

   /**
    * Singleton property:
    * When it is true the APP can be instantiated only once. 
    */
    def singleton = false


   /**
    * initProvider property
    * It shall be true to add a call to _Init() 
    */
    def initProvider = false

   /**
    * Deprecated APP
    * Set it to true to indicate that the APP shall be not used for new projects.
    */
    def deprecated = false

   /**
    * Sharable property.
    * It shall be true to allows multiple APPs to require the same instance of this APP.
    */
    def sharable = false

   /**
    * APP function description.
    */
    def description = "Here the APP description. Please add appropriate APP description"

    // End   : APP property section

    // Begin : User APP property section 
    // End   : User APP property section

    // APP Constructor
    public DEMOAPP(DaveEnv daveEnv) {
        //TODO: Initialize manifest variables here
    }

    // File Generation
    def generateFiles(){
        generate("demoapp.tmpl", "demoapp.h", false)
    }
}
**屬性:**
version
categoriesDescription
minDaveVersion
keywords
softwareIDs
singleton
initProvider
deprecated
sharable
descrition

返回頂部




##How to require multiple apps## **如何在父APP中建立多個APP
**        在這個demo APP中,我們需要2-5個DIGITAL_IO APP 根據微處理器的型號(XMC4500兩個XMC1200五個)。最簡單的方法是寫下建立一個APP的語句複製2遍然後用if判斷是不是1200來決定是否有接下來的3遍定義。
然而,我們可以用循環,Groovy來使它更爲緊湊。
首先,我們以最大可能用的數目來定義”MRequiredApp”

 // Begin : User APP property section

  MRequiredApp          appres_digital_io_0     /* DIGITAL_IO APP */
  MRequiredApp          appres_digital_io_1     /* DIGITAL_IO APP */
  MRequiredApp          appres_digital_io_2     /* DIGITAL_IO APP */
  MRequiredApp          appres_digital_io_3     /* DIGITAL_IO APP */
  MRequiredApp          appres_digital_io_4     /* DIGITAL_IO APP */


在類中我們將用前面的定義:

    /* --------------------------------------------------------------- */
    /* ------------ APP consumption Block ---------------------------- */
    /* --------------------------------------------------------------- */
    /* DIGITAL_IO APP from 2 to 5 instances */
    for(int i = 0; i 
##MF## **聲明:**

MF(
    Closure function,
    class returnType
)   
**描述:**
       一個標準的APP需要一些從GUI上獲取輸入值的邏輯,用他們計算出另外的數值傳遞給template文件或者顯示在GUI上另外的窗體部件上。
       這可以通過MF函數來實現(事實上MF並不是一個函數而是一個閉包,例如一個構造函數的函數)。這種特殊的類型需要與Groovy的閉包區分。
Parameter nameParameter typeDescription
functionfunctionA Closure means some embedded code between braces
returnTypeclassThis parameter determines the class type of the closure (e.g. “Boolean”, “Integer”, “String”, “Float”, “List”, “Map”)
Execution context:
Instance constructor
**例子:**
       在這個例子裏我們的“DEMOAPP”有兩個窗體元素:一個GLabel和一個GCheck。GLabel的可見屬性可以被MF設置和更新。在這種情況下當我們按下check box label 變得不可見。

void DEMOAPP(DaveEnv daveEnv){
    glabel_1.visible = MF(
        {                     // The code between ..
            gcheck_1.value    // .. braces is known .. 
        },                    // .. as the "Closure"
        Boolean               // This is the "class" return type
    )
}

**MF 函數的執行方式:**
       在實際運行時DAVE™用一種特殊的方式來執行MF,與電子表格的執行方式相似。例如Microsoft Excel 文件。
       我們把GUI中直接或間接變化的變量稱爲MVariables,就是MF中關聯的變量。MVariables就像電子錶中的單元格,他們可以包含常量或函數,常量就像一個沒有輸入值的函數。
**定義:**
**Free MVariable**: 包含常量的**MVariable** 或沒有輸入變量的MF 函數
**Non-free MVariable**: 有輸入值的 **MF**函數
**MVariable 屬性:**
1. 如果你讀取Non-free MVariable你會得到函數值的更新。
2. 不可以更改”non-free” MVariable 的值或函數表達。
3. 如果你更改Free MVariable ,所有的於它相關的Non-free MVariable會由從屬關係樹向下遞歸直到所有受到影響的MVariables更新。
4. 不能做循環引用。
5. 所有APP GUI 變量是MVariables。
6. 如果更新變量相同MVariables將不會更新。
7. MVariables可以在APP 構建時設定,但在MF 函數中只可讀,應爲它會自動更新。
an example of MVariables dependency tree:
![](http://img-storage.qiniudn.com/15-8-25/93411753.jpg)
**MVariables 類型:**
每一個 GUI Widget 有多種變量屬性,但在於GUI交互時只有MVariables 導出的屬性可以被控制。
• MInt
• MFloat
• MString
• MBoolean
• MList
• MMap

返回頂部




## sharability ##        DAVE™ APPs 根據manifest中的sharability 屬性能被設置爲可被共享或不可共享。Sharable的概念被用在當APP被需要在多個APP需要時。

如果一個APP可被共享:
1.多個APP可申請同一個已被共享的APP。
2.可被共享的APP自動成爲non-free MVariables 所以它們的屬性不能被“父”APP所更改。
3.可以通過“父”APP的manifest 設置RNOTSHARABLE參數把一個可被共享的APP可以轉化成不可共享。
![](http://img-storage.qiniudn.com/15-8-27/206127.jpg)
如果一個APP不可被共享:
1.這個APP必定只有一個“父”APP。
2.APP屬性是free MVariables,它們可以被“父”APP更改。
3.一個不可被共享的APP不可以轉換成可共享的。
APP sharability propertyRequired as RSHARABLERequired as RNOTSHARABLE
def sharable = trueSharableNot Sharable
def sharable = falseNot SharableNot Sharable

返回頂部




## Resource Group ##        從單片機軟件的角度,寄存器的位字段是最小的功能單元。HW resource group 是一系列能被URI(統一資源標識符)識別的位字段的集合。此外,這個寄存器位字段的實現的功能和組成的硬件功能塊,E.g. CCU8中的一片CC8單元包含多個寄存器位字段,它相應的URI是”peripheral/ccu8/*/cc8/*”,”*”表示”any”單元或者slice。這一命名方法非常有用,它可以包含所有的硬件單元(與FPGA的概念相同)。
注意:儘管是同一個寄存器的位字段,也可能出現在不同的HW resource group中。

一個格式完整的硬件資源組是這樣的:
http://www.infineon.com/0.1.30/peripheral/ccu8/0/cc8/0/gidls_ssi
寫在manifest裏:
resourceGroupUri=[“peripheral”,”ccu8”,”*”,”cc8”,”*”];

爲了找到特定MCU的特定HW resource group 我們可以用DAVE™ SDK Device Explorer。
![](http://img-storage.qiniudn.com/15-8-27/56851413.jpg)
       在這個例子裏,HW resource group對應的是XMC4500-F144的”peripheral/ccu8/0/cc8/0”,你可以看到功能塊CCU8的構成。
       在manifest裏我們能用一個或者多個resource group,定義虛擬信號,根據相應的應用需求給它們寫名字。你可以不同APP中的信號之間建立連接,你也可以定義信號不連接,用戶在Dave中連接。
       從更爲普通的觀點來說,我們可以把硬件單元定義成包含io信號的一個或者多個resource groups,用這個resource groups可以實現一些特定的功能。
![](http://img-storage.qiniudn.com/15-8-27/93238524.jpg)
       在硬件單元之間有很多相關的連接,因此人工地很難照顧到所有的連接。所以,solver會爲我們解決這個問題,APP的開發者只需要定義resource groups之間的連接。例如:想象我們現在有4個資源組{ p1/0, p1/1, p2/0, p3/0 }(”P”代表”peripheral”(外設)),每一個硬件組包含一些resource groups(”rg”)
1. { rga/0, rga/1 } ⊂ p1/0
2. { rga/0, rga/1 } ⊂ p1/1
3. { rgb/0, rgb/1 } ⊂ p2/0
4. { rgz/0, rgz/1 } ⊂ p3/0
       每一個成員代表了相應的硬件或resource group。在下面的情況中我們有兩個相應的硬件組(“p1/0” and “p1/1”), 它們內部的resource group的名字是一樣的,例如兩個USIC模塊分別有兩個channel。
![](http://img-storage.qiniudn.com/15-8-27/59484063.jpg)
       在你觀察上圖的過程中你可以發現有很多硬件的模塊之間的連接(form interconnection network to interconnection work),但是沒關係,我們有solver!通過solver的處理我們只需要關心資源組的連接,就如下圖:
![](http://img-storage.qiniudn.com/15-8-27/89621344.jpg)
       當solver決定是否需要連接被需要的resource group 之後,你可以通過在templetes或manifest 中要求solver返回相應的寄存器地址,或者你可以使用現有的APP讓它們爲你配置。
       在最後,作爲一個APP的開發者及使用者你只要關心虛擬的信號連接,不需要關心硬件連接了。
![](http://img-storage.qiniudn.com/15-8-27/48968590.jpg)

返回頂部




## Signal and SignalConnection ##        在DAVE™的代碼引擎和DAVE™ SDK環境中,信號連接有着和電子上的意義不同的意義。對於“信號”這個概念,我們認爲它是邏輯上的連接而不是像電平觸發,邊沿觸發中斷這樣的物理信號。它們不是電氣上的連接而是邏輯鏈接。
![](http://img-storage.qiniudn.com/15-8-27/64207880.jpg)        設想有三個信號{S1,S2,S3},S1,S2連在S3上,S1,S2可以影響到S3,但不可逆向。我們可以在幫助手冊裏發現這種信號之間的連接。例如下面的與門,或門。
你也可以發現被字段位影響的信號連接,如下圖。
![](http://img-storage.qiniudn.com/15-8-27/50888169.jpg)        微處理器的不同構成要素用信號連接多路器和寄存器。 爲了減少系統複雜度,使開發者高效工作。通過manifest來實現虛擬的信號連接時必要的。 這些信號稱之爲 “虛擬信號”因爲我們不可能知道它們準確的通道直到solver給它們分配特定的硬件單元和資源組。
       下圖可以讓你觀察到CCU4和NVIC的硬件抽象原理圖。在CCU4中有兩個工作組(CC4 Slices)。每一個工作組包含三個信號(A,B,C),它們通過一個多路器和多路輸出選擇器和中斷節點連接。爲了選擇多路器和多路輸出選擇器的信號,有專門的寄存器。
![](http://img-storage.qiniudn.com/15-8-27/33224579.jpg)        設想我們想要 連接CCU4上的信號A(其實我們不必關心哪一個)到中斷節點D。 以前的做法是我們必須要在相應的寄存器上寫入合適的數值去控制多路器。當只有一個硬件單元的年代幾乎這不是什麼問題,但如今的微處理器有着大量的外設和控制寄存器,因此對於一個開發者來說很難去關心所有的關於硬件模塊,信號,寄存器等等的複雜連接可能性和同時考慮系統相容性。
       因爲上面的理由,我們開發了solver。與直接設定對應的資源組(eg.CCU4 slice0)不同,我們只需要選擇聲明“信號A”連接“信號D”就可以了,solver可以自動選擇可被佔用的資源。然後我們可以獲取solver分配到的選擇器的特定寄存器(SRS),把它用在template文件裏用於生成代碼來合理配置微處理器。
在這個例子中solver選擇了CCU slice0,但在另一種配置中它可能選擇slice1 ,誰知道呢! 我們限制硬件因爲我們用了虛擬信號的概念。
![](http://img-storage.qiniudn.com/15-8-27/72164760.jpg)        爲了向solver傳遞我們的需求,我們必須在manifest對資源,信號以及限制條件進行聲明。 在例子中我們需要兩個資源CC4和聲明,申明兩個虛擬信號A,D。我們可以給它們加連接的約束,亦可以讓它們聲明但不連接。因此用戶可以在它們之間建立另一種連接(另選一個目標硬件,例如VADC)
       爲了申請資源你可以建立一個MVirtualResourceGroup對象,一個MVirtualSignal 來建立虛擬信號連接(‘M’來自於manifest類)。我們可以用方法addConnectionConstraint() 控制連接約束。

// Manifest code
// Begin : User APP property section
MVirtualResourceGroup cc4_slice      // CC4 slice of CCU4
MVirtualResourceGroup interrupt_node // Interrupt node of NVIC

MVirtualSignal        A      // Example of source signal (e.g. pmus_omds)
MVirtualSignal        D      // Example of destination signal (e.g. signal_in)
// End : User APP property section

// APP Constructor
public TEST(DaveEnv daveEnv) {
  cc4_slice      = MVirtualResourceGroup("CC4 Slice", ["peripheral","ccu4","*","cc4","*"])
  interrupt_node = MVirtualResourceGroup("INTERRUPT Node", ["peripheral","cpu","*","nvic","interrupt","*"])

  A = MVirtualSignal(cc4_slice, "PMUS Service Request", "pmus_omds")
  D = MVirtualSignal(interrupt_node, "Service Request Input", "signal_in")

  addConnectionConstraint(A, D)
}

       在這個簡單的聲明後,你可以在template文件裏獲取solver分配的值,再下面的例子中你能看到訪問分配值得一種方法,生成的程序是不能編譯的。

// Template code
for(def app : appInstancesList)
{
out.print("""
  CCU4 hardware module == ${app.cc4_slice.getSolverUri()[-3]}  // In Groovy you can index with a negative number in order to access from the end
  CC4 slice == ${app.cc4_slice.getSolverUri()[-1]}
  Register bitfield SRS.POSR == 0x${app.cc4_slice.getRegValue("srs", "srs_posr")}
  SRS.POSR bitfield mask == 0x${Integer.toHexString(((Integer)app.cc4_slice.getRegOwnershipMask("srs_posr")))}

  NVIC interrupt node == ${app.interrupt_node.getSolverUri()[-1]}
""")
}

**在DAVE™ 4中加載運行這個APP,可以生成:
** CCU4 hardware module == 0
CC4 slice == 0
Register bitfield SRS.POSR == 0x2
SRS.POSR bitfield mask == 0x3
NVIC interrupt node == 46
![](http://img-storage.qiniudn.com/15-8-27/84555190.jpg) 你可以在DAVE™ SDK Device Explorer發現這些硬件,資源組,寄存器,字段位。你也可以發現solver自動設置的寄存器是紅的。

返回頂部




##Deveice Explorer ## 8/25/2015 2:53 PM        DAVE™ SDK Device Explorer是一個可以讓你在開發APP過程中快速查找設備信息的有用工具。 它是一個單片機Datasheet的補充,你可以用它查找單片機的外設,管腳,包,來根據它來給出Manifest中resource group,信號,寄存器位字段的設置。
       你可以通過Window → Open Perspective → Other → Device Explorer 找到Device Explorer的視圖 . 打開視圖後你要選擇一種器件型號,接下來你會看到下面出現關於外設的這一欄目:
![](http://img-storage.qiniudn.com/15-8-24/1953202.jpg)        之後你可以查找任何一個在這些類別中的resource group 。舉例來說,如果我們需要尋找一片CC4 在CCU4的Resource group中,爲了知道它的位字段和提供的信號,我們可以如下面方式進行:
![](http://img-storage.qiniudn.com/15-8-25/14014756.jpg)        在這個例子裏,我們只需要按下“CCU40”界面就會自動刷新,接下去我們單擊“cc4/0”就會看到對應的片的位子段和信號。就如你所看到的,我們可以展開“cc4/0”它的resource group的URI 會在列表中出現。我們就可以把它複製下來用在manifest裏。你也許知道,在單片機裏有很多重複的硬件資源,我們使用APP的真正目的是不用去關心特定的硬件資源就可以充分利用它們aa。爲了達到這一目的,我們用“*”或是solver的變量來替代固定的數字。用solver變量的好處是我們可以給它加條件約束在solver分配後可以訪問它的值。

// Begin : User APP property section
MVirtualResourceGroup rg_example_resource_group
SolverVariable sv_group
// End : User APP property section
// App Constructor
public APP_NAME(DaveEnv daveEnv)
{
sv_group = SolverVariable()
addUriElementRangeConstraint(sv_group, [0,1]) // Only allows groups 0 and 1
rg_example_resource_group = MVirtualResourceGroup("Display name", ["ccu4", sv_group, "cc4", "*"])
}

       在manifest中定義期望的resource group之後,你可以看到你定義的虛擬信號和訪問位字段。
虛擬信號可以根據實際情況被其他信號所連接。連接的可能性能在Connect To 和Connect From 表中看到:

       你也可以通過manifest 和templates文件來訪問寄存器和寄存器的位字段。黑色字體的位字段可以被APP開發者所更改,但紅色標註的寄存器只能根據APP用戶的配置被solver自動分配。(e.g. 一個寄存器可以控制多路選擇器來控制兩信號的連接)。你可以在”Registers/Bit-Fields”看到寄存器包含的位字段:

想從寄存器返回值可以用:


MVirtualResourceGroup.getRegValue() 
MVirtualResourceGroup.getRegOwnershipMask()
addRegisterBitFieldConstraint()

正確訪問寄存器CCR中的HPCEN的方法是:


// Manifest code
// Begin : User APP property section
MVirtualResourceGroup usic_channel
// End : User APP property section
// APP Constructor
public TEST(DaveEnv daveEnv)
{
usic_channel = MVirtualResourceGroup("USIC Channel",["peripheral","usic","*","channel","*"])
}
// Template code
for(def app : appInstancesList)
{
def HPCEN = app.usic_channel.getRegValue("ccr", "ccr_hpcen")
}


返回頂部











Signal Design

       信號設計器讓開發者設計APP的單片機信號輸出,最終它將會顯示在用戶終端上:DAVE™ 4中的“HW Signal Connectivity”視圖中。這個文件在 -> Uimodel -> .sd.

       在下面的例子中,我們使用GLOBAL_CCU8 APP 的APP作爲例子,它有三個聲明的有效的信號,在signal designer中我們可以設計這三個信號在DAVE™ 4 用戶端的位置。我們可以最後通過聲明MVirtualSignal參數來使得它在用戶端不可見。其他的信號會在連接上後顯示,它們會顯示成灰色。

       在上面顯示的信號是在manifest中的MVirtualSignal 變量名中聲明的。它會顯示是因爲當MVirtualSignal改變,上圖會自動的改變。

       根據設定信號的可視屬性,一些信號在DAVE™ 4中不可見,所以如果可視屬性被特定的設置,它可能在用戶端不可見。


       在DAVE™ 4中型號顯示名是由在manifset 中的MVirtualSignal裏“displayname”參數控制的。

返回頂部











Advanced Widegets

       在這個教程中我們將會建立一個叫做GINDEXAPP的簡單工程來展示怎麼用GIndexGroup和GIndexCombo。我們假設你已經瞭解前文中APP開發的過程。
       GindexGroup可以讓你給窗體部件歸類,GIndexCombo就像一個指針讓你可以在不同的GindexGroup中切換來減少窗體的佔用面積和在生成APP GUI時佔用更少的資源來使APP的運行效果更佳。
       在下面的圖中你可以比較普通的佈置方案和用GindexGroup的不同。如果在這個例子裏你只有5個相似的部件,或許你想同時顯示它們,設想你如果有6個部件你就沒有其餘的空間來放置它,你只能把它們放在不同的Tab上,這不是一個好的解決方案。


       儘管使用GIndexGroup和GIndexCombo 是進階的教程,但它們不難。本質上,GIndexCombo就是GIndexGroup的選擇器。
       當你創建一個GIndexGroup,你需要拖一個GIndexCombo且只有一個在窗體裏,之後你可以拖任何你想要的窗體部件進去。然後你就能馬上得到GIndexCombo的最多能產生的數目。保存後,你將在manifest文件中看到一個.wg文件。


這個新的文件包含了你剛剛加入的窗體部件:


import ifx.davex.app.manifest.*;

class Gindexgroup_example {
  public GCombo gcombo_example;
  public GInteger ginteger_example;
  public GCheck gcheck_example;

  public Gindexgroup_example (DaveEnv daveEnv, String widgetName, int index){
    gcombo_example = new GCombo(widgetName:"gcombo_example", options:["Option 1","Option 2"], value:"Option 1", enabled:true, visible:true, isMandatoryValue:false , parentWidgetName:widgetName)
    ginteger_example = new GInteger(widgetName:"ginteger_example", value:1024, minValue:0, maxValue:4096, enabled:true, visible:true, isMandatoryValue:false , parentWidgetName:widgetName)
    gcheck_example = new GCheck(widgetName:"gcheck_example", value:false, enabled:true, visible:true, parentWidgetName:widgetName)
  }
}

在此同時,一些新的代碼在GINDEXAPP_GUI.manifest文件中生成:


abstract class GINDEXAPP_GUI extends AppManifest {
  // Begin : UI variable section
  public GInteger ginteger_number_of_items;
  public GIndexCombo gindexcombo_item;
  public GIndexGroup gindexgroup_example;
  public RArray rArraygindexgroup_example = RArray(16);


  public GINDEXAPP_GUI(DaveEnv daveEnv){

    ginteger_number_of_items = GInteger(widgetName:"ginteger_number_of_items", value:5, minValue:1, maxValue:16, enabled:true, visible:true, isMandatoryValue:false)
    gindexcombo_item = GIndexCombo(widgetName:"gindexcombo_item", options:["ITEM_0","ITEM_1","ITEM_2","ITEM_3","ITEM_4","ITEM_5","ITEM_6","ITEM_7","ITEM_8","ITEM_9","ITEM_10","ITEM_11","ITEM_12","ITEM_13","ITEM_14","ITEM_15"], value:"ITEM_0")
    gindexgroup_example = GIndexGroup(widgetName:"gindexgroup_example", text:"GIndexGroup", enabled:true, visible:true, gIndexCombo:gindexcombo_item, rArray:rArraygindexgroup_example)
    for(int i=0; i
#ifndef _GINDEXAPP_H_ #define _GINDEXAPP_H_ #ifdef __cplusplus extern "C" { #endif /*********************************************************************************************************************** ** System Header file inclusion ** ***********************************************************************************************************************/ #include #include "GINDEXAPP_extern.h" /* Included to access the APP Handles at Main.c */ #ifdef __cplusplus } #endif #endif /* GINDEXAPP_H_ */ gindexapp_extern_h.tmpl file: out.print(""" #ifndef GINDEXAPP_EXTERN_H_ #define GINDEXAPP_EXTERN_H_ #ifdef __cplusplus extern "C" { #endif /* Extern declaration of GINDEXAPP APP handlers */ """) for(def app : appInstancesList){ for (int i = 0; i #ifdef __cplusplus } #endif #endif /* GINDEXAPP_EXTERN_H_ */""") gindexapp_conf_c.tmpl file: out.println("#include \"gindexapp.h\"") for (GINDEXAPP app : appInstancesList) { for (int i = 0; i #ifndef GINDEXAPP_EXTERN_H_ #define GINDEXAPP_EXTERN_H_ #ifdef __cplusplus extern "C" { #endif /* Extern declaration of GINDEXAPP APP handlers */ extern GINDEXAPP_t GINDEXAPP_0_ITEM_0; extern GINDEXAPP_t GINDEXAPP_0_ITEM_1; extern GINDEXAPP_t GINDEXAPP_1_ITEM_0; #ifdef __cplusplus } #endif #endif /* GINDEXAPP_EXTERN_H_ */ gindexapp_conf.c file: #include "gindexapp.h" GINDEXAPP_t GINDEXAPP_0_ITEM_0 = { .gcombo = "Option 1", .ginteger = 3210, .gcheck = true }; GINDEXAPP_t GINDEXAPP_0_ITEM_1 = { .gcombo = "Option 1", .ginteger = 1024, .gcheck = false }; GINDEXAPP_t GINDEXAPP_1_ITEM_0 = { .gcombo = "Option 2", .ginteger = 83, .gcheck = false };


返回頂部











Error Report


返回頂部

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章