Ejemplo n.º 1
0
        virtual public void UpdateMonData()
        {
            mondata_old.Copy(mondata);
            mondata = new CMonData(signLen);

            ReadIO();

            if (g_jifenQueue.Count >= g_jifennum)
            {
                g_jifenQueue.RemoveAt(0);
            }
            g_jifenQueue.Add(mondata.GetSignals(Shared.SignalType.GAN));

            if (x_jifenQueue.Count >= x_jifennum)
            {
                x_jifenQueue.RemoveAt(0);
            }
            x_jifenQueue.Add(mondata.GetSignals(Shared.SignalType.XIAN));
            CSignals gsign = JiFen(g_jifenQueue.ToArray(), g_jifennum, Shared.SignalType.GAN, ganlen);
            CSignals xsign = JiFen(x_jifenQueue.ToArray(), x_jifennum, Shared.SignalType.XIAN, xianlen);

            mondata.SetSignals(Shared.SignalType.GAN, gsign);
            mondata.SetSignals(Shared.SignalType.XIAN, xsign);

            mondata_cur.Copy(mondata);
        }
Ejemplo n.º 2
0
 public CMonData(SignLength signLen)
 {
     GAN_LENGTH  = signLen.GAN_LENGTH;
     XIAN_LENGTH = signLen.XIAN_LENGTH;
     CHE_LENGTH  = signLen.CHE_LENGTH;
     Gan         = new CSignals(SignalType.GAN, RAW_LENGTH);
     Xian        = new CSignals(SignalType.XIAN, RAW_LENGTH);
     Che         = new CSignals(SignalType.CHE, RAW_LENGTH);
 }
Ejemplo n.º 3
0
        protected CSignals JiFen(CSignals[] datas, int jfNum, Shared.SignalType type, uint signLen)
        {
            CSignals data = new CSignals(type, CMonData.RAW_LENGTH);

            for (int i = 0; i < Math.Min(jfNum, datas.Length); i++)
            {
                for (int j = 0; j < data.Length; j++)
                {
                    data[j] = (sbyte)(data[j] | datas[i][j]);
                }
            }
            return(data);
        }
Ejemplo n.º 4
0
        public void SetSignals(SignalType type, CSignals src)
        {
            switch (type)
            {
            case SignalType.GAN:
                Gan = src;
                break;

            case SignalType.XIAN:
                Xian = src;
                break;

            case SignalType.CHE:
                Che = src;
                break;

            default:
                break;
            }
        }