RTXC插件开发指南Stepbystep
- 格式:doc
- 大小:2.29 MB
- 文档页数:11
构建⾃⼰的CC++插件开发框架(四)——核⼼层设计和实现上⾯⼀篇⽂章⼤致描述了⼀下插件开发框架整体结构。
这篇描述⼀下核⼼层的设计和实现。
⾄于核⼼层的设计,我想借鉴⼀下微内核的思想。
核⼼层只负责实现下⾯⼏个功能:1、插件的加载,检测,初始化。
2、服务的注册。
3、服务的调⽤。
4、服务的管理。
插件的加载,检测,初始化插件的加载利⽤linux共享库的动态加载技术。
具体的⽅法可以看⼀下IBM⽹站的⼀篇资料。
服务的注册服务的注册与调⽤采⽤表驱动的⽅法。
核⼼层中维护⼀个服务注册表。
//插件间交互消息类型typedef enum __Service_Type{Service_Max,}Service_Type;//插件⽤于和其他插件通信接⼝函数,由插件提供。
typedef PRsp_Ele_Stream (*PF_Invoke_Service_Func)(PReq_Ele_Stream pele_str);//驱动表typedef PF_Invoke_Service_Func Service_Drive_Table[Service_Max];驱动表是⼀个数组,下标为插件间交互消息类型,成员为插件提供的接收的消息处理函数,由插件初始化的时候,调⽤插件框架的的注册函数注册到驱动表。
插件的初始化实现为://插件⽤于注册处理的消息类型的函数,由插件框架提供。
typedef RET_RESULT (*PF_Service_Register_Func)(Service_Type service_type);//插件⽤于和其他插件通信接⼝函数,由插件框架提供。
typedef PRsp_Ele_Stream (*PF_Invoke_Service_Func)(PReq_Ele_Stream pele_str);//插件回复响应函数。
插件收到异步请求后,处理完成后,发送响应消息给请求的插件。
由插件框架提供typedef void (*PF_Send_Response_Func)(PRsp_Ele_Stream pele_str);//初始化插件信息typedef struct Plugin_Init_St{PF_Service_Register_Func register_func;//服务注册函数,要注册⼀系列的枚举值。
c++ asio 网络编程的基本流程下载温馨提示:该文档是我店铺精心编制而成,希望大家下载以后,能够帮助大家解决实际的问题。
文档下载后可定制随意修改,请根据实际需要进行相应的调整和使用,谢谢!并且,本店铺为大家提供各种各样类型的实用资料,如教育随笔、日记赏析、句子摘抄、古诗大全、经典美文、话题作文、工作总结、词语解析、文案摘录、其他资料等等,如想了解不同资料格式和写法,敬请关注!Download tips: This document is carefully compiled by theeditor.I hope that after you download them,they can help yousolve practical problems. The document can be customized andmodified after downloading,please adjust and use it according toactual needs, thank you!In addition, our shop provides you with various types ofpractical materials,such as educational essays, diaryappreciation,sentence excerpts,ancient poems,classic articles,topic composition,work summary,word parsing,copy excerpts,other materials and so on,want to know different data formats andwriting methods,please pay attention!C++ Asio 网络编程基础流程详解随着C++的发展,网络编程变得更加高效和易于管理,这得益于库如Boost.Asio的出现。
c++插件制作和使用实例要制作和使用C++插件,您可以按照以下步骤进行操作:1. 创建项目:在您的C++项目中,创建一个新的文件夹来存放插件的源码和相关文件。
您可以选择使用C++的一些常用工具,如CMake或Makefile来组织您的项目。
2. 实现插件功能:根据您的需求,编写插件的功能代码。
您可以根据自己的项目需求,选择合适的C++库或框架来实现插件功能。
例如,您可以使用Qt来创建GUI插件,或使用Boost来实现高效的算法。
3. 导出插件接口:在插件的源码中,定义一个公共接口,用于与主程序通信。
这个接口应该包含主程序需要调用的函数和变量,并使用适当的修饰符(如`EXPORT`)导出这些接口。
4. 编译插件:根据您选择的工具,使用相应的命令行或IDE 编译插件。
确保在编译过程中正确地链接所需的库和依赖项。
5. 在主程序中加载插件:在主程序中,使用适当的机制来加载插件。
具体的机制取决于您所使用的框架或库。
例如,如果您在使用Qt,您可以使用`QLibrary`类来加载插件。
6. 使用插件:一旦插件被加载,您可以通过插件提供的接口调用相应的函数或访问变量。
您可以根据您的需要,将这些函数和变量集成到您的主程序中,以实现更强大和灵活的功能。
以下是一个简单的C++插件制作和使用的示例:1. 创建项目:创建一个名为`MyPlugin`的文件夹,并在其中创建`plugin.h`和`plugin.cpp`文件。
2. 实现插件功能:在`plugin.h`中定义一个名为`MyPlugin`的类,具有一个公共的函数`void showMessage()`,并在`plugin.cpp`中实现该函数,在控制台输出一条消息。
3. 导出插件接口:在`plugin.h`的类定义中,使用`EXPORT`修饰符导出`MyPlugin`类和`showMessage`函数。
```cpp// plugin.h#ifdef _WIN32#define EXPORT __declspec(dllexport)#else#define EXPORT#endifclass EXPORT MyPlugin {public:void showMessage();};``````cpp// plugin.cpp#include <iostream>#include "plugin.h"void MyPlugin::showMessage() {std::cout << "Hello from MyPlugin!" << std::endl;}```4. 编译插件:使用命令行编译插件。
1. 导言今天我要跟你共享的主题是《qt6 c++开发指南全书实例》。
这是一个非常实用的主题,特别适合想要系统地学习和掌握qt6 c++开发的朋友们。
我将从简到繁,逐步深入地讨论这个主题,帮助你更好地理解和应用。
2. 什么是qt6 c++开发指南全书实例qt6 c++是一种跨评台的C++应用程序开发框架,它提供了丰富的类库和工具,可以帮助开发者轻松地创建各种类型的应用程序,包括桌面应用、移动应用、嵌入式应用等。
《qt6 c++开发指南全书实例》则是一本详尽的教程书籍,涵盖了qt6 c++开发的方方面面,从基础到高级,从原理到实践,以实例为主线,帮助读者系统地学习和掌握qt6 c++开发的技能和技巧。
3. qt6 c++开发指南全书实例的学习意义通过学习《qt6 c++开发指南全书实例》,我们可以系统地了解qt6 c++框架的核心概念和基本原理,掌握qt6 c++开发的基本技能和常用工具,熟悉qt6 c++的常用类库和模块,掌握qt6 c++开发的最佳实践和技巧。
通过实例学习,我们可以更加深入地理解和应用qt6 c++开发的知识,提高我们的开发水平和技术能力。
4. 如何学习qt6 c++开发指南全书实例要系统地学习《qt6 c++开发指南全书实例》,我们可以按照以下步骤进行:- 第一步,先从书中的基础部分开始,了解qt6 c++框架的核心概念和基本原理,掌握qt6 c++的基本语法和语义,熟悉qt6 c++的常用开发工具和环境。
- 第二步,结合书中的实例,逐步深入学习qt6 c++的常用类库和模块,掌握qt6 c++的常用技巧和最佳实践。
- 第三步,通过实际项目的练习和实践,巩固和应用所学的知识,提高自己的qt6 c++开发水平。
5. 个人观点和理解我个人认为,《qt6 c++开发指南全书实例》是一本非常优秀的教程书籍,它全面、系统地介绍了qt6 c++开发的方方面面,从基础到高级,从理论到实践,以实例为主线,帮助读者更好地理解和应用qt6 c++开发的知识。
主题:C++ 插件的创建和使用实例C++ 是一种被广泛应用的编程语言,它的强大和灵活性使得它成为许多软件开发人员的首选。
在实际的软件开发过程中,我们常常会遇到需要扩展已有软件功能的需求。
这时候,C++ 插件就成为了一个非常有用的工具。
本文将介绍如何创建和使用 C++ 插件,并通过一个实际的例子来展示其用法。
一、C++ 插件的创建1. 确定插件功能在创建 C++ 插件之前,我们首先需要明确插件的功能。
我们希望创建一个 C++ 插件来实现数据加密和解密的功能。
2. 创建插件项目在开始编写插件代码之前,我们需要创建一个新的 C++ 项目。
可以使用诸如 Visual Studio、Code::Blocks 等集成开发环境来创建新的C++ 项目。
3. 编写插件代码在创建了新的 C++ 项目之后,我们就可以开始编写插件的代码了。
在这个例子中,我们可以编写加密和解密函数的实现代码。
4. 将插件编译为动态信息库编写完插件代码之后,我们需要将代码编译为动态信息库(DLL)。
这可以通过编译器提供的工具来实现,比如在 Windows 评台下可以使用 Visual Studio 的编译器来生成 DLL 文件。
5. 导出插件接口为了让其他程序能够调用我们创建的插件,我们需要在代码中导出插件的接口。
这可以通过在函数前添加 `extern "C"__declspec(dllexport)` 来实现。
6. 完成插件创建经过以上步骤,我们就成功地创建了一个 C++ 插件。
这个插件可以用于在其他程序中实现数据加密和解密的功能。
二、C++ 插件的使用实例现在我们来介绍一个实际的例子,来展示如何在一个主程序中使用我们创建的 C++ 插件。
1. 创建主程序项目我们需要先创建一个新的 C++ 项目作为我们的主程序。
同样地,我们可以使用集成开发环境来创建新的项目。
2. 引入插件头文件在主程序中,我们需要引入我们创建的插件的头文件,以便在程序中调用插件的功能。
RTX消息管理插件用户手册2008年11月目录第一章RTX消息管理插件的安装1.1安装所需的软硬件环境●RTX消息管理插件硬件要求●RTX消息管理插件软件要求1.微软视窗系列操作系统Windows2000Server以上;2.Framework 2.0 安装包;3.RTXSERVER2007 SDK安装包;4.Microsofe office 安装包5.Microsofe Compact FrameWork 2.0 下载地址:http://.microsoft/downloads/details.aspxFamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=zh-c n注:RTX消息管理插件只支持RTX2007及以上版本1.2RTX消息管理插件的安装完成RTXSERVER2007及RTXSERVER2007 SDK安装后,就可以进行RTX消息管理插件的安装;运行安装程序;安装过程请遵循安装向导的提示,都可以采用默认设置;安装成功后,在开始菜单中出现已经安装的消息管理插件;第二章RTX消息管理插件的基本应用2.1 配置RTX消息管理插件说明:1.在RTX消息管理插件的初始界面填入服务器地址和服务器端口号,此地址为RTX的服务器地址,默认为127.0.0.12.点击开机自动启动,设置是否在开机时自动启动该插件;3.启动和停止按钮的使用,要想对RTX用户进行消息拦截,首先点击启动按钮,启动成功后服务状态栏会显示‘服务已启动’,点击停止按钮,此功能关闭;4.消息管理登陆的初始密码为123456,用户可以自行修改密码;修改密码点击修改密码按钮,进入修改密码界面,密码输入正确后进入消息管理界面;2.2 消息管理界面初始界面的显示说明:1.进入消息管理界面后,在上图中的红色圈位置的列表中显示管理到的用户发送消息记录TOP20的数量显示;管理员可以清晰的看到用户发送消息的数量;第一次安装由于没有记录所以此部分不显示任何内容;2.在左侧的组织架构列表中显示服务器的组织架构;3.在蓝色的圈中是时间的限制,默认是全部时间段的显示;4.在右下方显示的是管理到的消息总的数量;2.2.1 查看消息记录1.点击组织架构树状结构,红圈中的列表将显示点击部门下的用户信息以及次部门下用户发送短信的数量;点击用户列将在黄色圈的列表中显示点击用户的消息记录;2.在蓝色圈中是显示的时间段,管理员可以根据时间段更准确的查看用户发送的消息记录;下拉菜单中有三个选项全部,最近7天,一段时间,选择一段时间后,点击要查询的时间段可以自行查找;3.可以根据会话人的姓名和聊天内容查找;比如我想查找在2008年11月15日到2008年11月19日聊天记录中包含“工作难”的用户和消息记录;选择一段时间,在起始时间里选择2008年11月15日,结束时间选择2008年11月19日,在会话内容里输入“工作难”,点击查找,将会在下面红色圈的列表中显示对应的用户,点击这些用户在下面蓝色圈的列表中显示会话的内容;注消息内容中的换行符全部转换为‘■’2.2.2 消息记录备份为优化消息记录功能,系统默认当消息记录超过50000条,系统自动把消息备份到新的数据表中,数据表的名称为备份记录的最大时间到最小时间;备份的数据表将在管理界面的右下角显示;在下图中备份完后,管理员可以在下拉列表中看到备份的数据表名,选择备份的数据表名,可以查看备份消息中消息记录,不影响管理员的正常管理和查看;管理员也可以自行进行消息记录备份,点击右下方的消息记录数链接,或者点击左上方的备份按钮进行备份;上图在备份界面,可以选择时间段的进行备份,选择时间段的消息记录数量将显示出来;2.2.3 历史记录查看1. 消息记录每个月将备份出来,供管理员保管;一个月的消息记录全部会备份到新的数据库中,数据库文件在安装目录下,管理员可以自行保管;2. 查看历史消息记录,点击查看历史记录按钮,或者选择文件—〉查看历史记录在弹出的对话框中选择要查看的消息历史记录;如果管理员把历史记录放在其它文件夹中,只需把记录数据表拷贝到安装文件中即可;历史记录的查看同时支持2.2.1和2.2.2中的查找功能;2.2.4 TOP消息记录用户提醒功能此功能设置成功后,管理员每天可以收到昨天TOP消息记录用户的消息提醒,例如2008年10月20日RTX用户发消息数前10位程高峰1056 366孙亮1267 332李军1196 314王建1006 310毛志华1059 208袁志芳1342 79胡大哈1016 69李静1209 45赵菲3298 42张涛1236 34注:前面为姓名+RTX号码,后面为用户发送消息的条数;●点击文件—〉TOP消息用户记录提醒进入配置页面;●在管理员账号中填入要发送消息的管理员对象,此号码为管理员登陆账号;设置后系统会检查此账号是否寻在,如不存在将提示;●在用户数量中选择要提醒的TOP用户数量,可以选择10个,20 个,40个;点击保存按钮;●点击启动按钮,将启动此项功能;如停止此项功能,点击停止按钮;●每天发送的消息提醒的记录保存在安装目录下的TOP消息用户记录.log中;2.2.5 过滤关键字当用户发送的消息中含有敏感字段,系统将进行拦截,并提醒用户;比如把“垃圾”设为敏感字段,则用户发送:“今天的天气真垃圾”,系统将拦截消息.下图为配置页面●点击文件—〉关键字进入配置界面;●在内容中添加要设置的关键字;●点击已添加的关键字,点击删除按钮,即可删除此关键字2.2.4 消息记录的导出管理员可以导出消息记录,导出的格式为txt或者Excel●点击导出按钮,或者文件—>导出进行导出;●导出的内容为下图中红圈部分的列表中,故次导出功能支持查询和搜索条件;导出的Excel格式文档如下2.3注册RTX消息管理插件为正式版此系统使用期限为一个月,当点击启动按钮时,左下角会显示提示框;试用期结束后,系统会停止拦截消息功能;此版本的数据库为Access,如果用户数量大导致消息量过大会影响消息拦截效率,建议使用SQL\ORACLE\DB2,如需要请联系我们如继续使用,请把RTX服务器主机号发给我们,联系电话***********;我们会给用户发回注册码,注册—〉注册码校对填入正确的注册码便可以使用正式版;正式版的消息拦截效率得到了优化;。
qt6 c++开发指南学习笔记一、环境搭建。
1. 安装Qt6。
- 从Qt官方网站下载适合操作系统的Qt6安装包。
对于Windows系统,下载对应的.exe安装文件;对于Linux系统,可能需要根据不同的发行版选择合适的安装方式,如在Ubuntu上可以使用官方的软件仓库进行安装或者下载.run文件进行安装。
- 在安装过程中,注意选择要安装的组件,例如Qt Creator(集成开发环境)、Qt的各种模块(如Qt Widgets用于传统的桌面应用程序开发等)。
2. 配置开发环境。
- 在Qt Creator中,需要配置编译器。
对于C++开发,常见的编译器如GCC(在Linux系统中)或MSVC(在Windows系统中)。
确保编译器已经正确安装并且在Qt Creator中设置好路径。
- 可以创建一个简单的Hello World项目来测试开发环境是否搭建成功。
创建一个新的Qt Widgets Application项目,在`main.cpp`文件中编写以下代码:cpp.#include <QApplication>.#include <QLabel>.int main(int argc, char *argv[]){QApplication app(argc, argv);QLabel label("Hello World!");label.show();return app.exec();}- 编译并运行这个项目,如果能看到一个显示“Hello World!”的窗口弹出,说明环境搭建成功。
二、Qt基础概念。
1. 信号与槽机制。
- 信号(Signal)是对象发出的通知,表示某个事件发生了。
例如,当一个按钮被点击时,它会发出`clicked`信号。
信号的定义在类中使用`signals`关键字。
例如,在`QPushButton`类中定义了`clicked`信号:cpp.class QPushButton : public QAbstractButton.{Q_OBJECT.signals:void clicked(bool checked = false);// 其他信号定义。
c筑算插件命令C语言编程是一项复杂的任务,但是使用插件可以使编程过程更加高效和方便。
本文将介绍C筑算插件的一些常用命令,帮助C语言程序员更好地利用该插件。
C筑算插件是一款基于Sublime Text编辑器的插件,它可以帮助C 语言程序员快速地编写和调试程序。
下面是该插件的一些常用命令:1. C筑算:运行程序该命令可以直接运行程序,无需离开编辑器。
使用此命令可以更快地调试程序并进行实时测试。
2. C筑算:编译程序该命令可以将程序编译成可执行文件。
使用此命令可以方便地将程序移植到其他计算机上运行。
3. C筑算:查找变量该命令可以快速查找变量的定义和使用。
使用此命令可以避免在程序中出现未定义的变量或重复定义的变量。
4. C筑算:查找函数该命令可以快速查找函数的定义和使用。
使用此命令可以避免在程序中出现未定义的函数或重复定义的函数。
5. C筑算:查找头文件该命令可以快速查找头文件的位置。
使用此命令可以避免在程序中出现未找到头文件的错误。
6. C筑算:格式化代码该命令可以自动格式化代码,使代码风格统一。
使用此命令可以使代码更易读,减少出错的可能性。
7. C筑算:代码补全该命令可以自动补全代码。
使用此命令可以减少编码时间,降低编码难度。
8. C筑算:代码折叠该命令可以将代码折叠起来,使代码结构更清晰。
使用此命令可以更容易地理解代码,减少阅读难度。
9. C筑算:查找错误该命令可以快速查找程序中的错误。
使用此命令可以避免浪费时间在手动查找错误上。
10. C筑算:生成注释该命令可以自动生成注释。
使用此命令可以使代码更易读,并且可以帮助其他程序员更好地理解代码。
C筑算插件是一款非常实用的插件,可以帮助C语言程序员更高效地编写和调试程序。
掌握这些常用命令可以让程序员更好地利用该插件,提高编码效率。
C# 插件教程插件构架概述:假设你设计的程序已经部署到用户的计算机上,并且能够正常运行了。
但是有一天,用户打来了电话——他们要求增加新的功能。
确定了用户的需求后,你竟然发现原有的软件架构已经无法胜任新增任务的需求——你需要重新设计这个应用了!但问题是,就算你又用了一个开发周期完成了用户需要的应用,却不能保证用户的需求不会再次变更。
也就是说,需求蔓延的可能性依然存在。
因此,这种情况下C#实现插件构架更能显示出它的优越性。
设计插件:好了,现在我们准备把所有的核心代码都放在CSPluginKernel 命名空间中。
用VS2008建立一个C#类库工程。
在命名空间CSPluginKernel 中开始我们的代码。
1.接口设计我们的程序编辑器会向插件开放正在编辑的文档对象。
程序启动后,就枚举每一个插件并把它连接到主程序,同时传递主程序对象的接口。
插件可以通过这个接口来请求主程序对象或访问主程序功能。
根据上面的需求,我们首先需要一个主程序接口:public interface IApplicationObject{// 产生一条信息void Alert( string msg );// 将指定的信息显示在状态栏void ShowInStatusBar( string msg );// 获取当前使用的文档对象IDocumentObject QueryCurrentDocument();// 获取所有的文档对象IDocumentObject[] QueryDocuments();// 设置事件处理器void SetDelegate( Delegates whichOne , EventHandler targer ); }// 目前只需要这一个事件public enum Delegates{Delegate_ActiveDocumentChanged ,}然后是IDocumentObject 接口。
插件通过这个接口访问编辑器对象。
RTX插件开发(一)CsDemoClient(VC6.0)一、前言我想实现客户端的插件与服务器端的应用进行通讯,采用RTX的通道进行通讯,而不是自已再写一条通道;我想在RTX客户端面版上增加一个属于我自己的面版,服务器端发过来的数据在该面版显示出来;我在自己的面版本点击某个按钮,可以把数据发送给服务器应用。
通过本章的学习,您将能实现以上的功能,实际上在RTX客户端添加一个面版,就是把自己做好的一个Activ eX控件嵌入进插件,插件加截时把Ocx显示出来;因此开发RTX插件需要对Activ eX控件及COM有一定的了解。
二、技术说明正如前言介绍,在客户端添加面版,需要把自己做好的一个Activ eX控件嵌入进插件,因此要创建两个工程,一个Activ eX控件工程(本文Activ eX为ocx),实现界面的功能;一个是RTX插件工程(插件简称dll);实现与RTX内核交互的功能。
即然是两个不同的模块,必须先解决ocx与dll之间数据传输,本文通过ATL 事件解决此问题,ATL事件是本文的主要难点。
注意:ocx向应用发送数据时,不需要先把数据发给dll,再由d ll发给应用,直接通过ocx在初始化时得到的IRTXCRootPtr指针获取IRTX ModulePtr发送数据;当dll收到从应用发过来消息时,激发ATL事件,ocx通过ATL事件接收器获取事件,并得到事件传过来的数据。
另外把ocx嵌入dll需要在ocx实现几个插件接口,否则它们无法关联在一起,这一点应该比较好理解。
插件与Activ eX控件主要技术要点和步骤如下:a)插件要点1.生成RTX插件工程2.A TL组件设计3.DLL事件激发设计b)ActiveX控件要点1. 创建ocx工程2. 实现插件接口3. 事件接收器设计4. ocx界面设计5. 收发数据c)插件打包1. 打包准备2. 打包步骤d)安装调试1. 安装插件2. 启动应用3. 插件发数据给应用2. 应用发数据给插件三、操作步骤a)插件开发步骤1.生成RTX插件工程先安装RTXCSDK安装包,在其安装目录下有三个文件夹我们必须了解;wizard文件夹:插件生成向导文件RTXCModuleAW.awx放在该目录下,开发前第一件事就是先把RTXCModuleAW.awx文件拷贝到VC安装目录Microsoft V isualStudio\COMMON\MSDev98\Template\ 文件下。
《C++程序设计》实验指导目录实验0 认识开发环境........................................错误!未定义书签。
实验1 数据类型与输入输出............................错误!未定义书签。
实验2 分支语句 ................................................错误!未定义书签。
实验3 循环语句 ................................................错误!未定义书签。
实验4 函数和程序结构....................................错误!未定义书签。
实验5 数组 ........................................................错误!未定义书签。
实验6 指针和引用 ............................................错误!未定义书签。
实验7 类和对象 ................................................错误!未定义书签。
实验8 继承和派生 ............................................错误!未定义书签。
实验9 多态 ........................................................错误!未定义书签。
实验10 输入/输出流.........................................错误!未定义书签。
实验0 认识开发环境实验目的●了解和使用集成开发环境。
●熟悉集成开发环境的基本编辑命令及功能键,学会常规窗口操作,熟悉常用的菜单命令。
●学习完整的C++程序开发过程(编辑、编译、连接、调试、运行及查看结果)。
RTX常见问题解答腾讯科技(深圳)有限公司2014年1月目录一、文档说明 (3)二、RTX服务器防火墙配置 (3)a)RTX服务与端口 (3)b)服务器防火墙设置(以Windows XP SP2为例) (4)三、RTX公网部署 (8)a)RTXServer安装在托管的服务器上 (8)b)RTXServer安装在局域网内的客户机上 (9)c)RTXServer安装在代理服务器上 (10)d)设置公网IP (11)四、远程登录 (12)a)远程登录的原理 (12)b)远程登录优点 (13)c)远程登录功能的限制 (14)d)如何启动OutSupport服务 (14)e)客户端如何使用远程登录 (14)五、SQL数据库配置 (16)a)备份用户数据 (16)b)创建SQL数据库及表 ................................................................ 错误!未定义书签。
c)设置连接字符串 ........................................................................ 错误!未定义书签。
d)导入数据 (17)六、组织架构问题处理 (19)a)组织架构机制 (19)b)组织架构问题表现 (19)c)组织架构问题处理 (19)七、发送文件问题处理 (24)a)发送文件机制 (24)b)发送文件问题表现 (24)c)发送文件问题处理 (24)八、后语 (245)一、文档说明RTX是腾讯公司推出的企业级即时通信平台。
该平台定位于降低企业通信费用,增强企业内部沟通能力,改善企业与客户之间的沟通渠道,创造新兴的企业沟通文化,提高企业生产力。
RTX平台的主要功能,包括企业内部实时信息交互、视频语音、企业短信中心等等。
RTX平台具有很高的实用性、易用性、可管理性和安全性。
除了底层采用128位对称加密技术之外,在实际应用中,RTX可以通过员工实名制、记录对外交互信息等措施,确保企业应用的通信安全。
VISUAL COMPONENTS[CONNECTIVITY]Support****************************Visual Components ForumSiemens S7 connection plugin tutorial Visual Components 4.2.2 Premium | Version: May 26, 2020The Siemens S7 connection plugin is a new feature introduced to Visual Components in version 4.2.2. The plugin is available in the Premium version of the software, and it can be used to connect Visual Components simulationto Siemens S7-series programmable logic controllers (PLC).This tutorial requires a basic level understanding of Visual Components and TIA Portal. During this tutorial, you will learn how to establish a connection between S7-series PLC and Visual Components. This involves setting up a project and downloading it from TIA Portal to a PLC, and using Visual Components to simulate a production environment to test the implemented PLC logic.ContentsGetting started (3)Setting up the properties in TIA Portal (4)Creating your PLC program block (7)Exporting the tag table (8)PLCSIM and NetToPLCSim (9)Connecting Visual Components to the PLC (10)Pairing the variables (12)Review (15)Appendix (16)Getting startedThe Siemens S7 connection plugin can be configured in the connectivity tab of Visual Components Premium 4.2.2 or newer software. If the connectivity tab is not visible in your application, you must first enable it by navigating to File, Options, Add On to enable the Connectivity view. After enabling connectivity, you must save the changed settings by pressing OK at the bottom, and then you must restart the application.This tutorial uses a simple layout setup with a feeder, conveyor, sensor, and a motor. You can construct a similar layout by looking up the components from the corresponding categories in the eCatalog, and then connecting the components with the Plug and Play (PnP) tool. Alternatively, you can adapt the training and try the same approach with your custom logic and layout.Setting up the properties in TIA PortalThis tutorial is done using TIA Portal V16 and a virtual S7-1200 series PLC that is simulated with S7-PLCSIM V16. A similar procedure will also work with other S7-series PLCs, such as 300, 400, and 1500, that are either physical or simulated with PLCSIM or PLCSIM Advanced. Note that no OPC functionalities are required for the PLC to connect to Visual Components when using the S7 plugin.The basic steps for configuring the PLC project for simulation are:•Support simulation during block compilation (Optional)•Configure the PLC Ethernet interface•Disable physical input updating (Optional)•Enable full access and PUT/GET communication•Configure NetToPLCSim (Only for PLCSIM)To get started in TIA Portal, you can either create a new project or use an existing project. If you are using simulated PLC, you must go to the project properties to enable the simulation support. You can enter the project properties by right-clicking on the project.Select the Protection tab in the project properties. You must make sure that the setting ‘Support simulation during block compilation’ is enabled.You must add one or more devices to your project by pressing the Add new device button. This tutorial uses a 1212C AC/DC/Rly CPU as the only device. After adding the device, you can enter the device properties by right-clicking on the device and selecting Properties. After you have finished the virtual commissioning, you should update the properties back to the project-specific values.The first property to set is usually the device IP address found in the PROFINET Interface settings. When using a simulated PLC, it is often a good practice to set the IP address to a private IP address, such as 192.168.0.1.The next property to check is Process Image, which is found in the I/O addresses settings. The Process image property can be set to None so that the physical IOs of the PLC do not overwrite the values written by the simulation.The final properties that are relevant for connecting the device to the simulation are found from the Protection & Security settings. To enable the simulation to read and write to the PLC, you must first enable Full access, and secondly, enable Permit access with PUT/GET communication from remote partner. Note that this will leave your PLC vulnerable, and should only be done for testing in a secure network.Creating your PLC program blockAfter setting the device properties, you can start creating your PLC program logic. The control logic for this tutorial has been made with ladder logic, but you can use any of the IEC 61131 programming languages.The example program logic will power the conveyor motor until the sensor detects a part. Once the sensor is activated, the conveyor will be stopped and started again after a delay. The program consists of one network with two switches from the sensor input, one timer, and an output coil for the conveyor motor. For the inputs, one of the switches is normally closed (NC), and the second switch is normally open (NO). The timer type is TON, which counts a specified time PT, and after that activates the output Q. In this case, the processing time PT is set to T#5S, so the conveyor will stop for five seconds each time the sensor is triggered.Exporting the tag tableWhen using the S7 connection plugin, the variables that are paired with the simulation must be exported from the PLC program to Visual Components using a tag table. When creating the variables for the sensor and the motor, you must use the global memory areas so that the variables become visible in the tag table and can be exported to the simulation. In the example program, the sensor memory address is in the global input %I0.0, and the motor memory address is global output %Q0.0. The full list of supported memory areas is shown in appendix 1.can be found from the help file.The tag table can be exported from the tag table view by pressing the Export button. The supported file types are .sdf and .xlsx files. As you can only pair variables that are exported in the tag table, it is good to double-check the tag table file content after exporting. With .xlsx files this is easy, as all that you need to do is open the file in Excel to view and modify the content.The data types that are currently supported by the connection plugin are shown in the help file. When creating project-specific user-defined data types, only the main variable with the custom data type is exported with the tag table. See the appendix 13 for how to export user-defined data-types fully to your tag table.If you are using a physical PLC, S7-PLCSIM Advanced, or S7-PLCSIM with NetToPLCSim already running, you can compile the PLC program, download it to the device, log in and start monitoring the variables. If you are using S7-PLCSIM, you must save your project, exit TIA portal, and configure NetToPLCSim to enable the virtual PLC to communicate with the simulation.PLCSIM and NetToPLCSimThis section is only necessary if you are using PLCSIM to simulate your PLC. PLCSIM doesn’t support TCP/IP communication (but PLCSIM Advanced does), so creating a direct connection with the S7 connection plugin doesn’t work directly with PLCSIM. A free tool NetToPLCSim can be used as a bridge between the S7 communication and Siemens softbus interface the PLCSIM has.NetToPLCSim is free software that can be downloaded from here:/The download comes with a full user manual for the software that you can refer to if you encounter any questions while using the software.TIA portal and PLCSIM must be closed before launching NetToPLCSim to ensure that the connection works. You need to start the NetToPLCSim as an administrator and allow it to shut down the service that is blocking TCP port 102. Only after the service has been stopped can you open TIA Portal to start PLCSIM and load the project to it. Doing these in a wrong order is likely to make the connection fail, and a Windows reboot is needed to get it working again.After you have NetToPLCSim, TIA portal, and PLCSIM running, you can add a new station by pressing the Add button in NetToPLCSim. A new window will open where you can set the server properties. The network IP Address is the IP address of your computer, which can be changed by going to the network adapter settings in control panel. The network IP address must be in the same address space as the PLC address. Pressing the … -buttons will open yet another window that will automatically propose valid addresses for both fields. The rack and slot indexes must be set to the correct value that is determined by your PLC type. The next section will give more information about the rack and slot indexes. After configuring the properties, you must start the server by pressing the Start Server -button.Note for the next chapter: When using NetToPLCSim, you need to connect the S7 connection plugin to the Network IP address instead of the address of the PLC. Connecting Visual Components to the PLCOnce you have downloaded your program to the PLC and exported the tag table that contains the variables to be paired, you are ready to switch back to Visual Components. To start configuring the S7 connection plugin, open the connectivity view, select the Siemens S7 plugin, and press Add Server.Once you have the server selected, the edit connection panel will open by default on the right side of your application. To establish a connection to the PLC, you must enter the IP address and the rack & slot indexes. If you are using PLCSIM with NetToPLCSim, the IP address will be your computer's IP address, so the Network IP address that you entered in NetToPLCSim settings. If you are not using PLCSIM, you can enter the IP address of your PLC that was configured in the TIA portal's interface properties.The rack and slot indexes are determined by the type of PLC that you are using. If you are not sure of the correct indexes, you can inspect the correct values from TIA portal by opening the Devices & networks view. For S7-1200 and 1500 series PLC, the default rack index is 0, and the slot index is 1.Once you have entered the correct IP address along with rack and slot indexes, you can verify that the connection can be established by pressing the Test Connection -button. Once a valid connection has been verified, you can save the server settings by pressing Apply.Pairing the variablesUnlike other connection plugins, the Siemens S7 connection plugin does not have a browsing functionality to pair the variables between the simulation and the PLC directly. Due to the limitation in the communication protocol, the plugin can only access the PLC variables that are in the exported tag table. To start pairing the variables, you must press the Load PLC symbols from file -button in the server properties. The file explorer will open from which you can select the tag table that you exported from TIA portal. The plugin can import tag tables in .xlsx and .sdf file formats.You will get a confirmation that the tags have been imported successfully, along with the number of available tags. The next step is to pair the variables that you have in the simulation with the tags that are in the PLC. The pairing must be done separately for communication directions, so simulation to server, and server to simulation. Pairing the variables is done by selecting the transmit direction and pressing the Add variables -button.For this exercise, the sensor is used as an input, so the sensor is sending data from simulation to the server (PLC), while the motor signal is an output, so the motor control signal is sent from server to simulation. If either side of the Create variable pairs -window is empty orshowing old variables, the view should be refreshed by right-clicking on the panel and selecting Reload Structure.Only pair the variables for the correct transmit direction, so first in the Simulation to Server direction in the l eft side expand the sensor and select the ‘SensorBooleanSignal’. After the signal is selected, you can select the corresponding PLC variable ‘conveyor1 sensor’ from the right side. Once the desired variables are both selected and highlighted, press the Pair Selected -button to pair the variables together. The link icon to the left of the simulation variable indicates a successful pairing.After you have paired the sensor signal you can select the server to simulation group to pair the variables in this transmit direction. For simulation side the correct variable is the MotorSignal, which is found under the motor signal interface. From server side select the conveyor1 motor variable, and press Pair Selected. Now that you have paired the variables in both directions you can connect to the server by either pressing on the icon next to the server, or by selecting the server and pressing the Reconnect button.Once the connection is established you can view the Connected Variables window, which should show your server along with the variable groups. Make sure that the correct variables are in the correct groups as shown below.Finally, as the connection has been enabled, and the correct variables have been paired, you are ready to start the simulation. Make sure that your PLC is in RUN-mode and hit the Play -button. The feeder will start producing parts that move on the conveyor. Once a part reaches the sensor, the SensorBooleanSignal will switch from False to True. The paired conveyor1 sensor variable should reflect this change, and change the input value for your PLC program, thus setting the MotorSignal to False for the process duration. You can also inspect the variables in TIA portal by logging in to the PLC and monitoring the program block to see the program logic operating.ReviewIn this tutorial, you learned how to use the Siemens S7 connection plugin to connect Visual Components Premium to a Siemens PLC. The tutorial result is a simple conveyor system with a sensor and a motor. As the sensor detects a part, the PLC program will shut down the conveyor motor. After five seconds, the motor will be restarted, and so the flow continues.You can now adapt what you have learned to more complex projects with hundreds of IOs. Just remember that the plugin can only pair tags from the tag table, and the tags data types must be among the supported data types.The help documentation is a great resource for learning more about connectivity. You can open the Help documentation in Visual Components by pressing F1. Connectivity related topics are found in contents view by navigating to Tasks - Connectivity.AppendixUsing user-defined data typesYour project specific PLC program might contain user-defined data types that consist of multiple Step7 data types. When you export the tag table from TIA portal, only the heading variable with the custom data type are exported, while the contained Step7 data types are not exported.Since the S7 connection plugin only supports the system variable data types that are shown in the help file, user-defined data types are not visible in Visual Components application.To get around this issue, the user may add the Step7 data types to the exported .xlsx or .sdf file directly. Select the desired variables from the tag table in TIA portal and copy the tags with Control + C. Control + A can be used to select all of the tags in the tag table.Paste the tags to your .xlsx or .sdf file with Control + V.The tag data will initially not match the header format, so you will have to reformat the data to a suitable format. This can be done manually by cutting and pasting the data to correct cells, or for larger projects, the user should implement a script to format the data automatically.After reformatting the exported tag table so that the desired variables are available with the data in the correct fields, it is possible to import the file to the connection plugin and pair the PLC variables with the simulation.。
RTXC 插件开发指南Step by step腾讯科技(深圳)有限公司版权所有侵权必究目录1、开发前准备 (3)2、创建插件工程 (3)3、界面上的体现 (7)4、交互控制 (10)5、收发数据处理 (16)6、插件打包发布 (20)7、后语 (20)1、开发前准备需要安装如下文件:RTXClient 安装包RTXClient SDK 安装包开发插件的过程一般是要经历一下几个步骤:创建插件工程,RTX客户端里界面上体现,交互控制,数据传输,打包发布;以下的用例是开发一个程序共享的插件,通过介绍开发程序共享的插件,来讲解插件的一般开发过程。
2、创建插件工程创建插件工程,首先把RTXC SDK目录中wizard目录下的RTXCModuleAW.awx 文件拷至VC安装目录Microsoft Visual Studio\COMMON\MSDev98\Template\ ,然后在VC中创建一个插件工程。
第一步:创建一个AppSharePlugin 工程。
第二步:设置插件的信息。
第三步:设置插件内部邦定的事件。
完成以上三个步骤之后,可以自动生成如下函数:这些自动生成的代码,已经定义了RTXC的接口函数,一个插件的基本框架已经搭建成功,用户只需要在这些接口函数里添加自己的功能。
创建完成一个插件工程之后,就需要考虑在RTX的客户端界面能体现出该插件,如菜单、面板、TAB或者在RTXC其他的界面元素上;程序共享主要在RTXC的菜单上增加一个新的菜单项来体现,其他的体现方式,可以参看RTXC SDK文档。
3、界面上的体现程序共享一般需要在RTX客户端的菜单中添加“程序共享”的菜单项,操作步骤如下:第一步:设置动态菜单相关的内容。
首先在Stdafx.h文件中添加如下代码:#import "ClientObjects.tlb" raw_interfaces_only no_namespace, named_guids#include "RTXCModuleIds.h"在插件中实现动态的添加和删除菜单,就必须包含ClientOjbect.tlb和RTXModuleIds.h 这两个文件,这两个文件分别位于SDK安装目录下的TLB和INCLUDE 目录下,用户可以根据实际情况,设置文件的相对路径。
3Dmax插件开发指南:定制您自己的插件和脚本3Dmax是一款强大的三维建模、动画和渲染软件,广泛应用于电影、游戏、建筑和工业设计等领域。
为了满足用户的个性化需求,3Dmax支持插件和脚本开发,使用户能够根据自己的需求定制功能和工具。
本文将提供一个详细的指南,教你如何开发定制化的3Dmax插件和脚本。
一、了解3Dmax插件和脚本开发的基础知识1.1 插件和脚本的定义插件是一种可以扩展3Dmax功能的外部工具,可以添加新的命令、工具栏按钮或菜单项等,以实现特定的功能。
脚本是一种自动化操作的计算机程序,可以通过编写脚本语言来控制3Dmax软件的各种操作。
1.2 插件和脚本的开发环境3Dmax提供了一个强大的开发环境用于插件和脚本的编写和测试,主要包括Maxscript和.NET插件开发两种方式。
Maxscript是一种基于脚本语言的开发方式,适用于简单的功能和小型工具的开发;而.NET插件开发则提供了更多的灵活性和功能扩展的可能性。
二、使用Maxscript进行插件和脚本开发2.1 学习Maxscript语法和基本命令Maxscript是一种易学易用的脚本语言,可以轻松地执行各种3Dmax操作。
你可以通过阅读相关的文档和教程来学习Maxscript语法和常用命令,如创建对象、修改对象属性、运行动画等。
2.2 开发自定义的脚本功能首先,你需要确定你的脚本的功能和目的,然后使用Maxscript编辑器编写脚本。
例如,你可以编写一个用于自动创建树木的脚本,包括树干和树叶的生成、形状调整和材质设置等。
你可以使用Maxscript提供的一些内置函数和方法进行开发,也可以利用Maxscript的编程能力实现更复杂的功能。
2.3 创建自定义的工具栏按钮和菜单项在3Dmax的用户界面中,你可以创建自己的工具栏按钮和菜单项,以方便调用你的自定义脚本功能。
你可以通过Maxscript编辑器的界面设计工具来创建和调整工具栏按钮和菜单项的样式和位置,然后将它们与你的脚本函数关联起来。
C#实现插件式开发(超简单傻瓜式教程)为什么要用插件就不说了,本教程可以实现程序动态加载外部DLL,并调用DLL里面的类、方法,本教程力求已最简单的方式介绍,减少一些不必要的代码给小白造成混淆。
程序分三个部分:接口、插件、Windows程序,比较复杂的是程序如何动态加载与内容调用。
一、正式教程前科普一下基础知识:(非小白点我跳过)生成DLL项目=>新建=>类库写完代码后shift+f6 生成DLL快速实现接口插件同时也可以继承其他类,但插件名称必须写在后面,例如:项目引用DLL以下正文==================================二、接口接口的作用是定义一个规则,让插件和程序按这个规则来开发。
规则可以是函数、属性…,本文简单定义一个带返回值及参数的接口:三、插件新建类库,写一个类,并继承接口,具体的写法为:Public class 插件名字:接口名字注意必须引用上面写的接口生成的DLLusing System;using System.Collections.Generic;using System.Linq;using System.Text;using MainIO;namespace MathPlugs{public class add: iMainIO//注意要引用上面的接口,并且继承{public decimal Math(decimal a, decimal b){return (a + b);//简单的a+b}}public class minus : iMainIO{public decimal Math(decimal a, decimal b){return (a - b);}}}四、程序加载过程按以下次序进行:获取指定文件夹内所有文件的路径名称==》筛选出“.DLL”==》实例化“DLL”(就是把DLL变成类库)==》类库里面寻找有没有指定接口的类==》加载到ArraryList里面去,这样我们的得到了一个具有约定接口的类了,剩下的就是调用类里面的东西了。
C#插件编程简单介绍定义插件接口// PluginInterface.cs// 插件的公用接口// 编译命令:csc /target:library PluginInterface.csusing System;public interface IPlugin{//插件名称string Name{get;}//实现插件功能的方法object DoWork(object parameter);}定义插件宿主接口// HostInterface.cs// 插件宿主的公用接口// 编译命令:csc /target:library HostInterface.csusing System;using System.Collections.Generic;public interface IHost{//已经装载的插件的集合//path为存放插件的目录List<IPlugin> Plugins{get;}//装载所有实现了IPlugin接口的插件//path为存放插件的目录,返回值为符合要求的插件的数量int LoadPlugins(string path);//获取指定的插件//name为插件的名称IPlugin GetPlugin(string name);}编写插件// Plugin1.cs// 插件示例// 编译命令:csc /target:library /r:PluginInterface.dll Plugin1.csusing System;public class Plugin1 : IPlugin{//表示插件名的私有字段private string name;//实现IPlugin的Name属性public string Name{get{return name;}}//无参数的构造函数public Plugin1(){name = "Plugin1";}//实现IPlugin的DoWork方法public object DoWork(object parameter){Console.WriteLine("================================================");Console.WriteLine(name + ": " + parameter.ToString());Console.WriteLine("================================================");return parameter;}}// Plugin2.cs// 插件示例// 编译命令:csc /target:library /r:PluginInterface.dll Plugin2.csusing System;public class Plugin2 : IPlugin{//表示插件名的私有字段private string name;//实现IPlugin的Name属性public string Name{get{return name;}}//无参数的构造函数public Plugin2(){name = "Plugin2";}//实现IPlugin的DoWork方法public object DoWork(object parameter){Console.WriteLine("================================================");Console.WriteLine(name + ": " + parameter.ToString());Console.WriteLine("================================================");return parameter;}}除了插件名不同之外,Plugin1与Plugin2的代码几乎完全相同编写插件宿主程序// Host.cs// 宿主程序// 编译命令:csc /r:HostInterface.dll /r:PluginInterface.dll Host.csusing System;using System.IO;using System.Collections.Generic;using System.Reflection;public class Host : IHost{//私有字段,存放所有已经装载的插件的集合private List<IPlugin> plugins = new List<IPlugin>();//实现IHost的Plugins属性public List<IPlugin> Plugins{get{return plugins;}}//实现IHost的LoadPlugins方法public int LoadPlugins(string path){//获取指定目录中所有的程序集string[] assemblyFiles = Directory.GetFiles(path, "*.dll");//判断每一个程序集是否实现了插件接口IPluginforeach (string file in assemblyFiles){//装载程序集Assembly assembly = Assembly.LoadFrom(file);//检查程序集中每一个公开的类型foreach (Type t in assembly.GetExportedTypes()){//该类型是否类、是否实现了IPlugin接口?if (t.IsClass && typeof(IPlugin).IsAssignableFrom(t)){//创建实现了IPlugin接口的类的对象IPlugin plugin = Activator.CreateInstance(t) as IPlugin;//添加到集合中plugins.Add(plugin);}}}return plugins.Count;}//实现IHost的GetPlugins方法public IPlugin GetPlugin(string name){foreach (IPlugin ip in plugins){if ( == name)return ip;}return null;}//输入数量的安全方法private static int InputNumber(string prompt){Console.Write(prompt);string s = Console.ReadLine();int amount = 0;try{amount = Int32.Parse(s);}catch (Exception) //捕获任何异常{Console.Write("输入的数值格式不正确,请重新输入!"); //提示错误amount = InputNumber(prompt); //递归调用InputNumber }return amount;}//入口点static void Main(){//创建Host对象Host h = new Host();//装载插件h.LoadPlugins(".");//显示所有已经装载的插件Console.WriteLine("已经装载如下的插件:");int i = 1;foreach (IPlugin ip in h.Plugins){Console.WriteLine("{0}. {1}", i++, );}//选择插件int si = InputNumber("请选择一个插件(按Enter键输入):");Console.WriteLine("\n");//执行插件的功能IPlugin plugin = h.GetPlugin(h.Plugins[si-1].Name);plugin.DoWork("从宿主程序调用。
C++开发WPF,StepbyStep-WPF随笔-博客园示例代码使用C++来开发WPF,主要是如何在MFC(Win32)的窗口中Host WPF的Page。
下面我就做个详细的介绍.一、创建工程, 由于MFC的Wizard会生成很多用不到的代码,所以我准备从一个空的工程开始创建一个MFC的工程。
a) 打开VS2005,菜单File->New->Projects…, 左面选择Visual C++->Win32,右面选择Win32 Console Application,给工程起个名字CPlusPlus_WPF, Ok进入下一步。
见Figure 1 Figure 1 Create Project 1b) 工程基本配置,在Application Setting中选择Console Application和MFC.。
Finish进入下一步。
见Figure 2Figure 2 Application Settingc) 修改工程,使工程变成MFC Windows程序。
i. 删除CPlusPlus_WPF.cpp和CPlusPlus_WPF.h文件Figure 3 Remove no used filesii. 添加CWinApp派生类, 在工程上点击鼠标右键,Add=>Class…Figure 4 Add New Class Menu在弹出的对话框中,左边选择MFC,右面选择MFC Class,点击Add进入下一步Figure 5 Create New Class Dialog在弹出的对话框中输入类名:CCPlusPlus_WPFApp, 基类选择CWinAppFigure 6 Add CWinApp Derived Classi. 用同上的方法添加CWnd派生类,Class name为CCPlusPlus_WPFMainWnd, Base class为CWnd。
ii. 修改工程属性。
C#开发step步骤条控件详解现在很多的javascript控件,⾮常的不错,其中step就是⼀个,如下图所⽰:那么如何⽤C#来实现⼀个step控件呢?先定义⼀个StepEntity类来存储步骤条节点的信息:public class StepEntity{public string Id { get; set; }public string StepName { get; set; }public int StepOrder { get; set; }public eumStepState StepState { get; set; }public string StepDesc { get; set; }public object StepTag { get; set; }//public Image StepCompletedImage { get; set; }//public Image StepDoingImage { get; set; }public StepEntity(string id,string stepname,int steporder,string stepdesc, eumStepState stepstate,object tag){this.Id = id;this.StepName = stepname;this.StepOrder = steporder;this.StepDesc = stepdesc;this.StepTag = tag;this.StepState = stepstate;}}定义⼀个名为StepViewer 的⽤户控件。
public partial class StepViewer : UserControl{public StepViewer(){InitializeComponent();this.Height = 68;}}在StepViewer 的⽤户控件中定义⼀个ListDataSource的属性,如下:private List<StepEntity> _dataSourceList = null;[Browsable(true), Category("StepViewer")]public List<StepEntity> ListDataSource{get{return _dataSourceList;}set{if (_dataSourceList != value){_dataSourceList = value;Invalidate();}}}在此控件的paint⽅法中,进⾏步骤条的绘制:private void StepViewer_Paint(object sender, PaintEventArgs e){if(this.ListDataSource!=null){int CenterY = this.Height / 2;int index = 1;int count = ListDataSource.Count;int lineWidth = 120;int StepNodeWH = 28;//this.Width = 32 * count + lineWidth * (count - 1) + 6+300;//defalut pen & brushe.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;Brush brush = new SolidBrush(_Gray);Pen p = new Pen(brush, 1f);Brush brushNode = new SolidBrush(_DarkGray);Pen penNode = new Pen(brushNode, 1f);Brush brushNodeCompleted = new SolidBrush(_Blue);Pen penNodeCompleted = new Pen(brushNodeCompleted, 1f);int initX = 6;//stringFont nFont = new Font("微软雅⿊", 12);Font stepFont = new Font("微软雅⿊", 11,FontStyle.Bold);int NodeNameWidth = 0;foreach (var item in ListDataSource){//roundRectangle rec = new Rectangle(initX, CenterY - StepNodeWH / 2, StepNodeWH, StepNodeWH);if (CurrentStep == item.StepOrder){if (item.StepState == eumStepState.OutTime){e.Graphics.DrawEllipse(new Pen(_Red,1f), rec);e.Graphics.FillEllipse(new SolidBrush(_Red), rec);}else{e.Graphics.DrawEllipse(penNodeCompleted, rec);e.Graphics.FillEllipse(brushNodeCompleted, rec);}//⽩⾊字体SizeF fTitle = e.Graphics.MeasureString(index.ToString(), stepFont);Point pTitle = new Point(initX + StepNodeWH / 2 - (int)Math.Round(fTitle.Width) / 2, CenterY - (int)Math.Round(fTitle.Height / 2));e.Graphics.DrawString(index.ToString(), stepFont, Brushes.White, pTitle);//nodeNameSizeF sNode = e.Graphics.MeasureString(item.StepName, nFont);Point pNode = new Point(initX + StepNodeWH, CenterY - (int)Math.Round(sNode.Height / 2) + 2);e.Graphics.DrawString(item.StepName,new Font( nFont,FontStyle.Bold), brushNode, pNode);NodeNameWidth = (int)Math.Round(sNode.Width);if (index < count){e.Graphics.DrawLine(p, initX + StepNodeWH + NodeNameWidth, CenterY, initX + StepNodeWH + NodeNameWidth + lineWidth, CenterY);}}else if (item.StepOrder < CurrentStep){//completede.Graphics.DrawEllipse(penNodeCompleted, rec);//imageRectangleF recRF = new RectangleF(rec.X + 6, rec.Y + 6, rec.Width - 12, rec.Height - 12);e.Graphics.DrawImage(ControlsResource.check_lightblue, recRF);//nodeNameSizeF sNode = e.Graphics.MeasureString(item.StepName, nFont);Point pNode = new Point(initX + StepNodeWH, CenterY - (int)Math.Round(sNode.Height / 2) + 2);e.Graphics.DrawString(item.StepName, nFont, brushNode, pNode);NodeNameWidth = (int)Math.Round(sNode.Width);if (index < count){e.Graphics.DrawLine(penNodeCompleted, initX + StepNodeWH + NodeNameWidth, CenterY, initX + StepNodeWH + NodeNameWidth + lineWidth, CenterY); }}else{e.Graphics.DrawEllipse(p, rec);//SizeF fTitle = e.Graphics.MeasureString(index.ToString(), stepFont);Point pTitle = new Point(initX + StepNodeWH / 2 - (int)Math.Round(fTitle.Width) / 2, CenterY - (int)Math.Round(fTitle.Height / 2));e.Graphics.DrawString(index.ToString(), stepFont, brush, pTitle);//nodeNameSizeF sNode = e.Graphics.MeasureString(item.StepName, nFont);Point pNode = new Point(initX + StepNodeWH, CenterY - (int)Math.Round(sNode.Height / 2) + 2);e.Graphics.DrawString(item.StepName, nFont, brushNode, pNode);NodeNameWidth = (int)Math.Round(sNode.Width);if (index < count){//linee.Graphics.DrawLine(p, initX + StepNodeWH + NodeNameWidth, CenterY, initX + StepNodeWH + NodeNameWidth + lineWidth, CenterY);}}//描述信息if (item.StepDesc != ""){Point pNode = new Point(initX + StepNodeWH, CenterY+10);e.Graphics.DrawString(item.StepDesc,new Font(nFont.FontFamily,10),brush, pNode);}index++;//8 is space widthinitX = initX + lineWidth + StepNodeWH+ NodeNameWidth+8;}}}控件的使⽤:List<StepEntity> list = new List<StepEntity>();list.Add(new StepEntity("1", "新开单", 1, "这⾥是该步骤的描述信息", pleted, null));list.Add(new StepEntity("2", "主管审批", 2, "这⾥是该步骤的描述信息", eumStepState.Waiting, null));list.Add(new StepEntity("3", "总经理审批", 3, "这⾥是该步骤的描述信息", eumStepState.OutTime, null));list.Add(new StepEntity("2", "完成", 4, "这⾥是该步骤的描述信息", eumStepState.Waiting, null));this.stepViewer1.CurrentStep = 3;this.stepViewer1.ListDataSource = list;同样的,我们可以实现如下的timeline控件。
RTX 2013 公网部署
腾讯科技(深圳)有限公司
2014年1月
目录
1、文档说明 (3)
2、RTX服务器端和客户端的主要通信端口 (3)
3、局域网外的RTX客户端如何登录RTX服务器 (3)
a)RTXServer安装在托管的服务器上 (3)
b)RTXServer安装在局域网内的客户机上 (4)
c)RTXServer安装在代理服务器上 (5)
d)设置公网IP (6)
4、远程登录 (7)
a)远程登录的原理 (7)
b)远程登录优点 (8)
c)远程登录功能的限制 (9)
d)如何启动OutSupport服务 (9)
e)客户端如何使用远程登录 (9)
7、后语 (11)
1、文档说明
RTX是腾讯公司推出的企业级即时通信平台。
该平台定位于降低企业通信费用,增强企业内部沟通能力,改善企业与客户之间的沟通渠道,创造新兴的企业沟通文化,提高企业生产力。
RTX平台的主要功能,包括企业内部实时信息交互、视频语音、企业短信中心等等。
RTX平台具有很高的实用性、易用性、可管理性和安全性。
除了底层采用128位对称加密技术之外,在实际应用中,RTX可以通过员工实名制、记录对外交互信息等措施,确保企业应用的通信安全。
RTX可以利用SDK和API接口扩展第三方应用,如可以开发第三方短信网关、IM监控功能、用户数据同步等功能,为企业、ISV合作伙伴提供参考的整体解决方案。
本文档将介绍公网环境下如何部署RTX2011 Formal,针对各种具体情况提供了相应的解决方案,供RTX实施人员或企业系统管理人员参考阅读。
2、RTX服务器端和客户端的主要通信端口
注:为您的网络安装一个可靠的防火墙,在任何时候,都是必要的,我们提供以下端口,就是为了让客户在防火墙下,可以安全、放心的使用RTX。
请仅开通您所需要用到的端口,其他暂时闲置的端口,一定要置于防火墙之后,确保安全。
RTX服务器端所用到的端口:
TCP&UDP 8000:用于客户端登录,RTX2011默认采用UDP登录。
TCP 8003:用于客户端发送文件
TCP 8009:用于客户端升级
TCP 8880:语音、视频、大于1M文件传输
TCP 8010:用于客户端取组织架构
3、局域网外的RTX客户端如何登录RTX服务器
a)RTXServer安装在托管的服务器上
如果RTXServer安装的服务器放在电信的托管机房,服务器拥有公网的固定IP地址,那么公网用户就可以通过固定公网IP登录RTX。
如图1.1所示。
图1.1 远程RTX客户端登录公网服务器
b)RTXServer安装在局域网内的客户机上
方法I :外网用户可以通过总机号码登录RTX服务器,但前提必须确保RTX服务器的Outsupport 已经连接上WanServer,详细远程登录请见下一节。
如图1.2所示。
图1.2 远程
RTX客户端登录局域网服务器
方法II:可以在路由器上做端口映射的方式实现登录,把刚才所介绍的端口映射到RTX服务器,外网用户即可通过路由器的IP地址登录RTX,如果路由器没有固定IP地址,可以申请动态域名。
但需要设置公网IP。
如图1.3所示。
图1.3 路由器映射端口登录
方法III:局域网外的用户也可以通过VPN(Virtual Private Network)虚拟个人网络,从外网连接到局域网内,然后再登录网内的RTX服务器。
VPN业务可以向电信局或者其他网路服务商申请,性价比较DDN专线高。
c)RTXServer安装在代理服务器上
这种情况跟RTXServer安装在局限内部相同,通常代理服务器上有双网卡,一个外网IP、一个内网IP,公网用户通过公网IP登录、内网通过局域网IP登录, 但需要设置公网IP。
d)设置公网IP
打开RTX管理器,点击左边列表中的“配置向导”-> “服务运行状态”,如下图所示:
点击“高级配置”,在“高级配置”界面上输入公网IP地址或域名后点击“增加”,填写完毕后点击“确定”,并重启所有服务。
若添加的外网服务器地址为动态域名,每当服务端网络IP地址变更后,需要手动重新启动一下DBServer服务。
RTX2008 beta1以上版本添加多个IP;如您的服务器有电信和网通两个网卡,您可以在上图把电信和网通地址都增加进去。
4、远程登录
远程登录是指RTX用户在外网也可以正常使用RTX提供的功能。
在出差的情况下,用户与部署在企业内部的RTX服务器不在同一个局域网内,为了让用户能与其他同事通过RTX正常沟通,提供的解决方案。
a)远程登录的原理
局域网内部服务器启动OutSupport服务后将连接到腾讯公司WanServer服务器,外网客户端登录
时连接到WanServer,WanServer担负着为外网用户和企业内LAN 服务建立传输通道的职责。
整体架构模型如图1.4所示:
图1.4 出差支持模型
说明:
1、SessionServer为外网中转服务器,可以有多个,启动后要向WanServer登记;
2、OutSupport为企业部署的网关,充当proxy以及安全认证的角色,每个企业部署一个;
3、Wan Server负责对企业网关的注册和寻址和为出差用户指定SessionServer以及统计数据;
4、出差用户首先从WanServer上获得SessionServer的地址,由SessionServer作为中介与OutSupport 交互,OutSupport再帮助出差用户与Lan Server间进行连接;
5、安全连接建立后,出差用户与LAN内用户进行无缝操作。
b)远程登录优点
1、不需要企业开放端口,安全性高。
2、部署在企业内部的OutSupport有本地权限验证机制,同时OutSupport与部署在公网的腾讯运营服务器之间有严密的认证机制,促进了RTX服务器的安全。
3、用户操作简单,客户端远程登录只需要在登录前选中远程登录就可以了,(第一次登录RTX 的机器需要填写总机号)。
4、使用远程登录的用户,与内网用户之间可以进行无缝的交互。
c)远程登录功能的限制
由于带宽的限制,在目前的版本中,暂时限制了照片、音频和视频等功能。
d)如何启动OutSupport服务
如果已经导入License并正确输入总机号码密码,远程登录服务将随RTX服务器一同启动。
e)客户端如何使用远程登录
1. 输入用户名、密码→点击“远程登录模式”→点击,如图1.5所示。
图1.5 选择远程登录模式
2. 输入“企业总机号码”后点击确定。
如图1.6所示。
图1.6 输入企业总机号码
3. 点击登录,将提示“正在以远程登录模式登录”,登录成功后在RTX面版右下方将显示,如图1.7所示。
图1.7 远程登录成功
4. 如果您在局域网内使用“远程登录”时,将弹出善意提示窗口,提醒您是在局域内部,是否使用远程登录。
如图1.8所示。
RTX2013 – 公网部署
【腾讯公司 版权所有】 第 11 页
图1.8 远程登录提示
5. 打开RTX 会话窗口,如果对方为远程登录,会话窗口将显示对方的IP 地址和所在地区,如下图1.9所示。
图1.9 会话窗口提示
7、后语
本文档主要介绍RTX2013在公网上的部署、使用。
服务器端应用请阅读《RTX 管理员手册》、客户端使用请阅读《RTX 用户手册》。