package tests;

import oneLiners.OneLiners;
import signals.mast.IDAM;
import descriptors.mast.IDAMDesc;
import mds.MDSData;
import mds.MastMDSFetcher;
import mds.MdsPlus;
import junit.framework.TestCase;

public class TestMASTData extends TestCase {
	
	String cachePath = System.getProperty("java.io.tmpdir") + "/mastSignalCache";
	
	public void testBasics() {
		//MdsPlus mds = new MdsPlus("fuslwn.culham.ukaea.org.uk",8000);
		MdsPlus mds = new MdsPlus("wsservices-1.jet.uk",8766);			
		
		MastMDSFetcher mmds = new MastMDSFetcher(cachePath);
		IDAMDesc desc = new IDAMDesc(13500,"ip");
		IDAM d = (IDAM) mmds.getSig(desc);		
		OneLiners.dumpArray((float[]) d.getTVector());
		OneLiners.dumpArray((float[]) d.get1DData());
		
		
		
		/*
		
		int pulse = 13500;
		MDSData data = mds.makeRequest("_sig=idamgetapi(\"ip\","+pulse+")");
		int nr = data.getRank();
		int dims[] = data.getDimsFastestFirst();
		
		
		// Flux loops: "amb_fl/cc01", cc02 etc amb_fl/p2u
		// Pickups: ""
		// PF: "amc_sol current", "amc_p2iu feed current". p2il, p2ol, p3u, p3l    
		// 
		
		
		System.out.println(nr+", "+dims.length);
		for(int i=0;i<dims.length;++i) {
			System.out.println(dims[i]);
		}		
		
		*/
		
		
		
		
		
	}

	
	/*
	 * mdsconnect,'fuslwn.culham.ukaea.org.uk'
mdsvalue('_sig=idamgetapi("ip","13500/0")')
nr = mdsvalue('rank(_sig)')
nt = mdsvalue('size(dim_of(_sig,0))')
data = mdsvalue('_sig')
time = mdsvalue(dim_of(_sig,0))

plot, time,data
	 */
}




