101 lines
2.6 KiB
Plaintext
101 lines
2.6 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2025-03-21T09:22:33.939365Z",
|
|
"start_time": "2025-03-21T09:22:33.911673Z"
|
|
}
|
|
},
|
|
"cell_type": "code",
|
|
"source": [
|
|
"from src.models import KeypadSize\n",
|
|
"from src.user_keypad import UserKeypad\n",
|
|
"from src.utils import keypad_md_table\n",
|
|
"import numpy as np\n",
|
|
"from IPython.display import Markdown, display"
|
|
],
|
|
"id": "1f073371d04d02ef",
|
|
"outputs": [],
|
|
"execution_count": 1
|
|
},
|
|
{
|
|
"metadata": {
|
|
"collapsed": true,
|
|
"ExecuteTime": {
|
|
"end_time": "2025-03-21T09:22:33.948436Z",
|
|
"start_time": "2025-03-21T09:22:33.943046Z"
|
|
}
|
|
},
|
|
"cell_type": "code",
|
|
"source": [
|
|
"keypad_size = KeypadSize(numb_of_keys=5, props_per_key=4)\n",
|
|
"props = [1, 10, 11, 100]\n",
|
|
"keypad = []\n",
|
|
"for key_numb in range(1,keypad_size.numb_of_keys+1):\n",
|
|
" keypad.extend([key_numb * prop for prop in props])\n",
|
|
"\n",
|
|
"demo_interface = UserKeypad(keypad_size=keypad_size, keypad=np.array(keypad))\n",
|
|
"display(Markdown(f\"\"\"\n",
|
|
"## Example Keypad\n",
|
|
"{keypad_size.numb_of_keys} X {keypad_size.props_per_key} keypad ({keypad_size.numb_of_keys} keys, {keypad_size.props_per_key} properties per key).\n",
|
|
"\"\"\"))\n",
|
|
"display(Markdown(keypad_md_table(demo_interface.keypad, keypad_size)))"
|
|
],
|
|
"id": "initial_id",
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"<IPython.core.display.Markdown object>"
|
|
],
|
|
"text/markdown": "\n## Example Keypad\n5 X 4 keypad (5 keys, 4 properties per key).\n"
|
|
},
|
|
"metadata": {},
|
|
"output_type": "display_data"
|
|
},
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"<IPython.core.display.Markdown object>"
|
|
],
|
|
"text/markdown": "||position 0|position 1|position 2|position 3|\n|-|-|-|-|-|\n|key 0|1|10|11|100|\n|key 1|2|20|22|200|\n|key 2|3|30|33|300|\n|key 3|4|40|44|400|\n|key 4|5|50|55|500|"
|
|
},
|
|
"metadata": {},
|
|
"output_type": "display_data"
|
|
}
|
|
],
|
|
"execution_count": 2
|
|
},
|
|
{
|
|
"metadata": {},
|
|
"cell_type": "code",
|
|
"outputs": [],
|
|
"execution_count": null,
|
|
"source": "keypad_mat = demo_interface",
|
|
"id": "43db2b9d247f420d"
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 2
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython2",
|
|
"version": "2.7.6"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|