Integration of the G4EML tools into the CPS

Post Reply
User avatar
Zl1XE
Posts: 110
Joined: Fri Jul 24, 2020 12:25 am

Integration of the G4EML tools into the CPS

Post by Zl1XE » Mon Oct 26, 2020 6:52 am

VK3KYY wrote:
Mon Oct 26, 2020 12:07 am
BTW.
I'd love to integrate Colin (G4EMLs) tools into the CPS, but they are written in VB, not C#, and so even though Colin emailed he his source code, last year, it would take a long time for me to re-write it all in C# and test it all.
Hmmm. My code is in Python and runs on its own to build/modify existing csv exports. I can wrestle data fairly well into the needed input format.
E.g. take a list of name, rx, tx and fill in the blanks forcing (say) "Marine" as a Zone and overriding RX only and Flags4 so that Tx is inhibited.
(Struggling with squelch setting atm. I'd like to set at 20%)

I've converted some VB code before. But integrating everything into C# could be harder. Main prob is probably there are so many random possibilities it'd be more about scoping out what should be done.
Looked through the code briefly - looks like its mostly in here (or thereabouts): /DMR/ChannelForm.cs but its not so clear to me how stuff is organised in C#.

Just thinking:
How about
- an external super basic input format for channels. Work out what is a legit minimal input set of data and set that as one of the input formats.
- Maybe the CPS could call a bat file and then input a tempfile csv that the bat creates. It would be well formed and make life easier.
- also for Digital contacts and possibly DTMF ?

- And then a format for all the fields OpenGD77 is actually going to use (based n above code link Channelform.cs). External bat file can validate and fix before input.
- I can make support tools for crafting these csv files in useful ways possibly with QT5 UI but could at least become an external tool on github that will not take up your time.

Not sure what "right thing" to do is. I expect you have ideas. Feel free to email me :)

VK3KYY
Posts: 7590
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia

Re: CPS Update

Post by VK3KYY » Mon Oct 26, 2020 6:58 am

Zl1XE wrote:
Mon Oct 26, 2020 6:52 am
VK3KYY wrote:
Mon Oct 26, 2020 12:07 am
BTW.
I'd love to integrate Colin (G4EMLs) tools into the CPS, but they are written in VB, not C#, and so even though Colin emailed he his source code, last year, it would take a long time for me to re-write it all in C# and test it all.
Hmmm. My code is in Python and runs on its own to build/modify existing csv exports. I can wrestle data fairly well into the needed input format.
E.g. take a list of name, rx, tx and fill in the blanks forcing (say) "Marine" as a Zone and overriding RX only and Flags4 so that Tx is inhibited.
(Struggling with squelch setting atm. I'd like to set at 20%)

I've converted some VB code before. But integrating everything into C# could be harder. Main prob is probably there are so many random possibilities it'd be more about scoping out what should be done.
Looked through the code briefly - looks like its mostly in here (or thereabouts): /DMR/ChannelForm.cs but its not so clear to me how stuff is organised in C#.

Just thinking:
How about
- an external super basic input format for channels. Work out what is a legit minimal input set of data and set that as one of the input formats.
- Maybe the CPS could call a bat file and then input a tempfile csv that the bat creates. It would be well formed and make life easier.
- also for Digital contacts and possibly DTMF ?

- And then a format for all the fields OpenGD77 is actually going to use (based n above code link Channelform.cs). External bat file can validate and fix before input.
- I can make support tools for crafting these csv files in useful ways possibly with QT5 UI but could at least become an external tool on github that will not take up your time.

Not sure what "right thing" to do is. I expect you have ideas. Feel free to email me :)
Unfortunately I really don't have much time to even create a spec of how to do this

Re: VB code.

I did try to convert colin's old code to C# but I gave up, as it would take me hours of time, which I simply don't have



Colin's tools do a really good job and I recommend that people use them if they want to do any major changes to the codeplug

User avatar
Zl1XE
Posts: 110
Joined: Fri Jul 24, 2020 12:25 am

Re: CPS Update

Post by Zl1XE » Mon Oct 26, 2020 10:18 am

VK3KYY wrote:
Mon Oct 26, 2020 6:58 am
Re: VB code.
I did try to convert colin's old code to C# but I gave up, as it would take me hours of time, which I simply don't have
Colin's tools do a really good job and I recommend that people use them if they want to do any major changes to the codeplug
I'd be happy to have a try if @G4EML
G4EML wrote:
Mon Oct 26, 2020 6:58 am
Colin can send me the VB script.
I'm working my way through eventually.

User avatar
Zl1XE
Posts: 110
Joined: Fri Jul 24, 2020 12:25 am

Re: CPS Update

Post by Zl1XE » Tue Oct 27, 2020 8:42 am

I don't know why I have forgotten this but the G4EML tools work very well to solve this problem.
here:
- http://www.gb3gf.co.uk/downloads.html
- You need the gd77 zip which contains the GD77-CSV(OpenGD77-80) executable.

We don't need another approach really.
If it was handled by command line then the CPS could call it :
- from an Export button (forcing save) on the File menu
- to read the saved g77 file and create the csv files.
and
- from a new button on the Extras mnu "Combine csv to g77 codeplug" file
- to read and combine the newly edited csv files into a new g77 codeplug.
(with a validation/fix operation to help out malformed csv).

Then remove the import/export csv menu items from the Channels tab and mention the above method instead as text label.
The existing tools just need a refinement for the new features like dtmf, Master Tx, etc...

VK3KYY
Posts: 7590
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia

Re: CPS Update

Post by VK3KYY » Tue Oct 27, 2020 8:56 am

Zl1XE wrote:
Tue Oct 27, 2020 8:42 am
I don't know why I have forgotten this but the G4EML tools work very well to solve this problem.
here:
- http://www.gb3gf.co.uk/downloads.html
- You need the gd77 zip which contains the GD77-CSV(OpenGD77-80) executable.

We don't need another approach really.
If it was handled by command line then the CPS could call it :
- from an Export button (forcing save) on the File menu
- to read the saved g77 file and create the csv files.
and
- from a new button on the Extras mnu "Combine csv to g77 codeplug" file
- to read and combine the newly edited csv files into a new g77 codeplug.
(with a validation/fix operation to help out malformed csv).

Then remove the import/export csv menu items from the Channels tab and mention the above method instead as text label.
The existing tools just need a refinement for the new features like dtmf, Master Tx, etc...
Yes. If Colins tools could be integrated into the CPS, then the other other import / export functionality may not be needed.

However, I suspect that there will still be some people only only want to export and import contacts or channels etc etc, so that function would probably have to be added to the Extras menu.

I'm not sure if you are a C# programmer, but if so perhaps colin will share his code with you.

BTW
I did investigate some tools which claimed to convert VB .Net code to C# but they didn't work.
I also tried to decompile the Exe as C# and then recompile, and that does work, however the reconstructed code looks absolutely terrible.
This is not because Colin's code is bad, but is a caused by the way the VB .Net code is converted to ByteCode by the .Net compiler

G4EML
Posts: 930
Joined: Sat Nov 16, 2019 10:01 am

Re: Integration of the G4EML tools into the CPS

Post by G4EML » Tue Oct 27, 2020 11:02 am

Automatically combining files from different sources is always going to be a bit of a nightmare. Because of the cross linking by index between zones,channels,contacts,RX lists it doesn’t really make any sense to just export one type of item. You can’t take the channel list from one radio, add it another and expect it to work without also doing the same with the contacts and Rx lists. Any CSV export needs to include multiple files for all of the important parts of a codeplug. Maybe it needs to be a zip file containing multiple CSVs.

These complexities are the main reason for my preference to do any combination manually using a spreadsheet program like Excel. That makes it easy to do copying, global replacement, sorting etc. which will always be needed when organising a combined codeplug.

If I get the time (and the inclination) in the next week or so I will have a look at creating a command line version of my conversion utility. That could then be called from the CPS to provide some integration.

Colin G4EML

VK3KYY
Posts: 7590
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia

Re: Integration of the G4EML tools into the CPS

Post by VK3KYY » Tue Oct 27, 2020 10:56 pm

Colin

What I attempt to do in the CPS (half successfully), is to add the Contact data and TGList name and Zone name to each channel (row) in the spreadsheet

This allows the CPS to reconstruct the Zone, Contact and TGList to match the channel

This was working OK, before with the OpenGD77, the Channel no longer has a Contact, hence now its no longer able to reconstruct the Contacts and TG Lists correctly.

The only way to make this to work completely, would be to export every contact from the TG List, assigned to the Channel , with every channel.

Technically this is called "Flattening" the database.

But the CPS doesn't do this, and it would be quite a lot of work to implement it.

Post Reply