Load and Unload Macros working better.
Fixed colors on redeem purchase disabled button
This commit is contained in:
parent
a241888635
commit
06b1512698
24 changed files with 87 additions and 72 deletions
|
|
@ -44,7 +44,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
|
|||
private List<string> commandQueue = new List<string>();
|
||||
bool waitingForUserInput = false;
|
||||
|
||||
public const string macroStart = "; Command:";
|
||||
public const string MacroPrefix = "; Command:";
|
||||
|
||||
public QueuedCommandsStream(GCodeStream internalStream)
|
||||
: base(internalStream)
|
||||
|
|
@ -83,17 +83,17 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
|
|||
|
||||
if (lineToSend != null)
|
||||
{
|
||||
if (lineToSend.StartsWith(macroStart))
|
||||
if (lineToSend.StartsWith(MacroPrefix))
|
||||
{
|
||||
int spaceAfterCommand = lineToSend.IndexOf(' ', macroStart.Length);
|
||||
int spaceAfterCommand = lineToSend.IndexOf(' ', MacroPrefix.Length);
|
||||
string command;
|
||||
if (spaceAfterCommand > 0)
|
||||
{
|
||||
command = lineToSend.Substring(macroStart.Length, spaceAfterCommand - macroStart.Length);
|
||||
command = lineToSend.Substring(MacroPrefix.Length, spaceAfterCommand - MacroPrefix.Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
command = lineToSend.Substring(macroStart.Length);
|
||||
command = lineToSend.Substring(MacroPrefix.Length);
|
||||
}
|
||||
|
||||
List<string> messages = new List<string>();
|
||||
|
|
@ -112,12 +112,14 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
|
|||
}
|
||||
break;
|
||||
|
||||
case "ChooseMaterial":
|
||||
waitingForUserInput = true;
|
||||
UiThread.RunOnIdle(() => RunningMacroPage.Show(messages.Count > 0 ? messages[0] : "", true, true));
|
||||
break;
|
||||
|
||||
case "WaitOK":
|
||||
waitingForUserInput = true;
|
||||
if (messages.Count > 0)
|
||||
{
|
||||
UiThread.RunOnIdle(() => RunningMacroPage.Show(messages[0], true));
|
||||
}
|
||||
UiThread.RunOnIdle(() => RunningMacroPage.Show(messages.Count > 0 ? messages[0] : "", true));
|
||||
break;
|
||||
|
||||
case "Close":
|
||||
|
|
@ -140,17 +142,19 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
|
|||
return lineToSend;
|
||||
}
|
||||
|
||||
public void Continue()
|
||||
{
|
||||
waitingForUserInput = false;
|
||||
}
|
||||
|
||||
internal void Clear()
|
||||
public void Reset()
|
||||
{
|
||||
lock (locker)
|
||||
{
|
||||
commandQueue.Clear();
|
||||
}
|
||||
|
||||
waitingForUserInput = false;
|
||||
}
|
||||
|
||||
public void Continue()
|
||||
{
|
||||
waitingForUserInput = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue