Graphic HTTPservice & amp; for loop

I use a togglebuttonbar to navigate between the 3 separate linecharts, each display unique data. My problem is with my current code only the last chart shows all data. Whenever I have change which chart is finally displayed is always the last chart which displays correctly.

So my lloks of code like this:

TOGGLEBUTTONBAR

VIEWSTACK

Loop for (example: 3 times looped) {}

new canvas (added as child to viewstack)

new Panel (addd like child on the Web)

new chart

new Array (for the online series)

LOOP FOR (example: 2 times) {}
new line
Line.yfeild = NAME
line to push in the Bay of the serial line
}

HTTPservice to get data, called dataReceived function, which is within this loop for

dataReceived {Chart.dataProvider = event ;} / / works for you of httpservice, Ive checked during debugging, and because the last chart shows properly}

}

fact.

So, who should display 3 cards, each with two lines. Notice that the httpservice calls the same piece of XML code for each graph, but Im showing only a few parts in the each individual card. (for example, the xml file has: APPLES, ORANGES, BANANAS a cahrt display apples next bananas, etc.)

A useful part of the code is below... once more, only data from the last chart are displayed.

var DB_Connect:Object = new Object;
var URL: String = new String;
URL = "" http://192.168.11.12/getdata.php?length=day " "

useHTTPservice (DB_Connect, URL, dataReceived);

_newChart.series = _newSeries;
_newPanel.addChild (_newChart);

function dataReceived(evt:ResultEvent):void
{
_newChart.DataProvider = evt.result.point;
}

It is within the first loop. I'm sure Im making a noob!


get the newChart object synchronously, but sometimes the data asynchronously.

You need to store a reference to each instance of the child, perhaps in an array (object) associative, as it is created. Then in the result handler, assign the result to the appropriate chart.

Probably need AsyncToken to match the call to succeed.

Tracy

Tags: Flex

Similar Questions

  • For loop in place, images to scale and move

    I have an image which I enclose, is the white part of the image (I recorded it on a black background so it is easy to see, but it's on a transparent background, saved as a gif file and imported to flash). When my for loop runs, I'm trying to put this image on stage by programming, but it seems that it is not doing things. It will scale the image and positioned some in all directions

    I wanted the images (8) appears in 2 columns each staggered regularly, but he fails to do so. The clip holds the image below. Since it is an irregular shape, it also seems to make the edges really rough.

    (1) why is the loop generating these images in all directions like this?

    (2) it would be more ideal to draw this shape with flash, rather than by using a gif image? Such a form is even possible to draw?

    This is the code:

    Fl.transitions import. *;
    Fl.transitions.easing import. *;
    import flash.events.TimerEvent;

    var imageLoader:Loader;

    var xmlData:XML;

    var bucketItem:MovieClip; They hold the attached picture
    var bucketHor:MovieClip;

    placeBuckets();

    public function set {loadedXML(xml:XML):void}
    xmlData = xml;
    }

    function placeBuckets (): void {}
    var all: Number = 50;
    After var: number = 115;

    var bucketCount:XMLList = xmlData.product;
    for (var u: uint = 0; u < bucketCount.length (); u ++) {}
    bucketItem = new bucket();
    bucketHor = new bucketr();

    If (bucketCount.country.text ([u]) == 'USA') {}
    1st = bucketItem.y;
    bucketItem.x = 100;
    var bucketTween:Tween = new Tween (bucketItem, "x", Regular.easeOut, bucketItem.x, 0, 0.5, true);
    } else {}
    bucketHor.y = after;
    bucketHor.x = 300;
    bucketItem.scaleX = - 1;
    var buckettwoTween:Tween = new Tween (bucketItem, "x", Regular.easeOut, bucketItem.x, 0, 0.5, true);
    }
    var bucketImgTrans = new TransitionManager (bucketItem);
    bucketImgTrans.startTransition ({type: Zoom, direction: Transition.IN, duration: 3, easing:Strong.easeOut});})
    var bucketImgTransH = new TransitionManager (bucketHor);
    bucketImgTransH.startTransition ({type: Zoom, direction: Transition.IN, duration: 3, easing:Strong.easeOut});})
    trace (bucketItem.y);

    trace (bucketHor.y);
    addChildAt (bucketItem, 0);
    addChildAt (bucketHor, 0);
    After = (after + 200) - 115;
    1st (1st + 130) = - 50;
    }
    }

    It's the Stmt trace for two position there of bucket

    0
    115
    0
    200
    0
    285
    0
    370
    370
    0
    450
    0
    530
    0
    610
    0

    Regarding graphic design, here is the code (not exactly like yours but you can make adjustments - discover the documentation Flash Graphics class):

    var sp:Sprite = new Sprite();
    var gr:Graphics = sp.graphics;
    gr.beginFill(0xff0000);
    gr.moveTo(0, 0);
    gr.lineTo(213, 5);
    gr.lineTo(213, 65);
    gr.lineTo(6, 75);
    gr.lineTo(0, 0);
    gr.endFill();
    addChild(sp);
    

    In regards to the positioning, what are these classes/symbols backet and baketr?

    		   
  • Pavilion 15-K5C19PA #ABG: cannot install graphics drivers Nvidia for HP Pavilion Notebook 15-p102tu

    Cannot install graphics drivers Nvidia for HP Pavilion Notebook 15-p102tu

    [my laptop is not install my window 8.1 nvidia driver 64 bit my new purchase Moose please help me hp] team?

    Hi @mnshahid,

    Thank you for visiting the HP Forums! A place where you can find solutions for your problems with the help of the community!

    I stumbled upon your post on the laptop and wanted to help you! I looked in your question about your HP Pavilion Notebook 15-p102tu and problems with NVIDIA drivers. Your system uses only the Intel driver high definition (HD). Here is the download if you needsp68117.exe. I uninstall Nvidia and reboot the laptop.

    Please let me know how it goes.

    You can say thanks for trying to help by clicking on the Thumbs Up below! .

    Thank you.

  • parallel processing: for loop taking place

    Hallo,

    I have a loop 'for' runnin on this system: LabVIEW2009, windows7, intel i7.

    I wonder if and how I can tell to LabVIEW that he would be allowed to run different iterations of the loop at the same time (concurrently) on my processor with 8 cores.

    Now, it will execute the next iteration when it ended the previous, even one so is there no dependencies in iterations.

    I want to give a 'ownership' of the loop, which means that it can be "unfolded" for parallel execution.

    Thank you

    Pier

    pop up on for loop and select "configure interation Prallelism."

    Activate it.

    Wire a certain number to the new 'P' of entry to specify how many processors to spread it everywhere.

    Ben

  • for loop in formula node does not

    Hello

    I; m trying to use for loop in the node of the formula, but it is does not work. I want the output (y1) product value in certain range (a and d, and of course one is smaller than d). I ' do not use primitive labview since a and d are keep changing (both are variable). I tried to put "return 0;" after the y1 equation but the error popup.

    The issue of the loop works not because it gives the last value (I average would be ""). It does not begin with an (initial) value.

    Please help me how to solve this problem...

    Pls ignore other variables not used in the equation. Thank you!! A lot

    Your code works.

    But why you use loop?
    You get the last value, so you can get it in a single step with x correct;

    Also why you say that can not use primitives?
    If you use wire instead of terminals or local variable States values constant.

    Y1, y1_2, y1 3 is the same values calculated differently.

  • parallel for loops does not

    Hello.

    I'm learning the multi - thread programming. To start, I use "parallel for loops" and I was surprised that it does not work. One - thread loop work a few times faster (depending on settings) that multi - thread. I don't know why, and it is my request to correct my Vi to work properly.

    Lenovo, G580, Windows 7, 64-bit computer

    Intel Core i7 3632QM
    Ivy Bridge
    Specification Intel (r) Core i7-3632QM CPU @ 2.20 GHz
    Package (platform ID) Socket 988 B rPGA (0x4)
    Number of hearts 4
    Number of threads 8

    LabView 2011.

    Altenbach says:

    Gibbon wrote:

    What was 'strange' behavior?  In "linia dluga" when inside the loop is on '1' of the "spreed up' between one and multi-fil is about 3 times, when I put it in '20' this grow to 6.2. It was strange form me, becourse I expect a similar value.

    A parallel FOR loop has an overhead for parallelization (split the problem, then go back the results, etc.). If the code is very fast, the overhead is proportionally larger. If the Subvi takes a long time to complete, the overhead of parallelization is insignificant. It is often not worthwhile to parallelize the loops with a very simple and fast code.

    Gibbon wrote:

    Altenbach - I have another question if you can help me - how did you "seconds relative high resolution." VI "? -I want to say how did you know that there is this 'vi '. And thanks a lot for your modyfications.

    You can find it in vi.lib\utilities. It is well known.

    Maybe not well known enough!  the 'Hidden gems' package adds to your palattes.  It has also been considered by a nugget of the community

  • For loop runs with the value of N unwired

    In this case will be a loop run connected to the loop N worthless? I have seen a few examples of the loop for run without a certain number of times set to be ran wired or for example a size of table or something like that.

    PauldePaor wrote:

    Here's a program I am and as you can see the image that the program runs without the loop N being wired. The program will run without problem

    As everyone else has said, you don't have to plug something on N.  If you wire up a table for loop for input "auto-index", the loop for will run automatically the smaller table size.

    Perhaps an example will help:

    This makes a loop on my table size (in this case, long of 5 elements).  On the edge of the loop for which resembles [] brackets, indicates that it is auto-indexé.  The loop should go through each item one at a time (1, then 2, then 3, then 4, then 5).

  • Préallouée VI environment in paralleled for loop

    Hello

    I searched a bit and couldn't find that everything about this specific issue.

    If I have a Subvi in a parallelized for loop and the Subvi is set upon reentrant preallouee clone, the Subvi register also several characteristics of memory depending on the number of loop iteration For? My specific application is a Subvi containingvibration Analytisis screw using the previous data in their spread and filters.

    Thank you!


  • For loop creates 1 d data table

    Hello, I am building the circuit below, and I'm running into a lot of problems with the loop, creating a table 1 d of data from certain types of data such as the ERROR OUT and the VISA NAME of RESOURCE. I understand why it does this, but I only need the last value in the table (the value of the last iteration of the loop for). This is true for me for the error, resource name of visa, and I was thinking of using the Boolean value that indicates when the for loop.

    Is there a simple way to extract the last value in the table 1-D so that it is correct to pass along trails, VISA and ERROR type?

    You actually create a block diagram, not a circuit.  A circuit is an electrical system including devices and wires.

    If you right-click on the tunnel and choose disable indexing, then you get the value of the last iteration rather than a 1 d table.

    I recommend you watch the LabVIEW tutorials online
    LabVIEW Introduction course - 3 hours
    LabVIEW Introduction course - 6 hours

  • LabVIEW parallel for loop and OpenMP

    Hello:

    It's just a curious post, I just learned about OpenMP and I found that OpenMP helps you to parallelize loops in c about the same way that you can use the loop For parallel in LabVIEW.

    The loop For Parallel LabVIEW is being implemented under the hood using OpenMP? Or is it just a coincidence?

    No, it is not implemented LabVIEW parallel for loop under the hood using OpenMP. You might be interested to read this article on modern developments in the LabVIEW compiler architecture. Specifically, in this case, it's the DFIR technology discussed here that facilitates parallel for loop transformations.

  • For loop within a while loop

    I have for loop within a while loop... admission to the for loop N comes from the VI selection... the while loop I a condition essentially statement it stops just after to finish all the iteration in loop...

    Entrance to the N loop is bascially driven by a local variable... that's the problem Iam having:

    When I press the Start button to run the program... regardless of the output of the select VI is gives the N of the for loop, then the loop starts and then ends in place... and when the output of the select statement takes a different value (the N of the loop for) loop not work until I restart the program again... What can I do so that the for loop runs again for another value of N, the RUN program button is enabled.

    1. clean your diagram.  Style guides suggest keep the pattern of a single screen.  With a little effort, I was able to get your DB less than 1600 x 1000 pixels.

    2 then I can see (some) it happens all at once. This thing does nothing?

    3. local variables can lead to race conditions.  Output in Angle position may be a race condition, although is probably not what you wanted to do.  What does the wired local time at the moment present terminal meter? (Ooops! Two controls with the same name - which can be quite confusing as well!)  If you need or want two components of façade having the same text, use the legends.  Make the labels is different so the comic is more readable.

    4. having more than one Dequeue function on the same queue will lead to unpredictable results.  When an item is removed, it is removed from the queue and is not accessible to any other Dequeue function.  In parallel loops, you have no way of guessing which Dequeue will seize any particular element.

    5 use Boolean reverse instead of Select with wired False to true and true cable at the entrance to false entry. Better, just make the case of forgery in the structure of the case within the for loop the real deal. No required reversal.

    6. I was not looking for to determine the logic of the code within the structure of this case. It seems I could have posted a much simpler way to do this several weeks ago.

    7. use multiply from the Digital Palette rather than a node form multiply by 4 or 1.8. Uses less space BD and is much easier to read.

    8. as has been suggested, learn how to work the machine architecture and the State of producer/consumer.  They can make your life much easier.  Do not try to convert immediately to these models.   It's too much bite to at some point.  Learn how they work first.  Make a few simple examples.  Then rewrite this program in this format.  Probably faster than fixing what you have now.

    Lynn

  • For loop tunnel exit "Last value" output of default values

    Salvation OR community,

    Today, I came across a probem of LabVIEW stange. A tunnel of release of "Last value" to a for loop back the default values instead of the last real value. The code is below:

    Below as screenshots of probes 44 and 45.

    When the probe 44 contains al the data (all the planks are present (and the correct "Testrack Module" is used)) probe 45 is empty.

    I already tried to remove the complete thread and it rewire. The result was the same.

    However, I also tried to use registers with shift instead of the tunnels and the code works now (see below for the code).

    The used version of Labview is 2013 SP1.

    I hope you can help,

    Tim

    Edit: If the images are too small, you can drag it to a new tab, and they become the original size.

    Tim,

    My first assumption: the because the loop never executes as you pass an empty array to an entry of automatic indexation.

    Another option, which is difficult to see in the screenshot: are there two entries of tunnels over the probe nr 42?

    Norbert

  • FOR loop does not update the local Variable

    I am newer to labview, and I can't wrap the head around why not a habit of local variable to update in the code if it updates on the dashboard. Anything im missing?

    Assume that you are talking about the local variable of the 'State of the cell. The terminal updates every 500ms in the small top loop, the local variable indicates simply that the indicator and thus updates also.

    The problem is "dataflow" and you need to familiarize yourself with the concept!

    Once the while loop starts, the local variable is reading and inside the loop begins. Most likely, the local variable is read before it is updated in the small loop, so most likely returns the value of a fade on the first iteration of the while loop. Now the small loop continues to go twice per second for about five seconds. Only after the loop FOR (and everything else inside the while loop) completed, the while loop will go to the next iteration, date on which the local variable is read once more, this time with the last value of the last for loop iteration of the previous iteration of the while loop.

    In summary, the local variable updates very well, it's just that the code does not read the new value around most of the time.

    Your VI is full also potential competition conditions caused by the over-use of the local variable. You need to respect the proper execution order by eliminating local variables.

    So what is the solution? Hard to say without knowing what the VI is supposed to do. Most likely, you will need to remove the inside OF the loop and use it outside while loop for everything.

  • How to end Vi in a For loop

    Hello. I enclose my Vi. I have a question about stopping a loop For I have 2 loops for the case "Test underway". I have a termial conditional that will stop my Vi but only after you have completed all the iterations of the loop For I have need of this Vi to stop immediately, when you press the stop button. I realize that it will take probably still finish an iteration, however, at the present time it waits until all iterations are performed, before coming to rest. I'm doing it with the same front button that stops the while loop. I tried a local variable, but to change a mechanical action and I prefer not to do, if this is possible. There was a lot of posts related to this topic here on the forum but I couldn't find the one suited to my needs. Thank you for your time.

    Your While loop waiting loops to stop, so you can use local variables of your stop button to stop the for loops right now.

    See you soon,.

    Jimmy

  • Creating tables in a nested for loop

    Hi all.

    I was stuck in this problem for quite a while now and I still don't know how to continue. Some outside the entrance would be greatly appreciated!

    I'm doing the following:

    -Take an array of numbers, to check if they are within a certain range (e.g. between 2 and 4)

    -Build two new arrays: one with all the numbers that are inside the beach and the other with the rest.

    An additional condition is that the amount and value of the range conditions will change (for example, it could be between 2 and 4 only / 2, 4 AND 6 and 7 according to the entry)

    To treat this, I created two nested for loops - one that goes on a table that contains conditions of the beach and inside that actually go and check if the values are in the range. I think I did that part successfully, but the next part is confusing to me - how to actually create the tables separated within two loops for?

    My apologies if I did not explain it well. Another method to support this problem is I want to translate following LabVIEW:

    Ranges of table / / [1 5 7 10] exodus-> This means we want to divide numbers based on those who are in (1,2) and (4.5) against those who are not

    Table of values / / [2 3 6 11 3]

    EndOperationDelegate table / / array of values within the range
    Table outValues / / Array of values out of range

    for m = 1:size (ranges)

    for n = 1:size (values)
    If (THE NUMBER IS on the INSIDE of EACH RANGE)
    EndOperationDelegate = [EndOperationDelegate NEWNUMBER]
    on the other
    outValues = [outValues NEWNUMBER]
    end

    end
    end

    Sounds easy enough, but it gets so chaotic with Labview that I don't know what to do. I have attached a reference image - insertion in the array function is not in fact add to the table, it creates a new table. How can I save that for when the nested for the ends of the loop?

    I have seen a few examples with shift registers which lie in a loop and I couldn't successfully that transfers in my block diagram.

    Any help/direction would be greatly appreciated.

    Hello!

    See the following example to understand how you can create a table in the loop For

    In your case, you also can uce conditional terminal to create a table only when then located nearby. It makes the code much cleaner that the structures of the case

    Hope this helps, if not, let me know if I can help you!

    Marcin

Maybe you are looking for