1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
|
class GroupeAlrmBox(Control):
def __init__ (self):
self.labelAlarm = Label()
self.labelAlarm.Size = Size(100,20)
self.labelAlarm.Location = Point(0,20)
self.ResetBox = GroupBox()
self.ResetBox.Size = Size(260,30)
self.ResetBox.Location = Point(150,0)
self.RadioButton1 = RadioButton()
self.RadioButton1.Text = "Reset Alarm"
self.RadioButton1.Parent = self.ResetBox
self.RadioButton1.Location = Point(5, 10)
self.RadioButton1.Size = Size(90,15)
self.RadioButton1bis = RadioButton()
self.RadioButton1bis.Text = "No Reset"
self.RadioButton1bis.Parent = self.ResetBox
self.RadioButton1bis.Location = Point(150, 10)
self.RadioButton1bis.Size = Size(80,15)
self.RadioButton1bis.Checked = True
self.ResetBox2 = GroupBox()
self.ResetBox2.Size = Size(260,30)
self.ResetBox2.Location = Point(150,30)
self.RadioButton2 = RadioButton()
self.RadioButton2.Text = "Unmask"
self.RadioButton2.Parent = self.ResetBox2
self.RadioButton2.Location = Point(5, 10)
self.RadioButton2.Size = Size(90,15)
self.RadioButton2bis = RadioButton()
self.RadioButton2bis.Text = "Mask"
self.RadioButton2bis.Parent = self.ResetBox2
self.RadioButton2bis.Location = Point(150, 10)
self.RadioButton2bis.Size = Size(80,15)
self.RadioButton2bis.Checked = True
self.Controls.Add(self.labelAlarm)
self.Controls.Add(self.ResetBox)
self.Controls.Add(self.ResetBox2)
class Alarm_ICE(Form):
def __init__ (self):
self.Text = "Gestion Alarmes ICE"
self.Height = 800
self.Width = 500
self.CenterToScreen()
PanneauHeight = 65
self.ResetAlarm = []
self.AlarmEna = []
label = Label()
label.Text = "TC_ALARM_ICE"
label.Location = Point(180, 5)
label.Size = Size(100,15)
label.Parent = self
### Alarme 1 ICE ###
self.Panneau1 = Panel()
self.Panneau1.Location = Point(0,30)
self.Panneau1.Size = Size(self.Width,PanneauHeight)
self.Panneau1.BorderStyle = BorderStyle.FixedSingle
# GroupeAlrmBox 1
self.c1 = GroupeAlrmBox()
self.c1.Size = Size(self.Panneau1.Width,self.Panneau1.Height)
self.c1.Parent = self.Panneau1
self.c1.labelAlarm.Text = "Alarme 1 ICE"
### Alarme 2 ###
self.Panneau2 = Panel()
self.Panneau2.Location = Point(0,30+PanneauHeight)
self.Panneau2.Size = Size(self.Width,PanneauHeight)
self.Panneau2.BorderStyle = BorderStyle.FixedSingle
# GroupeAlrmBox 2
self.c2 = GroupeAlrmBox()
self.c2.Size = Size(self.Panneau2.Width,self.Panneau2.Height)
self.c2.Parent = self.Panneau2
self.c2.labelAlarm.Text = "Alarme 2 ICE"
### Alarme 3 ICE ###
self.Panneau3 = Panel()
self.Panneau3.Location = Point(0,30+2*PanneauHeight)
self.Panneau3.Size = Size(self.Width,PanneauHeight)
self.Panneau3.BorderStyle = BorderStyle.FixedSingle
# GroupeAlrmBox 3
self.c3 = GroupeAlrmBox()
self.c3.Size = Size(self.Panneau3.Width,self.Panneau3.Height)
self.c3.Parent = self.Panneau3
self.c3.labelAlarm.Text = "Alarme 3 ICE"
### Alarme 4 ICE ###
self.Panneau4 = Panel()
self.Panneau4.Location = Point(0,30+3*PanneauHeight)
self.Panneau4.Size = Size(self.Width,PanneauHeight)
self.Panneau4.BorderStyle = BorderStyle.FixedSingle
# GroupeAlrmBox 4
self.c4 = GroupeAlrmBox()
self.c4.Size = Size(self.Panneau4.Width,self.Panneau4.Height)
self.c4.Parent = self.Panneau4
self.c4.labelAlarm.Text = "Alarme 4 ICE"
### Alarme 5 ICE ###
self.Panneau5 = Panel()
self.Panneau5.Location = Point(0,30+4*PanneauHeight)
self.Panneau5.Size = Size(self.Width,PanneauHeight)
self.Panneau5.BorderStyle = BorderStyle.FixedSingle
# GroupeAlrmBox 5
self.c5 = GroupeAlrmBox()
self.c5.Size = Size(self.Panneau5.Width,self.Panneau5.Height)
self.c5.Parent = self.Panneau5
self.c5.labelAlarm.Text = "Alarme 5 ICE"
### Alarme 6 ICE ###
self.Panneau6 = Panel()
self.Panneau6.Location = Point(0,30+5*PanneauHeight)
self.Panneau6.Size = Size(self.Width,PanneauHeight)
self.Panneau6.BorderStyle = BorderStyle.FixedSingle
# GroupeAlrmBox 6
self.c6 = GroupeAlrmBox()
self.c6.Size = Size(self.Panneau5.Width,self.Panneau5.Height)
self.c6.Parent = self.Panneau6
self.c6.labelAlarm.Text = "Alarme 6 ICE"
# Bouton OK/Cancel
self.button1 = Button()
self.button1.Text = "Ok"
self.button1.Location = Point(100, 500)
self.button1.Click += self.ok
self.button2 = Button()
self.button2.Text = "Cancel"
self.button2.Location = Point(200, 500)
self.button2.Click += self.cancel
self.Controls.Add(self.button1)
self.Controls.Add(self.button2)
self.Controls.Add(self.Panneau1)
self.Controls.Add(self.Panneau2)
self.Controls.Add(self.Panneau3)
self.Controls.Add(self.Panneau4)
self.Controls.Add(self.Panneau5)
self.Controls.Add(self.Panneau6)
def ok(self, sender, event):
res1 = int(self.c1.RadioButton1.Checked)
res2 = int(self.c2.RadioButton1.Checked)
res3 = int(self.c3.RadioButton1.Checked)
res4 = int(self.c4.RadioButton1.Checked)
res5 = int(self.c5.RadioButton1.Checked)
res6 = int(self.c6.RadioButton1.Checked)
ena1 = int(self.c1.RadioButton2.Checked)
ena2 = int(self.c2.RadioButton2.Checked)
ena3 = int(self.c3.RadioButton2.Checked)
ena4 = int(self.c4.RadioButton2.Checked)
ena5 = int(self.c5.RadioButton2.Checked)
ena6 = int(self.c6.RadioButton2.Checked)
self.ResetAlarm = [res1,res2,res3,res4,res5,res6]
self.AlarmEna = [ena1,ena2,ena3,ena4,ena5,ena6]
self.Close()
def cancel(self, sender, event):
dr = showYesNo("Etes vous sur de vouloir quitter le module en cours ?", "Message operateur")
if dr == True:
self.Close() |
Partager