NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to hide HTBasic adapter in the TestStand Custom Editor Interface via the API?

Has anyone an idea how to hide an adapter programmatically (using C#) in the custom Editor of TestStand?

I suppose this can be done using the ApplicationMgr…

Patrick

0 Kudos
Message 1 of 6
(3,265 Views)

Hm, the easiest thing is to disable it in the general station settings of the adapter.

 

DisableHTBasic.PNG

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 6
(3,263 Views)

I know this possible via the GUI, but I want to do it via the program interface in C#.

I want to build a TestStand custom interface and limit the number of available adapters conform the privilege of the current user.

0 Kudos
Message 3 of 6
(3,255 Views)

The setting is stored in the TestExec.ini file in the TestStand CFG directory.

Once configured, it is also true for custom UIs.

 

So either configure it on the specific machine or copy the settings file from a machine where it is configured. This seems to be the easiest solution.

You can also modify the file by hand since it is ASCII. Search for _HTBasicAdp_Hidden and set it to "true".

 

The option to set it programmatically is the last option if you want the user of your UI to be able to switch this setting....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 6
(3,252 Views)

Thanks for your quick reply.

 

But, indeed I want to do it from code. The privileges for all our users are stored into an SQL database. When a user logins, the database is consulted to retrieve all the privileges, one of the privileges specifies if a specific adapter is available for the current logged in developer. So, via some C# code, I want to hide some of the adapters.

I do not like the idea to edit the .ini file behind the scenes...

I think, this is possible via the application manager, but it is not easy to figure out how to do this, any suggestion is highly appreciated.

 

I have tried something like the following.

ApplicationMgrConnections applicationMgrConnections = m_AxApplicationMgr.Connections;

AdapterListConnections adapterListConnections = applicationMgrConnections.AdapterList;

The adapterListConnections is a valid com object...

 

Thanks in advance.

 

Patrick

0 Kudos
Message 5 of 6
(3,249 Views)

Ok, since you want to go the hard way:

You have to dig down till you have access to the property Adapter.Hidden:

Hidden Property

Syntax

Adapter.Hidden

Data Type

Boolean

Purpose

Specifies if the adapter is present in the list of adapters. This property is used to hide the adapter.

Remarks

Set this property to True to hide the adapter in controls that display the list of adapters.

 

hope this helps

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 6 of 6
(3,246 Views)