Writing ° to text field

If you think you've found a bug post it here.

Writing ° to text field

Postby ger21 » Sat Nov 26, 2016 4:05 pm

Not sure if this is a bug or not.
I'm writing a probing macro, and want to write a degree symbol (° --- alt + 248) to a textfield, but I'm seeing some strange results.

At first I tried using in the .ssf file:

AS3jog.Addfield("", "Arial", "right", 22, -16777216, 636, 307, 122, "showfieldnb", 0, 0, 20349, 1);
AS3jog.Filterfieldtext("0123456789.\\-°", 20349);

In my Constructor macro, I have:

readfield = exec.Readkey("2017_Fields", "20349", "0.0°");
AS3jog.Setfieldtext(readfield, 20349); // Set Edge Angle

When I start UCCNC, it works as expected, giving me this:
deg1.jpg
deg1.jpg (15.76 KiB) Viewed 22366 times


To test what would happen if when my macro writes to the field, I wrote a macro, M20998, with :

AS3jog.Setfieldtext("25.39°", 20349); // Set Edge Angle

When I run it from the MDI, I get this:

deg2.jpg
deg2.jpg (22.95 KiB) Viewed 22366 times


Removing:

AS3jog.Filterfieldtext("0123456789.\\-°", 20349);

doesn't seem to make any difference. ( At first this caused my M20998 to not execute from MDI, but now I can't repeat it )

Another related issue.
I had manually edited the key value in the profile to be "0.0°"
I have another macro to write the keys while I'm testing, using:

string fieldtext = AS3jog.Getfield (20349);
exec.Writekey("2017_Fields", "20349", fieldtext);

When this macro is run with field #20349 having "0.0°", the key is saved as:

20349=0.0°

While typing this message, I realized that I don't nee to save these values, so this is less of an issue for me. But still a bug imo.

It's not a big deal if these issues can't be fixed, but they seem like bugs.
Or maybe I just don't know what I'm doing? :)
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2663
Joined: Sat Sep 03, 2016 2:17 am

Re: Writing ° to text field

Postby ger21 » Sat Nov 26, 2016 6:18 pm

After some Googling, I found that this works:

string test = "25.405" ;
string degree = ((char)0x00B0).ToString();
AS3jog.Setfieldtext(test + degree, 20349); // Set Edge Angle

But, as I stated in my original post, Setfieldtext() works in the Constructor macro, but not when called from MDI.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2663
Joined: Sat Sep 03, 2016 2:17 am

Re: Writing ° to text field

Postby cncdrive » Sat Nov 26, 2016 9:00 pm

Looks like a character coding issue, will try to look after what is causing this.
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: Writing ° to text field

Postby ger21 » Sat Nov 26, 2016 11:29 pm

Also.
Whenever I save the screen during editing.
If the field contains the value "0.0°", the value "0.0°" gets written to the Setfieldtext function in the .ssf
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2663
Joined: Sat Sep 03, 2016 2:17 am

Re: Writing ° to text field

Postby cncdrive » Sun Nov 27, 2016 5:05 pm

I think I could resolve this, but please check and test the new release 1.2030, last post in this thread: viewtopic.php?f=2&t=240&start=20
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: Writing ° to text field

Postby ger21 » Sun Nov 27, 2016 5:41 pm

Yes, this last issue seems to be fixed now.
I saved the screen, and restarted, and it works fine. The .ssf file is now being saved correctly. Thanks for the excellent support.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2663
Joined: Sat Sep 03, 2016 2:17 am

Re: Writing ° to text field

Postby ger21 » Sat Dec 17, 2016 2:53 pm

While this is fixed in the .ssf file, it's not working when called from a button.

M20545.txt
AS3jog.Setfieldtext("0.0°", 20349); // Write angle to DRO

gives me 0.0°
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2663
Joined: Sat Sep 03, 2016 2:17 am

Re: Writing ° to text field

Postby cncdrive » Sat Dec 17, 2016 5:20 pm

In which UCCNC version?
1.2029 did not have this fixed yet, 1.2030 had.
Could you confirm that you testing this with version 1.2030 and still have the mentioned issue?
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: Writing ° to text field

Postby ger21 » Sat Dec 17, 2016 5:30 pm

My mistake. I thought it was working when the screen loaded, but the problem was when saving the screen.

I'm using the 1.2029 release version from today, as the 1.2030 version was too buggy for me to use.
Thanks.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2663
Joined: Sat Sep 03, 2016 2:17 am

Re: Writing ° to text field

Postby ger21 » Wed Jan 11, 2017 1:36 am

ger21 wrote:While this is fixed in the .ssf file, it's not working when called from a button.

M20545.txt
AS3jog.Setfieldtext("0.0°", 20349); // Write angle to DRO

gives me 0.0°


This is still not working in version 1.2031
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2663
Joined: Sat Sep 03, 2016 2:17 am

Next

Return to Report a bug

Who is online

Users browsing this forum: No registered users and 2 guests

cron