当前位置: 首页 > news >正文

响应式网站素材岳阳网站建设收费标准

响应式网站素材,岳阳网站建设收费标准,摄影网课,做直播网站软件有哪些软件下载Bumblebee/Components/Analysis/GH_Ex_Ana_CondAverage.cs 这段代码定义了一个名为 GH_Ex_Ana_CondAverage 的类#xff0c;它是一个 Grasshopper 组件。这个组件的主要功能是为 Excel 工作表中的一个范围添加基于平均值的’条件格式’。以下是对这个组件的功能和特点的详细介…Bumblebee/Components/Analysis/GH_Ex_Ana_CondAverage.cs 这段代码定义了一个名为 GH_Ex_Ana_CondAverage 的类它是一个 Grasshopper 组件。这个组件的主要功能是为 Excel 工作表中的一个范围添加基于平均值的’条件格式’。以下是对这个组件的功能和特点的详细介绍 组件名称和描述 名称Conditional Average条件平均值描述基于值的平均值为 Excel 范围添加条件格式 输入参数 Worksheet工作表Range范围Type条件类型定义如何应用条件格式例如高于平均值、低于平均值等Cell Color单元格颜色用于高亮显示的颜色Clear清除是否清除现有的条件格式Activate激活是否应用新的条件格式 输出 处理后的 Range 对象 主要功能 获取指定的 Excel 工作表和范围根据用户输入的条件类型和颜色为指定范围添加基于平均值的条件格式可以选择性地清除现有的条件格式只有在 Activate 参数为 true 时才执行操作 特殊特性 使用枚举类型 AverageCondition 来定义不同的条件类型组件的暴露级别设置为次要secondary包含自定义图标 集成性 这个组件是一个更大的系统 Bumblebee的一部分专门用于在 Grasshopper 中处理 Excel 数据 总的来说这个组件提供了一种在 Grasshopper 环境中直接操作 Excel 数据的方法特别是添加基于平均值的条件格式。这对于需要在参数化设计过程中分析和可视化 Excel 数据的用户来说非常有用。它简化了 Excel 数据处理的流程使用户能够直接在 Grasshopper 中完成通常需要在 Excel 中手动执行的操作。 #mermaid-svg-0Zs2qReKNm2gKwSS {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-0Zs2qReKNm2gKwSS .error-icon{fill:#552222;}#mermaid-svg-0Zs2qReKNm2gKwSS .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-0Zs2qReKNm2gKwSS .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-0Zs2qReKNm2gKwSS .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-0Zs2qReKNm2gKwSS .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-0Zs2qReKNm2gKwSS .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-0Zs2qReKNm2gKwSS .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-0Zs2qReKNm2gKwSS .marker{fill:#333333;stroke:#333333;}#mermaid-svg-0Zs2qReKNm2gKwSS .marker.cross{stroke:#333333;}#mermaid-svg-0Zs2qReKNm2gKwSS svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-0Zs2qReKNm2gKwSS .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-0Zs2qReKNm2gKwSS .cluster-label text{fill:#333;}#mermaid-svg-0Zs2qReKNm2gKwSS .cluster-label span{color:#333;}#mermaid-svg-0Zs2qReKNm2gKwSS .label text,#mermaid-svg-0Zs2qReKNm2gKwSS span{fill:#333;color:#333;}#mermaid-svg-0Zs2qReKNm2gKwSS .node rect,#mermaid-svg-0Zs2qReKNm2gKwSS .node circle,#mermaid-svg-0Zs2qReKNm2gKwSS .node ellipse,#mermaid-svg-0Zs2qReKNm2gKwSS .node polygon,#mermaid-svg-0Zs2qReKNm2gKwSS .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-0Zs2qReKNm2gKwSS .node .label{text-align:center;}#mermaid-svg-0Zs2qReKNm2gKwSS .node.clickable{cursor:pointer;}#mermaid-svg-0Zs2qReKNm2gKwSS .arrowheadPath{fill:#333333;}#mermaid-svg-0Zs2qReKNm2gKwSS .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-0Zs2qReKNm2gKwSS .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-0Zs2qReKNm2gKwSS .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid-svg-0Zs2qReKNm2gKwSS .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid-svg-0Zs2qReKNm2gKwSS .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-0Zs2qReKNm2gKwSS .cluster text{fill:#333;}#mermaid-svg-0Zs2qReKNm2gKwSS .cluster span{color:#333;}#mermaid-svg-0Zs2qReKNm2gKwSS div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-0Zs2qReKNm2gKwSS :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} Yes / 是 Yes / 是 No / 否 No / 否 Start / 开始 Initialize Component / 初始化组件 Register Inputs / 注册输入参数 Get Worksheet / 获取工作表 Get Range / 获取范围 Get Condition Type / 获取条件类型 Get Cell Color / 获取单元格颜色 Get Clear Flag / 获取清除标志 Get Activate Flag / 获取激活标志 Activate? / 是否激活? Clear? / 是否清除? ClearConditions / 清除条件 AddConditionalAverage / 添加条件平均值 Set Output / 设置输出 End / 结束 这个流程图对应到代码中的主要步骤如下 Start / 开始对应构造函数 GH_Ex_Ana_CondAverage()Initialize Component / 初始化组件在构造函数中完成Register Inputs / 注册输入参数对应 RegisterInputParams 方法Get Worksheet / 获取工作表DA.GetData(0, ref gooS);Get Range / 获取范围DA.GetData(1, ref gooR);Get Condition Type / 获取条件类型DA.GetData(2, ref type);Get Cell Color / 获取单元格颜色DA.GetData(3, ref color);Get Clear Flag / 获取清除标志DA.GetData(4, ref clear);Get Activate Flag / 获取激活标志DA.GetData(5, ref activate);Activate? / 是否激活?if (activate)Clear? / 是否清除?if (clear)ClearConditions / 清除条件range.ClearConditions();AddConditionalAverage / 添加条件平均值range.AddConditionalAverage((AverageCondition)type, color);Set Output / 设置输出DA.SetData(0, range);End / 结束方法结束 这个流程图展示了组件的主要执行步骤从初始化到获取输入参数然后根据条件执行相应的操作最后设置输出。表示了代码的逻辑流程特别是条件判断和相应的操作。 Description 构造函数 public GH_Ex_Ana_CondAverage(): base(Conditional Average, Average,Add conditional formatting to a Range based on the average of the values,Constants.ShortName, Constants.SubAnalysis) { }这是组件的构造函数。它调用基类的构造函数设置组件的名称、昵称、描述和分类。 // This is the constructor for the component. It calls the base class constructor to set the component’s name, nickname, description, and category. Exposure 属性 public override GH_Exposure Exposure {get { return GH_Exposure.secondary; } }这个属性设置组件在Grasshopper界面中的显示级别为次要。这意味着该组件不会在主菜单中直接显示而是在子菜单中。 // This property sets the exposure level of the component in the Grasshopper interface to secondary. This means the component won’t be directly visible in the main menu, but in a submenu. RegisterInputParams 方法 protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) {base.RegisterInputParams(pManager);pManager[1].Optional true;pManager.AddIntegerParameter(Type, T, The condition type, GH_ParamAccess.item, 0);pManager[2].Optional true;// ... (其他参数注册) }这个方法注册组件的输入参数。它首先调用基类的方法然后添加额外的参数如条件类型、单元格颜色等。每个参数都有一个名称、简称、描述和默认值。 // This method registers the input parameters for the component. It first calls the base class method, then adds additional parameters such as condition type, cell color, etc. Each parameter has a name, nickname, description, and default value. RegisterOutputParams 方法 protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) {base.RegisterOutputParams(pManager); }这个方法注册组件的输出参数。在这个例子中它只是调用基类的方法没有添加额外的输出。 // This method registers the output parameters for the component. In this case, it only calls the base class method without adding any additional outputs. SolveInstance 方法 protected override void SolveInstance(IGH_DataAccess DA) {// ... (获取输入数据)if (activate){if (clear) range.ClearConditions();range.AddConditionalAverage((AverageCondition)type, color);}DA.SetData(0, range); }这是组件的核心方法执行主要的逻辑。 // This is the core method of the component, executing the main logic. 它首先获取所有输入数据然后根据条件执行操作 如果激活标志为真它会 a. 如果清除标志为真清除现有的条件格式 b. 添加新的基于平均值的条件格式 最后它设置输出数据处理后的范围对象 // It first retrieves all input data, then performs operations based on conditions: // 1. If the activate flag is true, it will: // a. Clear existing conditional formatting if the clear flag is true // b. Add new conditional formatting based on average // 2. Finally, it sets the output data (the processed range object) Icon 属性 protected override System.Drawing.Bitmap Icon {get{return Properties.Resources.BB_Cond_Average_01;} }这个属性返回组件的图标。它使用预定义的资源图片。 // This property returns the icon for the component. It uses a predefined resource image. ComponentGuid 属性 public override Guid ComponentGuid {get { return new Guid(b2854323-ef9f-470f-9f52-1d80fa90fb2a); } }这个属性返回组件的唯一标识符。这个GUID在组件发布后不应更改用于在Grasshopper中唯一标识这个组件。 // This property returns the unique identifier for the component. This GUID should not be changed after the component is released, as it’s used to uniquely identify this component in Grasshopper. 总结 这个组件展示了如何创建一个自定义的Grasshopper组件特别是用于Excel数据处理。它利用了面向对象编程的继承特性重写了基类的多个方法来定制组件的行为。通过这种方式它实现了在Grasshopper环境中直接操作Excel数据的功能为用户提供了强大而灵活的数据处理工具。 // In summary, this component demonstrates how to create a custom Grasshopper component, especially for Excel data processing. It utilizes object-oriented programming inheritance features, overriding multiple base class methods to customize the component’s behavior. Through this approach, it implements functionality to directly manipulate Excel data within the Grasshopper environment, providing users with a powerful and flexible data processing tool. Code using Grasshopper.Kernel; using Grasshopper.Kernel.Parameters; using Grasshopper.Kernel.Types; using Rhino.Geometry; using System; using System.Collections.Generic; using Sd System.Drawing;namespace Bumblebee.Components {// 定义一个条件平均值组件类继承自基础范围组件public class GH_Ex_Ana_CondAverage : GH_Ex_Rng__Base{/// summary/// 初始化 GH_Ex_An_CondAverage 类的新实例。/// /summarypublic GH_Ex_Ana_CondAverage(): base(Conditional Average, Average,Add conditional formatting to a Range based on the average of the values,Constants.ShortName, Constants.SubAnalysis){// 构造函数调用基类构造函数设置组件的名称、昵称、描述和分类}/// summary/// 设置组件的暴露级别。/// /summarypublic override GH_Exposure Exposure{// 将组件设置为次要暴露级别意味着它会在子菜单中显示get { return GH_Exposure.secondary; }}/// summary/// 注册此组件的所有输入参数。/// /summaryprotected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager){// 调用基类方法注册基本输入参数base.RegisterInputParams(pManager);// 设置第二个参数索引1为可选pManager[1].Optional true;// 添加整数参数用于条件类型pManager.AddIntegerParameter(Type, T, The condition type, GH_ParamAccess.item, 0);pManager[2].Optional true;// 添加颜色参数用于单元格颜色pManager.AddColourParameter(Cell Color, C, The cell highlight color, GH_ParamAccess.item, Sd.Color.LightGray);pManager[3].Optional true;// 添加布尔参数用于清除现有条件pManager.AddBooleanParameter(Clear, _X, If true, the existing conditions will be cleared, GH_ParamAccess.item, false);pManager[4].Optional true;// 添加布尔参数用于激活条件pManager.AddBooleanParameter(Activate, _A, If true, the condition will be applied, GH_ParamAccess.item, false);pManager[5].Optional true;// 为条件类型参数添加命名值Param_Integer paramA (Param_Integer)pManager[2];foreach (AverageCondition value in Enum.GetValues(typeof(AverageCondition))){paramA.AddNamedValue(value.ToString(), (int)value);}}/// summary/// 注册此组件的所有输出参数。/// /summaryprotected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager){// 调用基类方法注册基本输出参数base.RegisterOutputParams(pManager);}/// summary/// 这是实际执行工作的方法。/// /summary/// param nameDADA 对象用于从输入检索数据和存储到输出。/paramprotected override void SolveInstance(IGH_DataAccess DA){// 获取工作表数据IGH_Goo gooS null;DA.GetData(0, ref gooS);ExWorksheet worksheet new ExWorksheet();bool hasWs gooS.TryGetWorksheet(ref worksheet);// 获取范围数据IGH_Goo gooR null;DA.GetData(1, ref gooR);ExRange range new ExRange();if (!gooR.TryGetRange(ref range, worksheet)) return;if (!hasWs) worksheet range.Worksheet;// 获取条件类型int type 0;DA.GetData(2, ref type);// 获取单元格颜色Sd.Color color Sd.Color.LightGray;DA.GetData(3, ref color);// 获取清除标志bool clear false;DA.GetData(4, ref clear);// 获取激活标志bool activate false;DA.GetData(5, ref activate);// 如果激活执行条件格式操作if (activate){// 如果需要清除先清除现有条件if (clear) range.ClearConditions();// 添加新的条件平均值格式range.AddConditionalAverage((AverageCondition)type, color);}// 设置输出数据DA.SetData(0, range);}/// summary/// 提供组件的图标。/// /summaryprotected override System.Drawing.Bitmap Icon{get{// 返回组件的图标return Properties.Resources.BB_Cond_Average_01;}}/// summary/// 获取此组件的唯一ID。发布后不要更改此ID。/// /summarypublic override Guid ComponentGuid{// 返回组件的唯一标识符get { return new Guid(b2854323-ef9f-470f-9f52-1d80fa90fb2a); }}} }这段代码现在包含了详细的中文注释解释了每个方法和属性的功能。这些注释涵盖了以下几个方面 类的整体功能和继承关系构造函数的作用各个方法如RegisterInputParams、SolveInstance等的具体功能输入参数的设置和含义主要逻辑流程在SolveInstance方法中图标和GUID的设置及其重要性
http://www.pierceye.com/news/139815/

相关文章:

  • 企业网站推广计划免费最新如何建设网站教程视频
  • 17一起做网站普宁站好看个人网页模板
  • 民治营销网站专业网站建设价格最优
  • 免费的html网站做柜子喜欢上哪些网站看
  • 网站没备案怎么做加速现代装修风格三室两厅效果图
  • 互助平台网站建设网上商城怎么购物
  • 百度知道山东网站建设建设网站成本预算
  • 人人做免费网站网站建站是 什么
  • 以背景做网站视频为单位网站建设实施方案
  • 简洁大气企业网站模板西安个人做网站
  • 做一个网站需要到哪里做辽宁同鑫建设网站
  • 开发网站监控推荐扬中市建设局网站
  • 手机网站根目录简述一个网站设计的主要步骤
  • 网站改版seo建议网页设计师的能力
  • 网站上线前应该备案吗温州网站建设风格
  • 网站建设书籍免费聊城市东昌府区建设路小学网站
  • 网站标题优化怎么做找人一起做素材网站
  • 如何创建个人网站模板用织梦做模板网站
  • 平台建站建设做网站一定要有营业执照吗
  • 如何把学校网站建设好天猫店铺购买
  • 网站的建设和推广企业网站建设的主要目的是
  • html5 公众号 网站开发工程公司名称
  • 公司做网站那家好网站二维码怎么制作
  • 鼓楼区建设房产和交通局网站网站全屏图片怎么做
  • 外贸订单流失严重番禺网站建设优化推广
  • 做网站送邮箱电商网站建设行情
  • f2c网站建设珠海手机网站建设费用
  • 网站建设的策划书wordpress相册代码
  • 直播网站创做上海网站制作公司哪
  • 如何承接网站建设外包昆明专业网站设计公司