reds-cvs Mailing List for rapidEDS, Rapid Electronic Design System (Page 2)
Status: Alpha
Brought to you by:
rickyw
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
(33) |
May
|
Jun
(1) |
Jul
(123) |
Aug
(18) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(9) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(34) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Ricky W. <ri...@us...> - 2006-08-26 13:21:34
|
Update of /cvsroot/reds/rapideds/src/pcbedit In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28791/src/pcbedit Added Files: Makefile.am layer.cpp layer.h layereditdlg.cpp layereditdlg.h pcbcanvas.cpp pcbcanvas.h pcbedit.cpp pcbedit.h pcbeditpart.cpp pcbeditpart.h rapideds_pcbedit_part.rc Log Message: Initial PCB framework --- NEW FILE: pcbedit.h --- // file : pcbedit.h // Descr : PCB editor widget // Author : Ricky White ( ri...@ne... ) // License : GNU General Public License v2 // Coyright : Copyright (C) Ricky White 2004 /////////////////////////////////////////////////////////////////////////////// #ifndef PCBEDIT_H #define PCBEDIT_H #include <qcanvas.h> #include <kactioncollection.h> #include "pcbcanvas.h" #include "caddochdr.h" #include "cadtool/cadtool.h" #include "pcbtool/pt_selection.h" #include <editpart.h> /** Schematic Editor Widget Provides the core schematic editor widget which is wrapped by the part. @author Ricky White */ class PcbEdit : public QCanvasView { Q_OBJECT public: PcbEdit( QWidget *parent = 0, const char *name = 0, KActionCollection *kac =0, EditorPart *ep=0 ); ~PcbEdit(); bool save( KURL url ); bool load( KURL url ); // Mouse handling void contentsMousePressEvent( QMouseEvent *e ); void contentsMouseReleaseEvent( QMouseEvent *e ); void contentsMouseMoveEvent( QMouseEvent *e ); void contentsMouseDoubleClickEvent( QMouseEvent * e ); void contentsDragEnterEvent( QDragEnterEvent *e ); void contentsDragMoveEvent( QDragMoveEvent *e ); void contentsDragLeaveEvent( QDragLeaveEvent *e ); void keyPressEvent( QKeyEvent * e ); KActionCollection *actionCollection() { return m_actionCollection; } void setHeader( const CadDocHeader &hdr ); CadDocHeader header() { return m_header; } EditorPart &part() { return *m_part; } public slots: void zoom_in(); void zoom_out(); void zoom( float zoom ); void print(); void selectTool_slot(CadTool *tool); /// Call to indicate the document has been modified void setModified( bool modified=true ); // Update the displayed statusbar message void setStatusBar(const QString&); protected: PcbCanvas m_canvas; KActionCollection *m_actionCollection; CadTool *m_tool; PT_Selection *m_selectionTool; CadDocHeader m_header; EditorPart *m_part; }; #endif --- NEW FILE: rapideds_pcbedit_part.rc --- <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd"> <kpartgui name="rapideds_pcbedit_part" version="1"> <MenuBar> <Menu name="file"> <Action name="file_print"/> </Menu> </MenuBar> <ToolBar name="mainToolBar"> <Action name="file_print"/> <Action name="zoomin"/> <Action name="zoomout"/> <Action name="selecttool"/> <Separator lineSeparator="false" /> </ToolBar> <ToolBar name="PCBTools"> <Action name="pcb_track_tool"/> <Action name="pcb_pad_tool"/> <Separator lineSeparator="false" /> <Action name="search_footprints"/> <Action name="recent_footprints"/> <Separator lineSeparator="false" /> <action name="select_layer_label"/> <Action name="layer_selector"/> <Action name="layer_editor"/> <Separator lineSeparator="false" /> </ToolBar> <ToolBar name="DrawingTools"> <Action name="text_tool"/> <Action name="rectangle_tool"/> <Action name="image_tool"/> <Separator lineSeparator="false" /> </ToolBar> </kpartgui> --- NEW FILE: pcbcanvas.cpp --- // file : pcbcanvas.cpp // Descr : // Author : Ricky White ( ri...@ne... ) // License : GNU GPL General Public License // Copyright : Copyright (C) Ricky White 2004 /////////////////////////////////////////////////////////////////////////////// #include "pcbcanvas.h" PcbCanvas::PcbCanvas( PrjDoc &prjdoc ) : CadCanvas(prjdoc) { } PcbCanvas::~PcbCanvas() { } /** Draw all visible objects on the specified PCB layer. This function calls the DrawLayer functions of each PcbObj. */ void PcbCanvas::DrawLayer( QPainter &painter, int i ) { } --- NEW FILE: pcbeditpart.cpp --- // file: pcbeditpart.h // Descr PCB Editor Part // Author Ricky White ri...@ne... // Liscnce GPL /////////////////////////////////////////////////////////////////////////////// #include "pcbeditpart.h" #include <kdebug.h> #include <kstandarddirs.h> #include <kinstance.h> #include <kaction.h> #include <kstdaction.h> #include <kfiledialog.h> #include <qfile.h> #include <qtextstream.h> #include <qmultilineedit.h> #include <pcbedit.h> #include "../projectmgr/newsheetdlg.h" PcbEditPart::PcbEditPart( QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name, PrjDoc &project ) : EditorPart(parentWidget, name, project) { KStandardDirs stdDirs; kdDebug()<<"PcbEditPart initialising"<<endl; setInstance( PcbEditPartFactory::instance() ); m_widget = new PcbEdit( parentWidget, widgetName, actionCollection(), this ); setWidget( m_widget ); // notify the part that this is our internal widget // create our actions KStdAction::open(this, SLOT(fileOpen()), actionCollection()); KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); KStdAction::save(this, SLOT(save()), actionCollection()); KStdAction::print(m_widget,SLOT(print()), actionCollection(),"file_print"); KStdAction::zoomIn(m_widget,SLOT(zoom_in()), actionCollection(),"zoomin"); KStdAction::zoomOut(m_widget,SLOT(zoom_out()), actionCollection(),"zoomout"); setXMLFile( stdDirs.findResource("data","rapidEDS/rapideds_pcbedit_part.rc") ); setReadWrite(true); setModified(false); } PcbEditPart::~PcbEditPart() { } void PcbEditPart::setReadWrite(bool rw) { ReadWritePart::setReadWrite(rw); } void PcbEditPart::setModified(bool modified) { // get a handle on our Save action and make sure it is valid KAction *save = actionCollection()->action(KStdAction::stdName(KStdAction::Save)); if (!save) return; // if so, we either enable or disable it based on the current // state if (modified) save->setEnabled(true); else save->setEnabled(false); // in any event, we want our parent to do it's thing ReadWritePart::setModified(modified); } bool PcbEditPart::openFile() { return m_widget->load( m_file ); } bool PcbEditPart::saveFile() { kdDebug()<<"bool PcbEditPart::saveFile()"<<endl; if (isReadWrite() == false) return false; return m_widget->save( m_file ); } void PcbEditPart::fileOpen() { // this slot is called whenever the File->Open menu is selected, // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar // button is clicked QString file_name = KFileDialog::getOpenFileName(); if (file_name.isEmpty() == false) openURL(file_name); } void PcbEditPart::fileSaveAs() { // this slot is called whenever the File->Save As menu is selected, QString file_name = KFileDialog::getSaveFileName(); if (file_name.isEmpty() == false) saveAs(file_name); } bool PcbEditPart::newFileDialog( QString &name, const KURL &path ) { NewSheetDlg dlg; dlg.setEditorName("PCB"); if( dlg.exec()==QDialog::Accepted ) { m_url = path; CadDocHeader hdr = dlg.header(); m_widget->setHeader( hdr ); name = hdr.name(); m_url.addPath(name); kdDebug()<<"PCB file path = '"<<m_url.path()<<"'"<<endl; return true; } else return false; } // It's usually safe to leave the factory code alone.. with the // notable exception of the KAboutData data #include <kaboutdata.h> #include <klocale.h> KInstance* PcbEditPartFactory::s_instance = 0L; KAboutData* PcbEditPartFactory::s_about = 0L; PcbEditPartFactory::PcbEditPartFactory() : KParts::Factory() { } PcbEditPartFactory::~PcbEditPartFactory() { delete s_instance; delete s_about; s_instance = 0L; } KParts::Part* PcbEditPartFactory::createPartObject( QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name, const char *classname, const QStringList &args ) { /* FIXME: put this back and handle project // Create an instance of our Part PcbEditPart* obj = new PcbEditPart( parentWidget, widgetName, parent, name ); // See if we are to be read-write or not if (QCString(classname) == "KParts::ReadOnlyPart") obj->setReadWrite(false); return obj; */ } KInstance* PcbEditPartFactory::instance() { if( !s_instance ) { s_about = new KAboutData("rapidedspart", I18N_NOOP("rapidEDSPart"), "0.1"); s_about->addAuthor("Ricky White", 0, "ri...@ne..."); s_instance = new KInstance(s_about); } return s_instance; } extern "C" { void* init_librapidedspart() { return new PcbEditPartFactory; } }; #include "pcbeditpart.moc" --- NEW FILE: layer.cpp --- // file : .cpp // Descr : // Author : Ricky White ( ri...@ne... ) // License : GNU GPL General Public License // Copyright : Copyright (C) Ricky White 2004 /////////////////////////////////////////////////////////////////////////////// #include "layer.h" Layer::Layer() { } Layer::~Layer() { } --- NEW FILE: Makefile.am --- INCLUDES = -I$(top_srcdir)/sqlite -I$(top_srcdir)/src/cadlib/core \ -I$(top_srcdir)/src/common -I$(top_srcdir)/src/common/cadobj -I$(top_srcdir)/src/interfaces \ -I$(top_srcdir)/src/projectmgr -I$(top_srcdir)/src/ui -I$(top_srcdir)/src/ui/pcb -Ikmdi \ $(all_includes) METASOURCES = AUTO lib_LTLIBRARIES = libpcbedit.la libpcbedit_la_LDFLAGS = $(all_libraries) libpcbedit_la_SOURCES = pcbedit.cpp pcbeditpart.cpp pcbcanvas.cpp layer.cpp \ layereditdlg.cpp noinst_HEADERS = pcbeditpart.h pcbcanvas.h layer.h layereditdlg.h libpcbedit_la_LIBADD = $(top_builddir)/src/common/librapideds-common.la \ $(top_builddir)/src/ui/pcb/libpcb_ui.la $(top_builddir)/src/ui/lib-ui.la \ $(top_builddir)/src/pcbedit/pcbobj/librapideds_pcbobj.la $(top_builddir)/src/pcbedit/pcbtool/librapideds_pcbtool.la SUBDIRS = pcbobj pcbtool partrcdir = $(kde_datadir)/rapidEDS partrc_DATA = rapideds_pcbedit_part.rc --- NEW FILE: layereditdlg.cpp --- // file : .cpp // Descr : // Author : Ricky White ( ri...@ne... ) // License : GNU GPL General Public License // Copyright : Copyright (C) Ricky White 2004 /////////////////////////////////////////////////////////////////////////////// #include "layereditdlg.h" LayerEditDlg::LayerEditDlg( PcbCanvas &canvas ) : LayerEditForm(), mCanvas(canvas) { } LayerEditDlg::~LayerEditDlg() { } --- NEW FILE: pcbedit.cpp --- // file : pcbedit.cpp // Descr : PCB editor widget // Author : Ricky White ( ri...@ne... ) // License : GNU General Public License v2 // Coyright : Copyright (C) Ricky White 2004 /////////////////////////////////////////////////////////////////////////////// #include "pcbedit.h" #include <math.h> #include <qcolor.h> #include <qpaintdevicemetrics.h> #include <qcursor.h> #include <kprinter.h> #include <kdebug.h> #include <kmessagebox.h> #include <kurl.h> #include "pcbtool/pt_track.h" #include "pcbtool/pt_pad.h" #include "pcbtool/pt_footprint.h" #include "pcbtool/pt_layerselector.h" #include "cadobj/canvascursor.h" #include "units.h" //#include "schxmlparser.h" //#include "printscaledlg.h" #include <prjdoc.h> #include "layereditdlg.h" #include "pcbobj/pcbobj.h" #include "pcbobj/po_track.h" PcbEdit::PcbEdit( QWidget *parent, const char *name, KActionCollection *kac, EditorPart *ep ) : QCanvasView(parent, name) , m_part(ep), m_canvas(ep->project()) { m_tool = 0; m_actionCollection = kac; setBackgroundColor(Qt::lightGray); m_canvas.setSize( Units(270,Units::MM), Units(210,Units::MM) ); setCanvas(&m_canvas); // LayerEditDlg dlg(m_canvas); // dlg.exec(); m_selectionTool = new PT_Selection(this,m_part->project()); m_selectionTool->setGrid( Units(1,Units::MM) ); (void) new PT_Track(this,m_part->project()); (void) new PT_Pad(this,m_part->project()); (void) new PT_Footprint(this,m_part->project()); (void) new PT_LayerSelector(this,m_part->project()); selectTool_slot(m_selectionTool); zoom(1); kdDebug()<<"Object Size statistics" << endl <<"=======================" << endl <<"sizeof(QObject)="<<sizeof(QObject)<<endl <<"sizeof(QCanvasEllipse)="<<sizeof(QCanvasEllipse)<<endl <<"sizeof(QCanvasLine)="<<sizeof(QCanvasLine)<<endl <<"sizeof(QCanvasItem)="<<sizeof(QCanvasItem)<<endl <<"sizeof(QCanvasRectangle)="<<sizeof(QCanvasRectangle)<<endl <<"sizeof(PO_Track)="<<sizeof(PO_Track)<<endl <<"=======================" << endl; setFocusPolicy(QWidget::StrongFocus); setModified(true); } PcbEdit::~PcbEdit() { kdDebug()<<"============================== PcbEdit Going Down! ========================"<<endl; } void PcbEdit::setModified( bool modified ) { m_part->setModified( modified ); } void PcbEdit::setStatusBar(const QString &str) { kdDebug()<<"setStatusBar(\""<<str<<"\")"<<endl; m_part->setStatusBar(str); } /////////////////////////////////////////////////////////////////////////////// // Mouse handling and Cad tool redirection // /////////////////////////////////////////////////////////////////////////////// void PcbEdit::contentsMousePressEvent( QMouseEvent* e ) { QCanvasView::contentsMousePressEvent(e); if(m_tool) { kdDebug()<<"void SchView::contentsMousePressEvent( QMouseEvent* e ) : tool=" <<m_tool->name()<<endl; m_tool->mousePressEvent(e); } } void PcbEdit::contentsMouseReleaseEvent( QMouseEvent *e ) { QCanvasView::contentsMouseReleaseEvent(e); if(m_tool) m_tool->mouseReleaseEvent(e); } /** Handle mouse movements */ void PcbEdit::contentsMouseMoveEvent ( QMouseEvent *e ) { if(m_tool) { m_tool->mouseMoveEvent(e); // Let the tool handle things itself first // Special handling, // make sure we select correct cursor at corrct times // This is because CadToolGL draws its own cursor to allow grid // locking and we need to turn off the standard cursor when over // a valid area of canvas. UnitsPt pt = m_tool->getCurPos(); QRect rcraw = viewport()->rect(); QRect rc; rc.setTopLeft( viewport()->mapToGlobal(rcraw.topLeft()) ); rc.setBottomRight( viewport()->mapToGlobal(rcraw.bottomRight()) ); // check for viewport bounds if( ( QCursor::pos().y()<=rc.bottom() ) &&( QCursor::pos().y()>=rc.top() ) &&( QCursor::pos().x()<=rc.right() ) &&( QCursor::pos().x()>=rc.left() ) ) { // IN VIEWPORT // Handle monse on/off valid canvas area if( (pt.x().pixel(m_canvas.zoom())>canvas()->size().width()) || (pt.y().pixel(m_canvas.zoom())>canvas()->size().height()) ) { setCursor(QCursor::ArrowCursor); m_tool->showCursor(false); } else { setCursor(QCursor::BlankCursor); m_tool->showCursor(true); } } else { setCursor(QCursor::ArrowCursor); m_tool->showCursor(false); } } } void PcbEdit::contentsMouseDoubleClickEvent( QMouseEvent * e ) { QCanvasView::contentsMouseDoubleClickEvent(e); if(m_tool) m_tool->mouseDoubleClickEvent(e); } void PcbEdit::keyPressEvent( QKeyEvent * e ) { kdDebug()<<"keypress"<<endl; e->ignore(); } /////////////////////////////////////////////////////////////////////////////// // Public slots implementation // /////////////////////////////////////////////////////////////////////////////// void PcbEdit::print() { #if 0 float oldzoom = m_canvas.zoom(); QColor oldbkgcolor = m_canvas.backgroundColor(); m_canvas.setBackgroundColor(QColor(255,255,255)); KPrinter printer(true,QPrinter::HighResolution); printer.setFullPage( false ); PrintScaleDlg *scaletab = new PrintScaleDlg(this); printer.addDialogPage(scaletab); // initialize the printer using the print dialog if ( printer.setup( this ) ) { // create a painter to paint on the printer object QPainter painter; painter.begin( &printer ); QPaintDeviceMetrics metrics( painter.device() ); // check options if( printer.option("kde-rapideds-scaletofit").toUInt() ) { // scale to fit on one page UnitsSize sheetsize = m_canvas.size(); QSize m = printer.margins() ; if( printer.option("kde-rapideds-rotatebestfit").toUInt() ) { // rotate if necessary for better fit UnitsRect rc; rc.setSize(sheetsize); if (rc.aspect()<1 && metrics.width()>metrics.height()) printer.setOrientation(KPrinter::Portrait); else if( rc.aspect()>1 && metrics.width()<metrics.height() ) printer.setOrientation(KPrinter::Landscape); } // figure out correct zoom to fit on page float scale_x = metrics.widthMM()/sheetsize.x().value(Units::MM); float scale_y = metrics.heightMM()/sheetsize.y().value(Units::MM); float zoom = scale_x<scale_y ? scale_x : scale_y; zoom = Units::zoomFromDpi( metrics.logicalDpiX() )*zoom; m_canvas.setZoom(zoom); canvas()->drawArea( canvas()->rect(), &painter ); painter.end(); } else { // use zoom factor and as many pages as necessary float zoom = printer.option("kde-rapideds-zoom").toDouble(); zoom = Units::zoomFromDpi( metrics.logicalDpiX() )*zoom; m_canvas.setZoom(zoom); // calculate number of pages needed // in conversion to int must be rounded up int xpages = (int)ceil(m_canvas.size().x().pixel(zoom)/metrics.width()); int ypages = (int)ceil(m_canvas.size().y().pixel(zoom)/metrics.height()); QRect pagerect( 0, 0, metrics.width(), metrics.height() ); int ofs_x=0, ofs_y=0; // iterate over canvas printing slightly overlapping sheets for( int y=0; y<ypages; y++, ofs_y+=metrics.height() ) { for( int x=0; x<xpages; x++, ofs_x+=metrics.width() ) { pagerect.setTopLeft( QPoint( ofs_x, ofs_y ) ); pagerect.setWidth(metrics.width()); pagerect.setHeight(metrics.height()); // @FIXME: call scale to correct for mismatched dpi values for x and y although I'm not sure if we will ever see this but better to be safe. we should pick the highest resolution. painter.translate(-ofs_x,-ofs_y); m_canvas.drawArea( pagerect, &painter ); painter.translate(+ofs_x,+ofs_y); printer.newPage(); } ofs_x = 0; } painter.end(); } } m_canvas.setZoom(oldzoom); m_canvas.setBackgroundColor(oldbkgcolor); #endif } void PcbEdit::zoom_in() { zoom( m_canvas.zoom()+0.25 ); } void PcbEdit::zoom_out() { if(m_canvas.zoom()>0.25) zoom( m_canvas.zoom()-0.25 ); } void PcbEdit::zoom( float zoom ) { m_canvas.setZoom( zoom ); if(m_tool) m_tool->setZoom( zoom ); } /** call when a new tool is selected */ void PcbEdit::selectTool_slot(CadTool *tool) { if(tool==m_tool) return; if(m_tool!=0) { m_tool->deselect(); kdDebug()<<"\tCurrent tool = \""<<m_tool->name()<<"\""<<endl; } if(tool!=0) m_tool = tool; else m_tool = m_selectionTool; // Set tool to basic select tool. kdDebug()<<"\tNew tool = \""<<m_tool->name()<<"\""<<endl; setCursor(m_tool->getCursor()); m_tool->selected(); m_tool->setZoom(m_canvas.zoom()); // WARNING do not remove this line or a crash will result } void PcbEdit::contentsDragEnterEvent ( QDragEnterEvent *e ) { m_tool->dragEnterEvent(e); } void PcbEdit::contentsDragMoveEvent ( QDragMoveEvent *e ) { m_tool->dragMoveEvent(e); } void PcbEdit::contentsDragLeaveEvent ( QDragLeaveEvent *e ) { m_tool->dragLeaveEvent(e); } void PcbEdit::setHeader( const CadDocHeader &hdr ) { kdDebug()<<"void PcbEdit::setHeader( const CadDocHeader &hdr )"<<endl; m_header = hdr; // since header has changed we need to resize the sheet here // in case the sheet size has changed. Sheet s = m_header.sheet(); kdDebug()<<"zoom="<<m_canvas.zoom()<<", w="<<s.width().text()<<", h="<<s.height().text()<<endl; m_canvas.setSize( s.width(), s.height() ); // FIXME: after size change the window isn't being redrawn etc until we switch to another tab and back. } // Save the schematic to the specified file. // The canvas contains all objects on the schematic hence we // can just walk its item list asking objects to save themselves. // One complicatio is objects that are children to another object. // to get arround this we don't directly ask a child to save itself // but we only ask objects whose parten()==0. The parent objects // must request their children to save. This preserved the correct // tree structure in the resulting XML file. bool PcbEdit::save( KURL url ) { #if 0 kdDebug()<<"=================================================================="<<endl; kdDebug()<<"Saving schematic to \""<<url.path()<<"\"."<<endl; QFile file; file.setName( url.path() ); if( file.open( IO_WriteOnly ) ) { QTextStream stream( &file ); stream << "<?xml version=\"1.0\"?>\n" << "<!DOCTYPE RapidEDS-Sch-v01>\n" << "<SCHEMATIC>\n"; stream << m_header.xml(0); stream << "<BODY>\n"; QCanvasItemList list = canvas()->allItems(); QCanvasItemList::iterator it; CadObj *obj; for( it=list.begin(); it!=list.end();++it) { if( CadObj::isCadObj(*it) || SchObj::isSchObj(*it) ) { obj = dynamic_cast<CadObj*>(*it); // only save parent objects if( obj->parent()==0 ) stream << obj->xml(1); } } stream << "</BODY>\n" << "</SCHEMATIC>\n"; file.close(); return true; } else { kdDebug()<<"ERROR: PcbEdit::save( "<<url.path()<<" ) failed."<<endl; return false; } kdDebug()<<"=================================================================="<<endl; #endif } bool PcbEdit::load( KURL url ) { kdDebug()<<"bool PcbEdit::load( "<<url<<" )"<<endl; #if 0 // Load the file QFile xmlFile( url.path() ); if( !xmlFile.exists() ) { kdDebug()<<"coulden't open XML file!!!!!!!"<<endl; return false; } SchXMLParser handler( this ); QXmlInputSource source( &xmlFile ); QXmlSimpleReader reader; reader.setContentHandler( &handler ); reader.parse( source ); xmlFile.close(); kdDebug()<<"bool PcbEdit::load( "<<url<<" ) DONE"<<endl; selectTool_slot(m_selectionTool); #endif return true; } //#include "pcbedit.moc" --- NEW FILE: pcbcanvas.h --- // file : pcbcanvas.h // Descr : PCB editor Canvas // Author : Ricky White ( ri...@ne... ) // License : GNU GPL General Public License // Copyright : Copyright (C) Ricky White 2004 /////////////////////////////////////////////////////////////////////////////// #ifndef PCBCANVAS_H #define PCBCANVAS_H #include "cadcanvas.h" #include "layer.h" /** Provides PCB sepecific features to the basic canvas @author Ricky White <ri...@ne...> */ class PcbCanvas : public CadCanvas { public: PcbCanvas( PrjDoc &prjdoc ); ~PcbCanvas(); protected: LayerVector mLayers; void DrawLayer( QPainter &painter, int i ); }; #endif --- NEW FILE: pcbeditpart.h --- // file: pcbeditpart.h // Descr PCB Editor Part // Author Ricky White ri...@ne... // Liscnce GPL v2 /////////////////////////////////////////////////////////////////////////////// #ifndef PCBEDITPART_H #define PCBEDITPART_H #include <kparts/part.h> #include <kparts/factory.h> #include <editpart.h> class QWidget; class QPainter; class KURL; class QMultiLineEdit; class PcbEdit; /** PCB Editor Part @author Ricky White */ /** * This is a "Part". It that does all the real work in a KPart * application. * * @short Main Part * @author Ricky White <ri...@ne...> * @version 0.1 */ class PcbEditPart : public EditorPart { Q_OBJECT public: /** * Default constructor */ PcbEditPart(QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name, PrjDoc &project ); /** * Destructor */ virtual ~PcbEditPart(); /** * This is a virtual function inherited from KParts::ReadWritePart. * A shell will use this to inform this Part if it should act * read-only */ virtual void setReadWrite(bool rw); /** * Reimplemented to disable and enable Save action */ virtual void setModified(bool modified); /** cause a new file dialogue to be displayed. * \param name sets initialnamne if any to be prefilled and will recieve the new name on success * \param path, path to save the file (normally in project temp dir. (does not include filename) * \returns true on success (Ok), false on failure (Cancel) */ bool newFileDialog( QString &name, const KURL &path ); protected: /** * This must be implemented by each part */ virtual bool openFile(); /** * This must be implemented by each read-write part */ virtual bool saveFile(); protected slots: void fileOpen(); void fileSaveAs(); private: //QMultiLineEdit *m_widget; PcbEdit *m_widget; }; class KInstance; class KAboutData; class PcbEditPartFactory : public KParts::Factory { Q_OBJECT public: PcbEditPartFactory(); virtual ~PcbEditPartFactory(); virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name, const char *classname, const QStringList &args ); static KInstance* instance(); private: static KInstance* s_instance; static KAboutData* s_about; }; #endif // PCBEDITPART_H --- NEW FILE: layereditdlg.h --- // file : .h // Descr : // Author : Ricky White ( ri...@ne... ) // License : GNU GPL General Public License // Copyright : Copyright (C) Ricky White 2004 /////////////////////////////////////////////////////////////////////////////// #ifndef LAYEREDITDLG_H #define LAYEREDITDLG_H #include "layer_edit_form.h" #include "pcbcanvas.h" /** @author Ricky White <ri...@ne...> */ class LayerEditDlg : public LayerEditForm { public: LayerEditDlg( PcbCanvas &canvas ); ~LayerEditDlg(); protected: PcbCanvas &mCanvas; }; #endif --- NEW FILE: layer.h --- // file : layer.h // Descr : Define detailes about a PCB layer // Author : Ricky White ( ri...@ne... ) // License : GNU GPL General Public License // Copyright : Copyright (C) Ricky White 2004 /////////////////////////////////////////////////////////////////////////////// #ifndef LAYER_H #define LAYER_H #include <vector> #include <qstring.h> /** Define everything about a PCB layer @author Ricky White <ri...@ne...> */ class Layer { public: Layer(); ~Layer(); QString name(); int stackId(); bool visible() { return true; } typedef enum { TOP, MIDDLE, BOTTOM, TOP_OVERLAY, BOTTOM_OVERLAY, DRILL, TOP_MASK, BOTTOM_MASK } LAYER_TYPE; protected: }; typedef std::vector<Layer> LayerVector; #endif |
From: Ricky W. <ri...@us...> - 2006-08-26 13:21:34
|
Update of /cvsroot/reds/rapideds/src/schedit In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28791/src/schedit Modified Files: Makefile.am Log Message: Initial PCB framework Index: Makefile.am =================================================================== RCS file: /cvsroot/reds/rapideds/src/schedit/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.am 14 Jul 2005 19:30:38 -0000 1.6 --- Makefile.am 26 Aug 2006 13:21:31 -0000 1.7 *************** *** 13,20 **** partrcdir = $(kde_datadir)/rapidEDS partrc_DATA = rapideds_schedit_part.rc ! libschedit_part_la_LIBADD = $(top_builddir)/src/ui/lib-ui.la \ ! $(top_builddir)/src/projectmgr/libprojectmgr.la $(top_builddir)/src/schedit/schtool/libschtool.la \ ! $(top_builddir)/src/schedit/schobj/librapideds_schobj.la $(top_builddir)/src/common/librapideds-common.la \ ! $(top_builddir)/src/cadlib/core/libcadlib-core.la $(top_builddir)/src/common/cadtool/libcadtool.la \ ! $(top_builddir)/src/interfaces/libinterfaces.la $(LIB_KDEPRINT) $(LIB_KDEUI) $(LIB_KDECORE) SUBDIRS = schobj schtool --- 13,21 ---- partrcdir = $(kde_datadir)/rapidEDS partrc_DATA = rapideds_schedit_part.rc ! libschedit_part_la_LIBADD = $(top_builddir)/src/ui/schematic/libsch_ui.la \ ! $(top_builddir)/src/ui/lib-ui.la $(top_builddir)/src/projectmgr/libprojectmgr.la \ ! $(top_builddir)/src/schedit/schtool/libschtool.la $(top_builddir)/src/schedit/schobj/librapideds_schobj.la \ ! $(top_builddir)/src/common/librapideds-common.la $(top_builddir)/src/cadlib/core/libcadlib-core.la \ ! $(top_builddir)/src/common/cadtool/libcadtool.la $(top_builddir)/src/interfaces/libinterfaces.la $(LIB_KDEPRINT) \ ! $(LIB_KDEUI) $(LIB_KDECORE) SUBDIRS = schobj schtool |
From: Ricky W. <ri...@us...> - 2006-08-26 13:21:34
|
Update of /cvsroot/reds/rapideds/src/schedit/schobj In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28791/src/schedit/schobj Modified Files: schobj.h Log Message: Initial PCB framework Index: schobj.h =================================================================== RCS file: /cvsroot/reds/rapideds/src/schedit/schobj/schobj.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** schobj.h 26 Jul 2005 22:07:43 -0000 1.7 --- schobj.h 26 Aug 2006 13:21:31 -0000 1.8 *************** *** 16,20 **** class KPopupMenu; #define SCH_RTTI_BASE 5000 ! #define SCH_RTTI_MAX 10000 class PrjDoc; --- 16,20 ---- class KPopupMenu; #define SCH_RTTI_BASE 5000 ! #define SCH_RTTI_MAX 5999 class PrjDoc; |
From: Ricky W. <ri...@us...> - 2006-08-26 13:21:34
|
Update of /cvsroot/reds/rapideds/src/pcbedit/pcbobj In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28791/src/pcbedit/pcbobj Added Files: Makefile.am pcbobj.cpp pcbobj.h po_pad.cpp po_pad.h po_track.cpp po_track.h Log Message: Initial PCB framework --- NEW FILE: po_track.cpp --- // file : po_track.cpp // Descr : PCB Track object // Author : Ricky White ( ri...@ne... ) // License : GNU GPL General Public License // Copyright : Copyright (C) Ricky White 2004 /////////////////////////////////////////////////////////////////////////////// #include <qcanvas.h> #include <qpainter.h> #include <kdebug.h> #include <math.h> #include "pcbcanvas.h" #include "po_track.h" PO_Track::PO_Track( PcbCanvas *canvas ) : PcbObj(canvas) { m_StartPt = UnitsPt( Units(5,Units::MM), Units(5,Units::MM) ); m_EndPt = UnitsPt( Units(5,Units::MM), Units(100,Units::MM) ); m_LayerId = 0; // Test only m_Thickness = Units(5,Units::MM); UpdateAreaPoints(); } PO_Track::~PO_Track() { } QPointArray PO_Track::areaPoints() const { // QRect rc(0,0,5,5); // rc = m_pin.boundingRect( m_pos.x(), m_pos.y() ) // .inflate(Units(1,Units::MM)).rect(m_canvas->zoom()); /// @TODO calculate a bounding area for the line. This should be calculated only when the line is moved and just be returned here. // return QPointArray(rc); return m_boundary; } void PO_Track::drawLayer( QPainter &p, int layer ) { //UpdateAreaPoints(); update(); if( layer==m_LayerId ) { QPen pen( blue, uint(m_Thickness.pixel(m_canvas->zoom())), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin ); QPen oldpen = p.pen(); p.setPen(pen); p.drawLine( m_StartPt.getQPoint( m_canvas->zoom() ), m_EndPt.getQPoint( m_canvas->zoom() ) ); p.setPen(oldpen); p.drawLine( tmp_x1,tmp_y1, tmp_x2, tmp_y2); p.drawLine( t_x1,t_y1, t_x2, t_y2); QPen penr( white ); p.setPen(penr); p.drawPoints( m_boundary ); p.drawPolygon( m_boundary ); p.setPen(oldpen); } } void PO_Track::moveBy( UnitsPt delta ) { invalidate(); m_StartPt += delta; m_EndPt += delta; update(); } void PO_Track::update() { float z = m_canvas->zoom(); invalidate(); UpdateAreaPoints(); if(isSelected()) setPen(white); else setPen(black); QCanvasPolygonalItem::update(); } /** Recalculate the m_boundary points. Call after anything changes that will affect th boundary */ void PO_Track::UpdateAreaPoints() { //m_boundary. // Figure out line orientation // relative to 0 degrees being right Units v = m_EndPt.y() - m_StartPt.y(); Units h = m_EndPt.x() - m_StartPt.x(); double zoom = m_canvas->zoom(); double theta_radians = atan( v.pixel(zoom)/h.pixel(zoom) ); // kdDebug()<<"Line angle = "<<theta_radians*180/M_PI<<endl; double arc_base_rad = theta_radians - M_PI_2; // -90deg double radius = m_Thickness.pixel(zoom)/2; // work out new points // kdDebug()<<"Arc angle = "<<arc_base_rad*180/M_PI<<endl; double y = radius * sin(arc_base_rad); double x = radius * cos(arc_base_rad); // kdDebug()<<"x = "<<x<<endl; // kdDebug()<<"y = "<<y<<endl; QPoint pt1,pt2,pt3,pt4; // kdDebug()<<"*** arc_base_rad = "<<arc_base_rad*180/M_PI<<endl; // what dir and type bool is_start = true; if( (m_StartPt.y()<=m_EndPt.y()&&theta_radians>=0) || (m_StartPt.y()>m_EndPt.y()&& theta_radians<0) ) { pt1.setX( m_StartPt.x().pixel(zoom) + x + y ); pt1.setY( m_StartPt.y().pixel(zoom) + y - x ); pt2.setX( m_StartPt.x().pixel(zoom) - x + y ); pt2.setY( m_StartPt.y().pixel(zoom) - y - x ); pt3.setX( m_EndPt.x().pixel(zoom) + x - y ); pt3.setY( m_EndPt.y().pixel(zoom) + y + x ); pt4.setX( m_EndPt.x().pixel(zoom) - x - y ); pt4.setY( m_EndPt.y().pixel(zoom) - y + x ); } else { pt1.setX( m_StartPt.x().pixel(zoom) + x - y ); pt1.setY( m_StartPt.y().pixel(zoom) + y + x ); pt2.setX( m_StartPt.x().pixel(zoom) - x - y ); pt2.setY( m_StartPt.y().pixel(zoom) - y + x ); pt3.setX( m_EndPt.x().pixel(zoom) + x + y ); pt3.setY( m_EndPt.y().pixel(zoom) + y - x ); pt4.setX( m_EndPt.x().pixel(zoom) - x + y ); pt4.setY( m_EndPt.y().pixel(zoom) - y - x ); } // extract arc base line (end of rectangular part of track // t_x1 = m_StartPt.x().pixel(zoom) + x; // t_y1 = m_StartPt.y().pixel(zoom) + y; // t_x2 = m_StartPt.x().pixel(zoom) - x; // t_y2 = m_StartPt.y().pixel(zoom) - y; tmp_x1 = pt1.x(); tmp_y1 = pt1.y(); tmp_x2 = pt2.x(); tmp_y2 = pt2.y(); t_x1 = pt3.x(); t_y1 = pt3.y(); t_x2 = pt4.x(); t_y2 = pt4.y(); QPointArray pa,z; pa.putPoints(0,5,pt1.x(),pt1.y(),pt2.x(),pt2.y(),pt4.x(),pt4.y(),pt3.x(),pt3.y(),pt1.x(),pt1.y()); //z.makeArc(10,10,50,100,1000,2000); //z.makeArc(m_StartPt.x().pixel(zoom) + x,m_StartPt.y().pixel(zoom) + y,2*radius,2*radius,0,5760); //z.makeArc(m_StartPt.x().pixel(zoom)-x,m_StartPt.y().pixel(zoom)-y,2*radius,2*radius,0,5700); // z.makeArc(pt2.x(),pt2.y(),2*radius,2*radius,0,5700); // pa.putPoints(5,z.size(),z); //pa.makeArc( m_boundary = pa; } void PO_Track::setStart( UnitsPt pt ) { invalidate(); m_StartPt = pt; update(); } void PO_Track::setEnd( UnitsPt pt ) { invalidate(); m_EndPt = pt; update(); } #if 0 void PO_Track::moveBy( UnitsPt delta ) { invalidate(); m_pos+=delta; update();} void PO_Track::setPosX( Units x ) { invalidate(); m_pos.setX(x); update(); } void PO_Track::setPosY( Units y ) { invalidate(); m_pos.setY(y); update(); } void PO_Track::setPos( UnitsPt point ) { invalidate(); m_pos = point; update(); } void PO_Track::setPos( Units x, Units y ) { invalidate(); m_pos.setX(x); m_pos.setY(y); update(); } #endif /////////////////////////////////////////////////////////////////////////////// // Load / Save support /////////////////////////////////////////////////////////////////////////////// QString PO_Track::xml( int indent ) const { } XMLRET PO_Track::setXml( QString elementName, const QXmlAttributes &attr, QString text, bool bBCData) { } --- NEW FILE: po_pad.cpp --- // file : po_pad.cpp // Descr : PCB Pad object // Author : Ricky White ( ri...@ne... ) // License : GNU GPL General Public License // Copyright : Copyright (C) Ricky White 2004 /////////////////////////////////////////////////////////////////////////////// #include <qcanvas.h> #include <qpainter.h> #include <kdebug.h> #include <math.h> #include "pcbcanvas.h" #include "po_pad.h" PO_Pad::PO_Pad( PcbCanvas *canvas ) : PcbObj(canvas) { UpdateAreaPoints(); } PO_Pad::~PO_Pad() { } QPointArray PO_Pad::areaPoints() const { return m_boundary; } void PO_Pad::drawLayer( QPainter &p, int layer ) { update(); /// @TODO draw each layer here } void PO_Pad::moveBy( UnitsPt delta ) { invalidate(); m_pos += delta; update(); } void PO_Pad::update() { float z = m_canvas->zoom(); invalidate(); UpdateAreaPoints(); if(isSelected()) setPen(white); else setPen(black); QCanvasPolygonalItem::update(); } /** Recalculate the m_boundary points. Call after anything changes that will affect th boundary */ void PO_Pad::UpdateAreaPoints() { m_boundary = QPointArray(QRect(0,0,1,1)); } #if 0 void PO_Pad::moveBy( UnitsPt delta ) { invalidate(); m_pos+=delta; update();} void PO_Pad::setPosX( Units x ) { invalidate(); m_pos.setX(x); update(); } void PO_Pad::setPosY( Units y ) { invalidate(); m_pos.setY(y); update(); } void PO_Pad::setPos( UnitsPt point ) { invalidate(); m_pos = point; update(); } void PO_Pad::setPos( Units x, Units y ) { invalidate(); m_pos.setX(x); m_pos.setY(y); update(); } #endif /////////////////////////////////////////////////////////////////////////////// // Load / Save support /////////////////////////////////////////////////////////////////////////////// QString PO_Pad::xml( int indent ) const { } XMLRET PO_Pad::setXml( QString elementName, const QXmlAttributes &attr, QString text, bool bBCData) { return XML_FAIL; } --- NEW FILE: po_track.h --- // file : .h // Descr : // Author : Ricky White ( ri...@ne... ) // License : GNU GPL General Public License // Copyright : Copyright (C) Ricky White 2004 /////////////////////////////////////////////////////////////////////////////// #ifndef PO_TRACK_H #define PO_TRACK_H #include "pcbobj.h" #include "layer.h" #include "units.h" /** Implements a PCB Track object @author Ricky White <ri...@ne...> */ class PO_Track : public PcbObj { public: PO_Track( PcbCanvas *canvas ); ~PO_Track(); virtual int rtti() const { return PcbObj::PO_RTTI_TRACK; } virtual QString name() const { return "Track"; } // Functions required for QCanvasPolygonalItem QPointArray areaPoints() const; // PcbObj specific items void drawLayer( QPainter &p, int layer ); void moveBy( UnitsPt delta ); void update(); // Object specific functions void setStart( UnitsPt pt ); void setEnd( UnitsPt pt ); UnitsPt start() { return m_StartPt; } UnitsPt end() { return m_EndPt; } // Load / Save support /////////////////////////////////////////////////////////////////////////// virtual QString xml( int indent ) const; virtual XMLRET setXml( QString elementName, const QXmlAttributes &attr, QString text, bool bBCData); protected: int16_t m_LayerId; ///<See document layer table map for this Units m_Thickness; UnitsPt m_StartPt, m_EndPt; QPointArray m_boundary; double tmp_x1,tmp_x2,tmp_y1,tmp_y2; double t_x1,t_x2,t_y1,t_y2; void UpdateAreaPoints(); }; #endif --- NEW FILE: pcbobj.h --- // file : pcbobj.h // Descr : Base class for all objects that go aon a PCB canvas. // Author : Ricky White ( ri...@ne... ) // License : GNU GPL General Public License // Copyright : Copyright (C) Ricky White 2004 /////////////////////////////////////////////////////////////////////////////// #ifndef PCBOBJ_H #define PCBOBJ_H #include "cadobj.h" #include "layer.h" /** Base object for all objects that go on a PCB. This class adds support for PCB layers. @TODO: how will layers be handled? do we need a draw(Layer)? default draw should draw layers in the correct order (back to front) PcbObj's are made up of a lot of subparts, one for each layer. need to handle adding a new layer. Should layer objects be a child of the part or just the the one Obj with different draw layer id's and draw each layer separatly with the clickable area equal the the may size. All PcbObj's are derived from QCanvasItem but not too much of the origional calss is used. @author Ricky White <ri...@ne...> */ #include <qcanvas.h> // foward declarations class PcbCanvas; #define PCB_RTTI_BASE 6000 #define PCB_RTTI_MAX 6999 class PcbObj : public CadObj, public QCanvasPolygonalItem { public: PcbObj( PcbCanvas *canvas ); ~PcbObj(); enum { PO_RTTI_TRACK = PCB_RTTI_BASE, PO_RTTI_PAD }; static bool isPcbObj( QCanvasItem *obj ); // Rendering /////////////////////////////////////////////////////////////////////////// void drawShape( QPainter &p ); virtual void drawLayer( QPainter &p, int layer ); // User interaction /////////////////////////////////////////////////////////////////////////// virtual void properties() { kdDebug()<<"NO PROPERTIES IMPLEMENTED"<<endl; } // Load / Save support /////////////////////////////////////////////////////////////////////////// virtual QString xml( int indent ) const=0; virtual XMLRET setXml( QString elementName, const QXmlAttributes &attr, QString text, bool bBCData)=0; protected: PcbCanvas *m_canvas; }; #endif --- NEW FILE: pcbobj.cpp --- // file : .cpp // Descr : // Author : Ricky White ( ri...@ne... ) // License : GNU GPL General Public License // Copyright : Copyright (C) Ricky White 2004 /////////////////////////////////////////////////////////////////////////////// #include <kdebug.h> #include "pcbcanvas.h" #include "pcbobj.h" bool PcbObj::isPcbObj( QCanvasItem *obj ) { bool r=(obj->rtti()>=PCB_RTTI_BASE)&&(obj->rtti()<=PCB_RTTI_MAX); return r; } PcbObj::PcbObj( PcbCanvas *canvas ) : QCanvasPolygonalItem(canvas), m_canvas(canvas) { } PcbObj::~PcbObj() { } /** Default version of drawShape. Draw all layers marked as visible on the canvas. This is not the prefered display method, it is prefered that the canvas be modified to handle this and it will be so that the correct layering is preserved with multiple overlapping objects but for now this is a quick way to get things basically working for minimal effort that is not wasted. \param p Painter to draw the object on */ void PcbObj::drawShape( QPainter &p ) { // loop through canvas layers vector drawing in order, ie last in vector is // the top most layer. drawLayer( p, 0 ); } /** Draw a single layer of the object. This function must be re-implemented by all subclasses. \param p QPainter to draw on \param layer index to draw */ void PcbObj::drawLayer( QPainter &p, int layer ) { kdDebug() << "You have not implemented drawLayer for '"<<name()<<"'"<<endl; } --- NEW FILE: po_pad.h --- // file : .h // Descr : // Author : Ricky White ( ri...@ne... ) // License : GNU GPL General Public License // Copyright : Copyright (C) Ricky White 2004 /////////////////////////////////////////////////////////////////////////////// #ifndef PO_PAD_H #define PO_PAD_H #include "pcbobj.h" #include "layer.h" #include "units.h" /** PCB Pad object @author Ricky White <ri...@ne...> */ class PO_Pad : public PcbObj { public: PO_Pad( PcbCanvas *canvas ); ~PO_Pad(); virtual int rtti() const { return PcbObj::PO_RTTI_PAD; } virtual QString name() const { return "PO_Pad"; } // Functions required for QCanvasPolygonalItem QPointArray areaPoints() const; // PcbObj specific items void drawLayer( QPainter &p, int layer ); void moveBy( UnitsPt delta ); void update(); // Object specific functions // Load / Save support /////////////////////////////////////////////////////////////////////////// virtual QString xml( int indent ) const; virtual XMLRET setXml( QString elementName, const QXmlAttributes &attr, QString text, bool bBCData); protected: QPointArray m_boundary; void UpdateAreaPoints(); }; #endif --- NEW FILE: Makefile.am --- INCLUDES = -I$(top_srcdir)/sqlite -I$(top_srcdir)/src/common \ -I$(top_srcdir)/src/common/cadobj -I$(top_srcdir)/src/interfaces -I$(top_srcdir)/src/pcbedit \ -I$(top_srcdir)/src/projectmgr -I$(top_srcdir)/src/ui -I$(top_srcdir)/src/ui/pcb -Ikmdi \ $(all_includes) METASOURCES = AUTO lib_LTLIBRARIES = librapideds_pcbobj.la librapideds_pcbobj_la_LDFLAGS = $(all_libraries) noinst_HEADERS = pcbobj.h po_track.h po_pad.h librapideds_pcbobj_la_SOURCES = pcbobj.cpp po_track.cpp po_pad.cpp |
From: Ricky W. <ri...@us...> - 2006-08-26 13:21:34
|
Update of /cvsroot/reds/rapideds/src/interfaces In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28791/src/interfaces Modified Files: Makefile.am Log Message: Initial PCB framework Index: Makefile.am =================================================================== RCS file: /cvsroot/reds/rapideds/src/interfaces/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.am 14 Jul 2005 19:30:38 -0000 1.2 --- Makefile.am 26 Aug 2006 13:21:30 -0000 1.3 *************** *** 1,4 **** INCLUDES = -I$(top_srcdir)/sqlite -I$(top_srcdir)/src \ ! -I$(top_srcdir)/src/projectmgr $(all_includes) METASOURCES = AUTO libinterfaces_la_LDFLAGS = $(all_libraries) --- 1,4 ---- INCLUDES = -I$(top_srcdir)/sqlite -I$(top_srcdir)/src \ ! -I$(top_srcdir)/src/common -I$(top_srcdir)/src/projectmgr $(all_includes) METASOURCES = AUTO libinterfaces_la_LDFLAGS = $(all_libraries) |
From: Ricky W. <ri...@us...> - 2006-08-26 13:02:55
|
Update of /cvsroot/reds/rapideds/src/ui/pcb In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24514/pcb Log Message: Directory /cvsroot/reds/rapideds/src/ui/pcb added to the repository |
From: Ricky W. <ri...@us...> - 2006-08-26 12:56:29
|
Update of /cvsroot/reds/rapideds/src/pcbedit/pcbtool In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22054/pcbtool Log Message: Directory /cvsroot/reds/rapideds/src/pcbedit/pcbtool added to the repository |
From: Ricky W. <ri...@us...> - 2006-08-26 12:56:18
|
Update of /cvsroot/reds/rapideds/src/pcbedit/pcbobj In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22031/pcbobj Log Message: Directory /cvsroot/reds/rapideds/src/pcbedit/pcbobj added to the repository |
From: Ricky W. <ri...@us...> - 2006-08-26 12:54:57
|
Update of /cvsroot/reds/rapideds/src/pcbedit In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv21266/pcbedit Log Message: Directory /cvsroot/reds/rapideds/src/pcbedit added to the repository |
From: Ricky W. <ri...@us...> - 2006-07-29 13:24:28
|
Update of /cvsroot/reds/rapideds/src/common/cadtool In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5029 Modified Files: cadtoolgl.cpp cadtoolgl.h Log Message: Make cadtoolgl snap grid configurable by the editor Index: cadtoolgl.h =================================================================== RCS file: /cvsroot/reds/rapideds/src/common/cadtool/cadtoolgl.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cadtoolgl.h 27 Aug 2005 14:14:55 -0000 1.2 --- cadtoolgl.h 29 Jul 2006 13:21:53 -0000 1.3 *************** *** 37,40 **** --- 37,41 ---- virtual void showCursor( bool show ); virtual void setZoom(float zoom); + protected: virtual void updateCursorPos( QMouseEvent *e ); Index: cadtoolgl.cpp =================================================================== RCS file: /cvsroot/reds/rapideds/src/common/cadtool/cadtoolgl.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cadtoolgl.cpp 27 Aug 2005 14:14:55 -0000 1.2 --- cadtoolgl.cpp 29 Jul 2006 13:21:53 -0000 1.3 *************** *** 21,29 **** CadToolGL::CadToolGL( QCanvasView *view, PrjDoc &prj ) ! : CadTool( view, prj ) { m_cursorItem=0; m_locked=true; view->viewport()->setMouseTracking( true ); } --- 21,30 ---- CadToolGL::CadToolGL( QCanvasView *view, PrjDoc &prj ) ! : CadTool( view, prj ) { m_cursorItem=0; m_locked=true; view->viewport()->setMouseTracking( true ); + m_grid = Units( 5, Units::MM ); } *************** *** 38,42 **** if( m_locked ) { ! double grid=Units(5,Units::MM).pixel(m_zoom); // grid in pixels double rx = fmod(pt.x(),grid); double ry = fmod(pt.y(),grid); --- 39,43 ---- if( m_locked ) { ! double grid = m_grid.pixel(m_zoom); // grid in pixels double rx = fmod(pt.x(),grid); double ry = fmod(pt.y(),grid); |
From: Ricky W. <ri...@us...> - 2006-07-15 08:13:00
|
Update of /cvsroot/reds/rapideds In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv7809 Modified Files: report.sh Log Message: Added dat, minor format change Index: report.sh =================================================================== RCS file: /cvsroot/reds/rapideds/report.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** report.sh 15 Jul 2006 08:07:23 -0000 1.1 --- report.sh 15 Jul 2006 08:12:42 -0000 1.2 *************** *** 3,10 **** # please attach the outut of this script to bug reports to help ensure a quick # solution to your problem #info about system echo System Info: ! echo ============================================================================ uname --all echo --- 3,14 ---- # please attach the outut of this script to bug reports to help ensure a quick # solution to your problem + echo System information dump to aid in debugging: + echo ============================================================================ + date + echo #info about system echo System Info: ! echo ---------------------------------------------------------------------------- uname --all echo *************** *** 12,22 **** # GCC info ! echo GCC info ! echo ============================================================================ gcc --version # Info about the kde install echo KDE info: ! echo ============================================================================ kde-config --version --- 16,26 ---- # GCC info ! echo GCC info: ! echo ---------------------------------------------------------------------------- gcc --version # Info about the kde install echo KDE info: ! echo ---------------------------------------------------------------------------- kde-config --version *************** *** 26,29 **** echo local prefix = `kde-config --localprefix` echo ! ! --- 30,33 ---- echo local prefix = `kde-config --localprefix` echo ! echo ============================================================================ ! echo |
From: Ricky W. <ri...@us...> - 2006-07-15 08:07:28
|
Update of /cvsroot/reds/rapideds In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5817 Added Files: report.sh Log Message: Add report.sh script to collect information useful when reporting bugs --- NEW FILE: report.sh --- #!/bin/bash # Script to collect information about your system # please attach the outut of this script to bug reports to help ensure a quick # solution to your problem #info about system echo System Info: echo ============================================================================ uname --all echo echo # GCC info echo GCC info echo ============================================================================ gcc --version # Info about the kde install echo KDE info: echo ============================================================================ kde-config --version echo prefix = `kde-config --prefix` echo ecec_prefix = `kde-config --exec-prefix` echo library path suffix = `kde-config --libsuffix` echo local prefix = `kde-config --localprefix` echo |
From: Ricky W. <ri...@us...> - 2006-01-07 01:23:20
|
Update of /cvsroot/reds/rapideds/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17396 Modified Files: netlist.cpp netlist.h Log Message: Ensure database statments are freed in all return paths to prevent leaving the database table locked Index: netlist.h =================================================================== RCS file: /cvsroot/reds/rapideds/src/common/netlist.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** netlist.h 15 Jul 2005 16:16:04 -0000 1.4 --- netlist.h 7 Jan 2006 01:23:09 -0000 1.5 *************** *** 59,62 **** --- 59,65 ---- ~Netlist(); + /** close the current netlist database and open a new one + */ + bool Netlist::open( QString file ); typedef std::list<Net> Nets; *************** *** 179,182 **** --- 182,189 ---- */ RET addScope( QString scope, int id=-1 ); + + + QString netName( Net::ID id ); ///< get the name current associated with a net id + RET exportXML( KURL url ); *************** *** 205,208 **** --- 212,216 ---- int getScopeId( QString scope ); ///< get id for the named scope int Netlist::getNetId( int scope, QString name ); ///< get id for the named net + void precompile(); ///< call to precompile the common SQL queries void release(); ///< free resources used by precompile() Index: netlist.cpp =================================================================== RCS file: /cvsroot/reds/rapideds/src/common/netlist.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** netlist.cpp 15 Jul 2005 16:16:02 -0000 1.6 --- netlist.cpp 7 Jan 2006 01:23:09 -0000 1.7 *************** *** 35,38 **** --- 35,39 ---- bool bInit = false; bInit = (file==":memory:") || (!QFile::exists(file)); + kdDebug()<<"netlist database file = \""<<file<<"\""<<endl; if( sqlite3_open(file, &m_db)!=SQLITE_OK ) { *************** *** 54,57 **** --- 55,72 ---- } + bool Netlist::open( QString file ) + { + kdDebug()<<"Netlist::setFile( "<<file<<" )"<<endl; + release(); + sqlite3_close(m_db); + bool bInit = (file==":memory:") || (!QFile::exists(file)); + if( sqlite3_open(file, &m_db)!=SQLITE_OK ) + return false; + if(bInit) + init(); // populate the database with tables + precompile(); + return true; + } + bool Netlist::init() { *************** *** 173,177 **** if( name.isEmpty() ) name = "$$$TEMP$$$"; ! sqlite3_stmt *stmt = (id==-1) ? m_stmtAddNet : m_stmtAddNetId; sqlite3_reset( stmt ); --- 188,192 ---- if( name.isEmpty() ) name = "$$$TEMP$$$"; ! // @TODO: make this more robust, check that scop exsists before continuing, report noticable debug error! sqlite3_stmt *stmt = (id==-1) ? m_stmtAddNet : m_stmtAddNetId; sqlite3_reset( stmt ); *************** *** 221,224 **** --- 236,240 ---- case SQLITE_ROW: kdDebug()<<"unique=false"<<endl; + sqlite3_reset(m_stmtNetsInScope); return false; // exsists since a row was returned case SQLITE_BUSY: *************** *** 227,230 **** --- 243,247 ---- default: kdDebug()<<"ERROR [netlist] "<<sqlite3_errmsg( m_db )<<endl; + sqlite3_reset(m_stmtNetsInScope); return false; // Somthing BAD happened! return the safest option } *************** *** 272,287 **** } int Netlist::getScopeId( QString scope ) { sqlite3_reset(m_stmtScopeId); sqlite3_bind_text( m_stmtScopeId, 1, scope, -1, SQLITE_STATIC ); switch( sqlite3_step( m_stmtScopeId ) ) { case SQLITE_ROW: ! return sqlite3_column_int( m_stmtScopeId, 0); break; case SQLITE_DONE: kdDebug()<<"ERROR [netlist] "<<sqlite3_errmsg( m_db )<<endl; } return Net::INVALID_ID; } --- 289,339 ---- } + QString Netlist::netName( Net::ID id ) + { + QString sql, name; + int nrow, ncolumn; + char *errmsg; + char **result; + kdDebug()<<"Netlist::getNetId( '"<<name<<"' )"<<endl; + sql = QString("SELECT name FROM netlist WHERE id=%1;").arg( id ); + int r = sqlite3_get_table( m_db, sql, &result, &nrow, &ncolumn, &errmsg ); + if( r!=SQLITE_OK ) + { + kdDebug()<<"ERROR [netlist] "<<errmsg<<endl; + sqlite3_free(errmsg); + return "INVALID"; + } + if( nrow==1 ) + { + name = QString( result[1*ncolumn] ); // Row 1 is first data (0=header) + sqlite3_free_table(result); + return name; + } + else + { + if( nrow>1 ) + kdDebug()<<"ERROR [netlist] Database error, Multiple entries for the same net id"<<endl; + sqlite3_free_table(result); + return "INVALID"; + } + } + int Netlist::getScopeId( QString scope ) { sqlite3_reset(m_stmtScopeId); sqlite3_bind_text( m_stmtScopeId, 1, scope, -1, SQLITE_STATIC ); + int r; + switch( sqlite3_step( m_stmtScopeId ) ) { case SQLITE_ROW: ! r = sqlite3_column_int( m_stmtScopeId, 0); ! sqlite3_reset(m_stmtScopeId); ! return r; break; case SQLITE_DONE: kdDebug()<<"ERROR [netlist] "<<sqlite3_errmsg( m_db )<<endl; } + sqlite3_reset(m_stmtScopeId); return Net::INVALID_ID; } *************** *** 324,327 **** --- 376,380 ---- int r; kdDebug()<<"addConnection( "<<id<<", "<<d.text(Designator::ALPHA)<<", "<<pin<<" )"<<endl; + // make sure this isn't a duplicate entry r=sqlite3_reset(m_stmtConnection); *************** *** 335,338 **** --- 388,392 ---- { int nid=sqlite3_column_int( m_stmtConnection, 1 ); + sqlite3_reset(m_stmtConnection); if( nid==id ) return CONN_ALREADY_EXSISTS; *************** *** 403,410 **** int r; Net::ID master, secondary; ! // @TODO: Decide master/secondary order. master = id1; secondary = id2; ! r = sqlite3_reset( m_stmtMergeNet ); if(r!=SQLITE_OK) kdDebug()<<"ERROR [netlist] "<<sqlite3_errmsg( m_db )<<endl; --- 457,469 ---- int r; Net::ID master, secondary; ! // @FIXME: Decide master/secondary order, based on priority, eg named vs unnamed nets ! // nets with locked net names etc master = id1; secondary = id2; ! if( id1==id2 ) ! { ! kdDebug()<<"MERGE but net ids are identical"<<endl; ! return MERGE_ID1; ! } r = sqlite3_reset( m_stmtMergeNet ); if(r!=SQLITE_OK) kdDebug()<<"ERROR [netlist] "<<sqlite3_errmsg( m_db )<<endl; *************** *** 414,421 **** --- 473,486 ---- if(r!=SQLITE_OK) kdDebug()<<"ERROR [netlist] "<<sqlite3_errmsg( m_db )<<endl; r = sqlite3_step( m_stmtMergeNet ); + + kdDebug()<<"Netlist::mergeNets( "<<id1<<", "<<id2<<" ) " <<(r==SQLITE_DONE?"OK":"FAILED")<<endl; if( r==SQLITE_DONE ) return (master==id1) ? MERGE_ID1 : MERGE_ID2; else + { + kdDebug()<<"ERROR [netlist] "<<sqlite3_errmsg( m_db )<<endl; + sqlite3_reset( m_stmtMergeNet ); return MERGE_FAIL; + } } *************** *** 477,480 **** --- 542,547 ---- lst.push_back(conn); } while( r==SQLITE_ROW ); + + sqlite3_reset( m_stmtConnectionQuery ); return lst; } |
From: Ricky W. <ri...@us...> - 2006-01-06 22:01:34
|
Update of /cvsroot/reds/rapideds/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2713 Modified Files: rapideds.cpp Log Message: Make initial window start at a reasonable size Index: rapideds.cpp =================================================================== RCS file: /cvsroot/reds/rapideds/src/rapideds.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** rapideds.cpp 2 Jan 2006 10:15:39 -0000 1.11 --- rapideds.cpp 6 Jan 2006 22:01:21 -0000 1.12 *************** *** 43,47 **** createGUI( 0L ); setAutoSaveSettings(); ! // add project manager to the left tool pane m_prjmgr = new ProjectMgr( this ); --- 43,48 ---- createGUI( 0L ); setAutoSaveSettings(); ! setMinimumSize(800,600); ! // add project manager to the left tool pane m_prjmgr = new ProjectMgr( this ); |
From: Ricky W. <ri...@us...> - 2006-01-02 18:21:20
|
Update of /cvsroot/reds/rapideds In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24229 Modified Files: rapideds.kdevelop Log Message: kdev project now defaults to 64bit build, ignore not virtual destructios warning for now until gcc gets a clue of qt is updated Index: rapideds.kdevelop =================================================================== RCS file: /cvsroot/reds/rapideds/rapideds.kdevelop,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** rapideds.kdevelop 2 Jan 2006 10:15:39 -0000 1.9 --- rapideds.kdevelop 2 Jan 2006 18:21:08 -0000 1.10 *************** *** 14,23 **** </keywords> <ignoreparts> ! <part>KDevClearCase</part> ! <part>KDevcopyto</part> ! <part>KDevCTags</part> ! <part>KDevFileGroups</part> ! <part>KDevPerforce</part> ! <part>KDevsubversion</part> </ignoreparts> <projectdirectory>.</projectdirectory> --- 14,18 ---- </keywords> <ignoreparts> ! <part>kdevctags2</part> </ignoreparts> <projectdirectory>.</projectdirectory> *************** *** 36,39 **** --- 31,35 ---- <language>SQL</language> </secondaryLanguages> + <versioncontrol></versioncontrol> </general> <kdevautoproject> *************** *** 57,61 **** </runarguments> <customdirectory>/</customdirectory> ! <programargs/> <terminal>false</terminal> <autocompile>true</autocompile> --- 53,57 ---- </runarguments> <customdirectory>/</customdirectory> ! <programargs></programargs> <terminal>false</terminal> <autocompile>true</autocompile> *************** *** 89,106 **** <default> <envvars/> ! <configargs/> ! <builddir/> ! <topsourcedir/> ! <cppflags/> ! <ldflags/> <ccompiler>kdevgccoptions</ccompiler> <cxxcompiler>kdevgppoptions</cxxcompiler> <f77compiler>kdevpgf77options</f77compiler> ! <ccompilerbinary/> ! <cxxcompilerbinary/> ! <f77compilerbinary/> ! <cflags/> ! <cxxflags/> ! <f77flags/> </default> </configurations> --- 85,102 ---- <default> <envvars/> ! <configargs>--enable-libsuffix=64 --with-qt-dir=/usr/lib64/qt-3.3/ -with-qt-libraries=/usr/lib64/qt-3.3/lib/</configargs> ! <builddir></builddir> ! <topsourcedir></topsourcedir> ! <cppflags></cppflags> ! <ldflags></ldflags> <ccompiler>kdevgccoptions</ccompiler> <cxxcompiler>kdevgppoptions</cxxcompiler> <f77compiler>kdevpgf77options</f77compiler> ! <ccompilerbinary></ccompilerbinary> ! <cxxcompilerbinary>g++</cxxcompilerbinary> ! <f77compilerbinary></f77compilerbinary> ! <cflags></cflags> ! <cxxflags>-Wno-non-virtual-dtor</cxxflags> ! <f77flags></f77flags> </default> </configurations> *************** *** 113,117 **** <numberofjobs>6</numberofjobs> <dontact>false</dontact> ! <makebin/> <prio>0</prio> </make> --- 109,113 ---- <numberofjobs>6</numberofjobs> <dontact>false</dontact> ! <makebin></makebin> <prio>0</prio> </make> *************** *** 180,188 **** <general> <dbgshell>libtool</dbgshell> ! <programargs/> ! <gdbpath/> ! <configGdbScript/> ! <runShellScript/> ! <runGdbScript/> <breakonloadinglibs>true</breakonloadinglibs> <separatetty>false</separatetty> --- 176,184 ---- <general> <dbgshell>libtool</dbgshell> ! <programargs></programargs> ! <gdbpath></gdbpath> ! <configGdbScript></configGdbScript> ! <runShellScript></runShellScript> ! <runGdbScript></runGdbScript> <breakonloadinglibs>true</breakonloadinglibs> <separatetty>false</separatetty> *************** *** 207,211 **** <docsystem>Doxygen Documentation Collection</docsystem> <docurl>${APPNAMELC}.tag</docurl> ! <usermanualurl/> </projectdoc> </kdevdocumentation> --- 203,207 ---- <docsystem>Doxygen Documentation Collection</docsystem> <docurl>${APPNAMELC}.tag</docurl> ! <usermanualurl></usermanualurl> </projectdoc> </kdevdocumentation> *************** *** 238,241 **** --- 234,250 ---- <qtdesigner/> </designerintegration> + <qt> + <used>true</used> + <version>3</version> + <root>/usr/lib64/qt-3.3</root> + </qt> + <creategettersetter> + <prefixGet></prefixGet> + <prefixSet>set</prefixSet> + <prefixVariable>m_,_</prefixVariable> + <parameterName>theValue</parameterName> + <inlineGet>true</inlineGet> + <inlineSet>true</inlineSet> + </creategettersetter> </kdevcppsupport> <cppsupportpart> |
From: Ricky W. <ri...@us...> - 2006-01-02 16:52:47
|
Update of /cvsroot/reds/rapideds/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2737 Modified Files: designatormgr.cpp Log Message: prevent crash on loading schematic files Index: designatormgr.cpp =================================================================== RCS file: /cvsroot/reds/rapideds/src/common/designatormgr.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** designatormgr.cpp 2 Jan 2006 10:10:08 -0000 1.19 --- designatormgr.cpp 2 Jan 2006 16:52:33 -0000 1.20 *************** *** 1065,1069 **** DBERR( sqlite3_bind_int( m_stmtDesignatorById, 1, id ) ); int r = sqlite3_step( m_stmtDesignatorById ); - DBERR(r); if(r==SQLITE_ROW) { --- 1065,1068 ---- |
From: Ricky W. <ri...@us...> - 2006-01-02 10:15:48
|
Update of /cvsroot/reds/rapideds/src/projectmgr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23249/src/projectmgr Modified Files: netlistbrowsetool.cpp netlistbrowsetool.h Log Message: modify projecttool construtor arguments Index: netlistbrowsetool.cpp =================================================================== RCS file: /cvsroot/reds/rapideds/src/projectmgr/netlistbrowsetool.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** netlistbrowsetool.cpp 16 Jul 2005 18:41:10 -0000 1.3 --- netlistbrowsetool.cpp 2 Jan 2006 10:15:39 -0000 1.4 *************** *** 16,21 **** #include <common/netlist.h> ! NetlistBrowseTool::NetlistBrowseTool( QWidget *parent, const char *name, PrjDoc &project) ! : ProjectTool(parent, name, project) { setMinimumWidth(200); --- 16,21 ---- #include <common/netlist.h> ! NetlistBrowseTool::NetlistBrowseTool( PrjDoc &project, QWidget *parent, const char *name) ! : ProjectTool( project, parent, name) { setMinimumWidth(200); Index: netlistbrowsetool.h =================================================================== RCS file: /cvsroot/reds/rapideds/src/projectmgr/netlistbrowsetool.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** netlistbrowsetool.h 14 Jul 2005 19:30:38 -0000 1.1 --- netlistbrowsetool.h 2 Jan 2006 10:15:39 -0000 1.2 *************** *** 20,24 **** Q_OBJECT public: ! NetlistBrowseTool( QWidget * parent = 0, const char * name = 0, PrjDoc &project=0); virtual ~NetlistBrowseTool(); --- 20,24 ---- Q_OBJECT public: ! NetlistBrowseTool( PrjDoc &project, QWidget * parent = 0, const char * name = 0); virtual ~NetlistBrowseTool(); |
From: Ricky W. <ri...@us...> - 2006-01-02 10:15:47
|
Update of /cvsroot/reds/rapideds/src/interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23249/src/interfaces Modified Files: projecttool.cpp projecttool.h Log Message: modify projecttool construtor arguments Index: projecttool.h =================================================================== RCS file: /cvsroot/reds/rapideds/src/interfaces/projecttool.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** projecttool.h 14 Jul 2005 19:30:38 -0000 1.1 --- projecttool.h 2 Jan 2006 10:15:39 -0000 1.2 *************** *** 22,26 **** { public: ! ProjectTool(QWidget *parentWidget, const char *name, PrjDoc &project); ~ProjectTool(); --- 22,26 ---- { public: ! ProjectTool( PrjDoc &project, QWidget *parentWidget, const char *name); ~ProjectTool(); Index: projecttool.cpp =================================================================== RCS file: /cvsroot/reds/rapideds/src/interfaces/projecttool.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** projecttool.cpp 14 Jul 2005 19:30:38 -0000 1.1 --- projecttool.cpp 2 Jan 2006 10:15:39 -0000 1.2 *************** *** 8,12 **** ! ProjectTool::ProjectTool(QWidget *parentWidget, const char *name, PrjDoc &project) : QWidget( parentWidget, name ), m_project(project) { --- 8,12 ---- ! ProjectTool::ProjectTool( PrjDoc &project, QWidget *parentWidget, const char *name) : QWidget( parentWidget, name ), m_project(project) { |
From: Ricky W. <ri...@us...> - 2006-01-02 10:15:47
|
Update of /cvsroot/reds/rapideds/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23249/src Modified Files: rapideds.cpp Log Message: modify projecttool construtor arguments Index: rapideds.cpp =================================================================== RCS file: /cvsroot/reds/rapideds/src/rapideds.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** rapideds.cpp 30 Jul 2005 00:24:48 -0000 1.10 --- rapideds.cpp 2 Jan 2006 10:15:39 -0000 1.11 *************** *** 48,52 **** m_prjTool = addToolWindow( m_prjmgr, KDockWidget::DockLeft, getMainDockWidget() ); m_prjTool->hide(); ! NetlistBrowseTool *t = new NetlistBrowseTool( this,"Netlist Browse",*m_prjmgr->doc() ); addToolWindow( t, KDockWidget::DockBottom, getMainDockWidget() ); t->show(); --- 48,52 ---- m_prjTool = addToolWindow( m_prjmgr, KDockWidget::DockLeft, getMainDockWidget() ); m_prjTool->hide(); ! NetlistBrowseTool *t = new NetlistBrowseTool( *m_prjmgr->doc(), this,"Netlist Browse" ); addToolWindow( t, KDockWidget::DockBottom, getMainDockWidget() ); t->show(); |
From: Ricky W. <ri...@us...> - 2006-01-02 10:15:47
|
Update of /cvsroot/reds/rapideds In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23249 Modified Files: rapideds.kdevelop Log Message: modify projecttool construtor arguments Index: rapideds.kdevelop =================================================================== RCS file: /cvsroot/reds/rapideds/rapideds.kdevelop,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** rapideds.kdevelop 3 Sep 2005 04:46:31 -0000 1.8 --- rapideds.kdevelop 2 Jan 2006 10:15:39 -0000 1.9 *************** *** 222,229 **** </substmap> <kdevcppsupport> ! <references> ! <pcs>KDElibs</pcs> ! <pcs>Qt</pcs> ! </references> <codecompletion> <includeGlobalFunctions>true</includeGlobalFunctions> --- 222,226 ---- </substmap> <kdevcppsupport> ! <references/> <codecompletion> <includeGlobalFunctions>true</includeGlobalFunctions> |
From: Ricky W. <ri...@us...> - 2006-01-02 10:10:19
|
Update of /cvsroot/reds/rapideds/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22461 Modified Files: designatormgr.cpp Log Message: fix varible created within switch case that caused issues with new gcc Index: designatormgr.cpp =================================================================== RCS file: /cvsroot/reds/rapideds/src/common/designatormgr.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** designatormgr.cpp 3 Sep 2005 04:44:44 -0000 1.18 --- designatormgr.cpp 2 Jan 2006 10:10:08 -0000 1.19 *************** *** 910,916 **** case SQLITE_DONE: return -1; // Not found since no rows returned case SQLITE_ROW: ! int id = sqlite3_column_int( m_stmtPrefixId, 0); DBERR( sqlite3_reset(m_stmtPrefixId) ); ! return id; default: DBERR( r ); --- 910,916 ---- case SQLITE_DONE: return -1; // Not found since no rows returned case SQLITE_ROW: ! r = sqlite3_column_int( m_stmtPrefixId, 0); DBERR( sqlite3_reset(m_stmtPrefixId) ); ! return r; default: DBERR( r ); *************** *** 1004,1010 **** return -1; // Not found since no rows returned case SQLITE_ROW: ! int id = sqlite3_column_int( m_stmtScopeId, 0); DBERR( sqlite3_reset(m_stmtScopeId) ); ! return id; default: DBERR( r ); --- 1004,1010 ---- return -1; // Not found since no rows returned case SQLITE_ROW: ! r = sqlite3_column_int( m_stmtScopeId, 0); DBERR( sqlite3_reset(m_stmtScopeId) ); ! return r; default: DBERR( r ); |
From: Ricky W. <ri...@us...> - 2005-09-03 04:51:39
|
Update of /cvsroot/reds/rapideds/src/ui/schematic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11996/src/ui/schematic Modified Files: designator_prop.ui Log Message: Add designator properties dialog functionality Index: designator_prop.ui =================================================================== RCS file: /cvsroot/reds/rapideds/src/ui/schematic/designator_prop.ui,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** designator_prop.ui 26 Jul 2005 22:13:16 -0000 1.1 --- designator_prop.ui 3 Sep 2005 04:51:32 -0000 1.2 *************** *** 38,42 **** <widget class="KLineEdit"> <property name="name"> ! <cstring>kLineEdit1</cstring> </property> <property name="text"> --- 38,42 ---- <widget class="KLineEdit"> <property name="name"> ! <cstring>libPathLE</cstring> </property> <property name="text"> *************** *** 93,97 **** <widget class="KLineEdit"> <property name="name"> ! <cstring>kLineEdit1_2</cstring> </property> <property name="sizePolicy"> --- 93,97 ---- <widget class="KLineEdit"> <property name="name"> ! <cstring>defaultPrefixLE</cstring> </property> <property name="sizePolicy"> *************** *** 159,163 **** </property> <property name="text"> ! <string>Locked</string> </property> </widget> --- 159,163 ---- </property> <property name="text"> ! <string>Loc&ked</string> </property> </widget> *************** *** 166,169 **** --- 166,181 ---- <cstring>subpartHC</cstring> </property> + <property name="insertionPolicy"> + <enum>AtBottom</enum> + </property> + <property name="autoCompletion"> + <bool>true</bool> + </property> + <property name="duplicatesEnabled"> + <bool>false</bool> + </property> + <property name="urlDropsEnabled" stdset="0"> + <bool>false</bool> + </property> </widget> <widget class="QCheckBox" row="2" column="2"> *************** *** 185,189 **** <widget class="QCheckBox" row="1" column="2"> <property name="name"> ! <cstring>indexAutoCB</cstring> </property> <property name="text"> --- 197,201 ---- <widget class="QCheckBox" row="1" column="2"> <property name="name"> ! <cstring>indexAutoCBT</cstring> </property> <property name="text"> *************** *** 220,223 **** --- 232,250 ---- <cstring>indexHC</cstring> </property> + <property name="insertionPolicy"> + <enum>AtBottom</enum> + </property> + <property name="autoCompletion"> + <bool>true</bool> + </property> + <property name="duplicatesEnabled"> + <bool>false</bool> + </property> + <property name="contextMenuEnabled"> + <bool>false</bool> + </property> + <property name="urlDropsEnabled" stdset="0"> + <bool>false</bool> + </property> </widget> <widget class="QCheckBox" row="0" column="2"> *************** *** 226,230 **** </property> <property name="text"> ! <string>Auto</string> </property> </widget> --- 253,257 ---- </property> <property name="text"> ! <string>Default</string> </property> </widget> *************** *** 241,244 **** --- 268,286 ---- <cstring>prefixHC</cstring> </property> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="insertionPolicy"> + <enum>AtBottom</enum> + </property> + <property name="autoCompletion"> + <bool>true</bool> + </property> + <property name="duplicatesEnabled"> + <bool>false</bool> + </property> + <property name="contextMenuEnabled"> + <bool>false</bool> + </property> </widget> </grid> *************** *** 348,352 **** </connection> <connection> ! <sender>indexAutoCB</sender> <signal>toggled(bool)</signal> <receiver>indexHC</receiver> --- 390,394 ---- </connection> <connection> ! <sender>indexAutoCBT</sender> <signal>toggled(bool)</signal> <receiver>indexHC</receiver> *************** *** 359,366 **** <slot>applySlot()</slot> </connection> </connections> <slots> <slot access="protected">lockedSlot(bool locked)</slot> ! <slot>applySlot()</slot> </slots> <layoutdefaults spacing="6" margin="11"/> --- 401,415 ---- <slot>applySlot()</slot> </connection> + <connection> + <sender>prefixAutoCBT</sender> + <signal>toggled(bool)</signal> + <receiver>DesignatorPropForm</receiver> + <slot>defaultPrefixSlot(bool)</slot> + </connection> </connections> <slots> <slot access="protected">lockedSlot(bool locked)</slot> ! <slot returnType="bool">applySlot()</slot> ! <slot>defaultPrefixSlot( bool select )</slot> </slots> <layoutdefaults spacing="6" margin="11"/> |
From: Ricky W. <ri...@us...> - 2005-09-03 04:51:39
|
Update of /cvsroot/reds/rapideds/src/schedit/schobj In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11996/src/schedit/schobj Modified Files: designatordlg.cpp designatordlg.h so_designator.cpp Log Message: Add designator properties dialog functionality Index: designatordlg.cpp =================================================================== RCS file: /cvsroot/reds/rapideds/src/schedit/schobj/designatordlg.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** designatordlg.cpp 26 Jul 2005 22:13:16 -0000 1.1 --- designatordlg.cpp 3 Sep 2005 04:51:32 -0000 1.2 *************** *** 1,3 **** ! // file : .cpp // Descr : // Author : Ricky White ( ri...@ne... ) --- 1,3 ---- ! // file : designatordlg.cpp // Descr : // Author : Ricky White ( ri...@ne... ) *************** *** 8,25 **** #include <kdebug.h> #include <kcombobox.h> #include "so_subpart.h" #include "designatordlg.h" ! DesignatorPropDlg::DesignatorPropDlg( SO_Designator *obj ) ! : DesignatorPropForm(), m_obj(*obj) { ! m_subpart = dynamic_cast<SO_Subpart*>(m_obj.parent()); lockedCBT->setChecked(false); prefixAutoCBT->setChecked(false); subidxAutoCBT->setChecked(false); ! m_origDesig = m_subpart->designator(); // save for revert operations prefixHC->setCurrentText( m_subpart->designator().prefix() ); indexHC->setCurrentText( m_subpart->designator().indexText() ); subpartHC->setCurrentText( m_subpart->designator().subIndexText() ); } --- 8,44 ---- #include <kdebug.h> #include <kcombobox.h> + #include <kconfig.h> + #include <klineedit.h> + #include <kmessagebox.h> #include "so_subpart.h" #include "designatordlg.h" + #include <projectmgr.h> ! DesignatorPropDlg::DesignatorPropDlg( SO_Designator *obj, PrjDoc &prj ) ! : DesignatorPropForm(), m_project(prj), m_obj(*obj) { ! m_subpart = dynamic_cast<SO_Subpart*>(m_obj.parent()); ! m_dmgr = &m_project.desigMgr(); ! m_defaultPrefix = m_dmgr->defaultPrefix( m_subpart->libPath().text() ); ! m_origDesig = m_subpart->designator(); ! m_config = new KConfig("rapidEDS/schematic.cfg",false,true,"config"); ! loadHistory(); ! lockedCBT->setChecked(false); prefixAutoCBT->setChecked(false); subidxAutoCBT->setChecked(false); ! ! libPathLE->setText( m_subpart->libPath().text() ); ! defaultPrefixLE->setText( m_defaultPrefix ); ! prefixHC->setCurrentText( m_subpart->designator().prefix() ); + prefixHC->addToHistory( m_subpart->designator().prefix() ); + prefixHC->addToHistory( m_defaultPrefix ); + indexHC->setCurrentText( m_subpart->designator().indexText() ); + subpartHC->setCurrentText( m_subpart->designator().subIndexText() ); + + lockedCBT->setChecked( m_project.desigMgr().isLocked(m_origDesig) ); } *************** *** 27,38 **** DesignatorPropDlg::~DesignatorPropDlg() { } ! void DesignatorPropDlg::applySlot() { Designator d; ! d.setText(prefixHC->currentText()+indexHC->currentText()+":"+subpartHC->currentText(), Designator::AUTO); ! m_subpart->setDesignator( d ); ! //m_subpart->setLibPath( m_subpart->libPath(), d.subindex() ); // @FIXME: swaps symbol correctly but deletes designator text. The reason for this is that setLibPath deletes and recreates the component text and so_designator objects. } --- 46,99 ---- DesignatorPropDlg::~DesignatorPropDlg() { + saveHistory(); + delete m_config; } ! bool DesignatorPropDlg::applySlot() { Designator d; ! if( input2desig(&d) ) ! { ! if( d.prefix() != m_origDesig.prefix() || ! d.index() != m_origDesig.index() || ! d.subindex() != m_origDesig.subindex() ) ! { ! // change of critical parameters ! d = m_project.desigMgr().getNextDesignator( ! "GLOBAL", ! m_subpart->libPath(), ! indexAutoCBT->isChecked() ? -1 : (int)d.index(), ! subidxAutoCBT->isChecked() ? -1 : d.subindex(), ! d.prefix() ); ! // Update dialog ! if( d.valid() ) ! { ! indexHC->setCurrentText(d.prefix()); ! indexHC->setCurrentText( d.indexText(Designator::DEFAULT) ); ! subpartHC->setCurrentText( d.subIndexText( Designator::DEFAULT ) ); ! } ! } ! } ! else ! { ! KMessageBox::error( this,i18n( ! "Sorry but there is an error in one of the input fields.\n" ! "Please correct this and try again" ) ); ! return false; ! } ! ! ! if( d.valid() ) ! { ! m_project.desigMgr().freeDesignator( m_subpart->designator() ); ! m_subpart->setDesignator( d ); ! return true; ! } ! else ! { ! KMessageBox::error( this,i18n("The designator settings you have chosen" ! " conflict with another device.") ); ! return false; ! } } *************** *** 42,43 **** --- 103,179 ---- } + // returns true if the designator is valid + bool DesignatorPropDlg::input2desig( Designator *d ) + { + bool tmp = true, r = true; + + QString s; + s = prefixHC->currentText(); + r &= !s.isEmpty(); + + d->setPrefix(s); + if( !indexAutoCBT->isChecked() ) + d->setIndex(indexHC->currentText().toInt(&tmp)); + r &= tmp; + + if( !subidxAutoCBT->isChecked() ) + r &= d->setSubIndex(subpartHC->currentText()); + + d->setValid(r); + return r; + } + + void DesignatorPropDlg::defaultPrefixSlot( bool select ) + { + if( select ) + prefixHC->setCurrentText(m_defaultPrefix); + } + + void DesignatorPropDlg::loadHistory() + { + QStringList list; + + list = m_config->readListEntry( "Prefix Completion list" ); + prefixHC->completionObject()->setItems( list ); + list = m_config->readListEntry( "Prefix History list" ); + prefixHC->setHistoryItems( list ); + + list = m_config->readListEntry( "Index Completion list" ); + indexHC->completionObject()->setItems( list ); + list = m_config->readListEntry( "Index History list" ); + indexHC->setHistoryItems( list ); + + list = m_config->readListEntry( "Subpart Completion list" ); + subpartHC->completionObject()->setItems( list ); + list = m_config->readListEntry( "Subpart History list" ); + subpartHC->setHistoryItems( list ); + } + + void DesignatorPropDlg::saveHistory() + { + QStringList list; + + list = prefixHC->completionObject()->items(); + m_config->writeEntry( "Prefix Completion list", list ); + list = prefixHC->historyItems(); + m_config->writeEntry( "Prefix History list", list ); + + indexHC->addToHistory( indexHC->currentText() ); + list = indexHC->completionObject()->items(); + m_config->writeEntry( "Index Completion list", list ); + list = indexHC->historyItems(); + m_config->writeEntry( "Index History list", list ); + + subpartHC->addToHistory( subpartHC->currentText() ); + list = subpartHC->completionObject()->items(); + m_config->writeEntry( "Subpart Completion list", list ); + list = subpartHC->historyItems(); + m_config->writeEntry( "Subpart History list", list ); + } + + + void DesignatorPropDlg::accept() + { + if( applySlot() ) + QDialog::accept(); + } Index: so_designator.cpp =================================================================== RCS file: /cvsroot/reds/rapideds/src/schedit/schobj/so_designator.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** so_designator.cpp 27 Jul 2005 00:06:08 -0000 1.2 --- so_designator.cpp 3 Sep 2005 04:51:32 -0000 1.3 *************** *** 38,42 **** void SO_Designator::properties( QWidget *parent ) { ! DesignatorPropDlg dlg(this); dlg.exec(); } --- 38,43 ---- void SO_Designator::properties( QWidget *parent ) { ! PrjDoc &doc(static_cast<CadCanvas*>(canvas())->project()); ! DesignatorPropDlg dlg(this,doc); dlg.exec(); } Index: designatordlg.h =================================================================== RCS file: /cvsroot/reds/rapideds/src/schedit/schobj/designatordlg.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** designatordlg.h 26 Jul 2005 22:13:16 -0000 1.1 --- designatordlg.h 3 Sep 2005 04:51:32 -0000 1.2 *************** *** 12,34 **** #include "so_subpart.h" ! /** ! This class implements the logic for the designator properties dialog to allow the user to modify a components designator ! ! @author Ricky White ! */ class DesignatorPropDlg : public DesignatorPropForm { public: ! DesignatorPropDlg( SO_Designator *obj ); ~DesignatorPropDlg(); protected slots: ! virtual void applySlot(); virtual void lockedSlot(bool locked); protected: SO_Designator &m_obj; SO_Subpart *m_subpart; Designator m_origDesig; }; --- 12,44 ---- #include "so_subpart.h" ! /** This class implements the logic for the designator properties dialog ! * to allow the user to modify a components designator. ! * ! * @author Ricky White ! */ class DesignatorPropDlg : public DesignatorPropForm { public: ! DesignatorPropDlg( SO_Designator *obj, PrjDoc &prj ); ~DesignatorPropDlg(); protected slots: ! virtual bool applySlot(); virtual void lockedSlot(bool locked); + virtual void defaultPrefixSlot( bool select ); + virtual void accept(); protected: + PrjDoc &m_project; SO_Designator &m_obj; + DesignatorMgr *m_dmgr; SO_Subpart *m_subpart; + KConfig *m_config; Designator m_origDesig; + QString m_defaultPrefix; + + bool input2desig( Designator *desig ); + void loadHistory(); + void saveHistory(); }; |
From: Ricky W. <ri...@us...> - 2005-09-03 04:46:39
|
Update of /cvsroot/reds/rapideds In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11067 Modified Files: rapideds.kdevelop Log Message: add designator properties functionality Index: rapideds.kdevelop =================================================================== RCS file: /cvsroot/reds/rapideds/rapideds.kdevelop,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** rapideds.kdevelop 16 Jul 2005 13:41:03 -0000 1.7 --- rapideds.kdevelop 3 Sep 2005 04:46:31 -0000 1.8 *************** *** 132,135 **** --- 132,137 ---- <group pattern="*.po;*.ts" name="Translations" /> <group pattern="*" name="Others" /> + <hidenonprojectfiles>false</hidenonprojectfiles> + <hidenonlocation>false</hidenonlocation> </groups> <tree> *************** *** 236,239 **** --- 238,244 ---- <headerCompletionDelay>250</headerCompletionDelay> </codecompletion> + <designerintegration> + <qtdesigner/> + </designerintegration> </kdevcppsupport> <cppsupportpart> |
From: Ricky W. <ri...@us...> - 2005-09-03 04:44:52
|
Update of /cvsroot/reds/rapideds/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10792/src/common Modified Files: designatormgr.cpp designatormgr.h Log Message: Fix text display of parts with no subparts Index: designatormgr.h =================================================================== RCS file: /cvsroot/reds/rapideds/src/common/designatormgr.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** designatormgr.h 31 Aug 2005 13:26:06 -0000 1.14 --- designatormgr.h 3 Sep 2005 04:44:44 -0000 1.15 *************** *** 38,42 **** void setIndex( unsigned int index ); void setSubIndex( unsigned int sub ); ! void setNoSub( bool nosub=false ); void set( const QString &prefix, unsigned int index, unsigned int sub, bool nosub=false ); --- 38,43 ---- void setIndex( unsigned int index ); void setSubIndex( unsigned int sub ); ! bool setSubIndex( QString text, TEXT_MODE mode=DEFAULT ); ! void setNoSub( bool nosub=false ); void set( const QString &prefix, unsigned int index, unsigned int sub, bool nosub=false ); Index: designatormgr.cpp =================================================================== RCS file: /cvsroot/reds/rapideds/src/common/designatormgr.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** designatormgr.cpp 31 Aug 2005 13:26:06 -0000 1.17 --- designatormgr.cpp 3 Sep 2005 04:44:44 -0000 1.18 *************** *** 207,210 **** --- 207,255 ---- } + + bool Designator::setSubIndex( QString text, TEXT_MODE mode ) + { + static QRegExp + rx_alpha("([A-Z]+)$"), //Format : U1:A + rx_num("([1-9][0-9]*)$"); //Format : U1:1 + + switch(mode) + { + case ALPHA: + if( rx_alpha.search(text)==0) + { + setSubIndex( base26toint(rx_alpha.cap(1))-1 ); + return true; + } + break; + case NUMERIC: + if( rx_num.search(text)==0) + { + setSubIndex( base26toint(rx_alpha.cap(1))-1 ); + return true; + } + break; + case AUTO: + if( rx_alpha.search(text)==0) + { + setSubIndex( base26toint(rx_alpha.cap(1))-1 ); + return true; + } + else if( rx_num.search(text)==0 ) + { + setSubIndex( base26toint(rx_alpha.cap(1))-1 ); + return true; + } + else + return false; + case DEFAULT: + return setSubIndex( text, m_defaultTextMode ); + default: + setValid(false); + return false; + } + } + + int Designator::base26toint( QString s ) { *************** *** 590,594 **** Designator d; int subpart_cnt; ! Part *part = static_cast<Part*>(m_libdb->get( LibObject::PART, libpath)); subpart_cnt = part->getSubpartCount(); --- 635,643 ---- Designator d; int subpart_cnt; ! if( index==0 ) ! { ! d.setValid(false); ! return d; ! } Part *part = static_cast<Part*>(m_libdb->get( LibObject::PART, libpath)); subpart_cnt = part->getSubpartCount(); |