Ejemplo n.º 1
0
        // Constructor, copy from existing PLM.
        public Plm(Plm source) : base()
        {
            PlmID        = source.PlmID;
            PosX         = source.PosX;
            PosY         = source.PosY;
            MainVariable = source.MainVariable;

            MyPlmType       = source.MyPlmType;
            MyScrollPlmData = null;
        }
Ejemplo n.º 2
0
        // Constructor.
        public Plm() : base()
        {
            PlmID        = 0;
            PosX         = 0;
            PosY         = 0;
            MainVariable = 0;

            MyPlmType       = null;
            MyScrollPlmData = null;
        }
Ejemplo n.º 3
0
        // Constructor, copy from existing scroll PLM data.
        public ScrollPlmData(ScrollPlmData source) : base()
        {
            Entries = new List <int> ();
            MyPlms  = new HashSet <Plm> ();

            foreach (int i in source.Entries)
            {
                Entries.Add(i);
            }
        }
Ejemplo n.º 4
0
 private bool ForceAddScrollPlmData()
 {
     if (ActivePlm.PlmID == Plm.ScrollID && ActivePlm.MyScrollPlmData == null)
     {
         ScrollPlmData newData = new ScrollPlmData();
         newData.MyPlms.Add(ActivePlm);
         ScrollPlmDatas.Add(newData);
         ActivePlm.MyScrollPlmData = null;
         ChangesMade = true;
         return(true);
     }
     return(false);
 }
Ejemplo n.º 5
0
 public void SetScrollPlmData(ScrollPlmData target, out ScrollPlmData deleteData)
 {
     if (target == MyScrollPlmData)
     {
         deleteData = null;
         return;
     }
     deleteData      = MyScrollPlmData?.UnreferenceMe(this) == 0 ? MyScrollPlmData : null;
     MyScrollPlmData = null;
     if (target?.ReferenceMe(this) ?? false)
     {
         MyScrollPlmData = target;
     }
 }
Ejemplo n.º 6
0
        public bool Connect(List <Data> ScrollPlmDatas, List <PlmType> PlmTypes)
        {
            MyPlmType = PlmTypes.Find(x => x.PlmID == PlmID);
            if (MyPlmType == null)
            {
                MyPlmType = PlmTypes [0];
            }

            if (PlmID == ScrollID)
            {
                MyScrollPlmData =
                    (ScrollPlmData)ScrollPlmDatas.Find(x => x.StartAddressLR == MainVariable);
                if (MyScrollPlmData != null)
                {
                    MyScrollPlmData.MyPlms.Add(this);
                }
                return(MyScrollPlmData != null);
            }
            else
            {
                MyScrollPlmData = null;
            }
            return(true);
        }