void AnimationAttributes::SetFromNode(DataNode *parentNode) { if(parentNode == 0) return; DataNode *searchNode = parentNode->GetNode("AnimationAttributes"); if(searchNode == 0) return; DataNode *node; if((node = searchNode->GetNode("animationMode")) != 0) { // Allow enums to be int or string in the config file if(node->GetNodeType() == INT_NODE) { int ival = node->AsInt(); if(ival >= 0 && ival < 3) SetAnimationMode(AnimationMode(ival)); } else if(node->GetNodeType() == STRING_NODE) { AnimationMode value; if(AnimationMode_FromString(node->AsString(), value)) SetAnimationMode(value); } } if((node = searchNode->GetNode("pipelineCachingMode")) != 0) SetPipelineCachingMode(node->AsBool()); if((node = searchNode->GetNode("frameIncrement")) != 0) SetFrameIncrement(node->AsInt()); if((node = searchNode->GetNode("timeout")) != 0) SetTimeout(node->AsInt()); if((node = searchNode->GetNode("playbackMode")) != 0) { // Allow enums to be int or string in the config file if(node->GetNodeType() == INT_NODE) { int ival = node->AsInt(); if(ival >= 0 && ival < 3) SetPlaybackMode(PlaybackMode(ival)); } else if(node->GetNodeType() == STRING_NODE) { PlaybackMode value; if(PlaybackMode_FromString(node->AsString(), value)) SetPlaybackMode(value); } } }
//7segの4文字を表示 void* DispDataThread(void* param) { ////スレッドをjoin or detachしないとメモリリークが発生する ////終了状態がわからない状態でよければdetach 必要なら呼び出しもとでjoin //if( pthread_detach( pthread_self() ) != 0) // ;//error InitShiftRegister(); SetPriority(HIGH_PRIO); //シグナル処理にした同じ秒数なのにらちらつきがひどかったのでこちらはなし do{ if( g_outputMode < MODE_ANI_0 ) { //モードに応じたデータを表示用にデータに入れる DispModeData(g_outputMode); //Send7Seg(g_dispData[digit++], DIGIT_SWITCH); Dips7segData(); } else { AnimationMode(g_outputMode); } //スレッドの状態を0に変更されたら終了 if( g_threadStatus == 0 ) break; }while( 1 ); SetPriority(NOMAL_PRIO); UnInitShiftRegister(); g_threadStatus = 0; pthread_exit(NULL); return; }
AnimationAttributes::AnimationMode AnimationAttributes::GetAnimationMode() const { return AnimationMode(animationMode); }