Files
wg_cpso/CPSO/Forms/46_Distribution/ViewDistribution.cs

59 lines
2.0 KiB
C#
Raw Permalink Normal View History

2026-03-25 18:20:24 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using CaeGlobals;
using CaeModel;
using DynamicTypeDescriptor;
using CaeMesh;
namespace CPSO
{
[Serializable]
public abstract class ViewDistribution
{
// Variables
private DynamicCustomTypeDescriptor _dctd;
// Properties
[Category("Data")]
[OrderedDisplayName(0, 10, "Name")]
[Description("Name of the distribution.")]
[Id(1, 1)]
public abstract string Name { get; set; }
//
[Category("Data")]
[OrderedDisplayName(1, 10, "Type")]
[Description("Select the distribution type.")]
[Id(2, 1)]
public abstract DistributionTypeEnum DistributionType { get; set; }
//
[Category("Orientation")]
[DisplayName("Coordinate system")]
[Description("Select the coordinate system for the boundary condition.")]
[Id(1, 20)]
public abstract string CoordinateSystemName { get; set; }
//
[Browsable(false)]
public DynamicCustomTypeDescriptor DynamicCustomTypeDescriptor { get { return _dctd; } set { _dctd = value; } }
//
[Browsable(false)]
public abstract Distribution GetBase();
// Constructors
// Methods
public void PopulateCoordinateSystemNames(string[] coordinateSystemNames)
{
List<string> names = new List<string>() { CoordinateSystem.DefaultCoordinateSystemName };
names.AddRange(coordinateSystemNames);
DynamicCustomTypeDescriptor.PopulateProperty(nameof(CoordinateSystemName), names.ToArray(), false, 2);
}
}
}