`
dragon0929
  • 浏览: 78304 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

Smart GWT Sample (Form)

阅读更多

Form Validate; Form Field display&hide; input field filter; input field mask;Select box联动;

定制Validator;扩展DataSource Field Type;multiple forms

 

1. Form Validate

 

       private Widget validateTest() {
             DataSource dataSource = new DataSource();
             DataSourceTextField firstNameField = new DataSourceTextField("firstName", "First Name", 50, true);   
             DataSourceTextField lastNameField = new DataSourceTextField("lastName", "Last Name", 50, true);   
             DataSourceTextField emailField = new DataSourceTextField("email", "Email", 100, true);   
       
             RegExpValidator emailValidator = new RegExpValidator();   
             emailValidator.setErrorMessage("Invalid email address");   
             emailValidator.setExpression("^([a-zA-Z0-9_.\\-+])+@(([a-zA-Z0-9\\-])+\\.)+[a-zA-Z0-9]{2,4}$");   
                
             emailField.setValidators(emailValidator);   
             
            MaskValidator maskValidator = new MaskValidator();   
            maskValidator.setMask("^\\s*(1?)\\s*\\(?\\s*(\\d{3})\\s*\\)?\\s*-?\\s*(\\d{3})\\s*-?\\s*(\\d{4})\\s*$");   
            maskValidator.setTransformTo("$1($2) $3 - $4");   
               
            DataSourceTextField phoneField = new DataSourceTextField("phone");   
            phoneField.setTitle("Phone");   
            phoneField.setValidators(maskValidator);

 

            DataSourceIntegerField dsIntegerField = new DataSourceIntegerField("intField");  
            dsIntegerField.setTitle("Integer");
            
            DataSourcePasswordField passwordField = new DataSourcePasswordField("password", "Password", 20, true);    
            
            dataSource.setFields(firstNameField, lastNameField, emailField, phoneField, dsIntegerField, passwordField);
            
            final DynamicForm form = new DynamicForm();   
            form.setWidth(300);   
            form.setDataSource(dataSource);   
            form.setUseAllDataSourceFields(true);   
            
            HeaderItem header = new HeaderItem();   
            header.setDefaultValue("Registration Form");   
            PasswordItem passwordItem = new PasswordItem();   
            passwordItem.setName("password");   
            PasswordItem passwordItem2 = new PasswordItem();   
            passwordItem2.setName("password2");   
            passwordItem2.setTitle("Password Again");   
            passwordItem2.setRequired(true);   
            passwordItem2.setLength(20);   
            MatchesFieldValidator matchesValidator = new MatchesFieldValidator();   
            matchesValidator.setOtherField("password");   
            matchesValidator.setErrorMessage("Passwords do not match");           
            passwordItem2.setValidators(matchesValidator);   
      
            CheckboxItem acceptItem = new CheckboxItem();   
            acceptItem.setName("acceptTerms");   
            acceptItem.setTitle("I accept the terms of use.");   
            acceptItem.setWidth(150);   
      
            ButtonItem validateItem = new ButtonItem();   
            validateItem.setTitle("Validate");   
            validateItem.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {   
                public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {   
                    form.validate(false);  // 不验证hidden item(如伸展状态的section中的item);默认为false.
                }   
            });  
            
            form.setFields(header, passwordItem, passwordItem2, acceptItem, validateItem);   
            form.setValue("firstName", "Bob");   
            form.setValue("email", "bob@.com");   
            form.setValue("password", "sekrit");   
            form.setValue("password2", "fatfinger");   

            return form;

        }

 1)form.setUseAllDataSourceFields(true); 这行必须得有,我一开始没有设置,dataSource.setFields(), 绑定的字段,全部不显示,但是如果不和form.setFields() 同时使用,则没有这个现象。

2)dataSource.setFields()和 form.setFields() 中的password item似乎重复,我试着去掉其中的一个,  form 的 layout出现混乱,dataSource.setFields()和 form.setFields() 绑定的字段自动分成两组。另外就是dataSource.setFields() 中的passwordField 必须放在最后面,否则其的后面的fields会次序混乱。

 

关于上面两个问题,我查看了setUseAllDataSourceFields 的javadoc,看了半天,还是不太明白,以后慢慢研究。

If true, the set of fields given by the "default binding" (see DataBoundComponent.fields) is used, with any  fields specified in component.fields acting as overrides that can suppress or modify the display of individual fields, without having to list the entire set of fields that should be shown.
       If component.fields contains fields that are not found in the DataSource, they will be shown after the most recently referred to DataSource field. If the new fields appear first, they will be shown first.

 

 

2. 动态刷新form component

 

  CheckboxItem checkboxItem = new CheckboxItem();  
            checkboxItem.setTitle("display combobox");
            checkboxItem.setName("disCombox");
            checkboxItem.setValue(false);
            checkboxItem.setRedrawOnChange(true);

              
            ComboBoxItem cbItem = new ComboBoxItem();  
            cbItem.setTitle("Select");  
            cbItem.setHint("<nobr>A simple combobox</nobr>");  
            cbItem.setValueMap("Cat", "Dog", "Giraffe", "Goat", "Marmoset", "Mouse");
            cbItem.setVisible(false);
            cbItem.setShowIfCondition(new FormItemIfFunction() {  
                public boolean execute(FormItem item, Object value, DynamicForm form) {  
                    return (Boolean)form.getValue("disCombox");
                }  
            }); 

  click 'checkboxItem' to display or hide  'cbItem'

 

1)checkboxItem.setValue(false); 必须设置初始值,否则return (Boolean)form.getValue("disCombox"); 这一行会报null exception;

2) checkboxItem.setRedrawOnChange(true); 这行是关键,目的是改变这个元素的值,会刷新form;

   (javadoc: Setting to true causes the FormItem to be immediately redrawn with the new properties
      when its value changes)

 

还有一种改变form field显示状态的方法,如下:

 

CheckboxItem acceptItem = new CheckboxItem();  
            acceptItem.setName("acceptTerms");  
            acceptItem.setTitle("I accept the terms of use.");  
            acceptItem.setWidth(150);  
     
            final ButtonItem validateItem = new ButtonItem();  
            validateItem.setTitle("Validate");  
            validateItem.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {  
                public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {  
                    form.validate(false);  
                }  
            }); 
           
            acceptItem.addChangeHandler(new ChangeHandler() {  
                public void onChange(ChangeEvent event) {  
                    validateItem.setDisabled(!((Boolean) event.getValue()));  
                }  
            });

 

3.为输入框添加过滤器

   private Widget filterTest() {
            DataSource dataSource = new DataSource();
            DataSourceTextField firstNameField = new DataSourceTextField("firstName", "First Name", 50, true);  
            firstNameField.setAttribute("hint", "<nobr>Mapped to uppercase</nobr>");
            firstNameField.setAttribute("characterCasing", CharacterCasing.UPPER);

            dataSource.setFields(firstNameField);
           
            DynamicForm form = new DynamicForm();
            form.setDataSource(dataSource);
            form.setUseAllDataSourceFields(true);
           
            TextItem nameField = new TextItem("name", "Name");  
            nameField.setWidth(200);  
             nameField.setHint("Mapped to uppercase");  
            nameField.setCharacterCasing(CharacterCasing.UPPER);  

     
            TextItem commisionField = new TextItem("commission", "Commission");  
            commisionField.setWidth(100);  
            commisionField.setHint("Numeric only<br>[0-9.]");          
            commisionField.setKeyPressFilter("[0-9.]");  
     
            form.setFields(nameField, commisionField);
           
            return form;
        } 

    Note: 注意DataSource Field 设置property value的方式。

 

4.为输入框添加mask

    private Widget mastTest() {  
            DynamicForm form = new DynamicForm();  
            form.setWidth(400);  
     
            TextItem firstName = new TextItem("firstName", "First name");  
            firstName.setMask(">?<??????????????");  
            firstName.setHint("<nobr>>?<??????????????<nobr>");  
     
            TextItem lastName = new TextItem("lastName", "Last name");  
            lastName.setMask(">?<??????????????");
            lastName.setHint("<nobr>>?<??????????????<nobr>");
            TextItem stateField = new TextItem("state", "State");  
            stateField.setMask(">LL");  
            stateField.setHint("<nobr>>LL</nobr>");  
     
            TextItem phoneNumberField = new TextItem("phoneNo", "Phone No.");  
            phoneNumberField.setMask("(###) ###-####");  
            phoneNumberField.setHint("<nobr>(###) ###-####</nobr>");  
     
            DateItem dateField = new DateItem("dateItem", "Date");  
            dateField.setUseTextField(true);  
            dateField.setUseMask(true);  
     
            DateTimeItem dateTimeField = new DateTimeItem("dateTimeItem", "Date Time");  
            dateTimeField.setUseTextField(true);  
            dateTimeField.setUseMask(true);  
     
            TimeItem timeField = new TimeItem("timeItem", "Time");  
            timeField.setUseMask(true);  
     
            form.setFields(firstName, lastName, stateField, phoneNumberField, dateField, dateTimeField, timeField);  
     
            return form;
        }  

 

     效果和期望的不太一样,firstName和lastName的hint信息只显示两个符“ >? ”,而不能完全显示“>?<??????????????”,我用firebug查看源文件,也是只有这两个字符,不知道原因,以后再研究。

 

Mask Character 如下:

 

 

Character Description
0 Digit (0 through 9) or plus [+] or minus [-] signs
9 Digit or space
# Digit
L Letter (A through Z)
? Letter (A through Z) or space
A Letter or digit
a Letter or digit
C Any character or space
< Causes all characters that follow to be converted to lowercase
> Causes all characters that follow to be converted to uppercase

Any character not matching one of the above mask characters or that is escaped with a backslash (\) is considered to be a literal.

Custom mask characters can be defined by standard regular expression character set or range. For example, a hexadecimal color code mask could be:

  • Color: \#>[0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F]

 

5. Select Box 联动

 

private Widget selectRelationSelectTest() {  
             
            final DynamicForm form = new DynamicForm();  
            form.setWidth(500);  
            form.setNumCols(4);  
     
            final Map<String, String[]> departments = new HashMap<String, String[]>();  
            departments.put("Marketing", new String[]{"Advertising", "Community Relations"});  
            departments.put("Sales", new String[]{"Channel Sales", "Direct Sales"});  
            departments.put("Manufacturing", new String[]{"Design", "Development", "QA"});  
            departments.put("Services", new String[]{"Support", "Consulting"});  
     
            SelectItem divisionItem = new SelectItem();  
            divisionItem.setName("division");  
            divisionItem.setTitle("Division");  
            divisionItem.setValueMap("Marketing", "Sales", "Manufacturing", "Services");  
            divisionItem.addChangeHandler(new ChangeHandler() {  
                public void onChange(ChangeEvent event) {  
                    String selectedItem = (String) event.getValue();  
                    form.getField("department").setValueMap(departments.get(selectedItem));  
                }  
            });  
     
            SelectItem departmentItem = new SelectItem();  
            departmentItem.setName("department");  
            departmentItem.setTitle("Department");  
            departmentItem.setAddUnknownValues(false);  
     
            form.setItems(divisionItem, departmentItem);  
     
            return form;
        }  

  不知什么原因,我所有的SelectItem和combobox在chrome下都不能显示选择项,在firefox下正常,郁闷。

 

6. 定制validation

   private Widget customizeValidation() {  
             
            final DynamicForm form = new DynamicForm();  
            form.setWidth(250);  
            form.setTitleOrientation(TitleOrientation.TOP);  
     
            final RadioGroupItem radioGroupItem = new RadioGroupItem();  
            radioGroupItem.setName("willAttend");  
            radioGroupItem.setColSpan("*");  
            radioGroupItem.setRequired(true);  
            radioGroupItem.setVertical(false);  
            radioGroupItem.setValueMap("Yes", "No");  
            radioGroupItem.setRedrawOnChange(true);  
            radioGroupItem.setTitle("Will you be attending the meeting on April 4th? If no, please provide a reason");  
     
            TextItem textItem = new TextItem();  
            textItem.setName("reason");  
            textItem.setTitle("Reason");  
            RequiredIfValidator ifValidator = new RequiredIfValidator();  
            ifValidator.setExpression(new RequiredIfFunction() {  
                public boolean execute(FormItem formItem, Object value) {  
                    String valueStr = (String) radioGroupItem.getValue();  
                    return "No".equals(valueStr);  
                }  
            });  

            ifValidator.setErrorMessage("Please provide a reason");  
     
            textItem.setValidators(ifValidator);  
     
            ButtonItem buttonItem = new ButtonItem("validate", "Validate");  
            buttonItem.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {  
                public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {  
                    form.validate();  
                }  
            });  
     
            form.setFields(radioGroupItem, textItem, buttonItem);  
            return form; 
        }

 

上面的sample根据form中raio的value来定制RequiredIfValidator.

 

7.扩展DataSource的field type

 

This example demonstrates a DataSourceField that is based on a user created SimpleType . As illustrated in this sample, a user can create a reusable ZipCode SimpleType class with a regular expression based com.smartgwt.client.widgets.form.validator.Validator and then use this SimpleType in various DataSourceField definitions across their application for use with any DataBoundComponent like a ListGrid, TreeGrid, DynamicForm etc.

This is a powerful feature allows creation and reuse of domain specific "primitive" data types or types in the enterprises Common Data Model (CDM).

 

private Widget zipCodeTest() {  
             
            DataSource dataSource = new DataSource();  
     
            DataSourceField zipCodeField = new DataSourceField();  
            zipCodeField.setName("zipCode");  
            zipCodeField.setTitle("Zip Code");  
            zipCodeField.setType(new ZipCodeUSType());  
     
            dataSource.setFields(zipCodeField);  
              
            final DynamicForm boundForm = new DynamicForm();  
            boundForm.setWidth(300);  
            boundForm.setDataSource(dataSource);  
     
            IButton button = new IButton("Validate");  
            button.addClickHandler(new ClickHandler() {  
                public void onClick(ClickEvent event) {  
                    boundForm.validate();  
                }  
            });  
     
            VLayout layout = new VLayout(10);  
            layout.setMembers(boundForm, button);  
     
            return layout;
        }  
     
        public static class ZipCodeUSType extends SimpleType {  
            public ZipCodeUSType() {  
                super("zipCodeUS", FieldType.TEXT);  
     
                RegExpValidator validator = new RegExpValidator("^\\d{5}(-\\d{4})?$");  
                setValidators(validator);  
            }  
        } 

 

8. multiple forms

 

private Widget multipleForms() {  
            final ValuesManager vm = new ValuesManager();  
              
            final TabSet theTabs = new TabSet();  
            theTabs.setWidth(400);  
            theTabs.setHeight(250);  
              
            Tab item = new Tab();  
            item.setTitle("Item");  
              
            final DynamicForm form0 = new DynamicForm();  
            form0.setID("form0");  
            form0.setValuesManager(vm);  
              
            TextItem itemName = new TextItem();  
            itemName.setName("itemName");  
            itemName.setTitle("Item");  
              
            TextAreaItem description = new TextAreaItem();  
            description.setName("description");  
            description.setTitle("Description");  
              
            FloatItem price = new FloatItem();  
            price.setName("price");  
            price.setTitle("Price");  
            price.setDefaultValue("low");  
              
            form0.setFields(itemName, description, price);  
            item.setPane(form0);  
     
            Tab stock = new Tab();  
            stock.setTitle("Stock");  
              
            final DynamicForm form1 = new DynamicForm();  
            form1.setID("form1");  
            form1.setValuesManager(vm);  
              
            CheckboxItem inStock = new CheckboxItem();  
            inStock.setName("inStock");  
            inStock.setTitle("In Stock");  
              
            DateItem nextShipment = new DateItem();  
            nextShipment.setName("nextShipment");  
            nextShipment.setTitle("Next Shipment");  
            nextShipment.setUseTextField(true);  
            nextShipment.setDefaultValue(256);  
              
            form1.setFields(inStock, nextShipment);  
            stock.setPane(form1);  
              
            theTabs.setTabs(item, stock);  
              
            IButton submit = new IButton();  
            submit.setTitle("Submit");  
            submit.addClickHandler(new ClickHandler() {  
                public void onClick(ClickEvent event) {  
                    vm.setValues(new HashMap());  
                    vm.validate();  
                    if (form1.hasErrors()) {  
                        theTabs.selectTab(1);  
                    } else {  
                        theTabs.selectTab(0);  
                    }  
                }  
            });  
              
            VLayout vLayout = new VLayout();  
            vLayout.setMembersMargin(10);  
            vLayout.addMember(theTabs);  
            vLayout.addMember(submit);  
     
            return vLayout;
        } 

 

   此处的关键是ValuesManager ,下面是它的javadoc

ValuesManager

<!-- Generated by javadoc (build 1.5.0_19) on Sun Dec 13 17:34:16 EST 2009 -->

<script type="text/javascript"> function windowTitle() { parent.document.title=&quot;ValuesManager&quot;; } </script>

<noscript></noscript>

The ValuesManager manages data from multiple member forms.

If a single logical form needs to be separated into multiple DynamicForm instances for Layout purposes (for example, spanning one logical form across multiple Tabs), a ValuesManager can be used to make the forms act as one logical form, supporting all value-related APIs otherwise called on DynamicForm directly.

A ValuesManager has no visual representation - it is strictly a logical entity, and the member forms provide the user interface. You can initialize a ValuesManager with a set of member forms (by setting members at init) or add and remove member forms dynamically.

Calling setValues(java.util.Map) on a ValuesManager will automatically route new field values to whichever member form is showing an editor for that field. Likewise, calling validate() will validate all member forms, and saveData() will initiate a save operation which aggregates values from all member forms.

Like a DynamicForm, a ValuesManager can be databound by setting dataSource . In this case all member forms must also be bound to the same DataSource.

In general, when working with a ValuesManager and its member forms, call APIs on the ValuesManager whenever you are dealing with values that span multiple forms, and only call APIs on member forms that are specific to that form or its fields.

Note that, just as a DynamicForm can track values that are not shown in any FormItem, a ValuesManager may track values for which there is no FormItem in any member form. However, when using a ValuesManager these extra values are only allowed on the ValuesManager itself. Member forms will not track values for which they do not have FormItems.

分享到:
评论
1 楼 Durian 2011-03-15  
乱七八糟的

相关推荐

    一个基于Qt Creator(qt,C++)实现中国象棋人机对战

    qt 一个基于Qt Creator(qt,C++)实现中国象棋人机对战.

    热带雨林自驾游自然奇观探索.doc

    热带雨林自驾游自然奇观探索

    冰川湖自驾游冰雪交融景象.doc

    冰川湖自驾游冰雪交融景象

    C51 单片机数码管使用 Keil项目C语言源码

    C51 单片机数码管使用 Keil项目C语言源码

    基于智能算法的无人机路径规划研究 附Matlab代码.rar

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

    前端分析-2023071100789s12

    前端分析-2023071100789s12

    Delphi 12.3控件之Laz-制作了一些窗体和对话框样式.7z

    Laz_制作了一些窗体和对话框样式.7z

    ocaml-docs-4.05.0-6.el7.x64-86.rpm.tar.gz

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

    学习笔记-沁恒第六讲-米醋

    学习笔记-沁恒第六讲-米醋

    工业机器人技术讲解【36页】.pptx

    工业机器人技术讲解【36页】

    基于CentOS 7和Docker环境下安装和配置Elasticsearch数据库

    内容概要:本文档详细介绍了在 CentOS 7 上利用 Docker 容器化环境来部署和配置 Elasticsearch 数据库的过程。首先概述了 Elasticsearch 的特点及其主要应用场景如全文检索、日志和数据分析等,并强调了其分布式架构带来的高性能与可扩展性。之后针对具体的安装流程进行了讲解,涉及创建所需的工作目录,准备docker-compose.yml文件以及通过docker-compose工具自动化完成镜像下载和服务启动的一系列命令;同时对可能出现的问题提供了应对策略并附带解决了分词功能出现的问题。 适合人群:从事IT运维工作的技术人员或对NoSQL数据库感兴趣的开发者。 使用场景及目标:该教程旨在帮助读者掌握如何在一个Linux系统中使用现代化的应用交付方式搭建企业级搜索引擎解决方案,特别适用于希望深入了解Elastic Stack生态体系的个人研究与团队项目实践中。 阅读建议:建议按照文中给出的具体步骤进行实验验证,尤其是要注意调整相关参数配置适配自身环境。对于初次接触此话题的朋友来说,应该提前熟悉一下Linux操作系统的基础命令行知识和Docker的相关基础知识

    基于CNN和FNN的进化神经元模型的快速响应尖峰神经网络 附Matlab代码.rar

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

    网络小说的类型创新、情节设计与角色塑造.doc

    网络小说的类型创新、情节设计与角色塑造

    毕业设计-基于springboot+vue开发的学生考勤管理系统【源码+sql+可运行】50311.zip

    毕业设计_基于springboot+vue开发的学生考勤管理系统【源码+sql+可运行】【50311】.zip 全部代码均可运行,亲测可用,尽我所能,为你服务; 1.代码压缩包内容 代码:springboo后端代码+vue前端页面代码 脚本:数据库SQL脚本 效果图:运行结果请看资源详情效果图 2.环境准备: - JDK1.8+ - maven3.6+ - nodejs14+ - mysql5.6+ - redis 3.技术栈 - 后台:springboot+mybatisPlus+Shiro - 前台:vue+iview+Vuex+Axios - 开发工具: idea、navicate 4.功能列表 - 系统设置:用户管理、角色管理、资源管理、系统日志 - 业务管理:班级信息、学生信息、课程信息、考勤记录、假期信息、公告信息 3.运行步骤: 步骤一:修改数据库连接信息(ip、port修改) 步骤二:找到启动类xxxApplication启动 4.若不会,可私信博主!!!

    57页-智慧办公园区智能化设计方案.pdf

    在智慧城市建设的大潮中,智慧园区作为其中的璀璨明珠,正以其独特的魅力引领着产业园区的新一轮变革。想象一下,一个集绿色、高端、智能、创新于一体的未来园区,它不仅融合了科技研发、商业居住、办公文创等多种功能,更通过深度应用信息技术,实现了从传统到智慧的华丽转身。 智慧园区通过“四化”建设——即园区运营精细化、园区体验智能化、园区服务专业化和园区设施信息化,彻底颠覆了传统园区的管理模式。在这里,基础设施的数据收集与分析让管理变得更加主动和高效,从温湿度监控到烟雾报警,从消防水箱液位监测到消防栓防盗水装置,每一处细节都彰显着智能的力量。而远程抄表、空调和变配电的智能化管控,更是在节能降耗的同时,极大地提升了园区的运维效率。更令人兴奋的是,通过智慧监控、人流统计和自动访客系统等高科技手段,园区的安全防范能力得到了质的飞跃,让每一位入驻企业和个人都能享受到“拎包入住”般的便捷与安心。 更令人瞩目的是,智慧园区还构建了集信息服务、企业服务、物业服务于一体的综合服务体系。无论是通过园区门户进行信息查询、投诉反馈,还是享受便捷的电商服务、法律咨询和融资支持,亦或是利用云ERP和云OA系统提升企业的管理水平和运营效率,智慧园区都以其全面、专业、高效的服务,为企业的发展插上了腾飞的翅膀。而这一切的背后,是大数据、云计算、人工智能等前沿技术的深度融合与应用,它们如同智慧的大脑,让园区的管理和服务变得更加聪明、更加贴心。走进智慧园区,就像踏入了一个充满无限可能的未来世界,这里不仅有科技的魅力,更有生活的温度,让人不禁对未来充满了无限的憧憬与期待。

    一种欠定盲源分离方法及其在模态识别中的应用 附Matlab代码.rar

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

    Matlab实现基于BO贝叶斯优化Transformer结合GRU门控循环单元时间序列预测的详细项目实例(含完整的程序,GUI设计和代码详解)

    内容概要:本文介绍了使用 Matlab 实现基于 BO(贝叶斯优化)的 Transformer 结合 GRU 门控循环单元时间序列预测的具体项目案例。文章首先介绍了时间序列预测的重要性及其现有方法存在的限制,随后深入阐述了该项目的目标、挑战与特色。重点描述了项目中采用的技术手段——结合 Transformer 和 GRU 模型的优点,通过贝叶斯优化进行超参数调整。文中给出了模型的具体实现步骤、代码示例以及完整的项目流程。同时强调了数据预处理、特征提取、窗口化分割、超参数搜索等关键技术点,并讨论了系统的设计部署细节、可视化界面制作等内容。 适合人群:具有一定机器学习基础,尤其是熟悉时间序列预测与深度学习的科研工作者或从业者。 使用场景及目标:适用于金融、医疗、能源等多个行业的高精度时间序列预测。该模型可通过捕捉长时间跨度下的复杂模式,提供更为精准的趋势预判,辅助相关机构作出合理的前瞻规划。 其他说明:此项目还涵盖了从数据采集到模型发布的全流程讲解,以及GUI图形用户界面的设计实现,有助于用户友好性提升和技术应用落地。此外,文档包含了详尽的操作指南和丰富的附录资料,包括完整的程序清单、性能评价指标等,便于读者动手实践。

    漫画与青少年教育关系.doc

    漫画与青少年教育关系

    励志图书的成功案例分享、人生智慧提炼与自我提升策略.doc

    励志图书的成功案例分享、人生智慧提炼与自我提升策略

    人工智能在食品安全与检测中的应用.doc

    人工智能在食品安全与检测中的应用

Global site tag (gtag.js) - Google Analytics