123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Aitex.Core.Common.DeviceData;
- using Aitex.Core.RT.DataCenter;
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Event;
- using Aitex.Core.RT.OperationCenter;
- namespace MECF.Framework.Common.Device.Bases
- {
- public abstract class RfMatchBase : BaseDevice, IDevice
- {
- public virtual EnumRfMatchTuneMode TuneMode1 { get; set; }
- public virtual EnumRfMatchTuneMode TuneMode2 { get; set; }
- public virtual float LoadPosition1 { get; set; }
- public virtual float LoadPosition2 { get; set; }
- public virtual float TunePosition1 { get; set; }
- public virtual float TunePosition2 { get; set; }
- public virtual float DCBias { get; set; }
- public virtual float BiasPeak { get; set; }
- public virtual AITRfMatchData DeviceData { get; set; }
- protected RfMatchBase() : base()
- {
- }
- protected RfMatchBase(string module, string name) : base(module, name, name, name)
- {
- }
- public virtual bool Initialize()
- {
- DATA.Subscribe($"{Module}.{Name}.DeviceData", () => DeviceData);
- DATA.Subscribe($"{Module}.{Name}.TuneMode1", () => TuneMode1.ToString());
- DATA.Subscribe($"{Module}.{Name}.TuneMode2", () => TuneMode2.ToString());
- DATA.Subscribe($"{Module}.{Name}.LoadPosition1", () => LoadPosition1);
- DATA.Subscribe($"{Module}.{Name}.LoadPosition2", () => LoadPosition2);
- DATA.Subscribe($"{Module}.{Name}.TunePosition1", () => TunePosition1);
- DATA.Subscribe($"{Module}.{Name}.TunePosition2", () => TunePosition2);
- OP.Subscribe($"{Module}.{Name}.SetTuneMode1", (function, args) =>
- {
- if (!Enum.TryParse((string)args[0], out EnumRfMatchTuneMode mode))
- {
- EV.PostWarningLog(Module, $"Argument {args[0]}not valid");
- return false;
- }
- SetTuneMode1(mode);
- return true;
- });
- OP.Subscribe($"{Module}.{Name}.SetLoad1", (function, args) =>
- {
- SetLoad1((float)args[0]);
- return true;
- });
-
- OP.Subscribe($"{Module}.{Name}.SetTune1", (function, args) =>
- {
- SetTune1((float)args[0]);
- return true;
- });
- OP.Subscribe($"{Module}.{Name}.SetTuneMode2", (function, args) =>
- {
- if (!Enum.TryParse((string)args[0], out EnumRfMatchTuneMode mode))
- {
- EV.PostWarningLog(Module, $"Argument {args[0]}not valid");
- return false;
- }
- SetTuneMode2(mode);
- return true;
- });
- OP.Subscribe($"{Module}.{Name}.SetLoad2", (function, args) =>
- {
- SetLoad2((float)args[0]);
- return true;
- });
- OP.Subscribe($"{Module}.{Name}.SetTune2", (function, args) =>
- {
- SetTune2((float)args[0]);
- return true;
- });
- OP.Subscribe($"{Module}.{Name}.SetActivePresetNo1", (function, args) =>
- {
- SetActivePresetNo1((int)args[0]);
- return true;
- });
- OP.Subscribe($"{Module}.{Name}.SetActivePresetNo2", (function, args) =>
- {
- SetActivePresetNo2((int)args[0]);
- return true;
- });
- OP.Subscribe($"{Module}.{Name}.SetPreSetsAndTrajectories1", (function, args) =>
- {
- SetPreSetsAndTrajectories1((Presets)args[0]);
- return true;
- });
- OP.Subscribe($"{Module}.{Name}.SetPreSetsAndTrajectories2", (function, args) =>
- {
- SetPreSetsAndTrajectories2((Presets)args[0]);
- return true;
- });
- OP.Subscribe($"{Module}.{Name}.EnablePreset1", (function, args) =>
- {
- EnablePreset1((bool)args[0]);
- return true;
- });
- OP.Subscribe($"{Module}.{Name}.EnablePreset2", (function, args) =>
- {
- EnablePreset2((bool)args[0]);
- return true;
- });
- OP.Subscribe($"{Module}.{Name}.EnableCapacitorMove1", (function, args) =>
- {
- EnableCapacitorMove1((bool)args[0]);
- return true;
- });
- OP.Subscribe($"{Module}.{Name}.EnableCapacitorMove2", (function, args) =>
- {
- EnableCapacitorMove2((bool)args[0]);
- return true;
- });
- return true;
- }
- public virtual void SetPreSetsAndTrajectories1(Presets presets)
- {
- throw new NotImplementedException();
- }
- public virtual void SetActivePresetNo2(int v)
- {
- throw new NotImplementedException();
- }
- public virtual void SetPreSetsAndTrajectories2(Presets presets)
- {
- throw new NotImplementedException();
- }
- public virtual void EnablePreset1(bool v)
- {
- throw new NotImplementedException();
- }
- public virtual void EnablePreset2(bool v)
- {
- throw new NotImplementedException();
- }
- public virtual void EnableCapacitorMove1(bool v)
- {
- throw new NotImplementedException();
- }
- public virtual void EnableCapacitorMove2(bool v)
- {
- throw new NotImplementedException();
- }
- public virtual void SetActivePresetNo1(int v)
- {
- throw new NotImplementedException();
- }
- public virtual void SetTuneMode1(EnumRfMatchTuneMode enumRfMatchTuneMode)
- {
- }
- public virtual void SetMatchPositionC1(float c1, out string reason)
- {
- reason = string.Empty;
- TunePosition1 = c1;
- }
- public virtual void SetMatchPositionC2(float c2, out string reason)
- {
- reason = string.Empty;
- TunePosition2 = c2;
- }
- public virtual void SetMatchPosition(float c1, float c2, out string reason)
- {
- reason = string.Empty;
- TunePosition1 = c1;
- TunePosition2 = c2;
- }
- public bool SetMatchMode(string mode, out string reason)
- {
- reason = string.Empty;
- return true;
- }
- public virtual void SetLoad1(float load)
- {
- }
- public virtual void SetTune1(float tune)
- {
- }
- public virtual void SetTuneMode2(EnumRfMatchTuneMode enumRfMatchTuneMode)
- {
- }
- public virtual void SetLoad2(float load)
- {
- }
- public virtual void SetTune2(float tune)
- {
- }
- public virtual void Terminate()
- {
- }
- public virtual void Monitor()
- {
- }
- public virtual void Reset()
- {
- }
- }
- }
|