Hello Guest it is May 21, 2019, 01:11:02 PM

Author Topic: Auto Calculator Size  (Read 191 times)

0 Members and 1 Guest are viewing this topic.

Auto Calculator Size
« on: March 17, 2019, 10:14:09 AM »
Hi I am working on a new custom screenset, and I will be working on a touch screen.
So for this I am going to use the Auto Calulator feature for the input of the DRO´s
I have searched this forum and found someone ask the same question a few years back, but no response, that I can find.
My chubby fingers are a little to large for the small keys on the Auto calculator.
The function is great as the keypad pops up when you press the desired DRO, but again I would like it to be a bit larger.

I know that there are no further development on mach3 anymore, but If anyone has been able to solve this issue, or have some other good solutions, it is greatly appreciated

A numeric keyboard with an enter key is all that is needed

best reg
Roy

Offline TPS

*
  •  1,247 1,247
    • View Profile
Re: Auto Calculator Size
« Reply #1 on: March 17, 2019, 02:28:27 PM »
hello Roy,

have a look here: https://www.machsupport.com/forum/index.php?topic=39117.0

or here: https://www.machsupport.com/forum/index.php?topic=36213.msg247828#msg247828

there is some code code i did for an other user, witch can be easy modified for your Needs.
« Last Edit: March 17, 2019, 02:34:33 PM by TPS »
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline reuelt

*
  •  444 444
    • View Profile
Re: Auto Calculator Size
« Reply #2 on: March 17, 2019, 02:36:17 PM »
read my post
https://www.machsupport.com/forum/index.php?topic=39655.0

An Android tablet or a windows 10 tablet connecting into a MACH3 PC as a RD Client will ALREADY provide touchscreen, ZOOM, PAN and large touch Keyboard capability for data entry.

A simple screenset like the ready uploaded "School_Router.set" could be used if just running programs if using Remote Desktop touchscreen since buttons are LARGE.

"the gift of God is eternal life through Jesus Christ our Lord"
Re: Auto Calculator Size
« Reply #3 on: March 17, 2019, 03:16:30 PM »
hello Roy,

have a look here: https://www.machsupport.com/forum/index.php?topic=39117.0

or here: https://www.machsupport.com/forum/index.php?topic=36213.msg247828#msg247828

there is some code code i did for an other user, witch can be easy modified for your Needs.

Thank you very much Thomas.
I looked into this, and made the macro, but when I try to run the script I get this error message.
I just might have done something wrong.
I have not figured out yet how to call the macro from a button, so i just ran it from the script editor to test

Attached are the screenshot of the error message

Best regards
Roy
Re: Auto Calculator Size
« Reply #4 on: March 17, 2019, 03:27:45 PM »
read my post
https://www.machsupport.com/forum/index.php?topic=39655.0

An Android tablet or a windows 10 tablet connecting into a MACH3 PC as a RD Client will ALREADY provide touchscreen, ZOOM, PAN and large touch Keyboard capability for data entry.

A simple screenset like the ready uploaded "School_Router.set" could be used if just running programs if using Remote Desktop touchscreen since buttons are LARGE.



Thanks a lot, that is so cool.
For this project I have a compact computer with touchscreen running win8, and I am making a custom screenset for a motion control application using the mach 3 screen designer.
I have the screenset mostly worked out, but would like a bigger keypad for my lumpy fingers.

best regards
Roy

Offline TPS

*
  •  1,247 1,247
    • View Profile
Re: Auto Calculator Size
« Reply #5 on: March 18, 2019, 01:44:06 AM »
this is the way how to use it:

Hello,

here a simple solution with "on board" possibilities (VB script) to do Inputs to DRO (touch Screen).

put the following code into a macro in your macrofolder:


Code: [Select]


Global value As String

'TPS 01.12.2017
'numerische Eingabe
Function NumericKeyboard(ByVal DRONum as Integer) As Double
Dim title as String
value = GetOemDRO(DRONum)
title = Header


Begin Dialog UserDialog1 60,60, 105, 180, "Eingabe:"  , .Enable

PushButton 10, 10, 25, 25, "7", .but7
PushButton 40, 10, 25, 25, "8", .but8
PushButton 70, 10, 25, 25, "9", .but9

PushButton 10, 40, 25, 25, "4", .but4
PushButton 40, 40, 25, 25, "5", .but5
PushButton 70, 40, 25, 25, "6", .but6

PushButton 10, 70, 25, 25, "1", .but1
PushButton 40, 70, 25, 25, "2", .but2
PushButton 70, 70, 25, 25, "3", .but3

PushButton 10, 100, 25, 25, ".", .butD
PushButton 40, 100, 25, 25, "0", .but0
PushButton 70, 100, 25, 25, "<-", .butB

TextBox 10, 130, 85, 18, .FText
PushButton 10, 155, 40, 21,"OK", .OK
CancelButton 55, 155, 40, 21
End Dialog


Dim Dlg1 As UserDialog1

Dlg1.FText = CStr(value)
x = Dialog( Dlg1 )

NumericKeyboard = CDbl(Dlg1.FText)
SetOEMDro(DRONum,CDbl(Dlg1.FText))
End Function

Function Enable( ControlID$, Action%, SuppValue%)

Select Case Action%
Case 1

Case 2 'Button wurde gerückt
If ControlID$ = "but0" Then
value = CStr(value) + "0"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but1" Then
value = CStr(value) + "1"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but2" Then
value = CStr(value) + "2"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but3" Then
value = CStr(value) + "3"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but4" Then
value = CStr(value) + "4"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but5" Then
value = CStr(value) + "5"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but6" Then
value = CStr(value) + "6"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but7" Then
value = CStr(value) + "7"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but8" Then
value = CStr(value) + "8"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "but9" Then
value = CStr(value) + "9"
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "butD" Then
   If InStr(1,value,".") = 0 Then
value = CStr(value) + "."
DlgText "FText", CStr(value)
Enable =1
   End If
End If
If ControlID$ = "butB" Then
value = Left(value,Len(value)-1)
DlgText "FText", CStr(value)
Enable =1
End If
If ControlID$ = "OK" Then
Enable = -1
End If
Case 3 'Text verändert
'MsgBox Dlg1.FText
Case Else
End Select

'Wert zurückgeben
If Enable = -1 Then
Enable = value
End If

End Function   




ok lets say you put into C:\mach3\macros\yourprofile\numerickeyboard.m1s

if you put following code into a transparent button over the a-axis dro
the code do edit x-axis would be:


Code: [Select]

Sub Main
call NumericKeyboard(800)

End Sub


#Expand <\..\..\macros\yourprofile\numerickeyboard>



call NumericKeyboard(800)

the number is the OEMDro you want to edit.
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Auto Calculator Size
« Reply #6 on: March 18, 2019, 01:00:23 PM »
Thanks for the howto.
I got the script working, now its just a problem with the #Expand code.
When I press the button with this script, I get this error message. (see attachment)
(I noticed a path that has a folder named ScreensetMacros, I do not have this folder in my Mach3 folder)

Is the config button supposed to be configured with std code 34  ,and with this text?:

Sub Main
   call NumericKeyboard(800)

End Sub


#Expand <C:\Mach3\macros\plasma\numerickeyboard>

Best reg
Roy

Offline TPS

*
  •  1,247 1,247
    • View Profile
Re: Auto Calculator Size
« Reply #7 on: March 18, 2019, 01:17:12 PM »
try:

#Expand <\..\..\macros\plasma\numerickeyboard>
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Auto Calculator Size
« Reply #8 on: March 18, 2019, 01:19:39 PM »
Yup that did the trick. I figured that I should put my path in the ..\..\ fields. Now I am on track.
Thank you very much for your help Thomas, and I wish you a great day

Best regards
Roy
Re: Auto Calculator Size
« Reply #9 on: March 18, 2019, 04:24:50 PM »
Sorry to keep nagging here but I am trying to learn some of the VB scripting slow and steady.

I have been able to change the size of the keypad, buttons and also the placement on the screen by myself, BUT it would be great to be able to code some strings to also change the font size
Is that something that can be easily done?

BR
R