Commit 056d8e73 authored by reza's avatar reza

nr: pishfarz setting + chideman ultimate mesle fascin8

parent 57e2f7a2
...@@ -75,7 +75,7 @@ namespace I8Devices ...@@ -75,7 +75,7 @@ namespace I8Devices
public bool test_signal { get; set; } public bool test_signal { get; set; }
public bool leadoff_mode { get; set; } public bool leadoff_mode { get; set; }
private int _sampling_rate = 250; private int _sampling_rate = 2000;
public int sampling_rate public int sampling_rate
{ {
get => _sampling_rate; get => _sampling_rate;
...@@ -88,8 +88,8 @@ namespace I8Devices ...@@ -88,8 +88,8 @@ namespace I8Devices
} }
} }
private int _gain = 250; private int _gain = 24;
private int _exgain = 250; private int _exgain = 24;
public int gain public int gain
{ {
get => _gain; get => _gain;
...@@ -121,7 +121,7 @@ namespace I8Devices ...@@ -121,7 +121,7 @@ namespace I8Devices
} }
private const int _chanels_count = 24; private const int _chanels_count = 21;
public bool[] channels_on = new bool[_chanels_count]; public bool[] channels_on = new bool[_chanels_count];
private const int _exchanels_count = 3; private const int _exchanels_count = 3;
...@@ -622,19 +622,24 @@ namespace I8Devices ...@@ -622,19 +622,24 @@ namespace I8Devices
_serialPort.Read(last_data_recieve, 0, 26); _serialPort.Read(last_data_recieve, 0, 26);
if (last_data_recieve[25] == 47) if (last_data_recieve[25] == 47)
{ {
sample_count++;
double[] data_converted = new double[10]; double[] data_converted = new double[14];
data_converted[0] = sample_count; data_converted[0] = sample_count; // dll sample count
data_converted[1] = last_data_recieve[24]; // key inputs data_converted[1] = sample_count; // firmware sample count
int i = 2; data_converted[2] = 0; //reserverd
data_converted[3] = 47; // Device ID
data_converted[4] = last_data_recieve[24]; // user input keys
data_converted[5] = 0; //reserverd
int i = 6, p = 0;
for (int k = i; k < 8 + i; k++) for (int k = i; k < 8 + i; k++)
{ {
data_converted[k] = (65536 * last_data_recieve[3 * (k - i) + 0]) + (256 * last_data_recieve[3 * (k - i) + 1]) + last_data_recieve[3 * (k - i) + 2]; data_converted[k] = (65536 * last_data_recieve[3 * (k - i) + p + 0]) + (256 * last_data_recieve[3 * (k - i) + p + 1]) +
last_data_recieve[3 * (k - i) + p + 2];
if (data_converted[k] > 8388607) data_converted[k] = data_converted[k] - 16777216; if (data_converted[k] > 8388607) data_converted[k] = data_converted[k] - 16777216;
data_converted[k] = data_converted[k] * 0.536; data_converted[k] = data_converted[k] * 0.536;
} }
receiveBuffer.Add(data_converted); receiveBuffer.Add(data_converted);
sample_count++;
newData_count++; newData_count++;
// if (debug_mode) Console.WriteLine("DLL: Sample number " + sample_count + " has been received :)"); // if (debug_mode) Console.WriteLine("DLL: Sample number " + sample_count + " has been received :)");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment