Exemplo n.º 1
0
 public PnCadReader(IPnCadDocument document, IFileReadLine lineReader) : base(document, lineReader)
 {
     OnLine.Where(line => !string.IsNullOrWhiteSpace(line)).Subscribe(line => {
         var values = Regex.Split(line, @"\s+");
         if (values.Length != 14)
         {
             return;
         }
         PnCadSchema schema = new PnCadSchema()
         {
             Color     = values[1].TrySetIntValue() ?? 0,
             Prop2     = values[2].TrySetIntValue() ?? 0,
             Prop3     = values[3].TrySetIntValue() ?? 0,
             Prop4     = values[4].TrySetIntValue() ?? 0,
             Prop5     = values[5].TrySetIntValue() ?? 0,
             Prop6     = values[6].TrySetIntValue() ?? 0,
             Type      = values[7].TrySetIntValue() ?? 0,
             Direction = values[8].TrySetIntValue() ?? 0,
             Point1X   = values[9].TrySetDoubleValue() ?? 0.0,
             Point1Y   = values[10].TrySetDoubleValue() ?? 0.0,
             Point2X   = values[11].TrySetDoubleValue() ?? 0.0,
             Point2Y   = values[12].TrySetDoubleValue() ?? 0.0,
             Angle     = values[13].TrySetDoubleValue() ?? 0.0
         };
         document.Schema.Add(schema);
     });
 }
Exemplo n.º 2
0
 public LaserCutBySpeedReader(IGProgram program, IFileReadLine lineReader, ILaserDocument document)
 {
     Check.NotNull(program, nameof(IGProgram));
     Check.NotNull(lineReader, nameof(IFileReadLine));
     Check.NotNull(document, nameof(document));
     this.Program    = program;
     this.LineReader = lineReader;
     this.Document   = document;
 }
Exemplo n.º 3
0
 public FileLineReader(TDocument document, IFileReadLine lineReader) : base(document)
 {
     Check.NotNull(lineReader, nameof(IFileReadLine));
     this.LineReader = lineReader;
 }
Exemplo n.º 4
0
 public DxfReader(IFileReadLine lineReader, IDxfDocument document, IReaderFactory readerFactory)
     : base(document, lineReader)
 {
     Check.NotNull(readerFactory, nameof(IServiceProvider));
     ReaderFactory = readerFactory;
 }