Applying maths function on the fly

I�m currently working on my final year university project. I intend to develop a web based system which would allow a user to log on to a website and find out current pollution levels for any postcode they enter within the city of Manchester. The problem is as follows: Pollution data is available for a number of fixed locations around the city of Manchester. I need to apply some kind of function that would allow me estimate pollution levels at ANY postcode within the city � actual figures only exist for a few postcodes. Data from the pollution monitoring stations is available every hour so the backend database supporting the website will be populated once every hour. The data obviously needs to be pre-processed (using the function) and estimated levels calculated against each of the cities postcodes. Can anyone advise me as to a suitable / efficient way of tackling this using Java?

This sounds like quite a tough thing to do.
How many different postcodes are there in Manchester?
In London we have loads, N1-22, SW1-18, E1-14, W1-8,
those are the ones I know about. I hope you're going
to stop at the N15 level, and not go into the second
bit of a postcode, W1 5BU!?I agree, there are a number of different postcodes. However, as you point out I'm only intending to calculate a pollution level for each post code 'cell' e.g. just M1 - M18 (I think it goes up to that :-))
What do you plan to do the website in? JSP? Applet?
Servlet? How do the pollution people supply the data?
XML feed? Web service? File made available? Yes a CSV file for pollution levels recorded each hour is available
Dumped in
a DB you can access? Nope I'll have to populate a DB with the info in the CSV file.
What frame work will all the
components be on, DB and web server?Yep, Java prog. will have to process information in CSV file so that estimated pollution levels are available for each post code cell even if a particular cell doen't contain a pollution monitoring station.
How do you intend to work out the pollution level for
a postcode not provided by the pollution people? Will
it be something like, if a postcode falls halfway
between two monitored areas, the pollution level will
be calculated at half the difference of the two? What
if a third one is nearby, will that have an effect on
the result?This is essentially my problem. I will need to apply some kind of function based on all the factors you have mentioned above. I'm wondering the best way to implement this is Java.
Depending on whether the data is put in a DB for you
or not, and if you have a choice, could you not obtain
the data via a web service? Taking the DB out of the
equation altogether.Not really as I need to calculate estimated pollution levels for every postcode. These figures then need to be added to a DB so they can be recalled when someone uses the web service.
This could get very complex but it sounds like a nice
thing to do. Keep us informed of your progress.
AdeCheers for you help. If you have any more suggestions / input it would be great to hear from you .......
Tom

Similar Messages

  • Maths function on the fly?

    I intend to develop a web based system which would allow a user to log on to a website and find out current pollution levels for any postcode they enter within the city of Manchester. The problem is as follows: Pollution data is available for a number of fixed locations around the city of Manchester. I need to apply some kind of function that would allow me estimate pollution levels at ANY postcode within the city � actual figures only exist for a few postcodes. Data from the pollution monitoring stations is available every hour so the backend database supporting the website will be populated once every hour. The data obviously needs to be pre-processed (using the function) and estimated levels calculated against each of the cities postcodes. Can anyone advise me as to a suitable / efficient way of tackling this using Java?

    At first sight though, given you have a point located between 4 stations forming a square:
    D1 = Distance between station 1 and 2
    D2 = Distance between station 3 and 4
    D3 = Distance between station 1 and 3
    D4 = Distance between station 1 and centre of the postal code
    Theta = Angle between Centre of postal code and 1,2 axis
    D5 = Distance on y axis of the postal code from 1,2 axis = D4 * sin(Theta)
    D5 = Distance on x axis of the postal code from 1,2 axis = D4 * cos(Theta)
    P1 = Pollution level at station 1
    P2 = Pollution level at station 2
    P3 = Pollution level at station 3
    P4 = Pollution level at station 4
    PX1 = P1 + D5/D1*(P2-P1)
    PX2 = P3 + D5/D1*(P3-P4)
    PR = PX1 + D4/D3*(PX1 - PX2)
    PR is the resulting pollution level, however this work ONLY if the station form a square.
    Regards

  • Math functions with error in/out

    Please refer to the attached picture. Where do you get these math functions with the error in/out? I saw these in responding to a post.
    Richard
    Solved!
    Go to Solution.
    Attachments:
    them_things.jpg ‏2 KB

    No wonder I've never seen it, I never use the waveform datatype. Thanks Lynn and Smerc.
    Richard

  • I want to use the Function Generator VI to send command signals through the NI 7344 motion controller. This will be a closed loop servo valve system. I want to be able to change from say a square wave to a sine wave on the fly. Idea's?

    I am going to run tests that require an actuator to move using various types of arbitrary waveforms such as sine or square. The NI 7344 is hooked to the UMI that is going through a driver for a servo valve. The loop is analog and it is closed. I have played with some of the examples but can't get it to work. I have used the function generator VI to generate a signal but I think I am using the wrong input VI to the motion control board. When I use what I have it moves the servo and then stops. It doesn't continually generate the signal.
    I would love to use the controls on the function generator vi to control frequency and amplitude ect. Any help or pointer would be helpful. Thank you in advance.

    Hello,
    I'm not clear on exactly how you want to use the generated data but I'm assuming they will be used as your target points.
    There's a built-in example for motion called 'One-Axis Contour Move.vi'. This example demonstrates how to provide your target points as 1-D array. All you need to do is to replace the input array with the output of the function generator. In order to have it run continuously, use a while loop. You can further program your application so that it'll change the waveform on the fly by monitoring the user interface but this might be little little tricky as you will need to reset the move and load the new generated points while keeping track of your current position.
    I hope this helps. Let me know if you have further questions regarding this
    application.
    Best regards,
    Yusuf C.
    Applications Engineering
    National Instruments

  • Can Access DRM encryption be applied on the fly?

    Hi,
    ... and thanks in advance for responding. I have the following questions:
    Can Access DRM-Core and Access DRM-Pro encryption be applied to a video file "on the fly" for RTMP?  (I'm not interested here in Access Protected Streaming)
    How about for HDS?
    How about for HLS?
    By "on the fly", I mean at the time the request was made from the client and as a prelude to the  response from the media server. This would allow us to avoid creating and storing an Access encrypted representation of the video in advance.
    Thanks!

    There are a couple ways to generate just the "DRM Headers" without having to encrypt the whole file.
    1. If you're an Adobe Broadcast Licensee, with access to our Broadcast SDK (HDKb), there are APIs in there to just generate the DRM Metadata.
    2. If you have a recent version of AMS, the f4fpackager tool that comes with the product has had a recent revision where you can update an existing F4M (manifest) file to include a new DRM Metadata, which is created on the fly.  I'm not sure if this new f4fpackager tool has been released yet in the latest AMS, however.
    Besides those routes, the only other way to create a DRM Metadata would be to package an entire video.
    cheers,
    /Eric.

  • Questions about the High Throughput Math Functions

    Hello,
    i am just trying to unterstand what advandages the High Troughput Math Funtions have. So i have to ask some Questions.
    I always talk about beeing inside a SCTL.
    1. In the Image you can see four Add Functions. One with U32 which should use more Ressouces than the one with the U16Datatype which uses mor than the U8. But does my FXP High Througput Math Function use less Ressources than the U8 Version?
    2. Which of this four Add Functions will take less time for Execution?
    3. If I would Add two 32bit Numbers one with the normal Add and one with the High Throughput Add. Which of the Functions will use less Resources and which will be faster?
    4. How would it bee if i had a Multiplication instead? When i unterstand the concept of a Multiplication right it will be done with a DSP48E. This Logic Block is able of Multiplying a 25bit Number with a 18bit Number. So the U32 Multiply will use 2 DSP48Es and the other three Functions would use one DSP48E.
    I guess the U32 Version will have the slowest Execution?
    Whats about the other three will their execution speed be equal or will the Versions with smaller Datatypes be faster?
    With kind regards
    Westgate
    Solved!
    Go to Solution.

    I don't see a big rush to answer this, so I'll give it a shot:
    1. The HT version uses less resources, but only because it is configured with the smallest data types. You should get exactly the same results with the same data types and an Add function. The only difference with the HT version is the ability to specify an output register, and the handshaking signals that account for that delay. IF the add is implemented in a DSP48, the integrated register can result in better timing, but in practice it is usually equivalent to an Add function followed by a feedback node.
    2. The actual delay through an add is proportional to the number of bits, where the critical path is the sequentially computed carry chain. So you could run the last one at the highest clock rate. The FPGA has dedicated fast carry logic, so the difference isn't too significant.
    3. The first one will be VERY slightly smaller and faster, just because you're computing one extra output bit on the second one.
    4. I would expect the speed to depend only on the number of DSP48s used, so the last 3 should be similar. You'd be likely to see different results in practice, though, due to routing differing numbers of bits to registers for the indicators. This assumes you're not taking advantage of any of the pipelining configuration options in the HT Multiply. Those options, and the associated handshaking signals, are really what differentiates the HT versions from the regular numeric functions. They allow you to achieve higher clock rates and throughput at the expense of latency (ie, it will take more clock cycles to produce a valid result but you can get more data through the function in a given amount of time).
    Caveats: All your examples have constant inputs, so the LabVIEW compiler and/or Xilinx tools can and will optimize them to no ops. Small multiplies, multiplies with one constant input, or those just larger than 25x18 may also use some non-DSP48 logic for all or part of the implementation. Note that the HT palettes provide a DSP48E function in case you want control over exactly how a multiply and/or add gets implemented. Placing and routing can result in unexpected behaviors, so estimating timing is much more difficult than simply adding up component delays.

  • SUM function for a column made 'on the fly'

    I have access to a database, however only SELECT statements can be run on the database. Basically the database lists switches, these switches can have up to 20 computers connected to them but some do not. I need to know the switches which contail less than 20 computers so I know where there is space for more computers (I've wrote the code for this already). I also need something to keep a tally/total for the number of spare spaces left so I can run the script and go 'ok we have a total of 20 spare places for computers theres 10 on this switch and 10 on this one'.
    I just need to get the sum funtion working for the column that I've created 'on the fly', the column revealing the number of spare slots, heres the code I've got so far:
    SELECT switch, COUNT(*) as "Servers", 20 - COUNT(*) as "Spare slots"
    from dedicated_servers
    where switch like 'rs%'
    GROUP by switch
    HAVING COUNT(switch) < 20
    order by Servers;
    Which gives the following:
    | switch | Servers | Spare slots |
    | rsj14-1.dc | 12 | 8 |
    | rsj12-1.dc | 15 | 5 |
    | rsi2-2.dc | 16 | 4 |
    | rsj13-1.dc | 16 | 4 |
    | rsi2-1.dc | 16 | 4 |
    Just need something at the end saying TOTAL=25

    OK I'll have to make em up though, but they are something like this for one switch:
    INSERT INTO dedicated_servers (switch, server_number, switch_socket)
    VALUES (rsj-1.dc, 100, 18)
    On switch rsj-1.dc there can be upto 20 servers (the server_number is the primary key)
    Message was edited by:
    slowpoke115

  • How to adjust a function generator on-the-fly in Labview 7.0

    I'm using the 'Simulate Signal' vi in LabView 7.0 (with BNC-2090 board) to generate a triangle wave for output to a potentiostat. If the value of either the high or low potential is changed, however, the signal incorporates discontinuities as it recalculates the amplitude and offset. Does anyone know of a way to recalculate the phase shift on-the-fly so that those discontinuities and sudden jumps in signal no longer appear? I think there should be a way to do it using an array, but the 'simulate signal' vi seems like it would be much easier to use.

    I agree with Evan that this is not an easy task.
    A PID loop could help with the discontinuity but hurt other things. Here are my thoughts.
    PID at output of "Simulate Signal"
    This would smooth the transition but would also round-off the max and mins. Probably not good.
    PID to control Amplitude and offset
    Once you have this tuned, it may do what you want if you can tolerate the delay.
    Filtering
    Here you have to tolerate some phase shift as in the above. You are also caught in a catch 22 because you do not want the dicntinuity when the settings change but meanwhile the triagle wave is an endless series of cusps.
    Let us know what ends up working for you.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Premiere CS5 will not render video with titles on the fly in preview window

    I am trying to use CS5 and notice if I add a title to the timeline overlapping any video and then attempt to play the video as soon as it hits the part with the title the video stops playing in the preview window. The background sound keeps going but video play back stops. In premiere CS4 it would render titles on the fly no problem. Why wont it do it in CS5? I should not have to render the timeline it should do at least a rough realtime playback without a full render. In CS4 it would play any and all effects on the fly depending on the resolution and the performence would vary depending on how many and what effects and transitions were applied to the clips but its very useful to get a quick idea how it will look. If I scrub, the titles playback while scrubbing no problem its only with actual playback it happens. Other effects and transitions I apply seem to render on the fly and play back in the preview window ok, it only seems to be the titles having the issues.
    Any ideas?

    Version = 5.0
    Language = english
    Latest updates = applied
    Issue happens regardless of sequence settings
    Windows 7 64 bit
    latest updates
    english
    1650x900 , 32 bit color
    Intel core 2 duo 3ghz cpu
    8 gig ram
    Nvidia 9600 gt with latest drivers
    multiple monitor setup
    Audigy 2 platinum pro sound card from creative , latest drivers
    3 hard drives,  drive 1 = 1TB with 747gb free, drive 2= 1TB with 750 gb free, drive 3 = 200gb drive with 75 gig free
    Usualy capture video from a canon HV30 using Cineform Neoscene capture software, this is 1440x1080 HD 24p clips. (issue with the titles happens on any imported video in any format though, even with no clips but on a matt background)
    Cineform Neoscene capture software version 5 latest version
    Only using stock premiere plugins
    No error message
    I want to use the built in premiere title function to place titles along with fades and what not and then play back clips in the preview windows with the titles applied rendering on the fly. This works perfectly in CS4, just not in CS5. When I try it in CS5 after you hit the play button it will play the clip but as soon as you get to the part of the clip where the title is the video playback will freeze, mind you the clip is still playing in the sense that audio is still going just the video playback stops in the preview window. As a note if you scrub the video on the timeline the video clips will display with the titles applied it should, it is only when you hit the play button the problem happens.
    I have tried adjusing the quality settings in the preview window, updated my gfx card drivers and system drivers along with directx. Premiere is updated. I have tested other effects and transitions and they display fine, including super imposures such as chroma key or ultra key. I have adjust playback settings not that there was much to adjust there.
    I will say again in CS4 never had this issue, I am surprised to see it here.
    Please any ideas would be appriciated thx.

  • Math Functions in SAP

    What are the math functions in SAP?

    Hi,
    This is what u want may be
    Mathematical Functions
    ABAP contains a range of built-in functions that you can use as mathematical expressions, or as part of a mathematical expression:
    [COMPUTE] <n> = <func>( <m> ).
    The blanks between the parentheses and the argument <m> are obligatory. The result of calling the function <func> with the argument <m> is assigned to <n>.
    Functions for all Numeric Data Types
    The following built-in functions work with all three numeric data types (F, I, and P) as arguments.
    Functions for all numeric data types
    Function
    Result
    ABS
    Absolute value of argument.
    SIGN
    Sign of argument:                      1 X > 0
                                                  SIGN( X) = 0 if X = 0
                                                                   -1 X < 0
    CEIL
    Smallest integer value not smaller than the argument.
    FLOOR
    Largest integer value not larger than the argument.
    TRUNC
    Integer part of argument.
    FRAC
    Fraction part of argument.
    The argument of these functions does not have to be a numeric data type. If you choose another type, it is converted to a numeric type. For performance reasons, however, you should use the correct type whenever possible. The functions itself do not have a data type of their own. They do not change the numerical precision of a numerical operation.
    DATA N TYPE P DECIMALS 2.
    DATA M TYPE P DECIMALS 2 VALUE '-5.55'.
    N = ABS( M ).   WRITE:   'ABS:  ', N.
    N = SIGN( M ).  WRITE: / 'SIGN: ', N.
    N = CEIL( M ).  WRITE: / 'CEIL: ', N.
    N = FLOOR( M ). WRITE: / 'FLOOR:', N.
    N = TRUNC( M ). WRITE: / 'TRUNC:', N.
    N = FRAC( M ).  WRITE: / 'FRAC: ', N.
    The output appears as follows:
    ABS:              5.55
    SIGN:             1.00-
    CEIL:             5.00-
    FLOOR:            6.00-
    TRUNC:            5.00-
    FRAC:             0.55-
    DATA: T1(10),
    T2(10) VALUE '-100'.
    T1 = ABS( T2 ).
    WRITE T1.
    This produces the following output:
    100
    Two conversions are performed. First, the contents of field T2 (type C) are converted to type P. Then the system processes the ABS function using the results of the conversion. Then, during the assignment to the type C field T1, the result of the function is converted back to type C.
    Floating-Point Functions
    The following built-in functions work with floating point numbers (data type F) as an argument.
    Functions for floating point data types
    Function
    Meaning
    ACOS, ASIN, ATAN; COS, SIN, TAN
    Trigonometric functions.
    COSH, SINH, TANH
    Hyperbolic functions.
    EXP
    Exponential function with base e (e=2.7182818285).
    LOG
    Natural logarithm with base e.
    LOG10
    Logarithm with base 10.
    SQRT
    Square root.
    For all functions, the normal mathematical constraints apply (for example, square root is only possible for positive numbers). If you fail to observe them, a runtime error occurs.
    The argument of these functions does not have to be a floating point field. If you choose another type, it is converted to type F. The functions themselves have the data type F. This can change the numerical precision of a numerical operation.
    Regards

  • JAVA 3D: How to animate "on-the-fly"?

    Hy guys,
    I'm new to Java 3D and I've read a whole bunch of tutorials as well as Selman's book.
    However, as great as Java 3D seems, it seems like I can't get Interpolators to work the way I want them to! Here is my goal:
    Create a simulation where the View is FIXED and the main ANIMATED character (comibnation of objects) MOVE AROUND the universe through the user's keyboard commands.
    I've managed the above by creating all my objects, adding them to a branchgroup, adding that branchgroup to a transformgroup, adding a few interpolator animations to the transformgroup and finally adding a cutom keyboard navigator behavior to the transformgroup.
    The following problem has occurred:
    I can't NICELY move the transformgroup around because I use Transform3D objects to calculate the next position of the transformgroup and I then apply it to the transformgroup by calling the "setTransform" method on that group with the Transform3D object. The result is an instantaneous leap x locale units away with no animation in between the original and final position. :o( This is the only way I got this working. The Java runtime keeps yelling at me that I can't add or remove Interpolators or transformgroups from other transformgroups or branchgroups, so I can't change interpolators on-the-fly (say, when the user wants to move in a different direction)... Can it possibly be that we can only declare and use interpolators at prior to executing a universe?!
    The IDEAL solution I'm looking for (!INSERT YOUR HELP HERE! ;o) ):
    Replace the ugly "setTransform" call by adding a PositionInterpolator or something to the transformgroup object in order to generate a SMOOTH ANIMATION from the original position to the final position. The end result will be must nicer and more professional.

    Ok, I've modified the simple behavior class in order to extend the PositionInterpolator class and be able to get a translation that always begins from the last target position. Eventually, I'd also like to be able to modify the AXIS so I can change direction... Anyway, right now I just want what IWON managed to do in one direction.
    Here's what I got that DOESN'T WORK, can someone please help me, IWON?:
    // Allows an object or group of objects to be moved around SMOOTHLY by the keyboard.
    public class KeyboardControlBehavior extends PositionInterpolator {
    private TransformGroup source;
    public static final float distance = 0.1f;
    public static final long time = 200;
    // create SimpleBehavior
    KeyboardControlBehavior(TransformGroup source, TransformGroup target){
    super(new Alpha(1, Alpha.INCREASING_ENABLE, 0000, 0, time, 0, time, 0, 0, 0), target);
    // initialize the Behavior
    // set initial wakeup condition
    // called when behavior beacomes live
    public void initialize(){
    // set initial wakeup condition
    this.wakeupOn(new WakeupOnAWTEvent(KeyEvent.KEY_PRESSED));
    // behave
    // called by Java 3D when appropriate stimulus occures
    public void processStimulus(Enumeration criteria){
    // Check which direction we're going and adjust the AXIS and endPosition
    // in consequence.
    KeyEvent event = (KeyEvent) ((WakeupOnAWTEvent) criteria.nextElement()).getAWTEvent()[0];
    int c = event.getKeyCode();
    System.out.println("KEY PRESSED = "+c);
    if ( c != KeyEvent.CHAR_UNDEFINED ) {
    if(c == KeyEvent.VK_UP) {
    System.out.println("UP");
    if(c == KeyEvent.VK_DOWN) {
    System.out.println("DOWN");
    if(c == KeyEvent.VK_LEFT) {
    System.out.println("LEFT");
    if(c == KeyEvent.VK_RIGHT) {
    System.out.println("RIGHT");
    // Let the PositionInterpolator animate the translation.
    super.processStimulus(criteria);
    // Adjust the source's position to be at the end position of the
    // animation (same as target).
    Transform3D newPosition = new Transform3D();
    Transform3D oldPosition = new Transform3D();
    source.getTransform(oldPosition);
    target.getTransform(newPosition);
    newPosition.mul(oldPosition);
    source.setTransform(newPosition);
    // Reset the Alpha class since it only executes once.
    super.getAlpha().setStartTime(0);
    // Consume the event.
    event.consume();
    // do what is necessary
    this.wakeupOn(new WakeupOnAWTEvent(KeyEvent.KEY_PRESSED));
    } // end of class SimpleBehavior

  • How to change the frequency of pulse train on the fly using an array of values?

    Hi all!
    First I want to thank U for the great job you are doing for this forum.
    Iam still busy trying to control a stepper motor, by sending pulses from my E-series 6024 to a compumotor s6- stepper Driver. I've managed to get it working. I desperately need to control the motor using the values from an array. I believe we can use two approaches for that:
    1st - I can get an array of the "numbers of pulses". Each element must run for 10 milliseconds. Using that we can calculate the array of frequencies to send the number of pulses within 10 milliseconds for each specific element. Could we use the arrays of "number of pulses" and frequencies in a "finite pulse train " and up
    date with each element every 10 millisecond?
    2nd - Or Could we use of the frequency array in a "continuous pulse train vi" and update it every 10 milliseconds?
    Please note that I must use the values as they are.
    Can someone please built a good example for me? Your help will be appreciated.
    Regards
    Chris
    Attachments:
    number_of_steps.txt ‏17 KB
    frequency.txt ‏15 KB

    Tiano,
    I will try to better explain the paragraph on LabVIEW. The original paragraph reads ...
    "While in a loop for continuous pulse train generation, make two calls to Counter Set Attribute.vi to set the values for "pulse spec 1" (constant 14) and "pulse spec 2" (constant 15). Following these calls you would make a call to Counter Control.vi with the control code set to "switch cycle" (constant 7). The attached LabVIEW programs demonstrate this flow."
    You can make two calls to Counter Set Attribute or you can make a call to Set Pulse Specs which, if you open this VI, you will see that it is just making two calls to Counter Set Attribute. What you are doing with the Counter Set Attribute VIs is setting two registers called "pulse s
    pec 1" and "pulse spec 2". These two registers are used to configure the frequency and duty cycle of your output frequency.
    The example program which is attached to this Knowledge Base demonstrates how to change the frequency of a continuous generation on the fly. Why continuous? Because changing the frequency of a finite train would be easy. When the train completes it's finite generation you would just change the frequency and run a finite train again. You would not care about the time delay due to reconfiguration of the counter.
    If you would like to change the frequency of the pulse train using a knob, this functionality will have to be added in the while loop. The while loop will be continuously checking for the new value of the knob and using the knob value to set the pulse specs.
    LabVIEW is a language, and as with learning all new languages (spoken or programatic) there is a lot of learning to be accomplished. The great thing is that LabVIEW is much easier than mo
    st languages and the learning curve should be much smaller. Don't fret, you'll be an expert before you know it. Especially since you're tackling a challenging first project.
    Regards,
    Justin Britten

  • Can I create a dashboard layout on the fly?

    Hi all, I am trying to create a dashboard layout "on-the-fly"
    (dynamically).
    for example: I can create the following layout using MXML
    very easily:
    [CODE]
    <mx:VBox width="100%" height="100%"
    horizontalAlign="center">
    <mx:Canvas id="dashboardCanvas" width="90%"
    height="90%">
    <mx:HBox width="100%" height="100%">
    <mx:Panel title="panel 1" width="50%" height="100%">
    <mx:VBox width="100%" height="100%"
    borderStyle="solid">
    <myDashboarComp borderStyle="solid" />
    <myDashboarComp borderStyle="solid" />
    <myDashboarComp borderStyle="solid" />
    </mx:VBox>
    </mx:Panel>
    <mx:Panel title="panel 2" width="50%" height="100%">
    <mx:HBox width="100%" height="100%">
    <myDashboarComp borderStyle="solid" />
    <myDashboarComp borderStyle="solid" />
    <myDashboarComp borderStyle="solid" />
    </mx:HBox>
    </mx:Panel>
    </mx:HBox>
    </mx:Canvas>
    </mx:VBox>
    [/CODE]
    You can see that I want to build my dashboard up using
    HBox's, VBox's, Panels and the individual custom components
    (myDashboarComp) - keepinng the layout and structure quite simple.
    The above MXML creates a simple Dashboard consisting of the
    canvas (where it all starts - it constructed from -
    "dashboardCanvas"). the canvas has 2 panels within a HBox (so are
    side by side) called "panel 1" and "panel 2". panel 1 contains a
    VBox containing 3 components (displayed vertically) and panel 2
    contains a HBox containing 3 components (displayed horizontally) -
    so very simple.
    However - I want to control this layout externally e.g.
    passing an object or array (some sort of descriptor) to describe
    the layout to my app.
    I then want to loop through this descriptor item and build my
    dashboard using ActionScript rather than MXML to more control and
    flexibility.
    this is the object I have created and have been experimenting
    with in ActionScript:
    [CODE]
    [Bindable]
    public var descriptorObj:Object =
    {item:"dashboard", children: [
    {item:"vbox", id:"vbox1", percentWidth:100,
    percentHeight:100, children:[
    {item:"panel", id:"panel1", percentWidth:50,
    percentHeight:100, children:[
    {item:"vbox", children: [
    {item:"myDashboarComp"},
    {item:"myDashboarComp"},
    {item:"myDashboarComp"}
    {item:"panel", id:"panel2", percentWidth:50,
    percentHeight:100, children:[
    {item:"hbox", children: [
    {item:"myDashboarComp"},
    {item:"myDashboarComp"},
    {item:"myDashboarComp"}
    [/CODE]
    This is as far as I got as I kept hitting hurdles from here.
    Basically - all I want to do is somehow read / loop through
    this object and build my dashboard.
    First of all I was unsure of the best way to loop through the
    object - as I have to do it in order to get the correct layout...
    i.e. the first 3 "myDashboarComp's" are added to the >
    VBox that is added to > "panel1" that is added to the > HBox
    that is added to the > Canvas.
    This is where I ran into my second problem. I managd to loop
    through and read the elements checking there "item" in the object
    and adding them accordingly.... I could loop though and add each
    item to the canvas ok, e.g:
    [CODE]
    private function initApp():void
    for(var i:int=0; i<descriptorObj.children.length; i++)
    var itemType:String = descriptorObj.children
    .item.toString();
    var percentWidth = descriptorObj.children.percentWidth;
    var percentHeight = descriptorObj.children
    .percentHeight;
    addContainer(itemType, percentWidth, percentHeight);
    private function addContainer(conType:String, pWidth:int,
    pHeight:int):void
    if(conType == "panel")
    addPanel(pWidth, pHeight);
    else if(conType == "vbox")
    addVBox(pWidth, pHeight);
    private var newPanel:Panel;
    private function addPanel(pWidth:int, ptHeight:int):void
    newPanel = new Panel();
    newPanel.percentWidth = percentWidth;
    newPanel.percentHeight = percentHeight;
    newPanel.title = "test panel";
    dashboardCanvas.addChild(newPanel);
    [/CODE]
    in the above actionScript the canvas "dashboardCanvas" is
    already set up in the MXML (but is the only MXML container added as
    the rest should be built using the create object "descriptorObj" in
    AS).
    This is my next problem - when I have added a container,
    e.g. a panel the next items e.g. my "myDashboarComp's" should then
    be added to the previously added panel and not to the canvas
    anymore - I need some way of telling the app to add children to the
    last added container and not to the canvas (and each container can
    change type from a panel to VBox to HBox etc....)
    I hope what I am trying to say makes sense, and any help on
    this one would be greatly appreciated.
    I just need pointing in the right direction and some ideas on
    how to continue would be good - and if my thinking / method / ideas
    are actually possible.
    Kind Regards,
    Jon.

    There are several ways to do this. The third chapter in the
    cookbook is a good place to start.
    All things in ActionScript are based on objects. Constructing
    them with the data needed for the ui information you will need and
    then binding that data to your dashboard objects is basically what
    you are going to be doing.
    For me it makes the most sence to have an idea of what
    different types of objects you will be creating and create some
    extended components for those objects. Then when you recieve your
    data, binary or xml, you can digest the configuration settings from
    the layout and populate the constructor for each of your
    components.
    It sounds like you need to organize your layout structure in
    a heirarchy and from that you can walk each branch and create each
    set of things as you parse your data.
    Without a bit more information as to what you are
    specifically doing that is about as far as I can go minus adding in
    some code along some line that I think might work.
    Hope that helps some.
    -D

  • Convert Chinese on the fly

    Dear all,
    I have a DB which the NLS_CHARACTERSET is UTF8.
    In a table, we have a column which set as varchar2 data type.
    Users will put content into it (which some times are traditional chinese, and sometimes are simplified chinese).
    Based on the new user requirements, I need to:
    1. identify those records with traditional chinese / simplified chinese
    - I read from the web that I may use the dump function to do so. However, I did some tests and it seems incorrect. Any tips on this?
    2. Convert the characters on the fly
    - is it possible that I convert the column into all traditional chinese / simplified chinese when I select / export / view?
    - I heard that the function convert may help but I can't make it works. Any help on these two issues are very appreciated. many thx.

    The data in the VARCHAR2 column should encoded using the UTF-8 Unicode encoding. It should not be either simplified or traditional Chinese.
    If the client application is accepting data using the traditional Chinese character set, that data should be converted to the database character set transparently by the SQL*Net layer when it is sent over the wire based on the client's NLS settings. Similarly, if the client application is accepting data using the simplified Chinese character set, the data should be converted to the database character set when it is sent over the wire based on that client's NLS settings. Similarly, when you select data, the client's NLS settings should indicate the character set that the client application wishes the data to be converted to and that should be done transparently by the Oracle SQL*Net layer.
    Justin

  • Extract text data from dbc on the fly

    Hi All,
    I am currently setting up a testsystem for a CAN based project with LV7.1 and Teststand 4.
    I have my PXI8461 CAN card sending and receiving CAN messages fine but I wish to perform some work on all channel ( signal ) information before passing it up to Teststand for analysis.
    For my Teststand purposes it is preferable to work with text, for example if the DUT has a button pressed then the appropriate signal gets sent up to Teststand as "On" or "Off" etc rather than 1 and 0. ( CANoe has this feature and the LDF driver kit for LIN in Labview also )
    This is very useful for Teststand when checking test conditions rather than trying to equate a test with a number, so tests can be written like if result = "Ignition On" then Pass else Fail.
    The dbc file I have contains this text representation of data but is there any VI which can be ran after a Read Channel which will convert Channel data to text ?
    Thanks,
    Mike 

    Hi Mike,
    Thanks for the post! and I hope your well today.
    Im not very familiar with the CAN palette, but Im sure we could use Lower Level VIs to build this functionality.
    So, when on the fly, the CAN message is a number (0 or 1) and then convert it using a case structure?
    I imagine this issue is more complex then I have caught on so far, so please, maybe some example code etc would help.
    Kind Regards,
    James.
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

Maybe you are looking for

  • Download music?

    i used to own a pc and i have recently bought an ibook g4. the problem with my old pc is that i downloaded too much music off of limewire and basically killed my computer with spyware. i decided to get a mac because i have been told they dont contrac

  • Does my ipad2 work with Canon MG4150

    Hi, just brought an IPad 2 and not sure if it connects/how to connect to my Canon MG4150 printer. Anyone know how?

  • DVD "Dual Layer"

    Folks - I assume my model (iSight - last version) came with a "dual layer" DVD RW. Does this mean I can burn 9G DVDs? What is "dual layer"? Thanks.

  • Add on registraion failed

    dear all, i had installed on add on on the SAP B1. it runs on server machine using all user logings like manager, stores.. but the problem is when i am going to log in from client machine the that add on is not runing erroring like addon installation

  • The fade effect filter is  greyed out as a selection in edit. My image is an 8 bit and is an RGB format. How can I make it work?

    My computer is a 64 bit PC and I am using the latest version og PS CC. The short cut key also comes up wkth nothing - CRT+shift+filtersF