Custom COMBOBOX
Moderators: TomKerekes, dynomotion
Custom COMBOBOX
Hello Tom.
I have already install more than 10 Kmotion+Kanalog boards on plasma/oxyfuel cutting applications.
In the plasma cutting application, is needed to configure the cutting parameters, like pierce delay, cutting voltage, cutting speed,cutting height and more others. Those parameters are all depended from the cutting material, like the thickness of the sheet, the material its self, carbon steel, stainless steel,aluminum etc. Additionally every plasma source manufacture has its own cutting parameters. The bottom line of all is that there are a lot of parameters that the user has to adjust every time he want to make a cut. One approach is, that those parameters can be set in the CAM software and embedded into the gcode. This approach require a cam software that can do that. The problem is that the customer already has a cam software that can't do the job and has to buy a new one. One other approach is that all those parameters can be set via the Kmotioncnc software. Something like the tool library already embedded in the KmotionCNC. The problem with this approach is that this library,table is not customizable and cannot be used to handle the cutting parameters. So my idea is to include a combobox functionality on the screen editor that would be customizable to handle a generic text file, perhaps comma delimited and an edit button in order to edit the parameter table. So the user can choose from the drop down list the cutting appropriate parameters.
How ease or difficult is do implement something like that?
I have already install more than 10 Kmotion+Kanalog boards on plasma/oxyfuel cutting applications.
In the plasma cutting application, is needed to configure the cutting parameters, like pierce delay, cutting voltage, cutting speed,cutting height and more others. Those parameters are all depended from the cutting material, like the thickness of the sheet, the material its self, carbon steel, stainless steel,aluminum etc. Additionally every plasma source manufacture has its own cutting parameters. The bottom line of all is that there are a lot of parameters that the user has to adjust every time he want to make a cut. One approach is, that those parameters can be set in the CAM software and embedded into the gcode. This approach require a cam software that can do that. The problem is that the customer already has a cam software that can't do the job and has to buy a new one. One other approach is that all those parameters can be set via the Kmotioncnc software. Something like the tool library already embedded in the KmotionCNC. The problem with this approach is that this library,table is not customizable and cannot be used to handle the cutting parameters. So my idea is to include a combobox functionality on the screen editor that would be customizable to handle a generic text file, perhaps comma delimited and an edit button in order to edit the parameter table. So the user can choose from the drop down list the cutting appropriate parameters.
How ease or difficult is do implement something like that?
Re: Custom COMBOBOX
I'm going to guess that during use, those parameters are stored within the KFlop?
My initial thought was a custom screen that allows you to view/edit those parameters, then have the KFlop push them out a text file, although I'm not sure if the KFlop would be able to read the values back in, plus it doesn't help you with the selecting different configurations.
What about a small standalone program, that can be executed via a screen button, then once you've made any changes, runs a C program to transfer the new values to the KFlop?
This would remove the limitations of the KFlop/KMCNC in terms of file handling, and you could store the values however you'd like.
My initial thought was a custom screen that allows you to view/edit those parameters, then have the KFlop push them out a text file, although I'm not sure if the KFlop would be able to read the values back in, plus it doesn't help you with the selecting different configurations.
What about a small standalone program, that can be executed via a screen button, then once you've made any changes, runs a C program to transfer the new values to the KFlop?
This would remove the limitations of the KFlop/KMCNC in terms of file handling, and you could store the values however you'd like.
Re: Custom COMBOBOX
Very good idea. I will give it a try.
Thanks.
Thanks.
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Custom COMBOBOX
Hi cnc_freak,
It doesn't look like it would be too difficult to add some additional Combo Boxes. We will look into it.
It doesn't look like it would be too difficult to add some additional Combo Boxes. We will look into it.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Custom COMBOBOX
Here is a patch to add Combo Box functionality. 40 ComboBox Controls have been added to the custom screen.
We also added basic Unicode capability for the Combo Boxes as well as Edit Controls. Non ANSI Unicode characters are sent as hex strings to KFLOP.
The patch involves several files:
KMotionCNC.exe - copy to \Release Folder
KMotionCNCScreenEditor.exe - copy to \Release Folder
KMotionCNC.rc - copy to \PC VC Examples\KMotionCNC Folder
resource.h - copy to \PC VC Examples\KMotionCNC Folder
Here an example Screen Script and KFLOP C Program that reads the Combo Box:
Combo.scr - copy to \PC VC Examples\KMotionCNC\Screens Folder
ComboBoxCopyToDROLabelwhenChangedUnicode.c - copy to \C Programs Folder
See Video:
Please let us know if it works for you.
We also added basic Unicode capability for the Combo Boxes as well as Edit Controls. Non ANSI Unicode characters are sent as hex strings to KFLOP.
The patch involves several files:
KMotionCNC.exe - copy to \Release Folder
KMotionCNCScreenEditor.exe - copy to \Release Folder
KMotionCNC.rc - copy to \PC VC Examples\KMotionCNC Folder
resource.h - copy to \PC VC Examples\KMotionCNC Folder
Here an example Screen Script and KFLOP C Program that reads the Combo Box:
Combo.scr - copy to \PC VC Examples\KMotionCNC\Screens Folder
ComboBoxCopyToDROLabelwhenChangedUnicode.c - copy to \C Programs Folder
See Video:
Please let us know if it works for you.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Custom COMBOBOX
Hello Tom.
Finally i test this, in load the last version 435d, and it does not work as described.
I load the combo.scr to test it but the box looks like in the attached picture. Please advice.
Regards.
Finally i test this, in load the last version 435d, and it does not work as described.
I load the combo.scr to test it but the box looks like in the attached picture. Please advice.
Regards.
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Custom COMBOBOX
Hi cnc_freak,
Here is a patch that should fix the issue in Version 4.35d.
Copy this KMotionCNC.exe to your <>\KMotion\Release folder.
Here is a patch that should fix the issue in Version 4.35d.
Copy this KMotionCNC.exe to your <>\KMotion\Release folder.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Custom COMBOBOX
How can i do a string compare in c program, so that when i select for example "ALUMINUM' to do something.
I try to do switch(s) case(Aluminum):,case(Steel):,case(Wood): etc, but does not work, in s is the combobox string.
Is there another way to implement that?
I try to do switch(s) case(Aluminum):,case(Steel):,case(Wood): etc, but does not work, in s is the combobox string.
Is there another way to implement that?
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Custom COMBOBOX
Strings (actually null terminated char arrays) need to be compared character by character. Normally strcmp() can do this but it looks like we forgot to include it. A switch statement can't do this. You could use this function:
HTH
Code: Select all
#include "KMotionDef.h"
BOOL StrEq(char *a, char *b);
void main()
{
if (StrEq("ABCD", "XYZ"))
printf("Equal\n");
else
printf("Not Equal\n");
}
// compare strings return 1 if same 0 if not
BOOL StrEq(char *a, char *b)
{
while (*a != 0 && *a == *b) // loop while not at end and same
{
a++;
b++;
}
return *a == *b;
}
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.