GithubHelp home page GithubHelp logo

librepcb / librepcb Goto Github PK

View Code? Open in Web Editor NEW
2.3K 74.0 284.0 53.14 MB

A powerful, innovative and intuitive EDA suite for everyone!

Home Page: https://librepcb.org

License: GNU General Public License v3.0

QMake 0.01% Shell 0.26% HTML 0.01% C++ 96.32% Python 2.47% CMake 0.94% QML 0.01% GLSL 0.01%
eda electronics pcb schematic qt linux unix macos windows cad

librepcb's Introduction

LibrePCB

Become a Patron Discourse Telegram Website Docs

Azure Build Status OpenSSF Best Practices

Packaging status

About LibrePCB

LibrePCB is a free EDA suite to develop printed circuit boards on Windows, Linux and MacOS. More information and screenshots are available at librepcb.org.

Installation & Usage

Official stable releases are provided at our download page.

Please read our user manual to see how you can install and use LibrePCB. The quickstart tutorial provides a step-by-step guide through the whole process of designing a PCB.

Contributing

Contributions are welcome! See librepcb.org/contribute and CONTRIBUTING.md for details.

For internal details take a look at the developers documentation.

Development

WARNING: The master branch always contains the latest UNSTABLE version of LibrePCB. Everything you do with this unstable version could break your workspace, libraries or projects, so you should not use it productively! For productive use, please install an official release as described in the user manual. For development, please read details here.

Requirements

To compile and run LibrePCB, you need the following software components:

Prepared Docker Image

Instead of installing the dependencies manually on your system (see instructions below), you can also use one of our Docker images with all dependencies pre-installed (except GUI tools like QtCreator). These images are actually used for CI, but are also useful to build LibrePCB locally.

Installation on Debian/Ubuntu/Mint

Ubuntu 22.04
sudo apt-get install build-essential git cmake openssl zlib1g zlib1g-dev \
     qt6-base-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools \
     libqt6core5compat6-dev qt6-declarative-dev libqt6opengl6-dev libqt6svg6-dev \
     qt6-image-formats-plugins libglu1-mesa-dev \
     liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev
sudo apt-get install qtcreator # optional
Older Ubuntu Versions
sudo apt-get install build-essential git cmake openssl zlib1g zlib1g-dev \
     qt5-default qtdeclarative5-dev qttools5-dev-tools qttools5-dev \
     qtquickcontrols2-5-dev libqt5opengl5-dev libqt5svg5-dev \
     qt5-image-formats-plugins libglu1-mesa-dev liboce-*-dev
sudo apt-get install qt5-doc qtcreator # optional

Installation on Arch Linux

sudo pacman -S base-devel git cmake openssl zlib desktop-file-utils shared-mime-info \
     qt6-base qt6-5compat qt6-declarative qt6-svg qt6-tools qt6-imageformats opencascade
sudo pacman -S qt6-doc qtcreator # optional

Note: Instead of installing the dependencies and building LibrePCB manually, you could install the package librepcb-git from the AUR. The package clones and builds the latest version of the master branch from GitHub.

Installation on Mac OS X

  1. Install Xcode through the app store and start it at least once (for the license)
  2. Install homebrew (the package manager)
  3. Install dependencies: brew update && brew install qt6 cmake opencascade
  4. Make the toolchain available: brew unlink qt && brew link --force qt6

Installation on Windows

Download and run the Qt for Windows installer from here. LibrePCB does not compile with MSVC, so you must install following components with the Qt installer:

  • MinGW 11.2.0 64-bit compiler
  • Qt binaries for MinGW 11.2.0 64-bit (use the latest 6.x version)
  • Qt 5 Compatibility Module for MinGW 11.2.0 64-bit
  • Qt Image Formats for MinGW 11.2.0 64-bit
  • CMake

For the OpenCascade library the installation procedure is not that easy unfortunately. Basically you have to build it by yourself, see instructions here. However, to avoid this effort you could instead just set the CMake option USE_OPENCASCADE=0 (can be set in the QtCreator build config) to allow compiling LibrePCB without OpenCascade.

Cloning

It's important to clone the repository recursively to get all submodules too:

git clone --recursive https://github.com/LibrePCB/LibrePCB.git && cd LibrePCB

Updating

When updating the repository, make sure to also update all the submodules recursively. Otherwise you may get strange compilation errors:

git submodule update --init --recursive

Building

You can either build LibrePCB using Qt Creator, or you can build on the command line using cmake. To build LibrePCB using cmake/make:

mkdir build && cd build
cmake ..
make -j8

The binary can then be found in build/apps/librepcb/.

For more detailed instructions (including how to set up Qt Creator), see https://developers.librepcb.org/d5/d96/doc_building.html

Credits

  • First of all, many thanks to all of our contributors!
  • A big thank you goes to all our sponsors which help to keep this project alive!
  • Special thanks also to cloudscale.ch for sponsoring our API server!

License

LibrePCB is published under the GNU GPLv3 license.

librepcb's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

librepcb's Issues

Design an Icon for LibrePCB

The current icon is downloaded from the internet (it's license allows to use it for personal and commercial purpose). Even if the icon looks pretty nice, it would be better to design our own icon/logo, to be sure it is really unique.

In addition, iconfinder.com writes:

Using icons for a logo is never a good idea. By definition, icons are not unique and what you are looking for is something original that is not being used somewhere else. Icons are protected by license agreements that don't allow you to apply copyright on them, as you would do for a logo.

Fix doxygen build warnings

Since all classes were moved into a new namespace "librepcb" (1d361e6), doxygen now throws lot of warnings like warning: explicit link request to 'SomeClass' could not be resolved

I would mentor this issue if someone wants to work on it.

Strictly separate editor code from core logic (architecture issue)

Some editor related code (librepcbprojecteditor) is currently integrated into the logic core classes (librepcbproject), which is a little bit ugly. We should fix this architecture issue someday.

Example:
The core class NetSignal has a property isHighlighted which is used to highlight items of a specific net signal in the schematic/board editors. As this is the only purpose of that property, it should be located in librepcbprojecteditor instead of librepcbproject.

Make the first start of LibrePCB more intuitive

Until now, only a directory chooser dialog with the title "Choose workspace path" is shown, and the user has to choose a workspace directory. This is not very intuitive and can be annoying.

It would be better when:

  • A message box (or a dialog) explains in a few words how LibrePCB workspaces work.
  • This message box shows the default path to create a new workspace (for example /home/user/LibrePCB-Workspace/ under linux). If there is already a workspace at this location, the dialog shows that this workspace does already exist and will be opened.
  • A button like "Change workspace path" can be used to create or open a workspace at another location (not the default location). But this should be optional.
  • The user now only needs to click on the "OK" button to create or open the specified workspace

Create a "About LibrePCB" dialog

The current about dialog is very simple and could be improved in many ways:

  • Replace the QMessageBox with an own class derived from QDialog. This new class should be called AboutDialog and created in the directory libs/librepcb/common/dialogs/
  • Add the new about dialog to the "Help" menu of all main windows (ControlPanel, SchematicEditor, BoardEditor)
  • Add more information to the new dialog, maybe splitted up in multiple tabs:
    • A small description about LibrePCB (inclusive Logo)
    • A link to LibrePCB's website (librepcb.org) and to the GitHub project site
    • The application's version / commit hash (determined by git describe)
    • Maybe the datetime of the last commit
    • The license (a link to http://www.gnu.org/licenses/gpl-3.0.html, or the whole license text)
    • Options for contribution (Bitcoin address, link to Patreon)
    • Maybe a "how to contribute" section (see also #12)
    • Maybe the rendered content of the AUTHORS.md file

Get rid of QtWebKit

QtWebKit got removed upstream with Qt 5.6 - if you still need a HTML viewer after #72 I'd recommend either QtWebKit or QtWebEngine via a compile-time flag, or using something more minimalistic like QTextBrowser which has some degree of HTML support.

Replace private marked copy/default constructors with =delete

In some places in the code the following is found:

private:
        // make some methods inaccessible...
        ErcMsgList();
        ErcMsgList(const ErcMsgList& other);
        ErcMsgList& operator=(const ErcMsgList& rhs);

Which should be replaced by

public:
        ErcMsgList() = delete;
        ErcMsgList(const ErcMsgList& other) = delete;
        ErcMsgList& operator=(const ErcMsgList& rhs) = delete;

The canonical order for the constructors is like follows:

public:
  // Constructors / Destructor
  [Default Constructor]
  [Copy Constructor]
  [Custom Constructors]
  [Destructor]

  // getters, setters, ...

  // Operator Overloadings
  [Assignment Operator]
  [Other Operators]

I'm willing to mentor this bug if someone wants to work on it. The following are some of the places were this could be fixed:

Just search for // make some methods inaccessible...

Readme: Add build instructions for windows

  • how to install Qt libraries and MinGW
  • how to set up the build configuration while opening librepcb.pro the first time with Qt Creator

@nemofisch This is an issue for you :)

Improve project library handling

Looking at e.g. SES_AddComponents, there's loads of low level magic going on regarding access to the component libray. This must get into to some higher level interface!

Refactoring of the schematic editor state machine

The schematic editor state machine (all classes in the directory libs/librepcbprojecteditor/schematiceditor/fsm) is only provisional and very buggy (especially the exception handling).

Some refactoring is required to:

  • split the FSM into more, but shorter source files
  • make the FSM design cleaner and more robust (e.g. exception handling)
  • add more features to the schematic editor

The FSM should pass the remo-check before releasing it ๐Ÿ˜„

Use a more Pull-Request oriented developement process

@ubruhin You currently push a lot directly to master. To be more in touch with the development it would be nice if you could open pull-requests per feature/bug-fix. This would give other developers the chance to review the changes, make suggestions and also track the progress of librepcb.
Adding a @foo please review note in the pull-request also encourages others to review the pull-request.

ErcMsgDock may be a performance bottleneck

On a decent notebook I saw that the method ErcMsgDock::ercMsgAdded() is an extreme performance bottleneck. This seems to be caused by calling the method QTreeWidgetItem::sortChildren() which was very slow.

This is especially bad when performing lot of changes at once, for example when removing all items of a board or schematic. This can lead into a freezing GUI for many seconds.

System where this issue was seen: Intel i7-4712MQ with Ubuntu 14.04 and Qt 5.2.1 from the official Ubuntu Repository.

Create a scope guard class

It would be very useful to have a scope guard class which makes it possible to execute multiple methods, which can throw exceptions, atomically. If one method throws an exception, all previously executed methods must be reverted.

How such a scope guard may be used (...not sure if the lambdas are properly used...?):

void MyClass::doSomethingAtomically(int magicNumber) throw (Exception)
{
    ScopeGuardList sgl;
    sgl.execute([this](){doSomethingOrThrow();},
                [this](){revertSomethingOrThrow();});
    sgl.execute([this, &magicNumber](int n){makeMagicThingsOrThrow(n);},
                [this, &magicNumber](int n){revertMagicThingsOrThrow(n);});
    sgl.execute([this](){fooOrThrow();},
                [this](){barOrThrow();});
    sgl.commit();
}

Such a class should be created in the static library librepcbcommon (namespace "librepcb") because it would be useful for all other libraries.

@rnestler Interested in implementing such a class? ๐Ÿ˜ƒ

Make it possible to open multiple projects in one window

Until now, each project opens a new schematic editor and board editor in separate windows. So if you open 10 projects, there are 20 windows (+1 for control panel) ๐Ÿ˜ญ It would be nice to have the possibility to open multiple projects (schematics + boards) in one window (with some kind of a file navigator to switch between projects/schematics/boards).

Use XML instead of INI for workspace settings

workspace classes "WorkspaceSettings" and "WSI_Base":

workspace settings are stored in the file "settings.ini" which is created by QSettings. It would be nice to replace the INI file with a XML file, created by "SmartXmlFile" (e.g. "settings.xml").

Add "Contribution" section to readme

List some different ways how to contribute to LibrePCB, for example:

  • coding: fix issues (starting with issues labeled with "easy")
  • design/coding: create a website? design icons?
  • donate: Gratipay?
  • donate: PayPal?
  • donate: Bitcoin?
  • other ways to contribute?

also an IRC channel would be nice...

Error while preparing SQL query: [...] no such table: components

Fresh install, new project, when clicking the resistor symbol in the schema editor:

[ WARNING ] Could not determine the system's full username! (:0)
[ WARNING ] There was a stale lock on the workspace: "FilePath(/home/florian/LibrePCB-Workspace)" (:0)
[ WARNING ] Could not determine the system's full username! (:0)
[DEBUG-MSG] open project: "/home/florian/LibrePCB-Workspace/projects/test.lpp" (:0)
[ WARNING ] Could not determine the system's full username! (:0)
[ WARNING ] Could not determine the system's full username! (:0)
[DEBUG-MSG] load settings... (:0)
[DEBUG-MSG] settings successfully loaded! (:0)
[DEBUG-MSG] load project library... (:0)
[DEBUG-MSG] successfully loaded 0 symbols (:0)
[DEBUG-MSG] successfully loaded 0 spice models (:0)
[DEBUG-MSG] successfully loaded 0 packages (:0)
[DEBUG-MSG] successfully loaded 0 components (:0)
[DEBUG-MSG] successfully loaded 0 devices (:0)
[DEBUG-MSG] project library successfully loaded! (:0)
[DEBUG-MSG] load circuit... (:0)
[DEBUG-MSG] circuit successfully loaded! (:0)
[DEBUG-MSG] 1 schematics successfully loaded! (:0)
[DEBUG-MSG] 1 boards successfully loaded! (:0)
[DEBUG-MSG] project successfully loaded! (:0)
[EXCEPTION] Error while preparing SQL query: SELECT version, filepath FROM components WHERE uuid = :uuid {SELECT version, filepath FROM components WHERE uuid = :uuid: no such table: components, Unable to execute statement} (library.cpp:708)
terminate called after throwing an instance of 'librepcb::RuntimeError'
  what():  Error while preparing SQL query: SELECT version, filepath FROM components WHERE uuid = :uuid
[1]    13915 abort (core dumped)  ./generated/unix/librepcb

Cannot build LibrePCB

I'm getting this error message:

[master]danilo@x2000:LibrePCB$ rm -r build
[master]danilo@x2000:LibrePCB$ mkdir build && cd build
[master]danilo@x2000:build$ qmake -r ../librepcb.pro
Reading /mnt/data/Projects/LibrePCB/3rdparty/3rdparty.pro [/mnt/data/Projects/LibrePCB/build/3rdparty]
 Reading /mnt/data/Projects/LibrePCB/3rdparty/gmock/gmock.pro [/mnt/data/Projects/LibrePCB/build/3rdparty/gmock]
Reading /mnt/data/Projects/LibrePCB/libs/libs.pro [/mnt/data/Projects/LibrePCB/build/libs]
 Reading /mnt/data/Projects/LibrePCB/libs/librepcbcommon/librepcbcommon.pro [/mnt/data/Projects/LibrePCB/build/libs/librepcbcommon]
 Reading /mnt/data/Projects/LibrePCB/libs/librepcblibrary/librepcblibrary.pro [/mnt/data/Projects/LibrePCB/build/libs/librepcblibrary]
 Reading /mnt/data/Projects/LibrePCB/libs/librepcbproject/librepcbproject.pro [/mnt/data/Projects/LibrePCB/build/libs/librepcbproject]
 Reading /mnt/data/Projects/LibrePCB/libs/librepcbworkspace/librepcbworkspace.pro [/mnt/data/Projects/LibrePCB/build/libs/librepcbworkspace]
 Reading /mnt/data/Projects/LibrePCB/libs/librepcblibraryeditor/librepcblibraryeditor.pro [/mnt/data/Projects/LibrePCB/build/libs/librepcblibraryeditor]
 Reading /mnt/data/Projects/LibrePCB/libs/librepcbprojecteditor/librepcbprojecteditor.pro [/mnt/data/Projects/LibrePCB/build/libs/librepcbprojecteditor]
Reading /mnt/data/Projects/LibrePCB/librepcb/librepcb.pro [/mnt/data/Projects/LibrePCB/build/librepcb]
RCC: Error in '../../i18n/translations.qrc': Cannot find file 'librepcb_de.qm'
RCC: Error in '../../i18n/translations.qrc': Cannot find file 'librepcb_de_CH.qm'
RCC: Error in '../../i18n/translations.qrc': Cannot find file 'librepcb_gsw_CH.qm'
RCC: Warning: No resources in '../../i18n/translations.qrc'.
Reading /mnt/data/Projects/LibrePCB/tools/tools.pro [/mnt/data/Projects/LibrePCB/build/tools]
 Reading /mnt/data/Projects/LibrePCB/tools/EagleImport/EagleImport.pro [/mnt/data/Projects/LibrePCB/build/tools/EagleImport]
 Reading /mnt/data/Projects/LibrePCB/tools/ProjectLibraryUpdater/ProjectLibraryUpdater.pro [/mnt/data/Projects/LibrePCB/build/tools/ProjectLibraryUpdater]
 Reading /mnt/data/Projects/LibrePCB/tools/UuidGenerator/UuidGenerator.pro [/mnt/data/Projects/LibrePCB/build/tools/UuidGenerator]
 Reading /mnt/data/Projects/LibrePCB/tools/WorkspaceLibraryUpdater/WorkspaceLibraryUpdater.pro [/mnt/data/Projects/LibrePCB/build/tools/WorkspaceLibraryUpdater]
Reading /mnt/data/Projects/LibrePCB/tests/tests.pro [/mnt/data/Projects/LibrePCB/build/tests]

There seems to be something wrong with the paths...

Maybe related, I'm getting the following error msg in qtcreator when opening a form:

dialog

The path should actually be /mnt/data/Projects/**LibrePCB/**img/images.qrc.

Add a "new project"-wizard to ControlPanel

Create new projects with the ControlPanel:

Instead of only opening a QFileDialog to select the new project's filepath, we should show a simple wizard to choose the following things:

  • the project's name
  • the project's author
  • target directory (where to create the project)
  • target filename (*.lpp) --> automatically generated from the project's name, but editable
  • the project's license (optional)
  • some project settings, like language, norm, ... (optional)
  • name of the first schematic and board to add (optional)
  • which version control system to use (optional)

Make it possible to close control panel

When using LibrePCB, the control panel stays open even after opening a project. When using a tiling window manager, this is especially impractical :)

2016-01-03-150235_1919x1079_scrot

Is it possible to close the control panel without closing all other windows?

Change minimum required Qt version back to 5.2.x

In many Linux distributions, Qt 5.4 is not yet available via package manager. To support more distributions (like Ubuntu >= 14.04), it would be better to support Qt 5.2.x. This should be possible with only a few small code changes (+ updating the documentation / Travis CI config).

Add "interface check" to all library elements

Some attributes of library elements must not be edited after the creation of the element, because this could break references from other library elements. For example removing a pin from an existing Symbol will break all Components which use this Symbol.

I name the sum of these critical attributes "interface of the library element". Examples of library elements and their interface:

  • Symbol: Count, UUID and Function (meaning) of every pin
  • Package: Count, UUID and Function (meaning) of every pad
  • Component: Count, UUID and Function (meaning) of every signal

Maybe it would make sense to protect library elements from changing their interface (e.g. modifying XML files with a text editor). The constructor of the library elements could throw an exception if a modified interface is detected while loading its XML file. The interface may be stored in the XML files as a hash over all properties which define the interface.

Use imperative commit messages

Even if I like commit messages written in past tense, I think it would be better to use the imperative form, at least because...

  • ...most automatically generated merge commit messages (for example from GitHub) use the imperative form
  • ...many other projects (including the linux kernel and git itself) use the imperative form
  • ...because the imperative form is widely used, many commits in pull requests use the imperative form too (and it's hard to always say "please change your commit message")

Btw, here are nice guidelines for commit messages: http://chris.beams.io/posts/git-commit/

Any thoughts? ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.