/// <summary> /// Create Application report from TdmsObject /// </summary> /// <param name="attribute"></param> /// <returns></returns> public static string GetGuidSilent(this TDMSAttribute attribute) { try { return(attribute.Object.GUID); } catch (Exception) { return(string.Empty); } }
public DateTimeTdmsAttributeValueBehavior(TDMSAttribute attribute) : base( attribute, new SafeInvocation <TDMSAttribute, DateTime>( new Invocation <TDMSAttribute, DateTime>( attribute, (attr) => Convert.ToDateTime(attribute.Value) ) ) ) { }
//var attrName = "A_Obj_Ref_Tbl"; //var table = tdmsObject.Attributes.FirstOrDefault(a => a.AttributeDefName.Equals(attrName)); //table.Rows.RemoveAll(); //var nppsGuids = tdmsCorrectionAction.Npps.ToList(); //foreach (var nppGuid in nppsGuids) { // var nppFromTdms = app.GetObjectByGUID(nppGuid); // if (nppFromTdms == null) continue; // var nppCode = nppFromTdms.Attributes["A_Object_Code"]; // var nppDescription = nppFromTdms.Attributes["A_Desc_ObjPJ"]; // var newRow = table.Rows.Create(); // newRow.Attributes["A_Object_Code"].Value = nppCode; // newRow.Attributes["A_Desc_ObjPJ"].Value = nppDescription; // newRow.Attributes["A_Object_Ref"].Value = nppFromTdms; //} //} private void FillTableWithAllNpps(TDMSAttribute table, ICa tca) { if (table == null) { return; } var npps = app.GetObjectsByGUIDs(tca.Npps.ToList()); table.Rows.RemoveAll(); AddRows(table, npps); }
public TdmsObjectTdmsAttributeValueBehavior(TDMSAttribute attribute) : base( attribute, new SafeInvocation <TDMSAttribute, TDMSObject>( new Invocation <TDMSAttribute, TDMSObject>( attribute, (attr) => attr.Object ) ) ) { }
public StringTdmsAttributeValueBehavior(TDMSAttribute attribute) : base( attribute, new SafeInvocation <TDMSAttribute, string>( new Invocation <TDMSAttribute, string>( attribute, (attr) => attr.Value.ToString() ) ) ) { }
public TdmsUserTdmsAttributeValueBehavior(TDMSAttribute attribute) : base( attribute, new SafeInvocation <TDMSAttribute, TDMSUser>( new Invocation <TDMSAttribute, TDMSUser>( attribute, (attr) => attr.User ) ) ) { }
public BoolTdmsAttributeValueBehavior(TDMSAttribute attribute) : base( attribute, new SafeInvocation <TDMSAttribute, bool>( new Invocation <TDMSAttribute, bool>( attribute, (attr) => Convert.ToBoolean(attr.Value) ) ) ) { }
private static void AddRows(TDMSAttribute table, IEnumerable <TDMSObject> npps) { foreach (TDMSObject npp in npps) { IninializeTableAttributeRow( table.Rows.Create(), CreateRowNames(), CreateRowValues( npp, CreateRowNames() ) ); } }
public static IEnumerable <TDMSTableAttributeRow> GetRowsSafe( TDMSAttribute table) { try { return(table.Rows); } catch (Exception) { return(Enumerable .Empty <TDMSTableAttributeRow>()); } }
private void FillTableWithKudanKulamNpps(TDMSAttribute table, ICa tca) { if (table == null) { return; } var kudanKulamGuids = new KudanKulamNppMaps().Select(nppMap => nppMap.Guid); var containsKudanKulam = tca.Npps.ToList().Intersect(kudanKulamGuids); if (!containsKudanKulam.Any()) { return; } var npps = app.GetObjectsByGUIDs(kudanKulamGuids.ToList()); table.Rows.RemoveAll(); AddRows(table, npps); }
public DocumentBlocks(TDMSAttribute attribute) { this.attribute = attribute; }
public FolderBlocks(TDMSAttribute attribute) { this.attribute = attribute; }
public static IEnumerable <TDMSTableAttributeRow> GetRows( TDMSAttribute table) { return(table.Rows); }
private TDMSClassifier GetClassifierSilent(TDMSAttribute attribute) { try { return(GetClassifier(attribute)); } catch (Exception) { return(null); } }
private TDMSClassifier GetClassifier(TDMSAttribute attribute) { return(attribute.Classifier); }
public TdmsAttributeValueBehavior(TDMSAttribute attribute, IInvokable <TDMSAttribute, TResult> invocation) { Invocation = invocation; }