- 浏览: 102454 次
- 性别:
- 来自: 合肥
-
文章分类
最新评论
-
薛木木:
能说一下怎么解决的吗?没看懂哇。。。谢谢
socket.sendUrgentData在windows7下出现17次失效的问题 -
coral0212:
基于代理模式实现权限管理的案例举例说明数据权限如下:例1:论坛 ...
代理模式 -
coral0212:
面向对象设计原则:1.开闭原则2.少用继承,多用聚合3.针对接 ...
代理模式 -
zengshaotao:
jackyin5918 写道你好,你可曾 研究过 obj[p] ...
javascript遍历对象属性和方法 -
muhengji:
处理一下,具体是怎么处理呢,求指教。
socket.sendUrgentData在windows7下出现17次失效的问题
Exchanging Complex Data with Back-End Systems
Christophe Coenraets
Adobe
Retrieving server data in a Macromedia Flex application is generally easy and demonstrated in many sample applications. Sending complex data back to the server can be slightly more involved, however.
Depending on your role, and on the structure of your development team, you may have the luxury to choose—or at least influence—the architecture used to exchange data between the client and the server: web services, XML over HTTP, or remote method invocation.
In a service-oriented architecture, however, it is also likely that your application will have to access services that you didn't build and over which you have no control. In that case, you have to use the data exchange architecture implemented by the service provider.
This article takes a close look at different strategies to send complex data to the server using the three data services available in Flex to accommodate the heterogeneous data access requirements of your application: HTTPService, RemoteObject, and WebService.
Requirements
To complete this tutorial you will need to install the following software and files:
Macromedia Flex
Macromedia Flash Player
A text editor or Macromedia Flex Builder
Tutorials and sample files:
- complexdata.zip (ZIP, 23K)
Prerequisite knowledge:
Basic experience with the Flex programming model and application framework.
Using HTTPService
There are two commonly used approaches to send data to the server using the HTTPService:
- Passing request parameters
- Sending XML over HTTP
Passing Request Parameters
The request-parameters approach works fine for simple data. In the Employee Directory application (see Figure 1), we send basic employee information (first name, last name, salary, and start date) to a JavaServer page.
Figure 1. Simple Employee Directory application
Here is the source code for the simple Employee Directory application:
employeehttp.mxml
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" backgroundColor="#FFFFFF"> <mx:HTTPService id="srv" url="employeehttp.jsp" method="POST"> <mx:request> <firstName>{firstName.text}</firstName> <lastName>{lastName.text}</lastName> <salary>{salary.text}</salary> <startDate>{startDate.text}</startDate> </mx:request> </mx:HTTPService> <mx:Form> <mx:FormItem label="First Name"> <mx:TextInput id="firstName"/> </mx:FormItem> <mx:FormItem label="Last Name"> <mx:TextInput id="lastName"/> </mx:FormItem> <mx:FormItem label="Salary"> <mx:TextInput id="salary"/> </mx:FormItem> <mx:FormItem label="Start Date"> <mx:DateField id="startDate"/> </mx:FormItem> <mx:FormItem> <mx:Button label="Add Employee" click="srv.send()"/> </mx:FormItem> </mx:Form> </mx:Application>
At the server side, it's business as usual: You access the request parameters using the traditional API provided by your server-side language. Here is a JSP example:
employeehttp.jsp
<% String firstName= request.getParameter("firstName"); String lastName= request.getParameter("lastName"); String salary= request.getParameter("salary"); String startDate= request.getParameter("startDate"); // Some business logic to process the data %> <status>ok</status>
One advantage of this approach is that, from the server point of view, it works exactly like an HTML front end. This makes it particularly easy to replace an HTML-based user interface with a Flex front end.
In HTML, the request parameters approach works fine, mainly because the client side of the application is stateless and because the data-entry process is split across multiple pages. Therefore the data submitted to the server in one single request is never overly complex.
By contrast, a Flex application is stateful; the data-entry process is not constrained by the page-centric nature of HTML. You use rich user interface components to allow users to enter more complex data in a single integrated user interface. For example, Figure 2 represents an improved version of the Employee Directory application in Figure 1, where users can enter an unlimited number of phone numbers for an employee.
Figure 2. Improved Employee Directory application
With the availability of more sophisticated user interfaces, you will often need to submit more complex data to the server in one single request than you do in HTML. When the complexity of the data increases, the request-parameters approach becomes cumbersome. In that case, sending an XML document is usually a better approach.
Sending XML Over HTTP
There are two major approaches to sending XML data over HTTP:
- Sending XML as a request parameter
- Sending XML in an "application/xml" request
Sending XML as a Request Parameter: The code below provides an implementation of the Employee Directory application, where data is sent to the server in an XML string passed as a request parameter:
employeexml.mxml
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" backgroundColor="#FFFFFF" initialize="initApp()"> <mx:Script> var employee: Employee; function initApp() { employee=new Employee(); employee.phoneNumbers=new Array(); } function addEmployee() { employee.firstName=firstName.text; employee.lastName=lastName.text; employee.startDate=startDate.selectedDate; employee.salary=Number(salary.text); srv.send({xml: XMLUtil.as2xml(employee, "employee")}); } </mx:Script> <mx:HTTPService id="srv" url="employeexml.jsp" method="POST"/> <mx:Form> <mx:FormItem label="First Name"> <mx:TextInput id="firstName"/> </mx:FormItem> <mx:FormItem label="Last Name"> <mx:TextInput id="lastName"/> </mx:FormItem> <mx:FormItem label="Salary"> <mx:TextInput id="salary"/> </mx:FormItem> <mx:FormItem label="Start Date"> <mx:DateField id="startDate"/> </mx:FormItem> <mx:FormItem label="Phone Numbers" verticalGap="1"> <mx:DataGrid id="dg" editable="true" dataProvider="{employee.phoneNumbers}"> <mx:columns> <mx:Array> <mx:DataGridColumn columnName="type" headerText="Type" cellRenderer="PhoneTypeRenderer"/> <mx:DataGridColumn columnName="number" headerText="Number"/> </mx:Array> </mx:columns> </mx:DataGrid> <mx:HBox horizontalGap="1" width="100%" horizontalAlign="right"> <mx:Button label="+" cornerRadius="0" borderThickness="0" width="20" height="20" click="dg.addItem(new PhoneNumber('H'))"/> <mx:Button label="-" cornerRadius="0" borderThickness="0" width="20" height="20" click="dg.removeItemAt(dg.selectedIndex)" /> </mx:HBox> </mx:FormItem> <mx:FormItem> <mx:Button label="Add Employee" click="addEmployee()"/> </mx:FormItem> </mx:Form> </mx:Application>
Notice that the application uses a simple object-to-XML conversion utility. Here is its source code:
XMLUtil.as
class XMLUtil { static function as2xml(obj: Object, nodeName: String) { var xml:XML=new XML(); xml.appendChild(xml.createElement(nodeName)); for (var i in obj) { handleItem(xml, obj[i], i); } return xml; } private static function handleItem(xml, item, nodeName: String) { var type=typeof item; if (type=="string" || type=="number" || item instanceof Date) { var el=xml.createElement(nodeName); el.appendChild(xml.createTextNode(item)); xml.firstChild.appendChild(el); } else if (item instanceof Array) { for(var i=0; i<item.length; i++) handleItem(xml, item[i], nodeName); } else if (item instanceof Object) xml.firstChild.appendChild(as2xml(item, nodeName)); } }
The Employee.as and PhoneNumber.as classes used in the application are defined as follows:
class Employee { public var firstName : String; public var lastName : String; public var salary : Number; public var startDate : Date; public var phoneNumbers : Array; } class PhoneNumber { public var number : String; public var type : String; function PhoneNumber(type: String) { this.type=type; } }
In this example, the benefits of first loading the data in an ActionScript object (Employee.as) before creating the XML document might not be obvious. However, in Flex applications, you are typically manipulating data as objects. (Even when you retrieve an XML document from the server using the HTTPService, the data is deserialized into an object graph by default.) So when you use the HTTPService, the need to convert objects to XML is a very common scenario.
At the server side, you access the "xml" request parameter using the API provided by the language you are using. You then typically use the XML parsing API provided by that language to process the information further. Here is a JSP example:
employeexml.jsp
<% String xml=request.getParameter("xml"); // Some business logic to process the data %> <status>ok</status>
Sending XML in an "application/xml" Request: To use this approach, just add contentType="application/xml"
to the HTTPService tag definition in employeexml.mxml, and replace the following:
srv.send({xml: XMLUtil.as2xml(employee, "employee")});
with this:
srv.send(XMLUtil.as2xml(employee, "employee"));
At the server side, your application now needs to handle an "application/xml" request. To do so, you typically use an input stream to read the incoming request. You then parse the received XML document using the parsing API provided by your server-side language. Here is a JSP example:
<%@ page import="java.io.BufferedReader, javax.xml.parsers.DocumentBuilderFactory, javax.xml.parsers.DocumentBuilder, org.w3c.dom.Document, org.xml.sax.InputSource"%> <% BufferedReader br = new BufferedReader(request.getReader()); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder db = factory.newDocumentBuilder(); Document doc = db.parse(new InputSource(br)); // Process the XML document %> <status>ok</status>
One nice feature of Flex when you use "application/xml" requests is that you actually don't have to perform the object-to-XML transformation yourself. You can provide an object as the request content and let Flex convert it automatically to XML.
To use the automatic object-to-XML encoding in the Employee Directory application, replace the following:
srv.send(XMLUtil.as2xml(employee, "employee"));
with this:
srv.send(employee);
Flex also allows you to substitute the default encoding logic with your own logic by providing an implementation for the xmlEncode()
method of the HTTPService. For example, to substitute the default encoding logic with the logic implemented in XMLUtil.as, add the following block of code to the initApp()
method:
srv.xmlEncode=function(obj: Object) { return XMLUtil.as2xml(obj, "data"); }
Using RemoteObject
The RemoteObject service allows you to invoke methods remotely in Java objects deployed in your application server. Flex.NET, currently in beta, will allow you to remotely invoke methods in .NET objects.
When invoking methods remotely, you can pass objects back and forth (as the methods' input parameters and return value) between the client and the server.
The RemoteObject approach makes particular sense when both the front end and the back end of your application manipulate data as objects. In this case, the intermediate step of converting objects to XML may result in unnecessary overhead.
When you use RemoteObject, Flex takes care of the serialization/deserialization process. The RemoteObject uses AMF (Action Message Format) over HTTP. AMF is a binary encoding format that makes this solution faster and leaner in terms of bandwidth usage than the other solutions, especially when manipulating large data sets.
In the RemoteObject implementation of the Employee Directory application, we use a Java class named EmployeeService. The EmployeeService class is defined as follows:
package samples.data; public class EmployeeService { public void addEmployee(EmployeeVO employee) { // Output data to console for demo purpose System.out.println("First Name: "+employee.getFirstName()); System.out.println("Last Name: "+employee.getLastName()); System.out.println("Salary: "+employee.getSalary()); System.out.println("Start Date: "+employee.getStartDate()); System.out.println("Phone Numbers:"); PhoneNumberVO[] phoneNumbers=employee.getPhoneNumbers(); PhoneNumberVO phoneNumber=null; for (int i=0; i<phoneNumbers.length; i++) { phoneNumber = phoneNumbers[i]; System.out.println(phoneNumber.getType()+": "+phoneNumber.getNumber()); } // Some business logic to process the data } }
The addEmployee()
method takes an EmployeeVO object as an argument. The EmployeeVO class is defined as follows:
package samples.data; import java.util.Date; public class EmployeeVO { private String firstName; private String lastName; private int salary; private Date startDate; private PhoneNumberVO[] phoneNumbers; // getter and setter methods not shown for brevity }
The PhoneNumberVO class referenced in EmployeeVO is defined as follows:
package samples.data; public class PhoneNumberVO { private String type; private String number; // getter and setter methods not shown for brevity }
When remotely invoking the addEmployee()
method in the client application, you need to make sure that the ActionScript object you pass as an argument is deserialized into an instance of the EmployeeVO class at the server side. Similarly, you need to make sure that the PhoneNumber objects you pass as part of the Employee object are deserialized into instances of the PhoneNumberVO class.
There are three basic rules to make sure an ActionScript object passed as a method parameter is deserialized into an instance of a specific Java class:
-
You need to declare the ActionScript/Java class mapping using the
Object.RegisterClass()
static function. For example:Object.registerClass("samples.data.EmployeeVO", samples.data.EmployeeVO);
The first argument is the fully qualified Java class name; the second argument is the ActionScript class.
- You have to provide the ActionScript class attributes with the exact same names (and same letter case) as the Java class attributes.
- You have to map the data types of the ActionScript class attributes to the data types of the Java class attributes. (Refer to the ActionScript/Java data type mapping table in the documentation for more details.)
In addition, even though it's not required, it's often considered a good practice to provide your ActionScript and Java classes with the same class and package names.
The same three rules also allow a Java object returned by remote method invocation to be deserialized into an object of a specific ActionScript class. (By default, an object returned from the server is deserialized into an instance of the ActionScript Object class.)
Here is the implementation of the Employee Directory using RemoteObject:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" backgroundColor="#FFFFFF" initialize="initApp()"> <mx:Script> import samples.data.*; var employee: EmployeeVO; function initApp() { employee=new EmployeeVO(); employee.phoneNumbers=new Array(); } function addEmployee() { employee.firstName=firstName.text; employee.lastName=lastName.text; employee.startDate=startDate.selectedDate; employee.salary=Number(salary.text); srv.addEmployee(employee); } </mx:Script> <mx:RemoteObject id="srv" source="samples.data.EmployeeService"> <mx:method name="addEmployee"/> </mx:RemoteObject> <mx:Form> <mx:FormItem label="First Name"> <mx:TextInput id="firstName"/> </mx:FormItem> <mx:FormItem label="Last Name"> <mx:TextInput id="lastName"/> </mx:FormItem> <mx:FormItem label="Salary"> <mx:TextInput id="salary"/> </mx:FormItem> <mx:FormItem label="Start Date"> <mx:DateField id="startDate"/> </mx:FormItem> <mx:FormItem label="Phone Numbers" verticalGap="1"> <mx:DataGrid id="dg" editable="true" dataProvider="{employee.phoneNumbers}" > <mx:columns> <mx:Array> <mx:DataGridColumn columnName="type" headerText="Type" cellRenderer="PhoneTypeRenderer"/> <mx:DataGridColumn columnName="number" headerText="Number"/> </mx:Array> </mx:columns> </mx:DataGrid> <mx:HBox horizontalGap="1" width="100%" horizontalAlign="right"> <mx:Button label="+" click="dg.addItem(new PhoneNumberVO('H'))" cornerRadius="0" borderThickness="0" width="20" height="20"/> <mx:Button label="-" click="dg.removeItemAt(dg.selectedIndex)" cornerRadius="0" borderThickness="0" width="20" height="20"/> </mx:HBox> </mx:FormItem> <mx:FormItem> <mx:Button label="Add Employee" click="addEmployee()"/> </mx:FormItem> </mx:Form> </mx:Application>
EmployeeVO.as is defined as follows:
class samples.data.EmployeeVO { public var firstName : String; public var lastName : String; public var phoneNumbers : Array; public var salary : Number; public var startDate : Date; static var registered= Object.registerClass("samples.data.EmployeeVO", samples.data.EmployeeVO); }
PhoneNumberVO.as is defined as follows:
class samples.data.PhoneNumberVO { public var number : String; public var type : String; static var registered= Object.registerClass("samples.data.PhoneNumberVO", samples.data.PhoneNumberVO); function PhoneNumberVO(type: String) { this.type=type; } }
Creating ActionScript classes based on existing Java classes can be a tedious and error-prone task. To facilitate my own development efforts, I created a simple utility that uses Java introspection to create automatically an ActionScript class based on a Java Value Object class. This utility, named java2as, is included in the supporting ZIP file in the Requirements section.
Using WebService
Just as with RemoteObject, when you invoke web services methods using the WebService component, you can pass objects back and forth (as the methods' input parameters and return value) between the client and the service.
To implement the Employee Directory application using the WebService approach, we will expose the EmployeeService class used in the RemoteObject example as a web service.
You can use your own web services engine to expose the EmployeeService class as a web service. If you use Axis, add the following service declaration to WEB-INF\server-config.wsdd:
<service name="EmployeeService" provider="java:RPC"> <parameter name="methodName" value="*"/> <parameter name="className" value="samples.data.EmployeeService"/> <beanMapping languageSpecificType="java:samples.data.EmployeeVO" qname="ns5:EmployeeVO" xmlns:ns5="http://www.macromedia.com/samples"/> <beanMapping languageSpecificType="java:samples.data.PhoneNumberVO" qname="ns6:PhoneNumberVO" xmlns:ns6="http://www.macromedia.com/samples"/> </service>
Note: Make sure that the ns:<number>
you use for each beanMapping
is unique within the WSDD file.
The web service's WSDL file describes the methods available as well as the complex data types used in the service. If you use Axis, you can access the WSDL file using the following URL:
http://localhost:8700/flex/services/EmployeeService?wsdl
Here are two interesting sections of the WSDL file for the EmployeeService web service:
The method declaration:
<wsdl:message name="addEmployeeRequest"> <wsdl:part name="employee" type="tns1:EmployeeVO" /> </wsdl:message>
The complex data types declaration:
<complexType name="PhoneNumberVO"> <sequence> <element name="number" nillable="true" type="xsd:string" /> <element name="type" nillable="true" type="xsd:string" /> </sequence> </complexType> <complexType name="EmployeeVO"> <sequence> <element name="firstName" nillable="true" type="xsd:string" /> <element name="lastName" nillable="true" type="xsd:string" /> <element name="phoneNumbers" nillable="true" type="impl:ArrayOf_tns1_PhoneNumberVO" /> <element name="salary" type="xsd:int" /> <element name="startDate" nillable="true" type="xsd:dateTime" /> </sequence> </complexType>
When you remotely invoke the addEmployee()
method on the web service, your only requirement is to pass an ActionScript object whose attributes' names and data types match the complexType definition in the WSDL file. (Refer to the ActionScript/Web Services data type mapping table in the documentation for more details.)
To implement the Employee Directory using the WebService approach, simply replace the RemoteObject declaration with a WebService declaration:
<mx:WebService id="srv" wsdl="@ContextRoot()/services/EmployeeService?wsdl"> <mx:operation name="addEmployee"/> </mx:WebService>
In this case, you don't have to define a class mapping using Object.registerClass()
. This means that you could also use the Employee and PhoneNumber class used in the HTTP example.
Summary
Flex provides three data services to accommodate the heterogeneous data access requirements of your application: HTTPService, RemoteObject, and WebService. Retrieving server data in a Flex application is generally easy. Sending complex data back to the server can be slightly more involved.
The HTTPServices allows you to send complex data to the server using XML over HTTP.
The RemoteObject service allows you to invoke methods remotely in Java objects deployed in your application server, and pass objects back and forth (as the methods' input parameters and return value) between the client and the server.
Similarly, the WebService component allows you to invoke web services methods and exchange complex data types between the client and the service.
发表评论
-
firefox不支持attachEvent的解决方法
2011-05-05 14:36 3592第一种方法,就是通过修改Object原型的方法来申明一个att ... -
Ext oop 基础
2010-08-05 14:03 1290轻松搞定Extjs[连载]——第三章:Ext OOP基础 ... -
用一个HelloWorl例子手把手教会你使用BlazeDS
2009-11-05 14:10 1114发表于: 2009-10-26 23:00:13 - IP:5 ... -
javascript遍历对象属性和方法
2009-07-30 16:35 22144javascript遍历对象属性和方法 functi ... -
flex使用RemoteObject,如何给服务器端传递对象
2008-11-28 13:15 4175关键字: flex 举个例子吧,比 ... -
简单的ext 登录界面 (含验证码)
2008-11-28 11:45 3562以下是一个简单的 ext 登录界面: 1. ... -
flex 如何用HTTPService 与后台交互数据
2008-11-28 11:20 2613<?xml version="1.0" ... -
EXT 方法集锦
2008-11-28 11:11 2853EXT 方法集锦 (后续添加中) 1. ext的 ... -
Flex 2实现文件上传
2008-11-27 21:06 1649Flex 2实现文件上传 ... -
flex 技巧集锦
2008-11-27 21:00 1321Flex编程小技巧集锦 关键词: FLEX ... -
java flex servlet 通讯
2008-11-27 20:55 2812自从呼叫中心项目开始 ... -
Flex编程模型
2008-11-26 19:12 1117Flex编程模型 Flex包含Flex ...
相关推荐
内容概要:本文档《ccnp_300-430.pdf》涵盖了与Cisco无线网络配置相关的多个选择题及其答案解析。文档详细探讨了FlexConnect AP在不同模式下的行为、AP模式和子模式的选择、客户端特征配置、图像传输优化、Cisco OEAP配置、QoS设置、多播配置、安全措施(如入侵保护、恶意AP检测)、位置服务配置以及BYOD策略实施等内容。文档不仅提供了具体的配置命令和选项,还解释了每种配置背后的逻辑和技术原理。 适合人群:具备一定网络基础知识,特别是对Cisco无线网络设备有一定了解的技术人员,包括但不限于网络管理员、无线网络工程师和CCNP认证考生。 使用场景及目标: ① 为无线网络工程师提供实际操作指导,确保在不同场景下正确配置Cisco无线设备; ② 帮助CCNP认证考生复习并掌握相关知识点; ③ 协助IT管理员解决日常无线网络管理中的常见问题,如连接不稳定、性能不佳或安全性问题; ④ 支持企业IT部门制定和实施BYOD策略,确保员工个人设备接入公司网络的安全性和效率。 阅读建议:由于文档内容较为专业且技术性强,建议读者首先熟悉Cisco无线网络的基本概念和术语。在阅读过程中,应结合具体的工作环境和需求进行理解,并尝试将所学知识应用到实际工作中。对于不熟悉的术语或配置命令,可以通过查阅官方文档或在线资源进一步学习。此外,通过模拟环境练习配置也是巩固知识的有效方法。
内容概要:本文探讨了电力系统频率稳定性问题,特别是在风电大规模接入背景下,传统火电和水电调频方法面临的挑战及其解决方案。文中通过构建IEEE9节点系统模型,利用Simulink和Python进行仿真,比较了单一火电调频与风火联合调频的效果。研究表明,引入虚拟惯性控制和下垂控制可以显著提高系统的响应速度和稳定性,同时指出水电调频中存在的水锤效应对频率稳定的影响及相应的抑制措施。 适合人群:从事电力系统研究的专业人士、高校相关专业师生以及对电力系统调频感兴趣的工程技术人员。 使用场景及目标:适用于希望深入了解电力系统调频机制的研究人员和技术人员,旨在帮助他们掌握最新的调频技术和理论,提升实际工作中解决问题的能力。 其他说明:文章不仅提供了详细的数学模型和仿真代码,还分享了一些实用的小技巧,如参数优化方法和仿真加速策略,有助于读者更好地理解和应用所介绍的技术。
内容概要:本文详细介绍了如何在COMSOL中进行热湿耦合仿真,特别是针对蒸汽在顶部冷凝的复杂场景。首先搭建了一个20cm高的多孔介质层模型,设置了必要的物理场(如热湿传递和层流),并讨论了材料参数的选择,特别是蒸汽扩散系数和孔隙度的变化。接着深入探讨了边界条件的设置方法,包括蒸汽入口的速度和温度控制,以及冷凝边界的处理方式。文中还强调了求解器设置的重要性,提出了稳态解和瞬态解相结合的方法,并给出了具体的网格划分技巧。最后,文章提供了关于冷凝水量计算和表面张力处理的实用建议,确保仿真结果更加接近实际情况。 适合人群:具有一定COMSOL使用经验的研究人员和技术人员,特别是从事热湿耦合仿真领域的专业人士。 使用场景及目标:适用于需要精确模拟蒸汽冷凝过程的实际工程项目,如工业设备设计、建筑环境控制等。目标是帮助用户掌握COMSOL中热湿耦合仿真的关键技术,提高仿真精度和可靠性。 其他说明:文中提供的代码片段和具体参数设置对于初学者来说非常有价值,能够快速上手并应用于实际工作中。此外,文章还分享了一些常见的错误及其解决方法,有助于避免仿真过程中常见的陷阱。
# 压缩文件中包含: 中文-英文对照文档 jar包下载地址 Maven依赖 Gradle依赖 源代码下载地址 # 本文件关键字: jar中文-英文对照文档.zip,java,jar包,Maven,第三方jar包,组件,开源组件,第三方组件,Gradle,中文API文档,手册,开发手册,使用手册,参考手册 # 使用方法: 解压最外层zip,再解压其中的zip包,双击 【index.html】 文件,即可用浏览器打开、进行查看。 # 特殊说明: ·本文档为人性化翻译,精心制作,请放心使用。 ·只翻译了该翻译的内容,如:注释、说明、描述、用法讲解 等; ·不该翻译的内容保持原样,如:类名、方法名、包名、类型、关键字、代码 等。 # 温馨提示: (1)为了防止解压后路径太长导致浏览器无法打开,推荐在解压时选择“解压到当前文件夹”(放心,自带文件夹,文件不会散落一地); (2)有时,一套Java组件会有多个jar,所以在下载前,请仔细阅读本篇描述,以确保这就是你需要的文件;
内容概要:本文详细介绍了基于西门子S7-200smart PLC和西门子触摸屏构建的恒压供水(无负压供水)系统。系统通过PLC对电机进行智能控制,确保水压稳定。主要功能包括一拖二自动控制、PID调节实现恒压控制以及友好的人机交互界面。文中还展示了详细的PLC控制代码和PID控制算法,并讨论了电气图纸的设计要点和实际工程中的注意事项。 适合人群:从事自动化控制领域的工程师和技术人员,尤其是熟悉PLC编程和恒压供水系统设计的专业人士。 使用场景及目标:适用于需要稳定供水的工业生产和居民生活场景,旨在提高供水系统的可靠性和稳定性,减少设备磨损和能源浪费。 其他说明:文章不仅提供了完整的系统设计方案,还包括了许多实际调试经验和常见问题的解决方法,有助于读者更好地理解和实施该系统。
# 压缩文件中包含: 中文-英文对照文档 jar包下载地址 Maven依赖 Gradle依赖 源代码下载地址 # 本文件关键字: jar中文-英文对照文档.zip,java,jar包,Maven,第三方jar包,组件,开源组件,第三方组件,Gradle,中文API文档,手册,开发手册,使用手册,参考手册 # 使用方法: 解压最外层zip,再解压其中的zip包,双击 【index.html】 文件,即可用浏览器打开、进行查看。 # 特殊说明: ·本文档为人性化翻译,精心制作,请放心使用。 ·只翻译了该翻译的内容,如:注释、说明、描述、用法讲解 等; ·不该翻译的内容保持原样,如:类名、方法名、包名、类型、关键字、代码 等。 # 温馨提示: (1)为了防止解压后路径太长导致浏览器无法打开,推荐在解压时选择“解压到当前文件夹”(放心,自带文件夹,文件不会散落一地); (2)有时,一套Java组件会有多个jar,所以在下载前,请仔细阅读本篇描述,以确保这就是你需要的文件;
内容概要:本文详细介绍了滑模观测器和PLL在STM32F1平台上的C代码实现。滑模观测器用于估计系统内部状态,尤其适用于电机控制领域;PLL则用于确保输出信号相位与输入信号相位保持一致。文中展示了两种滑模观测器的实现方法:一种采用符号函数进行硬切换,另一种采用饱和函数进行软化处理。此外,文章还强调了使用TI的IQmath库进行定点计算加速,以提高运算效率并减少资源占用。通过具体的代码示例和调试技巧,作者分享了如何在STM32F1平台上实现高效稳定的滑模观测器和PLL系统。 适合人群:嵌入式系统开发者、电机控制系统工程师、熟悉C语言编程的技术人员。 使用场景及目标:① 实现高效的滑模观测器和PLL系统,应用于电机控制和其他实时性要求较高的场景;② 学习如何使用IQmath库进行定点计算加速,优化嵌入式系统的性能;③ 掌握调试技巧,确保系统稳定运行。 其他说明:文章提供了详细的代码示例和调试经验,帮助读者更好地理解和实现滑模观测器和PLL系统。同时,文中提到的一些注意事项和常见问题解决方案也非常实用。
# 压缩文件中包含: 中文-英文对照文档 jar包下载地址 Maven依赖 Gradle依赖 源代码下载地址 # 本文件关键字: jar中文-英文对照文档.zip,java,jar包,Maven,第三方jar包,组件,开源组件,第三方组件,Gradle,中文API文档,手册,开发手册,使用手册,参考手册 # 使用方法: 解压最外层zip,再解压其中的zip包,双击 【index.html】 文件,即可用浏览器打开、进行查看。 # 特殊说明: ·本文档为人性化翻译,精心制作,请放心使用。 ·只翻译了该翻译的内容,如:注释、说明、描述、用法讲解 等; ·不该翻译的内容保持原样,如:类名、方法名、包名、类型、关键字、代码 等。 # 温馨提示: (1)为了防止解压后路径太长导致浏览器无法打开,推荐在解压时选择“解压到当前文件夹”(放心,自带文件夹,文件不会散落一地); (2)有时,一套Java组件会有多个jar,所以在下载前,请仔细阅读本篇描述,以确保这就是你需要的文件;
# 压缩文件中包含: 中文文档 jar包下载地址 Maven依赖 Gradle依赖 源代码下载地址 # 本文件关键字: jar中文文档.zip,java,jar包,Maven,第三方jar包,组件,开源组件,第三方组件,Gradle,中文API文档,手册,开发手册,使用手册,参考手册 # 使用方法: 解压最外层zip,再解压其中的zip包,双击 【index.html】 文件,即可用浏览器打开、进行查看。 # 特殊说明: ·本文档为人性化翻译,精心制作,请放心使用。 ·只翻译了该翻译的内容,如:注释、说明、描述、用法讲解 等; ·不该翻译的内容保持原样,如:类名、方法名、包名、类型、关键字、代码 等。 # 温馨提示: (1)为了防止解压后路径太长导致浏览器无法打开,推荐在解压时选择“解压到当前文件夹”(放心,自带文件夹,文件不会散落一地); (2)有时,一套Java组件会有多个jar,所以在下载前,请仔细阅读本篇描述,以确保这就是你需要的文件;
内容概要:本文详细介绍了如何利用C语言在Simulink环境中构建逆变器的重复控制系统,旨在将逆变器的总谐波畸变率(THD)降低至0.47%。文中首先展示了核心的C语言结构体和函数,如RepetitiveController结构体用于封装延迟存储器、零相位滤波器和低通滤波器,repetitive_control函数则实现了核心算法。接着,文章解释了离散化处理的方法,包括主电路和控制部分的不同步长运行机制,以及多速率仿真的应用。此外,还讨论了陷波器的具体实现及其参数调整,强调了双线性变换在滤波器设计中的重要性。最后,文章提到了代码的高效移植性,指出通过这种方式可以在仿真阶段就为后续的实际硬件部署做好准备,大大减少了调试时间和复杂度。 适合人群:从事电力电子领域的工程师和技术人员,尤其是对逆变器控制和信号处理有一定了解的人群。 使用场景及目标:适用于需要精确控制逆变器输出质量的应用场合,如光伏逆变器、UPS电源等。主要目标是通过高效的算法设计和优化,确保逆变器输出的THD达到极低水平,同时提高代码的可移植性和易维护性。 其他说明:本文不仅提供了详细的理论背景和技术细节,还分享了许多实践经验,如环形缓冲区的使用、陷波器的参数选择等,对于理解和实施逆变器控制具有很高的参考价值。
Outlook新邮件到达时不显示通知
内容概要:本文详细介绍了三相维也纳PFC开关电源的设计、调试经验和量产方案。主要内容涵盖三相AC输入、无桥PFC结构、±400V DC输出的特点及其优势。文中提供了关键代码片段,如PFC开关频率控制、PWM初始化、过流保护等,并深入探讨了原理图设计、PCB布局要点以及EMI滤波措施。此外,还涉及移相全桥和LLC方案的应用,特别是在高效率、高功率密度场合的表现。作者分享了大量实战经验,包括硬件选型、软件调试技巧和常见问题解决方法。 适合人群:从事电力电子、工业电源设计的技术人员,尤其是对三相PFC、移相全桥和LLC技术感兴趣的工程师。 使用场景及目标:帮助读者理解和掌握三相维也纳PFC的工作原理和技术细节,提供实用的调试经验和量产解决方案,适用于新能源充电桩、大功率服务器电源等领域的产品开发。 其他说明:文章不仅涵盖了理论知识,还包括大量的实战案例和代码示例,有助于读者在实践中快速上手并解决问题。
黑板卡通熊儿童教学教案课件模板
内容概要:本文详细介绍了如何利用Python编程语言进行沟槽开挖土方量的计算,采用断面法作为主要手段。首先定义了基本参数如原地面标高、设计沟底标高等,接着通过函数calculate_section_area实现了断面面积的计算,考虑了边坡系数的影响。然后,通过遍历多个断面并应用平均面积法或棱台公式求解总土方量。此外,还探讨了如何使用matplotlib库绘制断面图以及处理复杂地形的方法,如使用pandas处理Excel数据和geopandas进行空间分析。文中强调了实际工程项目中需要注意的问题,如断面间距的选择、不同地质层的分段计算等。 适合人群:从事土木工程、市政建设等领域的一线工程师和技术人员,尤其是那些希望提高工作效率、减少手工计算错误的人群。 使用场景及目标:适用于需要精确计算沟槽开挖土方量的实际工程项目中,帮助工程师们更好地规划施工进度、控制成本。同时,也为后续的设计调整提供了科学依据。 其他说明:本文不仅提供了具体的Python代码实现,还分享了许多实践经验,如避免常见的计算陷阱、确保数据精度等。对于想要深入理解土方量计算原理及其自动化实现的人来说,是一份非常有价值的参考资料。
# 压缩文件中包含: 中文文档 jar包下载地址 Maven依赖 Gradle依赖 源代码下载地址 # 本文件关键字: jar中文文档.zip,java,jar包,Maven,第三方jar包,组件,开源组件,第三方组件,Gradle,中文API文档,手册,开发手册,使用手册,参考手册 # 使用方法: 解压最外层zip,再解压其中的zip包,双击 【index.html】 文件,即可用浏览器打开、进行查看。 # 特殊说明: ·本文档为人性化翻译,精心制作,请放心使用。 ·只翻译了该翻译的内容,如:注释、说明、描述、用法讲解 等; ·不该翻译的内容保持原样,如:类名、方法名、包名、类型、关键字、代码 等。 # 温馨提示: (1)为了防止解压后路径太长导致浏览器无法打开,推荐在解压时选择“解压到当前文件夹”(放心,自带文件夹,文件不会散落一地); (2)有时,一套Java组件会有多个jar,所以在下载前,请仔细阅读本篇描述,以确保这就是你需要的文件;
内容概要:本文详细介绍了如何利用Matlab实现MLP(多层感知机)进行时间序列预测。首先,通过对一维时间序列数据进行预处理,包括加载、划分训练集和测试集以及标准化。接着,构建了一个带有单隐藏层的MLP模型,并设置了训练参数,如隐藏层神经元个数、学习率和最大迭代次数。随后,使用训练好的模型对测试数据进行了预测,并通过R²和MAE两个指标评估了模型的性能。最后,提供了完整的代码实现和一些优化建议,如调整验证集比例和加入置信区间可视化。 适合人群:具有一定编程基础,尤其是熟悉Matlab和机器学习基础知识的研究人员和技术爱好者。 使用场景及目标:适用于需要进行时间序列预测的场景,如金融市场的趋势分析、气象预报等。目标是帮助读者掌握MLP在时间序列预测中的具体实现方法,理解各个步骤的作用,并能够根据自己的数据集进行相应的调整和优化。 其他说明:文中还提到了一些实用的小技巧,例如如何避免常见错误(如数据格式问题)、选择合适的隐藏层神经元数量以及如何正确地进行数据标准化等。此外,强调了在实际应用中可以通过调整模型参数来提高预测精度。
修改PDF元属性作者信息
踏入智慧校园的新时代,一场科技与教育的深度融合正在悄然上演。本方案以大数据、云计算、AI等前沿技术为基石,为校园管理带来前所未有的变革与便捷。 一、一键智控,校园管理轻松升级 想象一下,只需轻点手机,就能实现校园的全面智控。从教学教务到行政后勤,从师生考勤到校园安全,智慧校园解决方案一网打尽。通过构建统一的数据中台,实现各系统间的无缝对接与数据共享,让繁琐的管理工作变得轻松高效。智能排课、自动考勤、在线审批……一系列智能应用让校园管理如虎添翼,让校长和老师们从繁琐的事务中解放出来,专注于教学创新与质量提升。 二、寓教于乐,学习生活趣味无穷 智慧校园不仅让管理变得更简单,更让学习生活变得趣味无穷。AI赋能的教学系统能根据学生的学习习惯和能力,提供个性化的学习路径与资源推荐,让学习变得更加高效有趣。同时,丰富的课外活动与社团管理模块,让孩子们的课余生活也充满了欢声笑语。从智慧班牌到智能录播,从家校共育到虚拟实验室,智慧校园让每一个角落都充满了探索的乐趣与知识的光芒。 三、安全守护,校园生活无忧无虑 在智慧校园的守护下,校园生活变得更加安全无忧。通过高清视频监控、智能预警系统与人脸识别技术,校园安全得到了全方位保障。无论是外来人员的入侵还是学生的异常行为,都能被及时发现并处理。同时,智能化的健康管理系统还能实时监测师生的健康状况,为校园防疫工作提供有力支持。智慧校园,用科技的力量为每一位师生筑起了一道坚实的安全防线,让校园生活更加安心、舒心。
内容概要:本文详细介绍了锂电池二阶RC等效电路模型的构建与仿真方法。首先解释了选择二阶RC模型的原因,即它能够平衡复杂性和准确性,有效描述锂电池在充放电过程中的动态特性。接着展示了该模型的具体结构,包括开路电压源、欧姆内阻及两个RC支路。然后通过Python代码演示了如何实现模型的仿真,利用numpy和matplotlib库完成参数设置、模型仿真和结果可视化。此外,还讨论了参数辨识的方法,如最小二乘拟合,并强调了模型验证的重要性。最后指出该模型可用于电池管理系统(BMS)中,帮助实时监测和预测电池状态。 适合人群:从事锂电池研究、电池管理系统开发的技术人员,以及对电池建模感兴趣的科研工作者。 使用场景及目标:适用于需要理解和预测锂电池动态特性的场合,如电动车、储能系统等领域。目标是提高对锂电池行为的理解,优化电池管理系统的性能。 其他说明:文中提供了详细的代码示例,便于读者动手实践。同时提醒读者注意模型参数随温度变化的情况,建议在不同温度条件下进行参数标定。
内容概要:本文详细介绍了使用C#开发工业控制系统的上位机应用,涵盖主控界面设计、PLC通讯协议实现以及工艺编辑界面的构建。首先讨论了主控界面的设计,推荐使用WinForms或WPF进行布局,强调了SplitContainer和DockPanel等控件的应用。接着深入探讨了PLC通讯部分,提出了采用工厂模式抽象不同类型的PLC驱动(如Modbus TCP和RTU),并提供了具体的代码示例。对于工艺编辑界面,则提倡使用PropertyGrid控件结合自定义对象,避免使用Excel,同时介绍了如何利用OxyPlot库实现高效的曲线绘制和交互操作。此外,文中还特别提到了线程安全性和UI更新的最佳实践,确保系统的稳定运行。 适合人群:具有一定C#编程经验和对工业自动化感兴趣的开发者,尤其是从事上位机控制系统开发的技术人员。 使用场景及目标:适用于需要开发高效稳定的工业控制上位机系统的场合,帮助开发者掌握从界面设计到通讯协议实现再到数据展示的一系列关键技术,最终实现一个功能完备、易于维护的上位机应用程序。 其他说明:文中不仅提供了详细的代码片段和技术细节,还分享了许多实际项目中的宝贵经验,如避免常见错误、优化性能等方面的内容。