from ..detectors import (DetectorInstance, DetectorModule,
DetectorSpec, DetectorTypes)
class _LPD(DetectorSpec):
detector_type = DetectorTypes.LPD
LPD_SIV1_LPDV2_SM000 = DetectorModule(uuid=20001)
LPD_SIV1_LPDV2_SM001 = DetectorModule(uuid=20002)
LPD_SIV1_LPDV2_SM002 = DetectorModule(uuid=20003)
LPD_SIV1_LPDV2_SM003 = DetectorModule(uuid=20004)
LPD_SIV1_LPDV2_SM004 = DetectorModule(uuid=20005)
LPD_SIV1_LPDV2_SM005 = DetectorModule(uuid=20006)
LPD_SIV1_LPDV2_SM006 = DetectorModule(uuid=20007)
LPD_SIV1_LPDV2_SM007 = DetectorModule(uuid=20008)
LPD_SIV1_LPDV2_SM008 = DetectorModule(uuid=20009)
LPD_SIV1_LPDV2_SM009 = DetectorModule(uuid=20010)
LPD_SIV1_LPDV2_SM010 = DetectorModule(uuid=20011)
LPD_SIV1_LPDV2_SM011 = DetectorModule(uuid=20012)
LPD_SIV1_LPDV2_SM012 = DetectorModule(uuid=20013)
LPD_SIV1_LPDV2_SM013 = DetectorModule(uuid=20014)
LPD_SIV1_LPDV2_SM014 = DetectorModule(uuid=20015)
LPD_SIV1_LPDV2_SM015 = DetectorModule(uuid=20016)
[docs]class LPDInstance(DetectorInstance):
def _repr_html_(self):
b1 = 'bgcolor="#7ee878" width="250px" height="50px" style="border: 1px solid black;"'
b2 = 'bgcolor="#ddd042" width="250px" height="50px" style="border: 1px solid black;"'
b3 = 'bgcolor="#42aedd" width="250px" height="50px" style="border: 1px solid black;"'
b4 = 'bgcolor="#dd4242" width="250px" height="50px" style="border: 1px solid black;"'
view = """
<h2> Detector: {det}, Detector UUID: {duuid:03d},
Modules: {nmods}
</h2>
<table width="500px" height="500px" padding=0
style="border: 1px solid black; border-collapse: collapse;">
<tr>
<td {b4}>{Q4M4}</td><td {b4}>{Q4M1}</td>
<td rowspan=2> </td>
<td {b1}>{Q1M4}</td><td {b1}>{Q1M1}</td>
</tr>
<tr>
<td {b4}>{Q4M3}</td><td {b4}>{Q4M2}</td>
<td {b1}>{Q1M3}</td><td {b1}>{Q1M2}</td>
</tr>
<tr colspan=5 height="12px"> </tr>
<tr>
<td {b3}>{Q3M4}</td><td {b3}>{Q3M1}</td>
<td rowspan=2> </td>
<td {b2}>{Q2M4}</td><td {b2}>{Q2M1}</td>
</tr>
<tr>
<td {b3}>{Q3M3}</td><td {b3}>{Q3M2}</td>
<td {b2}>{Q2M3}</td><td {b2}>{Q2M2}</td>
</tr>
</table>
"""
rdr = view.format(det=self.__class__.__name__.replace("_", ""),
duuid=self.detector_uuid,
nmods=16,
Q1M1=self.Q1M1, Q1M2=self.Q1M2,
Q1M3=self.Q1M3, Q1M4=self.Q1M4,
Q2M1=self.Q2M1, Q2M2=self.Q2M2,
Q2M3=self.Q2M3, Q2M4=self.Q2M4,
Q3M1=self.Q3M1, Q3M2=self.Q3M2,
Q3M3=self.Q3M3, Q3M4=self.Q3M4,
Q4M1=self.Q4M1, Q4M2=self.Q4M2,
Q4M3=self.Q4M3, Q4M4=self.Q4M4,
b1=b1, b2=b2, b3=b3, b4=b4
)
return rdr
class _LPD1M1(LPDInstance):
parent = _LPD
detector_uuid = 2
Q1M1 = _LPD.LPD_SIV1_LPDV2_SM015
Q1M2 = _LPD.LPD_SIV1_LPDV2_SM012
Q1M3 = _LPD.LPD_SIV1_LPDV2_SM011
Q1M4 = _LPD.LPD_SIV1_LPDV2_SM014
Q2M1 = _LPD.LPD_SIV1_LPDV2_SM001
Q2M2 = None
Q2M3 = _LPD.LPD_SIV1_LPDV2_SM004
Q2M4 = _LPD.LPD_SIV1_LPDV2_SM002
Q3M1 = _LPD.LPD_SIV1_LPDV2_SM009
Q3M2 = _LPD.LPD_SIV1_LPDV2_SM006
Q3M3 = _LPD.LPD_SIV1_LPDV2_SM007
Q3M4 = _LPD.LPD_SIV1_LPDV2_SM005
Q4M1 = _LPD.LPD_SIV1_LPDV2_SM000
Q4M2 = _LPD.LPD_SIV1_LPDV2_SM010
Q4M3 = _LPD.LPD_SIV1_LPDV2_SM008
Q4M4 = _LPD.LPD_SIV1_LPDV2_SM013