---
# System prepended metadata

title: '<center><i class="fa fa-edit"></i> Smart Dispenser: `members_addtiona_card` Subfunction Code Edits </center>'
tags: [Internship]

---

# <center><i class="fa fa-edit"></i> Smart Dispenser: `members_addtiona_card` Subfunction Code Edits </center>
###### tags: `Internship`
:::info
**Goal:**
- [x] Final changes to code
- [x] Demonstrate 新增介面

**Resources:**
[PyQt](https://hackmd.io/Ibk_VuuWRXOjkION4wk3tg)
[newXinXingPyQtStructure](https://drive.google.com/drive/u/0/folders/1Ahr8zkZgUv8ujauLKGz1ZSzkZq0M9_mx)
[CodiMD](https://hackmd.io/c/codimd-documentation/%2F%40codimd%2Fextra-supported-syntax#Flow-Chart)
[冠辰參考的筆記](https://www.wongwonggoods.com/page/4/?s=pyqt&ct_post_type=post%3Apage&ct_product_price=1)
:::

---
:::spoiler **Expand Catalog**
[TOC]
:::

---
## Figures
*Figure 1. Open a new collection members_additional_card*
![](https://i.imgur.com/HIZq4rs.jpg)

*Figure 2. Flowchart*
![](https://i.imgur.com/KeSi6dk.jpg)

---
### Changes to Code
**Register Function**
* Previously, the register function displayed: Please swipe your new card on any smart dispenser. The system will register you automatically.
* However, this only records the CardID of the new user but not other necessary info like name, height, weight, etc. 
* Thus, this needs to be changed to a multiple entry dialogue box when clicked
    * If input is empty, do not add to database
    * Check if schoolID is already in `members_data`
    * Otherwise register as a new user

![](https://i.imgur.com/fKhCPOf.png)
![](https://i.imgur.com/ZUgChmv.png)

:::danger
Ran into errors when instantiating `alldata` and `alldata[0]`. Need to figure this out tomorrow
:::

