1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.ComponentModel.DataAnnotations;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using XdCxRhDW.Dto.Attribute;
- namespace XdCxRhDW.Dto
- {
- /// <summary>
- /// 信号识别模型
- /// </summary>
- public class SignalProcDto: IValidatableObject
- {
- /// <summary>
- /// 调用Upload接口上传文件后返回的文件名
- /// </summary>
- [FileMustExist]
- public string File { get; set; }
- /// <summary>
- /// 文件采样率(Hz)
- /// </summary>
- public long Fs { get; set; }
- /// <summary>
- /// 样点集合信息
- /// </summary>
- public List<SmpPosition> Smps { get; set; } = new List<SmpPosition>();
- /// <summary>
- ///
- /// </summary>
- /// <param name="validationContext"></param>
- /// <returns></returns>
- public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
- {
- if (Smps==null||!Smps.Any())
- yield return new ValidationResult("样点集合至少包含一个元素", new[] { nameof(this.Smps) });
- yield return null;
- }
- }
- }
|