src/projectStructure.js
// This functions adds a device to the current (latest) line
This functions adds a device to the current (latest) line
This functions adds a device to the current ( latest ) line
addDeviceToLine (ID, name, description, comment, address, serialNumber, applicationProgramLoaded,
    communicationPartLoaded, individualAddressLoaded, parametersLoaded, mediumConfigLoaded, lastModified, lastDownload,
    productReferenceId, hardware2ProgramReferenceId, isCommunicationObjectVisibilityCalculated, lastUsedAPDULength, maxReadAPDULength) {
    let target
    if (this.comingDevicesAssigned) {
      target = _.last(_.last(this.project.topology.areas).lines).devices
    } else {
      target = this.project.topology.unassignedDevices
    }
    target.push({
      ID: ID,
      name: name,
      description: description,
      comment: comment,
      address: address,
      communicationObjectReference: [],
      parameterReferences: [],
      security: {},
      isCommunicationObjectVisibilityCalculated: isCommunicationObjectVisibilityCalculated,
      programmingStatus: {
        serialNumber: serialNumber,
        applicationProgramLoaded: applicationProgramLoaded,
        communicationPartLoaded: communicationPartLoaded,
        individualAddressLoaded: individualAddressLoaded,
        parametersLoaded: parametersLoaded,
        mediumConfigLoaded: mediumConfigLoaded,
        lastUsedAPDULength: lastUsedAPDULength,
        maxReadAPDULength: maxReadAPDULength,
        lastModified: lastModified,
        lastDownload: lastDownload
      },
      __referenceIDs: {
        productRefID: productReferenceId,
        hardware2ProgramRefID: hardware2ProgramReferenceId
      }
    })
  }
addDeviceToLine ( ID , name , description , comment , address , serialNumber , applicationProgramLoaded , communicationPartLoaded , individualAddressLoaded , parametersLoaded , mediumConfigLoaded , lastModified , lastDownload , productReferenceId , hardware2ProgramReferenceId , isCommunicationObjectVisibilityCalculated , lastUsedAPDULength , maxReadAPDULength ) { let target if ( this . comingDevicesAssigned ) { target = _ . last ( _ . last ( this . project . topology . areas ) . lines ) . devices } else { target = this . project . topology . unassignedDevices } target . push ( { ID : ID , name : name , description : description , comment : comment , address : address , communicationObjectReference : [ ] , parameterReferences : [ ] , security : { } , isCommunicationObjectVisibilityCalculated : isCommunicationObjectVisibilityCalculated , programmingStatus : { serialNumber : serialNumber , applicationProgramLoaded : applicationProgramLoaded , communicationPartLoaded : communicationPartLoaded , individualAddressLoaded : individualAddressLoaded , parametersLoaded : parametersLoaded , mediumConfigLoaded : mediumConfigLoaded , lastUsedAPDULength : lastUsedAPDULength , maxReadAPDULength : maxReadAPDULength , lastModified : lastModified , lastDownload : lastDownload } , __referenceIDs : { productRefID : productReferenceId , hardware2ProgramRefID : hardware2ProgramReferenceId } } ) }
This functions adds a device to the current (latest) line
This functions adds a device to the current ( latest ) line
// Check if the devices is assigned or unassigned - figure out the correct push-target // Push the device to its target