tarou yamada / ShootingSystem

Dependencies:   AmmoPusher AmmoSupplier Shooter

Dependents:   OBROT_ALL

Revision:
1:3b0b583eba77
Parent:
0:987c53b6a212
Child:
2:4972946a6dfc
--- a/ShootingSystemDoc.txt	Fri Aug 21 04:52:50 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-MD
-(I2CServo)ShooterAngleManager	 	: 発射角度変更機構	: ポテメ 					: I2CServo
-(I2CServo)ShooterPositionManager	: 発射機構上下機構	: ポテメ					: I2CServo
-AmmoPusher			 				: 押出機構			: 2入力スイッチ			: DigitalIn * 2, I2CMotor * 1
-AmmoSupplier	 					: 補給機構			: 2モータ, レーザーON/OFF	: DigitalIn, InterruptIn, I2CMotor * 2
-
-リレーMD
-Shooter 							: 発射機構			: 出力3つ					: *I2C ( LPC1114側のプログラム : RelayYMotorDriver )
-
-About Shooter{
-	LPC1114{
-		DigitalOut( dp11, dp13, dp14 );
-	}
-}
-
-
-全統一制御ShootingSystem
-interface:
-	void update( Command command ){
-		if ( command.getIsShootable() && ( !mIsShooting ) ){
-			mIsShooting = true;
-			mShooterAngleManager->setTargetPosition( command.getAngleOfShooting() );
-			mShooterPositionManager->setTargetPosition( command.getPositionOfShooting() );
-			mAmmoPusher->draw();	// 補給された時に受け取れるように引いておく
-		}
-		
-		// 弾押し出し機構が補給された弾を受け取る位置に来たら補給開始
-		if ( mAmmoPusher->hasPusherFinishedDrawing() ){
-			mAmmoSupplier->supply();
-		}
-		
-		// 射撃作業で
-		//  ・角度調整
-		//  ・位置調整
-		//  ・弾補給
-		//  ・押出機構の準備
-		// が完了したら発射
-		bool canShooterFire = mIsShooting;
-		canShooterFire &= mShooterAngleManager->isStop();
-		canShooterFire &= mShooterPositionManager->isSop();
-		canShooterFire &= mAmmoPusher->hasPusherFinishedDrawing();
-		canShooterFire &= mAmmoSupplier->hasSupplied();
-		if ( canShooterFire ){
-			mShooter->launch();
-			mAmmoPusher->push();
-			
-			if ( mAmmoPresser->hasPresserFinishedPushing() ){
-				mAmmoPresser->draw();
-			}
-		}
-		/*
-			hasWorkFinished系は仕事の受注でフラグリセット、仕事の完了でフラグセット.
-			つまり受注前に使用すると前回の仕事のフラグを返されるため正しく動作しない可能性がある.
-		*/
-	}
-	void update( Command command ){
-		if ( command.getIsShootable() && ( !mIsShooting ) ){
-			mIsShooting 		= true;
-			mShooterAngleManager->setAngle( command.getAngleOfShooting() );
-			mShooterPositionManager->setPosition( command.getPositionOfShooting() );
-			mAmmoPusher->draw();
-		}
-		
-		// 弾押し出し機構が補給された弾を受け取る位置に来たら補給開始
-		if ( mAmmoPusher->hasPusherFinishedDrawing() ){
-			mAmmoSupplier->supply();
-		}
-		
-		// 射撃作業で
-		//  ・角度調整
-		//  ・位置調整
-		//  ・弾補給
-		//  ・押出機構の準備
-		// が完了したら発射
-		bool canShooterFire = mIsShooting;
-		canShooterFire &= mShooterAngleManager->hasWorkFinished();
-		canShooterFire &= mShooterPositionManager->hasWorkFinished();
-		canShooterFire &= mAmmoPusher->hasPusherFinishedDrawing();
-		canShooterFire &= mAmmoSupplier->hasSupplied();
-		if ( canShooterFire ){
-			mShooter->launch();
-			mAmmoPusher->push();
-			
-			if ( mAmmoPresser->hasPresserFinishedPushing() ){
-				mAmmoPresser->draw();
-			}
-		}
-		/*
-			hasWorkFinished系は仕事の受注でフラグリセット、仕事の完了でフラグセット.
-			つまり受注前に使用すると前回の仕事のフラグを返されるため正しく動作しない可能性がある.
-		*/
-	}