# Accelar 1200 Routing Switch
# (c) 1996-98 Rapid City Communications, Inc

include "first.dms"

class Chassis {
	hotswapProc "dmsHotswap 8"

	bitmap "accelar1k/v200/bitmaps/bay1200_front.gif"
	children {Card Power_supply}
        Card.positions {
		{183 43} {183 93} {183 143} {183 193} {183 243} {183 293} {183 343} {183 395}
        }
        Power_supply.positions {{22 41} {22 243}}
        Power_supply.instances {1 2}
        menu {
                {command -label "Edit..." -command {dm_DoMenu edit Chassis}}
                {command -label "Graph..." -command {dm_DoMenu graph Chassis}}
                {separator}
                {command -label "Save to NVRAM" -command {
                        dm_DoAction Sess0 {{rcSysAction.0 {} 4}}}}
                {command -label "Reset Counters" -command {
			dm_DoAction Sess0 {{rcSysAction.0 {} 5}} "Really?  This can cause monitoring\napplications to see traffic/error spike."}}
                {command -label "Reset" -command {
			if {[dmsCloseDeviceProc] != -1} {dm_DoAction Sess0 {{rcSysAction.0 {} 2}}}}}
                {separator}
		{command -label "Save to Standby NVRAM" -command {
			dm_DoAction Sess0 {{rcSysAction.0 {} 6}}}}
                {command -label "Save to NVRAM(s)" -command {
                        dm_DoAction Sess0 {{rcSysAction.0 {} 4}}
                        dm_DoAction Sess0 {{rcSysAction.0 {} 6}}}}
		{command -label "Switch to Standby CPU" -command {
			dm_DoAction Sess0 {{rcSysAction.0 {} 7}}}}
        }

}

class Power_supply {
        # We default to no power supply.
        bitmap "accelar1k/v200/bitmaps/empty.gif"
	subClassVar rcChasPowerSupplyDetailType
	# Ignore Power Supply state on 1200s for now
        #statusVar rcChasPowerSupplyOperStatus
        #status==3 {bitmap "accelar1k/v200/bitmaps/power.gif"}
        #status==4 {bitmap "accelar1k/v200/bitmaps/power.gif"}

	isSelect 1
	edit {
		{{-title "Detail" -prefix rcChasPowerSupplyDetail
			-help "dmdb/accelar1k/v200/help.html#power"} {
			rcChasPowerSupplyDetailType
			rcChasPowerSupplyDetailSerialNumber
			rcChasPowerSupplyDetailHardwareRevision
			rcChasPowerSupplyDetailPartNumber
		}}
	}
}

# AC
class Power_supply::1 {
	bitmap "accelar1k/v200/bitmaps/power.gif"
}

# DC
class Power_supply::2 {
	bitmap "accelar1k/v200/bitmaps/power2.gif"
}

class Card {
	# In order to speed up card discovery I'm going to call a discoverProc
	# and get it all in one PDU.  (Sometime we should do this in the engine.)
	# You can revert to the older mechanism by uncommenting subClassVar and
	# commenting discoverProc.
	#subClassVar rcCardType
	discoverProc "dmsDiscoverrcCardType 8"
}

