@@ -0,0 +1,1786 @@
+/*%0A * JaamSim Discrete Event Simulation%0A * Copyright (C) 2013 Ausenco Engineering Canada Inc.%0A *%0A * This program is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU General Public License as published by%0A * the Free Software Foundation, either version 3 of the License, or%0A * (at your option) any later version.%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU General Public License for more details.%0A */%0Apackage com.sandwell.JavaSimulation;%0A%0Aimport com.jaamsim.units.Unit;%0Aimport com.jaamsim.units.UserSpecifiedUnit;%0A%0Apublic class TimeSeriesInput extends Input%3CTimeSeriesProvider%3E %7B%0A%09private Class%3C? extends Unit%3E unitType;%0A%0A%09public TimeSeriesInput(String key, String cat, TimeSeriesProvider def) %7B%0A%09%09super(key, cat, def);%0A%09%09unitType = null;%0A%09%7D%0A%0A%09public void setUnitType(Class%3C? extends Unit%3E u) %7B%0A%09%09unitType = u;%0A%09%7D%0A%0A%09@Override%0A%09public void parse(StringVector input)%0A%09throws InputErrorException %7B%0A%09%09Input.assertCountRange(input, 1, 2);%0A%0A%09%09// Try to parse as a constant value%0A%09%09try %7B%0A%09%09%09DoubleVector tmp = Input.parseDoubles(input, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, unitType);%0A%09%09%09value = new TimeSeriesConstantDouble(unitType, tmp.get(0));%0A%09%09%09this.updateEditingFlags();%0A%09%09%09return;%0A%09%09%7D%0A%09%09catch (InputErrorException e) %7B%7D%0A%0A%09%09// If not a constant, try parsing a TimeSeriesProvider%0A%09%09Entity ent = Input.parseEntity(input.get(0), Entity.class);%0A%09%09TimeSeriesProvider s = Input.castImplements(ent, TimeSeriesProvider.class);%0A%09%09if( s.getUnitType() != UserSpecifiedUnit.class )%0A%09%09%09Input.assertUnitsMatch(unitType, s.getUnitType());%0A%09%09value = s;%0A%09%09this.updateEditingFlags();%0A%09%7D%0A%7D%0A

Add TimeSeriesInput class