`
menjoy
  • 浏览: 424035 次
  • 性别: Icon_minigender_1
社区版块
存档分类
最新评论

XLoadTree 基于AJAX + XML动态加载的JS树组件的文档翻译

    博客分类:
  • Ajax
阅读更多
codeman1_2b-src.zip
codeman1_2b.war
本文已经翻译完毕, 原始版本可以在这里下载: http://webfx.eae.net/dhtml/xloadtree/xloadtree.html. 全文打包下载:
xloadtree_zh_cn.zip  54KB


xloadtree.html:

(2006-05-28) Changed license to Apache Software License 2.0.
(2003-05-06) Added target attribute support
(2002-10-10) Added reload method

(2006-05-28) 更改许可证为 Apache Software License 2.0.
(2003-05-06) 添加对 target 属性的支持
(2002-10-10) 添加 reload 方法

Introduction 介绍

About a year ago Emil visited me while I was living in USA and he came up with a brilliant idea for a next generation DHTML tree. After some discussions about this it took shape and in the end it turned out to be one of the best DHTML tree scripts I've ever seen.

大概一年之前我还住在美国的时候 Emil 造访了我, 他带来了一个很炫的关于下一代的 DHTML 树组件的想法. 经过了一番讨论之后, 这个想法成型了, 最后它被证明是一个我所见过的最棒的 DHTML 树组件脚本.

Since the original xTree script is implemented using Object Oriented JS it is very easy to extend and as soon as it started to take shape we got some wild ideas on how one could extend the tree. One idea that Emil implemented in the original tree was to add support for persistance. Another idea I had some time later was to allow subtrees to be loaded and populated at runtime. For this to work the xTree had to be updated a little to support data model changes at runtime. Emil added support for this after a while and now nothing was in my way to add the dynamic loading support.

既然原来的 xTree 脚本是做作为面向对象的 JS 实现的, 所以它很容易的进行扩展, 当它刚刚成型的时候, 我们就有一些关于如何扩展它的疯狂的想法.其中的一个想法就是 Emil 对原来的树添加了持久化的实现. 另一个之后不久我提出的想法是允许运行的时候加载和填充子树. 对此 xTree 必须有点小小的更新来支持运行时候的数据模型的改变. 后来 Emil 对此添加了支持, 现在我所做的不过就是添加了动态加载的支持.

译者注: 其实用的就是现在炒的很热的 AJAX 技术, 通过 XMLHttpRequest 读取内容, 通过 DOM 来解析 XML 内容.

Dynamic loading 动态加载

The XLoadTree is an extended version of the xTree and it allows you to define a source property for each tree item that points to an xml file that is then loaded, transformed using DOM and inserted using tree item methods. The basic mechanism for this has been working for a long time but since I wanted to cover the xml loading mechanisms before writing this article it is not until now that I can publish this.

LoadTree 是 xTree 的扩展版本, 它让你可以对每个树的节点定义一个 source 属性, 这个属性指向一个 xml 文件, 然后它可以被载入, 使用 DOM 转换, 插入, 这些都可以用树节点的方法来做. 相关的底层的机制已经使用了很长时间了, 因此我想在 xml 加载机制 中介绍它, 这个文章在我写本文之前都已经发表了.

Known Issues 已知的问题

The persistance from the original xTree is not sophisticated enough for dynamic loaded trees because the original persistance is dependent on the order of insertion and not the path. I will try to fix this in a later update.

原来的 xTree 中的持久化机制对动态加载的树来说并不是十分灵活, 因为它依赖于树的插入顺序而不是路径. 我将尝试在后一更新版本中修正这个问题.

The xml object has some issues when using the file protocol (in IE) so this one only works when located on a web server. I'll see what can be done about this.

使用 file 协议的时候(在 IE中), xml 对象会有一些问题, 所以这个脚本将只能在服务器上加载的时候才能运行. 我将找找看怎么搞定这个问题.

译者注:就是说在本机执行的时候, 在 Firefox, Opera, Mozilla 浏览器中, 使用 file 协议工作的很好, 但是 IE 浏览器下会弹出一个空的消息框, 无法载入子节点.

介绍
使用说明
API
实现
演示
下载

作者: Erik Arvidsson
中文翻译: BeanSoft

usage.html

Usage 用法

The usage of the XLoadTree is almost identical to the xTree so if you do not remember how that is done take a look at the xTree usage. Anywhere the original xTree accepts a WebFXTree you can use a WebFXLoadTree and the same applies to WebFXTreeItem and WebFXLoadTreeItem.

XLoadTree 的用法几乎和 xTree 相同, 所以您记不得如何做的时候不要忘了看一下 xTree 用法. 任何原来的 WebFXTree 可以使用 xTree 的地方都可以使用 WebFXLoadTree, 这个规则也同样适用于WebFXTreeItemWebFXLoadTreeItem.

Taking the first example in the xTree usage and instead of using a WebFXTreeItem for the second tree item we use the load counterpart.

让我们看看第一个 xTree 用法的例子, 注意我们在第二个树节点的地方使用了对应的可载入树节点代替了 WebFXTreeItem.

var tree = new WebFXTree("Root");tree.add(new WebFXTreeItem("Tree Item 1"));tree.add(new WebFXLoadTreeItem("Tree Item 2", "tree.xml"));tree.add(new WebFXTreeItem("Tree Item 3"));document.write(tree);

The code above should result in something looking like this:

上面的代码将会产生如下结果:

When Tree Item 2 is expanded the file tree.xml is loaded and during the load a dummy tree item is inserted to show that the subcontent is loading. This looks something like this:

当 Tree Item 2 被展开的时候文件 tree.xml 被载入, 在加载的时候插入一个临时的树节点来显示子节点正在被载入中. 看起来就像这样:

 

The XML format XML 文件格式

To be able to transform the xml file to an xTree the xml file must be of a certain format. Below is the xml code from the file tree.xml:

要想从 xml 文件转换成 xTree, xml 文件必须符合一个固定的格式. 下面是文件 tree.xml 中的 xml 代码:

<!----><tree></tree>   <tree action="href://webfx.eae.net" text="Loaded Item 1"></tree>   <tree text="Loaded Item 2"></tree>      <tree action="javascript:alert(2.1)" text="Loaded Item 2.1"></tree>      <tree text="Load &amp;quot;tree1.xml&quot;" src="tree1.xml"></tree>      <tree text="Loaded Item 3"></tree>

When this xml file has been loaded and inserted into the tree it looks something like this:

当这个 xml 文件加载并且插入到树中后它看起来就像这样:

 

Notice how the XML structure can contain nested tree items and tree items that points to other xml files. Notice also the top level tree item that is used to contain all the tree items that are supposed to be inserted into the current WebFXLoadTreeItem.

注意 XML 的结构, 它可以包含嵌套的子节点以及指向其它xml文件的子节点. 也请留意最顶端的树节点被用来包含所有的假定为要插入当前WebFXLoadTreeItem的所有子节点.

To see what xml attributes are supported on the tree items see the api page.

要了解树节点支持什么样的 xml 属性, 请浏览 api 页.

介绍
使用说明
API
实现
演示
下载

作者: Erik Arvidsson
中文翻译: BeanSoft

api.html

<!---->

WebFXLoadTree

This object type is used to create the actual tree root and can be used to populate the tree with tree items loaded from an xml file.

这个对象类型用来创建实际的树的根节点, 并且可以被用来向树添加从一个 xml 文件中定义的树节点.

The WebFXLoadTree extends WebFXTree (see the xTree API) so all properties and methods provided by WebFXTree are available.

WebFXLoadTree 继承自 WebFXTree (请阅读 xTree API) , 因此WebFXTree提供的所有的属性和方法都可用.

Constructor 构造器

new WebFXLoadTree(sText, sXmlSrc, sAction, sBehavior, sIcon, sOpenIcon)
Name
名称
Description
描述
sText The text label for the tree root.
树的根节点的文本标签.
sXmlSrc The source for the xml file to load when expanded.
当展开时要加载的xml文件的源路径.
sAction Optional. The action (uri) associated with the tree root.
可选. 根节点关联的操作(uri地址).
sBehavior Optional. The behavior of the tree. Valid values are "classic" and "explorer". When the value is set to "explorer" the default icon for an empty item is the same as the folder icon.
可选. 树的表现方式. 可用的值包括 "classic""explorer". 当值为 "explorer" 时空节点默认的图标和文件夹图标一样.
sIcon Optional. The icon image to use for this item. In case this item is a folder this will be used when the folder is closed.
可选. 节点所使用的图标文件. 如果这个节点是个文件夹, 这个值将在节点被关闭的时候使用.
sOpenIcon Optional. The icon image to use for this item when it is opened. This is only used for folder items that are opened/expanded.
可选. 节点打开时使用的图标文件. 这个值仅仅对文件夹节点被打开或者展开的时候有效.

Properties 属性

Name
名称
Description
描述
All properties from WebFXTree.
WebFXTree 的所有属性.
src The source to the xml file that decribes the sub trees. Notice that this is read-only after the xml file has started to load so any changes done to the source are only valid before the loading of the first file.
描述子树的xml文件的源路径. 注意这个值将在 xml 文件开始载入后变为只读, 所以任何对这个值的修改只在第一个文件载入之前生效.
loading Read only. A boolean flag which is true if the xml file has started loading and not yet finished.
只读. 布尔变量, xml 文件开始加载但是尚未加载完的时候为 true.
loaded Read only. A boolean flag which is true if the xml file has been loaded.
只读. 布尔变量, xml 文件加载完成的时候为 true.
errorText Read only String. If the loading for any reason failed the reason can be found in the errorText property. If no error occured this is "" (an empty string).
只读字符串. 如果加载因为任何原因失败, 这个原因可以在 errorText 属性中找到. 如果没有错误它的值时 ""(空字符串).

Methods 方法

Name
名称
Description
描述
reload() Reloads the XML file from the server and recreates the children of this node.
重新从服务器载入 XML 文件, 并重建这个节点的子节点.
All methods from WebFXTree. 所有继承自 WebFXTree 的方法.

WebFXLoadTreeItem

This object type is used to create tree items that can be added to the tree root, or to other tree items to create sub folders in the tree. When an WebFXLoadTreeItem is expanded an xml file is loaded that is then used to populate the item with child items.

这个对象类型用来创建可以加入树根节点的树节点, 或者可以作为子目录添加到别的树节点. 当一个 WebFXLoadTreeItem 节点被展开的时候, 将会加载用于填充子节点的 xml 文件.

The WebFXLoadTreeItem extends WebFXTreeItem (see the xTree API) so all properties and methods provided by WebFXTreeItem are available.

WebFXLoadTreeItem 继承自 WebFXTreeItem (请查看 xTree API), 因此WebFXTreeItem提供的所有的属性和方法都可用.

Constructor 构造器

new WebFXLoadTreeItem(sText, sXmlSrc, sAction, eParent, sIcon, sOpenIcon)
Name
名称
Description
描述
sText The text label for the tree item.
树节点的文本标签.
sXmlSrc The source for the xml file to load when expanded.
当展开时要加载的xml文件的源路径.
sAction Optional. The action (uri) associated with the tree item.
可选. 节点关联的操作(uri地址).
eParent Optional. The parent WebFXTreeItem or WebFXTree that the item should be added to.
可选. 当前节点要添加进去的父节点, 可以为 WebFXTreeItem 或者 WebFXTree.
sIcon Optional. The icon image to use for this item. In case this item is a folder this will be used when the folder is closed.
可选. 节点所使用的图标文件. 如果这个节点是个文件夹, 这个值将在节点被关闭的时候使用.
sOpenIcon Optional. The icon image to use for this item when it is opened. This is only used for folder items that are opened/expanded.
可选. 节点打开时使用的图标文件. 这个值仅仅对文件夹节点被打开或者展开的时候有效.

Properties 属性

Name
名称
Description
描述
All properties from WebFXTreeItem. 继承自 WebFXTreeItem 的所有属性.
srcThe source to the xml file that decribes the sub trees. Notice that this is read-only after the xml file has started to load so any changes done to the source are only valid before the loading of the first file.
描述子树的xml文件的源路径. 注意这个值将在 xml 文件开始载入后变为只读, 所以任何对这个值的修改只在第一个文件载入之前生效.
loadingRead only. A boolean flag which is true if the xml file has started loading and not yet finished.
只读. 布尔变量, xml 文件开始加载但是尚未加载完的时候为 true.
loadedRead only. A boolean flag which is true if the xml file has been loaded.
只读. 布尔变量, xml 文件加载完成的时候为 true.
errorTextRead only String. If the loading for any reason failed the reason can be found in the errorText property. If no error occured this is "" (an empty string).
只读字符串. 如果加载因为任何原因失败, 这个原因可以在 errorText 属性中找到. 如果没有错误它的值时 ""(空字符串).

Methods 方法

Name Description
reload() Reloads the XML file from the server and recreates the children of this node.
重新从服务器载入 XML 文件, 并重建这个节点的子节点.
All methods from WebFXTree. 所有继承自 WebFXTree 的方法.

The xml format xml 格式

The only valid element in the xml file is the tree item. A tree item can contain zero, one or more tree items.

xml 文件中唯一有效的元素就是 tree 节点. 一个tree节点可以包含零个,一个或者更多tree节点.

Attributes 属性

There are five valid attributes that you can provide on a tree item.

您可以为一个 tree 节点提供 5 个有效的属性.

Name
名称
Description
描述
text Required. The text label for the tree item.
必需. 树节点的文本标签.
xmlSrc Optional. The source for the xml file to load when expanded.
可选. 当展开时要加载的xml文件的源路径.
action Optional. The action (uri) associated with the tree item.
可选. 节点关联的操作(uri地址).
icon Optional. The icon image to use for this item. In case this item is a folder this will be used when the folder is closed.
可选. 节点所使用的图标文件. 如果这个节点是个文件夹, 这个值将在节点被关闭的时候使用.
openIcon Optional. The icon image to use for this item when it is opened. This is only used for folder items that are opened/expanded.
可选. 节点打开时使用的图标文件. 这个值仅仅对文件夹节点被打开或者展开的时候有效.

DTD

The xml file does not have to be valid to work (only well formed) but if you want to ensure that you didn't do anything wrong you can use the following document type definition:

xml 文件并不必须是有效的格式才能工作(只需要良好的组织起来), 但是如果你想确保你没有写错, 可以使用下面的文档类型定义:

<!----><!---->

To use the dtd in your xml file add a DOCTYPE to the head of your xml file. Below is tree.dtd.xml shown. This represents the same xml tree as in tree.xml with a DOCTYPE declaration.

在你的 xml 文件中使用这个 dtd 请在文件的开头包含一个 DOCTYPE. 下面显示的是 tree.dtd.xml . 这个表示了和 tree.xml 中相同的 xml 树, 只不过有一个 DOCTYPE 声明.

<!----><!----><tree></tree>	<tree action="href://webfx.eae.net" text="Loaded Item 1"></tree>	<tree text="Loaded Item 2"></tree>		<tree action="javascript:alert(2.1)" text="Loaded Item 2.1"></tree>		<tree text="Load &amp;quot;tree1.xml&quot;" src="tree1.xml"></tree>

介绍
使用说明
API
实现
演示
下载

作者: Erik Arvidsson
中文翻译: BeanSoft

Implementation 实现

The main idea is to create sub classes to WebFXTree and WebFXTreeItem and overload the expand methods to start the loading of an xml file. Once the loading is done the xml file is tranformed into WebFXTreeItems and WebFXLoadTreeItems and inserted.

主要的思路就是创建 WebFXTreeWebFXTreeItem 的子类, 并且重载 expand 方法来启动加载 xml 文件的过程. 一旦加载结束, xml 文件被转换成 WebFXTreeItems 和 WebFXLoadTreeItems, 然后添加到树上.

译者注: 这里就是面向对象的好处了, 我也用重载或者添加新方法的思路实现了动态添加子节点, 添加失败则回复到原来状态, 成功则加入新的子节点.

WebFXLoadTree

First we create a new constructor and inside this we call the super constructor to make sure that the instance will be correctly initiated. After that we set some property values and finally we check whether the tree is open, if it is we start to load the sub trees. If not, we add a dummy tree item that displays the loading text.

首先我们创建了一个新的构造器, 在这个方法里面我们首先调用父类的构造器来确保每个实例可以被正确的初始化. 在此之后我们设置一些属性值, 最后我们检查树是否已经被打开, 如果这样的话我们就开始加载树的子节点. 反之, 我们向树节点中添加一个临时的显示正在加载文本的树节点.

After the constructor is created we set the protype to a new WebFXTree.

function WebFXLoadTree(sText, sXmlSrc, sAction, sBehavior, sIcon, sOpenIcon) {   // call super   this.WebFXTree = WebFXTree;   this.WebFXTree(sText, sAction, sBehavior, sIcon, sOpenIcon);   // setup default property values   this.src = sXmlSrc;   this.loading = false;   this.loaded = false;   this.errorText = "";   // check start state and load if open   if (this.open)      _startLoadXmlTree(this.src, this);   else {      // and create loading item if not      this._loadingItem = new WebFXTreeItem(webFXTreeConfig.loadingText);      this.add(this._loadingItem);   }}WebFXLoadTree.prototype = new WebFXTree;

The constructor is fairly straight forward and does not do much. Notice however how super is called by binding WebFXTree as a method and then calling it.

这个构造器是相当的直接, 并没有做太多事. 尽管如此请注意我们是如何将父类绑定为了一个方法然后调用它的.

Next we need to override the expand method but since we still need to be able to call the original expand method we create a new method called _webfxtree_expand that points to the function object used by WebFXTree objects. This is the standard way to access super methods but the first few times it might look a bit odd.

现在我们需要重载 expand 方法, 但是我们依然需要调用原来的 expand 方法, 因此我们创建了一个新方法_webfxtree_expand来指向WebFXTree的原来的那个 expand 方法对象. 这是个标准的调用父类的方法, 但是最初的几次看起来似乎是有点多余.

The logic in the expand method is really simple. We just check if we should start loading the xml file and then we expand it using the super expand (_webfxtree_expand) method.

expand 方法的逻辑是相当的简单. 我们只是检查是否应该开始载入 xml 文件, 然后使用父类的expand方法(_webfxtree_expand)来展开它.

// override the expand method to load the xml fileWebFXLoadTree.prototype._webfxtree_expand = WebFXTree.prototype.expand;WebFXLoadTree.prototype.expand = function() {   if (!this.loaded && !this.loading) {      // load      _startLoadXmlTree(this.src, this);   }   this._webfxtree_expand();};

WebFXLoadTreeItem

This class is too similar to WebFXLoadTree for me to be entirely comfortable. Since JavaScript does not support multiple inheritance, and I did not want to fake it using expandos, we just have to repeat the code. For everyone that are interested, the code for this can be found in xloadtree.js.

这个类和WebFXLoadTree太相似了, 对我来说是完全的相同. 因为 JavaScript 不提供多重继承, 我也不想使用 expandos 来欺骗它, 我们只是不得不重复代码. 如果您对此感兴趣, 这些代码可以在 xloadtree.js 中找到.

Loading the Tree 载入树

As you can see in the code above there is a function called _startLoadXmlTree that is called to load the actual xml file. This function uses an XmlHttp object to do the actual loading. The loading of the xml file is done asynchronously to prevent the UI to lock up while the file is being loaded and therefore we wait for the onreadystatechange event to fire before we continue. See the Xml Extras article for a more detailed description about the XmlHttp object.

你可以看到上面已经有了个方法叫 _startLoadXmlTree, 它将被用来加载实际的 xml 文件. 这个方法使用了严格 XmlHttp 对象来执行真正的加载. 对 xml 文件的载入使用了异步方式来防止文件正在读取的时候 UI 被锁定, 因此我们等待 onreadystatechange事件被触发之后才继续进行. 请阅读 Xml 增强文章 来了解关于 XmlHttp 对象的更多信息.

// creates the xmlhttp object and starts the load of the xml documentfunction _startLoadXmlTree(sSrc, jsNode) {   jsNode.loading = true;   var xmlHttp = XmlHttp.create();   xmlHttp.open("GET", sSrc, true);	// async   xmlHttp.onreadystatechange = function () {      if (xmlHttp.readyState == 4)         _xmlFileLoaded(xmlHttp.responseXML, jsNode);   };   // call in new thread to allow ui to update   window.setTimeout(function () {      xmlHttp.send(null);   }, 10);}

Once the xml file has finished loading we call the function _xmlFileLoaded. This function checks that we got an xml document back and if we did it goes through the document and recursively converts the xml elements to js WebFXTreeItem and inserts them. Once the xml elements have been converted and inserted we remove the dummy tree item that was only used to show that we were loading the contents.

一旦 xml 文件加载完毕, 我们调用方法 _xmlFileLoaded. 这个方法检查我们得到的 xml 文件, 如果得到了文件内容我们将递归转换 xml 元素到 js 的 WebFXTreeItem 对象, 然后添加他们. 一旦 xml 元素转换并添加完毕, 我们将删除那个临时的只不过是用来显示正在加载内容的树节点.

// Inserts an xml document as a subtree to the provided nodefunction _xmlFileLoaded(oXmlDoc, jsParentNode) {   var bIndent = false;   var bAnyChildren = false;   jsParentNode.loaded = true;   jsParentNode.loading = false;   // check that the load of the xml file went well   if( oXmlDoc == null || oXmlDoc.documentElement == null) {      jsParentNode.errorText = parseTemplateString(webFXTreeConfig.loadErrorTextTemplate,                                                   jsParentNode.src);   }   else {      // there is one extra level of tree elements      var root = oXmlDoc.documentElement;      // loop through all tree children      var cs = root.childNodes;      var l = cs.length;      for (var i = 0; i < l; i++) {         if (cs[i].tagName == "tree") {            bAnyChildren = true;            bIndent = true;            jsParentNode.add( _xmlTreeToJsTree(cs[i]), true);         }      }      // if no children we got an error      if (!bAnyChildren)         jsParentNode.errorText = parseTemplateString(webFXTreeConfig.emptyErrorTextTemplate,                                                      jsParentNode.src);   }   // remove dummy   if (jsParentNode._loadingItem != null) {      jsParentNode._loadingItem.remove();      bIndent = true;   }   if (bIndent) {      // indent now that all items are added      jsParentNode.indent();   }   // show error in status bar   if (jsParentNode.errorText != "")      window.status = jsParentNode.errorText;}

A few more things happen in this function but nothing really important. There is some code that checks the errors and a few properties are set to reflect the state of the WebFXLoadTree or WebFXLoadTreeItem object.

其它一些这个方法中发生更多的事情并不是很重要. 有一些代码来检查错误, 一些属性被设置, 来显示 WebFXLoadTreeWebFXLoadTreeItem 的状态.

Converting the Xml 转换 Xml

The only important thing left to do is to convert the xml tree item to a js WebFXTreeItem. This is done in the function _xmlTreeToJsTree. Here we retreive the xml attributes and if there was a src attribute defined we create a new WebFXLoadTreeItem and otherwise a WebFXTreeItem. Once that is created we go through all the childNodes of the xml node and convert and add those as well.

剩下的唯一要做的重要的事情就是转换 xml 树节点为 js WebFXTreeItem 对象. 这在方法 _xmlTreeToJsTree 中完成. 在这里读取 xml 属性值, 如果有 src 属性我们就创建一个 WebFXLoadTreeItem 对象, 否则就创建 WebFXTreeItem. 一旦创建完成, 我们就遍历所有 xml 节点的 childNodes, 转换并添加他们.

// Converts an xml tree to a js tree. See article about xml tree formatfunction _xmlTreeToJsTree(oNode) {	// retreive attributes   var text = oNode.getAttribute("text");   var action = oNode.getAttribute("action");   var parent = null;   var icon = oNode.getAttribute("icon");   var openIcon = oNode.getAttribute("openIcon");   var src = oNode.getAttribute("src");   // create jsNode   var jsNode;   if (src != null && src != "")      jsNode = new WebFXLoadTreeItem(text, src, action, parent, icon, openIcon);   else      jsNode = new WebFXTreeItem(text, action, parent, icon, openIcon);   // go through childNOdes   var cs = oNode.childNodes;   var l = cs.length;   for (var i = 0; i < l; i++) {      if (cs[i].tagName == "tree")         jsNode.add( _xmlTreeToJsTree(cs[i]), true );   }   return jsNode;}

介绍
使用说明
API
实现
演示
下载

作者: Erik Arvidsson
中文翻译: BeanSoft

<!----> 

 

分享到:
评论
1 楼 daoger 2007-05-22  
怀疑是转载!

相关推荐

    级联H桥SVG无功补偿系统在不平衡电网中的三层控制策略:电压电流双闭环PI控制、相间与相内电压均衡管理,级联H桥SVG无功补偿系统在不平衡电网中的三层控制策略:电压电流双闭环PI控制、相间与相内电压均

    级联H桥SVG无功补偿系统在不平衡电网中的三层控制策略:电压电流双闭环PI控制、相间与相内电压均衡管理,级联H桥SVG无功补偿系统在不平衡电网中的三层控制策略:电压电流双闭环PI控制、相间与相内电压均衡管理,不平衡电网下的svg无功补偿,级联H桥svg无功补偿statcom,采用三层控制策略。 (1)第一层采用电压电流双闭环pi控制,电压电流正负序分离,电压外环通过产生基波正序有功电流三相所有H桥模块直流侧平均电压恒定,电流内环采用前馈解耦控制; (2)第二层相间电压均衡控制,注入零序电压,控制通过注入零序电压维持相间电压平衡; (3)第三层相内电压均衡控制,使其所有子模块吸收的有功功率与其损耗补,从而保证所有H桥子模块直流侧电压值等于给定值。 有参考资料。 639,核心关键词: 1. 不平衡电网下的SVG无功补偿 2. 级联H桥SVG无功补偿STATCOM 3. 三层控制策略 4. 电压电流双闭环PI控制 5. 电压电流正负序分离 6. 直流侧平均电压恒定 7. 前馈解耦控制 8. 相间电压均衡控制 9. 零序电压注入 10. 相内电压均衡控制 以上十个关键词用分号分隔的格式为:不

    GTX 1080 PCB图纸

    GTX 1080 PCB图纸,内含图纸查看软件

    深度优化与应用:提升DeepSeek润色指令的有效性和灵活性指南

    内容概要:本文档详细介绍了利用 DeepSeek 进行文本润色和问答交互时提高效果的方法和技巧,涵盖了从明确需求、提供适当上下文到尝试开放式问题以及多轮对话的十个要点。每一部分内容都提供了具体的示范案例,如指定回答格式、分步骤提问等具体实例,旨在指导用户更好地理解和运用 DeepSeek 提升工作效率和交流质量。同时文中还强调了根据不同应用场景调整提示词语气和风格的重要性和方法。 适用人群:适用于希望通过优化提问技巧以获得高质量反馈的企业员工、科研人员以及一般公众。 使用场景及目标:本文针对所有期望提高 DeepSeek 使用效率的人群,帮助他们在日常工作中快速获取精准的答案或信息,特别是在撰写报告、研究材料准备和技术咨询等方面。此外还鼓励用户通过不断尝试不同形式的问题表述来进行有效沟通。 其他说明:该文档不仅关注实际操作指引,同样重视用户思维模式转变——由简单索取答案向引导 AI 辅助创造性解决问题的方向发展。

    基于FPGA与W5500实现的TCP网络通信测试平台开发-Zynq扩展口Verilog编程实践,基于FPGA与W5500芯片的TCP网络通信测试及多路Socket实现基于zynq开发平台和Vivad

    基于FPGA与W5500实现的TCP网络通信测试平台开发——Zynq扩展口Verilog编程实践,基于FPGA与W5500芯片的TCP网络通信测试及多路Socket实现基于zynq开发平台和Vivado 2019软件的扩展开发,基于FPGA和W5500的TCP网络通信 测试平台 zynq扩展口开发 软件平台 vivado2019.2,纯Verilog可移植 测试环境 压力测试 cmd命令下ping电脑ip,同时采用上位机进行10ms发包回环测试,不丢包(内部数据回环,需要时间处理) 目前实现单socket功能,多路可支持 ,基于FPGA; W5500; TCP网络通信; Zynq扩展口开发; 纯Verilog可移植; 测试平台; 压力测试; 10ms发包回环测试; 单socket功能; 多路支持。,基于FPGA与W5500的Zynq扩展口TCP通信测试:可移植Verilog实现的高效网络通信

    Labview液压比例阀伺服阀试验台多功能程序:PLC通讯、液压动画模拟、手动控制与调试、传感器标定、报警及记录、自动实验、数据处理与查询存储,报表生成与打印一体化解决方案 ,Labview液压比例阀

    Labview液压比例阀伺服阀试验台多功能程序:PLC通讯、液压动画模拟、手动控制与调试、传感器标定、报警及记录、自动实验、数据处理与查询存储,报表生成与打印一体化解决方案。,Labview液压比例阀伺服阀试验台多功能程序:PLC通讯、液压动画模拟、手动控制与调试、传感器标定、报警管理及实验自动化,labview液压比例阀伺服阀试验台程序:功能包括,同PLC通讯程序,液压动画,手动控制及调试,传感器标定,报警设置及报警记录,自动实验,数据处理曲线处理,数据库存储及查询,报表自动生成及打印,扫码枪扫码及信号录入等~ ,核心关键词:PLC通讯; 液压动画; 手动控制及调试; 传感器标定; 报警设置及记录; 自动实验; 数据处理及曲线处理; 数据库存储及查询; 报表生成及打印; 扫码枪扫码。,Labview驱动的智能液压阀测试系统:多功能控制与数据处理

    华为、腾讯、万科员工职业发展体系建设与实践.pptx

    华为、腾讯、万科员工职业发展体系建设与实践.pptx

    基于遗传算法的柔性车间调度优化 附Matlab代码.rar

    1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

    电网不对称故障下VSG峰值电流限制的柔性控制策略:实现电流平衡与功率容量的优化利用,电网不对称故障下VSG峰值电流限制的柔性控制策略:兼顾平衡电流与功率控制切换的动态管理,电网不对称故障下VSG峰值电

    电网不对称故障下VSG峰值电流限制的柔性控制策略:实现电流平衡与功率容量的优化利用,电网不对称故障下VSG峰值电流限制的柔性控制策略:兼顾平衡电流与功率控制切换的动态管理,电网不对称故障下VSG峰值电流限制的柔性不平衡控制(文章完全复现)。 提出一种在不平衡运行条件下具有峰值电流限制的可变不平衡电流控制方法,可灵活地满足不同操作需求,包括电流平衡、有功或无功恒定运行(即电流控制、有功控制或无功控制之间的相互切),注入电流保持在安全值内,以更好的利用VSG功率容量。 关键词:VSG、平衡电流控制、有功功率控制、无功功率控制。 ,VSG; 峰值电流限制; 柔性不平衡控制; 电流平衡控制; 有功功率控制; 无功功率控制。,VSG柔性控制:在电网不对称故障下的峰值电流限制与平衡管理

    libpinyin-tools-0.9.93-4.el7.x64-86.rpm.tar.gz

    1、文件内容:libpinyin-tools-0.9.93-4.el7.rpm以及相关依赖 2、文件形式:tar.gz压缩包 3、安装指令: #Step1、解压 tar -zxvf /mnt/data/output/libpinyin-tools-0.9.93-4.el7.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm 4、更多资源/技术支持:公众号禅静编程坊

    机器学习(预测模型):动漫《龙珠》相关的数据集

    数据集是一个以经典动漫《龙珠》为主题的多维度数据集,广泛应用于数据分析、机器学习和图像识别等领域。该数据集由多个来源整合而成,涵盖了角色信息、战斗力、剧情片段、台词以及角色图像等多个方面。数据集的核心内容包括: 角色信息:包含《龙珠》系列中的主要角色及其属性,如名称、种族、所属系列(如《龙珠》《龙珠Z》《龙珠超》等)、战斗力等级等。 图像数据:提供角色的图像资源,可用于图像分类和角色识别任务。这些图像来自动画剧集、漫画和相关衍生作品。 剧情与台词:部分数据集还包含角色在不同故事中的台词和剧情片段,可用于文本分析和自然语言处理任务。 战斗数据:记录角色在不同剧情中的战斗力变化和战斗历史,为研究角色成长和剧情发展提供支持。 数据集特点 多样性:数据集整合了角色、图像、文本等多种类型的数据,适用于多种研究场景。 深度:不仅包含角色的基本信息,还涵盖了角色的成长历程、技能描述和与其他角色的互动关系。 实用性:支持多种编程语言(如Python、R)的数据处理和分析,提供了详细的文档和示例代码。

    基于protues仿真的多功公交站播报系统设计(仿真图、源代码)

    基于protues仿真的多功公交站播报系统设计(仿真图、源代码) 该设计为基于protues仿真的多功公交站播报系统,实现温度显示、时间显示、和系统公交站播报功能; 具体功能如下: 1、系统使用51单片机为核心设计; 2、时钟芯片进行时间和日期显示; 3、温度传感器进行温度读取; 4、LCD12864液晶屏进行相关显示; 5、按键设置调节时间; 6、按键设置报站; 7、仿真图、源代码; 操作说明: 1、下行控制报站:首先按下(下行设置按键),(下行指示灯)亮,然后按下(手动播报)按键控制播报下一站; 2、上行控制报站:首先按上(上行设置按键),(上行指示灯)亮,然后按下(手动播报)按键控制播报下一站; 3、按下关闭播报按键,则关闭播报功能和清除显示

    基于微信小程序的琴房管理系统的设计与实现.zip

    采用Java后台技术和MySQL数据库,在前台界面为提升用户体验,使用Jquery、Ajax、CSS等技术进行布局。 系统包括两类用户:学生、管理员。 学生用户 学生用户只要实现了前台信息的查看,打开首页,查看网站介绍、琴房信息、在线留言、轮播图信息公告等,通过点击首页的菜单跳转到对应的功能页面菜单,包括网站首页、琴房信息、注册登录、个人中心、后台登录。 学生用户通过账户账号登录,登录后具有所有的操作权限,如果没有登录,不能在线预约。学生用户退出系统将注销个人的登录信息。 管理员通过后台的登录页面,选择管理员权限后进行登录,管理员的权限包括轮播公告管理、老师学生信息管理和信息审核管理,管理员管理后点击退出,注销登录信息。 管理员用户具有在线交流的管理,琴房信息管理、琴房预约管理。 在线交流是对前台用户留言内容进行管理,删除留言信息,查看留言信息。

    界面GUI设计MATLAB教室人数统计.zip

    MATLAB可以用于开发人脸识别考勤系统。下面是一个简单的示例流程: 1. 数据采集:首先收集员工的人脸图像作为训练数据集。可以要求员工提供多张照片以获得更好的训练效果。 2. 图像预处理:使用MATLAB的图像处理工具对采集到的人脸图像进行预处理,例如灰度化、裁剪、缩放等操作。 3. 特征提取:利用MATLAB的人脸识别工具包,如Face Recognition Toolbox,对处理后的图像提取人脸特征,常用的方法包括主成分分析(PCA)和线性判别分析(LDA)等。 4. 训练模型:使用已提取的人脸特征数据集训练人脸识别模型,可以选择支持向量机(SVM)、卷积神经网络(CNN)等算法。 5. 考勤系统:在员工打卡时,将摄像头捕获的人脸图像输入到训练好的模型中进行识别,匹配员工信息并记录考勤数据。 6. 结果反馈:根据识别结果,可以自动生成考勤报表或者实时显示员工打卡情况。 以上只是一个简单的步骤,实际开发过程中需根据具体需求和系统规模进行定制和优化。MATLAB提供了丰富的图像处理和机器学习工具,是开发人脸识别考勤系统的一个很好选择。

    hjbvbnvhjhjg

    hjbvbnvhjhjg

    HCIP、软考相关学习PPT

    HCIP、软考相关学习PPT提供下载

    绿豆BOX UI8版:反编译版六个全新UI+最新后台直播管理源码

    绿豆BOX UI8版:反编译版六个全新UI+最新后台直播管理源码 最新绿豆BOX反编译版六个UI全新绿豆盒子UI8版本 最新后台支持直播管理 作为UI6的升级版,UI8不仅修复了前一版本中存在的一些BUG,还提供了6套不同的UI界面供用户选择,该版本有以下特色功能: 在线管理TVBOX解析 在线自定义TVBOX 首页布局批量添加会员信息 并支持导出批量生成卡密 并支持导出直播列表管理功能

    vue3的一些语法以及知识点

    vue3的一些语法以及知识点

    西门子大型Fanuc机器人汽车焊装自动生产线程序经典解析:PLC博图编程与MES系统通讯实战指南,西门子PLC博图汽车焊装自动生产线FANUC机器人程序经典结构解析与MES系统通讯,西门子1500 大

    西门子大型Fanuc机器人汽车焊装自动生产线程序经典解析:PLC博图编程与MES系统通讯实战指南,西门子PLC博图汽车焊装自动生产线FANUC机器人程序经典结构解析与MES系统通讯,西门子1500 大型程序fanuc 机器人汽车焊装自动生产线程序 MES 系统通讯 大型程序fanuc机器人汽车焊装自动生产线程序程序经典结构清晰,SCL算法堆栈,梯形图和 SCL混编使用博图 V14以上版本打开 包括: 1、 PLC 博图程序 2 触摸屏程序 ,西门子1500; 大型程序; fanuc机器人; 汽车焊装自动生产线; MES系统通讯; SCL算法; 梯形图; SCL混编; 博图V14以上版本。,西门子博图大型程序:汽车焊装自动生产线MES系统通讯与机器人控制

    DeepSeek:从入门到精通

    DeepSeek:从入门到精通

    计及信息间隙决策与多能转换的综合能源系统优化调度模型:实现碳经济最大化与源荷不确定性考量,基于信息间隙决策与多能转换的综合能源系统优化调度模型:源荷不确定性下的高效碳经济调度策略,计及信息间隙决策及多

    计及信息间隙决策与多能转换的综合能源系统优化调度模型:实现碳经济最大化与源荷不确定性考量,基于信息间隙决策与多能转换的综合能源系统优化调度模型:源荷不确定性下的高效碳经济调度策略,计及信息间隙决策及多能转的综合能源系统优化调度 本代码构建了含风电、光伏、光热发电系统、燃气轮机、燃气锅炉、电锅炉、储气、储电、储碳、碳捕集装置的综合能源系统优化调度模型,并考虑P2G装置与碳捕集装置联合运行,从而实现碳经济的最大化,最重要的是本文引入了信息间隙决策理论考虑了源荷的不确定性(本代码的重点)与店铺的47代码形成鲜明的对比,注意擦亮眼睛,认准原创,该代码非常适合修改创新,,提供相关的模型资料 ,计及信息间隙决策; 综合能源系统; 优化调度; 多能转换; 碳经济最大化; 风电; 光伏; 燃气轮机; 储气; 储电; 储碳; 碳捕集装置; P2G装置联合运行; 模型资料,综合能源系统优化调度模型:基于信息间隙决策和多能转换的原创方案

Global site tag (gtag.js) - Google Analytics