Timer class usage!

from Mr. Mohee Jarada
Lufthansa Systems - Forté Consultant
Email(s):
[email protected]
[email protected]
Hamburg - Germany
Hi,
If any one facing problems with Timer class usage in Forte SO, please read
the following TechNotes about the solution:
Technote 11063
Technote 11548
Technote 10586
All the best
Mohi
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

from Mr. Mohee Jarada
Lufthansa Systems - Fort&eacute; Consultant
Email(s):
[email protected]
[email protected]
Hamburg - Germany
Hi,
If any one facing problems with Timer class usage in Forte SO, please read
the following TechNotes about the solution:
Technote 11063
Technote 11548
Technote 10586
All the best
Mohi
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

Similar Messages

  • Combining LVOOP DVR with Asynchronous Dynamic Dispatch and Preserve Run-Time Class

    OK, the title sounds like a cornucopia of LVOOP terms.  But there's a reason.  This is in a way an extension of THIS thread.
    What I'm doing recently is creating a LVOOP approach to loading Completely Asynchronous UI elements into subpanels.  This I have combined with a global repository for the objects (which are essentially singletons with a UI functionality) which are shared via DVR, thus eliminating a lot of synchronisation headaches).
    This means that I can ahve a universal framework for launching the UI elements into a subpanel.  The changes made on the Object there are automatically reflected in the global repository.
    So far so good.
    What I don't like too much is a combination of two seemingly awkward code constructs I need in order to keep things running.
    Weird construct 1:
    I have defined a "Launch UI" function in my parent class which is Dynamic Dispatch (Allowing each object to take care of launching its own UI).  This takes a parent object DVR as a second input which I make sure is of the exact same type as the object type being invoked by using the code shown below.  The ACTUAL Type of both inputs to the launch VI within the IPE are identical.  This is guaranteed because I require each new class to override this function.
    Here I pass the DVR from outside the IPE to the "Launch" VI but the Object obtained within the IPE retains information required for DD thus ensuring that the VI called for launching the UI is identical to the ACTUAL object type in the DVR.  This works OK and by placing this weird construct WITHIN the parent class, abuse is minimised, it works fine and seems to have no major side-effects.
    So now we have a VI running asynchronously in the background which belongs to a specific object but has a DVR which it *thinks* is of a Parent Type but, because of the steps taken earlier, is actually of the same type as the object itself.
    In order to make use of the functionality defined in this actual object type, I need to continuously re-interpret the Object within the IPE as shown below.  Otherwise only the Parent functionality is available.
    If I am accessing only methods of the parent class, then the Preserve functionality is not needed.
    Is there a more elegant way to do this?  I find the net result of this code and type-juggling to be really useful and much easier to manage than the non-DVR route since the synchronisation issues disappear.  By making the IPE usage near-atomic we remove the chances of deadlock.
    All editing done in the UI of the asynchronous VI is reflected automatically in any subsequent usage of the DVR.  Even if the DVRs are not shared between VIs, this makes (for me) the headache of synchronisation easier.  If you start expanding this beyond the limits of a single VI, the benefits in Synchronisation become really huge.  You can even have multiple UI objects operating on the same data in the background without extra synchronisation needs.  The only synchronisation required is a global "Data updated" for the object in question whereby the UI elements simply update their indicators and controls from the DVR again.  This is trivial.
    Thus I am convinced that the net result of this is very beneficial.
    My question is if there's a better, safer or more "official" way to do this?
    I was about to start a new Idea for combining the "Preserve Run time Class" and the DVR Terminal of the IPE so that the casting is done automatically.  We could then have a double input to the IPE, the DVR (of base type) plus the ACTUAL Type of the object but of course returning an error if the types are incompatible.  It would be like an "Imposter" DVR input for the IPE which allows a re-interpretation of the object type.
    Would all of this go away if we allowed Dynamic Dispatch to work with DVRs?  Probably.
    Shane
    Say hello to my little friend.
    RFC 2323 FHE-Compliant
    Solved!
    Go to Solution.

    You guys rock!
    I didn't even think of casting the DVR like that.  Kinds stupid of me but I never would have thought it would work.  Cool.
    Also, Yeah, the limitation of no IPE in the Launch VI was one I spotted quite early on.  this is why my Launch VI also doesn't accept more data than is absolutely neccessara because a DVR access in that VI will of course cause a lockup.  I have the system so far now that I can have a SINGLE Launch VI (Which is NOT overridden, so the limitation refers to only a single VI now which is certainly better.
    So again guys, thanks for helping out an old newbie.  I've been around for quite a while, have made many posts but I love the way I just keep learning from others in the Forum.  This is just why I absolutely LOVE it here. 
    Shane.
    Say hello to my little friend.
    RFC 2323 FHE-Compliant

  • My battery runs low very fast (three hours). I looked in the usage settings and it seems the time for usage and stand-by are the same, allthough i did have my iphone on stand-by!! What can i do?

    Community,
    I have a problem with my iphone 4. Every few months my battery starts draining within a few hours. I have tried all kinds of battery saving tips, but they don't help. When i go to the settings/general/usage is can see that the time for Usage and Stand-by are the same, so my phone is fully on all the time this explains the draining. But in reallity i turn my phone to stand-by most of the time, i mean the screen is black and all???
    The first and second time a had this problem, both a few months a part,  i restored my phone and it was solved. This time i restored my phone but this did not help!! And restoring my phone every two months is not my preferd way of solving this problem.
    Does anybody have an idea on how to solve this problem? can anybody help me?
    best regards,
    Merijn

    Restoring is the answer. It sounds as if there is a rogue process constantly draining your battery.
    The issue you face is that, if you restore your backup thereafter, you risk the problem coming straight back with your files.
    Store your files individually and it is time to start fresh.

  • Formatting incoming string with date/time classes?

    Hello,
    In the software I am writing currently I am @ a certain point talking to an external device. sending requests, receiving responses.
    One of the things I find in the response is "20090429094222", as a string.
    I cannot change anything to that, thats the way I get it from the device, so thats where I'll have to start with.
    As you could probably guess this is a date and a time. Now my question. Is there a good way to format this from 20090429094222
    to
    2009-04-29 09:42:22
    using date and or time classes, not using String operations?
    Thanks in advance.

    I found a class containing 2 functions who do exactly what I need, for those intrested:
    public static Date convertStringToDate(String txtFormat, String txtDate) {
            DateFormat dateFormat = new SimpleDateFormat(txtFormat);
            Date date =  dateFormat.parse(txtDate);
            return date;
    public static String formatDate(Date date, String txtFormat) {
            DateFormat dateFormat = new SimpleDateFormat(txtFormat);
            String txtDate = dateFormat.format(date);
            return txtDate;
        }Using them this way gives me exactly what I want:
    Date dt = DateUtil.convertStringToDate("yyyyMMddHHmmss", incomingDateSTring);
    String newDateString = DateUtil.formatDate(dt, "yyyy-MM-dd HH:mm:ss");Problem solved, thanks alot to those who gave me some explanation on the problem.

  • Timer Class in jsdk 1.4 w2000 doesn't compile

    Since this is based in the tutorial, shouldn't be a big deal but I spent the whole day looking for a solution. Please help!
    The tutorial presents this program:
    //1.3
    import java.util.timer;
    public class Problem {
    public static void main(String[] args) {
    final Timer timer = new Timer();
    timer.schedule(new TimerTask(), 5000);
    System.out.println("In 5 seconds this application will exit. ");
         public class TimerTask implements Timer {
    public void run() {
    System.out.println("Exiting.");
    timer.cancel();
    My problem starts because java.util doesn't have the timer class:
    Problem.java:2: Class java.util.timer not found in import.
    import java.util.timer;
    ^
    Now, JSDK 1.4 doesn't have timer as a package, but as a class, nevertheless, the instruction:
    import java.util.*; // instead of java.util.Timer
    doesn't compile because
    Problem.java:10: Interface Timer of inner class Problem. TimerTask not found.
    Problem.java:6: Class Timer not found in type declaration.
    I think Timer should be expressed as abstract, but how?
    I'm new in Java and feel a little frustrated...

    >
    ProblemSolved.java:3: Class java.util.Timer not found
    in import.
    import java.util.Timer;
    ^
    1 error
    Then you are not using java 1.3. You are using something before that.
    for the Timer and
    javac IteratorDemo.javaIteratorDemo.java:1: Interface java.util.Iterator of
    class IteratorDemo not foun
    d.
    public class IteratorDemo implements
    java.util.Iterator {
    ^
    1 error
    And this suggests that you are using something before 1.2.
    Just a thought...
    Windows comes with the MS version of java, which matches something like 1.1.6. It is in the path. So does you path put the jdk path first or last?

  • Using server time in  Timer Class

    Hai,
    I have develped an application(stand alone) using swings. the exe runs in all the systems in my company.
    requirement is
    --> application has to be closed at 11.59 P.M everyday.
    i did this task using Timer class. Timer class takes the system time in which the application runs. what i need is the server time. so when the application runs it has to check the server time and when the server time is equal to 11.59 PM application has to be closed.
    so how do i map the timer class to my server time?
    iam breaking my head for this for past few days. is there any way to do this?
    thanks

    1)Do you have one database in total? I mean all Java Application read and save data to this database. If so, try to get time from database by using database function. I recommend you to do this because database is central and all application share data with the database.
    2) You can still call web server in Java application. My link in last post will tell you.
    3) You can write a Java Server application for providing current server time for all your Java application. Socket technique may be used.
    Therefore, solution 1 and solution 2 look simpler than solution 3.

  • Timer class and javax.......

    Hi,
    Downloaded the latest java version to d:\download folder. The downloaded file has the name
    " j2re-1.4.2_03-wndows-i586-p.exe ". The file size was about 14.53MB. Double clicking the same installed j2re1.4.2_03 in "C:\Program Files\java\j2re1.4.2_03" folder.
    When I tried to compile Reminder.java program that comes with online Tutorial
    from within C:\Program Files\java\j2re1.4.2_03 at MS-DOS prompt, I got the error message �class java.util.Timer not found in import�.
    I also have Jdk1.1.3 in C:\jdk1.1.3 folder. When I tried to compile Reminder.java from within C:\jdk1.1.3 at MS-DOS prompt, got the same error message,
    Even after changing path variable to C:\jdk1.1.3\bin. Please help.
    Trying to compile any swing program at both DOS prompts gives error message �javax.__________ not found in import�. Can�t figure out why. Please help.
    ammukalai.

    j2re1.4 is a runtime only (ie j2re = Java Runtime Engine) It will not compile java files.
    The timer class was introduced with Java version 1.3.
    You currently have a very old version of 1.1.3.
    You need to download the j2se1.4.2 SDK - http://java.sun.com/j2se/1.4.2/download.html
    The size is closer to 50MB :-)
    Cheers,
    evnafets

  • Need to implement the timer class for 1.1

    Hi
    I am using JDK1.1 for integration with a STB.
    The timer class is not existing for 1.1.
    Where I can find an implementation code of the timer class in order
    to perform a schedule task which work with JDK 1.1
    Thanks
    Fred

    Before you look for Sun's implementation of Timer in post-1.1 versions, make sure you read the licence agreement for those versions and the copyright notice on the code. There's a good chance that by using that code you will be violating one or both of those. This may be a serious issue.
    Your other alternative is to read the API documentation for Timer (and TimerTask) and to write your own implementation. That shouldn't be too difficult.
    I doubt that you will find people actively writing open-source extensions for Java 1.1 since Java 2 has been out for nine years now. Most likely you are on your own there.

  • How to use server time in  Timer Class

    Hai,
    I have develped an application(stand alone) using swings. the exe runs in all the systems in my company.
    requirement is
    --> application has to be closed at 11.59 P.M everyday.
    i did this task using Timer class. Timer class takes the system time in which the application runs. what i need is the server time. so when the application runs it has to check the server time and when the server time is equal to 11.59 PM application has to be closed.
    so how do i map the timer class to my server time?
    iam breaking my head for this for past few days. is there any way to do this?
    thanks

    1)Do you have one database in total? I mean all Java Application read and save data to this database. If so, try to get time from database by using database function. I recommend you to do this because database is central and all application share data with the database.
    2) You can still call web server in Java application. My link in last post will tell you.
    3) You can write a Java Server application for providing current server time for all your Java application. Socket technique may be used.
    Therefore, solution 1 and solution 2 look simpler than solution 3.

  • Timer Class

    Hi
    I am using a timer delay between 2 functions, with the delay of 140ms.  One function triggers an RAW audio file thats embed into the .swf by extending the sound class.
    The problem is, that I am having slight timing issued that seem to be on a global scale.  So far I have to audio channels playing samples that are uncompressed and very short.  I have dicovered and read some adobe cookbooks on the accurateTimer() class, thats been custom built to override the Timer class functions, but I cant seem to get it to work on my set up.
    The app is a music sequencing app that will eventually have 16 channels of audio apposed to the current 2 at present.
    The cookbook is can be found here:
    http://cookbooks.adobe.com/post_Accurate_timer-17332.html
    And my code that drives the audio channels is here:
    var tempo:Number = 125.125;
    var timer:Timer = new Timer(tempo,1);
    timer.addEventListener(TimerEvent.TIMER, switchToColorZero);
    var boxi:int = -1;
    var boxi2:int = -1;
    function changeColours():void
        //trace("changeColours() :" + getTimer());
        ct.color = colour[2];
             if(boxi < boxes.length - 1)
                boxi += 1;
             else
                boxi = 0;
             //if white turn green
             if(boxes[boxi].ONOFF)
                boxes[boxi].transform.colorTransform = ct;
             else
                mix1Transform = new SoundTransform(currVol,currPan);
                mix1 = kick.play();
                mix1.soundTransform = mix1Transform;
                trace(currVol,currPan);
             if(boxi2 < boxes2.length - 1)
                boxi2 += 1;
             else
                boxi2 = 0;
             if(boxes2[boxi2].ONOFF)
                boxes2[boxi2].transform.colorTransform = ct;
             else
                mix2Transform = new SoundTransform(currVol2,currPan2);
                mix2 = hat.play();
                mix2.soundTransform = mix2Transform;
                trace(currVol2,currPan2);
             timer.start();
    function switchToColorZero(e:TimerEvent):void
        //trace("switchToColorZero() :" + getTimer());
            ct.color = colour[0];
            if(boxes[boxi].ONOFF)
                boxes[boxi].transform.colorTransform = ct;
            if(boxes2[boxi2].ONOFF)
                boxes2[boxi2].transform.colorTransform = ct;
            timer.stop();
            timer.reset();
            changeColours();

    What kind of Timer are you writing about..... specify ....
    I know java.util.Timer()
    example with repeats
    java.util.Timer t = new java.util.Timer();
              t.schedule(new java.util.TimerTask() {
                   public void run() {// do something
              }, delay, period);delay - delay in milliseconds before task is to be executed.
    period - time in milliseconds between successive task executions.
    example without repeats
    java.util.Timer t = new java.util.Timer();
              t.schedule(new java.util.TimerTask() {
                   public void run() {// do something
              }, delay);Good Luck

  • SetDelay() in Timer class

    hi,
    A small doubt ? can we sleep for a while if we are using Timer class .
    I used setDelay(1000) method. but it doesn't work like in Thread.sleep(1000). can anybody suggest me.
    Thanks ,
    -balaji

    Assumption: you refer to javax.swing.Timer
    Timer timer = new Timer();
    timer.start();
    ...//do stuff
    ...//blah, blah, blah
    //need timer to stop for 2 seconds, give or take
    timer.stop();
    try{
        Thread.sleep(2000);
    }catch(InterruptedException ie){
        ie.printStackTrace();
    timer.start();Does that work for you?

  • Plz help in Timer class

    Plz i want the timer class to start but if a packet was recieved from a client before the time is finished the timer is canceled.
    //e.g
    Datagrampacket rec=new Datagrampacket (byte[],length);
    Timer t=new Timer ();
    t.schedule(MyTimerTask,1000);
    socket.recieve(rec);
    // the timer started and the recieving will not start until the timer stopped.
    //how to make the recieving happen if the timer is still runnig.
    I would be very thankful.

    Starting a timer is asynchroneous, so it will not block. The socket will be able to receive data while the timer is running.
    /Kaj

  • How to uninstall Mcafee anti-virus from my machine because of machine bootup is taking too much of time for usage?

    Hi,
    How to uninstall Mcafee anti-virus from my machine because of machine bootup is taking too much of time for usage? so that i moved all mcafee related file to trash but while machine boot up mcafee showing and asking Authentication so any one give me better suggestion on this.
    Thanks in advance,
    Suresh Balakrishnan

    Hi All,
    i uninstalled AV successfully using as below mentioned links:
    Moved to VirusScan Other where hopefully an expert can help you.
    Until they do I Googled 'How to uninstall VirusScan 8.6 for MAC' and got this as one of the many choices:  https://kc.mcafee.com/corporate/index?page=content&id=KB54975
    There are also uninstall instructions in the User Guide: https://kc.mcafee.com/resources/sites/MCAFEE/content/live/PRODUCT_DOCUMENTATION/ 22000/PD22134/en_US/VirusScan%20for%20Mac%208.6.1%20User%20Guide%20Addendum.pdf
    By condemning files to the bin you may have scotched any automated method of removal but I will defer to the experts on that.
    Thanks lot,
    Suresh Balakrishann

  • Question redarding Timer class

    I have 16 buttons set to disabled initialy. And
    I have a timer event listener which andomly triggers one of 16 buttons to be Enabled every 250ms. How to let this timer object to create a second Timer object
    each time it enables a button. The second timer will have a delay time of 1000ms.
    When it is trggered, the second timer will clear the enabled button to be disabled again.
    It is just like one Enabled button's lift time is 1000ms. And there maybe more than one button lives at same time. How to handle their differnt life time?
    Thank you So much!

    Thank you camickr
    but my program still has problems.
    //Control Button Listener. This starts timer2 which is main timer to andomly
    //pick a button to enable it.
         class ControlButtonListener implements ActionListener{     
              public void actionPerformed(ActionEvent evt){
              System.out.println("Game Start");
              timer2 = new Timer(2000,startPicking);//Main timer     
         timer2.start();
    //Timer2 ActionListener
    class Timer2Listener implements ActionListener{     
         public void actionPerformed(ActionEvent evt){
         int pick = rn.nextInt(16);
              JButton newButton = (JButton) centerPanel.getComponent(pick);
              System.out.println("Picked "+ pick);
              newButton.setIcon(iconNormal);
         centerPanel.getComponent(pick).setEnabled(true);
         int twosec = timern.nextInt(2001);
         System.out.println(twosec);
         timer2.setDelay(twosec);
    //Here is where I create a second timer each time a button was
    //Enabled.
         timer1 = new LifeTimeTimer(1000, stopForOneSec, pick);
         timer1.start();
         timer1.setRepeats(false);
    I also have Extended Timer Class so that timer1 = new LifeTimeTimer(1000, stopForOneSec, pick); can store which button has been enabled.
    and of course Timer1Listener is just for set the enabled button to disabled.
    My problem here is, If there are two buttons are enabled within 1000ms
    That means the first button haven't been disabled, and the second Enabled button
    have already appeared. The second timer(timer1) can only have information about
    the lastest button that just appeared.
    Would you please help me with that?
    I think I missunderstand something. Sorry for bring all the troubles.

  • Change Timer Class Delay time

    Is it possible to update the Timer Class Delay time while it
    is running. I want to update it using the slider component however
    it doesn't seem to update. I even stop the timer on the THUMB_PRESS
    event of the slider that restart it after it is changed. Doesn't
    seem to work that way either. Any Ideas?

    I figured it out. Instead of setting a variable speed in the
    event handler function for the slider I direclty changed the timer
    delay variable to equal the slider value. I feel dumb now but it
    works great.

Maybe you are looking for

  • MS Access and Java JDBC help!

    Hello, I having trouble with a java GUI. I have a MS Access named Database.mdb with a table named Customer which I want my GUI to access. I want my GUI to be able to flick through the records using the field I have made for them. I already have conne

  • Select event not triggered in table with only one row

    Hi all, I am building a BI VC application where query data is displayed in a table. When the user clicks on a table row another query is then triggered and output in a second table. The output from table 1 is linked to the input of query2/table2 with

  • Adaptor To Connect Intel Imac To Home Stereo?

    It's been about five months that I've had my Intel Core Duo iMac sitting proudly on my desk. Question: Has anyone found a way to connect the audio outs to a standard home stereo? (No, I don't want 5.1, just good old 2 point stereo)... Thanks, Stu

  • Inventory Report Not able 2 trace

    Dear All, We are using "Z Report for Inventory Calcualtion of Opening and Closing Balance" The Opening Balanace and Closing Balance Figures are seen wiered in ur Production Server. But if run this same report in our QA Server.it works fine We are com

  • Adobe Flash Player 10.1.51.66 Beta 2 not working

    I can not install the new Flash Player 10.1.51.66 for the IE. I use Windows 7 x64 and see only this Crash Error: Problemsignatur: Problemereignisname:     APPCRASH Anwendungsname:     flashplayer10_1_p2_activex_121709.exe Anwendungsversion:     10.1.