Files for dotnet framework / EAF
This commit is contained in:
@ -6,6 +6,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Adaptation.FileHandlers.jpeg;
|
||||
@ -39,6 +40,29 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
foreach (ModelObjectParameterDefinition modelObjectParameterDefinition in reactors)
|
||||
_Reactors.Add(modelObjectParameterDefinition.Name.Split('.')[1], modelObjectParameterDefinition.Value);
|
||||
string entryAssemblyLocationDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||
string x86 = Path.Combine(entryAssemblyLocationDirectory, "x86");
|
||||
if (!Directory.Exists(x86))
|
||||
_ = Directory.CreateDirectory(x86);
|
||||
string tessdata = Path.Combine(entryAssemblyLocationDirectory, "tessdata");
|
||||
if (!Directory.Exists(tessdata))
|
||||
_ = Directory.CreateDirectory(tessdata);
|
||||
string pdfttfSource = Path.Combine(entryAssemblyLocationDirectory, "pdf.ttf");
|
||||
string pdfttfDestination = Path.Combine(tessdata, Path.GetFileName(pdfttfSource));
|
||||
if (File.Exists(pdfttfSource) && !File.Exists(pdfttfDestination))
|
||||
File.Copy(pdfttfSource, pdfttfDestination);
|
||||
string tesseract41dllSource = Path.Combine(entryAssemblyLocationDirectory, "tesseract41.dll");
|
||||
string tesseract41dllDestination = Path.Combine(x86, Path.GetFileName(tesseract41dllSource));
|
||||
if (File.Exists(tesseract41dllSource) && !File.Exists(tesseract41dllDestination))
|
||||
File.Copy(tesseract41dllSource, tesseract41dllDestination);
|
||||
string engtraineddataSource = Path.Combine(entryAssemblyLocationDirectory, "eng.traineddata");
|
||||
string engtraineddataDestination = Path.Combine(tessdata, Path.GetFileName(engtraineddataSource));
|
||||
if (File.Exists(engtraineddataSource) && !File.Exists(engtraineddataDestination))
|
||||
File.Copy(engtraineddataSource, engtraineddataDestination);
|
||||
string leptonica1800dllSource = Path.Combine(entryAssemblyLocationDirectory, "leptonica-1.80.0.dll");
|
||||
string leptonica1800dllDestination = Path.Combine(x86, Path.GetFileName(leptonica1800dllSource));
|
||||
if (File.Exists(leptonica1800dllSource) && !File.Exists(leptonica1800dllDestination))
|
||||
File.Copy(leptonica1800dllSource, leptonica1800dllDestination);
|
||||
}
|
||||
|
||||
void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception) => Move(extractResults, exception);
|
||||
|
@ -1,20 +1,13 @@
|
||||
using Adaptation.Eaf.Management.ConfigurationData.CellAutomation;
|
||||
using Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration;
|
||||
using Adaptation.Shared;
|
||||
using Adaptation.Shared.Deposition;
|
||||
using Adaptation.Shared.Methods;
|
||||
using log4net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using Tesseract;
|
||||
|
||||
namespace Adaptation.FileHandlers.jpeg;
|
||||
@ -105,7 +98,7 @@ public class ProcessData : IProcessData
|
||||
|
||||
#pragma warning disable CA1416
|
||||
|
||||
private static (MemoryStream memoryStream, Color[]) Get(IFileRead fileRead, int thresHold, int endY, int endX, int startY, int startX)
|
||||
private static (MemoryStream memoryStream, Color[]) Get(IFileRead fileRead, int thresHold, int startX, int startY, int endX, int endY)
|
||||
{
|
||||
Color color;
|
||||
List<Color> colors = new();
|
||||
@ -147,7 +140,7 @@ public class ProcessData : IProcessData
|
||||
|
||||
#pragma warning restore CA1416
|
||||
|
||||
private static (MemoryStream, Color[]) Get(IFileRead fileRead, int thresHold) => Get(fileRead, thresHold, 68, 1559, 32, 1094);
|
||||
private static (MemoryStream, Color[]) Get(IFileRead fileRead, int thresHold) => Get(fileRead, thresHold, 330, 16, 400, 32);
|
||||
|
||||
private void Parse(IFileRead fileRead, List<FileInfo> fileInfoCollection)
|
||||
{
|
||||
|
Reference in New Issue
Block a user