用C#写一个灵活的要素Feature属性Properties质检WebAPI接口(三)

YOLOv8缺陷检测可视化界面实战:PyQt5布局设计与代码实现 本文详细介绍了如何利用PyQt5为YOLOv8缺陷检测模型构建一个专业、易用的可视化界面。通过实战讲解PyQt5的布局管理器设计、信号槽机制与YOLOv8核心的集成,帮助开发者快速将AI模型部署为直观的桌面应用,提升工业质检等场景的落地效率。 阅读详情

本文介绍一下功能实现,并给出核心部分代码。

首先要定义各种结构,包括传入参数、传出结果、规则集合等,如下:

using GeoJSON.Net.Feature;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Web;

namespace GISWebService.HttpRequestContent
{
    /// <summary>
    /// 属性质检的传入参数
    /// </summary>
    public class CheckFields
    {
        /// <summary>
        /// 图层
        /// </summary>
        [JsonProperty("layer")]
        public string Layer { get; set; }
        /// <summary>
        /// 要素集合
        /// </summary>
        [JsonProperty("feature")]
        public List<Feature> Feature { get; set; }
    }


    /// <summary>
    /// 要素属性质检结果
    /// </summary>
    public class CheckFieldsResult
    {
        /// <summary>
        /// OBJECTID
        /// </summary>
        [JsonProperty("objectid")]
        public int ObjectID { get; set; }
        /// <summary>
        /// 字段检查结果
        /// </summary>
        [JsonProperty("fields")]
        public List<string> FieldInfo { get; set; }
    }

    /// <summary>
    /// 属性质检结果
    /// </summary>
    public class CheckFieldsResponseBody
    {
        /// <summary>
        /// 图层
        /// </summary>
        [JsonProperty("layer")]
        public string Layer { get; set; }
        /// <summary>
        /// 质检结果
        /// </summary>
        [JsonProperty("info")]
        public List<CheckFieldsResult> Information { get; set; }
    }

    /// <summary>
    /// 规则:来自集合
    /// </summary>
    public class RuleCollection
    {
        /// <summary>
        /// 分隔符
        /// </summary>
        [JsonProperty("seperator")]
        [DefaultValue(",")]
        public string Seperator { get; set; }
        /// <summary>
        /// 集合
        /// </summary>
        [JsonProperty("list")]
        [JsonConverter(typeof(ValueToList))]
        public List<string> Items { get; set; }
    }

    /// <summary>
    /// 属性值质检规则
    /// </summary>
    public class RuleValueItem
    {
        /// <summary>
        /// 字段名
        /// </summary>
        [JsonProperty("name")]
        public string FieldName { get; set; }
        /// <summary>
        /// 允许空值(默认为true)
        /// </summary>
        [JsonProperty("nullable")]
        [DefaultValue(true)]
        public bool Nullable { get; set; }
        /// <summary>
        /// 来自集合
        /// </summary>
        [JsonProperty("collection", NullValueHandling = NullValueHandling.Ignore)]
        public RuleCollection RuleOfCollection { get; set; }
        /// <summary>
        /// 正则表达式
        /// </summary>
        [JsonProperty("expression", NullValueHandling = NullValueHandling.Ignore)]
        public string RegExp { get; set; }
    }

    /// <summary>
    /// 要素类属性值质检规则
    /// </summary>
    public class RuleValue
    {
        /// <summary>
        /// 要素类集合
        /// </summary>
        [JsonProperty("featureclass")]
        public List<string> FeatureClassNames { get; set; }
        /// <summary>
        /// 各字段规则
        /// </summary>
        [JsonProperty("rule")]
        public List<RuleValueItem> RuleItems { get; set; }
    }

    /// <summary>
    /// 属性空值限制质检规则
    /// </summary>
    public class RuleRestrictionItem
    {
        /// <summary>
        /// 主干(非空时要求分支不为空)
        /// </summary>
        [JsonProperty("trunk")]
        public string Trunk { get; set; }
        /// <summary>
        /// 分支
        /// </summary>
        [JsonProperty("branch")]
        [DefaultValue(true)]
        public List<string> Branches { get; set; }
    }

    /// <summary>
    /// 要素类属性值质检规则
    /// </summary>
    public class RuleRestriction
    {
        /// <summary>
        /// 要素类集合
        /// </summary>
        [JsonProperty("featureclass")]
        public List<string> FeatureClassNames { get; set; }
        /// <summary>
        /// 属性空值限制质检规则
        /// </summary>
        [JsonProperty("rule")]
        public List<RuleRestrictionItem> RuleItems { get; set; }
    }


    /// <summary>
    /// 属性空值限制质检规则
    /// </summary>
    public class RuleRelationItem
    {
        /// <summary>
        /// 较短的字段
        /// </summary>
        [JsonProperty("short")]
        public string ShortField { get; set; }
        /// <summary>
        /// 较长的字段(非空时,较短字段为其取值的一部分)
        /// </summary>
        [JsonProperty("long")]
        public string LongField { get; set; }

        /// <summary>
        /// 起始索引(从1起算,取值包含该索引)
        /// </summary>
        [JsonProperty("from")]
        public int FromIndex { get; set; }
        /// <summary>
        /// 终止索引(从1起算,大于起始索引,但小于总长度,取值包含该索引)
        /// </summary>
        [JsonProperty("to")]
        public int ToIndex { get; set; }
    }

    /// <summary>
    /// 要素类属性关系质检规则
    /// </summary>
    public class RuleRelation
    {
        /// <summary>
        /// 要素类集合
        /// </summary>
        [JsonProperty("featureclass")]
        public List<string> FeatureClassNames { get; set; }
        /// <summary>
        /// 属性关系质检规则
        /// </summary>
        [JsonProperty("rule")]
        public List<RuleRelationItem> RuleItems { get; set; }
    }

    public class ValueToList : JsonConverter
    {
        public override bool CanConvert(Type objectType)
        {
            return true;
        }

        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            bool isTypeNullable = IsNullableType(objectType);
            Type t = isTypeNullable ? Nullable.GetUnderlyingType(objectType) : objectType;
            if (reader.TokenType == JsonToken.Null)
            {
                if (!IsNullableType(objectType))
                    throw new Exception(string.Format("不能转换null value to {0}.", objectType));
                return null;
            }
            try
            {
                List<string> ls = new List<string>();
                if (reader.TokenType == JsonToken.String)
                {
                    string sValue = reader.Value.ToString();
                    string[] arrayValue = sValue.Split(',');
                    foreach (string s in arrayValue)
                    {
                        if (string.IsNullOrWhiteSpace(s))
                            continue;
                        ls.Add(s);
                    }
                }
                return ls;
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error converting value {0} to type '{1}'", reader.Value, objectType));
            }
            throw new Exception(string.Format("Unexpected token {0} when parsing enum", reader.TokenType));
        }

        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            if (null == value)
            {
                writer.WriteNull();
                return;
            }
            List<string> ls = value as List<string>;
            if (null == ls || 0 == ls.Count)
            {
                writer.WriteNull();
                return;
            }
            string result = "";
            foreach (string s in ls)
            {
                if (string.IsNullOrEmpty(s) || string.IsNullOrWhiteSpace(s))
                    continue;
                if (string.IsNullOrEmpty(result))
                {
                    result = s;
                }
                else
                {
                    result += "," + s;
                }
            }
            writer.WriteValue(result);
        }

        public bool IsNullableType(Type t)
        {
            if (t == null)
            {
                throw new ArgumentNullException("t");
            }
            return (t.BaseType.FullName == "System.ValueType" && t.GetGenericTypeDefinition() == typeof(Nullable<>));
        }
    }
}

先定义一个CheckValue类,来实现属性质检规则的加载:

using GeoJSON.Net.Feature;
using GISWebService.HttpRequestContent;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace GISWebService.Common
{
    public class CheckValue
    {
        private static string _CheckRelationConfig = "CheckRelation.json";
        private static string _CheckRestrictionConfig = "CheckRestriction.json";
        private static string _CheckValueConfig = "CheckValue.json";

        private static List<RuleRelation> _RuleRelations = null;
        private static List<RuleRestriction> _RuleRestrictions = null;
        private static List<RuleValue> _RuleValues = null;
        /// <summary>
        /// 属性关系检查规则
        /// </summary>
        public static List<RuleRelation> RuleRelations { get { return GetRules<RuleRelation>(_CheckRelationConfig, _RuleRelations as System.Collections.IList) as List<RuleRelation>; } }
        /// <summary>
        /// 属性空值约束检查规则
        /// </summary>
        public static List<RuleRestriction> RuleRestrictions { get { return GetRules<RuleRestriction>(_CheckRestrictionConfig, _RuleRestrictions as System.Collections.IList) as List<RuleRestriction>; } }
        /// <summary>
        /// 属性值检查规则
        /// </summary>
        public static List<RuleValue> RuleValues { get { return GetRules<RuleValue>(_CheckValueConfig, _RuleValues as System.Collections.IList) as List<RuleValue>; } }

        private static System.Collections.IList GetRules<T>(string name, System.Collections.IList rules)
        {
            if (null == rules)
            {
                Type aType = typeof(List<>).MakeGenericType(typeof(T));
                rules = Activator.CreateInstance(aType) as System.Collections.IList;
            }
            if (0 == rules.Count)
                rules = LoadRules<T>(name);
            return rules;
        }

        private static string GetConfigFile(string name)
        {
            string path = "";
            try
            {
                string s = System.IO.Path.Combine(AppSettings.PathByKey("tempdir"), name);
                path = System.IO.File.Exists(s) ? s : "";
            }
            catch (Exception e)
            {
                ExceptionHelper.LogActionException(e);
            }
            return path;
        }

        private static System.Collections.IList LoadRules<T>(string name)
        {
            string sPath = GetConfigFile(name);
            Type aType = typeof(List<>).MakeGenericType(typeof(T));
            System.Collections.IList ls = Activator.CreateInstance(aType) as System.Collections.IList;
            if (!string.IsNullOrEmpty(sPath))
            {
                string sContent = System.IO.File.ReadAllText(sPath, System.Text.Encoding.Default);
                ls = Newtonsoft.Json.JsonConvert.DeserializeObject(sContent, aType) as System.Collections.IList;
            }
            return ls;
        }

    }
}

在核心的质检类CheckValueHelper类中定义质检的方法,并让它继承自CheckValue类:

using GeoJSON.Net.Feature;
using GISWebService.HttpRequestContent;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;

namespace GISWebService.Common
{
    public class CheckValueHelper : CheckValue
    {
        public static CheckFieldsResult Check(string featureclass, Feature feature)
        {
            CheckFieldsResult result = new CheckFieldsResult() { ObjectID = -1, FieldInfo = new List<string>() };
            int oid = GetObjectID(feature);
            if (0 <= oid)
            {
                result.ObjectID = oid;
                result.FieldInfo.AddRange(CheckRelation(featureclass, feature.Properties, RuleRelations));
                result.FieldInfo.AddRange(CheckRestriction(featureclass, feature.Properties, RuleRestrictions));
                result.FieldInfo.AddRange(CheckValue(featureclass, feature.Properties, RuleValues));
            }
            return result;
        }

        private static int GetObjectID(Feature feature)
        {
            int n = -1;
            if (null == feature || null == feature.Properties || 0 == feature.Properties.Count)
                return n;
            foreach (var item in feature.Properties)
            {
                if (0 == string.Compare(item.Key, "objectid", true))
                {
                    if (null == item.Value)
                        continue;
                    int oid = -1;
                    if (int.TryParse(item.Value.ToString(), out oid) && 0 < oid)
                    {
                        n = Convert.ToInt32(item.Value.ToString());
                        break;
                    }
                }
            }
            return n;
        }

        private static string GetValueToString(Dictionary<string, object> dict, string key, bool ignoreCase = true, bool removeWhitespace = true)
        {
            string s = "";
            if (null == dict || 0 == dict.Count || string.IsNullOrEmpty(key))
                return s;
            foreach (var item in dict)
            {
                if (0 == string.Compare(item.Key, key, ignoreCase) && item.Value != null)
                {
                    s = removeWhitespace ? item.Value.ToString().Replace(" ", "") : item.Value.ToString();
                    break;
                }
            }
            return s;
        }

        private static List<string> CheckRelation(string featureclass, Dictionary<string, object> dict, List<RuleRelation> lsRule)
        {
            int nA = -1;
            for (int n = 0; n < lsRule.Count; n++)
            {
                int m = lsRule[n].FeatureClassNames.FindIndex((e) => { return 0 == string.Compare(e, featureclass, true); });
                if (m >= 0)
                {
                    nA = n;
                    break;
                }
            }
            if (nA < 0)
                return null;

            List<string> ls = new List<string>();
            List<RuleRelationItem> lsRuleItem = lsRule[nA].RuleItems;
            foreach (var item in lsRuleItem)
            {
                if (string.IsNullOrEmpty(item.ShortField) || string.IsNullOrEmpty(item.LongField) || item.FromIndex <= 0 || item.ToIndex <= 0 || item.FromIndex > item.ToIndex)
                {
                    Log.Loging.Info(string.Format("关联检查配置文件有误。Long = {0}, Short = {1}, From = {2} ,To = {3}", item.LongField, item.ShortField, item.FromIndex, item.ToIndex));
                    continue;
                }
                string sShortLengthValue = GetValueToString(dict, item.ShortField);
                string sLongLengthValue = GetValueToString(dict, item.LongField);
                if (string.IsNullOrEmpty(sShortLengthValue) || string.IsNullOrEmpty(sLongLengthValue))
                {
                    Log.Loging.Info(string.Format("有数据为空。{0} = {1}, {2} = {3}", item.ShortField, sShortLengthValue, item.LongField, sLongLengthValue));
                    continue;
                }
                if (sLongLengthValue.Length < item.ToIndex)
                {
                    Log.Loging.Info(string.Format("数据有误,{0} 字段取值 {1} 未能超过索引长度 {2}", item.LongField, sLongLengthValue, item.ToIndex));
                    continue;
                }
                string sSubString = sLongLengthValue.Substring(item.FromIndex - 1, item.ToIndex - item.FromIndex + 1);
                if (0 != string.Compare(sShortLengthValue, sSubString, true))
                {
                    if (item.FromIndex == item.ToIndex)
                        ls.Add(string.Format("字段 {0} 取值不为字段 {1} 取值的第 {2} 位", item.ShortField, item.LongField, item.FromIndex));
                    else
                        ls.Add(string.Format("字段 {0} 取值不为字段 {1} 取值的第 {2} 位至第 {3} 位", item.ShortField, item.LongField, item.FromIndex, item.ToIndex));
                }
            }
            return ls;
        }

        private static List<string> CheckRestriction(string featureclass, Dictionary<string, object> dict, List<RuleRestriction> lsRule)
        {
            int nA = -1;
            for (int n = 0; n < lsRule.Count; n++)
            {
                int m = lsRule[n].FeatureClassNames.FindIndex((e) => { return 0 == string.Compare(e, featureclass, true); });
                if (m >= 0)
                {
                    nA = n;
                    break;
                }
            }
            if (nA < 0)
                return null;
            List<string> ls = new List<string>();
            List<RuleRestrictionItem> lsRuleItem = lsRule[nA].RuleItems;
            foreach (var item in lsRuleItem)
            {
                if (string.IsNullOrEmpty(item.Trunk) || null == item.Branches || 0 == item.Branches.Count)
                {
                    Log.Loging.Info("主干字段配置有误");
                    continue;
                }
                string sTrunkFieldValue = GetValueToString(dict, item.Trunk);
                if (string.IsNullOrEmpty(sTrunkFieldValue))
                {
                    Log.Loging.Info(string.Format("不包含字段 {0} 或取值为空", item.Trunk));
                    continue;
                }
                foreach (var branch in item.Branches)
                {
                    if (string.IsNullOrEmpty(branch))
                    {
                        Log.Loging.Info("分支字段配置有误");
                        continue;
                    }
                    string sBrunchFieldValue = GetValueToString(dict, branch);
                    if (string.IsNullOrEmpty(sBrunchFieldValue))
                        ls.Add(string.Format("字段 {0} 不为空时要求字段 {1} 也不能为空", item.Trunk, branch));
                }
            }
            return ls;
        }

        private static List<string> CheckValue(string featureclass, Dictionary<string, object> dict, List<RuleValue> lsRule)
        {
            int nA = -1;
            for (int n = 0; n < lsRule.Count; n++)
            {
                int m = lsRule[n].FeatureClassNames.FindIndex((e) => { return 0 == string.Compare(e, featureclass, true); });
                if (m >= 0)
                {
                    nA = n;
                    break;
                }
            }
            if (nA < 0)
                return null;
            List<string> ls = new List<string>();
            List<RuleValueItem> lsRuleItem = lsRule[nA].RuleItems;
            foreach (var aPair in dict)
            {
                RuleValueItem fieldRule = null;
                for (int k = 0; k < lsRuleItem.Count; k++)
                {
                    if (0 == string.Compare(lsRuleItem[k].FieldName, aPair.Key, true))
                    {
                        fieldRule = lsRuleItem[k];
                        break;
                    }
                }
                if (null == fieldRule)
                    continue;

                string sValue = "";
                if (null != aPair.Value)
                    sValue = aPair.Value.ToString().Replace(" ", "");

                if (!fieldRule.Nullable)
                {
                    if (string.IsNullOrEmpty(sValue))
                    {
                        ls.Add(string.Format("字段 {0} 取值不允许非空", aPair.Key));
                        continue;
                    }
                }

                if (!string.IsNullOrEmpty(sValue) && null != fieldRule.RuleOfCollection)
                {
                    if (null != fieldRule.RuleOfCollection.Items && 0 < fieldRule.RuleOfCollection.Items.Count && !string.IsNullOrEmpty(fieldRule.RuleOfCollection.Seperator))
                    {
                        char[] cSeperator = fieldRule.RuleOfCollection.Seperator.ToCharArray();
                        string[] arrayValue = sValue.Split(cSeperator, StringSplitOptions.RemoveEmptyEntries);
                        foreach (var item in arrayValue)
                        {
                            if (0 > fieldRule.RuleOfCollection.Items.FindIndex(e => { return 0 == string.Compare(item, e, true); }))
                            {
                                ls.Add(string.Format("字段 {0} 取值不在指定的集合范围内", aPair.Key));
                                break;
                            }
                        }
                    }
                }
                if (!string.IsNullOrEmpty(sValue) && !string.IsNullOrEmpty(fieldRule.RegExp))
                {
                    if (!(new Regex(fieldRule.RegExp).IsMatch(sValue)))
                        ls.Add(string.Format("字段 {0} 取值不符合规范", aPair.Key));
                }
            }
            return ls;
        }

    }
}

调用的地方,即接口处实现如下:

        /// <summary>
        /// 属性质检(可配置式)
        /// </summary>
        /// <returns>质检结果</returns>
        /// <status>可用</status>
        [HttpPost]
        [ResponseType(typeof(List<CheckFieldsResponseBody>))]
        public IHttpActionResult CheckFields2([FromBody]List<CheckFields> param)
        {
            try
            {
                List<CheckFieldsResponseBody> lsResult = new List<CheckFieldsResponseBody>() { };
                foreach (var item in param)
                {
                    CheckFieldsResponseBody aResponse = new CheckFieldsResponseBody() { Layer = item.Layer, Information = new List<CheckFieldsResult>() };
                    foreach (var feature in item.Feature)
                        aResponse.Information.Add(CheckValueHelper.Check(aResponse.Layer, feature));
                    lsResult.Add(aResponse);
                }
                return Json(new JObject(new JProperty("status", 0), new JProperty("result", JToken.FromObject(lsResult))));
            }
            catch (Exception e)
            {
                ExceptionHelper.LogActionException(e);
                return Json(new ResponseInfo() { StatusCode = 1, Message = e.Message });
            }
        }


【INMP441】 MEMS麦克风,让硬件“听得见”,更要“听得清” INMP441是一款数字MEMS麦克风,采用PDM接口输出高质量数字音频信号。相比传统模拟麦克风,它具有高度集成、抗干扰强、功耗低等优势,支持通过时钟启停实现软件控制开关。该麦克风体积小巧但功能强大,内置MEMS传感器、ADC转换器等模块,适合智能音箱、语音遥控等应用。工程师可通过ESP32等主控芯片轻松连接INMP441,利用多麦克风阵列实现波束成形等高级功能。INMP441展现了数字音频采集的先进技术,为创客和智能硬件开发者提供了优秀的音频解决方案。 阅读详情

相关推荐

3D点云修复实战:用PCN网络快速补全缺失的激光雷达数据(附代码)

本文详细介绍了PCN(Point Completion Network)网络在3D点云修复领域的实战应用。针对激光雷达数据常见的缺失问题,PCN通过端到端的深度学习架构,直接处理原始点云,实现由粗到精的快速补全。文章深入解析了其核心思想与编码器-解码器架构,并提供了完整的环境搭建、数据准备、模型实现、训练评估及在真实场景下的优化策略与代码示例,为自动驾驶、机器人等领域的开发者提供了高效的数据修复解决方案。

weixin_29041195的博客 400

用C#写一个灵活的要素Feature属性Properties质检WebAPI接口(二)

本文主要介绍质检规则的配置。CheckValue.json属性取值质检规则(单一字段)[ { "featureclass": [ "ZD_SHYQ", "ZD_SHYQ_WRK" ], "rule": [ { "name": "ZDTZM&q

a_dev的专栏 494

光电转换器件PMT,APD总结

PMT和APD都属于单点探测器,只能探测光子信息,可以通过扫描方式测光谱。 1. PMT PMT:光电倍增管,是光子技术器件中的一个重要产品,它是一种具有极高灵敏度和超快时间响应的光探测器件。 原理:光电倍增管是一种真空器件。它由光电发射阴极(光阴极)和聚焦电极、电子倍增极及电子收集极(阳极)等组成。当光照射到光阴极时,光阴极向真空中激发出光电子。这些光电子按聚焦极电场进入倍增系统,并通过进一步的二次发射得到的倍增放大。然后把放大后的电子用阳极收集作为信号输出。 优点:因为采用了二次发射倍增系统,.

Ammon_Zhang的博客 1万+

C#从零开始的学习笔记(5)命名空间

文章目录概述命名空间的定义访问命名空间命名空间别名 概述 .NET Framework类库包含大量的类型,并且用户也能够自定义类型。为了有效组织C#程序中的类型以及保证其唯一性,C#引入了命名空间的概念,从而最大限度地避免类型重名的错误。 与通常的文件或者组件不同,命名空间是一种逻辑组合。在C#文件中定义类时,可以把它包括在命名空间定义中。C#程序中类型有指示逻辑层次结构完全限定名(fully qualified name)描述,例如Dtcloud.Test1.HelloWorld 表示Dtcloud命名空

DTCloud 1563

Zynq工程IP核封装:XCI引用与约束继承实战指南

IP核封装是FPGA系统设计中实现模块复用、团队协作与技术资产沉淀的关键环节。其本质是将功能逻辑、时序约束、接口协议和硬件配置统一抽象为可配置、可验证、可演进的标准化组件。核心原理在于通过XCI文件保留IP核的参数化定义能力,依托Vivado IP Packager实现约束继承、端口自动映射与时钟域解耦,从而保障跨项目集成的时序可信性与约束完备性。该技术广泛应用于Zynq SoC视频处理、高速接口(如HDMI/TMDS)、多时钟域控制系统等场景,尤其在需要长期维护与版本迭代的工业级嵌入式开发中具有不可替代的

weixin_42593701的博客 131

Oracle19c字符集修改实战:从AL32UTF8到ZHS16GBK的完整避坑指南

本文详细介绍了Oracle19c数据库字符集从AL32UTF8到ZHS16GBK的无损转换实战指南。通过预检流程、企业级操作手册和数据完整性保障策略,帮助用户避免常见错误,确保转换过程顺利。特别适用于需要与中文字符集兼容的系统集成场景,提升数据库管理效率。

weixin_29296241的博客 164

C#.net 地图控件开发(八) 地图要素Feature

地图要素         地图要素(Feature)是构成地图图层的最小单元,它包括地物的几何形状,符号和描述信息。描述信息可以做成数据表的形式存储在图层类中,符号也可以存储在图层类中作为默认的要素符号,但是为了在图层中突出表示某个特殊的地物,所以在地图要素中也增加了符号属性。 要素类         作用:描述单个地物的图形信息和属性信息。         类:除了包括几何图形和符号外,

jackjian的专栏 2325

基于MATLAB的井筒多相流模拟

井筒多相流的模拟可以基于不同的数学模型和计算方法。其中,最常用的模型之一是多相流模型,它基于质量守恒、动量守恒和能量守恒等原理,描述了流体在井筒中的流动行为。对于井筒多相流的模拟和分析可以帮助我们理解和优化油气田开发过程中的流体行为,从而提高产量和效率。在本文中,我们将介绍如何使用MATLAB进行井筒多相流的模拟,并提供相应的源代码。需要注意的是,以上示例是一个简化的模拟,仅用于演示如何使用MATLAB进行井筒多相流模拟。实际应用中,我们需要考虑更多的物理过程和参数,并使用更复杂的数值方法和模型进行模拟。

AtdiHtml的博客 721

C# 使用AE获取feature的属性及字段操作

我就废话不多说了,大家还是直接看代码吧~ public static DataTable GetFeatureDataTable(IFeature pFeature) { DataTable dt = new DataTable(); dt.Columns.Add("位置:"); dt.Columns.Add("数据:"); for (int i = 0; i < pFeature.Fields.FieldCount; i++) {

chinaherolts2008的博客 1255

STM32CubeMX配置FSMC驱动外部SRAM全流程详解

FSMC(灵活静态存储控制器)是STM32实现高速并行外部存储扩展的核心外设,其本质是将片外SRAM地址空间映射为CPU可直接读写的内存区域。原理上依赖于精确的时序寄存器配置(如BTRx)、GPIO复用功能启用及AHB3总线时钟同步机制,技术价值在于免DMA搬运的零拷贝访问能力与确定性低延迟。典型应用场景包括工业HMI缓存、医疗设备实时数据采集、嵌入式图形加速等对带宽和确定性要求严苛的系统。本文围绕STM32F407ZG平台,结合STM32CubeMX工程化配置、硬件信号完整性设计与HAL库底层映射逻辑,系

weixin_34718952的博客 237

游戏开发:逻辑与渲染分离技术解析

游戏开发中逻辑与渲染分离的架构设计 本文系统阐述了游戏开发中逻辑与渲染分离的设计原则与实践方法。文章首先定义了核心概念:逻辑层负责游戏规则与状态,渲染层处理视觉表现,二者通过数据模型层进行通信。通过历史回顾,揭示了从早期混合架构到现代分层设计的演变过程。 在技术实现层面,文章详细分析了分离架构的优势:性能优化、流畅度控制、测试便利性、扩展灵活性以及团队协作效率。提供了Unity和Unreal两大引擎的具体实现方案,包括代码示例、分层模型和最佳实践。特别探讨了网络同步、客户端预测、插值处理等关键技术难点。 文

本博客聚焦游戏开发技巧、创业实战心得及大学热门课程干货。这里既有技术深度,也有思维广度,无论你是开发者、创业者还是高校学子,都能在这里找到适合自己的成长之路! 1066

用C#写一个灵活的要素Feature属性Properties质检WebAPI接口(四)

本文主要介绍接口的调用。接口页面测试参数[ { "layer": "ZRZ", "feature": [ { "type": "Feature", "geometry": null, "properties":

a_dev的专栏 352

【系统分析师】2025年下半年真题:案例分析-答案及详解(回忆版)

Redis相比Memcached在电商高并发场景下具有显著优势:支持持久化(RDB/AOF)、丰富数据结构(如有序集合实现排行榜)、原生支持集群和哨兵模式(高可用性)。布隆过滤器通过位数组和哈希函数预先存储所有合法订单ID,当查询请求到达时快速拦截无效ID(如伪造ID),避免其穿透缓存直接冲击数据库,从而预防缓存击穿问题。

数据知道的博客 6084

用C#写一个灵活的要素Feature属性Properties质检WebAPI接口(一)

需求概述某项目中,要对宗地、自然幢数据进行质检。质检规则非常多,大致可以分为几类:一是要求某一属性字段值要么为空,要么为指定值;二是要求为某一属性字段值要么为空,要么从指定的集合中取值;三是要求当某一字段取值不为空时,某些字段也不能为空;四是要求当某一字段取值不为空,某一字段的取值必须为该字段值的某一位或某几位。设计思路把规则搞成配置文件,程序只负责解析规则,检查数据,以及输出结果。上述规则中,前...

a_dev的专栏 394

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

C#AE获得feature的属性及字段

public static DataTable GetFeatureDataTable(IFeature pFeature) { DataTable dt = new DataTable(); dt.Columns.Add("位置:"); dt.Columns.Add("数据:"); ...

西柚2015地信小白GISer 2106

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

查询Feature的名称及ID

List<Guid> featIDs = new List<Guid>(); var dd = from i in SPFarm.Local.FeatureDefinitions where i != null && i.RootDirectory.Contains("NanmuThe...

weixin_34198762的博客 765

Feature的命名规则

一直不是很了解feature的命名规则是什么,直到最近遇到一个名称很长的feature在用ps active的时候,想了一小会,还是觉得看下比较好 最终,我发现,feature的名字的命名规则是 projectname_featurename 比如说,一个项目的名字是 ABCSolutions.A.B.C, 它里面一个featuree的名字是NoticeBoard Feature,那么

cindoralla的专栏 2364

IFeatureClass --1

IFeatureClass 用于访问控制要素类行为和属性的成员 IFeatureClass接口是获取和设置要素类属性的主要接口。例如,使用IFeatureClass接口获取要素类类型、获取满足查询条件的要素数目或在要素类中创建新要素。IFeatureClass接口继承了IObjectClass接口。 成员 AddField         向这个类中添加一个字段。 AddIndex

jojojojo2002的专栏 1932

C# 4.0 Features

C# is a language we work on regularly, it is a language that we love the most. It is always good to see updates to such a lovely language which is very common to most of us. C# 4.0 after its release

张彤的专栏 1161

关于获得IFeature的属性字段

IGeometricNetwork,NetworkAnalysis,IEIDHelepr,IEnumEIDInfo,IEIDInfo

Sean的专栏 8303

C# GIS库 NetTopologySuite shp 转 geojson

将ShapeFile 读取为 FeatureCollection: public bool ShpToFeatureCollection1(string filename, out FeatureCollection collection) { collection = null; try ...

weixin_30333885的博客 1469

基于C#的MapInfo开发时常用的命名空间总结

命名空间:  MapInfo.DataMapInfo.Data 命名空间包含了实现 MapInfo .NET 数据提供方的类和接口。 对 MapInfo 数据的访问有两种形式:作为使用 SQL 与数据交互的 ADO.NET 数据提供程序和作为使用类与数据交互的 Feature 对象。 MapInfo ADO.NET 数据提供方是使用 MIConnection、M

it114的专栏 2234

IfeatureSelection:SelectFeatures方法介绍

已知一个要素图层和我们的选择条件,寻找出符合要求的要素并闪烁显示,使用的IfeatureSelection接口的SelectFeatures方法Public Sub searchSelection(byval sqlfilter as string, byval pFeatLyr as iFeatureLayer)Dim pFilter As IqueryFilter ‘做一个过滤器pFilter

旅途 8966

特征选择(feature select)

单变量特征选择Univariate feature selection     分别选择每一个特征,衡量该特征与label之间的关系,选择出topk个最重要的特征     该方法可以帮助对数据的理解,但是对特征优化,提高模型的泛化能力不一定有效。 selector = SelectKBest(f_classif, k=5) f_classif(方差分析的F值):评估特征的指标。一般的,

u013385362的博客 2451
上一篇: 用C#写一个灵活的要素Feature属性Properties质检WebAPI接口(二)
下一篇: 用C#写一个灵活的要素Feature属性Properties质检WebAPI接口(四)
acngiser
博客等级 码龄15年 118粉丝 214原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址