[Solved] vb.net

Home Forums Software Development [Solved] vb.net

Viewing 15 posts - 1 through 15 (of 26 total)
  • Author
    Posts
  • #2483
    David Thomson
    Participant

    As a newcomer to the forum, has anybody got any basic vb.net code that they are willing to share?

    #2501
    Patrik [Tobii]
    Participant

    I’m sorry that we currently do not have any examples targeting VB.NET.

    If you want to get started as soon as possible with the EyeX SDK using VB.NET, I would recommend a service like Telerik’s Code Converter. Using a service like this, you can simply convert the C# code examples or source code on this forum to VB.NET.

    In the meanwhile, here is my contribution 🙂

    
    '-----------------------------------------------------------------------
    ' Copyright 2014 Tobii Technology AB. All rights reserved.
    '-----------------------------------------------------------------------
    
    Imports EyeXFramework
    Imports Tobii.EyeX.Framework
    
    Module Program
    
        Public Sub Main(args As String())
    
            ' Create the EyeX host
            Using eyeXHost = New EyeXHost()
    
                ' Create a data stream: lightly filtered gaze point data.
                ' Other choices of data streams include EyePositionDataStream and FixationDataStream.
                Using dataStream = eyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered)
    
                    ' Start the EyeX host.
                    eyeXHost.Start()
    
                    ' Write the data to the console.
                    AddHandler dataStream.Next, AddressOf OutputGazePoint
    
                    ' Let it run until a key is pressed.
                    Console.WriteLine("Listening for gaze data, press any key to exit...")
                    Console.ReadKey(True)
    
                End Using
    
            End Using
    
        End Sub
    
        Private Sub OutputGazePoint(sender As Object, e As GazePointEventArgs)
            Console.WriteLine("Gaze point at ({0:0.0}, {1:0.0}) @{2:0}", e.X, e.Y, e.Timestamp)
        End Sub
    
    End Module
    
    #2504
    David Thomson
    Participant

    Thanks for your help.

    Nearly there but AddHandler dataStream.[Next] is creating an error?

    #2516
    Patrik [Tobii]
    Participant

    Hello David,

    I’ve updated the example. Since the [ and ] characters surrounding the Next property just is a way of telling the compiler that “I know that this is a keyword, but I want to use it anyway” (just like the @-prefix for variables in C#), and since it’s not actually needed here, you should be able to delete those characters and it should compile.

    It’s strange that you get a compilation error though.
    What does the error say?

    / Patrik

    #2617
    Meir Naiman
    Participant

    How did yo include the EyeXFramework in your vb.net project?

    #2636
    Patrik [Tobii]
    Participant

    Hello Mehr,

    There are two ways you can go to include the EyeXFramework in your VB.NET project.

    1. Compile the framework yourself and add a reference to the compiled assembly.
    2. Add the EyeXFramework C# project to your solution (it’s OK to mix them) and reference the project directly.

    / Patrik

    #2640
    Meir Naiman
    Participant

    Thank you for your reply, i will try both and see which works better for me.

    #3924
    Aniket Sakinala
    Participant

    Hi, I’ve tried to reference the ‘Tobii.EyeX.Client.dll’ provided in the TobiiEyeXSdk-DotNet-1.5.466 in one of my VB.NET project but I get an error that the reference could not be added. Please help.

    #3938
    Jenny [Tobii]
    Participant

    Hi Aniket,

    It sounds like you are trying to add the Tobii.EyeX.Client.dll as a managed dll. You cannot do that, since it is a native dll. I know how to add it in a C# project and I’m guessing it should be similar in VB.NET (though I have never tried).

    Check out this forum topic and the solution I proposed there:

    Tobii EyeX SDK setup C#

    If that doesn’t work, I suggest you google “reference native dll vb.net”.

    #3940
    Aniket Sakinala
    Participant

    Thanks Jenny, that seemed to have fixed it.

    The other problem I’m facing is that the Tobii EyeX Engine is not connecting to the eye tracker(The icon tray says it’s not connected). It works in the Tobii Studio but I can’t get it to work in any .NET projects. The projects compile but there’s no detection.

    #4999
    David Thomson
    Participant

    You previously provided a snippet of VB.net code for the EyeX API. Could you get me going with a similar snippet for the Gaze API. I cannot seem to find any documentation on this.

    #5051
    Grant [Tobii]
    Keymaster

    Hi @profthomson, unfortunately we do not have a visual Basic sample for the Gaze API as this is not a supported binding.

    Hopefully the existing sample you have of EyeX can point you in the right direction.

    #7271
    Doug Livingstone
    Participant

    Dear Tobii

    As a newbie and getting started with an EyeTracker 4C, it would be great if you could post additional articles/code about using the VB.Net and the EyeTracker

    regards
    Doug Livingstone

    #7272
    Grant [Tobii]
    Keymaster

    Hi @mndcommunicate, thanks for your suggestion however for the time being we are not targeting VB.Net development within the new Tobii Core SDK.

    That being said, you can still follow the instructions above in this thread for converting our supplied eye tracking sample applications from C# into VB.net compatible code if necessary.

    I would recommend you start by running the code above to get up and running and thereafter consider code conversion for the more advanced samples… did you already go through these procedures without success?

    #7273
    Doug Livingstone
    Participant

    Thanks Grant

    I have been able to run the programs from the TobiiEyeXSdk-Dotnet-1.8.498. In particular I thought the GazeAwareForms program suited me as a start point. However using the Telerik utility I have not been able to successfully convert it to VB.Net. If anyone else has performed this conversion I would appreciate the advice. That applies to the other dotnet programs, as such examples would get me started.

    Regards
    Doug

Viewing 15 posts - 1 through 15 (of 26 total)
  • You must be logged in to reply to this topic.