Example #1
0
 public void DelCont(PlcItem i) {
   _cont.Remove(i);
   if(block==i) {
     block=null;
   }
   if(i==_src) {
     owner.SetFlagI(0, true);
     _src=null;
   }
   if(_cont.Count==0) {
     owner.changed -= owner_changed;
     PLC.instance.DelVar(this);
   }
 }
Example #2
0
 public void AddCont(PlcItem i) {
   _cont.Add(i);
   PiBlock b;
   PiLink l;
   if((b= i as PiBlock)!=null) {
     block=b;
     if(block._decl!=null && block._decl.pins[owner.name].op) {
       if(ip) {
         throw new ArgumentException(string.Format("{0} already hat source {1}", owner.path, _src));
       }
       _src=i;
       owner.SetFlagI(0, false);
     }
   } else if((l=i as PiLink)!=null) {
     if(l.output==this) {
       if(ip) {
         throw new ArgumentException(string.Format("{0} already hat source {1}", owner.path, _src));
       }
       _src=i;
       owner.SetFlagI(0, false);
     }
   }
 }
Example #3
0
 internal void AddBlock(PiBlock bl) {
   _blocks.Add(bl);
 }
Example #4
0
 internal void AddBlock(PiBlock bl)
 {
     _blocks.Add(bl);
 }
Example #5
0
 public void DeInit(PiBlock This) {
   if(_deinitFunc!=null) {
     _deinitFunc.Call(This, null);
   }
 }
Example #6
0
 public void Calc(PiBlock This) {
   if(_calcFunc!=null) {
     _calcFunc.Call(This, null);
   }
 }