package com.powerdata.openpa.psse.csv;

import java.io.File;

import com.powerdata.openpa.psse.AreaInterchangeList;
import com.powerdata.openpa.psse.ImpCorrTblList;
import com.powerdata.openpa.psse.LoadList;
import com.powerdata.openpa.psse.OwnerList;
import com.powerdata.openpa.psse.PsseModelException;
import com.powerdata.openpa.psse.ZoneList;

public class PsseModel extends com.powerdata.openpa.psse.PsseModel
{
	/** root of the directory where the csv files are stored */
	File _dir;
	
	GeneratorList _generatorList;
	BusList _buses;
	NontransformerBranchList _branchList;
	TransformerList _transformerList;
	
	public PsseModel(String dirpath)
	{
		_dir = new File(dirpath);
	}
	public File getDir() { return _dir; }
	@Override
	public String getContainerName() { return "PsseEquipment"; }
	@Override
	public BusList getBuses() throws PsseModelException
	{
		if (_buses == null) _buses = new BusList(this);
		return _buses;
	}
	@Override
	public GeneratorList getGenerators() throws PsseModelException
	{
		if (_generatorList == null) _generatorList = new GeneratorList(this);
		return _generatorList;
	}
	@Override
	public NontransformerBranchList getNontransformerBranches() throws PsseModelException
	{
		if (_branchList == null) _branchList = new NontransformerBranchList(this);
		return _branchList;
	}
	@Override
	public TransformerList getTransformers() throws PsseModelException
	{
		if (_transformerList == null) _transformerList = new TransformerList(this);
		return _transformerList;
	}
	@Override
	public ImpCorrTblList<?> getImpCorrTables() throws PsseModelException
	{
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public LoadList<?> getLoads() throws PsseModelException {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public OwnerList<?> getOwners() throws PsseModelException { return null; }
	@Override
	public AreaInterchangeList<?> getAreas() throws PsseModelException { return null; }
	@Override
	public ZoneList<?> getZones() throws PsseModelException { return null; }
	static public void main(String args[])
	{
		try
		{
			PsseModel eq = new PsseModel("testdata/db");
			for(Bus b : eq.getBuses())
			{
				System.out.println(b);
			}
			for(Generator g : eq.getGenerators())
			{
				System.out.println(g);
			}
			for(NontransformerBranch b : eq.getNontransformerBranches())
			{
				System.out.println(b);
			}
			for(Transformer t : eq.getTransformers())
			{
				System.out.println(t);
			}
		}
		catch (Exception e)
		{
			System.out.println("ERROR: "+e);
		}
	}
	
	@Override
	public float getSBASE() {return getDeftSBASE();}
}

@@ -298,16 +298,68 @@
 eption;%0A
+import com.powerdata.openpa.psse.SwitchedShuntList;%0A
 import c
@@ -2648,10 +2648,154 @@
 ASE();%7D%0A
+%09@Override%0A%09public SwitchedShuntList%3C?%3E getSwitchedShunts() throws PsseModelException%0A%09%7B%0A%09%09// TODO Auto-generated method stub%0A%09%09return null;%0A%09%7D%0A
 %7D%0A

add default for the switched shunt lists now required by the PsseModel