Time duration of events

Hello,
I am accessing an Oracle 10.2.0.1.0 Database
I have the following tables
CREATE TABLE BT_MAPPING
( "TAG_ID" NUMBER(6,0) NOT NULL ENABLE,
"TAG_NAME" VARCHAR2(30 BYTE) NOT NULL ENABLE,
"TAG_DESCRIP" VARCHAR2(100 BYTE),
"TAG_SRC1" VARCHAR2(30 BYTE),
"TAG_SRC2" VARCHAR2(30 BYTE),
"TAG_GRP_ID" NUMBER(4,0),
"TAG_TYPE" VARCHAR2(2 BYTE),
"TAG_DB" NUMBER(12,6),
"TAG_ZERO" NUMBER(12,6),
"TAG_SPAN" NUMBER(12,6),
"TAG_EU" VARCHAR2(10 BYTE),
"TAG_MIN" CHAR(1 BYTE),
"TAG_MAX" CHAR(1 BYTE),
"TAG_AVG" CHAR(1 BYTE),
"TAG_DCM" NUMBER(4,0),
"TAG_TYPE_ID" NUMBER(4,0),
"TAG_TOTAL" CHAR(1 BYTE)
and
CREATE TABLE MT_ANALOGUE
( "TAG_ID" NUMBER(6,0) NOT NULL ENABLE,
"TAG_DATE" DATE NOT NULL ENABLE,
"TAG_VALUE" NUMBER(12,6),
"TAG_QUALITY" NUMBER(6,0),
"TAG_ADJUST_FLAG" CHAR(1 BYTE)
I need to run a query that would return the tag_id, tag_name, tag_descrip from the bt_mapping table and the tag_date, tag_value from the analogue table when the tag_value is over .10 for the tags that are named BR_FL00_NI to BR_FL14_NI. I have the following which seems to work.
SELECT
BT.TAG_ID "TAG_ID", BT.TAG_NAME "TAG_NAME", BT.TAG_DESCRIP "TAG_DESCRIP", MT.TAG_DATE "TAG_DATE", MT.TAG_VALUE "TAG_VALUE"
FROM
BT_MAPPING BT, MT_ANALOGUE MT
WHERE
MT.TAG_ID=BT.TAG_ID
AND
MT.TAG_VALUE > 0.10
AND
(BT.TAG_NAME like 'BR_FL0%_NI'
OR BT.TAG_NAME like 'BR_FL1%_NI'
OR bt.tag_name = 'BR_FWL00_NI')
ORDER BY BT.TAG_NAME, MT.TAG_DATE;
this is a sample of what data the query returns
TAG_ID                 TAG_NAME                             TAG_DESCRIP                         TAG_DATE                  TAG_VALUE
40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:01:51          0.112088
40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:01:52          0.10696
40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:01:53          0.101343
40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:08:56          0.108181
40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:08:57          0.144567
40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:08:58          0.160684
40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:08:59          0.195116
40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:09:00          0.179976
40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:09:01          0.178266
40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:09:02          0.176557
40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:09:03          0.175336
40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:09:04          0.174359
40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:09:05          0.174359
40076                    BR_FL01_NI                            Filter #1 Turbidity                       2009-02-05:09:06          0.169475But I am wondering how to query the times that the value is > .10 with a time duration >= 15min and to have the time the tag_value was > 0.10 and the last time the value was > 0.10 with the duration in a new column?
Something like this
TAG_ID     TAG_NAME      TAG_DESCRIP        TAG_START_DATE_OVER      TAG_START_VALUE    TAG_END_DATE_OVER      TAG_END_VALUE      DURATION
40076       BR_FL01_NI      Filter #1 Turbidity     2009-02-05:08:56                     0.108181                      2009-02-05:09:06                 0.169475                     20minI have searched the forums, but didn't find anything that applied. It's possible that I was searching for the wrong phrase. If anyone can provide some help, it would be appreciated.
Cheers
Edited by: scada on Feb 24, 2009 10:21 AM

I will look into analytic functions and your sample code to see if I can get the results. I did forget the sample data, again. I have now included some sample data. so what i need to query is when tag_value is > 0.10 for greater than 15 minutes for tags with tag name like 'BR_FL0%_NI' OR like 'BR_FL1%_NI' OR tag_name = 'BR_FWL00_NI'. I also would need a column in that query to be the time duration that the tag_value was > 0.10.
thanks again for all the help
bt_mapping
CREATE TABLE BT_MAPPING
( "TAG_ID" NUMBER(6,0) NOT NULL ENABLE,
"TAG_NAME" VARCHAR2(30 BYTE) NOT NULL ENABLE,
"TAG_DESCRIP" VARCHAR2(100 BYTE),
"TAG_SRC1" VARCHAR2(30 BYTE),
"TAG_SRC2" VARCHAR2(30 BYTE),
"TAG_GRP_ID" NUMBER(4,0),
"TAG_TYPE" VARCHAR2(2 BYTE),
"TAG_DB" NUMBER(12,6),
"TAG_ZERO" NUMBER(12,6),
"TAG_SPAN" NUMBER(12,6),
"TAG_EU" VARCHAR2(10 BYTE),
"TAG_MIN" CHAR(1 BYTE),
"TAG_MAX" CHAR(1 BYTE),
"TAG_AVG" CHAR(1 BYTE),
"TAG_DCM" NUMBER(4,0),
"TAG_TYPE_ID" NUMBER(4,0)
Insert into bt_mapping
values (40652,'BR_FL10_NI','Filter #10 Turbidity','BRIPSS03','BRIPSS04',0,'AI',60,0,0,'0','1','1','1',3,2);MT_ANALOGUE TABLE
CREATE TABLE MT_ANALOGUE
( "TAG_ID" NUMBER(6,0) NOT NULL ENABLE,
"TAG_DATE" DATE NOT NULL ENABLE,
"TAG_VALUE" NUMBER(12,6),
"TAG_QUALITY" NUMBER(6,0),
"TAG_ADJUST_FLAG" CHAR(1 BYTE)
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:00','dd-mon-yyyy hh24:mi'),'.018816','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:01','dd-mon-yyyy hh24:mi'),'.028816','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:02','dd-mon-yyyy hh24:mi'),'.029548','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:03','dd-mon-yyyy hh24:mi'),'.029304','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:04','dd-mon-yyyy hh24:mi'),'.028816','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:05','dd-mon-yyyy hh24:mi'),'.028571','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:06','dd-mon-yyyy hh24:mi'),'.029548','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:07','dd-mon-yyyy hh24:mi'),'.029304','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:08','dd-mon-yyyy hh24:mi'),'.028816','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:09','dd-mon-yyyy hh24:mi'),'.028816','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:10','dd-mon-yyyy hh24:mi'),'.030037','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:11','dd-mon-yyyy hh24:mi'),'.028327','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:12','dd-mon-yyyy hh24:mi'),'.029792','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:13','dd-mon-yyyy hh24:mi'),'.028327','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:14','dd-mon-yyyy hh24:mi'),'.029792','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:15','dd-mon-yyyy hh24:mi'),'.029304','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:16','dd-mon-yyyy hh24:mi'),'.028816','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:17','dd-mon-yyyy hh24:mi'),'.028816','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:18','dd-mon-yyyy hh24:mi'),'.029548','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:19','dd-mon-yyyy hh24:mi'),'.028816','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:20','dd-mon-yyyy hh24:mi'),'.029792','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:21','dd-mon-yyyy hh24:mi'),'.029548','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:22','dd-mon-yyyy hh24:mi'),'.029548','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:23','dd-mon-yyyy hh24:mi'),'.029304','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:24','dd-mon-yyyy hh24:mi'),'.028816','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:25','dd-mon-yyyy hh24:mi'),'.028816','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:26','dd-mon-yyyy hh24:mi'),'.029304','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:27','dd-mon-yyyy hh24:mi'),'.028816','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:28','dd-mon-yyyy hh24:mi'),'.028571','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:29','dd-mon-yyyy hh24:mi'),'.029304','0','0');
INSERT INTO MT_ANALOGUE VALUES
('40652',to_date('25-feb-2009 10:30','dd-mon-yyyy hh24:mi'),'.029304','0','0');
INSERT INTO MT_ANALOGUE VALUES
'40652',to_date('25-feb-2009 10:31','dd-mon-yyyy hh24:mi'),'.017304','0','0');Edited by: scada on Feb 25, 2009 12:08 PM
Edited by: scada on Feb 25, 2009 1:21 PM
Edited by: scada on Feb 26, 2009 10:51 AM
Edited by: scada on Feb 26, 2009 10:58 AM

Similar Messages

  • Seeing time/duration of Events

    Hi there - I've imported a 30 minute video file I want to grab highlights from in iMovie - the problem is that when scrolling through the event, I can't find anywhere that shows how far into the clip I am - e.g., if I want to find the 5 minute mark of the event, I have to guess. Is there any way to see a timer of the event?

    Hi there - I've imported a 30 minute video file I want to grab highlights from in iMovie - the problem is that when scrolling through the event, I can't find anywhere that shows how far into the clip I am - e.g., if I want to find the 5 minute mark of the event, I have to guess. Is there any way to see a timer of the event?

  • Measuring the time duration of a Java webdynpro event

    Hi everybody,
    I would like to know if there are a standart wy of measuring the time duration in seconds of a Java webdynpro event.
    We are developing a Java Webdynpro application and we need to improve the performance of our business logic associated to the events which are thrown by our java webdynpro views. We want to do this by a stardart way, and if it possible without coding any line. So, is there any kind of monitorization of this information? or is there a tool to do that?
    We would need this information:
    - Name of View
    - Name of event
    - Start time
    - End time  
    Thanks for all.

    Hi Antonio Sanz ,
    Did you do logging for your application?
    If so, you can go and get the information from the logs.(This includes the time in milli seconds)
    (Assuming that you have written the logs at starting and ending of each method.)
    If not, I think it is not possible with out code change.
    If you want to do the code change you can do like this:
    method start(){
    long startTime = System.currentTimeMillis();
    long endTime = System.currentTimeMillis();
    long timeTaken = endTime - startTime; // You can print the "timeTaken" on the screen or you can log the information.
    Regards,
    Jaya.

  • How to display time duration (NOT dates) with an input mask in a JTable?

    Background: I am trying to display in a JTable, in two columns, the start position and time duration of an audio clip.
    They are stored as type float internally eg. startPosition = 72.7 seconds.
    However I wish to display on screen in the table in HH:mm:ss:S format. eg. 00:01:12:7. The user can edit the cell and input values to update the internal member fields.
    Problem: I am finding it very difficult to implement this - what with the interactions of MaskFormatter, DefaultCellEditor etc.
    Also using SimpleDateFormat and DateFormatter does not work as they insist on displaying the day, month, year also in the table cell.
    Taking the Swing Tutorial TableFTFEditDemo example as a template,
    (http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/index.html#TableFTFEditDemo)
    does anyone know how to do this?
    I can post my (buggy) modifications to the example code - if it would help.
    Appreciate any help.
    thanks,
    Anil

    Here are my modifications to the TableFTFEditDemo example. If you run it, you get an exception
    like java.lang.NumberFormatException: For input string: "18:00:03.500"
    The two modified classes are taken from the Tutorial and are listed below:
    =================
    * IntegerEditor is a 1.4 class used by TableFTFEditDemo.java.
    import javax.swing.AbstractAction;
    import javax.swing.BorderFactory;
    import javax.swing.DefaultCellEditor;
    import javax.swing.JFormattedTextField;
    import javax.swing.JOptionPane;
    import javax.swing.JTable;
    import javax.swing.JTextField;
    import javax.swing.KeyStroke;
    import javax.swing.SwingUtilities;
    import java.awt.event.ActionEvent;
    import java.awt.event.KeyEvent;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Toolkit;
    import java.text.DateFormat;
    import java.text.NumberFormat;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.Date;
    import javax.swing.text.DateFormatter;
    import javax.swing.text.DefaultFormatterFactory;
    import javax.swing.text.MaskFormatter;
    import javax.swing.text.NumberFormatter;
    class TimeRenderer {
         float seconds;
         TimeRenderer(String str) {
              int hSec = Integer.parseInt(str.substring(0,2)) * 60 * 60;
              int mSec = Integer.parseInt(str.substring(2,4)) * 60;
              int sSec = Integer.parseInt(str.substring(4,6));
              float tSec = Integer.parseInt(str.substring(6,7))/10.0F;
              seconds = hSec + mSec + sSec + tSec;
    * Implements a cell editor that uses a formatted text field to edit Integer
    * values.
    public class IntegerEditor extends DefaultCellEditor {
         JFormattedTextField ftf;
         static Date zeroTime = new Date(0L);
         private boolean DEBUG = true;
         SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss.S");
         MaskFormatter maskFo = new MaskFormatter("##:##:##.#");
         protected MaskFormatter createFormatter(String s) {
              MaskFormatter formatter = null;
              try {
                   formatter = new MaskFormatter(s);
              } catch (java.text.ParseException exc) {
                   System.err.println("formatter is bad: " + exc.getMessage());
                   System.exit(-1);
              return formatter;
         public IntegerEditor(int min, int max) throws ParseException {
              super(new JFormattedTextField(new MaskFormatter("##:##:##.#")));
              ftf = (JFormattedTextField) getComponent();
              // Set up the editor for the cells.
              ftf.setFormatterFactory(new DefaultFormatterFactory(new DateFormatter(sdf)));
              ftf.setFocusLostBehavior(JFormattedTextField.PERSIST);
              // React when the user presses Enter while the editor is
              // active. (Tab is handled as specified by
              // JFormattedTextField's focusLostBehavior property.)
              ftf.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "check");
              ftf.getActionMap().put("check", new AbstractAction() {
                   public void actionPerformed(ActionEvent e) {
                        if (!ftf.isEditValid()) { // The text is invalid.
                             ftf.setBorder(BorderFactory.createLineBorder(Color.RED));
                             ftf.setBackground(Color.PINK);
                             ftf.postActionEvent(); // inform the editor
                        } else
                             try { // The text is valid,
                                  ftf.commitEdit(); // so use it.
                                  ftf.postActionEvent(); // stop editing
                             } catch (java.text.ParseException exc) {
         // Override to invoke setValue on the formatted text field.
         public Component getTableCellEditorComponent(JTable table, Object value,
                   boolean isSelected, int row, int column) {
              JFormattedTextField ftf = (JFormattedTextField) super
                        .getTableCellEditorComponent(table, value, isSelected, row, column);
              System.out.println("value:" + value);
    //          long milliseconds =(long) (Float.parseFloat(value.toString()) * 1000);
              long milliseconds =(long) (((Float) value).floatValue() * 1000);
              Date dt = new Date(milliseconds);
              ftf.setValue(dt);
              return ftf;
         // Override to ensure that the value remains an Integer.
         public Object getCellEditorValue() {
              JFormattedTextField ftf = (JFormattedTextField) getComponent();
              Object o = ftf.getValue();
              try {               
                   Calendar cal = Calendar.getInstance();
                   cal.setTime((Date)o);
                   float seconds = cal.getTimeInMillis()/1000.0F;
                   return sdf.format(o);
                   //return new Float(seconds);
              } catch (Exception exc) {
                   System.err.println("getCellEditorValue: can't parse o: " + o);
                   exc.printStackTrace();
                   return null;
         // Override to check whether the edit is valid,
         // setting the value if it is and complaining if
         // it isn't. If it's OK for the editor to go
         // away, we need to invoke the superclass's version
         // of this method so that everything gets cleaned up.
         public boolean stopCellEditing() {
              JFormattedTextField ftf = (JFormattedTextField) getComponent();
              if (ftf.isEditValid()) {
                   try {
                        ftf.commitEdit();
                   } catch (java.text.ParseException exc) {
              } else { // text is invalid
                   ftf.setBorder(BorderFactory.createLineBorder(Color.RED));
                   ftf.setBackground(Color.PINK);
                   return false; // don't let the editor go away
              return super.stopCellEditing();
    //=====================================================
    * TableFTFEditDemo.java is a 1.4 application that requires one other file:
    *   IntegerEditor.java
    import javax.swing.JFrame;
    import javax.swing.JDialog;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.AbstractTableModel;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.text.ParseException;
    * This is exactly like TableDemo, except that it uses a
    * custom cell editor to validate integer input.
    public class TableFTFEditDemo extends JPanel {
        private boolean DEBUG = false;
        public TableFTFEditDemo() throws ParseException {
            super(new GridLayout(1,0));
            JTable table = new JTable(new MyTableModel());
            table.setPreferredScrollableViewportSize(new Dimension(500, 70));
            //Create the scroll pane and add the table to it.
            JScrollPane scrollPane = new JScrollPane(table);
            //Set up stricter input validation for the integer column.
         //   table.setDefaultEditor(Float.class,
           //                        new IntegerEditor(0, 100));
         //If we didn't want this editor to be used for other
         //Integer columns, we'd do this:
         table.getColumnModel().getColumn(3).setCellEditor(
              new IntegerEditor(0, 100));
            //Add the scroll pane to this panel.
            add(scrollPane);
        class MyTableModel extends AbstractTableModel {
            private String[] columnNames = {"First Name",
                                            "Last Name",
                                            "Sport",
                                            "# of Years",
                                            "Vegetarian"};
            private Object[][] data = {
                {"Mary", "Campione",
                 "Snowboarding", new Float(5.7), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new Float(3.5), new Boolean(true)},
                {"Kathy", "Walrath",
                 "Knitting", new Float(2.9), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Speed reading", new Float(20.8), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new Float(10.5), new Boolean(false)}
            public int getColumnCount() {
                return columnNames.length;
            public int getRowCount() {
                return data.length;
            public String getColumnName(int col) {
                return columnNames[col];
            public Object getValueAt(int row, int col) {
                return data[row][col];
             * JTable uses this method to determine the default renderer/
             * editor for each cell.  If we didn't implement this method,
             * then the last column would contain text ("true"/"false"),
             * rather than a check box.
            public Class getColumnClass(int c) {
                 Object obj = getValueAt(0, c);
                 System.out.println("getColumnClass.obj:" + obj);
                return obj.getClass();
            public boolean isCellEditable(int row, int col) {
                //Note that the data/cell address is constant,
                //no matter where the cell appears onscreen.
                if (col < 2) {
                    return false;
                } else {
                    return true;
            public void setValueAt(Object value, int row, int col) {
                if (DEBUG) {
                    System.out.println("Setting value at " + row + "," + col
                                       + " to " + value
                                       + " (an instance of "
                                       + value.getClass() + ")");
                data[row][col] = value;
                fireTableCellUpdated(row, col);
                if (DEBUG) {
                    System.out.println("New value of data:");
                    printDebugData();
            private void printDebugData() {
                int numRows = getRowCount();
                int numCols = getColumnCount();
                for (int i=0; i < numRows; i++) {
                    System.out.print("    row " + i + ":");
                    for (int j=0; j < numCols; j++) {
                        System.out.print("  " + data[i][j]);
                    System.out.println();
                System.out.println("--------------------------");
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
         * @throws ParseException
        private static void createAndShowGUI() throws ParseException {
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("TableFTFEditDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            TableFTFEditDemo newContentPane = new TableFTFEditDemo();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    try {
                             createAndShowGUI();
                        } catch (ParseException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
    }

  • Record time duration for fax in vxml

    I am going to get the time duration used for fax sending in vxml:
    <transfer name="mycall" destexpr="'fax://' + phone_num" bridge="false" connecttimeout="120s" maxtime="180s" cisco-longpound="true" cisco-mailtoaddress="'xxxx'" >
    <catch event="telephone.disconnect.transfer">
    <assign name="mydur" expr="mycall$.duration"/>
    <goto next="#timeCount"/>
    </catch>
    </transfer>
    <var name="startTime" expr="new Date();"/>
    <var name="endTime"/>
    <form id="timeCount">
    <block>
    <assign name="document.startTime" expr="startTime.getTime();"/>
    <assign name="document.startTime" expr="Number(startTime);"/>
    <assign name="document.endTime" expr="new Date();"/>
    <assign name="document.endTime" expr="endTime.getTime();"/>
    <assign name="document.endTime" expr="Number(endTime);"/>
    <assign name="mydur" expr="document.endTime - document.startTime;"/>
    </block>
    </form>
    But mycall$.duration is 0 after transferring fax.
    And even if I use codes to count time duration, the duration, mydur, is about the same regardless of the number of pages sent.
    Is it possible to use vxml to record time duration of fax?
    Thank you!

    Paste the following Config:
    sh ver
    sh run
    debug of one call demonstrating the problem :
    debug voip ivr all
    debug vxml all

  • How can I trig a timer to start to run for specific time duration?!

    Hi,
      I have a SubVI which gives me a string line, and I need that after end of this line ( which I gives me true value),  trig a timer to start to run to make the loop to wait for specific time duration. here I attached my VI, I hope it is clear.
    anybody can help me ?!
    Attachments:
    Sample Measurement.vi ‏45 KB

    worldviol wrote:
    Hi,
      I have a SubVI which gives me a string line, and I need that after end of this line ( which I gives me true value),  trig a timer to start to run to make the loop to wait for specific time duration. here I attached my VI, I hope it is clear.
    anybody can help me ?!
    can you be more specific?.....is the string coming from your "serial1.vi"? and what string specifically are you looking for to make this event happen?
    start by looking at the "comparison" pallet for your T/F logic of what specific string you want, wired to your case statement and a timer....

  • How to calculate the time duration on a datetime column?

    Hi guys,
    I've done some search on this forum and everywhere else but I can't seem to get this right, at the beggining it sounded like something very simple to accomplish, for the instance with Excel but I'm struggling to get it to work with Crystal Reports on Microsoft Visual Studio 2008.
    I have a datetime column (SQL Server 2000) that I wanted to calculate the the time duration on the report group footer, unfortunatelly the built-in SUM function cannot be applied and I've tried several formulas that I've found on the internet without any luck. I'm using a datetime column to store only the time because I'm stuck with SQL Server 2000 which doesn't have a time data type.
    Would you guys know how to do it by any chance?
    Some sample code I've tried: http://www.minisolve.com/TipsAddUpTime.htm
    Thanks a lot,
    Paul
    Edited by: Paul Doe on Dec 12, 2009 5:41 PM
    Some sample data:
    EMPLOYEE     WORK HOURS
    =========     =================
    JOHN DOE      1900-01-01 01:00:05
    JOHN DOE      1900-01-01 00:20:00
    JOHN DOE      1900-01-01 01:30:15
    =========     =================
    HOURS WORKED: 02:50:20
    Edited by: Paul Doe on Dec 12, 2009 5:42 PM
    Edited by: Paul Doe on Dec 12, 2009 5:45 PM

    Guess what, by further testing the code on the website mentioned above I got it working.
    Pus, I needed to change the grouping on the code, so I had to come up with a way to update the formulas based on the groupping field.
    Considering "call_date" is the field that you are groupping by on the designer use the following code to update the formula:
    CrystalReportObj = new ReportDocument();
    CrystalReportObj.Load("C:\\reportfile.rpt");
    FieldDefinition FieldDef;
    //Get formula
    FormulaFieldDefinition FormulaDef1;
    FormulaDef1 = CrystalReportObj.DataDefinition.FormulaFields["SubHours"];
    //Get formula
    FormulaFieldDefinition FormulaDef2;
    FormulaDef2 = CrystalReportObj.DataDefinition.FormulaFields["subMinSec"];
    //Update the formula to work with the new grouping field,
    //this must be called first else will throw an exception
    FormulaDef1.Text = FormulaDef1.Text.Replace("call_date", "call_extension");
    FormulaDef2.Text = FormulaDef2.Text.Replace("call_date", "call_extension");
    //Get the new field we are grouping by
    FieldDef = CrystalReportObj.Database.Tables[0].Fields["call_extension"];
    //Replace current grouping field with the new one,
    //considering there only one group in the report, index 0
    CrystalReportObj.DataDefinition.Groups[0].ConditionField = FieldDef;
    Have fun.
    Edited by: Paul Doe on Dec 12, 2009 8:43 PM
    Edited by: Paul Doe on Dec 12, 2009 8:53 PM

  • In setting up my ICal calendar I have specific times (as new events) that I want to be included in the print out.  This doesn't happen.

    In setting up my ICAL calendar I have specific times (as new events) for each day.  When it prints out the time does not show up (rather its a bar).  I would like the time for each appointment to print out. How do I do this?

    These are two possible approaches that will normally work to move an existing library to a new computer.
    Method 1
    Backup the library with this User Tip.
    Deauthorize the old computer if you no longer want to access protected content on it.
    Restore the backup to your new computer using the same tool used to back it up.
    Keep your backup up-to-date in future.
    Method 2
    Connect the two computers to the same network. Share your <User's Music> folder from the old computer and copy the entire iTunes library folder into the <User's Music> folder on the new one. Again, deauthorize the old computer if no longer required.
    Both methods should give the new computer a working clone of the library that was on the old one. As far as iTunes is concerned this is still the "home" library for your devices so you shouldn't have any issues with iTunes wanting to erase and reload.
    I'd recommend method 1 since it establishes an ongoing backup for your library.
    Note if you have failed to move contacts and calendar items across you should create one dummy entry of each in your new profile and iTunes should  merge the existing data from the device.
    If your media folder has been split out from the main iTunes folder you may need to do some preparatory work to make it easier to move. See make a split library portable.
    Should you be in the unfortunate position where you are no longer able to access your original library or a backup then then see Recover your iTunes library from your iPod or iOS device for advice on how to set up your devices with a new library with the maximum preservation of data.
    tt2

  • Can I hide the set time in the event boxes in Week View?

    Can I hide the set time in the event boxes in the Week View?

    David
    No way around this that I can find. That toolbar pops up if you pause the show.
    The nearest I could figure is to use the settings button for a long slide - 'Play each slide for 120 seconds' then tapping the arrows will move the slides along without showing the toolbar. And the 120 second slide is almost as good as a pause.
    iPhoto menu -> Provide iPhoto Feedback
    Regards
    TD

  • Error 1046: Type was not found or was not a compile-time constant: Component Event.

    Hi Everyone..
    I am getting an Error 1046: Type was not found or was not a compile-time constant: Component Event.
    The ComponentEvent class has been imported,and also the event handling code is there. I am not sure what else is wrong, hope somebody can advise me. Thanks. The code is below, the point where the error occurs as indicated by the compiler has been highlighted.
    package 
    import flash.display.Sprite;
    import flash.media.Camera;
    import flash.media.Microphone;
    import flash.media.Video;
    import fl.controls.TextArea;
    import fl.controls.Button;
    import fl.controls.TextInput;
    import flash.events.SyncEvent;
    import flash.events.MouseEvent;
    import flash.events.FocusEvent;
    import flash.net.SharedObject;
    import flash.net.NetConnection;
    import flash.net.NetStream;
    import flash.events.NetStatusEvent;
    import flash.events.FocusEvent;
    import flash.events.ComponentEvent;
    public class VideoChat extends Sprite
      private var button:Button;
      private var text_so:SharedObject; 
      private var textArea:TextArea;
      private var textInput:TextInput;
      private var chatName:TextInput; 
      private var nc:NetConnection;
      private var nsOut:NetStream;
      private var nsIn:NetStream;
      private var rtmpNow:String;
      private var msg:Boolean; 
      private var cam:Camera;
      private var mic:Microphone;
      private var vid:Video;
      public function VideoChat ()
       //Set up UI
       textArea = new TextArea();
       textArea.setSize(500,280);
       textArea.move(20,54);
       addChild(textArea);
       textInput = new TextInput();
       textInput.setSize(500,24);
       textInput.move(20,340);
       textInput.addEventListener(ComponentEvent.ENTER,checkKey);
       addChild(textInput);
       button = new Button();
       button.width=50;
       button.label="Send";
       button.move(20,370);
       button.addEventListener(MouseEvent.CLICK, sendMsg);
       addChild(button);
       chatName = new TextInput;
       chatName.setSize (100,24);
       chatName.move (80,370);
       chatName.text="<Enter Name>";
       chatName.addEventListener (FocusEvent.FOCUS_IN, cleanName);
       addChild(chatName); 
       //Connect
       rtmpNow="rtmp:/VideoChat ";  
       nc=new NetConnection;
       nc.connect (rtmpNow);
       nc.addEventListener(NetStatusEvent.NET_STATUS,doSO);
       cam = Camera.getCamera();
       mic=Microphone.getMicrophone();
       //Camera Settings
       cam.setKeyFrameInterval(15);
       cam.setMode (240, 180, 15, false);
       cam.setMotionLevel(35,3000);
       cam.setQuality(40000 / 8,0);
       //Microphone Settings
       mic.gain = 85;
       mic.rate=11;
       mic.setSilenceLevel (25,1000);
       mic.setUseEchoSuppression (true);
       //Video Setup
       vid=new Video(cam.width, cam.height);
       addChild (vid);
       vid.x=10, vid.y=20;  
       //Attach local video and camera
       vid.attachCamera(cam);  
      private function doSO(e:NetStatusEvent):void
       good=e.info.code == "NetConnection.Connect.Success";
       if(good)
        //Set up shared object
        text_so=SharedObject.getRemote("test", nc.uri, false);
        text_so.connect (nc);
        text_so.addEventListener(SyncEvent.SYNC, checkSO);
      private function checkSO(e:SyncEvent):void
       for (var chung:uint; change<e.changeList.length; chng++)
        switch(e.chageList[chng].code)
         case "clear":
          break;
         case "success":
          break;
         case "change":
          textArea.appendText (text_so.data.msg + "\n");
          break;
      private function cleanName(e:FocusEvent): void
       chatName.text="";
      private function sendMsg(e:MouseEvent):void
       noName=(chatName.text=="<Enter Name>" || chatName.text=="");
       if (noName)
         textArea.appendText("You must enter your name \n");
       else
        text_so.setProperty("msg", chatName.text +": " + textInput.text);
        textArea.appendText (chatName.text +": "+textInput.text +"\n");
        textInput.text="";
      private function checkKey (e:ComponentEvent):void
       noName=(chatName.text=="<Enter Name>" || chatName.text=="");
       if (noName)
         textArea.appendText("You must enter your name \n");
       else
        text_so.setProperty("msg", chatName.text +": " + textInput.text);
        textArea.appendText (chatName.text +": "+textInput.text +"\n");
        textInput.text="";
      //Create NetStream instances
      private function checkConnect  (e:NetStatusEvent):void
       msg=e.info.code == "NetConnection.Connect.Success";
       if(msg)
        nsOut=new NetStream(nc);
        nsIn=new NetStream(nc);
        //NetStream
        nsOut.attachAudio(mic);
        nsOut.attachCamera(cam);
        nsOut.publish("camstream");
        nsIn.play("camstream");

    Hi Guys...
    I have found out what is wrong. I was importing the wrong package the correct one should have been:
    import fl.events.ComponentEvent;
    instead of
    import flash.events.ComponentEvent;
    I hope this is helpful for anyone caught in a simillar situation as me...Thanks..

  • How to find out the top 10 data loads based on time duration?.

    Hi,
    We are working on performance tuning. so we want to find out the top 10 loads which had run long time in date wise.
    We need the load start time and end time of the load process, Infosource and datatarget name.
    There are nearly 1000 loads, So it is very difficult to collect the load's timings in RSMO.
    Is there any another alternative to collect the top 10 loads based on time duration in date wise?
    Thanks & Regards,
    Raju

    Hi Gangaraju,
    You can install BI Statistics for getting these type of data.
    Or you check in RSDDSTAT or RSMDATASTATE_EXT or  table for the Load process time.
    Or goto t-code ST13 to get detailed analysis of a Process chain for a given period.
    Hope this helps.
    Regards,
    Ravi Kanth

  • How to Set A Default Start Time For New Events In Calendar?

    How to Set A Default Start Time For New Events In Calendar?

    John,
    Thanks for that suggestion - could not get it to work. However, I did manage a different approach. I finally determined the sequence of events in terms of how the various events and listeners fire (I think).
    Basically, the CalendarActivityListener fires, followed by the listener associated with the Calendar object's Create facet, followed finally by the CalendarEventListener - the final is where the TriggerEvent is available and then finally, control is passed to the popup/dialog in the Create facet. So, my approach of trying to set/get the TriggerDate in the user's HTTP session was doomed to failure because it was being get before it had been set :(
    Anyway, I ended up adding a bit of code to the CalendarEvent listener - it grabs the current BindingContext, navigates through the DCBindingContainer to derive an Iterator for the ViewObject which drives the calendar and then grabs the currently active row. I then do a few tests to make sure we're working with a "new" row because I don't want to alter start & end dates associated with an existing calendar entry and then I define the Start and End dates to be the Trigger Date.
    Works just fine. Snippet from the listener follows
    BindingContext bindingContext = BindingContext.getCurrent();+
    *if ( bindingContext != null )    {*+
    DCBindingContainer dcBindings = (DCBindingContainer) bindingContext.getCurrentBindingsEntry();+
    DCIteratorBinding iterator = dcBindings.findIteratorBinding("EventsView1Iterator");+
    Row currentRow = iterator.getCurrentRow();+
    if ( currentRow.getAttribute("StartDate") == null)+
    currentRow.setAttribute("StartDate", calendarEvent.getTriggerDate());+
    if (currentRow.getAttribute("EndDate")==null)+
    currentRow.setAttribute("EndDate", calendarEvent.getTriggerDate());+
    *}*

  • How do i get final cut pro x to recognize my time capsule in event library

    how do i get final cut pro x to recognize my time capsule in event library?

    Yeah I'm getting the same issue.  I purchased a new Mac Mini yesterday purely to use the new FCPX, and now on day 1 I'm already running into problems... please don't make me switch to Premiere.
    Set up the computer with external yesterday, never set anything to Time Machine.  Here's a screenshot of the drive, formatted on Mac OS Extended (Journaled):
    And here's a screenshot of FCPX not recognizing the drive:
    Apple please respond to this post, would really appreciate some help here troubleshooting. 

  • Time duration for Process.waitFor() to wait.

    Can we specify the time duration for the Process.waitFor() after which it resumes?
              Runtime rt=Runtime.getRuntime();
              Process ps=rt.exec("some command");
              ps.waitFor();
    Like here if rt.exec() is taking a lot of time to execute, the ps should wait for a certain period of time for rt to execute and if rt doesnt complete within the specified time then ps should resume.

    I don't know exactly what you are doing but what about: wait(long timeout);

  • Time loop and events (again)

    Good morning,
    I still have problems with time loops and events.
    I have an event structure based on run time menu (two buttons: start stop).
    When I push start, an automatic sequence is started made of a state machine (so a while loop).
    I want to stop the process by means of presing stop in the run time menu. The problem is that the system doesn't respond when I press the button (it's not locked since I unchecked the option to stop front panel acitivity in the event structure configuration). I see that the pression of the stop command is made, but the code inside the event structure is not executed.
    How can I avoid this?
    Thank you,
    Fede

    Events don't react to changes in local and global varables, and that's usually a good thing.
    To trigger an event programmatically, you should write to a signaling property of the control assigned to the event, and the event will fire (even if the value does not actually change).
    Attached is a simple modification of my example that forces a stop of any ongoing measurments every 10 seconds using the above method.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Prova Loop MenuIII.zip ‏15 KB

Maybe you are looking for