CognoscentUI is a user interface framework intended to host modules within a SubPanel within an XControl. Instances of modules are able to run concurrently, and the framework allows for easy development of new modules to perform any sort of UI task.
CognoscentUI was developed as a contest entry for the LV2010 Coding Challenge (LVXCC), and it is specifically distributed as a reference source code example, demonstrating the following:
CognoscentUI is composed of three discrete frameworks (plus some eye candy):
This is the heart of the framework. The container is made of three distinct parts: the Titlebar, the SubPanel, and the Status Bar
This plugin displays pictures in a ring the user can spin around using a mouse (or finger if using a touchscreen).
This module plug-in displays a linear list of text and icons. The user can pan the list using a mouse (or finger if using a touchscreen).
LabVIEW 2010 - No additional drivers, add-ons, or toolkits required.
It's embarrassing how choppy the animations are in the the video. I would recommend that as you watch the video on one monitor, recreate the demonstration yourself on your other monitor. (Harder said than done if, like me, you only have one monitor ) Use the link below to download the 2.2MB Zip file, then run "CognoscentUI_Example.vi"
From the XControl Façade. When the XControl receives a message (from the Val(Sgnl) on the 'Interprocess Message' class control), the message is interpreted and handled by a case structure. The case shown handles the action for a module requesting to be inserted into the container.
The base messaging class has a method called "Send Message", and this screenshot shows the override implemented in the User Event child class. (At first, I only had one messaging class based on User Events, and it ended up genericized into a messaging base class since XControls won't "wake up" for User Events.)
When the "Activate Module" method is called, this method launches a reentrat clone of the module. Ugh, if only we had better dynamic launching.
Notice this guy has no Error terminals - it's a dynamically launched process that runs whenever a "Mouse Down?" event is detected on objects that can be manipulated with the mouse (the title bar moving the Container, the resize handle on the Container, the Pic Ring rotation...). The Object Kinematics class defines (overrides) how an object will move, and as the mouse moves "SetTarget" is called on the class to continually update the set point of the animation controller. The process continues until the button is no longer held.
One goal for this project was to not require anything more than a clean LabVIEW 2010 installation. The result? A few homebrew image processing routines. Note the interface only allows an input called "Sharpness (0.0 to 1.0)". One theme I tried to carry around this project is abstraction: develop interfaces through the eyes of the end user. The end user only cares about how blurry or sharp the image is: a value of 1.0 means no blurriness whatsoever, and a value of 0.0 means the entire image is smeared to oblivion.
I'm glad you asked!
1. Save a new instance of the CogMod_Template.lvclass
2. Give it a kickin' new name. Create a "Copy" of the Template - don't "Rename" the Template! Add it to your project.
3. At this point, you have the skeleton of a new module that's ready to be instantiated and used! Just drop an Invoke Node "Activate Module" for the container on your calling diagram and insert an instance of your Kickin' New Module Class. To add functionality to the new module, edit the "CogMod_Display.vi" class member. Consider this VI loosely analogous to the Façade member of an XControl - it must be present, and it contains the FP display of the module. Within this small VI, you will find brief instructions on how the VI should react to messages sent to it by the containing CognescentUI XControl. Feel free to add whatever class members you want, but don't change the inheritance of the class (the Template already made your new class inherit from Module base class).
There are compelling arguments against using typedefs. Madness?! You decide. I think I pulled it off with this project, and if someone can show where typedefs would produce more robust code, I'd love to discuss it in the comments.
Based on demand, I have added an additional download for a downconvert to LV2009.
This project is not complete and buggy. Like any framework, if it's going to be legit, it's got to be vetted.
The future of this project is demand-driven.
Kindly disregard all profane comment blocks I forgot to erase from source code prior to distribution.
Released under Creative Commons Attribution Unported 3.0 license - please be aware of the terms prior to further development or redistribution of this framework.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.