Building the new Configurator.NET on linux ?


Hi everyone,

I saw that recently a new Configurator source code appeared in the arducopter svn repo. It seems to be written in C#. For me the main flaw with the original configurator was that I couldn't run it on linux (ubuntu 10.10) , and I had to reboot in windows (which I never use)  every time I wanted to use the configurator. So when I saw the new code I though "maybe I could use it on linux with mono". So I installed monodevelop and I built the configurator. There was no error (only a warning), but when I launch ArducopterConfigurator, I can only see a windows for a few miliseconds, then I get this message in the terminal: 

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: '0' is not a valid value for 'Value'. 'Value' should be between 'Minimum' and 'Maximum'
Parameter name: Value
at System.Windows.Forms.ProgressBar.set_Value (Int32 value) [0x00000] in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
at System.Reflection.MonoProperty.SetValue (System.Object obj, System.Object value, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] index, System.Globalization.CultureInfo culture) [0x00000] in :0
at System.Reflection.PropertyInfo.SetValue (System.Object obj, System.Object value, System.Object[] index) [0x00000] in :0
at System.ComponentModel.ReflectionPropertyDescriptor.SetValue (System.Object component, System.Object value) [0x00000] in :0


I tried to determine where the exception was coming from with the debugger, but I couldn't find it.

So here are my questions:
-Is the current code actually working on a windows environment ? ( I guess it is)
-Is this error releated to the code or to my mono environment ?
-Did someone manage to make this code work on linux ?
-Where can I find more informations about this version of the configurator ? I couldn't find any in the wiki.

Sorry if this is not the right place to talk about it, but I thought this category was the most appropriate.
Thank you for your answers.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Moderator
    I thought the .Net configurator was in Visual Basic? I'm current going through it and get some insights on how to implement the AH and DG for my Mac OSX version.
  • FYI, I just put up a click once deployment for those who just want to play:

    http://mandrolic.com/configurator/

    Have not tested that link on any other machine but my own so might not work. Also that deployment is Windows only, Mono will need a different method
  • I just tested it on OSX - didn't work. I'll look into it when I get some time.

     

    Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeEngine ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeWin32Classic ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.KnownColors ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: /Library/Frameworks/Mono.framework/Versions/2.8.2/lib/libgdiplus.dylib  at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)  at System.Drawing.GDIPlus..cctor () [0x000cc] in /private/tmp/monobuild/build/BUILD/mono-2.8.2/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs:127   --- End of inner exception stack trace ---  at System.Drawing.KnownColors..cctor () [0x0001a] in /private/tmp/monobuild/build/BUILD/mono-2.8.2/mcs/class/System.Drawing/System.Drawing/KnownColors.cs:225   --- End of inner exception stack trace ---  at System.Drawing.Color.get_Black () [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.8.2/mcs/class/System.Drawing/System.Drawing/Color.cs:483   at System.Windows.Forms.ThemeWin32Classic..cctor () [0x00000] in <filename unknown>:0   --- End of inner exception stack trace ---  at System.Windows.Forms.ThemeVisualStyles..ctor () [0x00000] in <filename unknown>:0   at System.Windows.Forms.ThemeEngine..cctor () [0x0002d] in /private/tmp/monobuild/build/BUILD/mono-2.8.2/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeEngine.cs:49   --- End of inner exception stack trace ---  at System.Windows.Forms.SystemInformation.get_MenuAccessKeysUnderlined () [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.8.2/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SystemInformation.cs:346   at System.Windows.Forms.Control..ctor () [0x000e3] in /private/tmp/monobuild/build/BUILD/mono-2.8.2/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:1054   at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor ()  at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.8.2/mcs/class/Managed.Windows.Forms/System.Windows.Forms/WindowsFormsSynchronizationContext.cs:46   --- End of inner exception stack trace ---  at System.Windows.Forms.Control..ctor () [0x00014] in /private/tmp/monobuild/build/BUILD/mono-2.8.2/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:1024   at System.Windows.Forms.ScrollableControl..ctor () [0x00000] in <filename unknown>:0   at System.Windows.Forms.ContainerControl..ctor () [0x00000] in <filename unknown>:0   at System.Windows.Forms.Form..ctor () [0x00000] in <filename unknown>:0   at ArducopterConfigurator.mainForm..ctor (ArducopterConfigurator.PresentationModels.MainVm vm) [0x00000] in <filename unknown>:0   at (wrapper remoting-invoke-with-check) ArducopterConfigurator.mainForm:.ctor (ArducopterConfigurator.PresentationModels.MainVm)  at ArducopterConfigurator.Program.Main () [0x0002f] in /media/peejay/programs/C#/Configurator.Net/Program.cs:31 The application was terminated by a signal: SIGHUP

  • Ok here's an update:

     

    I've potentially worked around the BindingSource issue with an ugly hack that forces all the bindings to refresh when any one property changes - hack not needed or used on MS .Net.

     

    The 'indicators' which were winform ProgressBars I had to chuck because Aero theme on windows tried to 'smooth' the progress with a slow animation, and also Mono did not respect the well known hack to get them to be vertical. Instead, I've made some crude indicators that are drawn manually, however they work on Mono just fine and of course can be developed to have e.g. high watermarks, integrated value text etc

     

    At this point I can run it on Mono on windows, and there is just one problem remaining, that is the Mono (win32) implementation of the SerialPort seems to be 'zeroing' the first character of the received sentence for some reason. Interestingly, it doesn't seem to happen with the continuous stream of data like with the flight data. So I'm not sure where the fix needs to be or a clever work around.

     

    You can now open the solution in Monodevelop, and run it. I've not tried this on *nix though, only windows. It could be that it actually works on linux at the moment, because the Mono implementation of the SerialPort would be different than for windows. I don't have a linux platform to try it.

  • I'm hoping to get it running on Mono so I'll see how I go.
  • Hi there,

     

    I'm the guy working on this - the short answer is that you are probably the first person to try running it on Mono, so I'm not surprised that it's not going 100%

     

    I've intentionally written it using the older .Net framework 2.0 & winforms, so it has a chance of working on Mono (as opposed to using say WPF which is not supported)

     

    It is still a work in progress so although it does kind of work, it's not ready for release just yet.

     

    I don't have a handy Mono/Linux install so if you like I will consider you volunteering to be the Mono testing guy ;-)

     

    Andrew

This reply was deleted.

Activity