77 lines
3.2 KiB
C#
77 lines
3.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using CaeMesh;
|
|
using DynamicTypeDescriptor;
|
|
using System.ComponentModel;
|
|
using CaeGlobals;
|
|
using CaeModel;
|
|
|
|
namespace CPSO
|
|
{
|
|
[Serializable]
|
|
public class ViewDFlux : ViewLoad
|
|
{
|
|
// Variables
|
|
private DFlux _flux;
|
|
|
|
|
|
// Properties
|
|
public override string Name { get { return _flux.Name; } set { _flux.Name = value; } }
|
|
//
|
|
[Category("Region")]
|
|
[OrderedDisplayName(2, 10, "Surface")]
|
|
[Description("Select the surface for the creation of the load.")]
|
|
[Id(3, 2)]
|
|
public string SurfaceName { get { return _flux.SurfaceName; } set {_flux.SurfaceName = value;} }
|
|
//
|
|
[Category("Magnitude")]
|
|
[OrderedDisplayName(0, 10, "Flux per area")]
|
|
[Description("Value of the flux per area.")]
|
|
[TypeConverter(typeof(EquationPowerPerAreaConverter))]
|
|
[Id(1, 3)]
|
|
public EquationString Magnitude { get { return _flux.Magnitude.Equation; } set { _flux.Magnitude.Equation = value; } }
|
|
//
|
|
public override string AmplitudeName { get { return _flux.AmplitudeName; } set { _flux.AmplitudeName = value; } }
|
|
[Browsable(false)]
|
|
public override string CoordinateSystemName
|
|
{
|
|
get { return _flux.CoordinateSystemName; }
|
|
set { _flux.CoordinateSystemName = value; }
|
|
}
|
|
public override System.Drawing.Color Color { get { return _flux.Color; } set { _flux.Color = value; } }
|
|
|
|
|
|
// Constructors
|
|
public ViewDFlux(DFlux flux)
|
|
{
|
|
_flux = flux;
|
|
//
|
|
Dictionary<RegionTypeEnum, string> regionTypePropertyNamePairs = new Dictionary<RegionTypeEnum, string>();
|
|
regionTypePropertyNamePairs.Add(RegionTypeEnum.Selection, nameof(SelectionHidden));
|
|
regionTypePropertyNamePairs.Add(RegionTypeEnum.SurfaceName, nameof(SurfaceName));
|
|
//
|
|
SetBase(_flux, regionTypePropertyNamePairs);
|
|
DynamicCustomTypeDescriptor = ProviderInstaller.Install(this);
|
|
}
|
|
|
|
|
|
// Methods
|
|
public override Load GetBase()
|
|
{
|
|
return _flux;
|
|
}
|
|
public void PopulateDropDownLists(string[] surfaceNames, string[] amplitudeNames)
|
|
{
|
|
Dictionary<RegionTypeEnum, string[]> regionTypeListItemsPairs = new Dictionary<RegionTypeEnum, string[]>();
|
|
regionTypeListItemsPairs.Add(RegionTypeEnum.Selection, new string[] { "Hidden" });
|
|
regionTypeListItemsPairs.Add(RegionTypeEnum.SurfaceName, surfaceNames);
|
|
PopulateDropDownLists(regionTypeListItemsPairs);
|
|
//
|
|
PopulateAmplitudeNames(amplitudeNames);
|
|
}
|
|
}
|
|
}
|