Button Fire Event Multiple Times

Hey everyone.  I've somewhat inherited a LabVIEW program for a project I'm working on.  I need to fire an event in an event structure 20 times in a row to fully collect my data.  Right now i just have the event structure connected to a slider so i just slide it enough and it completes the 20 events needed.  Is there a way I can make one button fire an event 20 times?  I need the while loop for the entire program to run during these 20 times so a simple loop around the event code won't work.  Any ideas?  Thanks guys.

I'd use another solution.
When the button is pressed, start a dynamic VI that does the aqcuisition.
When the VI is done, it sends a user event (or a value (signalling) event to
some control), so the main VI knows it's done. By doing this, you seperate
the DAQ and the MMI, which is good. Both VI's are kept simple. Put the data
in a buffer, or pass it in the user event data.
Timing and event structures are difficult. It's very inconvenient to exectue
an event case every X sec. without using a dynamic VI (or parrallel loop).
Using the time out event has it's own problems. The TO event is called when
no other event occured for the given period. So if you'd add a mouse over
event (as an example) the TO case isn't called at all when the mouse
moves...
You could also start a dynamic VI that creates a user event (or value
(signalling) 20 times at some interval, and then quits. But it's just as
complex as a dynamic DAQ vi, and less elegant.
Regards,
Wiebe.

Similar Messages

  • Default button being clicked multiple times when enter key is pressed

    Hello,
    There seems to be a strange difference in how the default button behaves in JRE 1.4.X versus 1.3.X.
    In 1.3.X, when the enter key was pressed, the default button would be "pressed down" when the key was pressed, but wouldn't be fully clicked until the enter key was released. This means that only one event would be fired, even if the enter key was held down for a long time.
    In 1.4.X however, if the enter key is pressed and held for more than a second, then the default button is clicked multiple times until the enter key is released.
    Consider the following code (which is just a dialog with a button on it):
    public class SimpleDialog extends JDialog implements java.awt.event.ActionListener
    private JButton jButton1 = new JButton("button");
    public SimpleDialog()
    this.getContentPane().add(jButton1);
    this.getRootPane().setDefaultButton(jButton1);
    jButton1.addActionListener(this);
    this.pack();
    public void actionPerformed(ActionEvent e)
    if (e.getSource() == jButton1)
    System.out.println("button pressed");
    public static void main(String[] args)
    new SimpleDialog().show();
    When you compile and run this code under 1.3.1, and hold the enter key down for 10 seconds, you will only see one print line statement.
    However, if you compile and run this code under 1.4.1, and then hold the enter key down for 10 seconds, you will see about 100 print line statements.
    Is this a bug in 1.4.X or was this desired functionality (e.g. was it fixing some other bug)?
    Does anyone know how I can make it behave the "old way" (when the default button was only clicked once)?
    Thanks in advance if you have any advice.
    Dave

    Hello all,
    I think I have found a solution. The behaviour of the how the default button is triggered is contained withing the RootPaneUI. So, if I override the default RootPaneUI used by the UIDefaults with my own RootPaneUI, I can define that behaviour for myself.
    Here is my simple dialog with a button and a textfield (when the focus is NOT on the button, and the enter key is pressed, I don't want the actionPerformed method to be called until the enter key is released):
    package focustests;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.*;
    public class SimpleDialog extends JDialog implements java.awt.event.ActionListener
    private JButton jButton1 = new JButton("button");
    public SimpleDialog()
    this.getContentPane().add(new JTextField("a text field"), BorderLayout.NORTH);
    this.getContentPane().add(jButton1, BorderLayout.SOUTH);
    this.getRootPane().setDefaultButton(jButton1);
    jButton1.addActionListener(this);
    this.pack();
    public void actionPerformed(ActionEvent e)
    if (e.getSource() == jButton1)
    System.out.println("button pressed");
    public static void main(String[] args)
    javax.swing.UIManager.getDefaults().put("RootPaneUI", "focustests.MyRootPaneUI");
    new SimpleDialog().show();
    and the MyRootPaneUI class controls the behaviour for how the default button is handled:
    package focustests;
    import javax.swing.*;
    * Since we are using the Windows look and feel in our product, we should extend from the
    * Windows laf RootPaneUI
    public class MyRootPaneUI extends com.sun.java.swing.plaf.windows.WindowsRootPaneUI
    private final static MyRootPaneUI myRootPaneUI = new MyRootPaneUI();
    public static javax.swing.plaf.ComponentUI createUI(JComponent c) {
    return myRootPaneUI;
    protected void installKeyboardActions(JRootPane root) {
    super.installKeyboardActions(root);
    InputMap km = SwingUtilities.getUIInputMap(root,
    JComponent.WHEN_IN_FOCUSED_WINDOW);
    if (km == null) {
    km = new javax.swing.plaf.InputMapUIResource();
    SwingUtilities.replaceUIInputMap(root,
    JComponent.WHEN_IN_FOCUSED_WINDOW, km);
    //when the Enter key is pressed (with no modifiers), trigger a "pressed" event
    km.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ENTER,
    0, false), "pressed");
    //when the Enter key is released (with no modifiers), trigger a "release" event
    km.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ENTER,
    0, true), "released");
    ActionMap am = SwingUtilities.getUIActionMap(root);
    if (am == null) {
    am = new javax.swing.plaf.ActionMapUIResource();
    SwingUtilities.replaceUIActionMap(root, am);
    am.put("press", new HoldDefaultButtonAction(root, true));
    am.put("release", new HoldDefaultButtonAction(root, false));
    * This is a copy of the static nested class DefaultAction which was
    * contained in the JRootPane class in Java 1.3.1. Since we are
    * using Java 1.4.1, and we don't like the way the new JRE handles
    * the default button, we will replace it with the old (1.3.1) way of
    * doing things.
    static class HoldDefaultButtonAction extends AbstractAction {
    JRootPane root;
    boolean press;
    HoldDefaultButtonAction(JRootPane root, boolean press) {
    this.root = root;
    this.press = press;
    public void actionPerformed(java.awt.event.ActionEvent e) {
    JButton owner = root.getDefaultButton();
    if (owner != null && SwingUtilities.getRootPane(owner) == root) {
    ButtonModel model = owner.getModel();
    if (press) {
    model.setArmed(true);
    model.setPressed(true);
    } else {
    model.setPressed(false);
    public boolean isEnabled() {
    JButton owner = root.getDefaultButton();
    return (owner != null && owner.getModel().isEnabled());
    This seems to work. Does anyone have any comments on this solution?
    Tjacobs, I still don't see how adding a key listeners or overriding the processKeyEvent method on my button would help. The button won't receive the key event unless the focus is on the button. There is no method "enableEvents(...)" in the AWTEventMulticaster. Perhaps you have some code examples? Thanks anyway for your help.
    Dave

  • My problem is that my iCal won't sync from my first-generation iPad to my computer, and the computer sends events multiple times back to the iPad... which is now full of duplicate events. I'm NOT on iCloud.

    I'm just an old lady who doesn't know a lot about this stuff, but I do love my iPad and miss my portable calendar! My problem is that my iCal won't sync from my (first-generation, cheaper of the two models) iPad to my computer, and the computer sends events multiple times back to the iPad... which is now full of duplicate events. I'm NOT on iCloud. I've had this problem for nearly a year now. My Really Really Smart son couldn't fix it for me.

    djb53 wrote:
    Can take some time.... how much time?
    There's no simple answer to that. My calendar goes back to 2004 and is moderately busy; it took around an hour. It's possible that you've hit a slow period on the server - it happens.
    In order for it to work, your calendars should show on the MobileMe site, they should be listed under your MobileMe login name in the calendar list in iCal (calendars listed under 'On My Mac' will not sync) and your MM account details have to be entered in iCal Preferences>Accounts (this should have happened by itself).
    If it's not working please see the page I linked to.

  • Useful Code of the Day:  Button fires events while held

    Have you ever been making a GUI application with Swing and used some JButtons? Fun, right? Have you ever wanted to have the button fire action events while the button was being held down? Well, if you just stick a plain JButton in your application and press and hold the mouse button on it, you'll see it doesn't do anything except sit there looking pressed in. Insolent button!
    RepeatButton (code below, couldn't think of a better name) is a JButton subclass which contains a timer that is set when the mouse button presses the button, and after a slight initial delay (configurable), fires action events to all registered action listeners repeatedly (with another configurable delay between events) until either the mouse is released or the mouse moves out of the button (it starts up again if the mouse moves back over without releasing the mouse button) or the button is disabled. The event modifiers are passed on as well, so you know if the shift or control buttons (or whatever) are being pressed at the same time.
    There is also a method to disable the repeated action firing while holding. This, in effect, turns the button into a normal JButton, if needed.
    There is a main method for testing which will show a button in a frame and print out the action command for each action event fired.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import javax.swing.*;
    import javax.swing.event.*;
    * <code>RepeatButton</code> is a <code>JButton</code> which contains a timer
    * for firing events while the button is held down.  There is a default
    * initial delay of 300ms before the first event is fired and a 60ms delay
    * between subsequent events.  When the user holds the button down and moves
    * the mouse out from over the button, the timer stops, but if the user moves
    * the mouse back over the button without having released the mouse button,
    * the timer starts up again at the same delay rate.  If the enabled state is
    * changed while the timer is active, it will be stopped.
    * NOTE:  The normal button behavior is that the action event is fired after
    * the button is released.  It may be important to konw then that this is
    * still the case.  So in effect, listeners will get 1 more event then what
    * the internal timer fires.  It's not a "bug", per se, just something to be
    * aware of.  There seems to be no way to suppress the final event from
    * firing anyway, except to process all ActionListeners internally.  But
    * realistically, it probably doesn't matter. 
    public class RepeatButton extends JButton
              implements ActionListener, MouseListener {
          * The pressed state for this button.
         private boolean pressed = false;
          * Flag to indicate that the button should fire events when held. 
          * If false, the button is effectively a plain old JButton, but
          * there may be times when this feature might wish to be disabled. 
         private boolean repeatEnabled = true;
          * The hold-down timer for this button.
         private Timer timer = null;
          * The pressed state for this button.
         private int delay = 60;
          * The pressed state for this button.
         private int initialDelay = 300;
          * Holder of the modifiers used when the mouse pressed the button. 
          * This is used for subsequently fired action events.  This may change
          * after mouse pressed if the user moves the mouse out, releases a key
          * and then moves the mouse back in. 
         private int modifiers = 0;
          * Creates a button with no set text or icon.
         public RepeatButton() {
              super();
              init();
          * Creates a button where properties are taken from the Action supplied.
          * @param  a  the button action
         public RepeatButton(Action a) {
              super(a);
              init();
          * Creates a button with an icon.
          * @param  icon  the button icon
         public RepeatButton(Icon icon) {
              super(icon);
              init();
          * Creates a button with text.
          * @param  text  the button text
         public RepeatButton(String text) {
              super(text);
              init();
          * Creates a button with initial text and an icon.
          * @param  text  the button text
          * @param  icon  the button icon
         public RepeatButton(String text, Icon icon) {
              super(text, icon);
              init();
          * Initializes the button.
         private void init() {
              this.addMouseListener(this);
              // initialize timers for button holding...
              this.timer = new Timer(this.delay, this);
              this.timer.setRepeats(true);
          * Gets the delay for the timer of this button. 
          * @return  the delay
         public int getDelay() {
              return this.delay;
          * Set the delay for the timer of this button. 
          * @param  d  the delay
         public void setDelay(int d) {
              this.delay = d;
          * Gets the initial delay for the timer of this button. 
          * @return  the initial delay
         public int getInitialDelay() {
              return this.initialDelay;
          * Sets the initial delay for the timer of this button. 
          * @param  d  the initial delay
         public void setInitialDelay(int d) {
              this.initialDelay = d;
          * Checks if the button should fire events when held.  If false, the
          * button is effectively a plain old JButton, but there may be times
          * when this feature might wish to be disabled. 
          * @return  if true, the button should fire events when held
         public boolean isRepeatEnabled() {
              return this.repeatEnabled;
          * Sets if the button should fire events when held.  If false, the
          * button is effectively a plain old JButton, but there may be times
          * when this feature might wish to be disabled.  If false, it will
          * also stop the timer if it's running.
          * @param  en  if true, the button should fire events when held
         public void setRepeatEnabled(boolean en) {
              if(!en) {
                   this.pressed = false;
                   if(timer.isRunning()) {
                        timer.stop();
              this.repeatEnabled = en;
          * Sets the enabled state of this button.  Overridden to stop the timer
          * if it's running.
          * @param  en  if true, enables the button
         public void setEnabled(boolean en) {
              if(en != super.isEnabled()) {
                   this.pressed = false;
                   if(timer.isRunning()) {
                        timer.stop();
              super.setEnabled(en);
          * Handle action events.
          * @param  ae  the action event
         public void actionPerformed(ActionEvent ae) {
              // process events only from this components
              if(ae.getSource() == this.timer) {
                   ActionEvent event = new ActionEvent(
                        this, ActionEvent.ACTION_PERFORMED,
                        super.getActionCommand(), this.modifiers);
                   super.fireActionPerformed(event);
              // testing code...
              else if(testing && ae.getSource() == this) {
                   System.out.println(ae.getActionCommand());
          * Handle mouse clicked events.
          * @param  me  the mouse event
         public void mouseClicked(MouseEvent me) {
              // process events only from this components
              if(me.getSource() == this) {
                   this.pressed = false;
                   if(this.timer.isRunning()) {
                        this.timer.stop();
          * Handle mouse pressed events.
          * @param  me  the mouse event
         public void mousePressed(MouseEvent me) {
              // process events only from this components
              if(me.getSource() == this && this.isEnabled() && this.isRepeatEnabled()) {
                   this.pressed = true;
                   if(!this.timer.isRunning()) {
                        this.modifiers = me.getModifiers();
                        this.timer.setInitialDelay(this.initialDelay);
                        this.timer.start();
          * Handle mouse released events.
          * @param  me  the mouse event
         public void mouseReleased(MouseEvent me) {
              // process events only from this components
              if(me.getSource() == this) {
                   this.pressed = false;
                   if(this.timer.isRunning()) {
                        this.timer.stop();
          * Handle mouse entered events.
          * @param  me  the mouse event
         public void mouseEntered(MouseEvent me) {
              // process events only from this components
              if(me.getSource() == this && this.isEnabled() && this.isRepeatEnabled()) {
                   if(this.pressed && !this.timer.isRunning()) {
                        this.modifiers = me.getModifiers();
                        this.timer.setInitialDelay(this.delay);
                        this.timer.start();
          * Handle mouse exited events.
          * @param  me  the mouse event
         public void mouseExited(MouseEvent me) {
              // process events only from this components
              if(me.getSource() == this) {
                   if(this.timer.isRunning()) {
                        this.timer.stop();
          * Testing flag.  Set in main method.
         private static boolean testing = false;
          * Main method, for testing.  Creates a frame with both styles of menu.
          * @param  args  the command-line arguments
         public static void main(String[] args) {
              testing = true;
              JFrame f = new JFrame("RepeatButton Test");
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JPanel p = new JPanel();
              RepeatButton b = new RepeatButton("hold me");
              b.setActionCommand("test");
              b.addActionListener(b);
              p.add(b);
              f.getContentPane().add(p);
              f.pack();
              f.show();
    "Useful Code of the Day" is supplied by the person who posted this message. This code is not guaranteed by any warranty whatsoever. The code is free to use and modify as you see fit. The code was tested and worked for the author. If anyone else has some useful code, feel free to post it under this heading.

    This makes word completion possible for JTextArea:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import java.util.*;
    * This class provides word completion for JTextArea.
    public class WordCompleteArea extends JTextArea {
        private boolean isTextComplete = true;
        public WordCompleteArea (Document doc, String text,
                                      int rows, int columns, KeyStroke expandKey) {
            super (doc, text, rows, columns);
            String s = "word-complete";
            Action wordComplete = new AbstractAction () {
                public void actionPerformed (ActionEvent e) {
                    wordComplete ();
            getInputMap ().put (expandKey, s);
            getActionMap ().put (s, wordComplete);
        public WordCompleteArea (Document doc, String text, int rows, int columns) {
            this (doc, text, rows, columns,
                            KeyStroke.getKeyStroke ("ctrl pressed SPACE"));
        public WordCompleteArea (Document doc) {
            this (doc, null, 0, 0);
        public WordCompleteArea (String text, int rows, int columns) {
            this (new PlainDocument (), text, rows, columns);
        public WordCompleteArea (int rows, int columns) {
            this (null, rows, columns);
        public WordCompleteArea (String text) {
            this (text, 0, 0);
        public WordCompleteArea () {
            this (0, 0);
         * Define if text already written in the JTextArea will be used
         * for expansion.
        public void setTextComplete (boolean b) {
            isTextComplete = b;
         * Find out if text already written in the JTextArea will be used
         * for expansion.
        public boolean isTextComplete () {
            return isTextComplete;
        private String tokenDelimiters = "\t\r\n ,;()[]{}%+/-*<>=&|!\"\'.@#";
         * Get delimiters that form a word.
        public String getTokenDelimiters () {
            return tokenDelimiters;
         * Set delimiters that form a word.
        public void setTokenDelimiters (String s) {
            tokenDelimiters = s;
        // Additional words used for expansion.
        private LinkedList wordCompleteList = new LinkedList ();
         * Add words that will be used as expansion.
        public void addCompleteWords (java.util.List words) {
            wordCompleteList.add (words);
         * Add a word that will be used as expansion.
        public void addCompleteWord (String word) {
            wordCompleteList.add (word);
        private String lastExpanded = null;
        private String lastExpansion = null;
        private Set dontAccept = new HashSet ();
        protected void wordComplete () {
            int caret = getCaretPosition ();
            if (caret == 0)
                return;
            String text = getText ();
            if (caret != text.length () && isCompletionLetter (text.charAt (caret)))
                return;
            StringBuffer sb = new StringBuffer ();
            int index = caret - 1;
            char ch;
            while (index >= 0 && isCompletionLetter ((ch = text.charAt (index)))) {
                sb.append (ch);
                index--;
            if (sb.length () == 0)
                return;
            sb.reverse ();
            String word = sb.toString ();
            String toExpand = word;
            if (toExpand.equals (lastExpansion)) {
                dontAccept.add (lastExpansion);
                toExpand = lastExpanded;
            } else {
                dontAccept.clear ();
            String s = findExpansion (toExpand, caret);
            if (s != null) {
                lastExpanded = toExpand;
                lastExpansion = s;
                replaceRange (s, caret - word.length (), caret);
            } else {
                dontAccept.clear ();
                lastExpanded = null;
                lastExpansion = null;
                int diff = word.length () - toExpand.length ();
                replaceRange ("", caret - diff, caret);
        private boolean isCompletionLetter (char ch) {
            return tokenDelimiters.indexOf (ch) < 0;
        protected String findExpansion (String word, int caret) {
            StringTokenizer st;
            if (isTextComplete) {
                st = new StringTokenizer (getText (), getTokenDelimiters ());
                while (st.hasMoreTokens ()) {
                    String s = st.nextToken ();
                    if (    s.startsWith (word)
                            && s.length () != word.length ()
                            && !dontAccept.contains (s)      ) {
                        return s;
            for (Iterator it = wordCompleteList.iterator (); it.hasNext (); ) {
                st = new StringTokenizer
                                ((String) it.next (), getTokenDelimiters ());
                while (st.hasMoreTokens ()) {
                    String s = st.nextToken ();
                    if (    s.startsWith (word)
                            && s.length () != word.length ()
                            && !dontAccept.contains (s)      ) {
                        return s;
            return null;
        // TEST
        public static void main (String[] args) {
            WordCompleteArea a = new WordCompleteArea ();
            JFrame window = new JFrame ();
            window.getContentPane ().add (a, BorderLayout.CENTER);
            window.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
            window.setSize (300, 300);
            window.setVisible (true);
    }

  • Disabled button fires events to event structure

    Hi all,
    I was trying to disable a Button on the frontpanel by using its enabled property while the event was executed. The ide wa not to create more events of this buttopn while its fucntion was executed. However thsi did not work.It was creating events even though it was greyed out.
    I troied two different versions:
    1) in the event case of the button (value changed) in a sequence I first dispalbned the button, execuded the code and then enabled it again
        Result: All events were generated even though the button was greyed out
    2)  in the event case of the button (value changed) in a sequence I disbaled the Button and then started a second event. The Second event executed the code and then enabled the Button egain
       Result: Even though the Button was greyed out events were generated
    3) in the event case of the button (value changed) in a sequence I first dispalbned the button, execuded the code and in the timeout event I thenenabled it again
       Result: No additional events were generated
    it seems that the enable state of the button is analysed at teh time when the event is execute din teh event case but not at the time when it was created?
    So I Tried the Time Input of the case expecting that it woudl give me a time stamp of the time when the key was pressed - but instead it gave me the time point when teh event was executed...
    Teh only othe rsolution was to set teh cursor to busy (however I dont want to see the changed cursor during the busy cycle)
    So how can I make shure that no additional events are fired during the time teh code of the Button s executed?
    Thanks for any help,
    Rainer

    to altenbach:
    The evet takes about one or two seconds - I checked the behaviour as shown in the attached examples with LV 8.5, LV 2010, TV2011, LV2012 - allways exactly the same behaviour.
    It does not make any difference weather you use switch when pressed or latched when pressed.
    It does not make any difference weathe ror not you tag "Lock front panel" for that event
    to sth:
    > If you disable a front panel control (ie the button) you cannot click on it and a value changed event will not be
    generated.
    This is my experience so far as well, but if you disable and enable the control within the same event it does not work (see attaced example 1) and 2). It only works if you do the enable in the timeout event.
    > The time stamp from the event case left hand property is the time of the event not the time of execution.
    > If you ask for the timer value inside the event case it will be the time of event case executing.
    In the attached exampel this is not the case. The time differecne between the Time input on the left and the Tick count
    placed in the event is 0 for all events generated whil the button is supposed to be disabled.
    As I wrote before, the explanation I have for this behaviour is that the events are generated by windows weather or not
    the button is disabled and they are queued to the event cue. Only when the event is handeled LabVIEW tests weather
    or not the button is disabled and ignores the event in case it is disabled. If the Disabling and enabling is done
    withim the same event the button pressed events are added to thw event queue and the button is set to enabled before the  next event (button pressed while it shoul be disabled) is handeled. When that event is handeled the button is enabled again (by the original event) and therefore the evenet is not ignored (because by the time of execution of the event the button is enabled again).
    If the button is enabled in the timeout event instead of the button change value event all event in teh queue are executed before teh timeout event. At their time of execution therefore the button is steill disabled. Only then the timeout event enables the button again.
    If the vi is set to busy (sand clock) this is activating actually a windows function/property and no events are queued to teh event queue by windwos. Therefore no button change event is added to teh queue.
    Funtciomn of the 3 attached Vis (LV 2010):
    Run the Vi, then press the Test button once - when it is greyed out click it a few more times. The test button value
    changed event has a 2 second delay. You will see the event counter increase, and you will see the time difference
    between the time property on the left of the event and the tick count vi whci is displayed in the waveform chart.  
    DisableButton 1: Disable and enable are ste in teh same event  
    DisableButton 2: The button is disabled then a second event is called to do the work and then enable teh button again
    DisableButton 3: The Button is disabled in button change value event and it is enabled again in teh timeout event.
    Attachments:
    DisableButton1-3.zip ‏29 KB

  • Published Calendar has same event multiple times

    Hi, I have created a calendar group with four sub groups on iCal. On iCal, each event shows up only one time. However, when I published the calendar and went to check on it...each event is on each date a min of 3x, up to 15x...
    what's up? how do I fix this????
    thanks
    julie

    I am Tiger 10.4.2 iCal 2.0.2 and having the same problems. I haven't found a way to prove this, but I think iCal publishing is only smart enough to deal with 1 Mac. My problem started when I turned on .Mac syncing for iCal. My .Mac account is syncing my three macs (1 home, 1 powerbook, 1 powermac at work) and guess what? My appointments show up THREE times.
    Does anyone know if Apple is looking into this unexpected side effect from .Mac syncing published calendars? If not, I will give them a call on the phone to escallate this. I am guessing that there are multiple scenerios that make .Mac get confused and essentially treat a duplicate as if it was unique.

  • How not to generate complex event multiple times? Exclude used events.

    Hi all.
    My problem is that I need to generate alerts in my application where time window is 30 minutes and it is moved on every new incoming events, so if I have event1, event2, event3 in the first time window where event2 and event3 cause an alert and I have event2, event3, event4 in the second time window then my alert will be generated twice, but I need an alert to be generated once.
    Is there any solution to filter events which have caused an alert to prevent duplicate alerts?
    Regards,
    Sergey

    I think the following query should satisfy your requirement
                    SELECT
                          T.userId as userId,
                          T.totalAmount as totalAmount,
                          T.numEvents as numEvents
                    FROM
                          helloworldInputChannel MATCH_RECOGNIZE (
                              PARTITION BY userId
                              MEASURES
                                    userId AS userId,
                                    SUM(BUY.amount) as totalAmount,
                                    COUNT(*) as numEvents
                              PATTERN ( (B|S)+? (C|T) ) WITHIN 10 minutes
                              SUBSET
                                     BUY  = (B, C)
                                     SELL = (S, T)
                              DEFINE
                                    B AS (B.operation = "BUY"),
                                    S AS (S.operation = "SELL"),
                                    C AS (C.operation = "BUY" AND (SUM(BUY.amount) = SUM(SELL.amount)) ),
                                    T AS (T.operation = "SELL" AND (SUM(BUY.amount) = SUM(SELL.amount)) )
                          ) AS T

  • ICal duplicating entered events multiple times.

    After trying to sync my calender with the calender cloud app. multiple copies of each event appeared. Where did I go wrong?

    Hi,
    More information would be useful.
    What version of iCal are you using?
    Have you synced your calendars previously?  If so have you turned that syncing method off?
    Are the events in different calendars? Do you have duplicate calendars under the "On My Mac" and "iCloud" section of iCal?
    Best wishes
    John M

  • Event Executing Itself Multiple Times

    Hello Experts,
    I have created a validation in the Sales Order Form for checking the Item Gross Profit greater than 0 .
    When user press tab from the UnitPrice column this checking is done but system is executing the event multiple time
    rather than once .It makes the checking very slow each time this check occurs event occur mulitple times.
    Please suggest what to do .
    Thanks & Regards,
    Amit

    Hi,
    Please ensure that u r given necessary conditions before doing validation
    1. pval.BeforeAction = False
    2.Pval.ColumUID = "UrId"
    3.Pval.ItemUId = "UrMatId"
    4.pVal.InnerEvent
    By
    Firos C

  • PopupMenuListener event on JComboBox fires multiple times per selection

              // webAddressBox IS OF TYPE javax.swing.JComboBox
               webAddressBox.addPopupMenuListener(new PopupMenuAdapter() {
                    /** @uses {@link com.ppowell.tools.ObjectTools.SimpleBrowser.Surf} */
                    final Surf surf = new Surf(webAddressBox.getSelectedItem().toString());
                     * Perform {@link #surf} processing
                     * @param evt {@link javax.swing.event.PopupMenuEvent}
                    public void popupMenuWillBecomeInvisible(PopupMenuEvent evt) {
                        System.out.println("you selected:");
                        surf.doURLProcessing();
    * PopupMenuAdapter.java
    * Created on February 16, 2007, 11:53 AM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package com.ppowell.tools.ObjectTools.SwingTools;
    import javax.swing.event.PopupMenuEvent;
    import javax.swing.event.PopupMenuListener;
    * Will allow for greater flexibility by implementing {@link javax.swing.event.PopupMenuListener}
    * @author Phil Powell
    * @version JDK 1.6.0
    public abstract class PopupMenuAdapter implements PopupMenuListener {
        /** Creates a new instance of PopupMenuAdapter */
        public PopupMenuAdapter() {}
         * Overrides {@link javax.swing.event.PopupMenuListener} method popupMenuCanceled
         * @param evt {@link javax.swing.event.PopupMenuEvent}
        public void popupMenuCanceled(PopupMenuEvent evt) {}
         * Overrides {@link javax.swing.event.PopupMenuListener} method popupMenuWillBecomeInvisible
         * @param evt {@link javax.swing.event.PopupMenuEvent}
        public void popupMenuWillBecomeInvisible(PopupMenuEvent evt) {}
         * Overrides {@link javax.swing.event.PopupMenuListener} method popupMenuWillBecomeVisible
         * @param evt {@link javax.swing.event.PopupMenuEvent}
        public void popupMenuWillBecomeVisible(PopupMenuEvent evt) {}
    }This code is supposed to handle a single selection from a JComboBox webAddressBox. The front-end functionality of this code blocks works just fine to the user, however, upon viewing the "behind the scenes action", I noticed that the overriden popupMenuWillBecomeInvisible() method within the anonymous inner class instance of PopupAdapter is being called 2 times upon the first time you select something from webAddressBox, 4 times the next time you select something, 8 times the next time, and so on..
    Obviously this is a tremendous waste of resources to have it call that many times exponentially - it should only call once each time you select something from webAddressBox, but I can't figure out how to get that to happen.
    What suggestions might you have to accomplish this? I already have an ActionListener that runs separately from PopupMenuAdapter that handles the user either clicking a JButton or hitting ENTER - this works just fine.
    Thanx
    Phil

    is being called 2 times upon the first time youselect something from
    webAddressBox, 4 times the next time you selectsomething, 8 times the next time, and so on..
    Then you are adding the listener to the component
    multiple times.WTO sigh.. thanx! :)

  • P35 Platinum: I have to press the power button multiple times to start

    Hello fellow MSI customers,
     as written in the subject, I have a problem with starting my PC. When I press the power button, the computer powers on, but there is no output to the screen. In fact, my LCD stays in standby mode. I can hear the fans running, so something is going on. According to the LEDs on the mainboard, it is a memory problem.
     Now I turn the computer off, using the power button (have to hold it for a few seconds). When off, I start again and everything runs as it should.
     After starting, I ran memtest86 multiple times without any errors. I ran a few games, compiled some programs, installed Vista 64bit, Linux, all without any crashes or hangups. It is just the starting that makes problems. After booting it is very stable.
     Seeing that it could be a memory problem, I brought another pair of memory, just to be sure. I couldn't reproduce the problem on that day! Any type of memory I put in (the one before, or the newly brought home) the computer always started on the press of the button. So I thought, OK, maybe they were not seated correctly. But, alas, two days later it is again only starting by pressing the power button three times.
     What I tried:
     1. Boot using only 1 piece of memory stick
     2. Boot using only 1 piece of memory, but different one
     3. Use another pair of memory   <-  worked, but on that day it also worked using my original memory
     4. Disconnected everything except graphics card, to make sure it is not a power supply issue (minimized power usage)
     5. Tried all of the above with a different processor
     6. Used another power supply
    Any other ideas?
    Here are my specs:
    MSI P35 platinum
    Core2 Q6600
    Nvidia 7900GT
    4GB V-Data DDR2 800MHz      <--- I think this is the problem, any experiences?
    Enermax Liberty 400W
    a few other things (HDDs, XFi, DVD-RW)
    By the way, how can I boot from an external DVD-RW? It doesn't show in the menu when I press F11 (boot menu).
     Thank you for any help, muro
    And just to let a bit of steam off:
    1. I had major problems with the RAID controller (not MSI fault, rather intel) - I put two disks into a RAID 0, then RAID 1 and they always failed after a few boots - member missing on both disks. I was getting angry, so I put them as normal (non RAID) disks and everything is fine since, although no RAID.
    2. Installing anything except windows with an IDE DVD-RW is very hard. It took me ages until I got Ubuntu booting (there are guides on the net, google is your friend), and much longer to get grub (boot loader) working. Long story short - if you have multiple disks, use the Linux disk as the bootable, do NOT put grub on the disk where Vista is installed.
    3. I have no idea, how to update the BIOS, if I had to. I'm using 1.1 that came on the board. I use 64bit Vista and Linux, none of which is supported to upgrade the BIOS. Any hints how to do it (if I needed to)?

    Hello,
     now today is the day I've finally received my replacement board. The good news first - it DOES work! Yepeeee!
     Now some more information:
       The jmicron controller seems to be missing - a screen with something about "Marvel" is shown before the intel raid screen. However, it is only visible for a fraction of second, so I cannot read it. I think it detects my IDE DVD-RW so I'm quite certain it's the replacement for jmicron. I won't miss it - it took me ages to install Linux with the jmicron controller.
       The problem where I had to restart the computer sometimes because it didn't even post (RAM error) is gone. It boots just fine now.
     I had an extremely long first post - about a minute, but after that it boots very fast now.
     anyway, regarding some questions around here - the manual states MSI recommends using an 350W power supply. My 400W is more than enough. Please note - it is an Enermax, not one bundled with a cheap case. My cheap RAM sticks also work very well now. I did try them on different boards before, so now I know I just had a faulty board.
     In the end, I can only say this: This is my 3rd board already and it's the first one that works well. As the hardware changed, I presume there were major issues with this board that lead them to make a new revision. What is strange, though, is that the revision is still 1.1, as were my previous two. I pity everybody who had the same problems as I did, but I can now say that I'm very happy about the board now.
     Cheers, muro

  • How to restrict user marking same events in multiple times.

    Hi,
    In my online exam system, I am displaying the questions and related answer in jsp page. Once user fill all this questions, the result of these stored in final table containing column questonNo, userid, answer, testname.
    Now in my application if any user goes back to the question displaying page after submitting same questions, he can change the answer selected in first attempt and submitting again the test, the result are stored in final table. I.e. for same question no. user is now able to answer in two times. I want to restrict user for answering test in second times.
    How can I achieve this?
    Any suggestion is highly appreciated?
    Thanks and Regards
    Harshal

    Hi Hari,
    with you suggested logic can i restrict user marking one question in multiple times,
    My target is once user submit any questions teh control will be transferred to the next page.Now he/she could not able to submit the same questions with another answer or the same answer also which is possible in my application by going back to these page using back button .so that i can get only one record for particular questions in table final.
    Thanks and Regards
    Harshal
    Edited by: HARSHAL_GURAV on Aug 20, 2008 12:15 AM

  • Photoshop CC 2014 Extension - CEP Event callback is triggered multiple times per single event

    Trying to make my extensions listen for bunch of events and it's turning out to be a real pain in the ***.
    I'm hoping there's someone here who has a bit more experience playing around with these.
    I used the example code from here ( Page 43 ): http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/creativesuite/pdfs/CC14_Extension_S DK.pdf
    I've modified the code just a little. I removed some unnecessary things from it. I also added a counter, to try to visualize the issue.
    Every time I pasted the code here, the global variable seemed to duplicate. So, eeeeh...  the example code can be found here.
    The problem is:
    I close one document to trigger the event, but for some reason the callback seems to run multiple times.
    Even better, it doesn't seem to be super consistent about it. Sometimes it repeats only couple of times and sometimes it repeats 160 times.
    It seems like every time the extension panel is reopened, it comes up with a new number.
    Currently, if I close a document, it seems to trigger the callback 15 times
    Since this is screenshot, you'll have to take my word for it. I only closed a single document and the code ran 15 times.
    Am I doing something wrong by any chance?
    edit:
    I believe I just found out the reason and a way to recreate the issue.
    I've occasionally tested the extension by closing and opening the panel, which seems to have caused the issue.
    It looks like every time I close and then open the panel, it... adds one more run time to the stack.
    - Refreshing the panel from chrome doesn't seem to affect it.
    When I restart photoshop, it resets. So after the very first opening of the panel, the event triggers the callback only once.
    I forgot to mention that the host application events work just fine without these issues.
    In fact, I tried to use documentAfterActivate before, but as far as I could find, there is no way to kind of filter out specific events within host application events.
    For instance, I can't specify something different to happen when a new document is opened.
    As very much a side note:
    documentAfterActivate has its own side effect due to the way photoshop works.
    It is triggered when you:
    Create a new document
    Open a new document
    Switch to an open document
    It's the "Switch to an open document" part that makes this event listener also trigger when you close a document.
    Because when you close a document, photoshop switches back to the previous document and that in turn triggers the event listener when it shouldn't, I suppose.
    Of course it doesn't trigger the event when you close the last document as there is no document to switch to at that point.
    ...but this is beyond the scope of the original question.

    I was so tired last night that when I found out the cause of it, I never even thought about unregistering...
    I decided to unregister it when the panel is opened instead.
    This does indeed get rid of the issue.
    Thanks, cbuliarca.
    (function () {
      var csInterface = new CSInterface();
      function init() {
           themeManager.init();
           function registerPhotoshopEvent(in_eventId, register) {
                // Added the next line
                var register = register === "clear" ? "UnRegisterEvent" : "RegisterEvent";
                // Modified the next line
                var event = new CSEvent("com.adobe.Photoshop" + register, "APPLICATION");
                event.extensionId = csInterface.getExtensionID();
                event.appId = csInterface.getApplicationID();
                event.data = in_eventId
                csInterface.dispatchEvent(event);
           var number = 0;
           csInterface.addEventListener("PhotoshopCallback" , function(event) {
                number = number + 1;
                console.log( number );
           var closeEventid = "1131180832"
           // Added the next line
           registerPhotoshopEvent(closeEventid, "clear");
           registerPhotoshopEvent(closeEventid);
      init();

  • How do you fire a button click event on apex page from fancybox iframe that was created by page

    I am trying to fire off the button click event from fancybox iframe. The apex page has a button that launches a fancybox iframe which is loaded with an APEX form. On close of that fancy box, I am trying to fire a click event on the parent page which will refresh a div with html that is created with plsql. The button on the page works as expected when clicked from the page. It will show a debug alert message to prove it was called and then load the div with the correct data. I am unable to fire off this button click from the fancybox iframe when it closes.
    A couple of points:
    I using Plug-in: Execute PL/SQL Code and Return Content ("PLUGIN_MULEDEV.SERVER_REGION_REFRESH") to place the create fancybox statement. It is used to populate a div using plsql.
    The name of the button on the main page is P2020_REFRESH_SECTION_BUILDER_BTN.
    The click dynamic action on the button is calling the plugin to replace the html in the div.
    The data in the form in the fancybox is being saved to the database. On close of the fancybox box I want to refresh the div so the new record is included in the div html.
    Can anyone help. Here is the fancybox code:
      function customProcessOnReadyState4(){
        for (var i=0;i<11;i++){
          $( "#tabs"+i ).tabs();
          $("#createNewExerciseLink"+i).fancybox({
              ''width''         : ''60%'',
              ''height''        : ''70%'',
              ''autoScale''     : true,
              ''transitionIn''  : 200,
              ''transitionOut'' : 200,
              ''type''          : ''iframe'',
              ''onClosed''         : function() {
                                         window.parent.$(''#P2020_REFRESH_SECTION_BUILDER_BTN'').click();
    Here are the dynamic actions assigned to the button:
    5 - Execute JavaScript Code
    alert("Starting refresh");
    10 - Execute PL/SQL Code and Return Content [Plug-in]
    begin
      SCTUI.create_sct_tabs2(:P2020_CREATE_SECTION_LOV, '1');
    end;

    user setActionListener...
    <af:setActionListener from="#{bindings.XXX.inputValue" to="#{backingbean.variable}"
                  <af:inputText value="#{bindings.Email.inputValue}"
                                label="#{bindings.Email.hints.label}"
                                binding="#{backingBeanScope.backing_ShuttlePage.it2}"
                                id="it2">
                    <f:validator binding="#{bindings.Email.validator}"/>
                  </af:inputText>
                  <af:commandButton text="commandButton 2"
                                    binding="#{backingBeanScope.backing_ShuttlePage.cb2}"
                                    id="cb2" action="passing">
                    <af:setActionListener from="#{bindings.Email.inputValue}"
                                          to="#{processScope.detail}"/>
                  </af:commandButton>next jsf page:
                <af:outputText value="#{processScope.detail}"
                               binding="#{backingBeanScope.backing_ProcessScope.ot1}"
                               id="ot1"/>setPropertyListener also should work
    <af:setPropertyListener from="#{bindings.Email.inputValue}" to="#{processScope.detail}" type="action"/>

  • Run a subvi by pressing a button multiple times

    Hi
    I wanted to run a subvi each time the user pushes a button.
    So the subvi might be called multiple times & different instances of the subvi run simultanously with their front panels open.
    To do this I made a .vit & call it by refrence wehenever a button is pressed but it doesn't work.For the first time it opens but it seems as if the .vit doesn't return after it is called. while if I use the same method & call the .vit by reference 2 times in parallel both of the front panels open without problem.
    How can I solve this problem(the main & the subvi are attached LV 7.0).
    Thanks for your attention in advance
    Attachments:
    main.vi ‏35 KB
    subvi.vit ‏43 KB

    Hi,
    You have to run it dynamically, with the Run VI method. This method can
    optionally wait or not. Before running the VI, you have to set the controls
    with the method Set Control Value (or Set Control Value [Variant]).
    There are several ways to read back values from dynamically started VI's.
    One is to use a buffer (lv2 global). Another is to use the Get Control Value
    method.
    It's complicated, but if you put all this code in a sub vi, you'll end up
    with a nice main...
    Regards,
    Wiebe.
    "smal" wrote in message
    news:[email protected]..
    > Hi
    > I wanted to run a subvi each time the user pushes a button.
    > So the subvi might be called multiple times & different instances of
    > the subvi run simultanously with t
    heir front panels open.
    > To do this I made a .vit & call it by refrence wehenever a button is
    > pressed but it doesn't work.For the first time it opens but it seems
    > as if the .vit doesn't return after it is called. while if I use the
    > same method & call the .vit by reference 2 times in parallel both of
    > the front panels open without problem.
    >
    > How can I solve this problem(the main & the subvi are attached LV
    > 7.0).
    >
    > Thanks for your attention in advance

Maybe you are looking for