Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

// within string #23

Open
jbfaden opened this issue Sep 24, 2024 · 0 comments
Open

// within string #23

jbfaden opened this issue Sep 24, 2024 · 0 comments

Comments

@jbfaden
Copy link
Owner

jbfaden commented Sep 24, 2024

"//" within a string isn't handled properly, as if I do some pre-processing which doesn't consider the case:

String vapurl= "https://github.com/autoplot/dev/blob/master/demos/2024/20240907/kodalith.vap";

and returns

vapurl = 'https://github.com/autoplot/dev/blob/master/demos/2024/20240907/kodalith.vap'
#github.com/autoplot/dev/blob/master/demos/2024/20240907/kodalith.vap";

This needs to be explored. Here's the entire Java code:

package test;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.LinkedHashMap;
import org.autoplot.ApplicationModel;
import org.autoplot.datasource.DataSetURI;
import org.autoplot.dom.Application;
import org.das2.graph.DasCanvas;
import org.das2.util.monitor.NullProgressMonitor;

/**
 * The SimpleServlet isn't resolving PWD references.
 * @author jbf
 */
public class TestServletPWD {
    public static void main( String[] args ) throws IOException {
        String vapurl= "https://github.com/autoplot/dev/blob/master/demos/2024/20240907/kodalith.vap";
        File openable = DataSetURI.getFile(vapurl,new NullProgressMonitor());
        ApplicationModel appmodel = new ApplicationModel();
        appmodel.addDasPeersToAppAndWait();
        LinkedHashMap deltas = new LinkedHashMap<>();
        //deltas.put("PWD", "https://github.com/autoplot/dev/blob/master/demos/2024/20240907/");
        appmodel.doOpenVap( openable, deltas );
        
        Application dom= appmodel.getDom();
        int width = appmodel.getDom().getCanvases(0).getWidth();
        int height = appmodel.getDom().getCanvases(0).getHeight();
        DasCanvas c = dom.getController().getCanvas().getController().getDasCanvas();
        c.prepareForOutput(width, height);

        dom.getController().waitUntilIdle();

        File fout= new File("/tmp/ap/kodalith.vap.png");
        fout.getParentFile().mkdirs();
        FileOutputStream fos= new FileOutputStream(fout);
        
        appmodel.getCanvas().writeToPng( fos, width, height );
        fos.close();
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant