Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Did not find config.json #42

Closed
AKMaily opened this issue Oct 23, 2023 · 7 comments
Closed

Did not find config.json #42

AKMaily opened this issue Oct 23, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@AKMaily
Copy link
Collaborator

AKMaily commented Oct 23, 2023

The compiled version of the programm in windows has no config file.

System: Windows 11
Version: b0a3756

ConfigFile

@MaxClerkwell
Copy link
Contributor

There are two possible fixes:

  1. A standard config.json is generated during the compilation-process in CI
  2. An empty config.json is generated on opening the application

Which entries in config.json are mandatory, @NP199?

@MaxClerkwell MaxClerkwell added the bug Something isn't working label Oct 23, 2023
@NP199
Copy link
Collaborator

NP199 commented Oct 23, 2023

The problem is that the download failed.
When the config.json or language.json is not found the programm creates them as a new file and tries do download the contents from github and then dumps the content into it.
Until now there is now error checking if there is an error with the syntax or an empty file.

One solution is to delete the config.json and restart the programm or to copy the contents manually. (only for now)

The problem with solution number 2 is, that the content itself is not checked so th program would assume the file is correct.

So what should be done is to do a validation or/and to create a default config while compiling.

@NP199
Copy link
Collaborator

NP199 commented Oct 23, 2023

also issue #21 mentions this behaviour

@MaxClerkwell
Copy link
Contributor

Okay, so we should move on with generating the default config in the CI-Pipeline. But first of all, we should discuss, which entries are necessary in the config.json at all:

{
    "api": {
        "header1": "Content-Type: multipart/form-data",
        "header2": "Accept: application/json",
        "input1": "vin",
        "input2": "scan_type",
        "url": "https://postapi.aw4null.de/v1/uploadFile/"
    },
    "helplink": "https://www.autowerkstatt40.org/",
    "github": {
        "url": {
            "config": "https://raw.githubusercontent.com/skunkforce/omniview/master/config/config.json",
            "language": "https://raw.githubusercontent.com/skunkforce/omniview/master/languages/Deutsch.json"
        }
    },
    "button": {
        "sizex": 0.0,
        "sizey": 0.0,
        "standart": {
            "active": {
                "blue": 0.9,
                "green": 0.6,
                "red": 0.6,
                "transparency": 1.0
            },
            "hover": {
                "blue": 0.9,
                "green": 0.9,
                "red": 0.9,
                "transparency": 1.0
            },
            "normal": {
                "blue": 0.8,
                "green": 0.8,
                "red": 0.8,
                "transparency": 1.0
            }
        },
        "start": {
            "active": {
                "blue": 0.0,
                "green": 0.6,
                "red": 0.0,
                "transparency": 1.0
            },
            "hover": {
                "blue": 0.0,
                "green": 0.7,
                "red": 0.0,
                "transparency": 1.0
            },
            "normal": {
                "blue": 0.0,
                "green": 0.8,
                "red": 0.0,
                "transparency": 1.0
            }
        },
        "stop": {
            "active": {
                "blue": 0.0,
                "green": 0.0,
                "red": 0.6,
                "transparency": 1.0
            },
            "hover": {
                "blue": 0.0,
                "green": 0.0,
                "red": 0.7,
                "transparency": 1.0
            },
            "normal": {
                "blue": 0.0,
                "green": 0.0,
                "red": 0.8,
                "transparency": 1.0
            }
        }
    },
    "firststart": true,
    "language": "Deutsch",
    "languagepath": "languages/",
    "menubar": {
        "main": {
            "blue": 0.7,
            "green": 0.7,
            "red": 0.7,
            "transparency": 1.0
        },
        "popup": {
            "blue": 0.7,
            "green": 0.7,
            "red": 0.7,
            "transparency": 1.0
        }
    },
    "scanfolder": "saves",
    "text": {
        "color": {
            "inactive": {
                "blue": 0.5,
                "green": 0.5,
                "red": 0.5,
                "transparency": 1
            },
            "normal": {
                "blue": 0.1,
                "green": 0.1,
                "red": 0.1,
                "transparency": 1
            }
        },
        "font": "comicsans",
        "minscale": 1,
        "scale": 1.9999998807907104
    },
    "title": "Omniview 0.5",
    "window": {
        "color": {
            "blue": 0.7,
            "green": 0.7,
            "red": 0.7,
            "transparency": 1.0
        },
        "sizex": 1920,
        "sizey": 800
    }
}

I believe, that some of this content shouldn't be part of the config to begin with, but rather be hard-coded.
Colors may be in a config file to create "skin"-like behavior.
Other things, like the windows title should be hard-coded.
Another possibility could be to load colors via a different file, called skin.json and set the skin-file in the config.json.

Either way: These files should be downloaded during the delivery and not during the first run.

@R-Abbasi
Copy link
Collaborator

R-Abbasi commented Oct 24, 2023

The program works well on Linux and a config.json file is created as soon as the cloning is done (the first step). It must be the same on Windows. So I suggest checking omniview/config folder for that json file. You can manually copy it into /omniview/build/config folder, after compiling the project, and retest.
Since both title and size (sizex, sizey) entities are quite short, they'll be more easily dealt with when hardcoded, lesser calls of load_json<...>(config, ...) totally, and a little higher performance for the program likely, to me.

@NP199
Copy link
Collaborator

NP199 commented Oct 25, 2023

The idea behind downloading the config.json was to simplify the usage of the programm. We want to ship the program to enduser with little knowledge of computer systems and their need to have files in the right directory.
When you clone the repository and build the thing on your own machine, than windows has no problem with that either.
The problem is when you drag the executable file somewhere else on your system and forget the config.json.

In my opninion it can`t be the solution to trust the user to do the right thing and move the config.json and language.json with them and there should be default handling wiht this as mentioned above.

So my suggestion would be to be able to run the program without these files, so it can be used atleast.
The idea with the CI is good aswell.

Another challenge we will be facing is to get the right version of the config with the right version of the program running. If we make major changes right now, the whole supporting process will be worse, because of the lacking version controll.

I hope i descripted the problems in a coprenhesible way.

@MaxClerkwell
Copy link
Contributor

I think this issue should be closed and be handled as a duplicate of #21
With the next major release - January - we should have decided on a process on how to deal with this.

@MaxClerkwell MaxClerkwell closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants