The dynamic 2D table 3D-graphics

Hello

IM in the process of adding a 3-d chart of ActiveX to an application that I use.  I never know the number of data points with that I will have to curve in advance of the time and I therefore create a 2D array:

double **Data;

Data = malloc(size_x * sizeof(double *));
for (i = 0; i < size_x; i++) {
    Data[i] = malloc(size_y * sizeof(double));
 }

My problem is when I try to use CA_VariantSet2DArray, I still have the mistake of running too small argument table. My best guess is that the space allocated in the array is not contiguous, but I'm not sure.  I was not able to solve the problem.  Can someone help me convert my table 2D of a variant of the way I have it or suggest a better way to declare a 2D array dynamic that will work with CA_VariantSet2DArray?

Hunter,

Your intuition is correct.  You don't have to have a contiguous block of memory to pass to this function.  Passing the size_x and the size_y allows the service make your contiguous block in a 2d array.  Declare your table as such:

Data = malloc (size_x * size_y * sizeof (double));

Then you can pass it to the function and have it create the variant as expected.  However, when directly access you the data, note that you can not use data [2] [3] shortcut more and you will have to do some arithmetic to access the elements of the array pointer.

Tags: NI Software

Similar Questions

  • Adding record helps the dynamically nested table

    Hello guys im trying to add records to a nested table plsql dynamically. Here is my code that only adds a record. I can not figuered on why it's not more then add one record to the nested table. I think I would say at the table to update the index and insert the new index but I'm not sure on the index can someone throw me a BONE.
    I also tried the records, but I seem to be facing the same problem.
    create or replace
    PROCEDURE QUICKTEST AS 
    BEGIN
    /*declare and array to loop through. to write error log.*/
    declare
    TYPE local_table IS TABLE OF VARCHAR2(30);
    acct_code local_table;
    
    
    TYPE rec_type IS RECORD (       -- local RECORD type
        f1 INTEGER,
        f2 VARCHAR2(4)
      );
      r2     rec_type;                -- local type
    
    num number(17):=0;
    
    begin
    FOR Lcntr IN 1..20
    LOOP
        
        
         acct_code := local_table ('I');
         r2.f2 := num+1;
        
    num:=num+1;
    
    END LOOP;
    
    END QUICKTEST;

    I think you are looking for something in the lines of...

    CREATE OR REPLACE PROCEDURE quicktest
    AS
       TYPE local_table IS TABLE OF VARCHAR2(30);
    
       acct_code   local_table  := local_table();
    
       TYPE rec_type IS RECORD(   -- local RECORD type
          f1   INTEGER
         ,f2   VARCHAR2(4)
       );
    
       TYPE rec_type_arr IS TABLE OF rec_type
          INDEX BY BINARY_INTEGER;
    
       r2          rec_type_arr;   -- local type
       num         NUMBER(17)   := 0;
    BEGIN
       FOR lcntr IN 1 .. 20
       LOOP
          acct_code.EXTEND;
          acct_code(lcntr) := 'I' || lcntr;
          r2(lcntr).f1 := num + 1;
          r2(lcntr).f2 := 'J' || TO_CHAR(num + 1);
          num := num + 1;
       END LOOP;
    
       DBMS_OUTPUT.put_line(acct_code.COUNT);
       DBMS_OUTPUT.put_line(r2.COUNT);
    
       FOR i IN acct_code.FIRST .. acct_code.LAST
       LOOP
          DBMS_OUTPUT.put_line(acct_code(i));
       END LOOP;
    
       FOR i IN r2.FIRST .. r2.LAST
       LOOP
          DBMS_OUTPUT.put_line(r2(i).f1 || ' :: ' || r2(i).f2);
       END LOOP;
    END quicktest;
    /
    
  • Pneumatic schema / proportionally correct wheel of the dynamic circle

    Hi, I use actionScript to dynamically draw a diagram of a wheel with tire, but it made its appearance the right size. The diagram should be drawn using three pieces of incoming information (from JavaScript):

    num_wd_mm (diameter of the wheel) is the diameter of the metal wheel, which fits the tyre rubber.

    num_ph_mm (height) = the height of inside outside the tire rubber itself.

    num_ODmm (overall diameter) = the diameter of the whole thing (wheel diam + height profile)

    Sounds simple, isn't? But it is difficult to do the math necessary to draw the diagram with precision, because the diameter of the wheel is represented by a full circle and the circle race tire. The width of the line is the circumference of the circle filled with half and half inside the outer edge.

    The key is the correct outline width, while represents the tire rubber with precision, it compensates for the fact that it is only the display outside the circle of half of its width, and he rides inside the circle by half of its width also (fill circle should appear to be is the diameter of the wheel because it's what he represents in the diagram.)

    Here is how I had tried it, but I can see that the overall diameter is wrong:

    / / The scale for the graph is:

    var MMtoPX:Number = 3.5;

    //Set vars for dynamic circle

    var strokeWidth:Number = num_ph_mm/MMtoPX;

    var circleRadius:Number = ((num_ODmm+num_wd_mm)/2) / MMtoPX;

    / / Draw the dynamic circle

    circle.graphics.clear ();

    circle.graphics.lineStyle (strokeWidth, 0x000000);

    circle.graphics.beginFill (0x0000FF);

    circle.graphics.drawCircle (circleX, circleY, circleRadius);

    circle.graphics.endFill ();

    Initially, it seemed that it would be simple, but all combinations possible amounts that I try produces incorrect results.

    In addition to what AHernandezIP, traits are overlapping fills (half of the thickness of line) - it's one of the reasons why is not worth trying to find adequate compensation. If, say, a circle radius is 100 and accident stroke is 20 - combined radius of the circle that results will be 120 (100 + 10 on each side). So, it is much easier to draw two circles. One of the ways:

    var circle:Sprite = new Sprite();
    var gr:Graphics = circle.graphics;
    var outerRadius:Number = 100;
    var innerRadius:Number = 60;
    // draw two crcles in one swap
    gr.beginFill(0x6C0000);
    // draw bigger one
    gr.drawCircle(0, 0, outerRadius);
    gr.endFill();
    // change fill color
    gr.beginFill(0xC0C0C0);
    // draw smaller circle
    gr.drawCircle(0, 0, innerRadius);
    gr.endFill();
    addChild(circle);
    circle.x = circle.y = 100;
    
  • Cannot perform the insert/update on the form of tables, due to the dynamic action

    Hi all

    I created a dynamic action that calculates multiple cells in a table.

    This feature works well, when I change the value of the associated cell then the computed value is changed by the dynamic action.

    But I am not able to insert or update the line in a table when the dynamic action is enabled. When I put the condition 'Never', then the line is inserted or updated without any problems.

    All guess where is the problem?

    Apex version: 4.1.1.00.23

    Jiri

    Nina wrote:

    I don't know why the 123,40 value (or other) is set to the next item in line (f09, fsc, etc.)
    >

    What is hidden and generated Apex elements are always included in the last cell (td) of the line. Thus, it has nothing to do with the next item, only the last cell.
    If you see the last cell of the 888 Page you will see probably the same type = "hidden" entries here also.

    Your problem is not related to the HTML fragment to the last cell in the row showing all those extra items, it's somewhere else.

    Oh, here comes the jQuery selector:

    var clickedRow = $(this.triggeringElement).closest('tr');
    
    $(clickedRow).children('td[headers="SAL"]').find("input").val(myCalculatedTotal);
    

    SAL, COMM, w/e. here you will find the TD with headers = "COMM" and all the input fields and the value of all the entries in total calculated. Your selection is not precise enough in this case.
    So, target the specific entry.
    With the code example:

    
    
    
    
    
    
    
    
    

    change the switch on

    $(clickedRow).children('td[headers="SAL"]').find('input[name="f08"]').val(myCalculatedTotal);
    
  • Drag / move the dynamic region to tree parent link table

    Hello

    Is it possible to drag a row of a table returned by using the dynamic region of the parent tree? For example, I have the parent tree Explorer (say, dept and emp), clicking the dept and emp, it makes the Department or employee details to separate the workflow using the notion of dynamic region. Now I'm moving employees Department provided one and link to another node in the Department, it does not work. The listener to fall (on the tree) is not getting recognized.

    Is there something I'm missing?

    Thank you
    Sachin

    Hello

    as far as I know, drag and drop happens on the client and is therefore not bound by employment regions or dynamic regions. Then drag and drop should work for this use case. You share the implementation of slip and fall in the scenario you so that I don't want to exclude a program on your site (for example disccriminator incompatibility) error

    Frank

  • Data does not save in the dynamic table

    My form has been active player and all the information can be recorded with the exception of the data entered by the user in the dynamic table.

    Should I change the binding of data?

    https://Acrobat.com/#d=SWkT2mrJBJbxk * QJGmN0Ng

    Appreciate any help!

    Tracy

    Hello

    OK, I found the root of all evil.

    To resolve this problem, you need to replace the script that caculates the dates in the dynamic table by another.

    Go to table calculate a remove the event script.

    Then, select the Date field in the first row of the table and add this script to its change event.

    var StartDate = $event.newText
    var DateFormat = "MM/DD/YY"
    
    if (StartDate ne $event.prevText) then
              var selectedDate = Date2Num(StartDate, DateFormat)
                var selectedDay = Num2Date(selectedDate, "DD")
              var selectedMonth = Num2Date(selectedDate, "MM")
              var selectedYear = Num2Date(selectedDate, "YY")
              var firstDay = Date2Num(Concat(selectedMonth, "/", "01/", selectedYear), DateFormat)
              var lastDay = 0
              var dayNumber = firstDay
    
              $event.change = Num2Date(firstDay, DateFormat)
    
              for i = 0 upto 30 step 1 do
                        if (Num2Date(firstDay, "MM") eq Num2Date(dayNumber, "MM")) then
                                  dayNumber = dayNumber + 1
                                  lastDay = dayNumber
                                  Table._Row.addInstance(1)
                                  Table.Row[i].Date = Num2Date(dayNumber - 1, DateFormat)
                                  Table.Row[i].Day = Num2Date(dayNumber - 1, "EEE")
                        endif
              endfor
              Table._Row.removeInstance(Table._Row.count - 1)
    endif
    

    https://Acrobat.com/#d=qEVfk * AbNz5qfmJqF * BovA

  • Problem with the name of the dynamic Table

    Hi all

    I can't using a dynamic table name. I have the following code...
    declare l_cur sys_refcursor;
    l_ID int;
    l_tableName varchar(30);
    BEGIN
    
    open l_cur for
    select hkc.ColumnID, mapping from &HKAPPDB_Schema_Name..doctablemapping ddm
    inner join &HKDB_Schema_Name..HKColumns hkc on hkc.doctablemappingid = ddm.id
    where ddm.id > 0;
    LOOP
         FETCH l_cur into l_ID, l_tableName;
         EXIT WHEN l_cur%notfound;
                
         -- update missing VerbID in DocumentDocMapping table
         UPDATE &HKAPPDB_Schema_Name..IndexedDocument 
         SET VerbID = (SELECT t.VerbID 
                             FROM (SELECT DocRef, VerbID, DateUpdated 
                                  FROM &HKAPPDB_Schema_Name..l_tableName dd        - this is where the dynamic table name is used
                                  WHERE dd.VerbID is not NULL))
         WHERE HKColumnID = l_ID AND VerbID is NULL;
    
    END loop;
    end;
    /
    When I try to execute it I get an error

    ORA-00942: table or view does not exist

    What I am doing wrong?

    Kind regards
    Toby

    You cannot use a variable instead of a table name. You must build the dynamic SQL. Search for IMMEDIATE EXECUTION or DBMS_SQL in Document Oracle.

  • Name of the dynamic table is possible?

    Hi guys,.

    I have fact tables every day with the same structure, each table in a day: fact20090701, fact20090702 etc.
    Every night a new table is created.

    Database is Oracle.

    I need a single command prompt date and then run a query on the corresponding table.

    Is this possible?

    Direct application of the database is not an option.

    Thank you
    Alex

    Hello

    In the physical layer, go to table special and double click on it (go to properties) > general tab.
    You will find the option use dynamic names. When you click on this it asks the name of the variable.

    so, you must create a session variable that contains the dynamic value. And use it here...
    SQL is something like: SELECT 'fact' | to_char (sysdate, 'yyyy') | to_char (sysdate, 'mm') | to_char (sysdate, 'dd') block initialization
    assign it some variable... He uses...

    Hope this helps you...

  • 8610 all-in-one printer: I can't download the firmware update to remove the dynamic security

    "For not original hp ink users an update of the firmware option to remove the dynamic security is now available for select Officejet, Officejet Pro printers Officejet ProX."

    I have bee patiently for the "fix".   Following the posted signs: http://support.hp.com/us-en/document/c05308850?openCLC=true

    Step 2) "click your HP printer model in the table below and run the file to update the firmware downloaded from your Internet browser."

    Seems to have no option to run the download of my Internet browser.

    I use Safari (and that's all I intend to help).  When I click on the download, I get an error message that says: there is no application to open the file. I tried to right click 'open with' - any of these options are internet browsers.

    Can you offer any help?

    Hello

    Option updte to remove the functionality of dynamic security listed in the document is only intended for a Windows PC.

    Download and install the update by using the following link for Mac OS:

    http://FTP.HP.com/pub/softlib/software13/printers/OJP8610_R1640B.dmg

    Kind regards

    Shlomi

  • Strategies for bridge (structs) containers to the c dll table ++

    Does anyone have any suggestions for the passage of tables of containers (C structs) between TS and c ++ dll? I have exhausted my understanding here. I noticed that when I create a type which is an array of containers (size = 1), allow to move like a C struct but exclude the container as C struct, and then type presents itself as a struct rather than an array ref in the C++ dll parameters dialog box. I was hoping that I could exploit something here, but not luck.

    As a last resort, I could try to flatten the structures in an array of double, pass it as a VARIANT and rebuild on the other side - yuck!  I have hundreds of different transfers to manage that way, so I'm still holding hope for something better.

    In C/C++, I think that if you define a structure with a table like this:

    struct {Topic2

    int sizeVar;

    Topic1 array [size];

    }

    Then, the size is fixed. It doesn't really change because the compiler whenever you allocate a variable of the type of structure, must allocate enough space to store all the items that you have declared in the definition of struct. In other sizeof (Topic2) includes the full size of the array defined using the constant of 'size' that must be a constant, not a variable. If you want something more dynamic, you declare your structure as follows:

    struct {Topic2

    int size;

    Topic1 * array;

    }

    you dynamically allocate the memory for the array pointer and release it dynamically when you're finished with it.

    A simpler approach, that you can take, if the size range is quite small, is to make the Board as large as size max you will ever need and add another Member to say how many items in the table is actually being used. And it seems that your def struct is close to that, but not quite right. For example, I'm sure that you can not use the size for the variable field and the size of the array. Instead, you probably need something more like this

    struct {Topic2

    int numElements.

    Topic1 table [taille_max];

    }

    Hope this helps,

    -Doug

  • Manipulation of the data in table

    I would like to be able to manipulate certain data (columns 2 and 3 of the txt file) that I collect according to time (column 1 of the txt file).

    Now, as the VI is running, these data are plotted on a graph in wave form and stored in a txt file.

    What I have to do is:

    Column 1 - convert every moment at a wavelength.  I know starting wavelength (nm) and the rate of change of wavelength (nm/s).  I do this conversion on an excel spreadsheet right now where [current wavelength = previous wavelength - rate of change of wavelength * (time-previous time)].  So how extract column 1, take the difference between the value of the second and the first value and create a new column (somewhere) corresponding to the wavelength?  And save it in a new column?

    Column 2 - need to divide each value by 100 and subtract by a 'base' (on average the first 20 points, for example).

    Column 3 - as it is.

    Last step - write to the file a new column defined as manipulated column 2 divided by column 100 3 times... and then this field (on the y-axis) based on the manipulated column 1 (x axis).

    It is extremely critical that the manipulation of data occur in real time... it can occur after the file has been written if necessary.  The graphic result should stand as the jpeg attached.

    Thank you in advance for the help - I'm a little unsure on the conversion of table, unbundling, etc. so much unlike mathematical and medium which must be obtained.

    Meredith


  • Write to the file of measurement with a loop For using the value of the dynamic data attributes

    I looked and looked, but couldn't find a solution for this.

    I currently have 15 points of different data that I try to write in an Excel file.  I have all combined in a table and lie with the function "write into a file position.  However, the column names are always "Untitled", "Untitled 1" etc.  I then used the function 'Set the Dynamic Data attributes'; but for this I have to do 15 different functions "set data dynamic attributes.  It was suggested to use a loop with the function 'Set the Dynamic Data attributes' inside of her, but I can't find how do.

    I have several arrays consisting of 15 different values for 'Signal Index' 'Name of Signal' and 'Unit', but also a unique 'get Date/Time In Seconds' related to 'Timestamp '.  The problem is that the error I get when I try to connect the output with Scripture at the entrance to measure file:

    The source type is dynamic data table 1 d.  The type of sink is Dynamic Data.

    How can I fix it?  I have attached a picture of my installation; Sorry if this is gross (I'm new on this!).  Thank you!

    It will get rid of the error, but it is not quite correct. What you need to do after that is to click on the output or the tunnel entry and select 'replace with the shift register. In addition, the array of values that you have wired to the Signal Index is wrong. Arrays are 0 based. Just wire the iteration Terminal here. And, finally, take the size of the table and this connection to the N terminal are stupid. Don't wire nothing to this.

  • Size of the dynamic online ListField

    My requirement is to have the dynamic height listfield, I implementd a listfied custom by extending a VerticalFieldManager for each line and adding to another verticalfieldmanager for scrolling effect, but I'm stuck when it came to adding images in each row.

    I enclose the code to add textalone, of customrow

    public class CustomRow extends VerticalFieldManager implements FieldChangeListener, FocusChangeListener
    {
    public CustomRow(String a, String b)
        {
            field = new RichTextField(a,RichTextField.NON_FOCUSABLE);
            field.setPadding(10, 10, 0, 10);
            field2 = new RichTextField(b,RichTextField.NON_FOCUSABLE);
            field2.setPadding(0, 10, 10, 10);
            _focus.setFocusListener(this);
            this.add(_focus);
            h = this.getPreferredHeightOfChild(field)+this.getPreferredHeightOfChild(field2)+10;
            _vfm = new VerticalFieldManager(){
                protected void paint(Graphics graphics)
                {
                    h = this.getHeight();
                    graphics.drawLine(10, h-1, Display.getWidth()-10, h-1);
                    super.paint(graphics);
                }
            };
            _vfm.add(field);
            _vfm.add(field2);
            this.add(_vfm);
        }
    }
    

    A Y

    One way is to make your line a HorizontalFieldManager, add your 'image' as a BitmapField, and then add a value for money, where you add your RichTextFields.

    If you want to add lines by using this structure, loads, this will make slow processing, especially whenever you add a line.  You can do better your online custom a field.  But if you add only a few of them, it should run OK.

  • The dynamic firewall application on the VPN Clients with ASA

    Hello

    I'll put up a Cisco ASA to complete the remote VPN client connections, but I want to assure you that the dynamic firewall is enabled on the client.

    I know it's possible with the VPN concentrator, but cannot see any documentation detailing that can be performed on an ASA.

    Anyone encountered this?

    Thank you

    James

    I believe you can use Group Policy settings to configure the firewall client.

    You can find more information about this feature in the migration to http://www.cisco.com/en/US/docs/security/asa/asa72/vpn3000_upgrade/upgrade/guide/migrate.htmlguide.

    Hope this helps.

    Andrea.

    Step 1 under Configuration > VPN > General > Group Policy Panel, select group policy in the table and

    Click on change. ASDM displays the Edit Group Policy dialog box.

    Step 2: click on the customer Firewall tab Figure 5-6 shows the firewall client options configured for this example:

    • Inherit-disabled (disabled)

    • The required Firewall Firewall setting

    • Type firewall Cisco Integrated Client Firewall

    Firewall policy-policy (CPP) pushed •

  • Name of the dynamic pageFlowScope variable on a page of amx, possible?

    Hi all

    I have a problem that I can't seem to move at the moment. I have java classes that try to update some data, and if it is not successful it returns the ID of the control that contains the error. Then I take this control id and use it to highlight the field in error so that the user knows where it is. Usually, this works very well for any other than to a list view.

    For a grid/listView error control is returned in the form of something like "1.14" of the appeal of java, this is equivalent to the number of the line '1' and the id of the control "14". I can easily strip away the '. ' in java but I need a path in my AMX page to define a variable on the fly for example pageFlowScope #{pageFlowScope. {{} row.rowKey} 14} but I get EL analysis of errors try like this, the error is "ERROR_EL_PARSER_NESTED_EL_NOT_SUPPORTED". Basically, I'm trying to have conditional styles depending on whether E {pageFlowScope.114} is set to 1 or not. I can't imagine a better way to implement this in a listView?

    I can only suggest a medium crude to achieve.

    One way to see dynamic values in EL is to use a hash table and use the dynamic value as the key. I would record a HashMap per input element and then store the error with the line indicator not. You can even create your own implementation of HashMap and hoist the flag when running by overloading the get method.

    [For example #{pageFlowScope.elem14ErrorMap [row.rowKey}]

Maybe you are looking for

  • I usually keep all messages on my PC, but delete the older say 60 days on the server.

    Options of mail from the Inbox indicates that I can erase only (copy to PC and copy on the server), but I will not hold all messages... is there a way around this for example to transfer all messages, I want to keep out of my Inbox to a different fol

  • 15 - r036tu laptop computer HP - WiFi keeps forgetting the old network

    Hello OS = Windows unilingual 8.1 with Bing [64-bit] WiFi adapter = Ralink RT3290 802.11bgn Wi - Fi adapter Driver = date 25/11/2013 Driver = 5.0.37.0 The situation is like this... I have an ADSL + router to iBall Baton and I had kept initially named

  • NB100 - How to reset to the factory settings

    Hello Need help... How to reset the factory settings on the netbook NB100... If you know please give me step by step guide Thank you

  • Modus to connect with v AC - ups using

    I'm trying to use labview to communicate with phoenix universal power connection. I used the library Modbus OR trying to connect to the Quint AC - UPS, but it expires or do not access correctly. I'm new on using modbus and would like to help communic

  • Activation of Windows window is empty.

    I read a bunch of other questions similar to this one and they are all almost identical issues but no matter what I tried, I just can't get this window is displayed correctly.  I have run the MGAdiag tool and I will post it's information below. I bou