Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InstrumentNameFix #162

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions OpenTAP.TUI/OpenTAP.TUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,11 @@ public override int TuiExecute(CancellationToken cancellationToken)
{
settingsView = new ComponentSettingsWindow(obj);
}

settingsView.Height = Dim.Fill(2);
settingsView.X = 1;
settingsView.Width = Dim.Fill(1);

Application.Run(settingsView);
TestPlanView.UpdateHelperButtons();
});
Expand Down
13 changes: 12 additions & 1 deletion OpenTAP.TUI/Views/PropertiesView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,17 +390,28 @@ public void LoadProperties(object obj, bool mustIncludeSubmit = false)

public static bool FilterMember(IMemberData member)
{
if (member.DeclaringType.DescendsTo(resourceTypeData) && member.Name == nameof(Resource.Name))
return true;
if (member.GetAttribute<BrowsableAttribute>() is BrowsableAttribute attr)
return attr.Browsable;
if (member.HasAttribute<OutputAttribute>())
return true;
return member.Attributes.Any(a => a is XmlIgnoreAttribute) == false && member.Writable;
}

static ITypeData resourceTypeData = TypeData.FromType(typeof(IResource));

AnnotationCollection[] getMembers()
{
return annotations?.Get<IMembersAnnotation>()?.Members
.Where(x => x.Get<IAccessAnnotation>()?.IsVisible ?? false)
.Where(x =>
{
var member = x.Get<IMemberAnnotation>().Member;
if (member.DeclaringType.DescendsTo(resourceTypeData) && member.Name == nameof(Resource.Name))
return true;

return x.Get<IAccessAnnotation>()?.IsVisible ?? false;
})
.Where(x =>
{
var member = x.Get<IMemberAnnotation>()?.Member;
Expand Down
Loading