Max number of models

More
28 Jan 2017 20:50 #58494 by Sero
Max number of models was created by Sero
What is the maximal number of models that can be stored on a Devo 6s? I am at number 100 and seem unable to add another one...

A day without flying can't be called a day.

Please Log in or Create an account to join the conversation.

More
28 Jan 2017 22:42 #58506 by HappyHarry
Replied by HappyHarry on topic Max number of models
i didn't know there was a limit bar flash space? but i may be wrong

Please Log in or Create an account to join the conversation.

More
28 Jan 2017 23:24 #58508 by Arnold
Replied by Arnold on topic Max number of models

Sero wrote: What is the maximal number of models that can be stored on a Devo 6s? ...


The Deviation User Manual, in the Overview section says,
Deviation can store up to 255 different models ...

This can be limited by storage space available on the radio and the sizes of the various model configuration files being stored.

Too many hobbies & too many Devos!
Who knows where the time goes?

Please Log in or Create an account to join the conversation.

More
28 Jan 2017 23:52 #58510 by Sero
Replied by Sero on topic Max number of models
There is still space left, but no matter how I try to add another one, 100 models seems to be the maximum...

A day without flying can't be called a day.

Please Log in or Create an account to join the conversation.

More
29 Jan 2017 00:36 - 29 Jan 2017 00:42 #58511 by Arnold
Replied by Arnold on topic Max number of models
Since you say there is space available on the radio, try duplicating a model file on the radio and then try to edit and re-save it back to the radio.

If that fails, I think my last resort would be to format the Devo (using the installation tool of your choice - not by using the computer's tools) and reinstall deviation.

* It should be obvious that you would want to back up those items on the radio that you want to be sure to save. *

Too many hobbies & too many Devos!
Who knows where the time goes?
Last edit: 29 Jan 2017 00:42 by Arnold.

Please Log in or Create an account to join the conversation.

More
29 Jan 2017 00:47 #58512 by Sero
Replied by Sero on topic Max number of models
My second 6s is the same, so this seems to be normal behavior.

A day without flying can't be called a day.

Please Log in or Create an account to join the conversation.

More
29 Jan 2017 01:05 #58514 by Arnold
Replied by Arnold on topic Max number of models
6S X Two!
Lucky guy!

Too many hobbies & too many Devos!
Who knows where the time goes?

Please Log in or Create an account to join the conversation.

More
29 Jan 2017 05:21 #58518 by hexfet
Replied by hexfet on topic Max number of models
Took a look at the code and there is a hard-coded limit of 100, for no good reason that I could see. I've made a test build that increases the limit to 255. There still might be an issue if number of models plus number of layouts is more than 255 and you try to load a layout, but hopefully not :) Actually don't see why it couldn't go past 255 if necessary.

Can't get the test build upload link to work. A devo6 dfu is attached.
Attachments:

Please Log in or Create an account to join the conversation.

More
29 Jan 2017 16:25 #58533 by Fernandez
Replied by Fernandez on topic Max number of models
More than 100 models, Wow that's a serious "Deviation Gold Member".

Please Log in or Create an account to join the conversation.

More
30 Jan 2017 05:20 - 30 Jan 2017 05:21 #58546 by FDR
Replied by FDR on topic Max number of models

hexfet wrote: Can't get the test build upload link to work. A devo6 dfu is attached.


Would you try to upload it again?
PB has fixed the upload:

the user-upload code should auto-update, but if it does not, download the latest copy manually. you need 0.9.6

Last edit: 30 Jan 2017 05:21 by FDR.

Please Log in or Create an account to join the conversation.

More
02 Feb 2017 00:46 #58635 by hexfet
Replied by hexfet on topic Max number of models
Thanks FDR. No need for a test build now as the change has been merged and is in the nightly build.

Please Log in or Create an account to join the conversation.

More
06 Feb 2017 14:47 - 06 Feb 2017 17:08 #58820 by vlad_vy
Replied by vlad_vy on topic Max number of models
It doesn't work well. Transmitter reboot with any attempt to load new model if number of models >130~150.

Problems:
1. I think that model_count() function work too slow with large number of models and we get reboot by timeout.
2. We can't have 255 model limit, since main screen "Layout" templates list show templates and models: templates + models <=255. More real models limit will be about 200.

If change num_models = model_count(); to num_models = count_files("models", ".ini", NULL) - 1;, it work well, but it's not strict verification: we can skip model files, have arbitrary names and so on.

I think will be better to revert commit "Increase maximum number of model files from 100 to 255".
Last edit: 06 Feb 2017 17:08 by vlad_vy.

Please Log in or Create an account to join the conversation.

More
07 Feb 2017 06:26 - 07 Feb 2017 06:29 #58849 by vlad_vy
Replied by vlad_vy on topic Max number of models
We can use modified model_count():
int model_count()
{
    int num_models = count_files("models", ".ini", NULL) - 1;
    if(num_models > 200)
        num_models = 200;
    //check if model file is missing or >200 model files
    sprintf(tempstring, "models/model%d.ini", num_models + 1);
    if (fexists(tempstring))
        num_models = 0;
    return num_models;
}

It doesn't check/verify every model file, but missing model files and >200 model files only. In such case user will get empty models list. It work fine with any number of model files (<= 255).
Last edit: 07 Feb 2017 06:29 by vlad_vy.

Please Log in or Create an account to join the conversation.

More
07 Feb 2017 07:20 #58854 by FDR
Replied by FDR on topic Max number of models
The problem is that if you don't check all the model files in the loadable range, then it will fail when it wants to load a missing file.

Have you tried if the "fexists" is faster then the "fopen/fclose" was in the original implementation?
Like this:
int model_count()
{
    int num_models;
    for (num_models = 1; num_models <= 255; num_models++) {
        sprintf(tempstring, "models/model%d.ini", num_models);
        if (fexists(tempstring))
            break;
    }
    num_models--;
    return num_models;
}

Please Log in or Create an account to join the conversation.

More
07 Feb 2017 08:14 - 07 Feb 2017 08:16 #58859 by vlad_vy
Replied by vlad_vy on topic Max number of models
"fexists" do exactly the same things, but takes less space. But anyway, I can't fit changed code to devo7e v5.0.0 build, overflowed by 4 bytes.

I've tested with missing file, it works but can't be saved. With check, if any model file skipped you will get empty models list.
Last edit: 07 Feb 2017 08:16 by vlad_vy.

Please Log in or Create an account to join the conversation.

More
07 Feb 2017 09:23 - 07 Feb 2017 17:53 #58864 by vlad_vy
Replied by vlad_vy on topic Max number of models
If model files will be numbered: modelXXX.ini ("model001.ini" to "model200.ini") model_count() function can be:
int model_count()
{
    int num_models = 0;
    if (FS_OpenDir("models")) {
        char filename[13];
        int type;
        while((type = FS_ReadDir(filename)) != 0) {
            if (type == 1 && strncasecmp(filename + strlen(filename) - 4, ".ini", 4) == 0) {
                if(strncasecmp(filename, "default.ini", 11) != 0) {
                    num_models++;
                    sprintf(tempstring, "model%03d.ini", num_models);
                    if(strncasecmp(filename, tempstring, 12) != 0) {
                        num_models--;
                        break;
                    }
                    if(num_models >= 200) {
                        num_models = 200;
                        break;
                    }
                }
            }
        }
        FS_CloseDir();
    }
    return num_models;
}
Last edit: 07 Feb 2017 17:53 by vlad_vy.

Please Log in or Create an account to join the conversation.

More
07 Feb 2017 10:44 #58865 by FDR
Replied by FDR on topic Max number of models
That naming convention would be better by any means, but that would break the compatibilit, and the users had to rename all of their files, which is not a good thing...

Please Log in or Create an account to join the conversation.

More
07 Feb 2017 11:10 - 07 Feb 2017 11:12 #58866 by Fernandez
Replied by Fernandez on topic Max number of models
if we can group models, or store in folders would that help? That way can keep more organized, go to heli >select the heli.

also usefull if we could add annotation in the label. Model001_SuperCP_Walkera etc,
would make way more easy to find and or exchange model files.
Last edit: 07 Feb 2017 11:12 by Fernandez.

Please Log in or Create an account to join the conversation.

More
07 Feb 2017 11:26 #58867 by Moeder
Replied by Moeder on topic Max number of models
This would for sure not fit on the 7e.
Vlad,just make the code change to 255 an option not available on 7e...I'd say any user with 100+ models won't stick with a 7e

Please Log in or Create an account to join the conversation.

More
07 Feb 2017 11:38 #58868 by FDR
Replied by FDR on topic Max number of models

Fernandez wrote: if we can group models, or store in folders would that help? That way can keep more organized, go to heli >select the heli.

also usefull if we could add annotation in the label. Model001_SuperCP_Walkera etc,
would make way more easy to find and or exchange model files.

The minimalist filesystem used in deviation can't create, copy or rename files, only can use the existing ones, that's why they are named as modelXX.ini...

Please Log in or Create an account to join the conversation.

Time to create page: 0.062 seconds
Powered by Kunena Forum