ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE. Software > Post New Requests Here

IDEA: Convert Radio Frequency scan Data for 3 Manufacturers Data structures

<< < (2/4) > >>

Thanks you two. I am away from my desk for the next couple days but will post the script and my description file, and a test .csv to be operated on as soon as I get back.

Hi everyone,

Thanks for replying.

I've attached the script and some documentation with a folder of .csv files to use as test files. They were generated by the Handheld Spectrum analyzer and are representative of real data but there was very little radio activity so the actual variance in numbers is limited. Doesn't look like much when plotted on a graph but will be sufficient to test the script.

I also remembered that I'd like to add a "selectable on startup of script" function ... the ability to select a . csv and convert it between formats and appropriately name and save the output. csv file.

So it would be ... Script starts by asking "what do you want to do?"
1. Create. csv files from an RF Explorer scan
2. Convert .csv between existing manufacturer created scans

Industry folks have asked me for this feature as they generally use the manufacturers actual wireless Mic receiver to do the scans (not the handheld analyzer that generated these test files) and the machine outputs a. csv in that manufacturers corresponding format.

I suppose I could revisit my powershell skills LOL and add this function in, but have been very busy at the Concert Hall and haven't had much time to get it done.

Hope that makes sense and that someone will take this on :-)

There's now the Avalonia Project which provides a cross-platform UI solution for PowerShell (using XAML), (Windows, Linux, OSX), currently in beta but it shouldn't be hard to add a simple GUI to the script.

In it's current form, there is a niggling issue where a file selection dialog popup appears behind the main window and unless you know it's there, the thing appears to be locked up. I was unable to solve it in a reasonable amount of time and got frustrated.-floydlloyd (August 05, 2019, 12:55 PM)
--- End quote ---

From here System.Windows.Forms.OpenFileDialog always ontop - add a check for how the script was run and set $ShowHelp appropriately:

--- Code: PowerShell ---function Read-OpenFileDialog([string]$WindowTitle, [string]$InitialDirectory, [string]$Filter = "All files (*.*)|*.*", [switch]$AllowMultiSelect){    Add-Type -AssemblyName System.Windows.Forms    $openFileDialog = New-Object System.Windows.Forms.OpenFileDialog    $ShowHelp = $false# See    if ($ -eq "ConsoleHost") {$ShowHelp = $true}    $openFileDialog.Title = $WindowTitle    if (![string]::IsNullOrWhiteSpace($InitialDirectory)) { $openFileDialog.InitialDirectory = $InitialDirectory }    $openFileDialog.Filter = $Filter    if ($AllowMultiSelect) { $openFileDialog.MultiSelect = $true }    $openFileDialog.ShowHelp = $ShowHelp    # Without this line the ShowDialog() function may hang depending on system configuration and running from console vs. ISE.    $openFileDialog.ShowDialog() > $null    if ($AllowMultiSelect) { return $openFileDialog.Filenames } else { return $openFileDialog.Filename }}

Below are some observations and notes.

I tried the script out on a Windows 10 Pro box, but didn't notice dialog boxes being behind things.  Script execution was tested both from Windows Explorer as well as from a Powershell window.  It might be helpful to be able to replicate the issue -- perhaps it's for particular versions of Windows?

For running a test, one of the files from the TestFilesFromRFexplorer directory was selected.  It appears that all files in that directory get wiped by the end of the script.  I wonder if that is desirable behavior.  Also noticed some error output, but I did find a .zip file that appeared to contain the original file along with 2 converted ones.

Regarding running on macos, I looked a bit into 4wd's Avalonia idea, and came across: "Avalonia bindings for PowerShell".  The supported versions of Powershell there look like Powershell Core though, so I tried running the script via Powershell Core.  The result was a fair number of error messages so I stopped its execution.

I also tried creating a simple python script to open a file dialog and tried packaging and running this on Windows and macos using PyInstaller.  Interestingly enough, there was no problem with the dialog being behind things on Windows, but on macos there was.  It appears to be something that other folks have encountered and although I found multiple work-arounds, none of them worked for my particular environment (though apparently some of them do work for other folks).  (On a side note, my experience with macos (OS X, etc.) over the years has been that backward compatibility of certain types of things is not particularly a high priority, with adjustments sometimes being necessary when there are new OS releases, so even if something were found to work, it might be good to keep in mind that future OS releases might necessitate updates.  Perhaps it's misleading to single out Apple in this regard.)

Regarding "Convert .csv between existing manufacturer created scans", perhaps if this general conversion portion were implemented, the current script might benefit from being based on it.  If someone were to start on this though, may be it would be better to consider Powershell Core or something else more multi-platform friendly, rather than Windows Powershell.


[0] Message Index

[#] Next page

[*] Previous page

Go to full version