Esempio n. 1
0
 def _runSlot(self):
     if moose.isRunning():
         print("Stopping simulation in progress ...")
         moose.stop()
     self._runtime = self.getFloatInput(self._runTimeEdit, self._runTimeLabel.text())
     self._overlayPlots(self._overlayAction.isChecked())
     self._simdt = self.getFloatInput(self._simTimeStepEdit, self._simTimeStepLabel.text())
     clampMode = None
     singlePulse = True
     if self._electronicsTab.currentWidget() == self._vClampCtrlBox:
         clampMode = "vclamp"
         baseLevel = self.getFloatInput(self._holdingVEdit, self._holdingVLabel.text())
         firstDelay = self.getFloatInput(self._holdingTimeEdit, self._holdingTimeLabel.text())
         firstWidth = self.getFloatInput(self._prePulseTimeEdit, self._prePulseTimeLabel.text())
         firstLevel = self.getFloatInput(self._prePulseVEdit, self._prePulseVLabel.text())
         secondDelay = firstWidth
         secondWidth = self.getFloatInput(self._clampTimeEdit, self._clampTimeLabel.text())
         secondLevel = self.getFloatInput(self._clampVEdit, self._clampVLabel.text())
         if not self._autoscaleAction.isChecked():
             self._im_axes.set_ylim(-10.0, 10.0)
     else:
         clampMode = "iclamp"
         baseLevel = self.getFloatInput(self._baseCurrentEdit, self._baseCurrentLabel.text())
         firstDelay = self.getFloatInput(self._firstDelayEdit, self._firstDelayLabel.text())
         firstWidth = self.getFloatInput(self._firstPulseWidthEdit, self._firstPulseWidthLabel.text())
         firstLevel = self.getFloatInput(self._firstPulseEdit, self._firstPulseLabel.text())
         secondDelay = self.getFloatInput(self._secondDelayEdit, self._secondDelayLabel.text())
         secondLevel = self.getFloatInput(self._secondPulseEdit, self._secondPulseLabel.text())
         secondWidth = self.getFloatInput(self._secondPulseWidthEdit, self._secondPulseWidthLabel.text())
         singlePulse = self._pulseMode.currentIndex() == 0
         if not self._autoscaleAction.isChecked():
             self._im_axes.set_ylim(-0.4, 0.4)
     self.squid_setup.clamp_ckt.configure_pulses(
         baseLevel=baseLevel,
         firstDelay=firstDelay,
         firstWidth=firstWidth,
         firstLevel=firstLevel,
         secondDelay=secondDelay,
         secondWidth=secondWidth,
         secondLevel=secondLevel,
         singlePulse=singlePulse,
     )
     if self._kConductanceToggle.isChecked():
         self.squid_setup.squid_axon.specific_gK = 0.0
     else:
         self.squid_setup.squid_axon.specific_gK = SquidAxon.defaults["specific_gK"]
     if self._naConductanceToggle.isChecked():
         self.squid_setup.squid_axon.specific_gNa = 0.0
     else:
         self.squid_setup.squid_axon.specific_gNa = SquidAxon.defaults["specific_gNa"]
     self.squid_setup.squid_axon.celsius = self.getFloatInput(self._temperatureEdit, self._temperatureLabel.text())
     self.squid_setup.squid_axon.K_out = self.getFloatInput(self._kOutEdit, self._kOutLabel.text())
     self.squid_setup.squid_axon.Na_out = self.getFloatInput(self._naOutEdit, self._naOutLabel.text())
     self.squid_setup.squid_axon.K_in = self.getFloatInput(self._kInEdit, self._kInLabel.text())
     self.squid_setup.squid_axon.Na_in = self.getFloatInput(self._naInEdit, self._naInLabel.text())
     self.squid_setup.squid_axon.updateEk()
     self.squid_setup.schedule(self._simdt, self._plotdt, clampMode)
     # The following line is for use with Qthread
     self.squid_setup.run(self._runtime)
     self._updateAllPlots()
Esempio n. 2
0
 def _runSlot(self):
     if moose.isRunning():
         print('Stopping simulation in progress ...')
         moose.stop()
     self._runtime = self.getFloatInput(self._runTimeEdit, self._runTimeLabel.text())
     self._overlayPlots(self._overlayAction.isChecked())
     self._simdt = self.getFloatInput(self._simTimeStepEdit, self._simTimeStepLabel.text())
     clampMode = None
     singlePulse = True
     if self._electronicsTab.currentWidget() == self._vClampCtrlBox:
         clampMode = 'vclamp'
         baseLevel = self.getFloatInput(self._holdingVEdit, self._holdingVLabel.text())
         firstDelay = self.getFloatInput(self._holdingTimeEdit, self._holdingTimeLabel.text())
         firstWidth = self.getFloatInput(self._prePulseTimeEdit, self._prePulseTimeLabel.text())
         firstLevel = self.getFloatInput(self._prePulseVEdit, self._prePulseVLabel.text())
         secondDelay = firstWidth
         secondWidth = self.getFloatInput(self._clampTimeEdit, self._clampTimeLabel.text())
         secondLevel = self.getFloatInput(self._clampVEdit, self._clampVLabel.text())
         if not self._autoscaleAction.isChecked():
             self._im_axes.set_ylim(-10.0, 10.0)
     else:
         clampMode = 'iclamp'
         baseLevel = self.getFloatInput(self._baseCurrentEdit, self._baseCurrentLabel.text())
         firstDelay = self.getFloatInput(self._firstDelayEdit, self._firstDelayLabel.text())
         firstWidth = self.getFloatInput(self._firstPulseWidthEdit, self._firstPulseWidthLabel.text())
         firstLevel = self.getFloatInput(self._firstPulseEdit, self._firstPulseLabel.text())
         secondDelay = self.getFloatInput(self._secondDelayEdit, self._secondDelayLabel.text())
         secondLevel = self.getFloatInput(self._secondPulseEdit, self._secondPulseLabel.text())
         secondWidth = self.getFloatInput(self._secondPulseWidthEdit, self._secondPulseWidthLabel.text())
         singlePulse = (self._pulseMode.currentIndex() == 0)
         if not self._autoscaleAction.isChecked():
             self._im_axes.set_ylim(-0.4, 0.4)
     self.squid_setup.clamp_ckt.configure_pulses(baseLevel=baseLevel,
                                                 firstDelay=firstDelay,
                                                 firstWidth=firstWidth,
                                                 firstLevel=firstLevel,
                                                 secondDelay=secondDelay,
                                                 secondWidth=secondWidth,
                                                 secondLevel=secondLevel,
                                                 singlePulse=singlePulse)
     if self._kConductanceToggle.isChecked():
         self.squid_setup.squid_axon.specific_gK = 0.0
     else:
         self.squid_setup.squid_axon.specific_gK = SquidAxon.defaults['specific_gK']
     if self._naConductanceToggle.isChecked():
         self.squid_setup.squid_axon.specific_gNa = 0.0
     else:
         self.squid_setup.squid_axon.specific_gNa = SquidAxon.defaults['specific_gNa']
     self.squid_setup.squid_axon.celsius = self.getFloatInput(self._temperatureEdit, self._temperatureLabel.text())
     self.squid_setup.squid_axon.K_out = self.getFloatInput(self._kOutEdit, self._kOutLabel.text())
     self.squid_setup.squid_axon.Na_out = self.getFloatInput(self._naOutEdit, self._naOutLabel.text())
     self.squid_setup.squid_axon.K_in = self.getFloatInput(self._kInEdit, self._kInLabel.text())
     self.squid_setup.squid_axon.Na_in = self.getFloatInput(self._naInEdit, self._naInLabel.text())
     self.squid_setup.squid_axon.updateEk()
     self.squid_setup.schedule(self._simdt, self._plotdt, clampMode)
     # The following line is for use with Qthread
     self.squid_setup.run(self._runtime)
     self._updateAllPlots()
Esempio n. 3
0
 def pauseSimulation(self):
     moose.stop()
Esempio n. 4
0
 def pauseSimulation(self):
     moose.stop()