Jump to content

jgcode

LabVIEW Tools Network
  • Posts

    2,397
  • Joined

  • Last visited

  • Days Won

    66

Posts posted by jgcode

  1. Since it's a wiki, wouldn't it make sense to move its content to labviewwiki.org and use LAVA for its forums?

    The wiki has been mentioned however LAVA has a new Knowledge Base that I am currently reviewing for suitability also.

  2. I am interested in helping in developing OpenG. My problem is that I work for a company that automatically owns everything I do. I plan on making an agreement with them so that I can develop open source. I am an engineer, not a lawyer. Is there any advice for what should or should not be in such an agreement and any specific wording to be aware of?

    Just to clarify -are you saying that they own everything you do at work or in your personal time as well?

  3. So with most LabVIEW UI issues there is a work around. This work around only works for strings controls unfortunately. Hide the real string control off screen that has focus, then have it use the event for change value updating the string control on screen. Attached is an example in 2009 that does this. The key is to enable "Update Value When Typing" on the string with focus so that an event is fired after every key press.

    Nice!

    Another issue I can see with this is that you don't have a visual indication that the string has focus e.g. no | in the control.

    Also you can still tab in this example and get the black rectangle of course, this could be easily fixed by skipping this control during tabbing.

  4. I am new to object oriented and I am interested in learning it. I have a problem that I am not sure what is the best way to solve in OOP design. For my test I use a Scope. I create a class called Scope and define the data type of my base class as Address, Set Horizontal settings. I will now create a inherited class from my base class for Model 1. The Model one is having the class datatype as my base class so I create overriding VIs that will let me set the values for Address and Set Horizontal Settings. 3 weeks later, customer wants to change the power supply from Model 1 to model 2. This model now has a new configuration called, Channel Range. I have written all my test code using the base class. Now my software has to support both my Model 1 and Model 2 at any time. What is the best way to handle this? Is there a simple way to add new configuration without much changes to my Test code that uses my base class. At any time I need to be able to swap between Model 1 and Model 2.

    The ways that I can think of are, In test code have a Case statement for just Model specific settings and where ever base class is applicable use the base VIs. I am not sure if it is the best way to do it.

    Thanks in advance

    If your instruments differ in configuration settings, but behave similarly (?) then the following may help:

    • You could use a case structure, but if I do this with LVOOP, I usually think I am doing something wrong or I could do it better.
    • Load the configuration information from disk, internal to a class. Have a method that e.g. accepts a path which loads config info and updates that instance's data. The file structure can be different for each Model.
    • Have a configuration object as a data member of the Scope class. Create accessors for the configuration object. This config object would have children for Model 1 and 2 that would contain the correct data for that Model (and the base config class could contain shared settings). You would need to upcast to the correct configuration class when you use it inside each Model but that shouldn't be a big deal. This will separate your config stuff from your how your instrument actually works which can be handy.
    • I am sure there are other ways to implement this too.

  5. Hi,

    I would like to know if a class can have an array of objects from the same class. For example if I have a class Human, can it holds an array of its children (they are humans too) ?

    C++ equivalent:

    class Human{

    private :

    list<Human> children;

    }

    I've tried it and it gives me the "Private data control of this class uses an illegal value for its default data ..." error. Is there a way around that or do I have to use inheritance or the composite pattern?

    Thanks

    It may also be handy to state why you are trying to accomplish the above (use case), as someone maybe able to offer an alternative solution to your problem.

  6. Curiously, however, remains open window of the VI OpenG Builder ... :blink:

    I just meant by my comments that the OpenG Builder (OGB) may have changed (been worked on by JKI) quite a bit (or not much at all).

    As I remember there was mention that OGB was no longer an external dependency of VIPM - around VIPM 3.0/2010 if I am correct - and it was now included.

    ...So if you were to go digging and change something, it would be best to look in the right place :)

    Anyways I did some digging just then as I was interested and this is what I found:

    OGB is licensed under LGPL so it cannot be in the exe as I mentioned above.

    I found the external library for OGB for VIPM here:

    post-10325-0-43966000-1332246572_thumb.p

    The build version is:

    post-10325-0-18478500-1332246567.png

    Comparing this to the latest OGB on the VI package network, it is newer:

    post-10325-0-71743400-1332246565.png

    Although the actual package versioning is different to the build version VI?:

    (So it might not be correct? I don't know the answer to that at the moment).

    post-10325-0-82650200-1332246568_thumb.p

    Might not help much, but I answered my questions :lol:

  7. Again, I've solved the problem. Here the solution to allow others people to do not waste time with this stupid thing. The problem was due to the name of error file I've created. To be loaded from the IDE, it must be named as you want except for the last part of the name which have to be "-errors" and which you have to insert before of the "txt", the extension of the file. This is required but no one says it to you!

    Anyway, thank you for the support you've given me many times.

    Good job on solving your issues.

    Here is a KB on custom error files that may provide more info for others (that includes links to other resources at bottom).

  8. I have cross-posted even there, but I thought that perhaps some of you might have encountered the same problem ... :frusty:

    Yes, I see that. It's just if I was needing assistance with VIPM I would (and do) head over there.

    No idea on how to fix this problem or where it can be located in the OpenG Builder code?

    This is actually an interesting question as I would have thought that (nowdays) VIPM would install it's own version of OpenG Builder (possibly stored in the exe) and that it would have been worked on by JKI. I am just guessing tho?

  9. A while back AQ issued a request to finish some code located in <resource>\Framework\Providers\LVClassLibrary\NewAccessors

    The with great power come great responsibility line always stuck in my head and it was on my to-do list however, it took me a while to look at it (plus my scripting skills have improved slightly since then :)).

    Basically the code operates on a Class which has other Classes as Data Members (composition) and allows the end user to create an API that wraps the required Data Member methods (delegation):

    Remember, with great power comes great responsibility. What do I mean by this? I mean that I'd like someone to finish writing the ElementWrapperRetooler.lvclass for me. :-) It's one of the classes that is now unlocked. That class is the start of a solution to "I have a class X that has another class Y as a private data member. I want to create a new method on X that has the same conpane as a method on Y but with all terminals of type Y replaced with terminals of type X. On the block diagram, I want to unbundle the Y, call Y's method, and if there's an output, put the Y back into my X cluster." This has been requested by many people over the four years since LV was released to accelerate development of the Delegate pattern and similar patterns, but I've never finished writing it.

    post-10325-0-50706400-1331994166.png

    I have now finished off the existing code and bolted on a UI and included it with LVOOP Assistant.

    I made this a separate thread for a few reasons (not discussed here).

    Feedback on this feature would be really appreciated.

    I thought I'd put it out for testing and to get feedback.

    The aim of this tool is to speed up development.

    This wasn't my first choice in how to design the GUI etc... integrating it into the current LVOOP GUI's that ship with LabVIEW would be grand, but these are locked.

    So this way was by far the easiest for me.

    My next mission is to see if I can get this natively included with LabVIEW :P

    Instructions:

    Class A contains other Classes as Data Members

    Nesting of Data Members (stored in clusters) is also supported

    post-10325-0-31519900-1331994159.png

    Public methods are may be selected

    In this case Class B is Friends with A - which means A can have B's community-scoped on their block diagram

    Private and Protected scoped methods are not supported as

    • Private would break
    • Protected is not logical as LabVIEW does not allow a Child as a Data Member of a Parent

    post-10325-0-71348200-1331994212_thumb.p

    The script is accessed through the Project Provider by right-clicking on a Class (that contains data members) and selecting LVOOP Assistant >> Create Element Wrappers

    post-10325-0-22671300-1331994165.png

    The GUI will appear and allow the end user to select the Data Member that will be worked on as well the methods that will be wrapped

    Public methods and green, Community methods are blue

    Click a method to check/uncheck it, or use the buttons to batch check/uncheck etc...

    post-10325-0-07639200-1331994163_thumb.p

    In the example Data Member 2 is chosen - which is an instance of Class B, which has the following methods

    post-10325-0-80646500-1331994161.png

    Clicking OK creates the following methods for Class A

    post-10325-0-59007700-1331994160.png

    What is happening from a scripting perspective is that Class B's method is copied

    post-10325-0-66431800-1331994156_thumb.p

    Converted to a Class A method

    post-10325-0-53406800-1331994154_thumb.p

    Class A's BD is cleared, then the method is delegated to Class B.

    post-10325-0-50706400-1331994166.png

    Here is a demonstration (no sound)

    <!-- copy and paste. Modify height and width if desired. --> <object id="scPlayer" width="957" height="652" type="application/x-shockwave-flash" data="http://content.screencast.com/users/jgcode/folders/LVOOP%20Assistant/media/d749a41d-0411-46de-a9ac-2df37c6dc6f9/jingswfplayer.swf" > <param name="movie" value="http://content.screencast.com/users/jgcode/folders/LVOOP%20Assistant/media/d749a41d-0411-46de-a9ac-2df37c6dc6f9/jingswfplayer.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#FFFFFF" /> <param name="flashVars" value="thumb=http://content.screencast.com/users/jgcode/folders/LVOOP%20Assistant/media/d749a41d-0411-46de-a9ac-2df37c6dc6f9/FirstFrame.jpg&containerwidth=957&containerheight=652&content=http://content.screencast.com/users/jgcode/folders/LVOOP%20Assistant/media/d749a41d-0411-46de-a9ac-2df37c6dc6f9/LVOOP%20Assistant%20-%20CEW.swf&blurover=false" /> <param name="allowFullScreen" value="true" /> <param name="scale" value="showall" /> <param name="allowScriptAccess" value="always" /> <param name="base" value="http://content.screencast.com/users/jgcode/folders/LVOOP%20Assistant/media/d749a41d-0411-46de-a9ac-2df37c6dc6f9/" /> Unable to display content. Adobe Flash is required.</object>

    Enjoy!

    -JG

    Example Code in LabVIEW 2011

    cew example_LV2011.zip

    • Like 2
  10. There is an interesting new post on the LabVIEW Tools Network Developer Center Blog that talks about a facet of deprecating code - How to Change Connector Panes in New Versions of an API.

    I added a comment based on my experiences about deprecation in general, with examples from OpenG.

    Please check out the blog post and add your comments on this interesting topic!

    I would am very interested to hear what over developers do, as well as see examples including libraries and classes etc...

    Regards

    -JG

    • Like 1
×
×
  • Create New...

Important Information

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