using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace Hydro.CommonBase
|
{
|
public class Solution
|
{
|
public Solution(string f, int n)
|
{
|
存储表名 = 名称 = f;
|
并行数 = n;
|
}
|
[Category("1、方案信息")]
|
[Description("方案名称")]
|
[DisplayName("1、方案编码")]
|
public string 名称 { get; set; }
|
[Category("1、方案信息")]
|
[Description("该型号子方案计算器的数量")]
|
[DisplayName("3、并行数")]
|
public int 并行数 { get; set; }
|
[Category("1、方案信息")]
|
[Description("启动/禁用")]
|
[DisplayName("2、是否启用")]
|
public bool 启用 { get; set; }
|
[Category("2、存储")]
|
[Description("存储/不存储")]
|
[DisplayName("2、是否存储")]
|
|
public bool 是否存储 { get; set; }
|
|
[Category("2、存储")]
|
[Description("方案的名称,必填;")]
|
[DisplayName("1、方案名称")]
|
public string 存储表名 { get; set; }
|
|
[Category("2、存储")]
|
[Description("文件的存储位置")]
|
[DisplayName("3、文件存储位置")]
|
public string 存储位置 { get; set; }
|
|
[Category("2、存储")]
|
[Description("一组自然数值,表示每一位向量的二进制长度,用“,”隔开")]
|
[DisplayName("4、长度组")]
|
public string list_Length
|
{
|
get
|
{
|
|
if (settings == null || settings.Length_Ds == null) return null;
|
return string.Join(",", settings.Length_Ds);
|
}
|
set
|
{
|
try
|
{
|
if (value == null) return;
|
if (settings == null) settings = new SaveSettings();
|
settings.Length_Ds = value.Split(',').ToList().Select(n => int.Parse(n)).ToList();
|
}
|
catch
|
{
|
|
}
|
|
}
|
}
|
|
[Category("2、存储")]
|
[Description("一组Range值,表示每一位向量的范围,举例:1,2|2,3|0.3,0.4")]
|
[DisplayName("5、范围组")]
|
public string list_Range
|
{
|
get
|
{
|
if (settings == null || settings.list_Range == null) return null;
|
return string.Join("|", settings.list_Range.Select(n => $"{n.Min},{n.Max}"));
|
}
|
set
|
{
|
try
|
{
|
if (value == null) return;
|
if (settings == null) settings = new SaveSettings();
|
settings.list_Range = value.Split('|').ToList().Select(n => new DRange(double.Parse(n.Split(',')[0]), double.Parse(n.Split(',')[1]))).ToList();
|
}
|
catch
|
{
|
}
|
|
}
|
}
|
|
|
|
[Category("2、存储")]
|
[Description("一组Range值,表示每一位向量的范围,举例:{1,2},{2,3}")]
|
[DisplayName("6、闪存设置")]
|
[Browsable(false)]
|
public SaveSettings settings { get; set; }
|
|
|
|
|
}
|
}
|