def SaveToFile(self, filename):
     ''' Save object's parameters in specific order.
     '''
     listOfData = [
         self.pos[0], self.pos[1], self.rot, self.posOfBarrier[0],
         self.posOfBarrier[1]
     ]
     FilesManager.AddLineToFile(
         BuiltInTypesConverter.IntsToString(listOfData), filename)
Exemplo n.º 2
0
    def SaveToFile(self, filename):
        ''' Save object's parameters in specific order
        '''

        # Save data about car exclusively
        with open(filename, "a") as file:
            listOfData = [self.pos[0], self.pos[1], self.rot]
            file.write(BuiltInTypesConverter.IntsToString(listOfData) + "\n")

        # Save data about radar
        self.radarRecord.SaveToFile(filename)
 def test_1(self):
     list0 = [100, 23.03, 435, 0, -4, -3.999]
     self.assertEqual(BuiltInTypesConverter.IntsToString(list0),
                      "100 23 435 0 -4 -3 ")