Package pymontecarlo.program.nistmonte.options.detector

Source Code of pymontecarlo.program.nistmonte.options.detector.AbstractDetector

package pymontecarlo.program.nistmonte.options.detector;

import gov.nist.microanalysis.EPQLibrary.EPQException;
import gov.nist.microanalysis.NISTMonte.MonteCarloSS;

import java.awt.event.ActionEvent;
import java.io.IOException;
import java.util.Properties;

import pymontecarlo.util.hdf5.HDF5Group;

/**
* Abstract detector.
*
* @author ppinard
*/
public abstract class AbstractDetector implements Detector {

    @Override
    public void actionPerformed(ActionEvent e) {
    }



    @Override
    public void setup(MonteCarloSS mcss) throws EPQException {
    }



    @Override
    public void reset() {
        // Do nothing
    }



    protected void createLog(Properties props) {
        // Do nothing
    }



    @Override
    public void saveResults(HDF5Group root, String key) throws IOException {
        HDF5Group group = root.requireSubgroup(key);

        // Set Python class
        group.setAttribute("_class", getPythonResultClass());

        // Save log
        Properties props = new Properties();
        createLog(props);
        group.setAttribute("log", props.toString());
    }
}
TOP

Related Classes of pymontecarlo.program.nistmonte.options.detector.AbstractDetector

TOP
Copyright © 2018 www.massapi.com. 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.