Ejemplo n.º 1
0
digital_chans = []

names = []
#===========  device, zero name, one name, fault state
names.append(("OUT_LMTSW", "IS_OUT", "NOT_OUT", 1))
names.append(("IN_LMTSW", "IS_IN", "NOT_IN", 1))
names.append(("TEMP_SUM", "IS_FAULTED", "IS_OK", 0))  # GUN TEMP
names.append(("WAVEGUIDE_TEMP", "IS_FAULTED", "IS_OK", 0))
names.append(("TEMP_SUM", "IS_FAULTED", "IS_OK", 0))  # BUNCHER TEMP
names.append(("TEMP_SUM", "IS_FAULTED", "IS_OK", 0))  # SOL01 TEMP
names.append(("TEMP_SUM", "IS_FAULTED", "IS_OK", 0))  # SOL02 TEMP
names.append(("STATUS", "IS_FAULTED", "IS_OK", 0))  # VVR01
names.append(("STATUS", "IS_FAULTED", "IS_OK", 0))  # VV01

for i in range(0, 9):
    chan = models.DigitalChannel(number=i)
    (name, z_name, o_name, alarm_state) = names[i]
    chan.name = name
    chan.z_name = z_name
    chan.o_name = o_name
    chan.alarm_state = alarm_state
    chan.card = link_node_card
    digital_chans.append(chan)
    session.add(chan)

im01_channel = models.AnalogChannel(name="IM01B Charge",
                                    number=0,
                                    card=im_card)
fc_channel = models.AnalogChannel(name="Faraday Cup Current",
                                  number=0,
                                  card=fc_card)
Ejemplo n.º 2
0
# Install a mixed-mode link node card in every crate.
cards = []
for i in range(0, numCrates):
    link_node_card = models.ApplicationCard(number=i,
                                            type=mixed_link_node_type,
                                            slot_number=2)
    cards.append(link_node_card)
    crates[i].cards.append(link_node_card)
    session.add(link_node_card)

# Define some channels for the cards
channels = []
for i in range(0, numCards):
    for j in range(0, channelsPerCard):
        channel = models.DigitalChannel(number=j)
        channel.name = "Channel " + str(i) + ":" + str(j)
        channel.card = cards[i]
        channels.append(channel)
        session.add(channel)

# Define a device type
digitalDeviceType = models.DeviceType(name="Generic Device Type")
session.add(digitalDeviceType)

faultDigitalDeviceType = models.DeviceType(name="Composed Device Type")
session.add(faultDigitalDeviceType)

# States for the device - these are not really used
#deviceStates=[]
#for i in range(0, 2**channelsPerDevice):