[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: geda_manager.git: branch: master updated (895308418f34abe748e161245b1592840530f538)
The branch, master has been updated
via 895308418f34abe748e161245b1592840530f538 (commit)
from 809d6f20259582f970e57cb521a2706d26c187a5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/gui/Preferences.py | 12 ++--
src/gui/xml/folder_popup.xml | 2 +-
src/utils/Callbacks.py | 29 ++++++--
src/utils/Helpers.py | 163 ++++++++++++++++++++++++++++++++++++------
src/utils/Icons.py | 11 +++-
src/utils/Settings.py | 34 +++++-----
6 files changed, 196 insertions(+), 55 deletions(-)
=================
Commit Messages
=================
commit 895308418f34abe748e161245b1592840530f538
Author: Newell Jensen <jensen@xxxxxxxxxxxxxxxx>
Date: Fri Dec 26 01:45:41 2008 -0800
Added some more functionality to command flags in
the Preferences window and tying this together with
the Processes window.
:100644 100644 1140ff5... 382cec7... M src/gui/Preferences.py
:100644 100644 7b74efe... fea74df... M src/gui/xml/folder_popup.xml
:100644 100644 290d610... e7daf0e... M src/utils/Callbacks.py
:100644 100644 984fdd0... 8998443... M src/utils/Helpers.py
:100644 100644 24e8751... 7d82133... M src/utils/Icons.py
:100644 100644 1eae840... d6df9a2... M src/utils/Settings.py
=========
Changes
=========
commit 895308418f34abe748e161245b1592840530f538
Author: Newell Jensen <jensen@xxxxxxxxxxxxxxxx>
Date: Fri Dec 26 01:45:41 2008 -0800
Added some more functionality to command flags in
the Preferences window and tying this together with
the Processes window.
diff --git a/src/gui/Preferences.py b/src/gui/Preferences.py
index 1140ff5..382cec7 100644
--- a/src/gui/Preferences.py
+++ b/src/gui/Preferences.py
@@ -74,7 +74,7 @@ class Preferences(gtk.Dialog):
elif response == 19: # Restore Default
current_tool = self.get_current_tool()
if current_tool != None:
- self.flags_entry.set_text(self.mw.settings.default_flags[current_tool])
+ self.flags_entry.set_text(str(self.mw.settings.default_flags[current_tool]))
self.mw.settings.flags[current_tool] = self.mw.settings.default_flags[current_tool]
@@ -141,13 +141,13 @@ class Preferences(gtk.Dialog):
#####################################################
## gEDA Tool Flags
#####################################################
- label = gtk.Label('The flags listed here will be used when running the respective programs.\nPrograms with multiple uses will be listed in a dictionary ({ }).')
+ label = gtk.Label("The flags listed here will be used when running the respective programs.\nPrograms with multiple uses will be listed in a dictionary ({ }).\nArguments should be string seperated in a list ['-a','-b','output_filename'].")
label.show()
self.vbox.pack_start(label)
hbox = gtk.HBox()
hbox.show()
self.current_tool = self.get_current_tool()
- self.flags_entry.set_text(self.mw.settings.flags[self.current_tool])
+ self.flags_entry.set_text(str(self.mw.settings.flags[self.current_tool]))
hbox.pack_end(self.flags_entry)
label = gtk.Label('gEDA Tool Flags:')
label.show()
@@ -199,8 +199,10 @@ class Preferences(gtk.Dialog):
"""
# Save the current state of geda tool flags and editor
if current_tool != None:
- self.mw.settings.editor = self.editor_entry.get_text()
self.mw.settings.flags[current_tool] = self.flags_entry.get_text()
+ if self.mw.settings.editor != None or self.mw.settings.editor != '':
+ self.mw.settings.editor = self.editor_entry.get_text()
+
def update_fields(self, current_tool):
@@ -209,7 +211,7 @@ class Preferences(gtk.Dialog):
@param current_tool current tool to update the fields for
"""
if current_tool != None:
- self.flags_entry.set_text(self.mw.settings.flags[current_tool])
+ self.flags_entry.set_text(str(self.mw.settings.flags[current_tool]))
if current_tool in ['gschem','gnetlist','gsymcheck','gattrib','ghdl','gspiceui','gtkwave','grenum','gsch2pcb','ngspice','gnucap']:
subproc = Popen([current_tool,'-h'], stdout=PIPE)
output = subproc.communicate()[0]
diff --git a/src/gui/xml/folder_popup.xml b/src/gui/xml/folder_popup.xml
index 7b74efe..fea74df 100644
--- a/src/gui/xml/folder_popup.xml
+++ b/src/gui/xml/folder_popup.xml
@@ -1,10 +1,10 @@
<ui>
<popup>
<separator/>
- <menuitem action="New Source..."/>
<menuitem action="New Folder"/>
<menuitem action="Delete Folder"/>
<menuitem action="Rename Folder"/>
+ <menuitem action="New Source..."/>
<menuitem action="Copy Existing Source To Project..."/>
<separator/>
</popup>
diff --git a/src/utils/Callbacks.py b/src/utils/Callbacks.py
index 290d610..e7daf0e 100644
--- a/src/utils/Callbacks.py
+++ b/src/utils/Callbacks.py
@@ -324,13 +324,13 @@ def get_processes_tree(mw, selected_node=None, ext=None, folder=None, clear=None
image = icon.load_icon(mw.icons.icon_lut['gsch2pcb'], 22, 0)
up_date = mw.processes.append(update, ['update-gsch2pcb', image, None])
image = icon.load_icon(mw.icons.icon_lut['pcb'], 22, 0)
- _print = mw.processes.append(_pprint, ['lpr', image, None])
- bom = mw.processes.append(export, ['bom', image, None])
- gerber = mw.processes.append(export, ['gerber', image, None])
- nelma = mw.processes.append(export, ['nelma', image, None])
- png = mw.processes.append(export, ['png', image, None])
- ps = mw.processes.append(export, ['ps', image, None])
- eps = mw.processes.append(export, ['eps', image, None])
+ _print = mw.processes.append(_pprint, ['pcb-lpr', image, None])
+ bom = mw.processes.append(export, ['pcb-bom', image, None])
+ gerber = mw.processes.append(export, ['pcb-gerber', image, None])
+ nelma = mw.processes.append(export, ['pcb-nelma', image, None])
+ png = mw.processes.append(export, ['pcb-png', image, None])
+ ps = mw.processes.append(export, ['pcb-ps', image, None])
+ eps = mw.processes.append(export, ['pcb-eps', image, None])
elif ext == 'sym':
check_symbols = mw.processes.append(None, ['Check Symbols', None, None])
image = icon.load_icon(mw.icons.icon_lut['sym'], 22, 0)
@@ -346,7 +346,7 @@ def get_processes_tree(mw, selected_node=None, ext=None, folder=None, clear=None
elif ext == 'vvp':
simulate = mw.processes.append(None, ['Simulate', None, None])
image = icon.load_icon(mw.icons.icon_lut['iverilog'], 22, 0)
- mw.processes.append(simulate, ['iverilog', image, None])
+ mw.processes.append(simulate, ['vvp', image, None])
elif ext == 'vhd' or ext == 'vhdl':
compile_source = mw.processes.append(None, ['Analyze VHDL', None, None])
# comsim_source = mw.processes.append(None, ['Elaborate VHDL', None, None])
@@ -357,8 +357,21 @@ def get_processes_tree(mw, selected_node=None, ext=None, folder=None, clear=None
simulation = mw.processes.append(None, ['Simulate', None, None])
image = icon.load_icon(mw.icons.icon_lut['gspiceui'], 22, 0)
mw.processes.append(simulation, ['gspiceui', image, None])
+ image = icon.load_icon(mw.icons.icon_lut['ngspice'], 22, 0)
+ mw.processes.append(simulation, ['ngspice', image, None])
+ image = icon.load_icon(mw.icons.icon_lut['other'], 22, 0)
+ mw.processes.append(simulation, ['gnucap', image, None])
elif ext == 'vcd':
simulation = mw.processes.append(None, ['Simulate', None, None])
+ translate = mw.processes.append(None, ['Translate', None, None])
+ image = icon.load_icon(mw.icons.icon_lut['gtkwave'], 22, 0)
+ mw.processes.append(simulation, ['gtkwave', image, None])
+ mw.processes.append(translate, ['vcd2lxt', None, None])
+ mw.processes.append(translate, ['vcd2lxt2', None, None])
+ mw.processes.append(translate, ['vcd2vzt', None, None])
+
+ elif ext in ['lxt','lxt2','vzt']:
+ simulation = mw.processes.append(None, ['Simulate', None, None])
image = icon.load_icon(mw.icons.icon_lut['gtkwave'], 22, 0)
mw.processes.append(simulation, ['gtkwave', image, None])
diff --git a/src/utils/Helpers.py b/src/utils/Helpers.py
index 984fdd0..8998443 100644
--- a/src/utils/Helpers.py
+++ b/src/utils/Helpers.py
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import os, sys, gtk, pygtk, time, signal
pygtk.require('2.0')
-from subprocess import *
+from subprocess import Popen, PIPE, call
from src.gui.Gsch2pcb import Gsch2pcb
@@ -458,7 +458,7 @@ def run_command(mw, filepath, highlighted_source=None, ext=None):
is being used for the current process
@param ext extension of the selected file
"""
- files = ['net','log','bom','bom1','bom2','v','vl','vvp','vhd','vhdl','gm','txt','cmd']
+ ## files = ['net','log','bom','bom1','bom2','v','vl','vvp','vhd','vhdl','gm','txt','cmd','mod','vcd','lxt','lxt2','vzt','cir','cf']
# Sources
if ext != None:
os.chdir(filepath.rpartition('/')[0])
@@ -477,8 +477,11 @@ def run_command(mw, filepath, highlighted_source=None, ext=None):
tools['gerbv'] = Popen(['gerbv', filepath])
elif tools['gerbv'].poll() == None: # Process is still running
pass
- elif (ext in files or ext in configfiles):
- if mw.settings.editor == None:
+ #elif (ext in files or ext in configfiles):
+ else:
+ if mw.settings.editor != None and mw.settings.editor != '':
+ Popen([mw.settings.editor, filepath])
+ else:
dialog = gtk.MessageDialog(mw,
(gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT),
gtk.MESSAGE_INFO,
@@ -488,45 +491,161 @@ def run_command(mw, filepath, highlighted_source=None, ext=None):
dialog.show()
response = dialog.run()
dialog.destroy()
- else:
- Popen([mw.settings.editor, filepath])
-
else: # Processes
os.chdir(highlighted_source.rpartition('/')[0])
program = filepath
+ if mw.settings.flags != None:
+ flags = mw.settings.flags.copy()
+ else:
+ flags = mw.settings.default_flags.copy()
+ ## NEED TO REFACTOR SOME OF THE DUPLICATED CODE HERE
# Netlists
if program in netlists: # use gnetlist
- subproc = Popen(['gnetlist', '-v', '-g', program, highlighted_source], stdout=PIPE)
- mw.output_textbuffer.insert(mw.output_textiter, get_time() + ' and output from ' + program + ':\n' + subproc.communicate()[0] + '\n')
+ current_flags = flags['gnetlist'].copy()
+ inner_flags = current_flags['backends'][:]
+ print 'inner_flags:',inner_flags
+ # Now replace '*backend choosen*' with program
+ index = inner_flags.index('*backend choosen*')
+ inner_flags[index] = program
+ index = inner_flags.index('*your_filename_backend.net*')
+ # May want to make this work with .cir file extenstions
+ inner_flags[index] = highlighted_source.rsplit('.')[0] + '_' + program + '.net'
+ inner_flags.append(highlighted_source)
+ final = ['gnetlist'] + inner_flags
+ subpro = Popen(final, stdout=PIPE)
elif program == 'gnetlist':
- print 'GNETLIST'
+ current_flags = flags['gnetlist']
+ inner_flags = current_flags['gnetlist']
+ inner_flags.append(highlighted_source)
+ final = [program] + inner_flags
+ subproc = Popen(final, stdout=PIPE)
elif program == 'gnetlist-drc2':
- print 'gnetlist-drc2'
+ subproc = Popen(['gnetlist','-g', 'drc2', '-o', 'drc2_verify.txt', highlighted_source], stdout=PIPE)
+ elif program == 'vcd2lxt':
+ lxt = highlighted_source.rsplit('.')[0] + '.lxt'
+ subproc = Popen(['vcd2lxt', highlighted_source, lxt], stdout=PIPE)
+ elif program == 'vcd2lxt2':
+ lxt2 = highlighted_source.rsplit('.')[0] + '.lxt2'
+ subproc = Popen(['vcd2lxt', highlighted_source, lxt2], stdout=PIPE)
+ elif program == 'vcd2vzt':
+ vzt = highlighted_source.rsplit('.')[0] + '.vzt'
+ subproc = Popen(['vcd2vzt', highlighted_source, vzt], stdout=PIPE)
+ elif program == 'ngspice':
+ current_flags = flags['ngspice'][:]
+ current_flags.append(highlighted_source)
+ final = [program] + current_flags
+ subproc = Popen(final, stdout=PIPE)
+ elif program == 'gnucap':
+ current_flags = flags['gnucap'][:]
+ current_flags.append(highlighted_source)
+ final = [program] + current_flags
+ subproc = Popen(final, stdout=PIPE)
elif program == 'gspiceui':
- subproc = Popen([program, highlighted_source], stdout=PIPE)
+ current_flags = flags['gnucap'][:]
+ current_flags.append(highlighted_source)
+ final = [program] + current_flags
+ subproc = Popen(final, stdout=PIPE)
elif program == 'ghdl-analyze':
- not_implemented(mw)
+ current_flags = flags['ghdl'].copy()
+ inner_flags = current_flags['analyze'][:]
+ inner_flags.append(highlighted_source)
+ final = ['ghdl'] + inner_flags
+ subproc = Popen(final, stdout=PIPE)
elif program == 'ghdl-eloborate':
- not_implemented(mw)
+ current_flags = flags['ghdl'].copy()
+ inner_flags = current_flags['eloborate'][:]
+ inner_flags.append(highlighted_source)
+ final = ['ghdl'] + inner_flags
+ subproc = Popen(final, stdout=PIPE)
elif program == 'ghdl-run':
- not_implemented(mw)
+ current_flags = flags['ghdl'].copy()
+ inner_flags = current_flags['run'][:]
+ inner_flags.append(highlighted_source)
+ final = ['ghdl'] + inner_flags
+ subproc = Popen(final, stdout=PIPE)
elif program == 'iverilog-compile':
- subproc = Popen(['iverilog', '-v', '-o', get_filename_from_filepath(highlighted_source).rsplit('.')[0] + '.vvp', highlighted_source], stdout=PIPE)
- elif program == 'vvp-simulate':
- not_implemented(mw)
+ current_flags = flags['iverilog'].copy()
+ inner_flags = current_flags['compile'][:]
+ # Need to add logic like above for .vvp output file
+ inner_flags.append(highlighted_source)
+ final = ['iverilog'] + inner_flags
+ subproc = Popen(final, stdout=PIPE)
+ elif program == 'iverliog-translate':
+ current_flags = flags['iverilog'].copy()
+ inner_flags = current_flags['translate'][:]
+ output_file = highlighted_source.rsplit('.')[0] + '.vhd'
+ inner_flags.append(output_file)
+ inner_flags.append(highlighted_source)
+ final = ['iverilog'] + inner_flags
+ subproc = Popen(final, stdout=PIPE)
+ elif program == 'vvp':
+ not_implemented(mw)
+ elif program == 'refdes_renum':
+ current_flags = flags[program][:]
+ current_flags.append(highlighted_source)
+ final = [program] + current_flags
+ subproc = Popen(final, stdout=PIPE)
+ elif program == 'grenum':
+ current_flags = flags[program][:]
+ current_flags.append(highlighted_source)
+ final = [program] + current_flags
+ subproc = Popen(final, stdout=PIPE)
elif program == 'gattrib':
if tools['gattrib'] == None or tools['gattrib'].poll() == 0:
tools['gattrib'] = Popen([program, highlighted_source], stdout=PIPE)
- mw.output_textbuffer.insert(mw.output_textiter, get_time() + ' and output from ' + program + ':\n' + tools['gattrib'].communicate()[0] + '.\n')
elif tools['gattrib'].poll() == None: # Process is still running
pass
elif program == 'gsymcheck':
- arg = '-v ' + highlighted_source
- subproc = Popen([program, arg], stdout=PIPE)
- mw.output_textbuffer.insert(mw.output_textiter, get_time() + ' and output from ' + program + ':\n' + subproc.communicate()[0] + '.\n')
+ current_flags = flags[program][:]
+ current_flags.append(highlighted_source)
+ final = [program] + current_flags
+ subproc = Popen(final, stdout=PIPE)
elif program == 'gsch2pcb wizard':
gsch2pcb = Gsch2pcb(mw, highlighted_source)
+ elif program == 'pcb-lpr':
+ current_flags = flags['pcb'].copy()
+ inner_flags = current_flags['lpr'][:]
+ inner_flags.append(highlighted_source)
+ final = ['pcb'] + inner_flags
+ subproc = Popen(final, stdout=PIPE)
+ elif program == 'pcb-bom':
+ current_flags = flags['pcb'].copy()
+ inner_flags = current_flags['bom'][:]
+ inner_flags.append(highlighted_source)
+ final = ['pcb'] + inner_flags
+ print 'final:',final
+ subproc = Popen(final, stdout=PIPE)
+ elif program == 'pcb-gerber':
+ current_flags = flags['pcb'].copy()
+ inner_flags = current_flags['gerber'][:]
+ inner_flags.append(highlighted_source)
+ final = ['pcb'] + inner_flags
+ subproc = Popen(final, stdout=PIPE)
+ elif program == 'pcb-nelma':
+ current_flags = flags['pcb'].copy()
+ inner_flags = current_flags['nelma'][:]
+ inner_flags.append(highlighted_source)
+ final = ['pcb'] + inner_flags
+ subproc = Popen(final, stdout=PIPE)
+ elif program == 'pcb-png':
+ current_flags = flags['pcb'].copy()
+ inner_flags = current_flags['png'][:]
+ inner_flags.append(highlighted_source)
+ final = ['pcb'] + inner_flags
+ subproc = Popen(final, stdout=PIPE)
+ elif program == 'pcb-ps':
+ current_flags = flags['pcb'].copy()
+ inner_flags = current_flags['ps'][:]
+ inner_flags.append(highlighted_source)
+ final = ['pcb'] + inner_flags
+ subproc = Popen(final, stdout=PIPE)
+ elif program == 'pcb-eps':
+ current_flags = flags['pcb'].copy()
+ inner_flags = current_flags['eps'][:]
+ inner_flags.append(highlighted_source)
+ final = ['pcb'] + inner_flags
+ subproc = Popen(final, stdout=PIPE)
elif program == 'update-gsch2pcb':
not_implemented(mw)
# The stuff below is commented out until the dependency issues
diff --git a/src/utils/Icons.py b/src/utils/Icons.py
index 24e8751..7d82133 100644
--- a/src/utils/Icons.py
+++ b/src/utils/Icons.py
@@ -61,7 +61,8 @@ class Icons:
image = gtk.gdk.pixbuf_new_from_file('images/bitmaps/page_white_text.png')
gtk.icon_theme_add_builtin_icon('other', 22, image)
image = gtk.gdk.pixbuf_new_from_file('images/bitmaps/chart_curve.png')
- gtk.icon_theme_add_builtin_icon('spice', 22, image)
+ gtk.icon_theme_add_builtin_icon('spice', 22, image)
+ gtk.icon_theme_add_builtin_icon('cir', 22, image)
image = gtk.gdk.pixbuf_new_from_file('images/bitmaps/background-logo-icon.png')
gtk.icon_theme_add_builtin_icon('iverilog', 22, image)
image = gtk.gdk.pixbuf_new_from_file('images/bitmaps/GHDL_logo-22.png')
@@ -92,10 +93,14 @@ class Icons:
gtk.icon_theme_add_builtin_icon('txt', 22, image)
image = gtk.gdk.pixbuf_new_from_file('images/bitmaps/cog.png')
gtk.icon_theme_add_builtin_icon('out', 22, image)
- image = gtk.gdk.pixbuf_new_from_file('images/bitmaps/cog.png')
gtk.icon_theme_add_builtin_icon('vvp', 22, image)
+ gtk.icon_theme_add_builtin_icon('vcd', 22, image)
+ gtk.icon_theme_add_builtin_icon('lxt', 22, image)
+ gtk.icon_theme_add_builtin_icon('lxt2', 22, image)
+ gtk.icon_theme_add_builtin_icon('vzt', 22, image)
image = gtk.gdk.pixbuf_new_from_file('images/bitmaps/page_white_acrobat.png')
gtk.icon_theme_add_builtin_icon('pdf', 22, image)
+ gtk.icon_theme_add_builtin_icon('ps', 22, image)
image = gtk.gdk.pixbuf_new_from_file('images/bitmaps/GTKWave_logo.png')
gtk.icon_theme_add_builtin_icon('gtkwave', 22, image)
image = gtk.gdk.pixbuf_new_from_file('images/bitmaps/nglogo.jpg')
@@ -104,6 +109,7 @@ class Icons:
self.icon_lut = {'ngspice': 'ngspice',
'gtkwave': 'gtkwave',
+ 'ps': 'ps',
'pdf': 'pdf',
'vvp': 'vvp',
'out': 'out',
@@ -124,6 +130,7 @@ class Icons:
'gattrib': 'geda-gattrib',
'gschem': 'geda-gschem',
'spice': 'spice',
+ 'cir': 'cir',
'gspiceui': 'spice',
'iverilog': 'iverilog',
'ghdl': 'ghdl',
diff --git a/src/utils/Settings.py b/src/utils/Settings.py
index 1eae840..d6df9a2 100644
--- a/src/utils/Settings.py
+++ b/src/utils/Settings.py
@@ -39,23 +39,23 @@ class Settings:
self.project = None
self.editor = None
self.flags = None
- self.default_flags = {'gnucap': '-b',
- 'ngspice': '-b',
- 'refdes_renum': '--verbose',
- 'grenum': '-v',
- 'gsch2pcb': '-v',
- 'gschem': '-v',
- 'gnetlist': "{'gnetlist': '-v', 'backends': '-v -g `backend choosen`'}",
- 'gattrib': '-v',
- 'gerbv': '',
- 'gsymcheck': '-v',
- 'ghdl': "{'analyze': '-a', 'elaborate': '-e', 'run': '-r'}",
- 'iverilog': "{'compile': '-v', 'translate': '-tvhdl -o your_verilog_filename.vhd'}",
- 'vvp': '-v',
- 'gspiceui': '',
- 'gtkwave': '',
- 'gwave': '-v',
- 'pcb': "{'gui': '--verbose', 'lpr': '-p', 'bom': '-x bom', 'gerber': '-x gerber', 'nelma': '-x nelma', 'png': '-x png', 'ps': '-x ps', 'eps': '-x eps'}"
+ self.default_flags = {'gnucap': ['-b'],
+ 'ngspice': ['-b'],
+ 'refdes_renum': ['--verbose'],
+ 'grenum': ['-v'],
+ 'gsch2pcb': ['-v'],
+ 'gschem': ['-v'],
+ 'gnetlist': {'gnetlist': ['-v'], 'backends': ['-v','-g','*backend choosen*','-o','*your_filename_backend.net*']},
+ 'gattrib': ['-v'],
+ 'gerbv': [],
+ 'gsymcheck': ['-v'],
+ 'ghdl': {'analyze': ['-a'], 'elaborate': ['-e'], 'run': ['-r']},
+ 'iverilog': {'compile': ['-v','-o','*your_filename.vvp*'], 'translate': ['-tvhdl','-o','*your_filename.vhd*']},
+ 'vvp': ['-v'],
+ 'gspiceui': [],
+ 'gtkwave': [],
+ 'gwave': ['-v'],
+ 'pcb': {'gui': ['--verbose'], 'lpr': ['-p'], 'bom': ['-x','bom'], 'gerber': ['-x','gerber'], 'nelma': ['-x','nelma'], 'png': ['-x','png'], 'ps': ['-x','ps'], 'eps': ['-x','eps']}
}
self.path = os.path.expanduser('~') + '/.gmrc'
try:
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs