Hello Guest it is December 02, 2024, 04:02:06 PM

Author Topic: Disable Sound  (Read 21073 times)

0 Members and 1 Guest are viewing this topic.

Re: Disable Sound
« Reply #30 on: April 08, 2013, 02:10:50 PM »
i'm completely lost as to what you asked of me :)
so i'm back to my orginal question. i CAN"T have the words
Inch/Metric be displayed when mach3 starts ?

also, any way to change font size without changing button's size ?

now, when i start mach3 the message Inch/Metric is not shown.
is there a way to have it show last state when restarting mach3 ?
Thanks

Kenneth
Re: Disable Sound
« Reply #31 on: April 09, 2013, 06:07:13 AM »
Hi Kenneth,

as I've pointed out in an earlier answer, write a macro with that content:

SetUserLabel(nr, "text")

nr is label number
text is either Metrics, or Inch, depending what you want as default text when the screen set is opened.

name that macro m1010.m1s e.g.
add that macro to Config -> General Config -> Initializing String line without the trailing ".m1s"
When Mach3 is not in emergency mode, this text will be displayed, the first time the screen set is opened.


re font size:
if I remember right, there where some discussions about font size. Please use the search function to get more information about that.


Klaus

The brain isn't a soap, it doesn't shrink when used.
Re: Disable Sound
« Reply #32 on: April 09, 2013, 06:17:59 AM »
Thanks Klaus,
understand what you mean now.
but that will set it to what ever is in the general setting.
NOT the last state when closed. if i set(in General) it to
inch but the last state before close is metric. then it will open
as inch and the dro will me metric. hope this explains better.
Kenneth
Re: Disable Sound
« Reply #33 on: April 09, 2013, 06:57:11 AM »
think i need something like below. working on it....

If GetUserDRO(1010) And GetUserLED(1012) = 1 Then
SetUserLabel(1,"Inch")
SetUserLED(1012,0)
Else
SetUserLabel(1,"Metric")
SetUserLED(1012,1)
End If
End   
Kenneth
Re: Disable Sound
« Reply #34 on: April 09, 2013, 07:08:55 AM »
i've got this to do what i wanted. when mach3 opens, label is metric
if dro is metric( i know, dro doesn't know it :) ) and inch if dro is inch.
Thanks Klaus !

If GetUserDRO(1010) And GetUserLED(1012) = 0 Then
SetUserLabel(1,"Inch")
SetUserLED(1012,0)
Else
SetUserLabel(1,"Metric")
SetUserLED(1012,1)
End If
End     
« Last Edit: April 09, 2013, 07:10:40 AM by Kenneth »
Kenneth
Re: Disable Sound
« Reply #35 on: April 09, 2013, 09:27:49 AM »
Hi Kenneth,

if you want to remember the last state, you could write the actual state into a file. Every time you start Mach3 you read the last state from the file and set your label accordingly. The reading could be done in the macro we named m1010.m1s.


Klaus
The brain isn't a soap, it doesn't shrink when used.
Re: Disable Sound
« Reply #36 on: April 09, 2013, 10:11:56 AM »
just write inch or metric in a file? ext type ?
don't know ho wto get last state.
Kenneth
Re: Disable Sound
« Reply #37 on: April 09, 2013, 12:53:46 PM »
Hi Kenneth,

it's hard to give you the correct code, since I don't know what function codes you have assigned to your controls. Please insert the following code into your code
  Open "C:\Mach3\OldState" For output As #1
  Write #1, "Inch"

  Open "C:\Mach3\OldState" For output As #1
  Write #1, "Metric"

  Close #1


as shown in the sample.


If Get userLED(1010) = 1 Then
  Set UserLabel(1, "Inch")
  Set UserLED(1012 , 1)
  Set UserLED(1010 , 0)
  Open "C:\Mach3\OldState" For output As #1
  Write #1, "Inch"
Else
  Set UserLabel(1, "Metric")
  Set UserLED(1012 , 0)
  Set UserLED(1010 , 1)
  Open "C:\Mach3\OldState" For output As #1
  Write #1, "Metric"
End If
Close #1



and use this code for your macro m1010.m1s:



Sub init_units
On Error GoTo file_not_found
Open "C:\Mach3\OldState" For Input As #1
Input #1, unit
Close #1

If (StrComp(unit, "Inch") = 0) Then
  setuserlabel(1, unit)
elseif (StrComp(unit, "Metric") = 0) Then
  setuserlabel(1, unit)
Else
  setuserlabel(1, "default")
End If
exit sub
file_not_found:
  setuserlabel(1, "default")
End Sub

please replace the label text "Default" by Inch or metric, what ever you need.



Klaus
The brain isn't a soap, it doesn't shrink when used.
Re: Disable Sound
« Reply #38 on: April 09, 2013, 01:19:58 PM »
i don't have a file/folder OldState. do i make a folder ?
make a file ?   file ext ?
Kenneth
Re: Disable Sound
« Reply #39 on: April 09, 2013, 01:26:36 PM »
the file OldState will be created automatically.

Klaus
The brain isn't a soap, it doesn't shrink when used.