Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.0-alpha1 #122

Merged
merged 60 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
7c496b8
Quick CustomTkinter mockup
eeintech Jan 6, 2023
cbe6752
Added Flet version of the GUI
eeintech Jan 13, 2023
5a3a9e2
Fixed resize window option
eeintech Jan 16, 2023
d50c809
Building the new GUI(?)
eeintech Jan 17, 2023
058009b
Built search view
eeintech Jan 18, 2023
39c34ed
Bit more work
eeintech Jan 18, 2023
02f5dda
Premise of supplier search
eeintech Jan 18, 2023
ff8beec
Refactoring to move views to classes
eeintech Jan 19, 2023
748053a
Settings view as class, navrail bug
eeintech Jan 19, 2023
4aa5600
Classes are set and UI functions as expected, ready for next integrat…
eeintech Jan 19, 2023
61e2916
Updated run_search method in supplier view
eeintech Feb 7, 2023
8714f67
Started settings playground using tabs, maybe better use NavigationRa…
eeintech Feb 7, 2023
48eac56
Settings: moved away from tabs, instead use navrail like main views
eeintech Feb 8, 2023
935c70c
Filepicker handling: one at the time
eeintech Feb 8, 2023
d63b602
User settings framework complete
eeintech Feb 9, 2023
58bb9a3
Settings: all complete except for supplier settings
eeintech Feb 9, 2023
62295e5
Supplier settings: missing Element14
eeintech Feb 9, 2023
136d645
Settings view completed, missing save and test actions hooks
eeintech Feb 9, 2023
214da12
Small update to Element14 dropdown choices, added URL
eeintech Feb 9, 2023
aaf4652
Split views in differents files
eeintech Feb 9, 2023
4a05848
InvenTree view: Started working on category tree
eeintech Feb 9, 2023
76ba945
Updated search view with InvenTree/KiCad switches and add button
eeintech Feb 10, 2023
7b39d8c
Started to implement part adding flow with views
eeintech Feb 10, 2023
19d2e42
Fixed Collapsible _build method
eeintech Feb 10, 2023
0bfa28b
Preliminary KiCad view
eeintech Feb 10, 2023
48a01e1
Added symbol and footprint options to dropdown
eeintech Feb 10, 2023
9b8b953
Added settings GUI parameters
eeintech Feb 13, 2023
cd67c21
Implementing settings save and test methods
eeintech Feb 13, 2023
83b73b9
Settings progress: missing supplier tests
eeintech Feb 13, 2023
976a9b0
API tests work, save errors out
eeintech Feb 13, 2023
d00ab50
Settings methods are complete
eeintech Feb 13, 2023
1373929
MVP for custom dropdown
eeintech Feb 14, 2023
14d55f2
DropdownWithSearch is now a class in common
eeintech Feb 14, 2023
6e71bdc
Re-enabled full navigation rail, pushing data from views to global dict
eeintech Feb 15, 2023
68705c4
Dropdowns with search are in!
eeintech Feb 15, 2023
9814d5c
Implemented enable switches
eeintech Feb 15, 2023
22eff58
KiCad view completed + bunch of fixes
eeintech Feb 15, 2023
dff341a
Started building category tree
eeintech Feb 16, 2023
6cc5b8e
Started building create view
eeintech Feb 16, 2023
953990d
Merge branch '0.6.x' of github.com:sparkmicro/Ki-nTree into 1.0.0-alpha1
eeintech Feb 16, 2023
8aa3bb1
Updated version
eeintech Feb 16, 2023
f617134
Added floating reset button and function
eeintech Feb 16, 2023
dff916d
Small clean-up
eeintech Feb 16, 2023
624ed3a
Continue create part work, setting enable flags globally
eeintech Feb 16, 2023
3da60be
Refactoring of InvenTree categories handling
eeintech Feb 17, 2023
82b57fe
First InvenTree part creation, totally imperfect
eeintech Feb 17, 2023
22fd9aa
Creating part in InvenTree is now functional, but needs A LOT of testing
eeintech Feb 17, 2023
05126fb
Only enable used progress bars
eeintech Feb 17, 2023
e3bd825
First usable 1.0.0 codebase, creates both InvenTree and KiCad parts
eeintech Feb 17, 2023
0135ee1
Flet classes clean-up
eeintech Feb 20, 2023
749a29f
Fix style
eeintech Feb 20, 2023
9c763e2
Start fixing tests
eeintech Feb 20, 2023
046995d
Tests should be fixed now
eeintech Feb 20, 2023
f5fd036
Bunch of fixes
eeintech Feb 20, 2023
a8c7075
Debug MCU part
eeintech Feb 20, 2023
a4f35fa
Looks like it is fixed
eeintech Feb 20, 2023
c8b8576
Started prep for alpha release
eeintech Feb 20, 2023
08fc20d
Polishing UI
eeintech Feb 21, 2023
241181d
Added logo, improvement to view reset function
eeintech Feb 21, 2023
b42f036
KiUtils is now a PIP package, more fixes
eeintech Feb 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ omit =
# Do not run coverage on virtual environment files
env-kintree/*
.venv/*
# Skip KiCad library tool
kintree/kicad/lib_utils/*
# Skip UI coverage
kintree/kintree_gui.py
kintree/common/progress.py
kintree/gui/*
# Skip wrapt_timeout_decorator
kintree/wrapt_timeout_decorator/*
# Skip LCSC supplier search
kintree/search/lcsc_api.py
# Skip test script
run_tests.py
6 changes: 3 additions & 3 deletions kintree/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

# VERSION INFORMATION
version_info = {
'MAJOR_REVISION': 0,
'MINOR_REVISION': 6,
'RELEASE_STATUS': 99, # Dev = 99
'MAJOR_REVISION': 1,
'MINOR_REVISION': 0,
'RELEASE_STATUS': '0a1',
}

__version__ = '.'.join([str(v) for v in version_info.values()])
94 changes: 28 additions & 66 deletions kintree/common/progress.py
Original file line number Diff line number Diff line change
@@ -1,93 +1,55 @@
import time

# PySimpleGUI
import PySimpleGUI as sg
CREATE_PART_PROGRESS: float
MAX_PROGRESS = 1.0
DEFAULT_PROGRESS = 0.1

CREATE_PART_PROGRESS: int
MAX_PROGRESS = 100
DEFAULT_PROGRESS = 5


def create_progress_bar_window(font=None, location=None) -> bool:
''' Create window for part creation progress '''
global CREATE_PART_PROGRESS, MAX_PROGRESS
global progress_window

progress_layout = [
[sg.Text('Creating part...')],
[sg.ProgressBar(MAX_PROGRESS, orientation='h', size=(20, 30), key='progressbar')],
[sg.Cancel()]
]
progress_window = sg.Window('Part Creation Progress', progress_layout, font=font, location=location)
# progress_bar = progress_window['progressbar']

event, values = progress_window.read(timeout=10)
def reset_progress_bar(progress_bar) -> bool:
''' Reset progress bar '''
global CREATE_PART_PROGRESS

# Reset progress
CREATE_PART_PROGRESS = 0
update_progress_bar_window()

if progress_window:
return True

return False

progress_bar.color = None
progress_bar.value = 0
progress_bar.update()
time.sleep(0.1)

def close_progress_bar_window():
''' Close progress bar window after part creation '''
global progress_window
return True

try:
if progress_window:
progress_window.close()
except NameError:
return


def progress_increment():
def progress_increment(inc):
''' Increment progress '''
global CREATE_PART_PROGRESS, MAX_PROGRESS

if CREATE_PART_PROGRESS + 1 < MAX_PROGRESS:
CREATE_PART_PROGRESS += 1
if CREATE_PART_PROGRESS + inc < MAX_PROGRESS:
CREATE_PART_PROGRESS += inc
else:
CREATE_PART_PROGRESS = MAX_PROGRESS

return CREATE_PART_PROGRESS

def update_progress_bar_window(increment=0) -> bool:
''' Update progress bar during part creation '''
global CREATE_PART_PROGRESS, MAX_PROGRESS, DEFAULT_PROGRESS
global progress_window

on_going_progress = True
def update_progress_bar(progress_bar, increment=0) -> bool:
''' Update progress bar during part creation '''
global DEFAULT_PROGRESS

try:
if not progress_window:
return False
except NameError:
return False
if not progress_bar:
return True

if increment:
inc = increment
else:
# Default
inc = DEFAULT_PROGRESS

progress_bar = progress_window['progressbar']

event, values = progress_window.read(timeout=10)

if event in ['Cancel', sg.WIN_CLOSED]:
on_going_progress = False
close_progress_bar_window()
else:
# Smooth effect
for i in range(inc):
progress_increment()
progress_bar.update(CREATE_PART_PROGRESS, MAX_PROGRESS)
if inc < MAX_PROGRESS:
time.sleep(0.02)
else:
time.sleep(0.005)
current_value = progress_bar.value * 100
new_value = progress_increment(inc) * 100
# Smooth progress
for i in range(int(new_value - current_value)):
progress_bar.value += i / 100
progress_bar.update()
time.sleep(0.05)

return on_going_progress
return True
3 changes: 1 addition & 2 deletions kintree/common/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ def cprint(*args, **kwargs):

def create_library(library_path: str, symbol: str, template_lib: str):
''' Create library files if they don\'t exist '''

if not os.path.exists(library_path):
os.mkdir(library_path)
new_kicad_sym_file = os.path.join(library_path, symbol + '.kicad_sym')
new_kicad_sym_file = os.path.join(library_path, f'{symbol}.kicad_sym')
if not os.path.exists(new_kicad_sym_file):
copyfile(template_lib, new_kicad_sym_file)

Expand Down
2 changes: 1 addition & 1 deletion kintree/config/digikey/digikey_categories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Integrated Circuits:
- Logic - Translators, Level Shifters
- Clock/Timing - Clock Generators, PLLs, Frequency Synthesizers
- Logic - Buffers, Drivers, Receivers, Transceivers
MCU:
Microcontroller:
- Embedded - Microcontrollers
Memory:
- Memory
Expand Down
24 changes: 19 additions & 5 deletions kintree/config/inventree/categories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,25 @@ CATEGORIES:
- Printed-Circuit Board Assembly
- Product
Capacitors:
- Ceramic
- Aluminium
- Tantalum
- Polymer
- Super Capacitors
Ceramic:
'0603':
10V:
- X5R
- X7R
16V:
- X5R
- X7R
'0402':
10V:
- X5R
- X7R
16V:
- X5R
- X7R
Aluminium:
Tantalum:
Polymer:
Super Capacitors:
Circuit Protections:
- TVS
- Fuses
Expand Down
Loading