UCCNC argument for title

Here is where you can request new features or special features.

UCCNC argument for title

Postby Fabien » Sun Feb 09, 2020 10:15 am

Hello,
Is that possible to add a command argument to set UCCNC windows title (useful with multiple instances of UCCNC)
Fabien
 
Posts: 12
Joined: Fri Jun 21, 2019 8:04 am

Re: UCCNC argument for title

Postby dezsoe » Mon Feb 10, 2020 10:32 am

Hello Fabien,

I use this macro as a macroloop with autostart to show the version, profile name, controller type and the opened file name in the title:

title.png
title.png (3.61 KiB) Viewed 7580 times

Code: Select all
// ================================================================================================
// System Info v1.1
// ================================================================================================

string header = "UCCNC - ";
string version = AS3.Getfield(902);
string profile = AS3.Getfield(900);
string device = AS3.Getfield(907);
string filename = exec.Getgcodefilename(); // AS3.Getfield(895);

profile = profile.Replace(":", ": ");

if (filename == "-") filename = "";

header += version + " - " + profile + " - " + device + " - File: " + filename;

if (++counter == 20)
{
  counter = 0;
  if (exec.mainform.Text != header)
    exec.mainform.Text = header;
}

// ================================================================================================

#Events

// ================================================================================================

int counter = 0;

// ================================================================================================
dezsoe
 
Posts: 1146
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: UCCNC argument for title

Postby Robertspark » Mon Feb 10, 2020 10:57 am

nice macro :D
Rob
Einstein ― “If you can't explain it to a six year old, you don't understand it yourself”
...working my way through the 1000+ ways things don't work to find the one that does
UC400eth, UC300eth, UCCNC v1.2110, Neuron Lite
UCCNC v1.2110 Macro Manual
Robertspark
 
Posts: 1734
Joined: Sat Sep 03, 2016 4:27 pm
Location: Nr Liverpool, England

Re: UCCNC argument for title

Postby Fabien » Tue Jul 28, 2020 8:43 am

Hello dezsoe,
Sorry for my response soo late, the notification was probably lost in spams…
Do you know if i can get the actual UC100 serial number ? And more generally, do you have any document about AS3 items ?

A simple argument on command line should be also nice if dev team could add it please ;-)

Thank you.
Fabien
 
Posts: 12
Joined: Fri Jun 21, 2019 8:04 am

Re: UCCNC argument for title

Postby dezsoe » Wed Jul 29, 2020 5:28 pm

Hello Fabien,

As I wrote: that sample is a macroloop. You have to save it as e.g. M1234.txt into your Profiles\Macro_yourprofilename folder and in UCCNC you have to set it as a macroloop.

But I made an other one (don't use both together, the first macro will overwrite the title!):

Code: Select all
string[] args = Environment.GetCommandLineArgs();

if (args.Length > 0)
  for (int i = 0; i < args.Length; i++)
    if ((args[i].Trim().ToUpper() == "/TITLE") && (i < args.Length - 1))
      exec.mainform.Text = args[i + 1];

Copy these lines into your M99998.txt macro and if you set a command line switch "/title" then the next parameter will be the title of the program. If you need more than one word, then you have to "put it into quotes", see the example below:

commandline.png
commandline.png (1.26 KiB) Viewed 139 times


title.png
title.png (989 Bytes) Viewed 139 times
dezsoe
 
Posts: 1146
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary


Return to Feature Request

Who is online

Users browsing this forum: No registered users and 1 guest