Merge branch 'master' of evefit.org:pyfa

This commit is contained in:
cncfanatics
2010-09-01 18:19:05 +02:00
5 changed files with 41 additions and 17 deletions

2
.gitmodules vendored
View File

@@ -1,3 +1,3 @@
[submodule "eos"]
path = eos
url = git://pyfa.git.sourceforge.net/gitroot/pyfa/eos
url = git://evefit.org/eos.git

View File

@@ -105,7 +105,8 @@ class MainFrame(wx.Frame):
def registerMenu(self):
# Quit
self.Bind(wx.EVT_MENU, self.ExitApp, id=wx.ID_EXIT)
# Widgets Inspector
self.Bind(wx.EVT_MENU, self.openWXInspectTool, id=911)
# About
self.Bind(wx.EVT_MENU, self.ShowAboutBox, id=wx.ID_ABOUT)
@@ -116,3 +117,15 @@ class MainFrame(wx.Frame):
def toggleShipBrowser(self, event):
self.GetToolBar().toggleShipBrowser(event)
def openWXInspectTool(self,event):
from wx.lib.inspection import InspectionTool
if not InspectionTool().initialized:
InspectionTool().Init()
# Find a widget to be selected in the tree. Use either the
# one under the cursor, if any, or this frame.
wnd = wx.FindWindowAtPointer()
if not wnd:
wnd = self
InspectionTool().Show(wnd, True)

View File

@@ -58,3 +58,4 @@ class MainMenuBar(wx.MenuBar):
self.Append(helpMenu, "&Help")
helpMenu.Append(wx.ID_ABOUT)
helpMenu.Append(wx.ID_HELP, "User manual", "User manual")
helpMenu.Append(911,"Open Widgets Inspect tool", "Open Widgets Inspect tool")

View File

@@ -7,7 +7,7 @@
# --------------------------------------------------------------------------------- #
"""
PyGauge is a generic Gauge implementation tailored for PYFA (Python Fitting Assistant)
PyfaGauge is a generic Gauge implementation tailored for PYFA (Python Fitting Assistant)
It uses the easeOutQuad equation from caurina.transitions.Tweener
"""
@@ -51,7 +51,7 @@ class PyGauge(wx.PyWindow):
self._timerOver = None
self._oldValue = 0
self._timerOn = 0
self._animDuration = 500
self._animDuration = 400
self._animStep = 0
self._period = 25
self._animValue = 0
@@ -173,16 +173,16 @@ class PyGauge(wx.PyWindow):
if value > self._range:
self._overdrive = value
self._value = self._range
if not self._timerOver:
self._timerOver = wx.Timer(self, self._overdriveTimerId)
self._timerOver.Start(500)
self._overdriveTimerStarted = True
# if not self._timerOver:
# self._timerOver = wx.Timer(self, self._overdriveTimerId)
# self._timerOver.Start(500)
# self._overdriveTimerStarted = True
else:
self._overdrive = value
self._value = value
if self._overdriveTimerStarted:
self._timerOver.Stop()
self._overdriveTimerStarted = False
# if self._overdriveTimerStarted:
# self._timerOver.Stop()
# self._overdriveTimerStarted = False
if value < 0:
self._value = 0
self._overdrive = 0
@@ -322,10 +322,11 @@ class PyGauge(wx.PyWindow):
start = 0
end = oldValue - value
step=self.OUT_BOUNCE(self._animStep, start, end, self._animDuration)
step=self.OUT_QUAD(self._animStep, start, end, self._animDuration)
self._animStep += self._period
if self._timerId == event.GetId() and self._overdriveTimerId != event.GetId():
if self._timerId == event.GetId():
# and self._overdriveTimerId != event.GetId():
stop_timer = False
if self._animStep > self._animDuration:
@@ -346,6 +347,6 @@ class PyGauge(wx.PyWindow):
self._timer.Stop()
self.Refresh()
if self._overdriveTimerId == event.GetId():
self._overdriveToggle*=-1
self.Refresh()
# if self._overdriveTimerId == event.GetId():
# self._overdriveToggle*=-1
# self.Refresh()

View File

@@ -232,6 +232,11 @@ class StatsPane(wx.Panel):
self.SetSizer(self.pickerSizer)
collapsible = wx.CollapsiblePane(self, label="Stats")
colPane=collapsible.GetPane()
colPane.SetMinSize(wx.Size(0,0))
colPane.SetSize(wx.Size(0,0))
collapsible.Expand()
collapsible.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED, self.collapseChanged)
@@ -297,7 +302,7 @@ class StatsPane(wx.Panel):
box = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(bitmap, 0, wx.ALIGN_CENTER)
sizer.Add(box, 0, wx.ALIGN_CENTER)
sizer.Add(box, 0, wx.ALIGN_LEFT)
suffix = "Points" if type == "calibration" else "Hardpoints"
lbl = wx.StaticText(parent, wx.ID_ANY, "0")
@@ -349,6 +354,10 @@ class StatsPane(wx.Panel):
setattr(self, "label%sTotal%s" % (panel.capitalize(), capitalizedType), lbl)
absolute.Add(lbl, 0, wx.ALIGN_LEFT)
units = {"cpu":" tf", "pg":" GJ", "droneBandwidth":" mbit/s", "droneBay":u" m\u00B3"}
lbl = wx.StaticText(parent, wx.ID_ANY, "%s" % units[type])
absolute.Add(lbl, 0, wx.ALIGN_LEFT)
# Gauges modif. - Darriele
if self._showNormalGauges == True:
gauge = wx.Gauge(parent, wx.ID_ANY, 100)