打造自己的Carbide C++工程向导和模板

首先感谢dyw的博客: Carbide.c++下自制向导生成CView派生类及相关Container ,本文是在他的研究基础上完成的。不知道是不是因为版本的问题(我用的是Carbide C++ v1.3 OEM,在修改模板过程中与dyw提供的方法有点出入)。

一、多视图的工程向导
原来在2nd版本时候,carbide是提供一个多视图的程序框架向导的,但是在3rd以后就取消了。正如我在学习笔记中所说,其实我还是挺喜欢这种多视图的应用程序框架。

carbide的向导位于" /Apps/Nokia/Carbide.c++ v1.3/plugins/com.nokia.cdt.templates_1.3.0.023"。打开这个目录大伙都能明白个大概了。

第一步:我们需要建立工程的源文件,并放在这个目录下:/Apps/Nokia/Carbide.c++ v1.3/plugins/com.nokia.cdt.templates_1.3.0.023/templates/com/nokia/cdt/templates/projecttemplates/S603rd-ViewApplication。其中S603rd_ViewApplication是我新建的。

源文件就是拿自己手工写的多视图应用框架,修改一下罢了。关键在于如何将向导收集到工程名、UID等信息放入源代码中,其实也很简单,随便打开一个原来的向导看看它们是怎么写的,就明白了。

无非就是$(baseName)表示工程名称,$(uid3)表示UID,如果$(baseName$upper)表示工程名称全大写,如果是$(uid3-WITHOUT_0X)表示UID不要前导的0x…………

很容易吧,剩下的事情就是用这些标记去修改自己的源文件了。

第二步:修改源目录下的template.xml文件,因为我整个S603rd_ViewApplication都是在原来的S60-PlatsecApp工程模板的基础上修改的,因为它会有个"hello world"的对话框,这个是我们不需要的,所以我稍改动了一点地方。主要是在<wizardPage>中去掉了几个<textfield>(不再收集email,message了)。并且,在拷贝文件的时候,也要多拷几个文件(就是保证将源目录下的那些东西都拷到工程目标里去)。

第三步:修改那个plugin.xml文件(这是关键,dyw没有提到这个,可能是1.2版本不需要这个做吧)。
       < template
            
filterArguments ="S60:3.0-5.0"
            groupLabel
="%S60.3.label"
            image
="icons/icon_S60.png"
            location
="templates/com/nokia/cdt/templates/projecttemplates/S603rd-ViewApplication/template.xml"
            templateId
="com.nokia.cdt.templates.s60.viewApp"
            wizardId
="com.nokia.carbide.cpp.project.ui.wizards.NewSymbianOSCppProjectWizard" />     

加一个模板,过滤参数声明它是S60 3rd的,location定位到源目录下的template.xml文件。templateId只要是唯一即可,wizardId说明跟其它的工程向导没啥差别,就用现成的即可。

这样就OK了。

二、视图/容器类模板
利用上面的工程向导得到的应用程序框架中包括一个基本的视图和容器,如果在开发过程中需要增加新的视图/容器对,则可以在“Symbian C++ Class”向导中创建一对View/Container类。

同样,第一步是写源文件,放在/Apps/Nokia/Carbide.c++ v1.3/plugins/com.nokia.cdt.templates_1.3.0.023/templates/com/nokia/cdt/templates/classtemplates目录下。

这里不能用$(baseName)了,但是可以用$(classname)以及$(projectName)。也不能用$(uid3)。

这个目录下也有properties和template.xml文件,其中template.xml文件引用了一个shared/aknviewSymbian.inc文件。

第二步做这个shared/aknviewSymbian.inc文件,也是拿个现成的classSymbian.inc来修改,主要是改一下拷贝的文件。

第三步也在plugin.xml中增加对它的引用:
       < template
            
groupLabel ="%SymbianOS.label"
            image
="icons/icon_symbian.gif"
            location
="templates/com/nokia/cdt/templates/classtemplates/CAknView/template.xml"
            templateId
="com.nokia.cdt.templates.symbian.caknview"
            wizardId
="com.nokia.carbide.cpp.project.ui.wizards.NewSymbianOSCppClassWizard" />

就OK了。

在使用类模板生成一对View/Container时,要注意手工修改三个地方:
1)在view的cpp中,需要引入rsg文件和hrh文件,可以直接从AppView.cpp前面拷过来即可。
2)在hrh中,需要增加这个视图的枚举值。
3)在rss中,需要增加这个视图的资源。

我把这两个模板打包放在资源里,大家可以去下载,直接使用:
http://download.csdn.net/source/396068


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
WIDE bandgap devices, such as silicon carbide (SiC) metal–oxide–semiconductor field-effect transis- tors (MOSFETs) present superior performance compared to their silicon counterparts [1]. Their lower ON-state resistance and faster switching capability attract lots of interest in high-power- density applications [2]. Faster switching speed enables lower switching loss and higher switching frequency, which is benefi- cial to high-efficiency and high power density. However, severe electromagnetic interference (EMI) and transient overvoltage issues caused by fast switching speed jeopardize the power quality and reliability of converters [3], [4]. Therefore, there is a tradeoff between efficiency and reliability in the choice of switching speed. An optimized design should ensure theoperation within both safe-operation-area and EMI limits, and switching loss should be as small as possible. A prediction method of switching performance is important and helpful for designer to evaluate and optimize converter design. The most concerned switching characteristics are switching loss, dv/dt, di/dt, and turn-ON/OFF overvoltage generally. These characteristics are crucial for the design of heatsink, filter, and gate driver. Related discussions have been presented in many existing research articles as following.请将这一段进行以下要求,Move analysis 语步(内容成分)分析; Language devices和实现该功能的语言手段(某些关键专有名词提供汉语翻译)
最新发布
06-13

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值