Example #1
0
 public TONViewModel()
 {
     TopTextBlock.Text = InstructionName;
     Model             = new TONModel();
     CommentArea.Children.Add(_commentTextBlocks[0]);
     CommentArea.Children.Add(_commentTextBlocks[1]);
 }
Example #2
0
 static private void Initialize(LadderDiagramViewModel ldvmodel)
 {
     foreach (LadderNetworkViewModel lnvmodel in ldvmodel.GetNetworks())
     {
         foreach (BaseViewModel bvmodel in lnvmodel.GetElements())
         {
             BaseModel bmodel = bvmodel.Model;
             if (bmodel == null)
             {
                 continue;
             }
             if (bmodel is TONModel)
             {
                 TONModel    tmodel  = (TONModel)(bmodel);
                 IValueModel ivmodel = tmodel.TimerValue;
                 if (ivmodel.IsVariable)
                 {
                     continue;
                 }
                 if (ivmodel is TVWordValue)
                 {
                     int index = (int)(ivmodel.Index);
                     timers[index] = new SFCTimerModel(tmodel);
                 }
             }
             else
             {
                 for (int i = 0; i < bmodel.ParaCount; i++)
                 {
                     IValueModel ivmodel = bmodel.GetPara(i);
                     if (ivmodel is SBitValue)
                     {
                         int index = (int)(ivmodel.Index);
                         if (status[index] == null)
                         {
                             status[index] = new SFCStatusModel(ldvmodel);
                         }
                         else if (status[index].LDVModel != ldvmodel)
                         {
                             status[index] = new SFCInvalidStatusModel();
                         }
                     }
                 }
             }
         }
     }
 }
Example #3
0
 public SFCTimerModel(TONModel _model)
 {
     model = _model;
 }