Creating a customised triangle wave

Hello,
We are using Labview to create a signal to control the motion of a scanning galvo.  We would like to create a triangle wave so that the galvo scans back-and-forth uniformly, but to ensure smooth changes in momentum, we need the "corners" of the triangle wave to be slightly rounded.  What would be the best function to use to accomplish this?
I am using LabView 8.
Thank you,
Moor

Hi Moor,
You can create a triangle wave by use the triangle waveform.vi. LabVIEW has a lot of options to create triangle waves. Searching LabVIEW for triangle wave will give you all your options for it. Smoothing out the corners can be done by using a waveform graph property node and selecting the smooth update. Here is a link to a kb that contains information to waveform property nodes. Here is also a link to another discussion forum who discusses on how to smooth waveforms.
I hope this helps!
Warm regards,
Karunya R
National Instruments
Applications Engineer

Similar Messages

  • Why does my ouput signal produce triangle waves when i want sine waves

    in labview i use daq assistant to create a output voltage signal to create a sine wave. when i connect it to the opscilloscope it reads triangle waves. can someone please tell me why this is.
    Solved!
    Go to Solution.

    9172 is a chassis so I would need to know the module you are using, too. You should try the example:
    %PROGRAMFILES%\National Instruments\LabVIEW 2012\examples\DAQmx\Analog Output\Voltage - Continuous Output.vi
    It shows you how to create a waveform to generate, you could use that piece and feed it into your daq assistant.

  • I want to Create an Customised Viewer for my company to view a PDF document.

    Hello
         I want to Create a Customised Viewer to view a PDF document.
         I will be creating Setup.exe after Desiging the Viewer with content, only that Setup file will be sent to the end user.
         Please help me which software is best to Design and Create the viewer.
         NOTE : The viewer required User name and Password and other security features.
    Thanks
    Suresh

    when i go to set up his itunes account with my mastrcard it rejects it.  I'm using Visa for my account

  • What are the steps in creating a customised report?

    Dear Experts,
    can you help me with your expereince what are the steps involved in creating a customised report?
    Who generates the requirement?
    Who prepares the functional spec and what information it contains?
    Who approves the functional spec once it is prepared?
    You can take the followig case as an example:
    The customer requirement is that a report can be run for everything that is received in a given area and compare the price at which the material was received to the standard or moving average price in SAP.
    Here, what information you will give to ABAP ers to devlop the report?
    I would appreciate if anyone can help me with the entire process.
    Full points to be awarded for a satisfactory reply.
    Regards,
    Ranjan

    hi
    >Who generates the requirement?
    client or end user
    >Who prepares the functional spec and what information it contains
    there should be a specific format and it is to be filled by the functional consultant
    http://www.sap-img.com/general/what-are-functional-specification-in-sap.htm
    http://erp.ittoolbox.com/groups/project-management/erp-projectmanagement/samples-for-sap-functional-specification-1194336
    >Who approves the functional spec once it is prepared?
    abaper or the TL
    http://sap.niraj.tripod.com/id67.html
    get the proper info from ur customer as what means all information
    get the proper fields he required
    regards
    KI

  • How to get handle of a button that i created through Customisation?

    How to get handle of a button that i created through Customisation?
    I tried this in processformrequest ..failed :(
    String str2 = paramOAPageContext.getParameter("AutoDialler");
    if (str2 != null) {
    System.out.println("Inside AutoDialler Hurray");
    }

    this works well
    but can you give documentation support of whatever you are saying?
    public void processRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
    OASubmitButtonBean oasb= (OASubmitButtonBean)paramOAPageContext.getWebBeanFactory().createWebBean(paramOAPageContext,"BUTTON_SUBMIT");
    oasb.setID("xxSubmitAutoDialler");
    oasb.setUINodeName("xxSubmitAutoDialler");
    oasb.setEvent("xxSubmitAutoDialler");
    oasb.setText("xxSubmitAutoDialler");
    paramOAWebBean.addIndexedChild(oasb);
    public void processFormRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
    if ( strEvent.equals("xxSubmitAutoDialler"))
    //IMPORTANT Get this by calling the Function that loops for records.
    System.out.println("Inside processFormRequest Hurray");
    }

  • How to measure the slope of a triangle wave

    Hi everyone,
    I'm looking for a way to measure the slope of a triangle wave, which changes every half cycle of the wave. I have the triangle wave out of phase by 90 degrees so that it models the behavior of a cosine wave, and essentially all I want is a way to measure whether the slope is positive or negative. The idea is to use this information to stop another signal running at the same time at the halfway point of the cycle of the first signal, so the first wave can continue back to it's starting point and the second will start again at the completion of the first wave (as it begins the second cycle)
    I'm using LabVEIW 8.2.1 if it makes a difference
    Thanks,
    Ben
    PS. Is there a way to close threads you've previously posted on this forum? I started one yesterday (or possibly the day before) with a fairly vague question in it and it's now redundant after I made some headway on my own, and I don't want to clog the forums up

    I'm not sure how you're using this data to control anything, so I'm not sure what the best implementation would be.  You will not be able to get any data out of the loop until it finishes (gets a True value at the Stop If True terminal (sort of)), so if you want to have the loop running constantly, you need to put your control code in the loop with the generated data.  Otherwise, you could generate your boolean array, and then wire it and your control array into a for loop, and do a point by point comparison to see if you should be controlling.
    The new example.vi has two examples to give you a rough idea what I'm talking about.
    Message Edited by JeffOverton on 06-12-2008 12:19 PM
    =============
    XP SP2, LV 8.2
    CLAD
    Attachments:
    Example2.vi ‏18 KB

  • How to create 8-ch. .wav, as per Charles at NAB

    Please list all the steps necessary to create an 8-channel .wav file from input files that are either 5.1 and 2.0 AC3/E-AC3 or .wav files.  There may be some file-naming conventions involved--and name-changing.  Channelization may also be an issue.

    Warning - here be dragons! IOW, you can do it, but at present it's a bit 'clunky'...
    The basic process involves you starting with a multichannel file, with nothing in it. You create this by clicking on 'New File' and selecting 'custom'. This lets you create a file with as many channels as you want. You do this, and you then have an empty file block on your screen. At this point, any files you want to put into it have to be opened, and ideally converted to individual mono tracks (easy option to do this in the Edit menu). Now, in your multichannel file, you have to turn off all of the tracks except the one you want to insert into. The channel controls for doing this are at the RHS of the waveform. Open the track you want to insert, and copy it. Now return to the multichannel file and paste it to the active track. Repeat with all the other files you want to insert, and you have an n-channel file with your 5.1 or whatever tracks in it.
    Additionally, you can now open the Channel Mixer on this new file, and you'll get the option to alter the levels on individual channels if you want. Save the result, and you're done.
    Now, I'll be the first to admit that this isn't yet perfect. But hey, the fact that it works at all is quite something, considering how long we've waited for it.

  • What is the difference between triangle wave, triangle waveform, and triangle pattern

    For generating a triangle waveform, I have 3 vi's that I could use. Signal Processing -> Signal Generation -> Triangle wave.vi, Signal Processing -> Signal Generation -> Triangle Pattern.vi, Programming -> Waveform -> Analog waveform -> Waveform generation -> Triangle waveform.vi.
    What is the basic difference between these 3. I understand that all 3 have a different input set and I can use them according to what combination of input data I have. Is there any specific case for which each of them is used?
    Solved!
    Go to Solution.

    so, does this mean that I can not use triangle wave and triangle pattern to generate an actual waveform. Why I am asking is because I tried checking the waveform on an oscilloscope. The waveform generated by triangle waveform.vi is visible on the oscilloscope but not the one generated by triangle pattern and triangle wave.
    the attached vi CreateWaveformTest.vi does show up correctly on the oscilloscope. 
    The other vi, createparttern test.vi shows up correct in the waveform graph but I am not abe to see it on the oscilloscope. comes up as a straight line
    Attachments:
    CreateWaveformTest.vi ‏58 KB
    CreatePatternTest.vi ‏71 KB

  • Comparing sine and triangle waves

    hello everyone,
    i'm a student from belgium and i have to program an BLDC motor with labview. for this i need a PWM (pulse width modulated) signal. i want to do this by comparing a sine wave with a triangle wave, theoretically this should give me
    block wave with different duty cycle. i have added a picture to make my question more clear.
    as you can see there are two triangle waves to compare with the sine wave, every time one of the triangle crosses the sine wave a pulse is generated and stays high untill the next cross.
    thanx in advance 

    Hello,
    When i tried to reproduce this problem, I couldn't succeed in it.
    While looking at you jpeg I noticed that you have connected something to the channel input of your ddt to waveform convertors. You should remove this (except if this was your intention) and then everything should work.
    If this doesnt work, then you can always use the file attached to this post.
    Kind Regards,
    Thierry C - Applications Engineering Specialist Northern European Region - National Instruments
    CLD, CTA
    If someone helped you, let them know. Mark as solved and/or give a kudo.
    Attachments:
    testje.vi ‏420 KB

  • URGENT HELP REQUIRED _ Creating Labels for Triangle

    Hi everyone... the code below is my application - Pythagoras Theorem.. or rather displaying it.. But i have not been able to get the Vertex of the triangle Labelled as A B C... I need to do that and change the Triangle Table data to A B C insted of Horizontal Vertical and Hypotenuise and as the triangle is stretched on screen A B And C keep moving as well ...
    Besides i need to Show this in the tabel
    - Values of A ^ 2 , B^2 and C ^2 as welll as a row showing A^2+B^2 = C^2
    the code is as follows..
    This is the main class called Geometry
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.text.NumberFormat;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.DefaultTableCellRenderer;
    import java.lang.*;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    import java.awt.FileDialog;
    import java.io.*;
    import java.awt.BorderLayout;
    import java.awt.Container;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    import javax.swing.JFrame;
    public class Geometry {
        CardLayout cards;
        JPanel panel;
        public Geometry() {
            cards = new CardLayout();
            panel = new JPanel(cards);
            addCards();
            JFrame f = new JFrame("Geometry");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setJMenuBar(getMenuBar());
            f.getContentPane().add(panel);
            f.setSize(500,500);
            f.setLocation(0,0);
            f.setVisible(true);
            f.addMouseMotionListener(
            new MouseMotionListener() { //anonymous inner class
                //handle mouse drag event
                public void mouseMoved(MouseEvent e) {
                   System.out.println("Mouse  " + e.getX() +","  + e.getY());
                public void mouseDragged(MouseEvent e) {
                    System.out.println("Draggg: x=" + e.getX() + "; y=" + e.getY());
            //            public void mouseMoved(MouseEvent me) {
            //                System.out.println("Moving: x=" + me.getX() + "; y=" + me.getY());
            //        panel.addMouseMotionListener(
            //        new MouseMotionListener() { //anonymous inner class
            //            //handle mouse drag event
            //           public void mouseDragged(MouseEvent me) {
            //               setTitle("Dragging: x=" + me.getX() + "; y=" + me.getY());
            //            public void mouseMoved(MouseEvent me) {
            //                setTitle("Moving: x=" + me.getX() + "; y=" + me.getY());
        private void addCards() {
            // card one
            TriangleModel tri = new TriangleModel(175,100,175,250,325,250);
            TriangleView view  = new TriangleView(tri);
            JPanel panelOne = new JPanel(new BorderLayout());
            panelOne.add(view.getUIPanel(), "North");
            panelOne.add(view);
            panelOne.add(view.getTablePanel(), "South");
            panelOne.setName("Pythagoras's Theorem");
            panel.add("Pythagoras's Theorem", panelOne);
                  view.addMouseMotionListener(
            new MouseMotionListener() { //anonymous inner class
                //handle mouse drag event
                 public void mouseMoved(MouseEvent e) {
                    System.out.println("Mouse at " + e.getX() +","  + e.getY());
               public void mouseDragged(MouseEvent e) {
                   System.out.println("Dragging: x=" + e.getX() + "; y=" + e.getY());
            // card two
            TestModel trin = new TestModel(175,100,175,250,325,250);
            TestView viewn  = new TestView(trin);
            JPanel panelTwo = new JPanel(new BorderLayout());
            panelTwo.add(viewn.getUIPanel(), "North");
          // panelTwo.setBackground(Color.blue);
            panelTwo.setName("Similar Triangles");
            panelTwo.add(viewn);
            panelTwo.add(viewn.getTablePanel(), "South");
                  viewn.addMouseMotionListener(
            new MouseMotionListener() { //anonymous inner class
                //handle mouse drag event
                 public void mouseMoved(MouseEvent e) {
                    System.out.println("Mouse at " + e.getX() +","  + e.getY());
               public void mouseDragged(MouseEvent e) {
                   System.out.println("Dragging: x=" + e.getX() + "; y=" + e.getY());
            panel.add("Similar Triangles", panelTwo);
            JPanel panelThree = new JPanel();
            panelThree.setBackground(Color.white);
            panelThree.setName("Circle Theorem1");
            panel.add("Circle Theorem1", panelThree);
        private JMenuBar getMenuBar() {
            JMenu File = new JMenu("File");
            JSeparator separator1 = new JSeparator();
            JMenuItem Open = new JMenuItem("Open");
    //         Open.addActionListener(new java.awt.event.ActionListener() {
    //            public void actionPerformed(java.awt.event.ActionEvent evt) {
    //                openActionPerformed(evt);
            JMenuItem Save = new JMenuItem("Save");
            JMenuItem Print = new JMenuItem("Print");
            JMenuItem Exit = new JMenuItem("Exit");
            Exit.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    ExitActionPerformed(evt);
            JMenu theorem = new JMenu("Theorem");
            ActionListener l = new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    JMenuItem item = (JMenuItem)e.getSource();
                    String name = item.getActionCommand();
                    cards.show(panel, name);
            Component[] c = panel.getComponents();
            for(int j = 0; j < panel.getComponentCount(); j++) {
                String name = c[j].getName();
                JMenuItem item = new JMenuItem(name);
                item.setActionCommand(name);
                item.addActionListener(l);
                theorem.add(item);
            JMenuBar menuBar = new JMenuBar();
            JMenuBar menuBar1 = new JMenuBar();
            menuBar.add(File);
            File.add(Open);
            File.add(separator1);
            File.add(Save);
            File.add(Print);       
            File.add(Exit);
            menuBar.add(theorem);
            return menuBar;
    //    private void openActionPerformed(java.awt.event.ActionEvent evt) {
    //        FileDialog fileDialog = new FileDialog(this, "Open...", FileDialog.LOAD);
    //        fileDialog.show();
    //        if (fileDialog.getFile() == null)
    //            return;
    //        fileName = fileDialog.getDirectory() + File.separator + fileDialog.getFile();
    //        FileInputStream fis = null;
    //        String str = null;
    //        try {
    //            fis = new FileInputStream(fileName);
    //            int size = fis.available();
    //            byte[] bytes = new byte [size];
    //            fis.read(bytes);
    //            str = new String(bytes);
    //        } catch (IOException e) {
    //        } finally {
    //            try {
    //                fis.close();
    //            } catch (IOException e2) {
    //        if (str != null)
    //            textBox.setText(str);
        private void ExitActionPerformed(java.awt.event.ActionEvent evt) {
            // TODO add your handling code here:
            System.exit(0);
        public static void main(String[] args) {
            new Geometry();
    }import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.text.NumberFormat;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.DefaultTableCellRenderer;
    public class Triangle
    public Triangle()
    TriangleModel tri = new TriangleModel(175,100,175,250,325,250);
    TriangleView view = new TriangleView(tri);
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(view.getUIPanel(), "North");
    f.getContentPane().add(view);
    f.getContentPane().add(view.getTablePanel(), "South");
    f.setSize(500,500);
    f.setLocation(200,200);
    f.setVisible(true);
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.awt.event.MouseEvent;
    import javax.swing.JTable;
    import javax.swing.event.MouseInputAdapter;
    * TriangleControl.java
    * Created on 06 February 2005, 01:19
    * @author  Rahindra Naidoo
    public class TriangleControl extends MouseInputAdapter
        TriangleView view;
        TriangleModel model;
        Point start;
        boolean dragging, altering;
        Rectangle lineLens;            // used for line selection
        public TriangleControl(TriangleView tv)
            view = tv;
            model = view.getModel();
            dragging = altering = false;
            lineLens = new Rectangle(0, 0, 6, 6);
        public void mousePressed(MouseEvent e)
            Point p = e.getPoint();
            lineLens.setLocation(p.x - 3, p.y - 3);
            // are we over a line
            if(model.isLineSelected(lineLens))
                start = p;
                altering = true;
            // or are we within the triangle
            else if(model.contains(p))
                start = p;
                dragging = true;
        public void mouseReleased(MouseEvent e)
            altering = false;
            dragging = false;
            view.getCentroidLabel().setText("centroid location: " +
                                             model.findCentroid());
            view.repaint();  // for the construction lines
        public void mouseDragged(MouseEvent e)
            Point p = e.getPoint();
            if(altering)
                int x = p.x - start.x;
                int y = p.y - start.y;
                model.moveSide(x, y, p);
                updateTable();
                view.repaint();
                start = p;
            else if(dragging)
                int x = p.x - start.x;
                int y = p.y - start.y;
                model.translate(x, y);
                view.repaint();
                start = p;
        private void updateTable()
            String[] lengths = model.getLengths();
            String[] squares = model.getSquares();
            String[] angles  = model.getAngles();
            JTable table = view.getTable();
            for(int j = 0; j < angles.length; j++)
                table.setValueAt(lengths[j], 1, j + 1);
                table.setValueAt(squares[j], 2, j + 1);
                table.setValueAt(angles[j],  3, j + 1);
            view.getCentroidLabel().setText("centroid location: " +
                                             model.findCentroid());
    * TriangleModel.java
    * Created on 06 February 2005, 01:18
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.text.NumberFormat;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.DefaultTableCellRenderer;
    * @author  Rahindra Naidoo
    public class TriangleModel                      //  (x1, y1)
    {                                         //      |\
        static final int SIDES = 3;         //      | \
        private int cx, cy;                  //      |  \
        Polygon triangle;                     //      |_ _\ (x3, y3)
        int selectedIndex;                   //  (x2, y2)
        NumberFormat nf;
        Line2D[] medians;
        Point2D centroid;
        public TriangleModel(int x1, int y1, int x2, int y2, int x3, int y3)
            int[] x = new int[] { x1, x2, x3 };
            int[] y = new int[] { y1, y2, y3 };
            triangle = new Polygon(x, y, SIDES);
            nf = NumberFormat.getNumberInstance();
            nf.setMaximumFractionDigits(1);
        public boolean contains(Point p)
            // Polygon.contains doesn't work well enough
            return (new Area(triangle)).contains(p);
        public boolean isLineSelected(Rectangle r)
            Line2D line = new Line2D.Double();
            for(int j = 0; j < SIDES; j++)
                int[] x = triangle.xpoints;
                int[] y = triangle.ypoints;
                int x1 = x[j];
                int y1 = y[j];
                int x2 = x[(j + 1) % SIDES];
                int y2 = y[(j + 1) % SIDES];
                line.setLine(x1, y1, x2, y2);
                if(line.intersects(r))
                    selectedIndex = j;
                    return true;
            selectedIndex = -1;
            return false;
         * Only works for right triangle with right angle at (x2, y2)
        public void moveSide(int dx, int dy, Point p)
            int[] x = triangle.xpoints;
            int[] y = triangle.ypoints;
            switch(selectedIndex)
                case 0:
                    x[0] += dx;
                    x[1] += dx;
                    break;
                case 1:
                    y[1] += dy;
                    y[2] += dy;
                    break;
                case 2:
                    double rise  = y[2] - y[0];
                    double run   = x[2] - x[0];
                    double slope = rise/run;
                    // rise / run == (y[2] - p.y) / (x[2] - p.x)
                    x[2] = p.x + (int)((y[2] - p.y) / slope);
                    // rise / run == (p.y - y[0]) / (p.x - x[0])
                    y[0] = p.y - (int)((p.x - x[0]) * slope);
        public void translate(int dx, int dy)
            triangle.translate(dx, dy);
        public Polygon getTriangle()
            return triangle;
        public String findCentroid()
            int[] x = triangle.xpoints;
            int[] y = triangle.ypoints;
            // construct the medians defined as the line from
            // any vertex to the midpoint of the opposite line
            medians = new Line2D[x.length];
            for(int j = 0; j < x.length; j++)
                int next = (j + 1) % x.length;
                int last = (j + 2) % x.length;
                Point2D vertex = new Point2D.Double(x[j], y[j]);
                // get midpoint of line opposite vertex
                double dx = ((double)x[last] - x[next])/2;
                double dy = ((double)y[last] - y[next])/2;
                Point2D oppLineCenter = new Point2D.Double(x[next] + dx,
                                                           y[next] + dy);
                medians[j] = new Line2D.Double(vertex, oppLineCenter);
            // centroid is located on any median 2/3 the way from the
            // vertex (P1) to the midpoint (P2) on the opposite side
            double[] lengths = getSideLengths();
            double dx = (medians[0].getX2() - medians[0].getX1())*2/3;
            double dy = (medians[0].getY2() - medians[0].getY1())*2/3;
            double px = medians[0].getX1() + dx;
            double py = medians[0].getY1() + dy;
            //System.out.println("px = " + nf.format(px) +
            //                 "\tpy = " + nf.format(py));
            centroid = new Point2D.Double(px, py);
            return "(" + nf.format(px) + ",  " + nf.format(py) + ")";
        public String[] getAngles()
            double[] lengths = getSideLengths();
            String[] vertices = new String[lengths.length];
            for(int j = 0; j < lengths.length; j++)
                int opp  = (j + 1) % lengths.length;
                int last = (j + 2) % lengths.length;
                double top = lengths[j] * lengths[j] +
                             lengths[last] * lengths[last] -
                             lengths[opp] * lengths[opp];
                double divisor = 2 * lengths[j] * lengths[last];
                double vertex = Math.acos(top / divisor);
                vertices[j] = nf.format(Math.toDegrees(vertex));
            return vertices;
        public String[] getLengths()
            double[] lengths = getSideLengths();
            String[] lengthStrs = new String[lengths.length];
            for(int j = 0; j < lengthStrs.length; j++)
                lengthStrs[j] = nf.format(lengths[j]);
            return lengthStrs;
        public String[] getSquares()
            double[] lengths = getSideLengths();
            String[] squareStrs = new String[lengths.length];
            for(int j = 0; j < squareStrs.length; j++)
                squareStrs[j] = nf.format(lengths[j] * lengths[j]);
            return squareStrs;
        private double[] getSideLengths()
            int[] x = triangle.xpoints;
            int[] y = triangle.ypoints;
            double[] lengths = new double[SIDES];
            for(int j = 0; j < SIDES; j++)
                int next = (j + 1) % SIDES;
                lengths[j] = Point.distance(x[j], y[j], x[next], y[next]);
            return lengths;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.text.NumberFormat;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.DefaultTableCellRenderer;
    * TriangleView.java
    * Created on 06 February 2005, 01:21
    public class TriangleView extends JPanel
        private TriangleModel model;
        private Polygon triangle;
        private JTable table;
        private JLabel centroidLabel;
        private boolean showConstruction;
        TriangleControl control;
        public TriangleView(TriangleModel model)
            this.model = model;
            triangle = model.getTriangle();
            showConstruction = false;
            control = new TriangleControl(this);
            addMouseListener(control);
            addMouseMotionListener(control);
        public void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            g2.draw(triangle);
            if(model.medians == null)
                centroidLabel.setText("centroid location: " + model.findCentroid());
            // draw medians and centroid point
            if(showConstruction && !control.dragging)
                g2.setPaint(Color.red);
                for(int j = 0; j < 3; j++)
                    g2.draw(model.medians[j]);
                g2.setPaint(Color.blue);
                g2.fill(new Ellipse2D.Double(model.centroid.getX() - 2,
                                             model.centroid.getY() - 2, 4, 4));
        public TriangleModel getModel()
            return model;
        public JTable getTable()
            return table;
        public JLabel getCentroidLabel()
            return centroidLabel;
        public JPanel getUIPanel()
            JCheckBox showCon = new JCheckBox("show construction");
            showCon.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    boolean state = ((JCheckBox)e.getSource()).isSelected();
                    showConstruction = state;
                    repaint();
            JPanel panel = new JPanel();
            panel.add(showCon);
            return panel;
        public JPanel getTablePanel()
            String[] headers = new String[] { "", "", "", "" };
            // row and column data labels
            String[] rowHeaders = {
                "sides", "lengths", "squares", "angles", "degrees"
            String[] sidesRow = { "vertical", "horizontal", "hypotenuse" };
            String[] anglesRow = { "hyp to ver", "ver to hor", "hor to hyp" };
            // collect data from model
            String[] angles  = model.getAngles();
            String[] lengths = model.getLengths();
            String[] squares = model.getSquares();
            String[][] allData = { sidesRow, lengths, squares, anglesRow, angles };
            int rows = 5;
            int cols = 4;
            Object[][] data = new Object[rows][cols];
            for(int row = 0; row < rows; row++)
                data[row][0] = rowHeaders[row];
                for(int col = 1; col < cols; col++)
                    data[row][col] = allData[row][col - 1];
            table = new JTable(data, headers)
                public boolean isCellEditable(int row, int col)
                    return false;
            DefaultTableCellRenderer renderer =
                (DefaultTableCellRenderer)table.getDefaultRenderer(String.class);
            renderer.setHorizontalAlignment(JLabel.CENTER);
            centroidLabel = new JLabel("centroid location:  ", JLabel.CENTER);
            Dimension d = centroidLabel.getPreferredSize();
            d.height = table.getRowHeight();
            centroidLabel.setPreferredSize(d);
            JPanel panel = new JPanel(new BorderLayout());
            panel.setBorder(BorderFactory.createTitledBorder("triangle data"));
            panel.add(table);
            panel.add(centroidLabel, "South");
            return panel;
    }PLEASE HELP ---- Also does any one know how to draw a Triangle on a screen which can be controlled by a JSlider such that as and whenits incremented the triangle increase and vice versa... I need to prove Similarity in triangles using A Jslider that controls one triangle while the other triangle is Still on screen

    Sharan,
    The code given was part of the assignment and you are supposed to make the changes for your part right?
    Please give details of what you have done so far and not expect us to do your assignment for you. We'll be glad to help answer questions and point to the right direction, but giving us the entire assignment and saying, very nicely I might add, "Please do it for me." Just seems to make a mockery of the hours, days, and years that many of us has spent earning our degrees and learning our skills.
    Work on it and ask specific questions with examples of what you have done and you'll get a much better response.

  • Fastest Way To Create Ultrabeat Instrument From Wav Loop?

    Hello, can anyone share the fastest way to create and instrument from a WAV file?
    I know you can convert a wav to ESX24 instrument but I use Ultrabeat not ESX.
    Im finding my self divinding each shot into region and then exporting that to its own file.
    Is there a faster/simpler way?
    -Thanks

    You're right! It does work, however, if you follow these steps:
    1. Right-click on wave file in Arrange and choose "Slice at Transient Markers" or use the corresponding key command.
    2. Select all the split regions right-click on them and choose: Convert > Convert to new audio file(s)
    3. Again, with all the regions selected choose: Convert to new sampler track.
    4. Now launch Ultrabeat. Click on the Import button anc choose the .exs file you've just created (will be located in your project folder). Then drag the audio files into UB as desired.
    You could skip Part 3 altogether and simply slice at transients, convert to new audio file(s) and then in a new kit of UB drag them into the sample window of OSC for each part...

  • Creating a Magic Triangle

    We want to create a test Magic Triangle where we can test major changes before deploying them in production.
    We have a Mac Xserver 10.6 (matches production), Active Directory at Windows 2008 R2 functional level (Production is at 2003), and NetApp filer running OnTap 7.3.4 (Production is at 8.1). 
    We have augments defined to set the user home directory in Open Directory.  This overrides the AD setting in production.  Our test environment does not request the home directory attribute from Open Directory.
    I have turned on Diretory Service debugging using:
    sudo killall -USR1 DirectoryService
    sudo killall -USR2 DirectoryService
    From the debug logs I see the production Mac OS X client querying AD for user attributes and then OD for the augmented records:
    Here are some relevant records from the client debug log in production:
    2013-08-20 09:53:14 EDT - T[0x0000000100604000] - Internal Dispatch, API: dsGetRecordList(), Active Directory Used : DAC : 1 : Node Ref = 33610587 : Requested Rec Names = ebuller : Rec Name Pattern Match:8449 = eDSiExact : Requested Rec Types = dsRecTypeStandard:Users
    2013-08-20 09:53:14 EDT - T[0x0000000100604000] - Internal Dispatch, API: dsGetRecordList(), Active Directory Used : DAC : 2 : Node Ref = 33610587 : Requested Attrs = dsAttrTypeStandard:AppleMetaNodeLocation;dsAttrTypeStandard:AuthenticationAutho rity;dsAttrTypeStandard:HomeDirectory;dsAttrTypeStandard:NFSHomeDirectory;dsAttr TypeStandard:Password;dsAttrTypeStandard:Picture;dsAttrTypeStandard:JPEGPhoto;ds AttrTypeStandard:PrimaryGroupID;dsAttrTypeStandard:RealName;dsAttrTypeStandard:R ecordName;dsAttrTypeStandard:UniqueID;dsAttrTypeStandard:UserShell;dsAttrTypeSta ndard:GeneratedUID;dsAttrTypeStandard:CopyTimestamp;dsAttrTypeStandard:OriginalN odeName;dsAttrTypeStandard:PrimaryGroupID;dsAttrTypeStandard:MCXSettings;dsAttrT ypeNative:_guest;dsAttrTypeNative:external : Attr Type Only Flag = 0 : Record Count Limit = 0 : Continue Data = 0
    ...Some lines left out...
    2013-08-20 09:53:14 EDT - T[0x0000000100604000] - Internal Dispatch, API: dsGetRecordList(), Active Directory Used : DAR : Node Ref = 33610587 : Number of Found Records = 1 : Continue Data = 3489  : Result code = 0
    2013-08-20 09:53:14 EDT - T[0x0000000100604000] - Internal Dispatch, API: dsGetRecordList(), LDAPv3 Used : DAC : 1 : Node Ref = 33557052 : Requested Rec Names = Users:ebuller : Rec Name Pattern Match:8193 = eDSExact : Requested Rec Types = dsRecTypeStandard:Augments
    2013-08-20 09:53:14 EDT - T[0x0000000100604000] - Internal Dispatch, API: dsGetRecordList(), LDAPv3 Used : DAC : 2 : Node Ref = 33557052 : Requested Attrs = dsAttrTypeStandard:GeneratedUID;dsAttrTypeStandard:HomeDirectory;dsAttrTypeStan dard:NFSHomeDirectory : Attr Type Only Flag = 0 : Record Count Limit = 1 : Continue Data = 0
    2013-08-20 09:53:14 EDT - T[0x0000000100604000] - Internal Dispatch, API: dsGetRecordList(), LDAPv3 Used : DAR : Node Ref = 33557052 : Number of Found Records = 1 : Continue Data = 0  : Result code = 0
    And here are the similar lines from a test client:
    2013-08-19 09:25:37 EDT - T[0x0000000101C0A000] - Internal Dispatch, API: dsOpenDirNode(), Active Directory Used : DAC : Dir Ref = 16777216 : Node Name = /Active Directory/All Domains
    2013-08-19 09:25:37 EDT - T[0x0000000101C0A000] - Active Directory:          Using existing connection for domain.name.here
    2013-08-19 09:25:37 EDT - T[0x0000000101C0A000] - Active Directory:    Opening Forest-Level Node
    2013-08-19 09:25:37 EDT - T[0x0000000101C0A000] - Internal Dispatch, API: dsOpenDirNode(), Active Directory Used : DAR : Dir Ref = 16777216 : Node Ref = 33557146 : Result code = 0
    2013-08-19 09:25:37 EDT - T[0x0000000101C0A000] - Internal Dispatch, API: dsGetRecordList(), Active Directory Used : DAC : 1 : Node Ref = 33557146 : Requested Rec Names = ebuller : Rec Name Pattern Match:8449 = eDSiExact : Requested Rec Types = dsRecTypeStandard:Users
    2013-08-19 09:25:37 EDT - T[0x0000000101C0A000] - Internal Dispatch, API: dsGetRecordList(), Active Directory Used : DAC : 2 : Node Ref = 33557146 : Requested Attrs = dsAttrTypeStandard:AppleMetaNodeLocation;dsAttrTypeStandard:AuthenticationAutho rity;dsAttrTypeStandard:HomeDirectory;dsAttrTypeStandard:NFSHomeDirectory;dsAttr TypeStandard:Password;dsAttrTypeStandard:Picture;dsAttrTypeStandard:JPEGPhoto;ds AttrTypeStandard:PrimaryGroupID;dsAttrTypeStandard:RealName;dsAttrTypeStandard:R ecordName;dsAttrTypeStandard:UniqueID;dsAttrTypeStandard:UserShell;dsAttrTypeSta ndard:GeneratedUID;dsAttrTypeStandard:CopyTimestamp;dsAttrTypeStandard:OriginalN odeName;dsAttrTypeStandard:PrimaryGroupID;dsAttrTypeStandard:MCXSettings;dsAttrT ypeNative:_guest;dsAttrTypeNative:external : Attr Type Only Flag = 0 : Record Count Limit = 0 : Continue Data = 0
    ... Some lines left out ...
    2013-08-19 09:25:37 EDT - T[0x0000000101C0A000] - Active Directory:          DomainConnection Retrieval started
    2013-08-19 09:25:37 EDT - T[0x0000000101C0A000] - Active Directory:          DomainConnection Retrieval ended returning 1 results
    2013-08-19 09:25:37 EDT - T[0x0000000101C0A000] - Internal Dispatch, API: dsGetRecordList(), Active Directory Used : DAR : Node Ref = 33557146 : Number of Found Records = 1 : Continue Data = 627  : Result code = 0
    2013-08-19 09:25:37 EDT - T[0x0000000101C0A000] - Internal Dispatch, API: dsGetRecordList(), LDAPv3 Used : DAC : 1 : Node Ref = 33554887 : Requested Rec Names = Users:ebuller : Rec Name Pattern Match:8193 = eDSExact : Requested Rec Types = dsRecTypeStandard:Augments
    2013-08-19 09:25:37 EDT - T[0x0000000101C0A000] - Internal Dispatch, API: dsGetRecordList(), LDAPv3 Used : DAC : 2 : Node Ref = 33554887 : Requested Attrs = dsAttrTypeStandard:GeneratedUID : Attr Type Only Flag = 0 : Record Count Limit = 1 : Continue Data = 0
    2013-08-19 09:25:37 EDT - T[0x0000000101C0A000] - Internal Dispatch, API: dsGetRecordList(), LDAPv3 Used : DAR : Node Ref = 33554887 : Number of Found Records = 1 : Continue Data = 0  : Result code = 0
    The big difference is the search for LDAPv3 records.  In production, the client requests these attributes:
    Requested Attrs = dsAttrTypeStandard:GeneratedUID;dsAttrTypeStandard:HomeDirectory;dsAttrTypeStan dard:NFSHomeDirectory 
    but in the test environment the list is shorter:
    Requested Attrs = dsAttrTypeStandard:GeneratedUID
    We see the augments in both ODs so I don't know why our test client is not requesting the necessary attributes to mount the user's home folder.
    The client connections to AD and OD do not show any obvious issues.  Using dscl to read records from AD and OD works fine.
    Can anyone explain why a Mac OS X 10.6.8 client would not request the augmented attributes from OD when also connected to AD?

    Thanks for your reply ..
    I now see what's going on.
    so if I simply disabled kerberos of the existing OD as described here:
    http://docs.info.apple.com/article.html?path=ServerAdmin/10.6/en/odfd7bf26f.html
    it should be fine ?
    Mac OS is serving a few macs ; but most machines are Windows PCs now.
    What it does do however, is providing the mail; calendar and wiki server.
    My understanding is that if I do not run OD; it will be much more work to allow mail for AD users to work. And transferring the current mail files is going to be a pain provided it uses stuff like BC86E956-9107-4761-8EE1-C58D4019F559.
    So my plan was to bind the OD to AD ; create the same username on AD so OD would keep all the apple related entries (mail entry, GeneratedUID etc..)
    Re-creating all users from scratch looks like it's going to be a long task otherwise
    The other thing I'm worried about is that I would loose aliases. The way OD lets you create aliases is great; and I believe this isn't possible with AD.
    Last thing, when I last try to make the os X server to bind to AD ; it then wouldn't let the admin authenticate in workgroup manager kept telling me the password was incorrect.
    Which was very weird as the password would be accepted everywhere else (ssh, email, wiki etc..)
    Only workgroup manager would complain that my login details weren't correct. And in the mean time, I couldn't edit any of the remaining users.
    Thanks

  • Creating script to split wav files

    I'm using AA3 to record my vinyl collection for burning on to CD & I also use mixedinkey to ascertain the key for each track.
    Quite often the keys can be different at the beginning & end of each track so I want to create a script that will save the 1st 2 minutes of a track as say "filename(1).wav" & the last 2 minutes as "filename(2).wav" so mixedinkey can analyze them separately, is it possible?
    I have a lot of tracks that I'd like to do so automating it is the only way forward.
    Thanks in advance.

    Thanks for the replies.
    I'm getting there. I created the script below that deletes all but the 1st 2 minutes, this can then be run in batch processing with a file rename mask to get the desired result for the particular file I recorded the script on. All subsequent tracks of different length confuse it as they're not 18413567 samples in length.
    Is there any way to say "end of file" instead of specifying a number?
    Collection: mixedinkey
    Title: MIK1
    Description: Saves 1st 2 minutes only
    Mode: 2
    Undo: 0
    Selected: none at 0 scaled 18413568 SR 44100
    Freq: Off
    cmd: Channel Both
    Selected: 5292000 to 18413567 scaled 18413568 SR 44100
    Freq: Off
    cmd: Delete
    Freq: Off
    End:

  • I want to create a "clean" sawtooth wave with my own inserted array.

    I have a PXI module with a fgen5411. I can make a arbitrary waveform with my own array. that's not the problem. The real problem is that if I insert a waveform array with 4096 steps, Labview divides the steps and the 4096 steps are no longer 4096 steps but less. Because of this the created steps of the sawtooth wave excists one time out of 4 points, and the other time out of 5 points and so on.
    I use the "create arbitrary waveform" and the "app sequence waveforms" VI's. And because I use the create arb waveform VI, I have to devide my array values with 10000 so that my scale comes between the values �1 and 1.

    Hello Ben,
    I solved the problem I had with the number of points. The problem was that I was using 1/5 part of the �create arb waveform� scale(between �1 and 1) so that labview generated five points per step.
    Now I can generate a sawtooth with the full 12 bit resolution. But the problem now is that the sawtoothsweep begins negative and ends positive. This is strange because the array I load from file excists out of positive numbers. What I want is a sweep beginning at 2 Volt and ends at at least 8 Volt. I tried to change the offset of the �app sequence waveform� but this did not work. The offset does change, but it can not be made positive. I also tried to devide my array so that it fits in the positive scale of the �create arb waveform
    �(between 0 and 1), but this also did not work. Is it possible to make a positive sweep with the 5411 in ARB mode?
    I send you screenshots from the part of my program. First I load a array from file and devide this by 5000. Then I create a waveform and load this into the �app sequence waveform�.
    Ben, I hope you know what I am doing wrong, because I don�t.
    Attachments:
    load.bmp ‏291 KB
    loadarb.bmp ‏1747 KB
    generate.bmp ‏294 KB

  • Creating additional customised tabscreen under header data for me21n

    hi all.
    i have a requirement for adding extra tabscreen (subscreen) undr headr data of me21n purchase requisitions .
    and other thing is i want to know how we can raise an eror message if the user has filled all data in me21n except in customised tab screen that i am going to create.
    waiting for great answwr.
    bye.
    sita ram,

    Hi,
    you can find tons of general info BADIs on this forum. So basically go to transaction SE18 and enter name of your BADI - ME_GUI_PO_CUST. Please read carefully documentation. There is button for documentation. In documentation you can find following statement:
    The Business Add-In (BADI) ME_GUI_PO_CUST enables you to integrate your own subscreens into the Enjoy purchase order at both eader and item levels.
    So it looks like what you need. You have description for each method of BADI in documentation as well.Definitely you will have to implement method SUBSCRIBE. You will define your own screen in this method. Then you have to implement PBO and PAI logic (check methods TRANSPORT_TO_DYNP and TRANSPORT_FROM_DYNP). SAP provides examples for each BADI. You can read the example of BADIs implementation in Goto->Sample Code->Display. These examples are very well commented. I am pasting just example of SUBSCRIBE implementation
    DATA: ls_subscriber LIKE LINE OF re_subscribers.
    * we want to add a customer subscreen on the item detail tab
      CHECK im_application = 'PO'.
      CHECK im_element     = 'ITEM'.
    * each line in re_subscribers generates a subscreen. We add one subscreen in this example
      CLEAR re_subscribers[].
    * the name is a unique identifier for the subscreen and defined in this class definition
      ls_subscriber-name = subscreen1.
    * the dynpro number to use
      ls_subscriber-dynpro = '0001'.
    * the program where the dynpro can be found
      ls_subscriber-program = 'SAPLMEPOBADIEX'.
    * each subscreen needs his own DDIC-Structure
      ls_subscriber-struct_name = 'MEPO_BADI_STRUCT'.
    * a label can be defined
      ls_subscriber-label = text-001.
    * the position within the tabstrib can be defined
      ls_subscriber-position = 5.
    * the height of the screen can be defined here. Currently we suport two screen sizes:
    * value <= 7 a sevel line subscreen
    * value > 7  a 16 line subscreen
      ls_subscriber-height = 7.
      APPEND ls_subscriber TO re_subscribers.
    So basically you will define your new sub screen in this method. Do not forget that the BADI ME_PROCESS_PO_CUST is compulsatory for BADI ME_GUI_PO_CUST.
    Cheers

Maybe you are looking for