Merge pull request #488 from gregory-diaz/master
Added the ability to write print_log to file on disk for Android buil…
This commit is contained in:
commit
91c9c343bd
2 changed files with 21 additions and 0 deletions
|
|
@ -1235,7 +1235,25 @@ namespace MatterHackers.MatterControl.PrinterCommunication
|
|||
|
||||
public void OnCommunicationStateChanged(EventArgs e)
|
||||
{
|
||||
|
||||
CommunicationStateChanged.CallEvents(this, e);
|
||||
#if __ANDROID__
|
||||
|
||||
//Path to the printer output file
|
||||
string pathToPrintOutputFile = Path.Combine(ApplicationDataStorage.Instance.PublicDataStoragePath, "print_output.txt");
|
||||
|
||||
if (CommunicationState == CommunicationStates.FinishedPrint)
|
||||
{
|
||||
//Only write to the text file if file exists
|
||||
if (File.Exists(pathToPrintOutputFile))
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
File.WriteAllLines(pathToPrintOutputFile, PrinterOutputCache.Instance.PrinterLines);
|
||||
});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public void OnConnectionFailed(EventArgs e)
|
||||
|
|
|
|||
|
|
@ -32,9 +32,11 @@ using MatterHackers.Agg.UI;
|
|||
using MatterHackers.Localizations;
|
||||
using MatterHackers.MatterControl.CustomWidgets;
|
||||
using MatterHackers.MatterControl.PrinterCommunication;
|
||||
using MatterHackers.MatterControl.DataStorage;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
namespace MatterHackers.MatterControl
|
||||
{
|
||||
|
|
@ -116,6 +118,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
textScrollWidget = new TextScrollWidget(PrinterOutputCache.Instance.PrinterLines);
|
||||
//outputScrollWidget.Height = 100;
|
||||
Debug.WriteLine(PrinterOutputCache.Instance.PrinterLines);
|
||||
textScrollWidget.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor;
|
||||
textScrollWidget.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
textScrollWidget.HAnchor = HAnchor.ParentLeftRight;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue