Duke-Jones / RegulatedNoise

32 stars 11 forks source link

ApplicationContext proposal #32

Closed WiredSharp closed 9 years ago

WiredSharp commented 9 years ago

Hi Duke, i would like to propose you a reworking of main form in order to isolate other classes and allow to test them more easily. Here is first step of reworking, let me know what you think of it. I can propose you a threading model to simplify execution of background tasks through queue (lock free, no more thread handling). Last step would be to propose a plugin architecture for each tab, in order to isolate each work in progress.

Duke-Jones commented 9 years ago

Hi, very good idea. Since I have overtake this project I often have thought "the internal structure must clean up urgent". But my main focus was absolutely on improving existing functions and adding new functions - I'm not sure if I would ever had the time to do this cleanup by myself.

Please be patient, I will read your changes in peace and then you'll get the answer tomorrow or Sunday.

Duke-Jones commented 9 years ago

ok, I'd look on your changes.... ...very good - you've added some interesting and useful things. So, if you have the time to do this I will add your coming changes also to the master repository.

Duke Jones

WiredSharp commented 9 years ago

i'm glad you like it, if i can help on other subjects, please tell me. i will push my next wave soon.

Duke-Jones commented 9 years ago

i'm glad you like it, if i can help on other subjects, please tell me.

I will :-) There's partly a problem while starting RN first time. Some users report a error while RN is searching for the correct products path. The crash appears in (now) line 609 in Form1.cs:

/Verify that path contains FORC-FDEV var dirs = Directory.GetDirectories(path);

a actual error report is here : https://github.com/Duke-Jones/RegulatedNoise/issues/34

I've at the moment no idea to optimize this spot because I can't reproduce it. I assume basically it's a Win8-rights problem (?)

You have an idea ?

WiredSharp commented 9 years ago

ok, i will have a look.

WiredSharp commented 9 years ago

weird, the path looks truncated and the exception is a DirectoryNotFoundException, not an UnauthorizedAccessException... here is a bad smell:

Form1.getProductPathAutomatically (...)

    ProgramPath = ProgramPath.Substring(0, ProgramPath.LastIndexOf("\\Products\\") + 9);
    return ProgramPath;

Guess what, if IndexOf returns -1 ? ProgramPath.Substring(0,8) => 'C:\Progr'

WiredSharp commented 9 years ago

i commit a fix in my branch commodities. As i moved pathes setup logic to RegulatedNoiseSettings, i would have get conflicts. Tell me what you think of my modifications and we can discuss of which improvments can be merged in your project.