unloadControllerExternal
Definition
-- @/lua/vehicle/controller.lua:365
local function unloadControllerExternal(controllerName)
if not loadedControllers[controllerName] then
log("E", "controller.unloadControllerExternal", string.format("Can't unload controller with name '%s', no matching controller found.", controllerName))
return
end
loadedControllers[controllerName] = nil
table.clear(sortedControllers)
for _, v in pairs(loadedControllers) do
table.insert(sortedControllers, v)
end
local ranks = {}
for k, v in ipairs(powertrain.getOrderedDevices()) do
ranks[v.name] = k * 100
end
table.sort(
sortedControllers,
function(a, b)
local ra, rb = ranks[a.relevantDevice or ""] or a.manualOrder or a.defaultOrder or 100000, ranks[b.relevantDevice or ""] or b.manualOrder or b.defaultOrder or 100000
a.order = ra
b.order = rb
if ra == rb then
return a.name < b.name
else
return ra < rb
end
end
)
M.cacheAllControllerFunctions()
end
Callers
@/lua/ge/extensions/editor/cosimulationSignalEditor.lua
be:queueObjectLua(vehicles[selectedVehicleIdx].vid, "controller.getController('cosimulationCoupling').stop()")
be:queueObjectLua(vehicles[selectedVehicleIdx].vid, "controller.unloadControllerExternal('cosimulationCoupling')")
isExecuting = false
@/lua/vehicle/controller/tech/MQTToutput.lua
into the console to start exporting data. If you are using the example broker, you should see that data are being sent.
3. To stop, use the same console to execute the following command: `controller.unloadControllerExternal('MQTToutput')`
@/lua/vehicle/extensions/tech/GPS.lua
local function remove(sensorId)
controller.unloadControllerExternal('GPS' .. sensorId)
GPSs[sensorId] = nil
@/lua/vehicle/extensions/tech/vehicleSystemsCoupling.lua
couplingController = nil
controller.unloadControllerExternal('vehicleSystemsCoupling')
end
@/lua/vehicle/extensions/tech/powertrainSensor.lua
local function remove(sensorId)
controller.unloadControllerExternal('powertrainSensor' .. sensorId)
powertrains[sensorId] = nil
@/lua/vehicle/extensions/tech/advancedIMU.lua
local function remove(sensorId)
controller.unloadControllerExternal('advancedIMU' .. sensorId)
advancedIMUs[sensorId] = nil
@/lua/vehicle/extensions/tech/roadsSensor.lua
local function remove(sensorId)
controller.unloadControllerExternal('roadsSensor' .. sensorId)
roadsSensors[sensorId] = nil
@/lua/vehicle/extensions/tech/idealRADARSensor.lua
local function remove(sensorId)
controller.unloadControllerExternal('idealRADARSensor' .. sensorId)
idealRADARs[sensorId] = nil
@/lua/vehicle/extensions/tech/techCore.lua
controller.getController('cosimulationCoupling').stop()
controller.unloadControllerExternal('cosimulationCoupling')
request:sendACK('CosimulationStopped')
@/lua/vehicle/extensions/tech/tyreBarrier.lua
local function remove(sensorId)
controller.unloadControllerExternal('advancedIMU' .. sensorId)
dump("imu controller removed")
dump("imu controller removed")
controller.unloadControllerExternal('tyreBarrier' .. sensorId)
dump("tyreBarrier controller removed")