| 1 | /*************************************************************************** |
| 2 | boatpositionlog.cpp - description |
| 3 | ------------------- |
| 4 | begin : Sat Mar 16 2002 |
| 5 | copyright : (C) 2002 by Michael Bridak |
| 6 | email : [email protected] |
| 7 | $Id: boatpositionlog.cpp,v 1.2 2003/04/14 05:51:03 mbridak Exp $ |
| 8 | ***************************************************************************/ |
| 9 | |
| 10 | /*************************************************************************** |
| 11 | * * |
| 12 | * This program is free software; you can redistribute it and/or modify * |
| 13 | * it under the terms of the GNU General Public License as published by * |
| 14 | * the Free Software Foundation; either version 2 of the License. * |
| 15 | * . * |
| 16 | * * |
| 17 | ***************************************************************************/ |
| 18 | |
| 19 | |
| 20 | #include "SDL/SDL.h" |
| 21 | #include "boatpositionlog.h"cxx . . $ `<file>/src/boatpositionlog.h`/ |
| 22 | |
| 23 | BoatPositionLogcxx . . $ BoatPositionLog#::BoatPositionLogcxx . . $ BoatPositionLog#BoatPositionLog(49f6e7a06ebc5aa8).(){ |
| 24 | sizecxx . . $ BoatPositionLog#size. = 0; |
| 25 | positioncxx . . $ BoatPositionLog#position# temp; |
| 26 | temp.latcxx . . $ BoatPositionLog#position#lat.=0; |
| 27 | temp.loncxx . . $ BoatPositionLog#position#lon.=0; |
| 28 | temp.bearingcxx . . $ BoatPositionLog#position#bearing. = 0.0; |
| 29 | temp.tickcxx . . $ BoatPositionLog#position#tick. = 0; |
| 30 | for(int x=0; x<10; x++){ |
| 31 | storagecxx . . $ BoatPositionLog#storage.[x]=cxx . . $ BoatPositionLog#position#`operator=`(6105d4d3ca3acce4).temp; |
| 32 | } |
| 33 | } |
| 34 | BoatPositionLogcxx . . $ BoatPositionLog#::~cxx . . $ BoatPositionLog#`~BoatPositionLog`(ced63f7c635d850d).BoatPositionLogcxx . . $ BoatPositionLog#(){ |
| 35 | } |
| 36 | /** Recpord the position of the boat. takes a type of |
| 37 | struct { |
| 38 | float lat; |
| 39 | float lon; |
| 40 | double bearing |
| 41 | }; */ |
| 42 | void BoatPositionLogcxx . . $ BoatPositionLog#::RecBoatPoscxx . . $ BoatPositionLog#RecBoatPos(6882ec15dc2018f0).(positioncxx . . $ BoatPositionLog#position# temp){ |
| 43 | if (sizecxx . . $ BoatPositionLog#size. > 9){ |
| 44 | PopRecordcxx . . $ BoatPositionLog#PopRecord(49f6e7a06ebc5aa8).(); |
| 45 | } |
| 46 | sizecxx . . $ BoatPositionLog#size. ++; |
| 47 | storagecxx . . $ BoatPositionLog#storage.[sizecxx . . $ BoatPositionLog#size.-1] =cxx . . $ BoatPositionLog#position#`operator=`(6105d4d3ca3acce4). temp; |
| 48 | } |
| 49 | /** Remove the oldest record off stack. */ |
| 50 | void BoatPositionLogcxx . . $ BoatPositionLog#::PopRecordcxx . . $ BoatPositionLog#PopRecord(49f6e7a06ebc5aa8).(){ |
| 51 | for(int x = 0; x < sizecxx . . $ BoatPositionLog#size.; x++){ |
| 52 | storagecxx . . $ BoatPositionLog#storage.[x] =cxx . . $ BoatPositionLog#position#`operator=`(6105d4d3ca3acce4). storagecxx . . $ BoatPositionLog#storage.[x+1]; |
| 53 | } |
| 54 | sizecxx . . $ BoatPositionLog#size. --; |
| 55 | } |
| 56 | /** returns a log item */ |
| 57 | void BoatPositionLogcxx . . $ BoatPositionLog#::GetLogItemcxx . . $ BoatPositionLog#GetLogItem(d3e18dab127d8b08).(int item, positioncxx . . $ BoatPositionLog#position# &loc){ |
| 58 | loc =cxx . . $ BoatPositionLog#position#`operator=`(6105d4d3ca3acce4). storagecxx . . $ BoatPositionLog#storage.[item]; |
| 59 | } |