Package flanagan.circuits

Examples of flanagan.circuits.Phasor


            case 14:Complex[] co = this.getArray_as_Complex();
                   for(int i=0; i<this.length; i++)am.array.add(new Complex(Math.floor(co[i].getReal()), Math.floor(co[i].getImag())));
                   am.type = this.type;
                   break;
            case 15:Phasor[] ph = this.getArray_as_Phasor();
                   for(int i=0; i<this.length; i++)am.array.add(new Phasor(Math.floor(ph[i].getMagnitude()), Math.floor(ph[i].getPhaseInDegrees())));
                   am.type = this.type;
                   break;
            case 16:
            case 17:char[] ch = this.getArray_as_char();
                   for(int i=0; i<this.length; i++)am.array.add(new Character(ch[i]));
View Full Code Here


            case 14:Complex[] co = this.getArray_as_Complex();
                   for(int i=0; i<this.length; i++)am.array.add(new Complex(Math.ceil(co[i].getReal()), Math.ceil(co[i].getImag())));
                   am.type = this.type;
                   break;
            case 15:Phasor[] ph = this.getArray_as_Phasor();
                   for(int i=0; i<this.length; i++)am.array.add(new Phasor(Math.ceil(ph[i].getMagnitude()), Math.ceil(ph[i].getPhaseInDegrees())));
                   am.type = this.type;
                   break;
            case 16:
            case 17:char[] ch = this.getArray_as_char();
                   for(int i=0; i<this.length; i++)am.array.add(new Character(ch[i]));
View Full Code Here

            case 14:Complex[] co = this.getArray_as_Complex();
                   for(int i=0; i<this.length; i++)am.array.add(new Complex(Math.rint(co[i].getReal()), Math.rint(co[i].getImag())));
                   am.type = this.type;
                   break;
            case 15:Phasor[] ph = this.getArray_as_Phasor();
                   for(int i=0; i<this.length; i++)am.array.add(new Phasor(Math.rint(ph[i].getMagnitude()), Math.rint(ph[i].getPhaseInDegrees())));
                   am.type = this.type;
                   break;
            case 16:
            case 17:char[] ch = this.getArray_as_char();
                   for(int i=0; i<this.length; i++)am.array.add(new Character(ch[i]));
View Full Code Here

                    Complex sumcc = Complex.zero();
                            for(int i=0; i<this.length; i++)sumcc.plus(cc[i]);
                        this.summ.add(sumcc);
                    break;
            case 15: Phasor[] pp = this.getArray_as_Phasor();
                    Phasor sumpp = Phasor.zero();
                    for(int i=0; i<this.length; i++)sumpp.plus(pp[i]);
                    this.summ.add(sumpp);
                    break;
            default: throw new IllegalArgumentException("Data type not identified by this method");
        }
        this.sumDone = true;
View Full Code Here

    }

   public Phasor getSum_as_Phasor(){
        if(this.suppressMessages)Conv.suppressMessages();
        if(!this.sumDone)this.calcSum();
        Phasor sum = Phasor.zero();
        switch(this.type){
            case 0:
            case 1:
            case 2:
            case 3:
            case 18: sum = new Phasor(((Double)this.summ.get(0)).doubleValue());
                    break;
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
            case 10:
            case 11:
            case 16:
            case 17: if(this.sumlongToDouble){
                        sum = new Phasor(((Double)this.summ.get(0)).doubleValue());
                    }
                    else{
                        sum = new Phasor(((Long)this.summ.get(0)).doubleValue());
                    }
                    break;
            case 12: sum = new Phasor(((BigDecimal)this.summ.get(0)).doubleValue());
                    break;
            case 13: sum = new Phasor(((BigInteger)this.summ.get(0)).doubleValue());
                    break;
            case 14:
            case 15: throw new IllegalArgumentException("The " + this.typeName[this.type] + " is not a numerical type for which a sum as Phasor is meaningful/supported");
            default: throw new IllegalArgumentException("Data type not identified by this method");
        }
View Full Code Here

                    Complex productcc = Complex.plusOne();
                    for(int i=0; i<this.length; i++)productcc.times(cc[i]);
                    this.productt.add(productcc);
                    break;
            case 15: Phasor[] pp = this.getArray_as_Phasor();
                    Phasor productpp = Phasor.plusOne();
                    for(int i=0; i<this.length; i++)productpp.times(pp[i]);
                    this.productt.add(productpp);
                    break;
            default: throw new IllegalArgumentException("Data type not identified by this method");
        }
        this.productDone = true;
View Full Code Here

    }

    public Phasor getProduct_as_Phasor(){
        if(this.suppressMessages)Conv.suppressMessages();
        if(!this.productDone)this.calcProduct();
        Phasor product= Phasor.zero();
        switch(this.type){
            case 0:
            case 1:
            case 2:
            case 3:
            case 18: product= new Phasor(((Double)this.productt.get(0)).doubleValue());
                    break;
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
            case 10:
            case 11:
            case 16:
            case 17: if(this.productlongToDouble){
                        product= new Phasor(((Double)this.productt.get(0)).doubleValue());
                    }
                    else{
                        product= new Phasor(((Long)this.productt.get(0)).doubleValue());
                    }
                    break;
            case 12: product= new Phasor(((BigDecimal)this.productt.get(0)).doubleValue());
                    break;
            case 13: product= new Phasor(((BigInteger)this.productt.get(0)).doubleValue());
                    break;
            case 14:
            case 15: throw new IllegalArgumentException("The " + this.typeName[this.type] + " is not a numerical type for which a productas Phasor is meaningful/supported");
            default: throw new IllegalArgumentException("Data type not identified by this method");
        }
View Full Code Here

        // accepts strings 'magnitude'<'phase', 'magnitude'<'phase'deg, 'magnitude'<'phase'rad
        // e.g. 1.23<34.1deg, -0.67<-56.7, 6.8e2<-0.22rad
        // No default option
        public static final synchronized Phasor readPhasor(String mess){
                String line="";
                Phasor ph = new Phasor();
                boolean finish = false;
                String mess0 = "";
                if(Db.inputTypeInfo)mess0 = "Input type: Phasor ('mag'<'phase'deg or 'mag'<'phase'rad)\n";

View Full Code Here

        // Reads a Phasor from a dialog box with a prompt message and the return
        // of a default option if the return key alone is pressed - Phasor default
        public static final synchronized Phasor readPhasor(String mess, Phasor dflt){
                String line="";
                Phasor ph = new Phasor();
                boolean finish = false;
                String mess0 = "";
                if(Db.inputTypeInfo)mess0 = "Input type: Phasor ('mag'<'phase'deg or 'mag'<'phase'rad)\n";
                String dfltmess = dflt+"";
                mess = mess + "\n";
View Full Code Here

        // Reads a Phasor from a dialog box with a prompt message and the return
        // of a default option if the return key alone is pressed - String default
        public static final synchronized Phasor readPhasor(String mess, String dflt){
                String line="";
                Phasor ph = new Phasor();
                boolean finish = false;
                String mess0 = "";
                if(Db.inputTypeInfo)mess0 = "Input type: Phasor ('mag'<'phase'deg or 'mag'<'phase'rad)\n";
                String dfltmess = dflt;
                mess = mess + "\n";
View Full Code Here

TOP

Related Classes of flanagan.circuits.Phasor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.