Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 7019421
Author: Yihuo <65127095+Liangtie@users.noreply.github.com>
Date:   Tue Oct 31 14:24:12 2023 +0800

    Fix/kicad6.0 unavailable api (#11)

    * fix: Remove apis not available in kicad 6.0

    Remove the duplicated flags in the plugin so as to be used in Kicad 6.0

    * fix: Correct the name section in metadata.json

    * fix: Prefer and to & for the plugin name

    * fix: add kicad_version_max 7.0.8 in the metajson

commit 7038e4d
Author: jzzhuang <840064358@qq.com>
Date:   Fri Oct 27 18:40:22 2023 +0800

    Update metadata.template.json

commit 9833106
Author: Yihuo <65127095+Liangtie@users.noreply.github.com>
Date:   Fri Oct 27 17:39:01 2023 +0800

    feat: Update readme and metadata.json (#8)

    * feat: Update readme and metadata.json

    * Add README zh

    * Update homepage

commit 130303d
Author: Yihuo <65127095+Liangtie@users.noreply.github.com>
Date:   Thu Oct 26 18:19:27 2023 +0800

    fix: :bug: Fix nonetype error throwing from pcbnew.ToMils (#7)

    * fix: 🐛 Fix nonetype error throwing from pcbnew.ToMils

    Check if the param from design setting is None before converting it

    * feat: Update the gif path in the README

commit ff303ad
Author: Yihuo <65127095+Liangtie@users.noreply.github.com>
Date:   Thu Oct 26 12:03:07 2023 +0800

        feat: Prefer reading lang setting through pcbnew.GetLanguage (#5)

    Try reading lang setting from Kicad context before reading lang setting from json file

commit bd15e70
Author: Yihuo <65127095+Liangtie@users.noreply.github.com>
Date:   Thu Oct 26 11:59:04 2023 +0800

    加入Credi声明、并在代码中注明版权或者引用 (#3)

    * Refact the dir

    * Update dev instruction  p

    * Init modules

    * Add order and price

    * Add pcb_fabrication

    * Add service iIp

    * Remove service

    * Add adt for the request info

    * Add i18n template

    * add main dialog

    * Remove dists

    * add base_info_view

    * add ui_base_info

    * Finish the base info view

    * add UiProcessInfo

    * Add ui_personalized

    * Finish Personalized info

    * Finish the process info widget

    * Finish the dialog

    * Init i18n

    * Fix the sys path

    * Fix the syle

    * Fix base info

    * Fix the initial size

    * Fix the size

    * Fix the initial size for base info

    * Fix duplicated path

    * Add order info

    * Finish main window

    * Finish the order info panel

    * Fix the size for order info

    * Fix the scrollbar

    * Finish the flat button

    * add language

    * Add lang setting menu

    * Add models for order info

    * Remove dist

    * Remove dist

    * Add po files

    * Enable i18n

    * Remove dist files

    * Remove dist

    * Add setting manager

    * add re_translatable

    * add LocaleChangeEvent

    * Fix painting

    * Remove dist

    * read the language setting from kicad client

    * Remove dist

    * Update locales

    * Fix the base class for MainFrame

    * Fix the locale path

    * Update translation

    * Add ja

    * Finish the  translation

    * Update translation

    * Fix translation

    * Update translation

    * Update UI

    * Fix the unit

    * Restore the old widgets

    * Update utils '

    * Add kicad

    * Add board manager

    * add pcb_fabrication_evt_list

    * Finish the connection for base info

    * Fix base info

    * Add board manager

    * Adjust the base size for special process

    * Enable SILK_SCREEN_COLOR_BY_SOLDER_COLOR

    * Finish the constraint between the UI component

    * Fix the base info

    * Add base request

    * Fix the sp request

    * add snippy for params

    * Add number round

    * Finish the models mapping

    * Finish the api for querying price

    * Add order module

    * Add summary module

    * Add summary_panel

    * Add place order impl

    * Finish placing order

    * enable order region setting

    * Fix the OrderRegion

    * Add smt pcb models

    * Finish the price summary

    * Finish the pcb

    * Update translation

    * Prepare to import region change

    * Add cn params in the form

    * Fix translation Fix the region

    * Fix the width

    * Fix the available board thickness

    * Fix the board thickness

    * Record the window size

    * Finish adjusting the window layout

    * Adjust the order_summary_model

    * Finish showing the emergency price

    * Update Japanese translation

    * Finish the translatin

    * Add ComboBoxIgnoreWheel

    * Finish ComboBoxIgnoreWheel

    * add ComboBoxIgnoreWheel to builtin

    * FInish ComboBoxIgnoreWheel

    * Fix the summary model

    * Update the api

    * Remove dist files

    * Add release plugin

    * Always clear content while querying price

    * Migrate the original PCM

    * Update the create_pcm_archive.sh

    * Update git ignore

    * Adjust the ci for testing

    * Fxi the token

    * Fix the pcm script

    * Restore the original workflow yml

    * Fix the archive script

    * Revert "Restore the original workflow yml"

    This reverts commit f680d78ac63c24eae9b3267ec14e104338873ec0.

    * Fix the pcm script

    * Fix the pcm script

    * Fix the PCM script

    * Update the pcm script

    * Fix the pcm path

    * Fix the geni18n script

    * install wxPython in the script

    * Fix the translation

    * Update the mo files

    * Comment the translation step

    * Ignore the mo file

    * Fix the dumplicated lang_const

    * Adjust the geni18n script to run on github ci

    * Adjust the script to setup env

    * Install the python-gettext in the ci

    * Ajust the gen18n script to run on ci

    * Enable reading region from IP

    * Restore the yml

    * fmt the yml

    * Fix the lang setting menu

    * Adjust the yml for test

    * Revert "Adjust the yml for test"

    This reverts commit f839cd20430609ac365eb290785ab00872923472.

    * Fix the null parent in the price summary model

    * Fix the parent for price item

    * Fix the check state of the lang setting btn

    * Finish the api for placing order through hqpcb

    * Add value mapping

    * Add form value mapper

    * Enable jp order region

    * Finish the plugin

    * Fix  the board manager

    * Fix the generate_geber method while layer_count>6

    * Fix generate_geber

    * Check if the layer count is supported

    * Fix the stack up

    * Adjust the runner to WIndows

    * Use ubuntu-20.04 as runner

    * Restore the .yml

    * Formmatter test

    * Fix the panel calc

    * Fix the blind value

    * Remove dist

    * Fix the cover

    * Enable modal dialog

    * Add single plugin

    * Add  setup_trace_and_via in the base info

    * Add test

    * add query price test case

    * Restore the original yml config

    * Fix the min trace

    * Add simple

    * Remove dist yml

    * Prefer GetLanguage to get the language setting

    * Fix the ip

    * Format README for updating

    * Add credits declaration

    * Update git demo

commit e8d3326
Author: Yihuo <65127095+Liangtie@users.noreply.github.com>
Date:   Wed Oct 25 15:09:54 2023 +0800

    国际化、日本及中国大陆地区询价下单 (#2)

    * Refact the dir

    * Update dev instruction  p

    * Init modules

    * Add order and price

    * Add pcb_fabrication

    * Add service iIp

    * Remove service

    * Add adt for the request info

    * Add i18n template

    * add main dialog

    * Remove dists

    * add base_info_view

    * add ui_base_info

    * Finish the base info view

    * add UiProcessInfo

    * Add ui_personalized

    * Finish Personalized info

    * Finish the process info widget

    * Finish the dialog

    * Init i18n

    * Fix the sys path

    * Fix the syle

    * Fix base info

    * Fix the initial size

    * Fix the size

    * Fix the initial size for base info

    * Fix duplicated path

    * Add order info

    * Finish main window

    * Finish the order info panel

    * Fix the size for order info

    * Fix the scrollbar

    * Finish the flat button

    * add language

    * Add lang setting menu

    * Add models for order info

    * Remove dist

    * Remove dist

    * Add po files

    * Enable i18n

    * Remove dist files

    * Remove dist

    * Add setting manager

    * add re_translatable

    * add LocaleChangeEvent

    * Fix painting

    * Remove dist

    * read the language setting from kicad client

    * Remove dist

    * Update locales

    * Fix the base class for MainFrame

    * Fix the locale path

    * Update translation

    * Add ja

    * Finish the  translation

    * Update translation

    * Fix translation

    * Update translation

    * Update UI

    * Fix the unit

    * Restore the old widgets

    * Update utils '

    * Add kicad

    * Add board manager

    * add pcb_fabrication_evt_list

    * Finish the connection for base info

    * Fix base info

    * Add board manager

    * Adjust the base size for special process

    * Enable SILK_SCREEN_COLOR_BY_SOLDER_COLOR

    * Finish the constraint between the UI component

    * Fix the base info

    * Add base request

    * Fix the sp request

    * add snippy for params

    * Add number round

    * Finish the models mapping

    * Finish the api for querying price

    * Add order module

    * Add summary module

    * Add summary_panel

    * Add place order impl

    * Finish placing order

    * enable order region setting

    * Fix the OrderRegion

    * Add smt pcb models

    * Finish the price summary

    * Finish the pcb

    * Update translation

    * Prepare to import region change

    * Add cn params in the form

    * Fix translation Fix the region

    * Fix the width

    * Fix the available board thickness

    * Fix the board thickness

    * Record the window size

    * Finish adjusting the window layout

    * Adjust the order_summary_model

    * Finish showing the emergency price

    * Update Japanese translation

    * Finish the translatin

    * Add ComboBoxIgnoreWheel

    * Finish ComboBoxIgnoreWheel

    * add ComboBoxIgnoreWheel to builtin

    * FInish ComboBoxIgnoreWheel

    * Fix the summary model

    * Update the api

    * Remove dist files

    * Add release plugin

    * Always clear content while querying price

    * Migrate the original PCM

    * Update the create_pcm_archive.sh

    * Update git ignore

    * Adjust the ci for testing

    * Fxi the token

    * Fix the pcm script

    * Restore the original workflow yml

    * Fix the archive script

    * Revert "Restore the original workflow yml"

    This reverts commit f680d78ac63c24eae9b3267ec14e104338873ec0.

    * Fix the pcm script

    * Fix the pcm script

    * Fix the PCM script

    * Update the pcm script

    * Fix the pcm path

    * Fix the geni18n script

    * install wxPython in the script

    * Fix the translation

    * Update the mo files

    * Comment the translation step

    * Ignore the mo file

    * Fix the dumplicated lang_const

    * Adjust the geni18n script to run on github ci

    * Adjust the script to setup env

    * Install the python-gettext in the ci

    * Ajust the gen18n script to run on ci

    * Enable reading region from IP

    * Restore the yml

    * fmt the yml

    * Fix the lang setting menu

    * Adjust the yml for test

    * Revert "Adjust the yml for test"

    This reverts commit f839cd20430609ac365eb290785ab00872923472.

    * Fix the null parent in the price summary model

    * Fix the parent for price item

    * Fix the check state of the lang setting btn

    * Finish the api for placing order through hqpcb

    * Add value mapping

    * Add form value mapper

    * Enable jp order region

    * Finish the plugin

    * Fix  the board manager

    * Fix the generate_geber method while layer_count>6

    * Fix generate_geber

    * Check if the layer count is supported

    * Fix the stack up

    * Adjust the runner to WIndows

    * Use ubuntu-20.04 as runner

    * Restore the .yml

    * Formmatter test

    * Fix the panel calc

    * Fix the blind value

    * Remove dist

    * Fix the cover

    * Enable modal dialog

    * Add single plugin

    * Add  setup_trace_and_via in the base info

    * Add test

    * add query price test case

    * Restore the original yml config

    * Fix the min trace

    * Add simple

    * Remove dist yml
  • Loading branch information
SYSUeric66 committed Nov 2, 2023
1 parent c919d13 commit 2fbb651
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 32 deletions.
3 changes: 2 additions & 1 deletion PCM/metadata.template.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://go.kicad.org/pcm/schemas/v1",
"name": "HQPCB / HQ NextPCB Quote & Order",
"name": "HQPCB / HQ NextPCB Quote and Order",
"description": "Start prototype and assembly by sending files to NextPCB with just one click\nAutomatic extract key parameters from pcbnew and get real-time quotation within KiCad",
"description_full": "Click this plugin for high quality prototyping and assembly services, NextPCB will commit to meeting your needs to the greatest extent.\n\nWhen you click NextPCB Plug-in button, we will export these files in your project:\n\n1. Gerber files in correct format for production\n2. IPC-Netlist file\n3. Bom-file that includes all information of components (please note designator, quantity, MPN/part number, package/footprint are necessary)\n4. Pick and Place-file used in assembly\n\nYou can click \"Save to Cart\" to place an order immediately after uploading the files ( usually only takes a few seconds), our engineers will double check the files before the production.\n\nAbout NextPCB:\n\nNextPCB is a Chinese company specializing in PCB prototyping and assembly, devotes to offer one-stop service. The build-time for standard PCBs is 24hrs. Our upgraded material with TG150-160 costs as low as $5/10pcs while our remarkable after-sale services are standing by for any questions you may encounter. As a sponsor of KiCad, we will always support its development.",
"identifier": "com.github.SYSUeric66.kicad-amf-plugin",
Expand All @@ -26,6 +26,7 @@
"version": "VERSION_HERE",
"status": "testing",
"kicad_version": "6.0",
"kicad_version_max": "7.0.8",
"download_sha256": "SHA256_HERE",
"download_size": DOWNLOAD_SIZE_HERE,
"download_url": "DOWNLOAD_URL_HERE",
Expand Down
1 change: 0 additions & 1 deletion kicad_amf_plugin/gui/main_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ def __init__(self, board_manager: BoardManager, size, parent=None):
self.init_ui()

def init_ui(self):
wx.SizerFlags.DisableConsistencyChecks()
self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)
main_sizer = wx.BoxSizer(wx.HORIZONTAL)

Expand Down
18 changes: 9 additions & 9 deletions kicad_amf_plugin/gui/summary/ui_summary_panel.fbp
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@
<property name="name">bSizer1</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER|wxEXPAND</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="0">
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer3</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER|wxEXPAND</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="0">
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Preference</property>
<property name="minimum_size"></property>
Expand Down Expand Up @@ -304,7 +304,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
Expand All @@ -313,7 +313,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER|wxALL|wxEXPAND</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="CustomControl" expanded="0">
<property name="BottomDockable">1</property>
Expand Down Expand Up @@ -375,7 +375,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER|wxALL|wxEXPAND</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="CustomControl" expanded="0">
<property name="BottomDockable">1</property>
Expand Down
18 changes: 8 additions & 10 deletions kicad_amf_plugin/gui/summary/ui_summary_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
PB_STYLE_SQUARE,
)

import gettext

_ = gettext.gettext

###########################################################################
## Class UiSummaryPanel
Expand Down Expand Up @@ -68,9 +71,9 @@ def __init__(
)
sbSizer4.Add(self.btn_set_language, 0, wx.ALL, 5)

bSizer3.Add(sbSizer4, 1, wx.ALIGN_CENTER | wx.EXPAND, 5)
bSizer3.Add(sbSizer4, 1, wx.EXPAND, 5)

bSizer1.Add(bSizer3, 0, wx.ALIGN_CENTER | wx.EXPAND, 5)
bSizer1.Add(bSizer3, 0, wx.EXPAND, 5)

sbSizer1 = wx.StaticBoxSizer(
wx.StaticBox(self, wx.ID_ANY, _("Cost detail")), wx.VERTICAL
Expand Down Expand Up @@ -110,22 +113,17 @@ def __init__(
style=PB_STYLE_GRADIENT,
label=_("Update Price"),
)
bSizer31.Add(self.btn_update_price, 1, wx.ALIGN_CENTER | wx.ALL | wx.EXPAND, 5)
bSizer31.Add(self.btn_update_price, 1, wx.ALL | wx.EXPAND, 5)

self.btn_place_order = PlateButton(
self,
bmp=wx.Bitmap(self.GetImagePath("cart.png"), wx.BITMAP_TYPE_ANY),
style=PB_STYLE_GRADIENT,
label=_("Add to Cart"),
)
bSizer31.Add(self.btn_place_order, 1, wx.ALIGN_CENTER | wx.ALL | wx.EXPAND, 5)
bSizer31.Add(self.btn_place_order, 1, wx.ALL | wx.EXPAND, 5)

bSizer1.Add(
bSizer31,
0,
wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND,
5,
)
bSizer1.Add(bSizer31, 0, wx.EXPAND, 5)

self.SetSizer(bSizer1)
self.Layout()
Expand Down
33 changes: 23 additions & 10 deletions kicad_amf_plugin/language/lang_const.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,34 @@
def get_supported_language():
import wx

return (
wx.LANGUAGE_ENGLISH,
wx.LANGUAGE_JAPANESE_JAPAN,
wx.LANGUAGE_CHINESE_SIMPLIFIED,
)
try:
# NOTE - LANGUAGE_JAPANESE_JAPAN is not available until Kicad 6.0
return (
wx.LANGUAGE_ENGLISH,
wx.LANGUAGE_JAPANESE_JAPAN,
wx.LANGUAGE_CHINESE_SIMPLIFIED,
)
except:
return (
wx.LANGUAGE_ENGLISH,
wx.LANGUAGE_CHINESE_SIMPLIFIED,
)


def code_to_wx():
import wx

return {
"en": wx.LANGUAGE_ENGLISH,
"ja": wx.LANGUAGE_JAPANESE_JAPAN,
"zh_CN": wx.LANGUAGE_CHINESE_SIMPLIFIED,
}
try:
return {
"en": wx.LANGUAGE_ENGLISH,
"ja": wx.LANGUAGE_JAPANESE_JAPAN,
"zh_CN": wx.LANGUAGE_CHINESE_SIMPLIFIED,
}
except:
return {
"en": wx.LANGUAGE_ENGLISH,
"zh_CN": wx.LANGUAGE_CHINESE_SIMPLIFIED,
}


def fool_translation():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ def on_region_changed(self):
pass

def setup_trace_and_via(self):

designSettings = self.board_manager.board.GetDesignSettings()
minTraceWidth = (
designSettings.m_TrackMinWidth
Expand Down

0 comments on commit 2fbb651

Please sign in to comment.