Use screws of no class within the class

I guess that it is a theory of the question of the OBJECT-oriented programming.

Say that I have 2 classes, 1 is used to adjust the tension on a diet and another is used to update a user interface.  They are not really related to all that there is no common parent class and there is essentially no relationship between them.

Now I write a Subvi, which is a kind of random number generator specialist.  What happens if I want to use this VI in a method of each of the two classes above, I created.  Where this Subvi belongs?

I see the following options, but I don't know who should be.  I'd really like to hear your suggestions because it was bugs me for some time:

(1) create a method in each class that has the functionality of random number generator.  I don't like this idea because I'll be duplicating code.

(2) simply choose store the VI as part of my project and does not include it in classes.  I don't like this, it's that if I decide to reuse my code/class in another project, I need copy screws that are not part of my class with her.

(3) create a kind of "utility" class which should contain all these various screws and then use the methods of this class.  I could pass an object of that class of utilities in each class so I would have access to methods.  But this seems to be quite complicated.

So that is the dilemma.  I wonder how you chose to resolve this problem.  Thank you!

Create a library for reuse.  I recommend looking in the VI package manager.  You can create "packages" of code reuse and 'install' in each version of LabVIEW.  Then everyone can use them since they are in a nice place.

Tags: NI Software

Similar Questions

  • Using cfquery GROUP of output within the intrusion via CFMAIL

    Having a problem with the display of the CFQUERY results grouped in an intrusion via CFMAIL. After studying this question on these forums and the internet, I found some useful information, but have been unable to find the answer to my question...

    Here's what I'm trying to do. I want to send an intrusion via CFMAIL to a single user. So far so good. I do not use CFOUTPUT in the intrusion via CFMAIL and it displays correctly the variables CF.

    The problem is this: I have a CFQUERY that uses the GROUP setting and I want to display these results in AN e-mail. The display works if outside intrusion via CFMAIL:

    < cfoutput query = "GetHoliday" group = "year" >
    < b > #year # < /b > < br >
    < cfoutput > #DateFormat(holiday,"mm/dd/yyyy") #-< / cfoutput > < br > < br >
    < / cfoutput >

    The output looks like this:

    2010

    05/02/2010 - 05/03/2010 - 23/05/2010

    2009

    07/06/2009 - 05/07/2009 - 23/08/2009

    However, inside the intrusion via CFMAIL it does not work. First of all, I took the CFOUTPUTs and used CFLOOP, but then I can't use the GROUP attribute.

    I tried the attribute of the GROUP on the intrusion via CFMAIL, but who sends an e-mail by group. I want only an email sent and the results grouped into this one email as described above.

    Any ideas on what I am doing wrong?

    Or is there a way to run the group outside the intrusion via CFMAIL, store in a variable and display it somehow? I guess not since the query is a type of complex data...

    loamguy wrote:

    Any ideas on what I am doing wrong?

    Or is there a way to run the group outside the intrusion via CFMAIL, store in a variable and display it somehow? I guess not since the query is a type of complex data...

    I don't think you're doing something wrong. As far as I KNOW, there is no method integrated to group the content of the mail exactly in this way that you have described.

    Yes, you could use cfsavecontent to capture grouped. Then include it in your e-mail message.



        #year #.

        #DateFormat(holiday,"mm/dd/yyyy") # -.


    [email protected]"from ="[email protected]"subject ="Holidays">"
    #mailContent #.

  • deploy programmatically variable shared within the standalone version of RT (cRIO-9014)

    Hello

    I have a question about here to use variables shared single process within the standalone version of RT for the cRIO-9014

    I simplified my request of LV (LV2010) in two to test the use of shared variables.  See the attached file.

    (1) only run on the host PC: testHost
    (2) only works on the cRIO-9014: testRTcRIO

    for both, I packed stand-alone executable and source distribution.

    for testHost,.
    (a). I copied \builds\testcRIO\Host to d:/or-rt/xmlrpcFEU source Distribution...
    (b) I run... \builds\testcRIO\Host.exe
    (c) xmlrpcFEUlog - host.txt is generated.

    for testRTcRIO,.
    (a) .d FileZilla to connect to the target of RT on network, I copied... \builds\testcRIO\Source Distribution\c\ni - rt\xmlrpcFEU

    to/or-rt/xmlrpcFEU on the target of RT
    (b) I copied also... \builds\testcRIO\Real-Time Application\c\ni - rt\startup to/or-rt/startup on the target of RT
    (c) Max, I restarted the cRIO-9014.
    (d) xmlrpcFEUlog - RT.txt is generated.

    We see that the shared variable does not work inside the RT target. but worked well on PC. the deployment programmatically method does not work.  any suggestion?

    Another thing is:
    can I use telnet for the RT 9014 target and start the RT app directly? What is the command inside the terminal telnet RT?

    Currently, I can telnet into the cRIO-9014, but, what I can do with it?

    ================
    220-national Instruments FTP
    220 service Ready

    530 journal please with USER and PASS
    USER
    331 user name okay, need password
    PASS
    230 user logged
    Help
    211 - USER PASS ACCT STRU TYPE
    211-MODE CWD XCWD PWD XPWD
    211 CDUP XCUP PASV, RETR, REST
    211-PORT LIST NLST QUIT SYSTEM
    211 STAT HELP NOOP STOR, APPE
    211 STOU HELLO MKD XMKD RMD
    211 XRMD DELE, RNFR TRAVEL SIZE
    211 MDTM
    ===========================

    Concerning

    Xiaofeng


  • Listen to the event within the custom class

    I created a custom class that publishes on a webpage to authorize a user. How can I listen to an event within the custom class?

    It is my code in my main class.

    var customClass:CustomClass = new CustomClass();

    var testingString = customClass.authorize ("[email protected]", "password");

    the fuction "authorizes" within the customClass looks like this:

    public void authorize(user:String,_password:String):void

    {

    jSession = new URLVariables();

    j_Loader = new URLLoader();

    jSession.j_username = user;

    jSession.j_password = password;

    jSend.method = URLRequestMethod.POST;

    jSend.data = jSession

    j_Loader.load (jSend)

    }

    How can I trigger an event in my main class once the j_Loader triggers Event.COMPLETE?

    You can raise an event using the dispatchEvent() function.

    In your main class, you assign a listener to the event the CustomClass distributes when there are.

  • Is it possible to get the activation code of the older PC so that I can use it in my class?

    Original title: Activation of Windows 8.

    If there is some time I had windows 8 pro to use in my construction of future games. Not knowing I could install it on 1 computer (thought it would be at least 2) I installed it as a test on my desktop PC previos where it has not yet run properly cause it was an older model (and if you haven't used since then, cause I have a laptop with Windows7). But now my PC gaming is finished and I suddenly find I could activate only on 1 PC.

    So my question is. Is it possible to get the activation code of the older PCs (that I use even more, maybe even remove it) so that I can use it in my class? Or that the activation code and the money just went in the toilet?
    I could install Windows 7 to 2 different PC-s(didn't try more cause there was no need) with no problems and it wasen can't pack family, why is Windows 8 different? Sometimes errors occur.
    Ask cause I went all on buy the parts, I have no money to buy a new copy of windows 8.
    Awayting for your answers.
    Thank you
    Edit! Maybe I'm a solution. Going to try it out after I return to work.
    It's the solution

    "I have Windows 8/8 Pro is installed on my PC." If I replace with another PC, can I install my copy of Windows 8 on my new PC until I remove it from the other? »

    Yes. The highest point is the one you mentioned: you must remove Windows 8 from your old computer before you activate on the new. In other words, you can have your copy of Windows 8 or Windows 8 Pro running on a single computer at a time.

    Another thing to keep in mind is that if you have installed an upgrade copy under license of Windows 8 on a computer and then you want to use it on another computer, the same 'upgrade' rules apply: you must have a previous version of Windows on the computer before you install Windows 8. You can ignore this rule, if you started with Windows 8.1

    Important: You can't "move" Windows 8 or Windows 8 Pro on another computer if your computer is pre-installed with Windows 8. Your copy of Windows 8 is what OEM licensed which means that you are allowed to use Windows 8 on the computer on which he came already installed on.

    "How many times can I reinstall Windows 8 on another computer? Assuming I follow the rule 'uninstall old installation', peux I keep installing Windows 8 on different computers? »

    There is no limit to the number of computers that you reinstall Windows 8 on as long as you follow the rules, that I discussed in the last question.
     

    Hi NeemeK,

    We appreciate the research you have done to find more information on this issue. The information you found were correct.

    OEM product key can only be used with the computer on which it is installed on.

    When the operating system is not active (uninstalled) in the old computer, you can install it on the new computer. This applies to any number of computers you use.

    If you get any errors, you can perform the activation of the phone.

    http://support.Microsoft.com/kb/950929/en-us

    Hope that the information provided is useful. Do not respond if you need more help.

  • Change the value of "int" one within the arraylist class instance.

    It's my program...

    -Hello.java

    public class Hello {}

    public int a = 5;
    public char c = 'A ';
    }

    -Main.java-

    public class Main {}

    ArrayList < Hello > Hello = new ArrayList < Hello > ();
    Hello.Add (new Hello());

    Public Shared Sub main (String [] args) {}
    int b;
    int c;
    I'm going to get the value of "int a" in the first list of tables and store it in "int b.
    b = hello.get (0) .a;

    Now, I want to change the value of "int a" within the first class of the table
    ///////////////////////////////
    WHAT SHOULD I DO...? //
    //////////////////////////////

    Finally, I'll get the value of "int a" and store it in "int c".
    c = hello.get (0) .a;


    }

    }

    Help, please... >! @! @~

    Well, nothing of this code will compile, but if you corrected the errors, and that was the case, you can replace it with

    hello.get(0).a = 123;
    

    But what you should really do is read all the tutorials you can find.

  • What change required to use a code of 'class '. The FLA itself?

    Hello

    What change required to use a code of 'class '. FLA itself instead of using an external class file? Please help me solve the problem? When I tried the class code by pasting the code, it does not work. How do I change? Help, please.

    Here is the Code for the class:

    package demo {}

    import com.greensock.events.LoaderEvent;
    import com.greensock.loading.ImageLoader;
    import com.greensock.loading.LoaderMax;
    import com.greensock.loading.SWFLoader;
    import com.greensock.loading.VideoLoader;
    import com.greensock.loading.display.ContentDisplay;

    import flash.display.Sprite;

    SerializableAttribute public class Parse_Array extends Sprite {}

    public var progress_mc:MovieClip;

    public void Parse_Array() {}

    activate the Chargers, we must
    LoaderMax.activate ([ImageLoader, SWFLoader, VideoLoader]);

    var urls:Array = ["image.jpg", "video.f4v", "image.png", "avm2.swf"];
    var queue: LoaderMax = LoaderMax.parse (URL,
    {maxConnections:1,
    onProgress:_progressHandler,
    onComplete:_queueCompleteHandler,
    onChildComplete:_childCompleteHandler},
    {width: 125,}
    size: 90,.
    ScaleMode (ScaleMode): "stretch."
    y:150});
    queue.prependURLs("assets/");
    tail. Load();
    }

    private void _progressHandler(event:LoaderEvent):void {}
    This.progress_mc.progressBar_mc. ScaleX = event.target.progress;
    }

    private void _queueCompleteHandler(event:LoaderEvent):void {}
    var content: Array = event.target.content;
    var currentContent:ContentDisplay;
    for (var i: int = 0; i < contents.length; i ++) {}
    currentContent = content [i];
    addChild (currentContent);
    currentContent.x = i * 125 + 25;
    }
    }

    private void _childCompleteHandler(event:LoaderEvent):void {}
    trace ("loaded child:" + event.target + "inside the queue:" + event.currentTarget);
    }
    }
    }

    Kind regards.

    For the most part, you just need to remove all the package and the references of public/private.

  • Access to the Instance of the class within the component TileList DataProvider?

    I have a TileList component that is powered by a DataProvider.  The DataProvider place a class from the source (and the corresponding MovieClip) in the TileList in the form of Visual and interactive objects.

    dpChords.addItem ({label: tt, source: ChordUnit, data:, scaleContent:true});})

    How to pass unique values for instances of the 'ChordUnit' within the TileList?

    public void setChordBin(song:int):void {}

    var dpChords:DataProvider = new DataProvider();

    var i: uint;

    / / determine the game of rope

         If (song ==-1) {}

    activeChords = allChords;

         else {}

    activeChords = songChordSets [song];

         }

    / / filled dataProvider

    for (i = 0; i < activeChords.length; i ++) {}

    var TT = activeChords [i];

    dpChords.addItem ({label: tt, source: ChordUnit, data:, scaleContent:true});})

    }

    chordBin.dataProvider = dpChords;

    FORMATTING

    chordBin.columnWidth = 105;

    chordBin.rowHeight = 115;

    chordBin.direction = ScrollBarDirection.HORIZONTAL;

    chordBin.setStyle ("contentPadding", 5);

    chordBin.setRendererStyle ("imagePadding", 0);

    chordBin.scrollPolicy = ScrollPolicy.ON;

    / / set of style for labels

    chordBin.setRendererStyle ("textFormat", textFormat2);

    / / set the background skin

    chordBin.setStyle ("skin", lightBackground);

    set the CellRenderer

    chordBin.setStyle ("cellRenderer", MyTileListRenderer);

    EVENTS

    chordBin.addEventListener (ListEvent.ITEM_ROLL_OVER, chordBinItemOVER);

    chordBin.addEventListener (ListEvent.ITEM_ROLL_OUT, chordBinItemOUT);

    chordBin.addEventListener (ListEvent.ITEM_CLICK, chordBinItemCLICK);

    }

    I think you should you rewrite ChordUnit class so that path is defined. There are several way to do. One of the ways can be:

    public void ChordUnit(url:String):void {}

    imagePath = url;

    loadDiagramImage (imagePath);

    }

    So, in your setChordBin you can instnatiate directly:

    for (i = 0; i

    var TT = activeChords [i];

    dpChords.addItem ({label: tt, source:new ChordUnit("youUrl.blah"), data:, scaleContent:true});})

    }

  • Model of ADF for use within the declarative component project

    Hello

    JDev 11.1.2.4

    I created a project for my declarative components. I want to create an element with an attribute of type oracle.jbo.Row, but this class is not recognized. What are the libraries I need to include if I want to use the object Row.

    Some basic information: my declarative component is bound to a managed bean.

    Import oracle.jbo.Row;

    @ManagedBean (name = "audit")

    @RequestScoped

    public class AuditBean {}

    Online Privacy;

    public AuditBean() {}

    Var UIXDeclarativeComponent = (UIXDeclarativeComponent) JSFUtils.resolveExpression("#{comp}");

    If (vars == null) {}

    again, throw PropertyNotFoundException ("could not find the name of the attribute [comp] component declarative Vars.");

    }

    line = vars.getAttributes () .get ("row");

    }

    }

    Most of our table have the same fields of audit, and we want to create a component that displays audit information. The component would take the line and check if the attributes are present, if so, display them.

    Thank you

    Hello

    Line belongs to the ADF runtime library. However, your declarative component seems to have another flaw, that is, it uses a bean managed within the scope of the request. She should better use backingBean range (a range of task flow) so it can be used multiple times on a page without the substitution of a previous rendering information. Maybe this isn't a problem if the component cannot forget his condition after rendering

    Frank

  • Using C++ in QML classes: need for Clarification

    I have read the document using classes in QML C++ and understood that we must call qmlRegisterType before using C++ in QML classes.

    But I found that some (or all?) of the classes can be used in QML without call qmlRegisterType in advance.

    Example of

    import bb.device 1.0
    
    Page {
      attachedObjects: [VibrationController {id: qmlvib}]
      Container{
           Button {
                        text: "Test vibrate"
                        horizontalAlignment: HorizontalAlignment.Center
                        onClicked: qmlvib.start(100,100)
                       }
        }
    }
    

    I also found the SensorDemo project using many classes of QML sensor final qmlRegisterType<>(). But it does not call qmlRegisterType<>for VibrationController (?).

    I wish I had a few questions:

    1. How will I know which classes can be used in QML without qmlRegisterType<>()? Is there a list or the rule to help me know?

    2. what should I look at to decide using C++ class in QML directly (without qmlRegisterType<>(()) or with qmlRegisterType<>(): as the performance, memory management,...?

    3. If you can choose to use the C++ in QML class directly (without qmlRegisterType<>(()), BB shoud put it in the paper?

    Sorry for the many questions. I'm just a beginner on BB.

    Thank you very much!

    (1) I think that some classes are pre-registered. If it works without adding it yourself: looks like it was a.
    (2) I don't think that there is a performance issue with the help of registerType
    (3) No, there is not, just of the classes that are recorded automatically by the system.

  • Using Actionscript 2.0 classes in Flash Media Server

    Hello

    I am using the new Flash Media Interactive Server 3.
    I have written quite a few classes to make a game in a nice object-oriented medium. Each of them in the style of the Actionscript 2.

    Now, when I'm in my "main.asc" (the file actually executed by FMS. I can't find a way to import these classes.
    When you use:
    Import the package. Class;
    The server cannot resolve the name of the package.
    When you use:
    Load("dir/file.asc");
    The server does not allow me to use the keyword "class".

    Does anyone have experience in this field? And it is even possible to use this kind of classes (that work well when they are used in a SWF client side)

    Thank you!



    Bart

    Hello :)

    FMS does not use AS1 but Javascript 1.5 Customize Adobe :) SSAS (Server
    Side ActionScript) isn't AS1 ;)

    But in SSAS, we can create the class of OBJECT-oriented programming and use implementations as AS2 or
    AS3 with class, design patterns, etc...

    Example in my opensource framework VEGAS based AS3/AS2/SSAS and it
    Implementation of SSAS:

    http://code.Google.com/p/Vegas/

    You can find all categories of this framework:
    http://svn1.CVSDude.com/OSFlash/Vegas/SSAS/trunk/src/

    For example... you can use the events as AS3 with EventListener model,
    EventDispatcher etc...

    http://code.Google.com/p/Vegas/wiki/VegasTutorialsEvents (all AS2
    example on this page works in SSAS with my framework)

    Classmapping we can create application N-tier base W3C events
    model...

    The SSAS for now use JS1.5... I hope that in the next version of FMS
    language JS2 or CC4 ;)

    EKA + :)

    fmslove wrote:
    > Server side scripting in FMS is possible in AS1.

  • Storage of Information within the screw

    I have an interesting problem...

    I have a VI that controls a subsystem. It has about 80 entries, when he used the subsystem with these entries programs. Entries are not homogeneous, they are information configuration and each means something different. This VI allows interactively and as part of a larger system. Since it has many entries I used clusters of group related entries.

    As far as I can say LabVIEW applies the following scope rules when SubVIs are involved:

    Controls that are wired to the login Panel

    When a top-level VI calls a Subvi if highest level VI son an entry then the Sub - VI receives this value. If the VI more high-level wiring is not an entry, then the default value is used.

    Controls that are not wired for the login Panel

    When a VI is loaded into memory front panel is loaded with the default values, even if the VI is not visible. LabVIEW retains the values defined by the last use of the VI. It goes the same for registry entries to offset unwired.

    The behavior of controls unwired is useful because it allows information to be stored, it allos "masking of information." In my application I can open the VI subsystem described above in an interactive way and set up some values. Screw top level then call that VI as usual. These screws of higher level need not know anything about the settings I changed. Where I work, this idea is used in the code for many years. It is similar to the "functional global variables" using terminals unwired-shift register.

    Once a control should be wired to the component connector however everything changes, a value may not persist a use of the VI to the other.  This is true even if the connector pane entry is left connected because otherwise LabVIEW use it * default value * not the existing value. Thus, all controls dealing with things my subsystem-specific low-level can be left unwired. Then all controls dealing with things higher level that allows to control the higher level screw must be wired and the highest level VI must assume responsibility for this information. Previous versions of the system that I mention did.

    The problem with this plan is that the clusters.  A cluster is either on a connector component or not, I can find no way to put a cluster on the connector pane entries but not others. Since I have so many entries, I need bunches. But, once I attribute a cluster to the connector pane the top-level screws must take responsibility for all its values. This means that I lose all the concealment of information that I had before and my code becomes much more complicated.

    Someone at - he found a solution to this kind of problem?

    I can draw out as example screws if people are interested.


  • Using ListView with ArrayDataModel displays only the first element in each QVariantMap within the matrix

    I have this QML who have a ListView with datasource to a full ArrayDataModel from the CPP file for creationcompleted, I loop in the table to add the hour together to appear as a label on the page, what works. However, when I want to view these items in the list, it will display only the first element of the QVariantMap within the table, no error on the log of the device. Also, triggered more does not work, but when I click it, it will have a blue border surrounding it, but the onTriggered does not fire.

    Here is an excerpt of the CPP on the table fill

    This-> eventsModel = new ArrayDataModel();

    QVariantMap event;

    event ['EventName'] = "Event1";

    event ["EventHour"] = "00";

    event ["EventMinute"] = "01";

    event ["EventSecond"] = '02 ";

    QML-> setContextProperty ("eventsModel", it-> eventsModel);

    Here's the QML

    {Of container

    ID: eventListContainer

    {To ListView

    ID: eventList

    dataModel: eventsModel

    Use a ListItemComponent to customize the appearance of the list view

    listItemComponents:]

    {ListItemComponent}

    type: 'point '.

    {StandardListItem}

    Title: 'Event' + ListItemData.EventName;

    Description: "time:" + ListItemData.EventHour + ":" + ListItemData.EventMinute + ":" + ListItemData.EventSecond; "»

    }

    }

    ]

    onTriggered: {}

    var selectedEvent = dataModel.data (row);

    var eventDetailPage = eventDetailDefinition.createObject ();

    eventDetailPage.txtEventName.text = selectedEvent ['EventName'];

    eventDetailPage.pickEventTime.value = picker.dateFromTime(selectedEvent["EventHour"]+":"+selectedEvent["EventMinute"]+":"+selectedEvent["EventSecond"]);

    eventDetailPage.open ();

    }

    }

    Any help would be appreciated.

    Thank you.

    ListView determines ItemType of the element by calling the function itemType of the dataModel. By default, an ArrayDataModel returns an empty string for this call (see https://developer.blackberry.com/cascades/reference/bb__cascades__arraydatamodel.html).

    This leaves you with a few options:

    (1) If you have no header and all the elements are the same, you can make

    ListItemComponent {
         type: ""
         ...
    

    (2) If you have headers or different elements, you can extend ArrayDataModel and implement your own function of itemType

    (3) you can define a function of ItemType on your ListView in QML. Documentation:

    ListView called DataModel::itemType() for each item in order to know the type. QML, this can be overridden by declaring the itemType function (data, row) on the ListView element. ListView then call this function instead of the function DataModel.

    Here's how to create a list in QML which creates a header for all items on the high level and aStandardListItem for each item below the top level:

  • How can I put pictures outside the window of Photoshop elements 14 work, so that I'm not obliged to work within the program window, but use my screen completely for the image?

    How can I put pictures outside the window of Photoshop elements 14 work, so that I'm not obliged to work within the program window, but use my screen completely for the image?

    dannyb76251437 wrote:

    How can I put pictures outside the window of Photoshop elements 14 work, so that I'm not obliged to work within the program window, but use my screen completely for the image?

    Note that you can work with two screens and drag and drop the image to display on the other window.

    I think you mean working temporarily with the window enlarged image without displaying all the tools and panels.

    See:

    Panels and bins in Photoshop Elements

    My advice: take the time to read the above help and especially to look at ways to maximize this window if you are on Mac or Win.

    Set your preferences in the Edit menu to "allow the floating windows in expert mode.

    Use the "tab" on the keyboard key to hide or show your panels and tools quickly.

    Find out how to hide the photo tray.

  • I am using the trial version of adobe photoshop. I want to buy it later not within the period of 4 months. So, how can I cancel my payment option

    I am using the trial version of adobe photoshop. I want to buy it later not within the period of 4 months. So, how can I cancel my payment option

    Hi mohammadr42362249,

    I see that there is no update on your account payment information.

    You can always contact our sales team customer care and make a purchase for the new http://www.adobe.com/products/request-consultation/marketing-cloud.html here

    https://helpx.Adobe.com/contact.html

    I hope this helps!

Maybe you are looking for