def removeoutlier(): if len(ep.EpmDatasetPens.SelectedPens) != 1: ep.showMsgBox("EPM - Histograma", "Execute a consulta do Dataset Analysis \n e selecione uma pena antes de aplicar a funcao.", "Warning") return 0 epm_tag = ep.EpmDatasetPens.SelectedPens[0].Values FATOR = 1.5 values = epm_tag["Value"] q3, q1 = np.percentile(values, [75, 25]) iqr = q3 - q1 lowpass = q1 - (iqr * FATOR) highpass = q3 + (iqr * FATOR) epmarray = np.dtype([('Value','>f8'),('Timestamp','object'),('Quality','object')]) print data ep.plotValues('No_Outliers',values)
def submitForm(self): elements = [] for e in self.theFrame.findAllElements("*"): el = {} el["type"] = str(e.localName()) if e.hasAttribute("id"): el["id"] = str(e.attribute("id")) if e.hasAttribute("name"): el["name"] = str(e.attribute("name")) val = e.evaluateJavaScript('this.value').toPyObject() if val != None: el["value"] = val elements.append(el) if "#" in self.parent.current_text.split(" ")[0]: plugins_list = [] for p in Plugins.get_plugin_names(): if str(self.parent.current_text.split(" ")[0]).lower().replace( "#", "") in p: plugins_list.append(p) if plugins_list: plugin_name = plugins_list[0] pl = Plugins.getCurrentPluginModule(plugin_name) try: pl.onFormSubmit(elements) except: print( "[Duck Launcher] No 'onFormSubmit()' method present in the plugin." )
def windSpeedPowerChart(): """Grafico de potencia com a velocidade do vento Apresenta um grafico de dispersao da potencia com a velocidade do vento e calcula a curva que melhor o representa """ if len(ep.EpmDatasetPens.SelectedPens) != 2: ep.showMsgBox('EPM Python Plugin - Demo Tools', 'Please select two interpolated pens before applying this function!', 'Warning') return 0 global minSpeed global nominalPower runDialogMinSpeedNomPower() minSpeed = float(minSpeed) nominalPower = float(nominalPower) rawSpeed, rawPower = getSpeedPowerValues(ep.EpmDatasetPens.SelectedPens[0], ep.EpmDatasetPens.SelectedPens[1]) speed, power = cleanSpeedPowerData(rawSpeed, rawPower, minSpeed, nominalPower ) xm, ym = windPowerAverage(speed, power) par0 = [1.0, 1.0, 1500.0, 1.0] binSpeed = 0.5 parest,cov,infodict,mesg,ier = optimize.leastsq(residualsSPPn4, par0, args=(xm, ym), full_output=True) xEst = np.arange(xm.min(), xm.max(), binSpeed) yEst = powerFitPn4(parest, xEst) posAbove = np.argwhere(yEst > nominalPower) yEst[posAbove] = nominalPower fig1 = plt.figure() ax1 = fig1.add_subplot(1, 1, 1) ax1.set_ylim(0, 1.05*nominalPower) ax1.set_xlim(minSpeed-1, 1.1*speed.max()) ax1.set_xlabel(r'$Speed (m/s)$') ax1.set_ylabel(r'$Power (KW)$') ax1.scatter(speed, power) ax1.plot(xEst, yEst, color='r', linewidth=3) plt.show()
def open(self, editor): """ """ if self.pluginEnabled: msg = _('Disable') else: msg = _('Enable') if wx.MessageBox('%s %s?'%(msg, self.name), _('Confirm Toggle Plug-in'), wx.YES_NO | wx.ICON_QUESTION) == wx.YES: section = getPluginSection(self.resourcepath) ordered, disabled = Plugins.readPluginsState(section) if self.pluginEnabled: disabled.append(self.name) else: try: disabled.remove(self.name) except ValueError: pass #Plugins.writeInitPluginGlobals(initPluginPath, initPluginGlobals) Plugins.writePluginsState(section, ordered, disabled) editor.explorer.list.refreshCurrent() return None, None
def histograma(): # Verifica se existe apenas uma pena selecionada no Dataset Analysis. if len(ep.EpmDatasetPens.SelectedPens) != 1: ep.showMsgBox("EPM - Histograma", "Execute a consulta do Dataset Analysis \n e selecione uma pena antes de aplicar a funcao.", "Warning") return 0 # Passa para a variavel 'epm_tag' a variavel selecionada. epm_tag = ep.EpmDatasetPens.SelectedPens[0].Values x = epm_tag["Value"] mu = epm_tag["Value"].mean() # Mediana da amostra sigma = epm_tag["Value"].std() # Desvio padrao da amostra # Quantidade de valores que desejamos agrupar. (barras verdes) num_bins = 20 # Gera o histograma n, bins, ignore = plt.hist(x, num_bins, normed=1, facecolor='green', alpha=0.5) # Adiciona uma linha indicando a curva de normalidade (vermelha tracejada) y = mlab.normpdf(bins, mu, sigma) plt.plot(bins, y, 'r--') plt.title("Histograma \n $\mu=" + "{:.3f}".format(mu) + "$, $\sigma=" + "{:.3f}".format(sigma) + "$") # Mostra na tela o gráfico plt.subplots_adjust(left=0.15) plt.show()
def open(self, editor): """ """ if self.pluginEnabled: msg = _('Disable') else: msg = _('Enable') if wx.MessageBox('%s %s?' % (msg, self.name), _('Confirm Toggle Plug-in'), wx.YES_NO | wx.ICON_QUESTION) == wx.YES: section = getPluginSection(self.resourcepath) ordered, disabled = Plugins.readPluginsState(section) if self.pluginEnabled: disabled.append(self.name) else: try: disabled.remove(self.name) except ValueError: pass #Plugins.writeInitPluginGlobals(initPluginPath, initPluginGlobals) Plugins.writePluginsState(section, ordered, disabled) editor.explorer.list.refreshCurrent() return None, None
def submitForm(self): elements=[] for e in self.theFrame.findAllElements("*"): el={} el["type"] = str(e.localName()) if e.hasAttribute("id"): el["id"]=str(e.attribute("id")) if e.hasAttribute("name"): el["name"]=str(e.attribute("name")) val= e.evaluateJavaScript('this.value').toPyObject() if val!=None: el["value"]=val elements.append(el) if "#" in self.parent.current_text.split(" ")[0]: plugins_list=[] for p in Plugins.get_plugin_names(): if str(self.parent.current_text.split(" ")[0]).lower().replace("#","") in p: plugins_list.append(p) if plugins_list: plugin_name=plugins_list[0] pl=Plugins.getCurrentPluginModule(plugin_name) try: pl.onFormSubmit(elements) except: print("[Duck Launcher] No 'onFormSubmit()' method present in the plugin.")
def showChooseIDELanguage(editor): dlg = LanguageSelectDlg(editor, lang=Preferences.i18nLanguage, boaLangs=langs) try: if dlg.ShowModal() == wx.ID_OK: lang, ident = dlg.GetLanguageInfo() Preferences.i18nLanguage = lang Plugins.updateRcFile('prefs.rc.py', 'i18nLanguage', 'wx.'+ident) finally: dlg.Destroy()
def countChanges(): """ Show direction changes count from selected pen """ if len(ep.EpmDatasetPens.SelectedPens) != 1: ep.showMsgBox(_g_DemoToolsCaption, _g_MissSinglePenTxt, _g_MissPensMsgType) return None epmData = ep.EpmDatasetPens.SelectedPens[0].Values changes = _invCount(epmData['Value']) message = 'Number of changes: {}' # use only for debugging print(message.format(changes)) ep.showMsgBox(_g_DemoToolsCaption, message.format(changes)) return changes
def showChooseIDELanguage(editor): dlg = LanguageSelectDlg(editor, lang=Preferences.i18nLanguage, boaLangs=langs) try: if dlg.ShowModal() == wx.ID_OK: lang, ident = dlg.GetLanguageInfo() Preferences.i18nLanguage = lang Plugins.updateRcFile('prefs.rc.py', 'i18nLanguage', 'wx.' + ident) finally: dlg.Destroy()
def myMAvgPlugin(): """ Moving average filter (3th order). """ if len(ep.EpmDatasetPens.SelectedPens) != 1: ep.showMsgBox('EPM Python Plugin - example', 'Please select a single pen before applying this function!', 'Warning') return 0 order = 3 epmData = ep.EpmDatasetPens.SelectedPens[0].Values yf = filtMAvg(epmData, order) ep.plotValues('yf', yf) return yf
def plotXY(): """ Plot XY from selected pens """ if len(ep.EpmDatasetPens.SelectedPens) != 2: ep.showMsgBox(_g_DemoToolsCaption, _g_MissDoublePenTxt, _g_MissPensMsgType) return None epmData1 = ep.EpmDatasetPens.SelectedPens[0].Values epmData2 = ep.EpmDatasetPens.SelectedPens[1].Values from matplotlib.pylab import show, subplots, plot, figure, connect figure(figsize=(8, 6)) plot(epmData1['Value'], epmData2['Value']) show()
def fiveDaysProfilePlugin(): """ Gráfico de área do perfil diário médio da variável a partir de dados de 5 dias. Dados devem corresponder a uma consulta de 5 dias (úteis) com valores médios a cada hora. """ if len(ep.EpmDatasetPens.SelectedPens) != 1: ep.showMsgBox( 'EPM Python Plugin - Demo Power', 'Please select a single pen before applying this function!', 'Warning') return 0 def cc(arg): return colorConverter.to_rgba(arg, alpha=0.6) epmDataValue = ep.EpmDatasetPens.SelectedPens[0].Values['Value'] epmAvg = np.vstack( (epmDataValue[0:24], epmDataValue[24:2 * 24], epmDataValue[2 * 24:3 * 24], epmDataValue[3 * 24:4 * 24], epmDataValue[4 * 24:5 * 24])) epmAvg = epmAvg.mean(axis=0) epmAvg[0], epmAvg[-1] = 0, 0 ys = np.arange(1, 25) zs = [0., 1., 2., 3., 4., 5.] profileList = [] profileList.append(list(zip(ys, epmAvg))) ini = 0 end = 24 for i in range(5): dataPeriod = epmDataValue[ini:end] dataPeriod[0], dataPeriod[-1] = 0, 0 profileList.append(list(zip(ys, dataPeriod))) ini += 24 end += 24 poly = PolyCollection( profileList, facecolors=[cc('k'), cc('r'), cc('g'), cc('b'), cc('y'), cc('c')]) fig = plt.figure(figsize=(15, 8)) ax = fig.gca(projection='3d') poly.set_alpha(0.7) ax.add_collection3d(poly, zs=zs, zdir='y') ax.set_xlabel('hour') ax.set_xlim3d(1, 24) ax.set_ylabel('day') ax.set_ylim3d(-1, 6) ax.set_zlabel('power') ax.set_zlim3d(epmDataValue.min(), epmDataValue.max()) plt.show()
def thirtyDaysProfilePlugin(): """ Gera uma superfície para avaliar a variação diária e ao longo do mês (30 dias). Dados devem corresponder a uma consulta com 30 dias e serem interpolados (ProcessingInterval < 1h). """ if len(ep.EpmDatasetPens.SelectedPens) != 1: ep.showMsgBox( 'EPM Python Plugin - Demo Power', 'Please select a single pen before applying this function!', 'Warning') return 0 epmData = ep.EpmDatasetPens.SelectedPens[0].Values sampling = 30 pHours = 24 iniPeriod = epmData['Timestamp'][0] endPeriod = epmData['Timestamp'][-1] dTotal = endPeriod - iniPeriod totDays = dTotal.days evalPeriod = dt.timedelta(hours=pHours) nextPeriod = iniPeriod + evalPeriod profileList = [] for i in range(totDays + 1): iniP = epmData['Timestamp'] >= iniPeriod endP = epmData['Timestamp'] < nextPeriod epmDataValue = epmData['Value'] dataPeriod = epmDataValue[iniP * endP] profileList.append(dataPeriod) iniPeriod = iniPeriod + dt.timedelta(1) nextPeriod = iniPeriod + evalPeriod profileMatrix = np.array(profileList) days = np.arange(totDays) + 1 hours = np.arange(0, pHours * 60, sampling) meshTime, indices = np.meshgrid(hours, days) meshProfile = np.zeros(meshTime.shape) for i in range(indices.shape[0]): for j in range(indices.shape[1]): meshProfile[i, j] = profileMatrix[i, j] fig = plt.figure(figsize=(15, 8)) ax = fig.gca(projection='3d') X = meshTime Y = indices Z = meshProfile ax.plot_surface(X / 60., Y, Z, rstride=1, cstride=1, cmap='coolwarm', alpha=0.8) ax.set_xlabel('hour') ax.set_ylabel('day') ax.set_zlabel('Power') plt.show()
def windDirectionPieChart(): """Grafico de pizza da direcao do vento Apresenta um grafico de pizza baseado no percentual de tempo da direcao do vento """ if len(ep.EpmDatasetPens.SelectedPens) != 1: ep.showMsgBox('EPM Python Plugin - Demo Tools', 'Please select one pen before applying this function!', 'Warning') return 0 rawDirection = ep.EpmDatasetPens.SelectedPens[0] nodesPercents, nodesLabels = percentTimeIn(rawDirection.Values) colors = ['blue','yellowgreen', 'cyan', 'gold', 'lightskyblue', 'magenta', 'green', 'lightcoral'] plt.pie(nodesPercents[:,1], labels=nodesLabels, colors=colors,autopct='%1.1f%%', shadow=False, startangle=90) plt.axis('equal') plt.show()
def normalizeData(): """ Plot normalized data from selected pen """ if len(ep.EpmDatasetPens.SelectedPens) != 1: ep.showMsgBox(_g_DemoToolsCaption, _g_MissSinglePenTxt, _g_MissPensMsgType) return None penName = ep.EpmDatasetPens.SelectedPens[0].Name + '_Normalized' epmData = ep.EpmDatasetPens.SelectedPens[0].Values normCurves = epmData.copy() v = epmData['Value'] normCurves['Value'] = (v - v.mean()) / v.std() ep.plotValues(penName, normCurves) return normCurves
def integralData(): """ Show area from selected pen """ if len(ep.EpmDatasetPens.SelectedPens) != 1: ep.showMsgBox(_g_DemoToolsCaption, _g_MissSinglePenTxt, _g_MissPensMsgType) return None epmData = ep.EpmDatasetPens.SelectedPens[0].Values from scipy import integrate curveArea = integrate.simps(epmData['Value']) message = 'Integral: {:.2f}' # use only for debugging print(message.format(curveArea)) ep.showMsgBox(_g_DemoToolsCaption, message.format(curveArea)) return curveArea
def statsInfos(): """ Show basic statistics from selected pen """ if len(ep.EpmDatasetPens.SelectedPens) != 1: ep.showMsgBox(_g_DemoToolsCaption, _g_MissSinglePenTxt, _g_MissPensMsgType) return None epmData = ep.EpmDatasetPens.SelectedPens[0].Values v = epmData['Value'] stats = v.mean(), v.std(), v.min(), v.max() message = 'Mean: {:.3f}\nStdDev: {:.3f}\nMinimum: {:.3f}\nMaximum {:.3f}' # use only for debugging print( message.format(*stats)) ep.showMsgBox(_g_DemoToolsCaption, message.format(*stats)) return stats
def removeMean(): """ Plot removed mean data from selected pen """ if len(ep.EpmDatasetPens.SelectedPens) != 1: ep.showMsgBox(_g_DemoToolsCaption, _g_MissSinglePenTxt, _g_MissPensMsgType) return None penName = ep.EpmDatasetPens.SelectedPens[0].Name + '_ZeroMean' epmData = ep.EpmDatasetPens.SelectedPens[0].Values rmMean = epmData.copy() v = epmData['Value'] rmMean['Value'] = v - v.mean() ep.plotValues(penName, rmMean) return rmMean
def sendData(self, thing, value): print "data : " , thing, value if "#" in self.parent.current_text.split(" ")[0]: plugins_list=[] for p in Plugins.get_plugin_names(): if str(self.parent.current_text.split(" ")[0]).lower().replace("#","") in p: plugins_list.append(p) if plugins_list: plugin_name=plugins_list[0] pl=Plugins.getCurrentPluginModule(plugin_name) try: pl.onDataSent(thing, value) except: print("[Duck Launcher] No 'onDataSent()' method present in the plugin.")
def __init__(self, host, port): """ Constructs an instance of DeadlineCon. Params: host name of the web service (string) port number the web service is listening on (integer) """ #Builds the ConnectionProperty object used for sending requests address = host + ":" + str(port) self.connectionProperties = ConnectionProperty(address) #The different request groups use the ConnectionProperty object to send their requests self.Jobs = Jobs.Jobs(self.connectionProperties) self.SlavesRenderingJob = SlavesRenderingJob.SlavesRenderingJob( self.connectionProperties) self.Tasks = Tasks.Tasks(self.connectionProperties) self.TaskReports = TaskReports.TaskReports(self.connectionProperties) self.JobReports = JobReports.JobReports(self.connectionProperties) self.LimitGroups = Limits.LimitGroups(self.connectionProperties) self.Pulse = Pulse.Pulse(self.connectionProperties) self.Repository = Repository.Repository(self.connectionProperties) self.MappedPaths = MappedPaths.MappedPaths(self.connectionProperties) self.MaximumPriority = MaximumPriority.MaximumPriority( self.connectionProperties) self.Pools = Pools.Pools(self.connectionProperties) self.Groups = Groups.Groups(self.connectionProperties) self.Plugins = Plugins.Plugins(self.connectionProperties) self.Slaves = Slaves.Slaves(self.connectionProperties) self.Users = Users.Users(self.connectionProperties) self.Balancer = Balancer.Balancer(self.connectionProperties)
def PolarScatterWindDirection(): """Grafico polar de dispersao da direcaodo vento Apresenta um grafico polar de dispersao com a direcao do vento """ if len(ep.EpmDatasetPens.SelectedPens) != 2: ep.showMsgBox('EPM Python Plugin - Demo Tools', 'Please select 2 interpolated pens before applying this function!', 'Warning') return 0 speed, direction = getSpeedDirectionValues(ep.EpmDatasetPens.SelectedPens[0], ep.EpmDatasetPens.SelectedPens[1]) ax1 = plt.subplot(111, polar=True) ax1.set_theta_zero_location('N') ax1.set_theta_direction(-1) ax1.grid(True) ax1.xaxis.set_ticklabels(['N',r"$45^{o}$",'E',r"$135^{o}$",'S',r"$225^{o}$",'W', r"$315^{o}$"]) ax1.set_title("Wind direction", va='bottom') ax1.plot(direction, speed, 'bo') plt.show()
def openList(self): res = [] splitext = os.path.splitext for filename, ordered, enabled in Plugins.buildPluginExecList(): if os.path.basename(filename) == '__init__.plug-in.py': continue name = splitext(splitext(os.path.basename(filename))[0])[0] if not enabled: name = splitext(name)[0] status = _('Disabled') imgIdx = EditorHelper.imgSystemObjDisabled else: fn = filename.lower() if Preferences.failedPlugins.has_key(fn): kind, msg = Preferences.failedPlugins[fn] if kind == 'Skipped': status = _('Skipped plug-in: %s')% msg imgIdx = EditorHelper.imgSystemObjPending else: status = _('Broken plug-in: %s')% msg imgIdx = EditorHelper.imgSystemObjBroken elif fn in Preferences.installedPlugins: if ordered: status = _('Installed, ordered') imgIdx = EditorHelper.imgSystemObjOrdered else: status = _('Installed') imgIdx = EditorHelper.imgSystemObj else: status = _('Pending restart') imgIdx = EditorHelper.imgSystemObjPending res.append(PluginFileExplNode(name, enabled, status, filename, imgIdx)) return res
def cbPluginList(self, widget): text = Plugins.plugininfo() msg = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_CLOSE, text) msg.run() msg.destroy()
def deltasData(): """ Plot deltas from selected pen """ if len(ep.EpmDatasetPens.SelectedPens) != 1: ep.showMsgBox(_g_DemoToolsCaption, _g_MissSinglePenTxt, _g_MissPensMsgType) return None penName = ep.EpmDatasetPens.SelectedPens[0].Name + '_Delta' epmData = ep.EpmDatasetPens.SelectedPens[0].Values deltaCurves = epmData.copy() v = epmData['Value'] delta = v[1:] - v[:-1] deltaValues = deltaCurves['Value'] deltaValues[0] = 0 deltaValues[1:] = delta ep.plotValues(penName, deltaCurves) return deltaCurves
def changeOrder(self, direction): section = getPluginSection(self.resourcepath) #initPluginPath = os.path.dirname(self.resourcepath) ordered, disabled = Plugins.readPluginsState(section) #ordered = initPluginGlobals['__ordered__'] try: idx = ordered.index(self.name) except ValueError: idx = len(ordered) + 1 else: del ordered[idx] idx = max(idx + direction, 0) if idx <= len(ordered): ordered.insert(idx, self.name) #Plugins.writeInitPluginGlobals(initPluginPath, initPluginGlobals) Plugins.writePluginsState(section, ordered, disabled)
def changeOrder(self, direction): section = getPluginSection(self.resourcepath) #initPluginPath = os.path.dirname(self.resourcepath) ordered, disabled = Plugins.readPluginsState(section) #ordered = initPluginGlobals['__ordered__'] try: idx = ordered.index(self.name) except ValueError: idx = len(ordered)+1 else: del ordered[idx] idx = max(idx + direction, 0) if idx <= len(ordered): ordered.insert(idx, self.name) #Plugins.writeInitPluginGlobals(initPluginPath, initPluginGlobals) Plugins.writePluginsState(section, ordered, disabled)
def initPalette(self, inspector, editor): self.inspector = inspector self.editor = editor if Preferences.paletteStyle == 'menu': mb = self.menuBar else: mb = None # XXX Set these from class if not hasattr(sys, 'cyclops'): # 'New' page palettePage = NewPalettePage(self.palette, PaletteStore.newPalette[0], 'Images/Palette/', self, self.widgetSet, self) for modelName in PaletteStore.paletteLists['New']: palettePage.addButton2(modelName, PaletteStore.newControllers[modelName], wx.lib.buttons.GenBitmapButton) if mb: mb.Append(menu=palettePage.menu, title=PaletteStore.newPalette[0]) self.palettePages.append(palettePage) # Normal control pages for palette in PaletteStore.palette: palettePage = PalettePage(self.palette, palette[0], 'Images/Palette/', self, self.widgetSet, self.componentSB, self) palettePage.addToggleBitmaps(palette[2], None, None) self.palettePages.append(palettePage) if mb: mb.Append(menu=palettePage.menu, title=palette[0]) # Dialog page ## if PaletteStore.dialogPalette[2]: ## self.dialogPalettePage = PanelPalettePage(self.palette, ## PaletteStore.dialogPalette[0], ## 'Images/Palette/', self, self.widgetSet, ## self.componentSB, self) ## for dialog in PaletteStore.dialogPalette[2]: ## self.dialogPalettePage.addButton( ## PaletteStore.compInfo[dialog][0], ## dialog, PaletteStore.compInfo[dialog][1], ## self.OnDialogPaletteClick, None, None, ## wx.lib.buttons.GenBitmapButton) ## self.palettePages.append(self.dialogPalettePage) ## if mb: mb.Append(menu=self.dialogPalettePage.menu, ## title=PaletteStore.dialogPalette[0]) # Zope page if Plugins.transportInstalled('ZopeLib.ZopeExplorer'): self.zopePalettePage = ZopePalettePage(self.palette, PaletteStore.zopePalette[0], 'Images/Palette/', self, self.widgetSet, self.componentSB, self) self.zopePalettePage.addToggleBitmaps( PaletteStore.zopePalette[2], None, None) self.palettePages.append(self.zopePalettePage) if mb: mb.Append(menu=self.zopePalettePage.menu, title=PaletteStore.zopePalette[0]) else: palettePage = None
def sendData(self, thing, value): print "data : ", thing, value if "#" in self.parent.current_text.split(" ")[0]: plugins_list = [] for p in Plugins.get_plugin_names(): if str(self.parent.current_text.split(" ")[0]).lower().replace( "#", "") in p: plugins_list.append(p) if plugins_list: plugin_name = plugins_list[0] pl = Plugins.getCurrentPluginModule(plugin_name) try: pl.onDataSent(thing, value) except: print( "[Duck Launcher] No 'onDataSent()' method present in the plugin." )
def PolarScatterAreaWind(): """Grafico polar de dispersao-area da direcao, velocidade e potencia do vento Apresenta um grafico polar de dispersao com a direcao, a velocidade e potencia do vento """ if len(ep.EpmDatasetPens.SelectedPens) != 3: ep.showMsgBox('EPM Python Plugin - Demo Tools', 'Please select 3 interpolated pens before applying this function!', 'Warning') return 0 speed, direction, power = getSpeedPowerDirectionValues(ep.EpmDatasetPens.SelectedPens[0], ep.EpmDatasetPens.SelectedPens[1], ep.EpmDatasetPens.SelectedPens[2]) colors = power/1000. area = np.pi * speed**2 ax1 = plt.subplot(111, polar=True) ax1.set_theta_zero_location('N') ax1.set_theta_direction(-1) ax1.xaxis.set_ticklabels(['N',r"$45^{o}$",'E',r"$135^{o}$",'S',r"$225^{o}$",'W', r"$315^{o}$"]) c = plt.scatter(direction, speed, c=colors, s=area, cmap=plt.cm.hsv) c.set_alpha(0.75) plt.show()
def Search(query, color=None, font=None): static = "/media/mark/Storage/python/Launcher/current/plugins/plugins/" s = str(open("{}plugins.html".format(static), "r").read()) rep = Plugins.Repo() plugins = rep.getFirst50() t = Template(s) return t.render(font=font, static="file://{}".format(static), plugins=plugins)
def thirtyDaysProfilePlugin(): """ Gera uma superfície para avaliar a variação diária e ao longo do mês (30 dias). Dados devem corresponder a uma consulta com 30 dias e serem interpolados (ProcessingInterval < 1h). """ if len(ep.EpmDatasetPens.SelectedPens) != 1: ep.showMsgBox('EPM Python Plugin - Demo Power', 'Please select a single pen before applying this function!', 'Warning') return 0 epmData = ep.EpmDatasetPens.SelectedPens[0].Values sampling = 30 pHours = 24 iniPeriod = epmData['Timestamp'][0] endPeriod = epmData['Timestamp'][-1] dTotal = endPeriod - iniPeriod totDays = dTotal.days evalPeriod = dt.timedelta(hours = pHours) nextPeriod = iniPeriod + evalPeriod profileList = [] for i in range(totDays+1): iniP = epmData['Timestamp'] >= iniPeriod endP = epmData['Timestamp'] < nextPeriod epmDataValue = epmData['Value'] dataPeriod = epmDataValue[iniP * endP] profileList.append( dataPeriod ) iniPeriod = iniPeriod + dt.timedelta( 1 ) nextPeriod = iniPeriod + evalPeriod profileMatrix = np.array(profileList) days = np.arange(totDays)+1 hours = np.arange(0,pHours*60,sampling) meshTime, indices = np.meshgrid(hours, days) meshProfile = np.zeros(meshTime.shape) for i in range( indices.shape[0] ): for j in range( indices.shape[1] ): meshProfile[i,j] = profileMatrix[i,j] fig = plt.figure(figsize=(15, 8)) ax = fig.gca(projection='3d') X = meshTime Y = indices Z = meshProfile ax.plot_surface(X/60., Y, Z, rstride=1, cstride=1, cmap='coolwarm', alpha=0.8) ax.set_xlabel('hour') ax.set_ylabel('day') ax.set_zlabel('Power') plt.show()
def xyzScatter3DPlugin(): """ Apresenta gráficos de dispersão comparando 3 variáves entre si duas a duas e as 3 simultaneamente. Os dados das 3 variáveis devem estar igualmente espaçados. """ if len(ep.EpmDatasetPens.SelectedPens) != 3: ep.showMsgBox('EPM Python Plugin - Demo Power', 'Please select 3 pens before applying this function!', 'Warning') return 0 epmDataX = ep.EpmDatasetPens.SelectedPens[0].Values['Value'] Xlabel = ep.EpmDatasetPens.SelectedPens[0].Name epmDataY = ep.EpmDatasetPens.SelectedPens[1].Values['Value'] Ylabel = ep.EpmDatasetPens.SelectedPens[1].Name epmDataZ = ep.EpmDatasetPens.SelectedPens[2].Values['Value'] Zlabel = ep.EpmDatasetPens.SelectedPens[2].Name fig = plt.figure(figsize=(15, 8)) ax1 = plt.subplot2grid((3, 3), (0, 0)) ax2 = plt.subplot2grid((3, 3), (0, 1)) ax3 = plt.subplot2grid((3, 3), (0, 2)) ax4 = plt.subplot2grid((3, 3), (1, 0), colspan=3, rowspan=3, projection='3d') x = (epmDataX - epmDataX.mean()) / epmDataX.std() y = (epmDataY - epmDataY.mean()) / epmDataY.std() z = (epmDataZ - epmDataZ.mean()) / epmDataZ.std() ax1.scatter(x, y) ax1.set_xlabel(Xlabel, fontsize=10) ax1.set_ylabel(Ylabel, fontsize=10) ax2.scatter(x, z) ax2.set_xlabel(Xlabel, fontsize=10) ax2.set_ylabel(Zlabel, fontsize=10) ax3.scatter(y, z) ax3.set_xlabel(Ylabel, fontsize=10) ax3.set_ylabel(Zlabel, fontsize=10) #ax4.scatter(x, y, z, cmap='hot') ax4.scatter(x, y, z) ax4.set_xlabel(Xlabel, fontsize=10) ax4.set_ylabel(Ylabel, fontsize=10) ax4.set_zlabel(Zlabel, fontsize=10) plt.tight_layout(pad=0.5, w_pad=0.5, h_pad=1.0) plt.show()
def PowerCurve3d(): """Grafico de dispersão em 3D""" if len(ep.EpmDatasetPens.SelectedPens) != 3: ep.showMsgBox('EPM Python Plugin - Demo Tools', 'Please select 3 interpolated pens before applying this function!', 'Warning') return 0 speed, direction, power = getSpeedPowerDirectionValues(ep.EpmDatasetPens.SelectedPens[0], ep.EpmDatasetPens.SelectedPens[1], ep.EpmDatasetPens.SelectedPens[2]) fig = plt.figure() ax = fig.add_subplot(111, projection='3d') c = np.abs(speed) cmwinter = plt.get_cmap("winter") ax.scatter(speed, direction, power, c=c, cmap=cmwinter) ax.set_xlabel('Power (KW)') ax.set_ylabel('Direction') ax.set_zlabel('Speed (m/s)') plt.show()
def __init__(self): ConfigWrapper.__init__(self, Keys.Plugin.main_dir) self.__plugins = self.client.get_list(Keys.Plugin.pluginlist, gconf.VALUE_STRING) for plugin in self.__plugins: try: p = Plugins.load(plugin, self) p.init() except ImportError, e: print "Unable to load plugin", plugin
def PolarBarWind(): """Grafico de polar de barras da direcao, velocidade e potencia do vento Apresenta um grafico polar de dispersao com a direcao, a velocidade e potencia do vento """ if len(ep.EpmDatasetPens.SelectedPens) != 3: ep.showMsgBox('EPM Python Plugin - Demo Tools', 'Please select 3 interpolated pens before applying this function!', 'Warning') return 0 speed, direction, power = getSpeedPowerDirectionValues(ep.EpmDatasetPens.SelectedPens[0], ep.EpmDatasetPens.SelectedPens[1], ep.EpmDatasetPens.SelectedPens[2]) spd4, dir4, pow4 = groupByDirection(speed, direction, power) width = pow4/1000. ax1 = plt.subplot(111, polar=True) ax1.set_theta_zero_location('N') ax1.set_theta_direction(-1) ax1.xaxis.set_ticklabels(['N',r"$45^{o}$",'E',r"$135^{o}$",'S',r"$225^{o}$",'W', r"$315^{o}$"]) bars = ax1.bar(dir4, spd4, width=width, bottom=0.0) for r, bar in zip(spd4, bars): bar.set_facecolor(plt.cm.jet(r / 10.)) bar.set_alpha(0.5) plt.show()
def suplierSpeedPowerChart(): """Grafico de potencia com a velocidade do vento comparada com a cruva do fornecedor em um arquivo CSV Apresenta um grafico de dispersao da potencia com a velocidade do vento, calculan a curva que melhor o representa e compara com a curva de referencia fornecida pelo fornecedor """ if len(ep.EpmDatasetPens.SelectedPens) != 2: ep.showMsgBox('EPM Python Plugin - Demo Tools', 'Please select two interpolated pens before applying this function!', 'Warning') return 0 global minSpeed global nominalPower global supplierCurveFile runDialogMinSpeedNomPowerSupplier() minSpeed = float(minSpeed) nominalPower = float(nominalPower) rawSpeed, rawPower = getSpeedPowerValues(ep.EpmDatasetPens.SelectedPens[0], ep.EpmDatasetPens.SelectedPens[1]) speed, power = cleanSpeedPowerData(rawSpeed, rawPower, minSpeed, nominalPower ) xm, ym = windPowerAverage(speed, power) par0 = [1.0, 1.0, 1500.0, 1.0] binSpeed = 0.5 parest,cov,infodict,mesg,ier = optimize.leastsq(residualsSPPn4, par0, args=(xm, ym), full_output=True) xEst = np.arange(xm.min(), xm.max(), binSpeed) yEst = powerFitPn4(parest, xEst) posAbove = np.argwhere(yEst > nominalPower) yEst[posAbove] = nominalPower speedRef, powerRef = readFromCsv(fileName=supplierCurveFile, delimiter=';') tckRef = interpolate.splrep(speedRef, powerRef, s=0) binSpeed = 0.5 xRef = np.arange(speedRef.min(), speedRef.max(), binSpeed) yRef = interpolate.splev(xRef, tckRef, der=0) energyLost = integrate.simps(yRef, dx=binSpeed) - integrate.simps(yEst, dx=binSpeed) fig1 = plt.figure() ax1 = fig1.add_subplot(1, 1, 1) ax1.set_ylim(0, 1.05*nominalPower) ax1.set_xlim(minSpeed-1, 1.1*speed.max()) ax1.set_xlabel(r'$Speed (m/s)$') ax1.set_ylabel(r'$Power (KW)$') ax1.scatter(speed, power) ax1.plot(xEst, yEst, color='r', linewidth=3) ax1.plot(xRef, yRef, color='g', linewidth=3) ax1.text(15, 1100, 'Lost: ' + str(round(energyLost/1000,2)) + '(MW)', fontsize=14) plt.show()
def plotGetRetangle(): """ Get area selection from selected pen """ if len(ep.EpmDatasetPens.SelectedPens) != 1: ep.showMsgBox(_g_DemoToolsCaption, _g_MissSinglePenTxt, _g_MissPensMsgType) return None epmData = ep.EpmDatasetPens.SelectedPens[0].Values y = epmData['Value'].copy() x = np.arange(len(y)) from matplotlib.pylab import show, subplots, plot, figure, connect fig, current_ax = subplots() plot(x, y, lw=2, c='g', alpha=.3) selRect = [] def line_select_callback(eclick, erelease): # eclick and erelease are the press and release events x1, y1 = eclick.xdata, eclick.ydata x2, y2 = erelease.xdata, erelease.ydata print "\n({:3.3f}, {:3.3f}) --> ({:3.3f}, {:3.3f})".format( x1, y1, x2, y2) selRect.append((int(x1), y1, int(x2), y2)) def toggle_selector(event): if event.key in ['Q', 'q'] and toggle_selector.RS.active: toggle_selector.RS.set_active(False) if event.key in ['A', 'a'] and not toggle_selector.RS.active: toggle_selector.RS.set_active(True) from matplotlib.widgets import RectangleSelector toggle_selector.RS = RectangleSelector(current_ax, line_select_callback, drawtype='box', useblit=True, button=[1, 3], minspanx=5, minspany=5, spancoords='pixels') connect('key_press_event', toggle_selector) show() return selRect
def rmNanAndOutliers(): """ Plot without NAN and outliers from selected pen """ if len(ep.EpmDatasetPens.SelectedPens) < 1: ep.showMsgBox(_g_DemoToolsCaption, _g_MissSinglePenTxt, _g_MissPensMsgType) return None penName = ep.EpmDatasetPens.SelectedPens[0].Name + '_NoOutliers' epmData = ep.EpmDatasetPens.SelectedPens[0].Values t = epmData['Timestamp'] v = epmData['Value'] def _clearNANs(v, t): """ Deletes all NANs v: array of double values t: array of datetimes """ nanPos = np.argwhere(np.isnan(v)) v, t = np.delete(v, nanPos), np.delete(t, nanPos) return v, t def _clearOutliers(v, t, maxStdDevs=6): """ Deletes all outliers v: array of double values t: array of datetimes maxStdDevs: cut-off limit for outliers (six-sigma by default) """ smean = v.mean() s3 = np.floor(v.std() * maxStdDevs) outliers = np.argwhere(v < smean - s3) v, t = np.delete(v, outliers), np.delete(t, outliers) outliers = np.argwhere(v > smean + s3) v, t = np.delete(v, outliers), np.delete(t, outliers) return v, t v, t = _clearNANs(v, t) v, t = _clearOutliers(v, t) noOutsNans = _vta2epm(v, t) ep.plotValues(penName, noOutsNans) return noOutsNans
def xyzScatter3DPlugin(): """ Apresenta gráficos de dispersão comparando 3 variáves entre si duas a duas e as 3 simultaneamente. Os dados das 3 variáveis devem estar igualmente espaçados. """ if len(ep.EpmDatasetPens.SelectedPens) != 3: ep.showMsgBox('EPM Python Plugin - Demo Power', 'Please select 3 pens before applying this function!', 'Warning') return 0 epmDataX = ep.EpmDatasetPens.SelectedPens[0].Values['Value'] Xlabel = ep.EpmDatasetPens.SelectedPens[0].Name epmDataY = ep.EpmDatasetPens.SelectedPens[1].Values['Value'] Ylabel = ep.EpmDatasetPens.SelectedPens[1].Name epmDataZ = ep.EpmDatasetPens.SelectedPens[2].Values['Value'] Zlabel = ep.EpmDatasetPens.SelectedPens[2].Name fig = plt.figure(figsize=(15, 8)) ax1 = plt.subplot2grid((3, 3), (0, 0)) ax2 = plt.subplot2grid((3, 3), (0, 1)) ax3 = plt.subplot2grid((3, 3), (0, 2)) ax4 = plt.subplot2grid((3, 3), (1, 0), colspan=3, rowspan=3, projection='3d') x = (epmDataX-epmDataX.mean())/epmDataX.std() y = (epmDataY-epmDataY.mean())/epmDataY.std() z = (epmDataZ-epmDataZ.mean())/epmDataZ.std() ax1.scatter(x, y) ax1.set_xlabel(Xlabel, fontsize=10) ax1.set_ylabel(Ylabel, fontsize=10) ax2.scatter(x, z) ax2.set_xlabel(Xlabel, fontsize=10) ax2.set_ylabel(Zlabel, fontsize=10) ax3.scatter(y, z) ax3.set_xlabel(Ylabel, fontsize=10) ax3.set_ylabel(Zlabel, fontsize=10) #ax4.scatter(x, y, z, cmap='hot') ax4.scatter(x, y, z) ax4.set_xlabel(Xlabel, fontsize=10) ax4.set_ylabel(Ylabel, fontsize=10) ax4.set_zlabel(Zlabel, fontsize=10) plt.tight_layout(pad=0.5, w_pad=0.5, h_pad=1.0) plt.show()
def ExpectedProduction(): if len(ep.EpmDatasetPens.SelectedPens) != 2: ep.showMsgBox('EPM Python Plugin - Demo Tools', 'Please select Power and Speed pens before applying this function!', 'Warning') return 0 global minSpeed global nominalPower global supplierCurveFile runDialogMinSpeedNomPowerSupplier() minSpeed = float(minSpeed) nominalPower = float(nominalPower) rawSpeed, rawPower = getSpeedPowerValues(ep.EpmDatasetPens.SelectedPens[0], ep.EpmDatasetPens.SelectedPens[1]) speed, power = cleanSpeedPowerData(rawSpeed, rawPower, minSpeed, nominalPower ) speedRef, powerRef = readFromCsv(fileName=supplierCurveFile, delimiter=';') #idx = [] #for item in speed: # idx.append(find_nearest(speedRef, item) idx = [find_nearest(speedRef, item) for item in speed] expected = [powerRef[index] for index in idx] #TODO: Calculo de perdas #lost = sum(expected - power) #print lost fig, ax = plt.subplots() line1 = ax.plot(power, label='Realized') line2 = ax.plot(expected, label='Expected') plt.ylabel('Power (Kw)') plt.xlabel('Time Unit') ax.legend(loc='lower right') plt.show()
def plotGetSelection(): """ Get data range from selected pen """ if len(ep.EpmDatasetPens.SelectedPens) != 1: ep.showMsgBox(_g_DemoToolsCaption, _g_MissSinglePenTxt, _g_MissPensMsgType) return None epmData = ep.EpmDatasetPens.SelectedPens[0].Values y = epmData['Value'].copy() x = np.arange(len(y)) from matplotlib.pylab import show, subplots, plot, figure, connect fig = figure(figsize=(8,6)) ax = fig.add_subplot(211, axisbg='#FFFFCC') ax.plot(x, y, '-') ax.set_title('Press left mouse button and drag to test') ax2 = fig.add_subplot(212, axisbg='#FFFFCC') line2, = ax2.plot(x, y, '-') selData = [] def onselect(xmin, xmax): selData.append([xmin, xmax]) indmin, indmax = np.searchsorted(x, (xmin, xmax)) indmax = min(len(x)-1, indmax) thisx = x[indmin:indmax] thisy = y[indmin:indmax] line2.set_data(thisx, thisy) ax2.set_xlim(thisx[0], thisx[-1]) ax2.set_ylim(thisy.min(), thisy.max()) fig.canvas.draw() from matplotlib.widgets import SpanSelector span = SpanSelector( ax, onselect, 'horizontal', useblit=True, rectprops = dict(alpha=0.5, facecolor='red') ) show() return selData
def load_plugins(self): loading_window = AFXLoadingWindow() loading_window.show() loading_window.update_status("Loading plugins...") print "\nLoading plugins..." import Plugins Plugins.loading_window = loading_window Plugins.load_plugins() #for mod in Modules.plugin_list: # loading_window.update_status("Loading: %s" % mod.short_name) loading_window.update_status("Initializing main view...") self.main_window.plugin_view = AFXView(Plugins) self.main_window.add(self.main_window.plugin_view) self.main_window.plugin_view.show() loading_window.destroy(None)
def plotGetPoints(): """ Get data points from selected pen """ if len(ep.EpmDatasetPens.SelectedPens) != 1: ep.showMsgBox(_g_DemoToolsCaption, _g_MissSinglePenTxt, _g_MissPensMsgType) return None epmData = ep.EpmDatasetPens.SelectedPens[0].Values y = epmData['Value'].copy() x = np.arange(len(y)) from matplotlib.pylab import show, subplots, plot, figure, connect fig = figure(figsize=(8, 6)) ax = fig.add_subplot(111, axisbg='#FFFFFF') ax.plot(x, y, '-o') selPoints = [] def onclick(event): selPoints.append((event.xdata, event.ydata)) from matplotlib.widgets import Cursor cursor = Cursor(ax, useblit=True, color='red', linewidth=1) cid = fig.canvas.mpl_connect('button_press_event', onclick) show() return selPoints
def openPyInterpChooser(editor): dlg = PyInterpreterChooserDlg(editor, Preferences.pythonInterpreterPath) try: if dlg.ShowModal() != wx.ID_OK: return pyIntpPath = dlg.txtPyIntpPath.GetValue() if pyIntpPath != Preferences.pythonInterpreterPath: Plugins.updateRcFile('prefs.rc.py', 'pythonInterpreterPath', `pyIntpPath`) for ver, path in dlg.installedPaths: if path == pyIntpPath: break else: for path in Preferences.picExtraPaths: if path == pyIntpPath: break else: Plugins.updateRcFile('prefs.plug-ins.rc.py', 'picExtraPaths', `Preferences.picExtraPaths+[pyIntpPath]`) finally: dlg.Destroy()
def fiveDaysProfilePlugin(): """ Gráfico de área do perfil diário médio da variável a partir de dados de 5 dias. Dados devem corresponder a uma consulta de 5 dias (úteis) com valores médios a cada hora. """ if len(ep.EpmDatasetPens.SelectedPens) != 1: ep.showMsgBox('EPM Python Plugin - Demo Power', 'Please select a single pen before applying this function!', 'Warning') return 0 def cc(arg): return colorConverter.to_rgba(arg, alpha=0.6) epmDataValue = ep.EpmDatasetPens.SelectedPens[0].Values['Value'] epmAvg = np.vstack((epmDataValue[0:24], epmDataValue[24:2*24], epmDataValue[2*24:3*24], epmDataValue[3*24:4*24], epmDataValue[4*24:5*24])) epmAvg = epmAvg.mean(axis=0) epmAvg[0], epmAvg[-1] = 0,0 ys = np.arange(1, 25) zs = [0., 1., 2., 3., 4., 5.] profileList = [] profileList.append( list(zip(ys, epmAvg))) ini = 0 end = 24 for i in range(5): dataPeriod = epmDataValue[ini:end] dataPeriod[0], dataPeriod[-1] = 0,0 profileList.append( list(zip(ys, dataPeriod))) ini += 24 end += 24 poly = PolyCollection(profileList, facecolors=[cc('k'), cc('r'), cc('g'), cc('b'), cc('y'), cc('c')]) fig = plt.figure(figsize=(15, 8)) ax = fig.gca(projection='3d') poly.set_alpha(0.7) ax.add_collection3d(poly, zs=zs, zdir='y') ax.set_xlabel('hour') ax.set_xlim3d(1, 24) ax.set_ylabel('day') ax.set_ylim3d(-1, 6) ax.set_zlabel('power') ax.set_zlim3d(epmDataValue.min(), epmDataValue.max()) plt.show()
def keyPressEvent(self, e): if e.key()==QtCore.Qt.Key_Backspace: if self.parent.plugin==False: self.parent.current_text=self.parent.current_text[:-1] self.parent.allApps=Apps.info(str(self.parent.current_text)) self.parent.webview.page().mainFrame().evaluateJavaScript("setNewApps({})".format(self.parent.allApps)) self.parent.update() elif e.key()==QtCore.Qt.Key_Return: if len(self.parent.allApps)==1: a=self.parent.allApps[0] print("[Duck Launcher] Launching '{0}' with '{1}'".format(a["name"], a["exec"]) ) thread = Launch(parent=self.parent) thread.app=a["exec"] thread.start() self.parent.close_it() self.parent.current_text='' self.parent.allApps=Apps.find_info('') html= Plugins.get(str(self.parent.current_text),color=(self.parent.conf["r"],self.parent.conf["g"],self.parent.conf["b"]),font=self.parent.conf["font"]) if html!=None: self.parent.webview.load(QtCore.QUrl(html)) self.parent.webview.show() self.parent.plugin=True self.parent.webview.page().mainFrame().setFocus() self.parent.webview.setFocus() self.update() elif e.key()==16777216: #ESC self.parent.current_text="" self.parent.allApps=Apps.info(str(self.parent.current_text)) self.parent.webview.page().mainFrame().evaluateJavaScript("setNewApps({})".format(self.parent.allApps)) self.parent.initApps() elif e.text()!='': self.parent.current_text+=e.text() self.parent.allApps=Apps.info(str(self.parent.current_text)) self.parent.webview.page().mainFrame().evaluateJavaScript("setNewApps({})".format(self.parent.allApps)) self.parent.update() else: if e.key()==16777250: if self.parent.current_state=="half_open": self.parent.activity="apps" self.parent.current_text='' self.parent.allApps=Apps.info('') self.parent.initApps() self.parent.open_it() elif self.parent.current_state=="open": self.parent.close_it() self.parent.update()
finally: dlg.Destroy() ''' class MessageDialogCDC(MessagedCDC): def body(self): return '''dlg = wx.MessageDialog(self, 'Message', 'Caption', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() ''' #------------------------------------------------------------------------------- import Plugins Plugins.registerComponents('Dialogs', (wx.FontDialog, 'wx.FontDialog', FontDialogCDC), (wx.FileDialog, 'wx.FileDialog', FileDialogCDC), (wx.PrintDialog, 'wx.PrintDialog', PrintDialogCDC), (wx.PageSetupDialog, 'wx.PageSetupDialog', PageSetupDialogCDC), (wx.DirDialog, 'wx.DirDialog', DirDialogCDC), (wx.SingleChoiceDialog, 'wx.SingleChoiceDialog', SingleChoiceDialogCDC), (wx.TextEntryDialog, 'wx.TextEntryDialog', TextEntryDialogCDC), (wx.MessageDialog, 'wx.MessageDialog', MessageDialogCDC), )
def writeImports(self): return 'import wx.lib.dragscroller' #------------------------------------------------------------------------------- def getDragScrollerData(): return \ '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x18\x00\x00\x00\x18\x08\x06\ \x00\x00\x00\xe0w=\xf8\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\ \x01QIDATH\x89\xb5V\xdb\x8d\xc3 \x10\x9c\x05\x17\xe0\x94c+i\xc0R\xaa\x8d\xe4\ \xcf\xdc\x87-(\xc7\x15$s\x1f\xb9\xe50\x81\xe0\\\xce+!\xc0Z\xcd\xb0\xb3\x0fY\ \xc4X\xeci\r\x00\xf0~\xe3\x1e\xe0b\xac4zq\x93\xfb\x08\xac?\xf5 \x1f\xef\xf4\ \xb3G\x7f\xea\x01\x00\xe6\x1d\x90\xe1<T}Ddu\xdfL0\x9c\x07\x8c\x97\xf1%\x89\ \x9f=\xdc\xe4p\xfd\xba\x86oM\xd1;\x03\xde\x1d\xbb@2^\xc6\'?\x95%\xb6j\x04\ \xfa\xe2\xe1<\xe0p8\xac\xee\xa9\x91\x84\x9b\\\xc8E\x95@A\xc6\xcb\x18^\x1c\ \x9fS\x12?{t\xc7\x0e~\xf6u\x82\x92\x0c\xb1\xa59Q\xf0\xee\xd8\xfd:\xfd4\x1a\ \xdd\xe4\xc2j\xdb\x96nr$\xc9\xb6m\x8b\x8bd\xf0W\x0c\xfd\x06\x80bl\x9e &\xd1\ \xbdt\xd6\x1d@\x00\xe7#\t\x14c\xcb\x12\xd5J2\'c.\x07"\xc6\x82\xf7\x1bK\x9d\ \xfc\x8a$\x06\xd7NV\x12\x11\x81\x18+\xd52\x8d\xabgY\x96\xd5=\xb5?E\x10G\xf2n\ \x93m\x8a \x8e\xa4V\xba$C\xb3\xa9\xbd5\xecj}\x01|0\xec\xb6Xn\xd8\x85\x1c\xfc\ \'Q\x00\x8fs\x90\xea\xa7C+\xb7\x97\xfc\xe3\xa5\xb6\x92(\xd6/\x9e+\xe9\x9e\ \xf3/Y H\xf5+\x81k\x8d\xe7\xf4\xce\xca\xb4w\x0ed\xef\xdf\x96o\x88zW)\xc2N\ \xbe\xfb\x00\x00\x00\x00IEND\xaeB`\x82' Plugins.registerComponent('Library', wx.lib.dragscroller.DragScroller, 'wx.lib.dragscroller.DragScroller', DragScrollerDTC) Preferences.IS.registerImage('Images/Palette/wx.lib.dragscroller.DragScroller.png', getDragScrollerData())
def designTimeSource(self, position = 'wx.DefaultPosition', size = 'wx.DefaultSize'): return {'pos': position, 'size': size, 'style': 'wx.DIRP_DEFAULT_STYLE', 'path': "''", 'message': "'Select a folder'", 'wildcard': "'*.*'", 'name': `self.name`} #------------------------------------------------------------------------------- import Plugins Plugins.registerPalettePage('Buttons', _('Buttons')) Plugins.registerComponents('Buttons', (wx.Button, 'wx.Button', ButtonDTC), (wx.BitmapButton, 'wx.BitmapButton', BitmapButtonDTC), (wx.SpinButton, 'wx.SpinButton', SpinButtonDTC), (wx.SpinCtrl, 'wx.SpinCtrl', SpinCtrlDTC), (wx.lib.buttons.GenButton, 'wx.lib.buttons.GenButton', GenButtonDTC), (wx.lib.buttons.GenBitmapButton, 'wx.lib.buttons.GenBitmapButton', GenBitmapButtonDTC), (wx.lib.buttons.GenToggleButton, 'wx.lib.buttons.GenToggleButton', GenToggleButtonDTC), (wx.lib.buttons.GenBitmapToggleButton, 'wx.lib.buttons.GenBitmapToggleButton', GenBitmapToggleButtonDTC), (wx.lib.buttons.GenBitmapTextButton, 'wx.lib.buttons.GenBitmapTextButton', GenBitmapTextButtonDTC), (wx.lib.buttons.GenBitmapTextToggleButton, 'wx.lib.buttons.GenBitmapTextToggleButton', GenBitmapTextToggleButtonDTC), (wx.ContextHelpButton, 'wx.ContextHelpButton', ContextHelpButtonDTC), ) try:
def hideDesignTime(self): return FramePanelDTC.hideDesignTime(self) + ['Position', 'Size', 'ClientSize'] class WizardPageSimpleDTC(FramePanelDTC): defFrameSize = wx.Size(*wizardPageSize) defFrameStyle = wizardFrameStyle suppressWindowId = True def __init__(self, name, designer, frameCtrl): FramePanelDTC.__init__(self, name, designer, frameCtrl) def constructor(self): return {'Previous': 'prev', 'Next': 'next'} def designTimeSource(self): return {'prev': 'None', 'next': 'None'} def hideDesignTime(self): return FramePanelDTC.hideDesignTime(self) + ['Position', 'Size', 'ClientSize'] #------------------------------------------------------------------------------- import Plugins Plugins.registerComponents(None, (wx.wizard.Wizard, 'wx.wizard.Wizard', WizardDTC), (wx.wizard.PyWizardPage, 'wx.wizard.PyWizardPage', PyWizardPageDTC), (wx.wizard.WizardPageSimple, 'wx.wizard.WizardPageSimple', WizardPageSimpleDTC), )
editor.openOrGotoModule(os.path.join(filename, '__init__.py')) elif type in (imp.PY_SOURCE, imp.C_EXTENSION): editor.openOrGotoModule(filename) return finally: dlg.Destroy() if wx.Platform == '__WXMSW__': keyIdent = 'ModuleFinder' Preferences.keyDefs[keyIdent] = (wx.ACCEL_ALT, ord('M'), 'Alt-M') else: keyIdent = '' import Plugins Plugins.registerTool(_('Module finder'), openModuleFinder, 'Images/ModuleFinder.png', keyIdent) #------------------------------------------------------------------------------- def getModuleFinderImgData(): return \ '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\ \x00\x00\x00\x1f\xf3\xffa\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\ \x00\x01\x1aIDATx\x9c\xa5\x93]j\xc30\x10\x84?\x95\x1c@\xd7\xf1\x12\x08\xd5\ \x89J\xf0[J\x7f\xc2\xe6-\x94\x9eH\x10\x12\xd6\xd7\xc9\x01\n\xdb\x07[\x8a\x9d\ \xba$\xa5\x0bb\xd7\x1efX\xcd\xa0\x10c\xe4?\xb5(C\xbbn\xfd\x1a\xdc\x7f\xec\ \xc3]\x02\xed\xba\xf5\xf4\x98\x90\xa5`\'\xab\x1d\xf0["\x8b\xdf\xc8\xb2\x14\ \x8c^d\x8eX\x85u\xab>.;\x9a\xab\xaa\xab\xaa\x03\xae:\xc5\xdd\xddu\xdbc1\xc6\ \x8b\x00N%\xfb\xf0\xc7\xdd\xabH\xc1q&\x02\xd5D;\x19\xf9\x90\xd9l6@\x00\x9c\ \x00\x98\x19"\x82\xad.\xd7\xcb\xe4z\x95\x872\xc8R\x86\xa9\x90\x03\xd6uH\xd3T\ \xbcx3\xae*0\xb8>"\x1b\xd24X\xd7U|\x94\xce\xfc\x06i\x95\xd8\xedv\x13\xb2\x88\