How to read data from scanner models with more than one laser. |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using JoeScan.JCamNet;
namespace Examples
{
class Program
{
static void Main(string[] args)
{
Scanner scanner = Scanner.Connect(new IPAddress(new byte[] { 192, 168, 1, 152 }), 0);
TextReader parametersReader;
using (parametersReader = File.OpenText("param.dat"))
{
scanner.SetParameters(parametersReader.ReadToEnd(), true);
}
// this will only work on an X2 or X3 model!
if (scanner.LaserCount < 2)
{
System.Console.WriteLine("Demo code only for models with multiple lasers.");
return;
}
for (int i = 0; i < scanner.LaserCount; i++)
{
Profile p = scanner.GetProfile(i);
System.Console.WriteLine("Laser {0}: Profile contains {1} points.", i,p.Count);
}
}
}
} |
| Reading out multiple lasers in Synchronized Mode is only supported when configured with the TimeStaggeredScanning keyword. |