Hi all, I've been pondering over this for about a week with no luck on a simple solution.
A usb device will import data in TXT/CSV format from PC software - amoung other things, the main purpose is for the USB device to display categories (which users select with up and down keys on the keypad). There could be any number of categories set by the user on pc, downloaded into the device, and then referred to when using the device. Categories can have sub-categories, and sub-categories can have sub-sub-categories.
Categories can be deleted....changed....modified in name, so, each category is assigned a unique id number on the pc software. An example of categories would be teams, and then sub-categories would be players. The CSV would be something like:
team A, 111
team B, 112
team C, 113
A user might delete team B, and rename another team:
team A, 111,
team baldrick, 114
team C, 113
Categories always keep there same id number so any data saved to that category doesnt get lost. Categories should be saved alphabetically, by their name, not by their unique id number - so when scrolling on the device keypad (after downloading the txt file to the device) - the user knows how far to wait/go for a certain category.
The problem.. is...how do sub-categories get listed?
team a, 111
player 1, 111.1
player 2, 111.2
player 3, 111.3
Sub cat. unique id is an extension of parent category id. Each parent category can have true or false indicator if it has or doesn't have sub-categories.
I don;t know how the txt file exported from pc software into the device via usb should be sequenced/listed, as, parent categories should be alphabetical by name, and sub-categories be alphabetical by name under each respective parent category.
team a, 111
player 1, 111.1
player 2, 111.2
player 3, 111.3
team baldrick, 114
player 1, 114.1
player 2, 114.2
player 3, 114.3
As above, how would software export such category listing in this order, can't list by id number as these might change when adding/deleting......
My other idea was to make a seperate code string (not sure if right word) for each sub-category. For example
team A, 111, 1
team baldrick, 114, 1
team C, 113, 1
The third digit true/false if there are sub categories, if true, there will be a string in the same output code file with the list of sub-categories for that parent category, in case of team A,
sub string 111
player 1, 111.1
player 2, 111.2
player 3, 111.3
So the MCU on the device would work something like:
Show parent category
(if user wants to see the sub-category) they press left/right keypad button
If they do that, MCU searches same txt imported file in memory for sub-string of the parent categories unique id number. There, will be an alphabetical list of sub-categories, with unique id numbers (which will be out of sequence).
This way, the TXT file can easily be ordered, and the MCU can easily navigate round....
but... i just dont really know......
any advice/help/pointers would be great......
thanks
A usb device will import data in TXT/CSV format from PC software - amoung other things, the main purpose is for the USB device to display categories (which users select with up and down keys on the keypad). There could be any number of categories set by the user on pc, downloaded into the device, and then referred to when using the device. Categories can have sub-categories, and sub-categories can have sub-sub-categories.
Categories can be deleted....changed....modified in name, so, each category is assigned a unique id number on the pc software. An example of categories would be teams, and then sub-categories would be players. The CSV would be something like:
team A, 111
team B, 112
team C, 113
A user might delete team B, and rename another team:
team A, 111,
team baldrick, 114
team C, 113
Categories always keep there same id number so any data saved to that category doesnt get lost. Categories should be saved alphabetically, by their name, not by their unique id number - so when scrolling on the device keypad (after downloading the txt file to the device) - the user knows how far to wait/go for a certain category.
The problem.. is...how do sub-categories get listed?
team a, 111
player 1, 111.1
player 2, 111.2
player 3, 111.3
Sub cat. unique id is an extension of parent category id. Each parent category can have true or false indicator if it has or doesn't have sub-categories.
I don;t know how the txt file exported from pc software into the device via usb should be sequenced/listed, as, parent categories should be alphabetical by name, and sub-categories be alphabetical by name under each respective parent category.
team a, 111
player 1, 111.1
player 2, 111.2
player 3, 111.3
team baldrick, 114
player 1, 114.1
player 2, 114.2
player 3, 114.3
As above, how would software export such category listing in this order, can't list by id number as these might change when adding/deleting......
My other idea was to make a seperate code string (not sure if right word) for each sub-category. For example
team A, 111, 1
team baldrick, 114, 1
team C, 113, 1
The third digit true/false if there are sub categories, if true, there will be a string in the same output code file with the list of sub-categories for that parent category, in case of team A,
sub string 111
player 1, 111.1
player 2, 111.2
player 3, 111.3
So the MCU on the device would work something like:
Show parent category
(if user wants to see the sub-category) they press left/right keypad button
If they do that, MCU searches same txt imported file in memory for sub-string of the parent categories unique id number. There, will be an alphabetical list of sub-categories, with unique id numbers (which will be out of sequence).
This way, the TXT file can easily be ordered, and the MCU can easily navigate round....
but... i just dont really know......
any advice/help/pointers would be great......
thanks