Error 1448. LVOOP: Referring to objects of the child class

Hi all.

In a project using LVOOP, I defined a class parent with several attributes. Of this class, there are three classes of children who inherit the attributes of the parent class and also have their own.

Imagine that I instantiated an object belonging to the parent class and initialize its attributes. So I want this object even belong to a class of the child in particular, and refer to its attributes in the class of the child, of course, keep the values of the parent class. How can I do?

I tried to use "in a more specific class" tool but I get the following text: "error 1448: bad type cast." LabVIEW does not deal with the run-time value of this class of LabVIEW as an instance of the given class of LabVIEW. »

Exactly the same problem is committed and solved here http://lavag.org/topic/7473-lvoop-class-variable-as-child/, but because the links are temporarily disabled I can't download and understand the code example, which shows what it says there.

Thank you very much
Francisco.

Hi Francisco,.

Take a look at this thread: http://forums.ni.com/ni/board/message?board.id=170&message.id=362388&requireLogin=False

Christian

Tags: NI Software

Similar Questions

  • LVOOP: Common accessor for the child classes?

    I am reletively new to LVOOP and OBJECT oriented programming in general. I used very simple classes as a replacement for clusters several times, and now I have an architecture intended to convert most of my code into classes, dynamic distribution screw and similar.

    However, I run in to an issue, which basically boils down to laziness: I really don't want to do a lot of the same dynamic send screws I want to have a VI parent to be able to write a piece of data common to all children. Preference gives an error if the child does not have this data element.

    I guess it's quite similar to dynamic distribution, but without having to write a DD VI for each class.

    Is it possible to have the VI parent to access the data of the child? If so, how?

    Here is an example of my hierarchy:

    Test.lvclass (parent)

    DC_test.lvlcass (data: test number, 2D, time stampresults)

    Transfer_Curve_test.lvlcass (data: results of tests settings, 1 d, timestamp)

    Breakdown_test.lvlcass (data: test number, 3D, timestampresults)

    ... 28 another test

    As you can see, the data type only common between them is the timestamp. I want to be able to use a VI in the parent class to write data in the child class.

    You have it backwards autour.

    The data that is common belongs to the parent class, not the class of the child.

    Data that are not common may not be processed by the parent class and must be transformed by the child class.

    You don't need to CREATE truly dynamic shipping screws for a common data type.  If you just don't set the VI at all, it will be called the parent instance.

    Shane.

  • Prevent the child class dependency when the conditional use disable to specify the class in the development environment

    Hello

    I develop an application that I want to run on the normal systems and in real time using LabVIEW Proffesional Development System 2012 SP1

    To control how the application interacts with the user, I created a class that defines the type of user interface behavior that should allow me to have nice dialog boxes when the system is running on a machine windows and no dialog box (or any other friendly code in non-real time) if they sail on a real-time target.

    The parent class is the code that suits the actual time and the class of the child is the one with dialog boxes.

    To control the class of which it is responsible, I have a structure conditional disable. It works fine when the application is built in an executable or executable file in real time, but the problem arises when I want to use the code during development on the target in real time.

    I think that with the application under a target in real time (RT PXI), the proper case of the conditional - disable is enabled for the parent class is used, but the child classes are also listed under dependencies - I pressume it's because they exist on the block diagram in the case of persons disabled conditional turn off the diagram.

    This means that I can't deploy the code on the target in real time as it is unhappy with the class of the child code - even if it will never run.

    To save the poster my real project, I created an example with a Parent and child class and a flag to disable conditional 'class' to illustrate the problem.

    If you run Test.vi, you will see that the child class always gets locked (i.e. is addictive) while running even if it is not called.

    So - basically my question is: is what I can do about it or will I enough to disable it with conditionals and simply put the constant to correct class on the block diagram in the tests?

    Thanks in advance

    John.

    I feel your pain.  I came across something similar some time back.

    Apparently official NOR position is that you have to put a conditional structure of Disable IN EVERY ONE OF YOUR CLASS live.  In the Windows screws, you simply have a case of empty disable conditional with the windows code in another case and vice versa on the RT.

    I also much prefer the method you describe...

  • Passing an object of the UiApplication class reference

    Hi all

    I am very new to the development of BB and have struggled for hours on something that I think should be very simple. What I have, this is the main class that extends UiApplication and a second class that implements Runnable. From a method in the UiApplication class, I create an instance of the Runnable class. After that, I call a method to start from this class and pass an object originally from the UiApplication class reference - so that I can call a method, once completed the processing of the Runnable class.

    The problem I have, is that once past the object through a call to method reference, the reference instantly cancels and causes a NullPointer exception when trying to call a method in the original class. The structure is as below, but with all the surrounding code subscribed:

    public class MainApp extends UiApplication {
    
        MainApp _MainApp;
        OtherClass _OtherClass;
    
        public static void main(String[] args) {
        MainApp _MainApp = new MainApp();
        _MainApp.enterEventDispatcher();
        }
    
        private void createOtherClass() {
            _OtherClass = new OtherClass();
            _OtherClass.someMethod(_MainApp);
        }
    
        public void response() {
            // code here
        }
    }
    
    public class OtherClass implements Runnable {
    
        MainApp _MainApp;
    
        public void someMethod(MainApp MainAppRef) {
            _MainApp = MainAppRef;
            // _MainApp object reference is null here
    
            new Thread(this).run();
        }
    
        public void run() {
            // stuff here
            // once done, call a different method
            sendDetailsBack();
        }
    
        public void sendDetailsBack() {
            _MainApp.response(); // causes a NullPointerException
        }
    }
    

    I rewrote this to only show the code at the source of the problem. I don't quite understand why the object reference is not passed correctly - I have tried many other ways to call back to the UiApplication function, including static calls.

    Any help on how I do it is very appreciated!

    Will be

    I suspect that your problem is here:

    MainApp _MainApp = new MainApp();

    I think you meant just

    _MainApp = new MainApp();

  • Substitution of the class, how to create the child class and then the base class

    I started to write a program for a DMM smart, that the problem is all versions of DMM greet the change company communication.

    My idea is to write a child class for each version, DMM and each Subvi child will replace the Subvi base class.

    My problem is, I first want to create a child class and after I see everything is working, start creating the base class. in this way, I'll see if think the right way.

    My question is

    How can I create a child class and then create the base class and configure the Subvi class of the child to be the substitution of the base class?

    I tried searching in the property of the class, but I don't see anything.

    Thank you

    This can be done and I did on occasion.

    You create the base class with the methods of dynamic distribution, you need (Connector components must be identical to those of the class of the child).

    Set then the legacy of the class inherits this base class.  If your method is defined as a dynamic distribution method in the parent, you will probably now have some errors (unless your method of child was already DD, in which case you might be OK already).

    To change the inheritance of a class, right-click on the properties of the class in your project, and then select Properties.  According to me, the tree of estate is at the lower end of the property.  Click on the 'legacy of change' (or something similar) to choose the class from which you now want to inherit.

  • Iterate through the objects of the child in components

    I have a custom component named myComp that has three TextInputs. And in the main application there is a button that adds the component dynamically to the VBox named myVBox, I would like to know how iterate through the added components and display the text inside each of the TextInputs in a box of Alret. I'm pretty new to flex and I couldn't find examples for this.

    Thank you

    Code example,

    Custom component

    MyComp1.mxml

    
    http://www.adobe.com/2006/mxml">
         
         
         
    
    

    Application

    
    http://www.adobe.com/2006/mxml"
         layout="absolute"
         creationComplete="init()">
         
              
         
    
         
              
              
              
              
         
    
    

    Hope this helps you

  • Invalid PUBLIC objects in the database

    Hello

    I have a 11.1.0.7.10 database running on one machine Linux EL5.
    OWNER           OBJECT_NAME                    OBJECT_TYPE
    --------------- ------------------------------ --------------------
    SYS             INTERACTIONEXECUTE             FUNCTION
    SYS             XOQ_VALIDATE                   PROCEDURE
    PUBLIC          ALL_AW_LOAD_DIMENSIONS         SYNONYM
    PUBLIC          ALL_AW_LOAD_DIM_FILTERS        SYNONYM
    PUBLIC          ALL_AW_LOAD_CUBE_FILTERS       SYNONYM
    PUBLIC          ALL_AW_LOAD_CUBE_MEASURES      SYNONYM
    PUBLIC          ALL_AW_LOAD_DIM_PARMS          SYNONYM
    PUBLIC          ALL_AW_LOAD_CUBE_DIMS          SYNONYM
    PUBLIC          ALL_AW_LOAD_CUBES              SYNONYM
    PUBLIC          ALL_AW_LOAD_CUBE_PARMS         SYNONYM
    PUBLIC          ALL_LOAD_CUBE_SEGWIDTH         SYNONYM
    PUBLIC          ALL_AW_CUBE_AGG_PLANS          SYNONYM
    PUBLIC          ALL_AW_CUBE_AGG_MEASURES       SYNONYM
    PUBLIC          ALL_AW_CUBE_AGG_LEVELS         SYNONYM
    PUBLIC          ALL_AW_DIM_ENABLED_VIEWS       SYNONYM
    PUBLIC          ALL_AW_CUBE_ENABLED_VIEWS      SYNONYM
    PUBLIC          ALL_AW_CUBE_ENABLED_HIERCOMBO  SYNONYM
    PUBLIC          DBMS_AWM                       SYNONYM
    
    SQL> alter public synonym ALL_AW_LOAD_DIMENSIONS compile;
    alter public synonym ALL_AW_LOAD_DIMENSIONS compile
    *
    ERROR at line 1:
    ORA-00980: synonym translation is no longer valid
    When I try to compile the synonyms, I get the above error. Could someone help me please here as to what needs to be done to get these fixed invalid synonyms?

    Published by: 877343 on 5 March 2012 02:13

    Its look like someone has voluntarily withdrawn your database OLAp option, but forgot to remove its synonyms :|

    See the following note in MOS:
    Remove invalid OLAP of SYS and [ID 565773.1] OLAPSYS schema objects

    He explains after removing the OLAP option, you must remove all of its related synonyms. Look at step 3) this note:

    3. All the objects listed in step 2 can be deleted, since they are used exclusively by the OLAP option.
    
    To make this easier, use the following SQL script to determine all PUBLIC synonyms referring to objects in the OLAPSYS schema:
    This will generate a script that drops the listed objects from the database.
    
    SQL>spool olapdrop.sql
    SQL> select 'drop public synonym ' || synonym_name || ';'
           from dba_synonyms
           where owner='PUBLIC' and table_owner='OLAPSYS';
    SQL>spool off
    
  • to access the property of the child of a display object

    I need help to understand how to access a property of a child of a DisplayObject.

    within a class, I have an object with the name of the variable: btnLMain

    I assigned a name property: btnLMain.name = "btnL;

    btnLMain also has a property: btnLMain.clickNum = 0; It's the one that I need to access

    When I instantiated (btnL) class that contains this code in the parent class, I need to access the 'clickNum' property so I did this:

    var dispObj:DisplayObject = btnL.getChildByName (btnLMain);

    displayObj.clickNum ++;

    but then, I get the error: 1119: access to property may be undefined clickNum through a reference with static type flash.display:DisplayObject.

    so then I looked at the documentation and as I understand it, I am not able to access the child of the DisplayObject property as it is a static property... Please correct me if I'm wrong.

    so now, I try to understand how to access this property in the child class.

    do you have any tips for me?

    Thank you!

    For what you described, the following line is meaningless...

    var dispObj:DisplayObject = btnL.getChildByName (btnLMain);

    because you said that the name property, that you assigned to the btnLMain is btnL, which would make btnL and btnLMain representative of the same object.  Or maybe I just missed something the explanation.

    How you declare btnLMain first?  If it is defined in a way such As btnLMain... var = new Something(), then you have a direct access using the btnLMain variable and should be able to use btnLMain.clickNum

  • LVOOP - 1 table of Parents in several bays of the child?

    I have 3 types of channels in my system. DI, I and AO.

    I want to create a Parent class that has 3 children for each of my types of channels.  It's because I want to store (on disk using flatten chain) all my channels together as an array of strings.  It's ok because I can use the 'to the more generic class"and a record in a table of my parents (CHANNEL class).

    The problem is when I read this array of objects.  I can read my array of objects parent but then I want to transform my array of objects of string into an array of objects, an array of objects HAVE and an array of objects of the DI AO.

    Any ideas?  Thank you.

    Lewis_G wrote:

    Hi nathand thanks for the ideas.  I've implemented it as you sugested.  Is there a way to make it more scalable?

    You might abuse the primitive preserve Run-Time class, as shown below. This divided the table parent tables separated for each class of the child, but the type of each element of these tables is always the parent type, even if they are transporting children. Not sure if that's what you want, or not.

    Lewis_G wrote:

    The child the more classes i, messier, fine.  Even if the code is the same for both, I can't have a Subvi generic because the child class is different for the two.  Don't you think it's a good idea to have a new class of table for each child.  For example, I could make a class with a method that has a channel enter parent and trys to add it to the guard?

    This could be very good, if it meets your needs.

    Intaris wrote:

    nathand wrote:

    Otherwise, add a method to the class called parent Type Get and override it in each class of the child, and then call on each element of the array to determine its type.

    And make sure that the type is a string, otherwise problems ensure later in life...

    I thought to mention that when I offered everything first, but then I thought that there could be situations in which an enum would work very well if you don't mind violating good OOP practices. Yes, the parent should know his children and you need to know about all children at design time, but if you can accept these terms then an enum is simple. I'm undecided about whether I would never apply this solution if I were to try to solve this problem in my own code.

  • Adding objects to the stage & amp; Properties of the acceessing Stadium - I'm a bit confused...

    Hello

    I'm a bit confused about the programming of the display's two-pronged:

    A. What are the best way to add objects to the stage?
    B. how to access the properties of the step.

    I can make these two when the project is a 'Action Script Project', but I have a problem when it is a "Flex project" (for example a MXML file). See the attached files two questions included in the commentary to see exactly what I mean.


    A. What are the best way to add objects to the stage?
    =====================================

    In a project of action script which extends Sprite I can call him addChild()

    In a project MXML I add objects to the scene first, adding them to a UIComponent, then adding that the step.

    1 - is the best way to do it?

    In this doc: http://livedocs.adobe.com/flex/3/html/help.html?content=05_Display_Programming_02.html he says this quote from
    :
    Each SWF file has an ActionScript class associated with it, called the main class of the SWF file. When Flash Player opens a SWF file in an HTML page, Flash Player calls the constructor function for that class and the instance that is created (which is always a type of display object) is added as a child of the Stage object. The main class of a SWF file always extends the Sprite class
  • Private data LVOOP Parent returned when the child instance created from constant

    I created a parent class and child class.  For each of these classes, I created a member who is a builder, whose purpose is to initialize constants for each class and return the instance of the class VI.  I also have an accessor Member VI for each class that returns private data of the class (in this case, a single string for each class).

    Private class data Parent 'String' is set to "text Parent" as default.

    Private data of the class of the child 'Child String' are set to 'Child text' as a default.

    The Parent class constructor works very well.  For testing purposes, I'll be back the text of unbundling of directly the manufacturer VI, as a return of the VI accessor. The Parent constructor starts from a class constant.

    However, in the case the constructor of class as a child, if I start from a class constant, unbundling directly private data (using a feature of unbundling by name and choosing "Child String" as the element), I get the private parent data!

    If I use the Member of the class of the child VI to retrieve the text, I get the private data of the child.

    If I change the constructor from a class of control instead of a constant class, I get the private data of the child.

    This occurs only until the child class has existed as a control flag. that is, if I ungroup private data, after the class is returned by any Member VI, I get the private good child data.  Then, of course, something changes once the class 'data' has been a control at a given time.

    I'm using Labview 8.6.1, Windows XP

    I have attached a small project that demonstrates the problem that I encounter, without actually doing initialization, just read.

    Is this expected behavior?  Why does it matter if I start with a constant of class instead of a control of the class?  When you slide the block diagram in the project window, you will always have a constant.

    Although I was able to reproduce your problem in LabVIEW 8.6.1, it seems to work fine in 2009.  I could not find a CAR ID, but at this point I can only assume that the behavior was not intended but it is set in 2009.

    Let me know if you need me to find more details.

  • Summary of functions (two entries) for classes of brother with a dynamic distribution of entry: the static entry retains the type of the parent class.

    Suppose that in a hypothetical example, I have a superclass (number) with two children (real and complex) classes.

    I would define a function of sum for these classes, using dynamic distribution.

    Real or complex would have its own method of the sum (VI) which would be subject to various operations, such as the real and complex numbers are different.

    As I understand it, the normal way to proceed in OOP is for each of these methods to have an entry of dynamic distribution and a static entry of its own type.

    Problem: Labview doesn't let me do this!

    I first define an input method dynamic-shipping dummy for the numberof the parent class, but only the first entry can be dynamic-Envoy while the other is statically typed as number.

    Then, when I create override methods in my two children classes real and complex, the second entry (static) remains under the number (the type of the parent class). This is not fair, because then I can't access the private data of the child class of type real or complex that will be connected to the second input (static).

    What is the solution to this problem (usually)?

    I think that, in LVOOP, you use only a dynamic terminal or a static terminal to the terminal object.

    You can have several other terminals, but all the dynamics VI (methods with the same name) must have the same API (terminals).

    If you have to understand your preferred mode to pass, use multiple terminals, not used by each method, or use a cluster that contains all the numbers to pass (real or complex, both of which are not used in each method) or you can try a Variant, as shown.

  • Get and set data using the ActionScript class

    Hello

    I use the ActionScript class to store the user name and password when the user logs


    com package
    {
    public class Login
    {
    public function Greeter (initialName:String = "")
    {
    }

    public var uname:String;
    password public var: String;

    }
    }

    Inside the Componet Login form, I am creating the object of this class of connection and affecting the data as shown in it

    var logincomp:Login = new login());

    logincomp.uname = UnameTI.text;
    logincomp. Password = PassTI.text;


    I need these data within an another CustomComponent, is it possiblke to access these data within an another componnet.

    Can I do this?


    var logincomp:Login = new login());

    var str:String = new String();

    Str = logincomp.uname;


    Please me tips


    I know it's possible with recording and Dispatching Evenets
    However, I'm not interested to use DEMONSTRATIONS. I'm using FLEX 3

    Please advise me if this is possible.

    THnaks in advance.

    Thanks for helping me learn Flex quickly.

    Hello

    You use a Singleton class as (class ModelLocator) If Yes, then you can put a single instance of your connection class in this class so that you can access this instance in the world in any component (infact with the app).

    Declare an instance of the connection object in the Singleton class like below

    var logincomp:Login = new login());

    Set the values in a single component, and you can access the values in the other component.

    The sample class Singleton as shown below...

    package com.model
    {

    [Bindable]
    public class ModelLocator
    {
    private static var instance: ModelLocator;
     
    public var logincomp:Login = new login());
     
    public void ModelLocator()
    {
    If (instance! = null)
    {
    throw (new Error ("cannot only one instance of ModelLocator"));
    }
    }
    Public Shared function getInstance (): ModelLocator
    {
    if(instance == null)
    {
    instance = new ModelLocator();
    }
    return instance;
    }
    }
    }

    If this post answers your question or assistance, please mark it as such.

    Thank you

    Jean Claude Chari

  • I get this error msg - permission denied for < Web page > get XPCComponents.classes property

    A couple of days, I started getting the msg of error-permission denied for < Web page > get the XPCComponents.classes property. It happens with every Web page I visit. If I hit the x in the upper right so I can access the page. Is not in Internet Explorer. Any ideas how I could solve this problem and why she started to happen?

    Try Firefox SafeMode to see how it works there.

    A way of solving problems, which disables most of the modules.

    (If you use it, switch to the default theme).

    • You can open the mode without failure of Firefox 4.0 + by pressing the SHIFT key when you use the desktop Firefox or shortcut in the start menu.
    • Or use the Help menu option, click restart with the disabled... modules while Firefox is running.

    Do not choose anything at the moment, just use 'continue in safe mode.

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before using the shortcut of Firefox (without the Shift key) to open it again.

    If it's good in Firefox Safe mode, your problem is probably caused by an extension, and you need to understand that one.

    http://support.Mozilla.com/en-us/KB/troubleshooting+extensions+and+themes

    When find you what is causing that, please let us know. It might help others who have this problem.

    If you look in the error for this XPCComponents.classes error Console, there should be a Source file: chrome: / / address that could give us information which extension is causing this message.

    Firefox button > Web Developer-> Console for errors or simply use {Ctrl + Maj + J} from the keyboard

  • With the help of the child in the executable class

    I'm kinda stuck and don't know how to solve and could not find a solution online.

    I have a parent class and its children to the class. The child class only overrides a method, but not the run method. I want to compile the executable project, where the run method is called, but the class type is the child, not parent. How to do this?

    I tried three things, but all in vain:

    (1) in the build properties when I select start VI the run method of the parent, I get in the executable the parent, not the child's class class. It's logical. However, I couldn't find the option to use the child as a type's class.

    (2) when I add the run method of the child class and appeal to parents, I get two windows pop up. The run of the parent and the child method. Too many. Even if for the class child run method (see below the block diagram of a child, red run method's parent), I put not to show the façade when it is called in the properties of VI.

    (3) when I tried with a separate VI calling the run method of the parent class, but the class type is the child, I get the façade of this separate VI and the run method of the parent. See below (Blue class is child, red of parent).

    In both cases 2 and 3, I chose to put the checkbox 'See the façade when it is called' a FAKE, but still the front panels appear.

    Someone don't know either: i) the use in the executable version of the options to generate an executable when a different class method is used, or ii) when you compile an executable file with a certain start VI, to not show this starting VI?

    I understand if I say "you want to configure the RUN method of the class as 'start-up VI' in the EXE file, but it should run the RUN method for a child object"?

    If this is correct, your third approach is the right one. This new boot VI is often used as 'Splash Screen' that covers the task of a demon "spawning" for your application.

    You must simply close this VI once it's over. This can be done using VI server on its own front panel functions.

    hope this helps,

    Norbert

Maybe you are looking for