return getExportInformationFromFile(moduleName);
}
public int getExportInformationFromFile(String eqmName)
{
getEquipmentModuleFactory().getFecXmlDocument();
FecCfg cfg = gEqmFactory.getFecXmlCfg();
if (cfg != null)
{ // has parsed a fec.xml config file ...
LinkedList<EqmCfg> el = cfg.getEqmList();
LinkedList<String> dv = null;
float max, min;
String grp, ctx, sub, exp, reg, mstr, slav;
String fctx = gEqmFactory.getFecContext();
for( EqmCfg ec : el )
{
if (ec.getName().compareTo(eqmName) == 0)
{
LinkedList<PropertyCfg> pl = ec.getPropertyList();
for (PropertyCfg pc : pl)
{
TExportProperty xp = new TExportProperty(
pc.getId().getValue(),pc.getName(),pc.getDescription(),
pc.getSizeOut().getValue(),(short)pc.getDTypeOut().getValue(),pc.getDTagOut(),
pc.getSizeIn().getValue(),(short)pc.getDTypeIn().getValue(),pc.getDTagIn(),
(short)pc.getAccess().getValue());
if (pc.getDeadband().getValue() > 0)
xp.setAccessDeadband(pc.getDeadband().getValue());
xp.getDescription().setArrayType((short)pc.getDArrayTypeOut());
max = pc.getXmax().getValue();
min = pc.getXmin().getValue();
if (min > max) TFecLog.log(eqmName,"x min > x max for property "+pc.getName());
xp.getDescription().setXRange(new TPropertyEGU(pc.getXEgu(),min,max));
max = pc.getMax().getValue();
min = pc.getMin().getValue();
if (min > max) TFecLog.log(eqmName,"min > max for property "+pc.getName());
xp.getDescription().setYRange(new TPropertyEGU(pc.getEgu(),min,max));
// TODO:
//expp.getDescription().setArrayNumRows(pc.getNumRows().getValue());
xp.getDescription().setRedirection(pc.getRedirection());
xp.hasExclusiveRead = pc.hasExclusiveRead;
xp.hasUnlockedExclusiveRead = pc.hasUnlockedExclusiveRead;
xp.isEnforceOutput = pc.isEnforceOutput;
registerProperty(xp,null);
dv = pc.getDevices();
if (dv != null && dv.size() > 0)
{
int nr = 0;
ArrayList<String> lst = new ArrayList<String>(dv.size());
for (String d : dv)
{
lst.add(nr++,d);
}
xp.setDeviceList(lst);
getDeviceList().setPropertyOriented(true);
}
}
grp = ec.getGroup();
if (grp != null && grp.length() > 0)
{
setGroupName(grp);
if (ec.getGroupIndex().isValid())
setGroupIndex(ec.getGroupIndex().getValue());
setGroupDevicePrefix(ec.getGroupDevicePrefix());
setGroupDevicePostfix(ec.getGroupDevicePostfix());
}
exp = ec.getServer();
if (exp != null && exp.length() > 0) setExportName(exp);
ctx = ec.getContext();
if (ctx == null || ctx.length() == 0)
{ // not specified for the eqm : use the default
ctx = cfg.getContext();
if (ctx == null || ctx.length() == 0) ctx = fctx; // hope for the best
}
if (fctx == null || fctx.length() == 0)
{ // make sure this is set
gEqmFactory.setFecContext(ctx);
fctx = ctx;
}
if (ctx != null && ctx.length() > 0) setContext(ctx);
sub = ec.getSubsystem();
if (sub == null || sub.length() == 0)
{ // not specified for the eqm : use the default
sub = cfg.getSubsystem();
}
if (sub != null && sub.length() > 0) setSubsystem(sub);
reg = ec.getRegion();
if (reg != null && reg.length() > 0) setRegion(reg);
mstr = ec.getMaster();