Package simtools.data.async

Examples of simtools.data.async.TimeStampedDataSource


    public TimePlot(int ox, int oy, int width, int height) {
        super(ox, oy, width, height);
    }

    protected CurveShape doAddYAction(Object[] obar){
        TimeStampedDataSource ds = (TimeStampedDataSource)obar[0];
        boolean primary = ((Boolean)obar[1]).booleanValue();
        boolean usePrimaryX = ((Boolean)obar[2]).booleanValue();

        Rectangle bounds = getBounds();
        CurveShape cs;

        if (usePrimaryX) {

            cs = createCurveShape(ds.getTime(), ds);
            if (isPrimaryBounded) cs.setSlice(primaryStartIndex, primaryEndIndex);
        } else {
            cs = createCurveShape(ds.getTime(), ds);
            if (isSecondaryBounded) cs.setSlice(secondaryStartIndex, secondaryEndIndex);
        }

        String label = DEFAULT_DISPLAY_DATA_SOURCE_ID? DataInfo.getAliasOrIdwithUnit(ds) : DataInfo.getAliasOrLabelwithUnit(ds);
        if (primary) {
View Full Code Here


       

        // Get first TimeStamped data source and compute offset between time1 and time2 values
        if (!curves.isEmpty()){
            try {
                TimeStampedDataSource fisrtTsDs =(TimeStampedDataSource) ((Curve)curves.get(0)).shape.getYSource();
                if (fisrtTsDs instanceof StreamingTSDataSource){
                    if (((StreamingTSDataSource)fisrtTsDs).getTime2()!=null){
                        if (displaySecondaryAxis) {
                            if(_asx2 == null){
                                setSecondaryAxis(true,true);
                                setTimeFormat(_asx1.getMin(), _asx1.getMax(), _asx1.getStep(), true);   // set format using ax1 format
                            }

                            // Compute offset between time1 and tim2
                            long currentIndex = fisrtTsDs.getLastIndex();
                            time2Offset =
                                ((StreamingTSDataSource)fisrtTsDs).getTime2().getDoubleValue(currentIndex)-
                                fisrtTsDs.getTime().getDoubleValue(currentIndex);

                            // update SX axe
                            if(!axesLimitsArray[SX].validity){
                                axesLimitsArray[SX].min = axesLimitsArray[PX].min + time2Offset ;                                
                                axesLimitsArray[SX].max = axesLimitsArray[PX].max + time2Offset ;
View Full Code Here

            return super.doAction(x,y,o,action, undoableEdit);   
        }

        if (o instanceof TimeStampedDataSource) {
            TimeStampedDataSource ds = (TimeStampedDataSource)o;
            if (action.equals(addedResources.getStringValue("add"))) {
                return add(ds, true, true);
            }
            if (action.equals(addedResources.getStringValue("addSec"))) {
                return add(ds, false, true);
View Full Code Here

        try{
            for (int i=0; i<curves.size(); ++i) {
                Curve curve = ((Curve) curves.get(i));

                if (curve.secondaryXaxis == secondaryXaxis) {
                    TimeStampedDataSource ySource = (TimeStampedDataSource)curve.shape.getYSource();
                    double t = (start ? ySource.getStart(): ySource.getEnd());
                    if (start && t < res){
                        res = t;
                    }
                    if (!start && t > res){
                        res = t;
View Full Code Here

            try {
                if ( ! (tsdsc.get(i) instanceof TimeStampedDataSource)){
                    continue;
                }

                TimeStampedDataSource ds = (TimeStampedDataSource)tsdsc.get(i);
                String id =DataInfo.getId(ds);

                if (get(id)!=null){
                    id +=  "_" + DataInfo.getLabel(tsdsc)//  If data source name already exists then add collection name as a suffix
                }
                if (get(id)==null){
                    // 1 - Update merged time
                    if (ds.getTime().sortedOrder() != 1) {
                        throw new MergeDataException("Cannot add " + DataInfo.getId(ds) + " because its time reference is not sorted");
                    }
                    updateMergedTimeBounds(ds.getTime(), false, offset, initialDate);

                    // 2- Create data source
                    addedDs = new DirectSynchronousMergedDataSource(id, this,size(), ds, ds.getTime(), false, offset, initialDate);

                    // 3 - Add data source to collection
                    addToCollectionArborescence(DataInfo.getId(addedDs), addedDs);
                    add(addedDs);
                    map.put(id, addedDs);
View Full Code Here

TOP

Related Classes of simtools.data.async.TimeStampedDataSource

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.