Model File Utility (Updated)

More
03 Aug 2015 03:17 #36498 by greenfly
Replied by greenfly on topic Model File Utility (Updated)
Well, I thought I would delve into the world of Mono , and it has been an interesting trip so far. Surprisingly much of the code is close to portable! The biggest hurdle is doing the GUI stuff. That affects the code drastically sometimes.

Anyway, enough of the boring details... I have actually made some progress on a Linux version of the app.




I'm not sure when it will be ready, but I don't see any major pitfalls to completion... so maybe a week or two. Maybe.
Attachments:

Please Log in or Create an account to join the conversation.

More
03 Aug 2015 20:36 #36510 by mwm
Replied by mwm on topic Model File Utility (Updated)
Cool! I can't wait to test it on my Unix (FreeBSD and OSX) boxes!

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
07 Aug 2015 21:28 #36657 by greenfly
Replied by greenfly on topic New Mono Version
I think this is all ready to go. I have been testing on Ubuntu and Windows and it works pretty well... so I'm going to post it.

Have fun!
Attachments:

Please Log in or Create an account to join the conversation.

More
08 Aug 2015 07:24 #36676 by Richard96816
Replied by Richard96816 on topic Model File Utility (Updated)
Very nice to see this coming to Linux.

Thanks.

Please Log in or Create an account to join the conversation.

More
08 Aug 2015 11:28 #36679 by mwm
Replied by mwm on topic Model File Utility (Updated)
Got it working on my Unix desktop after updating a couple of libraries.

And it's completely unusable. Or rather, there's no way to get it to do anything.

Seems like GetDriveType isn't implemented on this platform, and just returns Unknown for everything. Wading into the Mono sources gets into the foreign function interface stuff, at which point I can no longer follow the trail. Rather, grep can't find any of the breadcrumbs in the sources.

Two suggested fixes:
  1. Check Unknown drives as well as Removable ones to see if they're a Tx drive.
  2. Alternatively, provide an "open model directory" function. Might also be useful for working with the emulator.

Could you put build instruction in the readme? I'd have tried fixing this myself, but I've got no clue as to what tools I need, much less what to do with them.

I hope to check it on a Mac later today.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
08 Aug 2015 14:36 #36681 by mwm
Replied by mwm on topic Model File Utility (Updated)
Well, on OSX it started without needing graphics libraries upgraded.

But it has the same problem my other Unix system did: the Devo file system isn't detected as removable. This appears to be a bug in the MCS DriveInfo object, as it does report drive types - but the Devo file system is reported as "Fixed". So much for just checking "Unknown" drive types.

A smarter automatic detection would still work, but at this point that's probably just a rathole.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
08 Aug 2015 18:26 #36683 by greenfly
Replied by greenfly on topic Model File Utility (Updated)
@mwm, I'm sorry you are having issues. I have included some build instructions if you care to take that route again. Otherwise, I am looking for a Mac OS X box (or maybe a VM) that I can work out the issues with the DriveInfo.GetDrives(). Looking at the source, I don't actually filter by the type of drive, (I did in Windows...thus the left over comment) so I'm not sure what is failing.
Attachments:

Please Log in or Create an account to join the conversation.

More
08 Aug 2015 20:32 #36686 by Richard96816
Replied by Richard96816 on topic Model File Utility (Updated)
It found my 7e drive fine on Linux. But did have issues saving files. It created temp files on the 7e, with names with a tilde on the end. But they were empty. So it does seem to be able to write files, it just 'thinks' it can't. :-)

Thanks so much for building cool stuff for the rest of us to play with. Most appreciated. Now I'm for sure going to have to upgrade my 7e's to the better processor.

Please Log in or Create an account to join the conversation.

More
08 Aug 2015 20:54 #36688 by greenfly
Replied by greenfly on topic Model File Utility (Updated)
@RIchard96816, Thanks, I appreciate anybody taking an interest in my work. I'm having a good time developing it and trying out new things. If you don't mind me asking... what distro are you using? I would like to see why the file writes are not working. For some stuff, I simply rename the files, for others I have to open the file and write the contents to a new file. Is there one particular function that generates the empty files?

It's obvious that Mono has some deficits, but for what it is attempting, I think it does a fair job. I kind of expected some cross-platform issues. We are dealing with hardware in a sense and it must be difficult to homogenize drives, paths, files, etc...

Please Log in or Create an account to join the conversation.

More
09 Aug 2015 01:53 #36696 by mwm
Replied by mwm on topic Model File Utility (Updated)

greenfly wrote: I am looking for a Mac OS X box (or maybe a VM) that I can work out the issues with the DriveInfo.GetDrives(). Looking at the source, I don't actually filter by the type of drive, (I did in Windows...thus the left over comment) so I'm not sure what is failing.


Note that it's technically illegal to run OSX on an emulator, with the exception of OSX Server running on a properly licensed emulator running on Apple hardware. Which is the reason my desktop never became a Mac. On the other hand, my desktop is FreeBSD, and you should be able to download an image for it for most popular VM programs.

Possibly I the zipped source is old? As MainForm/CheckDrives is pretty clearly checking the drive type, and if it's in a comment then C++ is unlike anything else I've ever seen in the C family. You have a git/hg/fossil/arch/cvs/svn/whatever repository somewhere I can pull from (and submit pull requests to)?

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
09 Aug 2015 02:36 #36697 by greenfly
Replied by greenfly on topic Model File Utility (Updated)
Ahh, if you are in MainForm then you are definitely looking at the Windows source code. The Mono code uses the GTK# convention of MainWindow. I have attached that source directly to this post.

Just download, unzip somewhere and open the ModelFileManager.sln solution file with MonoDevelop/Xamarin Studio. You should be able to break the source code in the MainWindow.cs around here...

	foreach (var drive in DriveInfo.GetDrives())
	{
		string FilePathTest = System.IO.Path.Combine(drive.RootDirectory.ToString(), "tx.ini");
		if (File.Exists(FilePathTest))

MonoDevelop will let you examine the variables, so you might get an idea of what it is "finding" as disk drives.

Another solution might be to add a configuration setting that would represent the mount point of where the Deviation TX is mounted. Then it could go right to checking for the tx.ini file for the presence of the TX.

In any case, I'll give FreeBSD a go... at least as a VM. I'll post what I find when I reach that point.
Attachments:

Please Log in or Create an account to join the conversation.

More
09 Aug 2015 03:15 #36698 by Richard96816
Replied by Richard96816 on topic Model File Utility (Updated)

greenfly wrote: @RIchard96816, Thanks, I appreciate anybody taking an interest in my work. I'm having a good time developing it and trying out new things. If you don't mind me asking... what distro are you using? I would like to see why the file writes are not working. For some stuff, I simply rename the files, for others I have to open the file and write the contents to a new file. Is there one particular function that generates the empty files?

Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty

sd% uname -a
Linux amd 3.13.0-58-generic #97-Ubuntu SMP Wed Jul 8 02:56:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Copy and Rename both seem to create empty files. Haven't tried Move. Thought it might get messy.

It's obvious that Mono has some deficits, but for what it is attempting, I think it does a fair job. I kind of expected some cross-platform issues. We are dealing with hardware in a sense and it must be difficult to homogenize drives, paths, files, etc...


The portability is cool. Hardware and security can be difficult. I ran your program as root just to make sure it wasn't just a permissions problem. Same results.

Please Log in or Create an account to join the conversation.

More
09 Aug 2015 03:55 #36701 by greenfly
Replied by greenfly on topic Model File Utility (Updated)

Richard96816 wrote: Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty

sd% uname -a
Linux amd 3.13.0-58-generic #97-Ubuntu SMP Wed Jul 8 02:56:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Hmm. I developed the app on almost the same exact platform. I can't verify exactly at the moment but I'm sure I'm on Trusty. I did however add the mono repositories to get the latest versions of everything. Basically following these instructions .

Richard96816 wrote: Copy and Rename both seem to create empty files. Haven't tried Move. Thought it might get messy.

Actually, the move does the least amount of file activity. All I am doing is simply renaming files as opposed to opening and re-writing them. What is concerning, is the Copy function not working. There I use the built-in System.IO.File.Copy method... which I use everywhere else....

Did you happen to notice any error.txt files being generated?

Thanks. :blink:

Please Log in or Create an account to join the conversation.

More
09 Aug 2015 04:02 #36702 by Richard96816
Replied by Richard96816 on topic Model File Utility (Updated)
No error.txt files anywhere on the system.

Please Log in or Create an account to join the conversation.

More
09 Aug 2015 08:14 - 09 Aug 2015 08:19 #36703 by mwm
Replied by mwm on topic Model File Utility (Updated)

greenfly wrote: Another solution might be to add a configuration setting that would represent the mount point of where the Deviation TX is mounted. Then it could go right to checking for the tx.ini file for the presence of the TX.


Doesn't necessarily work. I have two Deviation Tx's, and don't always mount them to the same point. I've even been known to have them both mounted at the same time when I was juggling models back and forth. But see below.

And yup, there is no MainWindow.cs. The new source builds just fine.

FWIW, I don't have Xamarin or any such. However, "mdtool build ModelFileManger.sln" creates .exe files. This version works. At least, if I mount the Tx before starting the application, it will find it, let me manipulate model files, and the results show up on my models. Possibly the port to FreeBSD fixed some things in libraries that don't get reflected in the .exe files built elsewhere.

Suggestions in the next bottle.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.
Last edit: 09 Aug 2015 08:19 by mwm.

Please Log in or Create an account to join the conversation.

More
09 Aug 2015 08:31 #36704 by mwm
Replied by mwm on topic Model File Utility (Updated)
Ok, now that I've got it working where I can use it, I have requests! Mostly just minor UI tweaks.

  • It seems to open as a dialog, not a resizable window. That's not really very friendly. And it makes for ugly windows when I push them into tiling.
  • Where do the users settings live? Should be in $HOME/.config/ModelFileManager/ModelFileManager.config on Unix-like systems, with backups defaulting to $HOME/.config/ModelFileManager/Backups.
  • Is there any possibility of specifying more a config from the command line? I'd like to have two different configs for my two Tx's.

On a more behavioral note, it would be nice if moving the current model - as specified in tx.ini's default section - updated tx.ini to match. Clearing that model should also be dealt with, but I'm not sure how. Maybe just set current_model to some "reasonable" value and warn the user.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
10 Aug 2015 17:01 - 10 Aug 2015 17:03 #36724 by greenfly
Replied by greenfly on topic Model File Utility (Updated)

mwm wrote:

  • It seems to open as a dialog, not a resizable window. That's not really very friendly. And it makes for ugly windows when I push them into tiling.


Hmm. My file dialogs are all sizable. Let me see if I can force it to be sizable and start at a smaller size.

mwm wrote:

  • Where do the users settings live? Should be in $HOME/.config/ModelFileManager/ModelFileManager.config on Unix-like systems, with backups defaulting to $HOME/.config/ModelFileManager/Backups.


The convention is taken from Windows, as it looks in the same directory as the executable. This seems to be built in to the framework, but I may be able to redirect it with a command line argument. In the mean time, it does work to set the backup directory setting to work as you would like....

     <add key="BackupPath" value=".config/ModelFileManager/Backups" />

mwm wrote:

  • Is there any possibility of specifying more a config from the command line? I'd like to have two different configs for my two Tx's.


If the config file redirection works, then this should be possible. I will give it a try.

mwm wrote: On a more behavioral note, it would be nice if moving the current model - as specified in tx.ini's default section - updated tx.ini to match. Clearing that model should also be dealt with, but I'm not sure how. Maybe just set current_model to some "reasonable" value and warn the user.


I can do this, but I was thinking more generally. I think I would need to actually have a feature to "set the current model" or figure out an appropriate time to check it for validity. I can do it on closing, but it will not work if you un-mount the TX before exiting the utility.
Last edit: 10 Aug 2015 17:03 by greenfly.

Please Log in or Create an account to join the conversation.

More
10 Aug 2015 17:14 #36725 by greenfly
Replied by greenfly on topic Model File Utility (Updated)

Richard96816 wrote: No error.txt files anywhere on the system.


Something weird is going on.
I have been testing on a fresh Trusty install and the files downloaded right off of the forum and everything works as expected. The only software I installed was mono-complete.

Any other ideas on what to try?

Please Log in or Create an account to join the conversation.

More
10 Aug 2015 17:26 #36726 by Richard96816
Replied by Richard96816 on topic Model File Utility (Updated)

mwm wrote:

  • Is there any possibility of specifying a config from the command line? I'd like to have two different configs for my two Tx's.


It might be nice if there was a way to recognize the radio by looking at it's drive. Then you could set backup locations, etc., automatically for as many radios as you want.

Please Log in or Create an account to join the conversation.

More
10 Aug 2015 17:48 #36727 by Richard96816
Replied by Richard96816 on topic Model File Utility (Updated)

greenfly wrote:

Richard96816 wrote: No error.txt files anywhere on the system.


Something weird is going on.
I have been testing on a fresh Trusty install and the files downloaded right off of the forum and everything works as expected. The only software I installed was mono-complete.

Any other ideas on what to try?


Hmm. Guess I need to remember how to dump the versions of all the constituents of an executable. I simply did a 'apt-get install MonoDevelop' and got a response that it was already up to date. Not sure what it got loaded for ...

Please Log in or Create an account to join the conversation.

Time to create page: 0.110 seconds
Powered by Kunena Forum