Conversational Wizards

Discuss the creation and usage of Wizards

Re: Conversational Wizards

Postby Dan911 » Sat Jan 13, 2018 2:27 am

Finishing up forth wizard. Create and cut square or rectangle with editable/type corners. Will upload soon, just haven't had a chance for thorough testing.

sqyare-rectangle.JPG
Dan911
 
Posts: 416
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Conversational Wizards

Postby Sword » Sat Jan 13, 2018 4:57 am

Back when I used Mach3 (10+ years ago), I made myself a keyslot or hangslot wizard. I do 1000's of various size plaques throughout the year and they all need keyhole slots of some form on them, so over the years, I've made a couple versions that worked on the machines I had/have (the old Mach3 wizard version and an input only driven one that used plain Basic). I even started making a stand alone one with VB.net several years ago, but not being a real programmer, I got lost in the code that was needed and kind of abandoned it.

Anyway, I thought I'd suggest it as a wizard and show a screenshot of the one I made for Mach3 and the abandoned .net one.

Scott
Attachments
Keyhole Wizard.JPG
KeySlotter.JPG
Sword
 
Posts: 16
Joined: Fri Dec 08, 2017 10:45 pm

Re: Conversational Wizards

Postby Vmax549 » Sat Jan 13, 2018 5:54 am

IF you can upload the mach3 ver OR send me teh Wizard. I will take a look at converting it to UCCNC for you.

(;-) TP
Vmax549
 
Posts: 1274
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Conversational Wizards

Postby Sword » Mon Jan 15, 2018 2:32 am

I'll see if I can dig up all the bits and pieces of it.
Sword
 
Posts: 16
Joined: Fri Dec 08, 2017 10:45 pm

Re: Conversational Wizards

Postby Sword » Mon Jan 15, 2018 7:48 pm

Here's the old Mach3 version. In the VB version, I was setting it up for a center vertical one also. Some combination were not allowed, because it wouldn't make sense to do. For instance, only one centered vertical one was allowed as well as only one of the vertical pairs. Both horizontal center ones could be. I had some preset ones in the Mach3 version, but was working towards being able to save a set of settings as a preset in the VB version. If you think you could work with the VB version, I can see what I can zip up for that. It's been a while since I worked on it, so I'd have to see if I can get all the pieces together.
Attachments
Hangslots.zip
(332.42 KiB) Downloaded 59 times
Sword
 
Posts: 16
Joined: Fri Dec 08, 2017 10:45 pm

Re: Conversational Wizards

Postby Vmax549 » Tue May 29, 2018 6:43 pm

HI Dezsoe, Did you ever get a chance to make this work ??? It is a great idea and I would like to try it. Can you give a code example .

// ##WizardName,M90234

I store all Macro Wizards in C:\UCCNC\Wizards


(;-) TP

Start the macro files with a fixed pattern, e. g. "// ##This is my macro for anything". Scan the macro folder for .txt files which have the first line starting with "// ##", add the rest of this line as a name and the macro number to a list if the pattern is found. Your menu is ready to use in runtime. Also, you can store the results in a combobox on the standard screen and have a button to start the selected macro/wizard. (It's about 1AM here, so I go to sleep now. If you'd like, I make it tomorrow.)
Vmax549
 
Posts: 1274
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Conversational Wizards

Postby dezsoe » Tue May 29, 2018 8:54 pm

Hi Terry,

No. As I wrote than: I make it if you want it. Now I feel that you want it. :)

How do you plan to call a macro from an other folder? My original idea was to scan the current macro folder for macros with that fixed sign at their beginning. OK, I'll make it and after a test we can discuss it.
dezsoe
 
Posts: 531
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Conversational Wizards

Postby Vmax549 » Tue May 29, 2018 10:33 pm

I wrote the wrong Folder it should have been the macros folder. They really SHOULD have their own folder BUT that is another discussion. :P

I think I have something to work with here. I scavenged the web for bits and pieces and I think I have found enough for it to work. Let me see IF I can make it work before you dig into it.

(;-) TP
Vmax549
 
Posts: 1274
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Conversational Wizards

Postby Vmax549 » Tue May 29, 2018 11:59 pm

This works, I added a ComboBox(2001) to teh screen. Then I populate teh List from this script. It searches teh macro folder for files that have the "// ## " in teh first line. It then applies all the names and macro numbers to teh list. ( Wizard1,M8000,etc). You select a function then press a button that takes teh Macro Number and calls it.

To make it better we DO need a exec.GetProfilename() function. It is IN teh UC side but not teh macro side that I can find.

You can use this for ANY macro function not just for Wizards.

(;-) TP



// Macro to update Wizard Menu M20010

AS3.Clearcomboboxitems(2001);
exec.Wait(100);

string folderPath = Application.StartupPath + "\\Profiles\\Macro_Derek_BP"; // Need Profile info

string contents = "";

foreach (string file in System.IO.Directory.GetFiles(folderPath, "*.txt"))
{
if(exec.Ismacrostopped()){return;}
string firstLine;
using(System.IO.StreamReader reader = new System.IO.StreamReader(file))
{
firstLine = reader.ReadLine() ?? "";
if (firstLine.Contains("// ##")) // LOOK FOR THE WORD "// ##"
{
var result = firstLine.Substring(firstLine.LastIndexOf('#') + 1);
AS3.Addcomboboxitem(""+result,2001);
}
}
}

AS3.Validatenewcomboboxitems(2001);
exec.Wait(100);
AS3.Updatecomboboxselection(0,2001);
exec.Wait(100);
exec.AddStatusmessage("Wizard Menu Update Complete");

######################################################

//Macro M20094 for function select button

string selection = AS3.Getcomboboxselection (2001) ;
exec.Wait(100);
var result = selection.Substring(selection.LastIndexOf(',') + 1);
exec.Wait(100);

if (MessageBox.Show(" Ready to Start ? ", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
//Function script if user clicked yes
exec.AddStatusmessage(" Starting Function");
exec.Code(""+ result);
}
else
{
exec.AddStatusmessage("Question Failed!! Restart Function");
return;
}
Vmax549
 
Posts: 1274
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Conversational Wizards

Postby Dan911 » Wed May 30, 2018 12:43 am

Vmax549 wrote: They really SHOULD have their own folder BUT that is another discussion. :P
(;-) TP


Terry.... if you want your own folder just create it.

Path = Application.StartupPath + @"\Wizard_Gcode1";

Directory.CreateDirectory(Path);

Dan
Dan911
 
Posts: 416
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

PreviousNext

Return to Conversational Wizards

Who is online

Users browsing this forum: No registered users and 1 guest