启动- SCL Simulator for IEC61850
来源:互联网 发布:淘宝外卖会员卡好用吗 编辑:程序博客网 时间:2024/05/18 03:19
- v0.0.1
a 支持 Ironpython 脚本,嵌入
b .net界面
2013.05.23 - start to wrap iec 61850 stack using ctypes, just for quick start.
- Use Ctypes , if you want to wrap pure C code very easily.- Use Boost.Python , if you want to create a more complete API for C++ that also reects the object oriented nature of your native code, including inheritance into Python, etc.
- Use cython, if you want to easily speed up and migrate code from Python to speedier native code (Mixing is possible!).- Use SWIG, if you want to wrap your code against several dynamic languages
---------
ironpython +.net + c/c++.dll will be very cool for your unit test, automatic test, functional acceptance test..
======== notes: in .net with ironpython to excute python script which inject your dll c function
1. C# need add reference : /r:IronPython.dll /r:Microsoft.Scripting.dll
2. test1 :
def welcome(name):
return "Hello '" + name + "' from IronPython"
static void Main(string[] args)
{
ScriptScope helloworld = Python.CreateRuntime().UseFile("D:\\Project\\script\\hello.py");
var welcome = helloworld.GetVariable("welcome");
Console.WriteLine(welcome("abc"));
Console.ReadLine();
}
3: errors “name 'ctypes' is not defined” -> to solve
change "from ctypes import *" to " import ctypes " in python script
--dll.c to compile dll.dll
1.=====
#include <math.h>
#ifdef __cplusplus
extern "C" {
#endif
__declspec(dllexport) double testsin(double x)
{
return sin(x);
}
#ifdef __cplusplus
}
#endif
2.==python script file : dll.py
import ctypes
dll = ctypes.CDLL('D:\\Project\\TestSuit\\Debug\\testdll.dll')
dll.testsin.argtypes = [ctypes.c_double]
dll.testsin.restype = ctypes.c_double
print(dll.testsin(34))
MessageBox = ctypes.windll.user32.MessageBoxW
MessageBox(None, u"Hello World", u"Hi", 0)
3.==.net main function
static void Main(string[] args)
{
var engine = Python.CreateEngine();
string dir = "D:\\Project\\script\\";
List<string> searchPaths = new List<string>(engine.GetSearchPaths());
if (!String.IsNullOrEmpty(dir))
{
searchPaths.Add("D:\\Project\\script\\");
}
else
{
searchPaths.Add(Environment.CurrentDirectory);
}
searchPaths.Add(Environment.CurrentDirectory);
searchPaths.Add("C:\\Program Files\\IronPython 2.7");
searchPaths.Add("C:\\Program Files\\IronPython 2.7\\Lib");
engine.SetSearchPaths(searchPaths);
var script = engine.CreateScriptSourceFromFile("D:\\Project\\script\\dll.py");
CompiledCode code = script.Compile();
ScriptScope scope = engine.CreateScope();
code.Execute(scope);
}
- 启动- SCL Simulator for IEC61850
- Trace32 Simulator for ARM
- compile error for iphone simulator
- Trace32 Simulator for ARM工具。
- Trace32 Simulator for ARM工具
- week2th、 Generate SW package for Simulator and create simulator
- simulator
- NSN HLR simulator for provisioning in expect
- Trace32 Simulator for ARM (Qualcomm dump analysis)
- libjing 编译 for iphone simulator (..完善中..)
- libjing 编译 for iphone simulator (..完善中..)
- Network Simulator 2 for Wireless : My Experience
- iOS simulator Cannot find executable for CFBundle
- xcknkc scl
- iec61850 资料
- IEC61850数据模型
- IEC61850 总结
- xcode 6 如何将 模拟器(simulator) for iphone/ipad 转变成 simulator for iphone
- java.io.File中的pathSeparator与separator的区别
- android JB surfaceflinger重点
- c# 多线程 调用带参数函数
- Unix网络编程—基本TCP套接字编程
- 学习ios and android 的地方
- 启动- SCL Simulator for IEC61850
- CentOS TCP 性能优化
- [iOS] ios的runtime
- 开源软件keepalived实现分布式数据分发
- 在vs2010里自建cocos2dx工程,不依赖cocos2dx包
- linux下实现自动后台运行,脱离输出到终端
- 新项目1大幕开启
- VC/MFC之ListCtrl控件使用经验总结
- ZOJ 1880 Tug of War