Edge baker tool

Discussion in 'Car Modding' started by Tommy78, Sep 6, 2019.

  1. CeeBee

    CeeBee Registered

    Joined:
    May 24, 2020
    Messages:
    207
    Likes Received:
    125
    I dont mod so i dont have GMT's to test, but, program flow looks like it invokes baker.dll as follows
    [DllImport("Baker.dll")]
    private static extern void BakeGMT(string input, string output, float threshold, float contrast, int size);


    Export button runs this
    private void Export(object sender, EventArgs e)
    {BakeGMT(_gmtInput.Text, _pngOutput.Text, (float)_thresholdValue.Value, (float)_contrastValue.Value, (int)_resolutionValue.Value);
    WriteSettings();}

    so looks like the program is at the mercy of a timeout in baker.dll.

    Adding something like this

    private void Export(object sender, EventArgs e){
    Thread thread = new Thread(RunBaker());
    thread.Start();
    while(thread.IsAlive){
    //do something to let users know baker is still busy
    //add timeout to end the thread if its taking longer than Nth time.
    }
    WriteSettings();
    }

    private void RunBaker(){
    BakeGMT(_gmtInput.Text, _pngOutput.Text, (float)_thresholdValue.Value, (float)_contrastValue.Value, (int)_resolutionValue.Value);
    }

    or task.run or even async, anything that does not leave the main window at the mercy of a crash or timeout in the the baker.dll.

    if someone can send me a gmt to play will I will have a looksee if it can be stabilised to at least only crash the baker thread and not the whole app.

    For what its worth it loads fine windows 11 with only .net 4.8 on it.
    upload_2021-9-7_7-19-7.png
     
  2. CeeBee

    CeeBee Registered

    Joined:
    May 24, 2020
    Messages:
    207
    Likes Received:
    125
    I built the UI against X64 and .net 4.7.2 (everyone should be on at least that) compiled version in net472.zip, and the code in ui.zip

    UI runs fine, baker.dll is spitting a memory access violation, but, probably due to the fact that I am starting it with no input GMT. I added a MessageBox in case the returning failure is captured, but, it never is.

    upload_2021-9-7_7-40-5.png
     

    Attached Files:

    • net472.zip
      File size:
      125.2 KB
      Views:
      96
    • ui.zip
      File size:
      477.8 KB
      Views:
      100

Share This Page