Unhandled exception when trying to import csv

Report any bugs or errors you find here.
Post Reply
User avatar
2E0LXY
0posts
Posts: 5
Joined: Sun Feb 27, 2022 9:49 pm
Location: IO93fr
Callsign: 2e0lxy

Unhandled exception when trying to import csv

Post by 2E0LXY »

test.csv
Unhandled exception when trying to import csv

Code: Select all

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at CPEditor.MainForm.importChannelsToolStripMenuItem_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4470.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
CPEditor
    Assembly Version: 0.2.320.1
    Win32 Version: 0.2.0320.1
    CodeBase: file:///C:/Users/2e0lx/Desktop/Retevis%20RT73/CPEditor/CPEditor.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4400.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4360.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4390.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4190.0 built by: NET48REL1LAST_B
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4470.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Newtonsoft.Json
    Assembly Version: 13.0.0.0
    Win32 Version: 0.2.0320.1
    CodeBase: file:///C:/Users/2e0lx/Desktop/Retevis%20RT73/CPEditor/CPEditor.exe
----------------------------------------
Newtonsoft.Json
    Assembly Version: 13.0.0.0
    Win32 Version: 0.2.0320.1
    CodeBase: file:///C:/Users/2e0lx/Desktop/Retevis%20RT73/CPEditor/CPEditor.exe
----------------------------------------
Newtonsoft.Json
    Assembly Version: 13.0.0.0
    Win32 Version: 0.2.0320.1
    CodeBase: file:///C:/Users/2e0lx/Desktop/Retevis%20RT73/CPEditor/CPEditor.exe
----------------------------------------
Newtonsoft.Json
    Assembly Version: 13.0.0.0
    Win32 Version: 0.2.0320.1
    CodeBase: file:///C:/Users/2e0lx/Desktop/Retevis%20RT73/CPEditor/CPEditor.exe
----------------------------------------
Newtonsoft.Json
    Assembly Version: 13.0.0.0
    Win32 Version: 0.2.0320.1
    CodeBase: file:///C:/Users/2e0lx/Desktop/Retevis%20RT73/CPEditor/CPEditor.exe
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Runtime.Serialization
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4455.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4455.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
You do not have the required permissions to view the files attached to this post.
MB7AXY in Yorkshire.
Feel free to connect to my Yorkshire talkgroup.
You can connect via XLX899Y, PEANUT YSF Yorkshire, YSF 20584 Yorkshire or Freestar Yorkshire TG23530.

https://www.yorkshireradio.uk
User avatar
MM7DBT
Site Admin
200posts
Posts: 209
Joined: Wed Jun 02, 2021 6:59 pm
Location: Scotland
Callsign: MM7DBT

Re: Unhandled exception when trying to import csv

Post by MM7DBT »

Frequency has to be in Hz rather than MHz as that is how the radio stores it.
test_fix.csv
Imports correctly once changed, easy way to do it in the csv is type the frequency without the decimal point and then pad it with 0 so it's 9 digits long.
test_fix.PNG
You do not have the required permissions to view the files attached to this post.
-73 de MM7DBT
User avatar
MM7DBT
Site Admin
200posts
Posts: 209
Joined: Wed Jun 02, 2021 6:59 pm
Location: Scotland
Callsign: MM7DBT

Re: Unhandled exception when trying to import csv

Post by MM7DBT »

Updated to 0.2.0327.1

Channel CSV can now have frequency in MHz or Hz, it will automatically convert it when importing :D
-73 de MM7DBT
User avatar
2E0LXY
0posts
Posts: 5
Joined: Sun Feb 27, 2022 9:49 pm
Location: IO93fr
Callsign: 2e0lxy

Re: Unhandled exception when trying to import csv

Post by 2E0LXY »

Hi Dave.
Many thank for the quick response, seems to have sorted this issue.
Great bit of software that coming along very nicely, thank you! :-)
MB7AXY in Yorkshire.
Feel free to connect to my Yorkshire talkgroup.
You can connect via XLX899Y, PEANUT YSF Yorkshire, YSF 20584 Yorkshire or Freestar Yorkshire TG23530.

https://www.yorkshireradio.uk
User avatar
2E0LXY
0posts
Posts: 5
Joined: Sun Feb 27, 2022 9:49 pm
Location: IO93fr
Callsign: 2e0lxy

Re: Unhandled exception when trying to import csv

Post by 2E0LXY »

If I try to write the CP to radio I'm getting.
Capture.JPG
You do not have the required permissions to view the files attached to this post.
MB7AXY in Yorkshire.
Feel free to connect to my Yorkshire talkgroup.
You can connect via XLX899Y, PEANUT YSF Yorkshire, YSF 20584 Yorkshire or Freestar Yorkshire TG23530.

https://www.yorkshireradio.uk
User avatar
MM7DBT
Site Admin
200posts
Posts: 209
Joined: Wed Jun 02, 2021 6:59 pm
Location: Scotland
Callsign: MM7DBT

Re: Unhandled exception when trying to import csv

Post by MM7DBT »

What version did you get the error with?

It is to do with the CTCSS/DCS tones. Somehow it is looking in the DCS tone table for a CTCSS tone. Hence why it reports that it isn't in the list.

I made an update (0.2.0327.3) that should have corrected that error as someone else reported the same error.
When loading a codeplug or using the channel editor, it should automatically select the correct tone type for the tone that is selected.

Although it was 6am, coming home from a 12hr nightshift so I may have missed a case where it could still happen :lol:
-73 de MM7DBT
User avatar
MM7DBT
Site Admin
200posts
Posts: 209
Joined: Wed Jun 02, 2021 6:59 pm
Location: Scotland
Callsign: MM7DBT

Re: Unhandled exception when trying to import csv

Post by MM7DBT »

Ah! I see the issue now.
I tried it with the csv file you posted. Where you have the 'TX Tone Type' set to 'ON' it should be 'CTCSS'

Valid values for that column are;
OFF
CTCSS
DCS
DCS Invert
toneon.PNG
Opening the channel editor will automatically change it to CTCSS which would then work correctly.
Notice how it is now showing the error for the second channel. Changing the value from ON to CTCSS in the CSV file should fix it.
You do not have the required permissions to view the files attached to this post.
-73 de MM7DBT
User avatar
MM7DBT
Site Admin
200posts
Posts: 209
Joined: Wed Jun 02, 2021 6:59 pm
Location: Scotland
Callsign: MM7DBT

Re: Unhandled exception when trying to import csv

Post by MM7DBT »

Also if you are using Excel to edit the CSV you would have to change the cell format to number, with 1 decimal place, so that it does not remove the .0

e.g Where it has 67 and 77. They need to be 67.0 and 77.0, otherwise they would be read as a DCS tone and cause an invalid value.
excelnumber.PNG
You do not have the required permissions to view the files attached to this post.
-73 de MM7DBT
User avatar
2E0LXY
0posts
Posts: 5
Joined: Sun Feb 27, 2022 9:49 pm
Location: IO93fr
Callsign: 2e0lxy

Re: Unhandled exception when trying to import csv

Post by 2E0LXY »

OK.
I think that's got it... Brilliant!
Thanks very much.
MB7AXY in Yorkshire.
Feel free to connect to my Yorkshire talkgroup.
You can connect via XLX899Y, PEANUT YSF Yorkshire, YSF 20584 Yorkshire or Freestar Yorkshire TG23530.

https://www.yorkshireradio.uk
Post Reply