Example #1
0
        unsafe collar_detector_rec MakeAFake(collar_detector_rec src, string det, string mat)
        {
            collar_detector_rec m = new collar_detector_rec();
            byte[] b = new byte[INCC.MAX_DETECTOR_ID_LENGTH];
            char[] a = det.ToCharArray(0, Math.Min(det.Length, INCC.MAX_DETECTOR_ID_LENGTH));
            Encoding.ASCII.GetBytes(a, 0, a.Length, b, 0);
            TransferUtils.Copy(b, m.collar_detector_id);
            b = new byte[INCC.MAX_ITEM_TYPE_LENGTH];
            a = mat.ToCharArray(0, Math.Min(mat.Length, INCC.MAX_ITEM_TYPE_LENGTH));
            Encoding.ASCII.GetBytes(a, 0, a.Length, b, 0);
            TransferUtils.Copy(b, m.collar_detector_item_type);
            //m.collar_detector_mode = (byte)(imr.collar_det.collar_mode ? 1 : 0);

            b = new byte[INCC.DATE_TIME_LENGTH];
            a = @"89.10.17".ToCharArray();
            Encoding.ASCII.GetBytes(a, 0, a.Length, b, 0);
            TransferUtils.Copy(b, m.col_reference_date);
            m.col_relative_doubles_rate = 1.0;
            return m;
        }
Example #2
0
            internal static unsafe collar_detector_rec MoveCD(INCCSelector se, INCCAnalysisParams.INCCMethodDescriptor md)
            {
                INCCAnalysisParams.collar_combined_rec imr = (INCCAnalysisParams.collar_combined_rec)md;
                collar_detector_rec m = new collar_detector_rec();
                byte[] b = new byte[INCC.MAX_DETECTOR_ID_LENGTH];
                char[] a = se.detectorid.ToCharArray(0, Math.Min(se.detectorid.Length, INCC.MAX_DETECTOR_ID_LENGTH));
                Encoding.ASCII.GetBytes(a, 0, a.Length, b, 0);
                TransferUtils.Copy(b, m.collar_detector_id);
                b = new byte[INCC.MAX_ITEM_TYPE_LENGTH];
                a = se.material.ToCharArray(0, Math.Min(se.material.Length, INCC.MAX_ITEM_TYPE_LENGTH));
                Encoding.ASCII.GetBytes(a, 0, a.Length, b, 0);
                TransferUtils.Copy(b, m.collar_detector_item_type);
                m.collar_detector_mode = (byte)(imr.collar_det.collar_mode ? 1 : 0);

                b = new byte[INCC.DATE_TIME_LENGTH];
                a = imr.collar_det.reference_date.ToString("yy.MM.dd").ToCharArray();
                Encoding.ASCII.GetBytes(a, 0, a.Length, b, 0);
                TransferUtils.Copy(b, m.col_reference_date);
                m.col_relative_doubles_rate = imr.collar_det.relative_doubles_rate;
                return m;
            }
Example #3
0
 unsafe void CollarDet(INCCAnalysisParams.collar_combined_rec combined, collar_detector_rec collar_detector, ushort bonk)
 {
     combined.collar_det = new INCCAnalysisParams.collar_detector_rec();
     combined.collar_det.collar_mode = (collar_detector.collar_detector_mode == 0 ? false : true);
     combined.collar_det.reference_date = INCC.DateFrom(TransferUtils.str(collar_detector.col_reference_date, INCC.DATE_TIME_LENGTH));
     combined.collar_det.relative_doubles_rate = collar_detector.col_relative_doubles_rate;
     mlogger.TraceEvent(LogLevels.Verbose, 34212, " -- Collar det has mode {0} {1}",  combined.collar_det.collar_mode, bonk);
 }