prp = property;
isPrpOriented = prp == null ? false : true;
}
public int process(int index)
{
TDeviceList dlst = getDeviceList();
if (dlst == null) return TErrorList.device_not_connected;
int ndevs = dlst.getNumberOfDevices();
if (ndevs == 0) return TErrorList.device_not_connected;
if (deviceNumber < 0 && deviceNumber >= ndevs) return TErrorList.illegal_equipment_number;
if (!isPrpOriented)
{
TDevice tdv = dlst.getDevice(deviceNumber);
if (tdv == null) return TErrorList.device_not_connected;
String oldName = tdv.getName();
if (deviceName.compareTo(oldName) != 0)
{
dlst.renameDevice(oldName,deviceName);
}
if (deviceRedirection != null && deviceRedirection.length() > 0)
{
tdv.setRedirection(deviceRedirection);
deviceRedirection = null; // reset this !
}
if (deviceDescription != null && deviceDescription.length() > 0)
{
tdv.setDescription(deviceDescription);
deviceDescription = null; // reset this !
}
if (prpListFile != null && prpListFile.length() > 0)
{
getRegisteredPropertyListFromFile(tdv,prpListFile);
propertyList.setDeviceOriented(true);
prpListFile = null; // reset this !
}
if (deviceLocation != null && deviceLocation.length() > 0)
{
tdv.setLocation(deviceLocation);
}
if (deviceMask != 0) tdv.setMask(deviceMask);
if (deviceOffline != 0) tdv.setOffline(true);
if (deviceZPosition != 0) tdv.setZposition(deviceZPosition);
}
else
{
if (prp != null)
{
int prplen = prp.getOutputSize();
ArrayList<String> lst = prp.getDeviceList();
if (lst == null)
{
lst = new ArrayList<String>(prplen);
prp.setDeviceList(lst);
}
if (deviceName.length() == 0)
{
deviceName = deviceNameAlt;
if (deviceNumber == 0) deviceNumber = deviceNumberAlt;
}
if (deviceNumber < prplen) lst.add(deviceNumber,deviceName);
dlst.setPropertyOriented(true);
}
}
return 0;
}