private async Task ResetSpectrum() { for (uint i = 0; i < 16; ++i) { await Task.Run(() => { LahgiWrapper_Static.ResetSpectrum(i); CZTSpectrumEnergy.Reset(); }); } }
static void ProcessImgData(SRE3021ImageData imgData) { List <int> interactionX = new List <int>(); List <int> interactionY = new List <int>(); int interactionPotins = 0; int backgroundNoise = 0; for (int X = 0; X < 11; ++X) { for (int Y = 0; Y < 11; ++Y) { if (imgData.AnodeTiming[X, Y] > 50) { ++interactionPotins; interactionX.Add(X); interactionY.Add(Y); } else { backgroundNoise += imgData.AnodeValue[X, Y]; } } } if (interactionX.Count == 0) { return; } backgroundNoise = backgroundNoise / 118; if (interactionPotins == 1) { CZTSpectrumEnergy.AddEnergy(imgData.AnodeValue[interactionX[0], interactionY[0]] * p1 + p2); } //if (interactionPotins == 2) //{ // CZTSpectrumEnergy.AddEnergy(imgData.AnodeValue[interactionX[0], interactionY[0]] * p1 + p2 + imgData.AnodeValue[interactionX[1], interactionY[1]] * p1 + p2); //} DataCountStatic++; }