Model File Utility (Updated)
- greenfly
- Topic Author
- Offline
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.
Please Log in or Create an account to join the conversation.
- mwm
- Offline
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.
- greenfly
- Topic Author
- Offline
Have fun!
Please Log in or Create an account to join the conversation.
- Richard96816
- Offline
- Posts: 208
Thanks.
Please Log in or Create an account to join the conversation.
- mwm
- Offline
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:
- Check Unknown drives as well as Removable ones to see if they're a Tx drive.
- 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.
- mwm
- Offline
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.
- greenfly
- Topic Author
- Offline
Please Log in or Create an account to join the conversation.
- Richard96816
- Offline
- Posts: 208
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.
- greenfly
- Topic Author
- Offline
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.
- mwm
- Offline
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.
- greenfly
- Topic Author
- Offline
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.
Please Log in or Create an account to join the conversation.
- Richard96816
- Offline
- Posts: 208
Distributor ID: Ubuntugreenfly 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?
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.
- greenfly
- Topic Author
- Offline
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: 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
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....Richard96816 wrote: Copy and Rename both seem to create empty files. Haven't tried Move. Thought it might get messy.
Did you happen to notice any error.txt files being generated?
Thanks.
Please Log in or Create an account to join the conversation.
- Richard96816
- Offline
- Posts: 208
Please Log in or Create an account to join the conversation.
- mwm
- Offline
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.
Please Log in or Create an account to join the conversation.
- mwm
- Offline
- 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.
- greenfly
- Topic Author
- Offline
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.
Please Log in or Create an account to join the conversation.
- greenfly
- Topic Author
- Offline
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.
- Richard96816
- Offline
- Posts: 208
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.
- Richard96816
- Offline
- Posts: 208
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.
- Home
- Forum
- General
- General Discussions
- Model File Utility (Updated)