Exemplo n.º 1
0
 protected override void DoWork()
 {
     lock (portal)
     {
         try
         {
             PresetStoreSCL        scl         = new PresetStoreSCL(blockName, valueTypeName, null);
             PresetStoreEnabledSCL enabled_scl = new PresetStoreEnabledSCL(blockEnabledName, valueTypeName, enableTypeName, null);
             foreach (var tag in tags)
             {
                 if (!tag.noStore)
                 {
                     scl.AddStore(tag.tagPath);
                     enabled_scl.AddStore(tag.tagPath);
                 }
             }
             TIAutils.ImportPlcBlockXML(scl.Document, resultGroup);
             TIAutils.ImportPlcBlockXML(enabled_scl.Document, resultGroup);
         }
         catch (Exception ex)
         {
             LogMessage(MessageLog.Severity.Error, "Failed to create preset store SCL block:\n" + ex.Message);
             return;
         }
     }
 }
 protected override void DoWork()
 {
     lock (portal)
     {
         try
         {
             PresetRecallSCL scl = new PresetRecallSCL(blockName, valueTypeName, enableTypeName, null);
             foreach (var tag in tags)
             {
                 scl.AddRecall(tag.tagPath);
             }
             TIAutils.ImportPlcBlockXML(scl.Document, resultGroup);
         }
         catch (Exception ex)
         {
             LogMessage(MessageLog.Severity.Error, "Failed to update preset recall SCL block:\n" + ex.Message);
             return;
         }
     }
 }