Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/16/2020 in Posts

  1. NI Week was a blast and while there I got to mention a few things I was trying that I'd like to share with the community. One of them is this thing I'm calling a Multi Panel Interface (MPI). The code is rough around the edges, very rough. This is probably the least polished code I've posted in a long time but this code has been sitting in a half working state for a while, and if I took the time to clean it up, it might never be ready. So please be gentle, there's room for improvement but I think the basics are there. Now with that out of the way here's what I got. I wanted to make an interface similar to Veristand. I don't want to re-create the wheel when it isn't necessary but anyone who has worked with Veristand knows that there are quite a few limitations, and as a result I started developing a UI that is dynamic. So that controls and indicators can be added and setup in way that could be saved and loaded for different operator types. This would be setting and getting event based information from Actors running asynchronously. Implementation It is a publisher subscriber architecture. Here there are actors for each set of hardware we care to read from. Later we could talk about controlling Actors but for now lets just talk reading. So for example there maybe an Actor for CAN, Power Supply, AIO, DIO, FPGA, Real-Time (talking to another PC), UPS, etc. Each Actor has a functional global that describes what data it has for other panels to display. For the time lets call any data an Actor is publishing a "channel". An Actor will publish the channel data to user events, and in a global it will have the list of user events and their names so they can be subscribed to. The actual messaging system between the Actors and the Panels can be anything and in my demo I actually just have random numbers because the demo isn't meant to showcase the messaging it is meant to showcase the UI. UI The purpose of the demo posted is to show that a tabbed interface can be made, and be made semi-dynamically. There are 3 things to be defined to understand what is going on. The Parent VI, the Panel VI, and the Child VI. In the demo the Parent is the top level "Main.vi". Clicking the "Add" button will add a Panel VI which is a shell of a VI that has controls to minimize, pop out, and control menus to the Child. The Panel has a subpanel that contains the Child VI. The Child VI in this demo is only a graph showing random data. The Child VI is tied to the Panel VI using a subpanel. The Panel VI is tied to the Parent VI using Windows user32.dll function calls. The user can interact with the Child anyway the child defines. There is no right click override (like in Veristand) where you can no longer right click on a graph and get a menu. The Parent VI also has little restrictions. It is a normal VI with a menu bar which can be used for things like managing Panels. In the demo there is also tabs in the Parent. They are fake tabs in that there are 20 but the ones not being used are hidden. There are neat UI elements that are hard to describe in text. Things like docking/undocking Panels, minimizing Panels while docked or not, resizing Panels while docked or not, moving panels quickly and easily, renaming panels, intuitively adding tabs while moving panels. These are the basics that I didn't know if I could do so I did first. The messaging I described before is not difficult it just takes some time to define how Actors talk and how Panels subscribe to the data. I know there are some UI bugs. The biggest one that you'll notice is trying to move a Panel when docked will have some z-order issues with other Panels that are docked, but there are others. Code The actual code in the demo uses several pieces of code I've found. The parent child idea I originally saw in the Dynapanels demo. Then there are several user32 functions from the Windows API. Panel controls were from UI Panels. OpenG Array, Error, and Application Control is needed, I'm not sure if there are others. http://screencast.com/t/P9SJ1anR Please feel free to comment and use as you see fit. Just know I won't be supporting this as a real project. Multi Panel Interface.zip
    1 point
  2. You're right, this needs an example. How you describe it sounds correct. I've had as many as four update Booleans, I think.
    1 point
  3. It's documented in the DEV Template. I use a feedback timeout that is default 0 ms from every case but the Timeout case (which feeds back -1). This makes the Timeout case execute exactly once after the event queue is empty. Use a "Display needs update" boolean flag to record if the display needs updating in the timeout case. One can do this with Queues as well. With this one is able to look at all incoming data, but do expensive display operations only as often as possible (but as quickly as possible). So you could, for example, have information coming in a 100 a second, and display using fancy techniques (like complex 2D pictures) that take 100ms+. This is more responsive and a look more robust than the "drop old stuff" technique.
    1 point
  4. You can use the Flush Event Queue function to clear out old events.
    1 point
  5. A Notifier is only usable is you only have one type of message coming in, and your display doesn't include any history, like a chart. Personally, I keep the data transfer lossless, but just make the actual front panel display update lossy.
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.