Updates Part Three

This commit is contained in:
Unknown
2019-04-03 18:20:23 -04:00
parent 05e51d5a80
commit b0c818b737
19 changed files with 164 additions and 65 deletions
@@ -6,10 +6,28 @@
nanomodule_path = /datum/nano_module/power_monitor/
program_icon_state = "power_monitor"
extended_desc = "This program connects to sensors around the station to provide information about electrical systems"
ui_header = "power_norm.gif"
required_access = access_engine
requires_ntnet = 1
network_destination = "power monitoring system"
size = 9
var/has_alert = 0
/datum/computer_file/program/power_monitor/process_tick()
..()
var/datum/nano_module/power_monitor/NMA = NM
if(istype(NMA) && NMA.has_alarm())
if(!has_alert)
program_icon_state = "power_monitor_warn"
ui_header = "power_warn.gif"
update_computer_icon()
has_alert = 1
else
if(has_alert)
program_icon_state = "power_monitor"
ui_header = "power_norm.gif"
update_computer_icon()
has_alert = 0
/datum/computer_file/program/alarm_monitor
filename = "alarmmonitor"
@@ -24,7 +24,7 @@
dos_speed = NTNETSPEED_ETHERNET * 10
if(target && executed)
target.dos_overload += dos_speed
if(target.is_operational())
if(!target.is_operational())
target.dos_sources.Remove(src)
target = null
error = "Connection to destination relay lost."
@@ -89,8 +89,9 @@
target = R
return
if(href_list["PRG_reset"])
target.dos_sources.Remove(src)
target = null
if(target)
target.dos_sources.Remove(src)
target = null
executed = 0
error = ""
return
@@ -88,7 +88,7 @@
ui.auto_update_layout = 1
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
ui.set_auto_update(0)
/datum/nano_module/card_mod/proc/format_jobs(list/jobs)
var/obj/item/weapon/card/id/id_card = program.computer.card_slot.stored_card
@@ -16,25 +16,17 @@
/datum/nano_module/computer_configurator
name = "NTOS Computer Configuration Tool"
var/obj/machinery/modular_computer/stationary = null
var/obj/item/modular_computer/movable = null
/datum/nano_module/computer_configurator/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state)
if(program)
stationary = program.computer
movable = program.computer
if(!istype(stationary))
stationary = null
if(!istype(movable))
movable = null
if(istype(movable, /obj/item/modular_computer/processor))
var/obj/item/modular_computer/processor/P = movable
stationary = P.machinery_computer
// No computer connection, we can't get data from that.
if(!movable && !stationary)
if(!movable)
return 0
var/list/data = list()
@@ -42,27 +34,15 @@
if(program)
data = program.get_header_data()
var/list/hardware = list()
if(stationary)
if(stationary.cpu)
movable = stationary.cpu
hardware.Add(stationary.tesla_link)
else
return
var/list/hardware = movable.get_all_components()
if(movable)
hardware.Add(movable.network_card)
hardware.Add(movable.hard_drive)
hardware.Add(movable.card_slot)
hardware.Add(movable.nano_printer)
hardware.Add(movable.battery_module)
data["disk_size"] = movable.hard_drive.max_capacity
data["disk_used"] = movable.hard_drive.used_capacity
data["power_usage"] = movable.last_power_usage
data["battery_exists"] = movable.battery_module ? 1 : 0
if(movable.battery_module)
data["battery_rating"] = movable.battery_module.battery.maxcharge
data["battery_percent"] = round(movable.battery_module.battery.percent())
data["disk_size"] = movable.hard_drive.max_capacity
data["disk_used"] = movable.hard_drive.used_capacity
data["power_usage"] = movable.last_power_usage
data["battery_exists"] = movable.battery_module ? 1 : 0
if(movable.battery_module)
data["battery_rating"] = movable.battery_module.battery.maxcharge
data["battery_percent"] = round(movable.battery_module.battery.percent())
var/list/all_entries[0]
for(var/obj/item/weapon/computer_hardware/H in hardware)
@@ -81,4 +61,4 @@
ui.auto_update_layout = 1
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
ui.set_auto_update(0)
@@ -223,5 +223,5 @@
ui.auto_update_layout = 1
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
ui.set_auto_update(0)
@@ -147,7 +147,7 @@
/datum/computer_file/program/chatclient/process_tick()
..()
if(running)
if(program_state != PROGRAM_STATE_KILLED)
ui_header = "ntnrc_idle.gif"
if(channel)
// Remember the last message. If there is no message in the channel remember null.