Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "segui_base.h"
- ///////////////////////////////////////////////////////////////////////////////
- // ---> GUI_user_panel.GuiModule.h
- ///////////////////////////////////////////////////////////////////////////////
- class GUI_user_panel : public SEGUI_base {
- public:
- GUI_user_panel(seGuiCallback seaudioMaster, void *p_resvd1);
- ~GUI_user_panel(void);
- void Initialise(bool loaded_from_file);
- bool OnIdle(void);
- void OnModuleMsg(int p_user_msg_id,int p_length, void * p_data);
- void Init();
- private:
- virtual void OnGuiPinValueChange(SeGuiPin *p_pin);
- int count;
- int *p_count;
- int z;
- char str[2];
- int myval_1;
- int myval_2;
- int myval_3;
- int myval_4;
- int myval_5;
- int myval_6;
- int myval_7;
- int myval_8;
- };
- ///////////////////////////////////////////////////////////////////////////////
- // ---> GUI_user_panel.GuiModule.cpp
- ///////////////////////////////////////////////////////////////////////////////
- #include "guimodule.h"
- //#include <string>
- //#include <cstdlib>
- //#include <time.h>
- //#include <assert.h>
- GUI_user_panel::GUI_user_panel(seGuiCallback seaudioMaster, void *p_resvd1) : SEGUI_base(seaudioMaster, p_resvd1)
- {
- }
- GUI_user_panel::~GUI_user_panel(void)
- {
- CallHost(seGuiHostSetIdle, 0 ); // cancel OnIdle events
- }
- void GUI_user_panel::OnModuleMsg(int p_user_msg_id,int p_length, void * p_data)
- {
- }
- bool GUI_user_panel::OnIdle(void)
- {
- return true;
- }
- void GUI_user_panel::Initialise(bool loaded_from_file)
- {
- CallHost(seGuiHostSetIdle, 0 );
- SEGUI_base::Initialise(loaded_from_file);
- if(loaded_from_file == true){
- };
- count=0;
- z=0;
- }
- void GUI_user_panel::Init()
- {
- }
- void GUI_user_panel::OnGuiPinValueChange(SeGuiPin *p_pin)
- {
- //read pins input
- myval_1=getPin(0)->getValueInt(); //
- myval_2=getPin(1)->getValueInt(); //
- myval_3=getPin(2)->getValueInt(); //
- myval_4=getPin(3)->getValueInt(); //
- myval_5=getPin(4)->getValueInt(); //
- myval_6=getPin(5)->getValueInt(); //
- myval_7=getPin(6)->getValueInt(); //
- myval_8=getPin(7)->getValueInt(); //
- //inputs are "true"?
- if ( myval_1 == 1 || myval_2 == 1 || myval_3 == 1 || myval_4 == 1 ||
- myval_5 == 1 || myval_6 == 1 || myval_7 == 1 || myval_8 == 1 )
- {
- //getPin(8)->setValueInt(count);
- if (count>1){count=0;}
- else count++;// fuehrt zum absturz (count=1; wuerde klappen)
- }
- getPin(8)->setValueInt(count); //ausgabe an pin
- //sprintf(str,"%d%d",z,last_z);
- //str[0]=
- //str[1]='x';
- //str[2]='\0';
- //getPin(9)->setValueText(str);
- };
Add Comment
Please, Sign In to add comment