示例#1
0
 private void AddChildrenToAlarmworxExportTable(ExportTable.AlarmWorxExportTableDataTable exportTable, List<S7DataRow> Children, string strCommentPath)
 {
     foreach (S7DataRow child in Children)
     {
         if (!child.IsArray)
         {
             ExportTable.AlarmWorxExportTableRow newRow = exportTable.NewAlarmWorxExportTableRow();
             switch (child.DataType)
             {
                 case S7DataRowType.BOOL:
                     newRow.LocationPath = "\"" +  @"\\Alarm Configurations\" + SelectedAlarmFolder + "\"";
                     newRow.Name = "\"" +  SelectedAlarmFolder + "." + child.StructuredName + "\"";
                     newRow.Description = "\"" + child.Comment + "\"";
                     newRow.LastModified = DateTime.Now;
                     newRow.Input1 = "\"" + SelectedOPCServer + "." + CurrentBlock.Value.SymbolicName + "." + child.StructuredName + "\"";
                     newRow.BaseText = "\"" + strCommentPath.Trim() + " " + child.Comment.Trim() + "\"";  // Message text
                     newRow.DIG_MsgText = " ";   // Prevents 'Digital Alarm' text at the end of each message
                     exportTable.AddAlarmWorxExportTableRow(newRow);
                     break;
                 case S7DataRowType.UDT:
                 case S7DataRowType.STRUCT:
                     // Build comments path string, separate each level by the space
                     AddChildrenToAlarmworxExportTable(exportTable, child.Children, strCommentPath.Trim() + " " + child.Comment.Trim());
                     break;
                 default:
                     break;
             }
         }
     }
 }