public PythonSettings( uint StartType, uint BufferSize, double Frequency, uint Control, uint Prehistory, uint StartDelay, uint Hysteresis, uint PacketNumber, double Threshold, uint ControlSynchro, RshChannel[] Channels, uint WaitTime, uint DigitalPort) { startType = StartType; bufferSize = (uint)(BufferSize);// / Channels.Length); frequency = Convert.ToUInt32(Frequency); control = Control; preHistory = Prehistory; startDelay = StartDelay; hysteresis = Hysteresis; packetNumber = PacketNumber; threshold = Threshold; controlSynchro = ControlSynchro; channels = Channels; waitTime = WaitTime; digitalPort = DigitalPort; InitPossibleAscanLengths(); }
public PythonSettings() { // Test mode startType = (uint)RshInitMemory.StartTypeBit.Internal; bufferSize = 16304;// 16224; frequency = Convert.ToUInt32(1.0e+9); control = 0; startDelay = 0; hysteresis = 0; packetNumber = 0; threshold = 0; controlSynchro = 1; waitTime = 500; channels = new RshChannel[1]; channels[0] = new RshChannel(); channels[0].control = (uint)RshChannel.ControlBit.Used; channels[0].gain = 1; InitPossibleAscanLengths(); }
/// <summary> /// Считать заголовок файла /// </summary> /// <param name="bReader"></param> /// <param name="fi"></param> /// <param name="bscanLength"></param> /// <returns></returns> private TempFileInfo ReadFileHeader(BinaryReader bReader, FileInfo fi, out int bscanLength) { // file info short fileVersion = bReader.ReadInt16(); bscanLength = bReader.ReadInt32(); string comment = bReader.ReadString(); string timeCreated = bReader.ReadString(); // python settings uint startType = bReader.ReadUInt32(); uint bufferSize = bReader.ReadUInt32(); double frequency = bReader.ReadDouble(); uint control = bReader.ReadUInt32(); uint preHistory = bReader.ReadUInt32(); uint startDelay = bReader.ReadUInt32(); uint hysteresis = bReader.ReadUInt32(); uint packetNumber = bReader.ReadUInt32(); double threshold = bReader.ReadDouble(); uint controlSynchro = bReader.ReadUInt32(); uint waitTime = bReader.ReadUInt32(); int channelsNum = bReader.ReadInt32(); RshChannel[] channels = new RshChannel[channelsNum]; for (int i = 0; i < channels.Length; i++) { channels[i] = new RshChannel(); channels[i].control = bReader.ReadUInt32(); channels[i].delta = bReader.ReadDouble(); channels[i].gain = bReader.ReadUInt32(); } uint digitalPort = bReader.ReadUInt32(); // survey settings double dt = bReader.ReadDouble(); double dx = bReader.ReadDouble(); double eps = bReader.ReadDouble(); int zoom = bReader.ReadInt32(); string palette = bReader.ReadString(); int repRate = bReader.ReadInt32(); int marksCount = bReader.ReadInt32(); Dictionary<int, int> Marks = new Dictionary<int, int>(); for (int i = 0; i < marksCount; i++) Marks.Add(bReader.ReadInt32(), bReader.ReadInt32()); PythonSettings pythset = new PythonSettings( startType, bufferSize, frequency, control, preHistory, startDelay, hysteresis, packetNumber, threshold, controlSynchro, channels, waitTime, digitalPort); TempFileInfo tempInfo = new TempFileInfo(fileVersion, pythset, Marks); Settings.Init(zoom, dx, dt, eps, palette, repRate, Settings.CalibrationProps); return tempInfo; }