Micro Framework 3.0模拟器改造
2009-01-17 23:28
357 查看
Micro Framework 3.0的SDK去年十月份就已经发布了,本打算在该SDK发布之后就把我以前开发的,可支持GPIO、I2C、SPI测试的模拟器同步升级为3.0版,以便早点支持VS2008(Micro Framework v2.x仅支持VS2005,Micro Framework v3.0仅支持VS2008)。不过前段时间太忙了,现在趁着年假,花了一两天的工夫,终于达成了心愿。
新的模拟器相对于以前的模拟器有了两部分改变,下面详细说一下:
一、由于Micro Framework v3.0 SDK已经含有触摸屏组件,所以新模拟器中去掉了以前的SPI通道的鼠标模块,添加了最新的触摸屏支持。
二、3.0 SDK已经支持文件系统,所以新模拟器添加了这部分功能支持,不过新功能有些讨巧,不像虚拟机能支持真正的磁盘镜像文件,而是引用了windows自身文件操作API,把windows的文件操作封装到模拟器中。
模拟器V3.0
新模拟器改进了注册机制,下载后解压到任一目录,直接运行YFMFEmulator.exe文件即可完成注册。
至于模拟器如何使用,请参见我以前写的文章:
1、[MSDN Webcast]Windows Embedded从入门到精通系列课程(18):用模拟器零成本体验MF开发
2、.Net Micro Framework研究—模拟器改造
3、用模拟器零成本体验MF开发
模拟器V3.0下载链接:http://www.sky-walker.com.cn/yefan/YFMFEmulator.rar
关于Micro Framework 3.0 SDK的几点问题
1、下载链接:http://www.microsoft.com/downloads/details.aspx?FamilyId=9356ED6F-F1F0-43EF-B21A-4644DD089B4A&displaylang=en
2、几个bug
其实这几个bug在安装SDK3.0后的Micro Framework SDK Release Notes.txt中已经有了说明。
主要有如下两个问题:
(1) 非英文版VS2008安装SDK3.0后,在新建项目中无micro Framework选项
解决办法:
If you are running a non-English version of Visual Studio, you will need to
move the Micro Framework project and item template files to a new location.
Assuming the default installation directory, you would need to copy all files
from
\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates\
CSharp\Micro Framework\1033 to
\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates\
CSharp\Micro Framework
and all MicroFramework* files from
\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\
1033 to
\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\
注意:进行以上操作以后,一定要运行如下指令:X:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe /setup
(2) V2.x的应用程序升级为V3.0时失败
解决办法:
If you have existing projects written for previous versions of the Micro
Framework, follow these steps to update them to version 3.
1) Open the .csproj file for each of your projects and update the value of the
TargetFrameworkVersion from
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion> to
<TargetFrameworkVersion>v3.0</TargetFrameworkVersion>
2) Open the project (or solution) in Visual Studio 2008 and complete the
Conversion Wizard.
3) Review the "New behavior" section below and update code as needed.
新的模拟器相对于以前的模拟器有了两部分改变,下面详细说一下:
一、由于Micro Framework v3.0 SDK已经含有触摸屏组件,所以新模拟器中去掉了以前的SPI通道的鼠标模块,添加了最新的触摸屏支持。
this.lcdDisplay.TouchPort = (TouchGpioPort)_emulator.GpioPorts[TouchGpioPort.DefaultTouchPin]; protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); flags = TouchSampleValidFlag | TouchSampleDownFlag; _touchPort.WriteTouchData(flags, e.X, e.Y); } protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); flags = TouchSampleValidFlag | TouchSamplePreviousDownFlag; _touchPort.WriteTouchData(flags, e.X, e.Y); } protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); if ((flags & (TouchSampleValidFlag | TouchSampleDownFlag)) == (TouchSampleValidFlag | TouchSampleDownFlag)) { flags = TouchSampleValidFlag | TouchSamplePreviousDownFlag | TouchSampleDownFlag; if ((e.X >= 0) && (e.Y >= 0)) { _touchPort.WriteTouchData(flags, e.X, e.Y); } } }
二、3.0 SDK已经支持文件系统,所以新模拟器添加了这部分功能支持,不过新功能有些讨巧,不像虚拟机能支持真正的磁盘镜像文件,而是引用了windows自身文件操作API,把windows的文件操作封装到模拟器中。
List<EmulatorRemovableBlockStorageDevice> bsdList = new List<EmulatorRemovableBlockStorageDevice>(); removableBSDs = new Dictionary<string, EmulatorRemovableBlockStorageDevice>(); foreach (BlockStorageDevice bsd in _emulator.BlockStorageDevices) { if (bsd is EmulatorRemovableBlockStorageDevice) { bsdList.Add((EmulatorRemovableBlockStorageDevice)bsd); } } if (bsdList.Count > 0) { insertEjectMenuItem.Visible = true; foreach (EmulatorRemovableBlockStorageDevice removableBSD in bsdList) { ToolStripItem item = new ToolStripMenuItem(GetItemText(removableBSD), null, InsertEjectOnClick); item.Name = removableBSD.Namespace; insertEjectMenuItem.DropDownItems.Add(item); removableBSDs.Add(removableBSD.Namespace, removableBSD); } }
模拟器V3.0
新模拟器改进了注册机制,下载后解压到任一目录,直接运行YFMFEmulator.exe文件即可完成注册。
至于模拟器如何使用,请参见我以前写的文章:
1、[MSDN Webcast]Windows Embedded从入门到精通系列课程(18):用模拟器零成本体验MF开发
2、.Net Micro Framework研究—模拟器改造
3、用模拟器零成本体验MF开发
模拟器V3.0下载链接:http://www.sky-walker.com.cn/yefan/YFMFEmulator.rar
关于Micro Framework 3.0 SDK的几点问题
1、下载链接:http://www.microsoft.com/downloads/details.aspx?FamilyId=9356ED6F-F1F0-43EF-B21A-4644DD089B4A&displaylang=en
2、几个bug
其实这几个bug在安装SDK3.0后的Micro Framework SDK Release Notes.txt中已经有了说明。
主要有如下两个问题:
(1) 非英文版VS2008安装SDK3.0后,在新建项目中无micro Framework选项
解决办法:
If you are running a non-English version of Visual Studio, you will need to
move the Micro Framework project and item template files to a new location.
Assuming the default installation directory, you would need to copy all files
from
\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates\
CSharp\Micro Framework\1033 to
\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates\
CSharp\Micro Framework
and all MicroFramework* files from
\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\
1033 to
\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\
注意:进行以上操作以后,一定要运行如下指令:X:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe /setup
(2) V2.x的应用程序升级为V3.0时失败
解决办法:
If you have existing projects written for previous versions of the Micro
Framework, follow these steps to update them to version 3.
1) Open the .csproj file for each of your projects and update the value of the
TargetFrameworkVersion from
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion> to
<TargetFrameworkVersion>v3.0</TargetFrameworkVersion>
2) Open the project (or solution) in Visual Studio 2008 and complete the
Conversion Wizard.
3) Review the "New behavior" section below and update code as needed.
相关文章推荐
- 针对Micro Framework 3.0模拟器进行改造方法(浅谈)
- Micro Framework 3.0模拟器改造
- .Net Micro Framework研究—模拟器改造
- Mozilla发布Firefox OS模拟器3.0
- UIQ3.0模拟器上网和显示中文
- 华为路由、交换机(二层)模拟器3.0(破解版)
- 【开源发布】中国移动通信CMPP3.0 SP端模拟器 C++实现
- vue3.0 CLI - 2.2 - 组件 home.vue 的初步改造
- .Net Micro Framework研究—模拟器改造
- android 3.0中加快启动模拟器
- Net Micro Framework研究 模拟器改造
- 一步一步制作自己的Micro Framework模拟器 序
- uiq3.0sdk最终版模拟器显示中文
- OpenGL ES 3.0 支持的设备和模拟器
- 如何正确启动AndroidStudio3.0的模拟器AVD
- .NET三层经典架构PetShop3.0说明连载一(转)
- 第五章 Spring3.0 、Hibernate3.3与Struts2的整合
- 一个爆android自带模拟器10条街的神器——Genymotion的配置
- C#与.NET 3.0高级程序设计(特别版)问题与错误列表