Having a little trouble with v 1.1.0

Nov 16, 2015 at 1:07 AM
For sake of simplicity, I have created a folder in my solution named HMI. There I put the HMI file and the DisplayConfigurationGenerator executable.

my Pre-Build command line is:
$(SolutionDir)HMI\DisplayConfigurationGenerator.exe $(SolutionDir)HMI\Demo.hmi /ns MyNamespace /cn NextionClass
I get an error of
Error   1   The command "c:\users\scard.desktop-9l23b08\documents\visual studio 2013\Projects\TestingNextionNet_1.1.0\HMI\DisplayConfigurationGenerator.exe c:\users\scard.desktop-9l23b08\documents\visual studio 2013\Projects\TestingNextionNet_1.1.0\HMI\Demo.hmi /ns MyNamespace /cn NextionClass
" exited with code 9009.    TestingNextionNet_1.1.0
What am I doing wrong?
Coordinator
Nov 16, 2015 at 8:41 AM
I guess you are missing quotes. Correct pre-build should be:
"$(SolutionDir)HMI\DisplayConfigurationGenerator.exe" "$(SolutionDir)HMI\Demo.hmi" /ns MyNamespace /cn NextionClass
Nov 16, 2015 at 10:59 AM

This still does not work.

When I execute it from the command line using C:\Users\scard.DESKTOP-9L23B08\Documents\Visual Studio 2013\Projects\TestingNextionNet_1.1.0\TestingNextionNet_1.1.0\HMI>displayconfigurationgenerator demo.hmi /ns MyNamespace /cn NextionClass /o ..\Nextionclass.cs

It returns Unknown type: Page. Skipping...

However, the generated file appears to be correct.

P.S. What is the purpose of adding the extra Hex Characters to the Picture IDs in the Pictures Enumeration. It makes things harder to follow?

What is the purpose of the UserInit(display); in the Init method

public static void Init(JernejK.NextionNET.Driver.NextionDisplay display)

{

P0 = display.Controls.DefinePictureBox(1, "p0", 1);

UserInit(display);

}

UserInit will never get executed as its implementation is partial or abstract.

I am sure that I that I will have other questions.

Stephen

Coordinator
Nov 16, 2015 at 11:38 AM
  1. This unknown types are just warnings, so just ignore them.
  2. At font and pages I have name, but at pictures I don't have any user identification. Where is the problem? If you have 3 pictures and then you delete 2., you will not get any compile time error, but you will get wrong picture at the runtime. For that reason I added picture hash code, so if the picture changes, you also need to change code. I recommend you to use extra private enum to do the mapping, like this:
    public enum MyPictures
    {
        Smyle1 = Pictures.Picture0_4C5C9ED1,
        Smyle2 = Pictures.Picture1_66B4FE23,
        Smyle3 = Pictures.Picture2_D735FB57,
    }
    
Otherwise I will add a switch to generator to skip hash at pictures.
  1. UserInit is for user internal initializations and it's not required. Here is one example from TicTacToe demo:
    public partial class DisplayConfiguration
    {
    public partial class Page1
    {
        public static Driver.Controls.PictureBox[] PlayGround;
        static partial void UserInit(NextionNET.Driver.NextionDisplay display)
        {
            PlayGround = new[] { PlayGround00, PlayGround01, PlayGround02, PlayGround10, PlayGround11, PlayGround12, PlayGround20, PlayGround21, PlayGround22 };
        }
    }
    }
Here I generated array of components for easy access to them later.
Coordinator
Nov 16, 2015 at 12:12 PM
If you have any suggestions or questions please let me know. Good beta testers are more than welcome.
Btw, did you get my replay to your private message? It way a while ago.

Jernej
Nov 16, 2015 at 4:42 PM

Yes, I did receive it. If you are referring to the one about the DS Button, etc.?

If this is not the one in question, then you can let me know what it was about?

I did have a few questions regarding the path that you use for the DisplayconfigurationGenerator.exe. Your path ..\..\..\DisplayConfigurationGenerator.exe is a little confusing to me.

Coordinator
Nov 16, 2015 at 5:54 PM
There was nothing special about it, I was just wondering if codeplex messaging works.
I'm sure that using $(SolutionDir) is better than my "..". My example is taken from my SVN repository, where is have this structure:
Root
--Tools
----DisplayConfigurationGenerator.exe
--Demo
----Bin
------Debug

So from debug folder to tools is "......\Tools\DisplayConfigurationGenerator.exe"
Nov 16, 2015 at 6:37 PM

Can you try to create a project outside the SVN repository and then tell me how this works. I am still having troubles with the relative path.

Coordinator
Nov 17, 2015 at 8:20 PM
I will prepare getting started demo including setting up DisplayConfigurationGenerator, but I'm afraid it could take some time. Will let you know.
Nov 17, 2015 at 8:59 PM

That would be awesome. It is not as straight forward as you would think. I have spent a few hours trying to get this to work.

Coordinator
Nov 18, 2015 at 9:10 PM
I have done my best to do one getting started guide. It is available here. As you can see very quickly English is not my strongest part :) Sorry about that and I hope someone will find it useful.
Coordinator
Dec 15, 2015 at 11:32 AM
@scardinale: long time no hear. Does this driver works for you? Need anything else?
Do you use this driver in any real world application or you just playing around like me?
Dec 15, 2015 at 2:01 PM

@ jernejk. The driver works just fine in its last release.

I have not used the driver or Nextion display in any real world applications yet.

Mostly I have used it to showcase MikroBus.Net Click board drivers due to the simplicity of the Nextion hardware and your driver making it very easy to make some very nice demos.

The only drawback with the Nextion display is no support for dynamic adding of graphic images. Hopefully, this will be resolved by them soon. Then it will be a really nice display to have.

You can see it in action in these YouTube videos:

https://www.youtube.com/watch?v=SrPatS32FvE

https://www.youtube.com/watch?v=dDGL1D3xSBY

https://www.youtube.com/watch?v=ooo7Nzp2oqU

https://www.youtube.com/watch?v=hzZ2Dbgd18Y

Stephen

[email removed]

www.mikrobusnet.org

Coordinator
Dec 16, 2015 at 8:05 AM
Thank you for sharing.
I totally agree with you about dynamic images. I saw there is already one feature request about that http://support.iteadstudio.com/support/discussions/topics/1000071972. Maybe you should also vote for it and maybe we get this sorted soon.

Regards
Dec 16, 2015 at 11:21 AM

I have voted for this feature.

Stephen