コード例 #1
0
ファイル: Laser.cs プロジェクト: bmegli/ev3dev-mapping-ui
	public void HandleSnapshotRequest(LaserThreadSharedData unity_data)
	{
		if (snapshots_left == 0 && unity_data.snapshot_request)
		{
			snapshots_left = unity_data.snapshots_left; 
			snapshot_request = true;
			unity_data.snapshot_request=false;
		}

		unity_data.snapshots_left = snapshots_left;		
	}
コード例 #2
0
ファイル: Laser.cs プロジェクト: bmegli/ev3dev-mapping-ui
	public void CopyNewDataFrom(LaserThreadSharedData thr_data)
	{
		// Copy only the data that changed since last call
		from = thr_data.from;
		length = thr_data.length;
		averagedPacketTimeMs = thr_data.averagedPacketTimeMs;
		laserRPM = thr_data.laserRPM;
		crcFailurePercentage = thr_data.crcFailurePercentage;
		invalidPercentage = thr_data.invalidPercentage;

		for (int i = from; i < from + length; ++i)
		{
			int ind = i % readings.Length;
			readings[ind] = thr_data.readings[ind];
			invalid_data[ind] = thr_data.invalid_data[ind];
		}
	}