123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- using Uestc.Auto6.Dso.Core.Tools;
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- using Uestc.Auto6.Dso.ComModel;
- namespace Uestc.Auto6.Dso.Core
- {
- public abstract class ChannelPrsnt : MulticastPrsnt<IChnlView>, IChnlPrsnt
- {
- private protected abstract override ChannelModel Model
- {
- get;
- }
- public ChannelPrsnt(IChnlView? view)
- {
- if (view != null)
- {
- //建立起View和Presenter的关联
- //这时候View中能使用它所对应的Presenter进行业务逻辑的操作
- view.Presenter = this;
- //通过构造函数将View注入到Presenter中
- TryAddView(view);
- }
- }
- public ChannelType Type => Model.Type;
- public ChannelId Id => Model.Id;
- public String Name => Model.Name;
- public Color DrawColor
- {
- get => Model.DrawColor;
- set => Model.DrawColor = value;
- }
- public virtual Boolean Active
- {
- get => Model.Active;
- set => Model.Active = value;
- }
- public String Label
- {
- get => Model.Label;
- set => Model.Label = value;
- }
- public abstract ISampling Sampling
- {
- get;
- }
- //Default stride is 1000/div, so its name suffix "BymDiv", but the corresponding model name does not.
- public virtual Double PosIndexBymDiv
- {
- get => Model.Conditioning.PosIndex;
- set
- {
- Model.Conditioning.PosIndex = value;
- Dispatcher.SoftReset();
- }
- }
- public Double PosMaxIndex => Model.Conditioning.PosMaxIndex;
- public Double PosMinIndex => Model.Conditioning.PosMinIndex;
- public virtual void ResetPosIndex()
- {
- Model.Conditioning.PosIndex = Model.Conditioning.PosDefIndex;
- Dispatcher.SoftReset();
- }
- public Double PosIdxPerDiv => Model.Conditioning.PosIdxPerDiv;
- /// <summary>
- /// Adjust 'ScaleIndex' to roughly change vertical scale.
- /// </summary>
- public virtual Int32 ScaleIndex
- {
- get => Model.Conditioning.ScaleIndex;
- set
- {
- Model.Conditioning.ScaleIndex = value;
- Dispatcher.SoftReset();
- }
- }
- //public Double ScaleMaxIndex => Model.Conditioning.ScaleMaxIndex;
- //public Double ScaleMinIndex => Model.Conditioning.ScaleMinIndex;
- /// <summary>
- /// Adjust 'ScaleTick' to finely change vertical scale.
- /// </summary>
- public virtual Int32 ScaleTick
- {
- get => Model.Conditioning.ScaleTick;
- set
- {
- Model.Conditioning.ScaleTick = value;
- Dispatcher.SoftReset();
- }
- }
- public String Unit
- {
- get => Model.Conditioning.Unit;
- set => Model.Conditioning.Unit = value;
- }
- public Prefix Prefix => Model.Conditioning.Prefix;
- public WfmPack? Pack => Model.Pack;
- public WfmVuDatabase VuDatabase => Model.VuDatabase;
- public Int64? WindowId
- {
- get => Model.WindowId;
- set => Model.WindowId = value;
- }
- }
- }
|