Example #1
0
 def remote_display_summary(self, period_content):
     logger.info(u"{} Summary".format(self._le2mclt.uid))
     line = []
     for k in self._histo_vars:
         if k == "GP_randomdraw":
             if period_content.get(k) == PILE:
                 line.append(le2mtrans(u"Tail"))
             else:
                 line.append(le2mtrans(u"Head"))
         else:
             line.append(period_content.get(k))
     self.histo.append(line)
     if self._le2mclt.simulation:
         return 1
     else:
         defered = defer.Deferred()
         ecran_recap = GuiRecapitulatif(
             defered, self._le2mclt.automatique, self._le2mclt.screen,
             self.currentperiod, self.histo,
             texts_GP.get_text_summary(period_content))
         ecran_recap.show()
         return defered
Example #2
0
    def __init__(self, defered, automatique, parent, periode, historique):
        super(GuiDecision, self).__init__(parent)

        self._defered = defered
        self._automatique = automatique

        layout = QtGui.QVBoxLayout(self)

        self._widexplication = WExplication(
            text=texts_GP.get_text_explanation(), size=(500, 70), parent=self)
        layout.addWidget(self._widexplication)

        self._widdecision = WSpinbox(label=trans_GP(
            u"Choose the amount you want to invest in the "
            u"risky option"),
                                     minimum=pms.DECISION_MIN,
                                     maximum=pms.DECISION_MAX,
                                     interval=pms.DECISION_STEP,
                                     parent=self,
                                     automatique=self._automatique)
        layout.addWidget(self._widdecision)

        # bouton box
        buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok,
                                         QtCore.Qt.Horizontal, self)
        buttons.accepted.connect(self._accept)
        layout.addWidget(buttons)

        if self._automatique:
            self._timer_automatique = QtCore.QTimer()
            self._timer_automatique.timeout.connect(
                buttons.button(QtGui.QDialogButtonBox.Ok).click)
            self._timer_automatique.start(7000)

        # title and size
        self.setWindowTitle(le2mtrans(u"Decision"))
        self.adjustSize()
        self.setFixedSize(self.size())
 def remote_display_summary(self, period_content):
     logger.info(u"{} Summary".format(self._le2mclt.uid))
     line = []
     for k in self._histo_vars:
         if k == "GP_randomdraw":
             if period_content.get(k) == PILE:
                 line.append(le2mtrans(u"Tail"))
             else:
                 line.append(le2mtrans(u"Head"))
         else:
             line.append(period_content.get(k))
     self.histo.append(line)
     if self._le2mclt.simulation:
         return 1
     else:
         defered = defer.Deferred()
         ecran_recap = GuiRecapitulatif(
             defered,
             self._le2mclt.automatique, self._le2mclt.screen,
             self.currentperiod, self.histo,
             texts_GP.get_text_summary(period_content))
         ecran_recap.show()
         return defered
Example #4
0
    def __init__(self, defered, automatique, parent, periode, historique):
        super(GuiDecision, self).__init__(parent)

        self._defered = defered
        self._automatique = automatique

        layout = QtGui.QVBoxLayout(self)

        self._widexplication = WExplication(
            text=texts_GP.get_text_explanation(), size=(500, 70), parent=self)
        layout.addWidget(self._widexplication)

        self._widdecision = WSpinbox(
            label=trans_GP(u"Choose the amount you want to invest in the "
                           u"risky option"),
            minimum=pms.DECISION_MIN, maximum=pms.DECISION_MAX,
            interval=pms.DECISION_STEP, parent=self,
            automatique=self._automatique)
        layout.addWidget(self._widdecision)

        # bouton box
        buttons = QtGui.QDialogButtonBox(
            QtGui.QDialogButtonBox.Ok, QtCore.Qt.Horizontal, self)
        buttons.accepted.connect(self._accept)
        layout.addWidget(buttons)

        if self._automatique:
            self._timer_automatique = QtCore.QTimer()
            self._timer_automatique.timeout.connect(
                buttons.button(QtGui.QDialogButtonBox.Ok).click)
            self._timer_automatique.start(7000)

        # title and size
        self.setWindowTitle(le2mtrans(u"Decision"))
        self.adjustSize()
        self.setFixedSize(self.size())
Example #5
0
 def __init__(self, le2mclt):
     IRemote.__init__(self, le2mclt)
     self._histo_vars = ["GP_decision", "GP_randomdraw", "GP_periodpayoff"]
     self.histo.append(texts_GP.get_histo_header())
 def __init__(self, le2mclt):
     IRemote.__init__(self, le2mclt)
     self._histo_vars = ["GP_decision", "GP_randomdraw", "GP_periodpayoff"]
     self.histo.append(texts_GP.get_histo_header())