Exemplo n.º 1
0
 // 現在の脳活性度を取得
 public double calcActivenessFromBuffered()
 {
     return(m_nfb.calcActivenessFromBuffered());
 }
Exemplo n.º 2
0
    /**
     * ゲイン調整済みデータ受信時の動作
     */
    private void receiveData(BrainDataFeedbacker nfb, Hot2gEnumerations.EnumHot2gMeasResult e, object data, DataLogger logger)
    {
        switch (e)
        {
        /*XB-01*/
        case Hot2gEnumerations.EnumHot2gMeasResult.Ac1ch:
            //Debug.Log("Ac1ch:" + LitJson.JsonMapper.ToJson(data));

            //- check afterGainCounter
            checkAfterGainCounter();


            if (Hot2gApplication.Instance.datastore.stability.Count > 1)
            {
                Debug.Log("Ac1chRec: [ " + Hot2gApplication.Instance.mode.ToString() +
                          " ]/[ " + Hot2gApplication.Instance.datastore.stability[Hot2gApplication.Instance.datastore.stability.Count - 1] +
                          " ]/[: " + Hot2gApplication.Instance.state2.ToString() +
                          " ]/[G1: " + Hot2gApplication.Instance.m_gc.getL1Gain() + "][G3: " + Hot2gApplication.Instance.m_gc.getL3Gain() +
                          " ]/[Raw 1: " + Hot2gApplication.Instance.datastore.l1Ac[Hot2gApplication.Instance.datastore.l1Ac.Count - 1] +
                          " ]/[Raw 3: " + Hot2gApplication.Instance.datastore.l3Ac[Hot2gApplication.Instance.datastore.l3Ac.Count - 1] +
                          " ]/ after MGC: " + Hot2gApplication.Instance.afterMGC_counter.ToString()
                          );
            }

            Xb01data xbData = this.dataStore.add(data as Hot2gMeasData1chAc, nfb.calcActivenessFromBuffered());

            state2 = updateStatusOnHead(); //- check XB-01 On head status

            nfb.bufferActiveness();        //- calc Brain activation level


            if (logger != null)
            {
                logger.write(xbData.ConvCSV());
            }

            break;

#if false
        case Hot2gEnumerations.EnumHot2gMeasResult.Ac2ch:
        {
            when(Hot2gDevInfo().valDevType)
            {
                /* HOT-2000 */
                Hot2gEnumerations.EnumHot2gDevType.HOT2000->{
                    val hot2Data = this.dataStore.add(data as Hot2gMeasData2chAc)
                                   logger?.write(hot2Data)
                }
                /* HOT-1000 */
                Hot2gEnumerations.EnumHot2gDevType.HOT1000->{
                    val hot1data = this.dataStore.add(data as Hot2gMeasData2chAc)
                                   logger?.write(hot1data)
                }
            }
#endif
        /* 心拍数 */
        case Hot2gEnumerations.EnumHot2gMeasResult.HeartRate:
            this.dataStore.add(data as Hot2gMeasDataHR);
            break;

        /* 脈波振幅関連係数 */
        case Hot2gEnumerations.EnumHot2gMeasResult.HRElement1:
            this.dataStore.add(data as Hot2gMeasDataHRElement);
            break;

        /* 姿勢変化のチェック */
        case Hot2gEnumerations.EnumHot2gMeasResult.MotionBatt:
            GyroScope.Stability s_pre = this.dataStore.stability[this.dataStore.stability.Count - 1];
            GyroScope.Stability s     = this.dataStore.add(data as Hot2gMeasDataMotBatt);
            break;
        }
    }