public Light createNewLight(String systemName,String userName){
  Light lgt=null;
  int nAddress=-1;
  nAddress=SerialAddress.getNodeAddressFromSystemName(systemName);
  if (nAddress == -1) {
    return (null);
  }
  int bitNum=SerialAddress.getBitFromSystemName(systemName);
  if (bitNum == 0) {
    return (null);
  }
  String conflict="";
  conflict=SerialAddress.isOutputBitFree(nAddress,bitNum);
  if (!conflict.equals("")) {
    log.error("Assignment conflict with " + conflict + ".  Light not created.");
    notifyLightCreationError(conflict,bitNum);
    return (null);
  }
  if (SerialAddress.validSystemNameFormat(systemName,'L')) {
    lgt=new SerialLight(systemName,userName,_memo);
    if (!SerialAddress.validSystemNameConfig(systemName,'L',_memo.getTrafficController())) {
      log.warn("Light system Name does not refer to configured hardware: " + systemName);
    }
  }
 else {
    log.error("Invalid Light system Name format: " + systemName);
  }
  return lgt;
}

public Light createNewLight ( String systemName , String userName ) { Light lgt = null ; int nAddress = - 1 ; nAddress = SerialAddress . getNodeAddressFromSystemName ( systemName ) ; if ( nAddress == - 1 ) { return ( null ) ; } int bitNum = SerialAddress . getBitFromSystemName ( systemName ) ; if ( bitNum == 0 ) { return ( null ) ; } String conflict = "" ; conflict = SerialAddress . isOutputBitFree ( nAddress , bitNum ) ; if ( ! conflict . equals ( "" ) ) { log . error ( "Assignment conflict with " + conflict + ".  Light not created." ) ; notifyLightCreationError ( conflict , bitNum ) ; return ( null ) ; } if ( SerialAddress . validSystemNameFormat ( systemName , 'L' ) ) { lgt = new SerialLight ( systemName , userName , _memo ) ; if ( ! SerialAddress . validSystemNameConfig ( systemName , 'L' , _memo . getTrafficController ( ) ) ) { log . warn ( "Light system Name does not refer to configured hardware: " + systemName ) ; } } else { log . error ( "Invalid Light system Name format: " + systemName ) ; } return lgt ; }
method to create a new light based on the system name returns null if the system name is not in a valid format or if the system name does not correspond to a configured c / mri digital output bit assumes calling method has checked that a light with this system name does not already exist
