Exemplo n.º 1
0
        public override byte[] Encode()
        {
            byte[] param  = null;
            int    remain = NCFData.GetData().Configs[0].SampleData.Data["Time"].Count - Index;

            //达到测试预设时间
            if (CollectionParams.GetCollectionParams().ArrivedTime())
            {
                param = new byte[2] {
                    0x00, 0x02
                };
                return(this.Encode(message, param));
            }
            else if (CollectionParams.GetCollectionParams().ArrivedSize())
            {
                param = new byte[2] {
                    0x00, 0x04
                };
                return(this.Encode(message, param));
            }
            else
            {
                if (remain >= 5)
                {
                    param = CreateTransferParam(5);
                }
                else if (remain != 0)
                {
                    param = CreateTransferParam(remain);
                    Index = 0;
                }
            }
            //if (remain >= 5)
            //{
            //    param = CreateTransferParam(5);
            //}
            //else if (remain != 0)
            //{
            //    param = CreateTransferParam(remain);
            //    Index = 0;
            //}
            //else
            //{
            //    param = new byte[2] { 0x00, 0x02 };
            //    return this.Encode(message, param);
            //}
            //for test no data
            //param = CreateTransferParam(0);
            return(this.Encode(message, param));
        }
Exemplo n.º 2
0
 private float GetValue(string key, int index)
 {
     try
     {
         var v = FLChannel.GetFLChannel(config.CytometerInfo).channels;
         return(NCFData.GetData().Configs[0].SampleData.Data[key][index]);
     }
     catch (Exception ex)
     {
         Console.WriteLine(key);
         LogHelper.GetLogger <C22>().Error(ex.Message);
         LogHelper.GetLogger <C22>().Error(ex.StackTrace);
         return(0);
     }
 }
Exemplo n.º 3
0
        private void ReadSampleConfig()
        {
            string sql   = "Select * from SampleConfig";
            var    table = dbOp.TryExecuteDataTable(sql, null);

            if (table != null)
            {
                NCFData.GetData().Configs.Clear();
                foreach (DataRow row in table.Rows)
                {
                    SampleConfig sample = new SampleConfig();
                    Parameters   paras  = new Parameters(Convert.ToString(row["ParameterNames"]), '\t');

                    sample.SC_ID      = Convert.ToInt32(row["SC_ID"]);
                    sample.SampleName = Convert.ToString(row["SampleName"]);

                    sample.SampleName         = Convert.ToString(row["SampleName"]);
                    sample.Unlimited          = Convert.ToBoolean(row["Unlimited"]);
                    sample.EventsLimits       = Convert.ToUInt32(row["EventsLimits"]);
                    sample.TimeLimits         = Convert.ToUInt16(row["TimeLimits"]);
                    sample.VolumeLimits       = Convert.ToUInt16(row["VolumeLimits"]);
                    sample.GateLimits         = table.Columns.Contains("GateLimits") ? Convert.ToString(row["GateLimits"]) : string.Empty;
                    sample.FlowRateLevel      = (FlowRateLevel)Convert.ToByte(row["FlowRateLevel"]);
                    sample.CustomFlowRate     = Convert.ToUInt16(row["CustomFlowRate"]);
                    sample.PrimaryChannel     = (SByte)Convert.ToByte(row["PrimaryChannel"]);
                    sample.PrimaryThreshold   = Convert.ToInt32(row["PrimaryThreshold"]);
                    sample.SecondaryChannel   = (SByte)Convert.ToByte(row["SecondaryChannel"]);
                    sample.SecondaryThreshold = Math.Max(Convert.ToInt32(row["SecondaryThreshold"]), 10);
                    sample.StorageGate        = table.Columns.Contains("StorageGate") ? Convert.ToString(row["StorageGate"]) : string.Empty;

                    if (paras.Count > 0)
                    {
                        sample.Parameters = paras;
                    }

                    ReadSampleDataData(sample, sample.SC_ID);
                    NCFData.GetData().Configs.Add(sample);
                }
            }
        }