public MainWindow() { InitializeComponent(); boneManager = new BoneManager(); servoManager = new ServoManager(); serialPortManager = new SerialPortManager(); motionManager = new MotionManager(ref serialPortManager); }
/*internal*/ public MotionManager(ref SerialPortManager sp) { //コンストラクタで必要そうなもの //とりあえず最初は止まってるでしょう currentStatus = MotionStatus.STOP; oldStatus = MotionStatus.STOP; nextStatus = MotionStatus.STOP; wiiBBFrameCount = 0; changeFlag = false; finishFlag = true; //sp.Open(); //Debug.WriteLine("spmyport={0}", sp.MyPort.IsOpen); spm = sp; frameCount = 0; positionID = 0; weight = 0; wm = new Wiimote(); //Wiimoteの接続 this.wm.Connect(); //イベント関数の登録 this.wm.WiimoteChanged += wm_WiimoteChanged; }