Ejemplo n.º 1
0
    //Public method that allows to add an analog recording
    public void AddAnalog(string name, float timeAnalog, string path)
    {
        if (File.Exists(path))
        {
            BinaryFormatter          bf   = new BinaryFormatter();
            FileStream               file = File.Open(path, FileMode.Open);
            VRPNAnalog.AnalogReports data = (VRPNAnalog.AnalogReports)bf.Deserialize(file);

            file.Close();

            VRPNAnalogRecording recording = new VRPNAnalogRecording(name, timeAnalog, data);

            VRPNAnalogRecordings test;
            if (VRPNAnalogDevice.TryGetValue(data.deviceType + " " + data.deviceName, out test))
            {
                test.recordings.Add(recording);
            }
            else
            {
                test = new VRPNAnalogRecordings();
                test.recordings.Add(recording);
                VRPNAnalogDevice.Add(data.deviceType + " " + data.deviceName, test);
            }
        }
    }
Ejemplo n.º 2
0
    //Method that returns a recordings' enumerator of a given analog device
    public List <VRPNAnalogRecording> .Enumerator GetAnalogRecordingsEnumerator(string name)
    {
        VRPNAnalogRecordings test = new VRPNAnalogRecordings();

        if (VRPNAnalogDevice.TryGetValue(name, out test))
        {
            return(test.recordings.GetEnumerator());
        }
        return(test.recordings.GetEnumerator());
    }
Ejemplo n.º 3
0
    //Public method that allows to add an analog recording
    public void AddAnalog(string name, float timeAnalog, string path)
    {
        if (File.Exists(path))
        {
            BinaryFormatter bf = new BinaryFormatter();
            FileStream file = File.Open(path, FileMode.Open);
            VRPNAnalog.AnalogReports data = (VRPNAnalog.AnalogReports)bf.Deserialize(file);

            file.Close();

            VRPNAnalogRecording recording = new VRPNAnalogRecording(name, timeAnalog, data);

            VRPNAnalogRecordings test;
            if (VRPNAnalogDevice.TryGetValue(data.deviceType + " " + data.deviceName, out test))
            {
                test.recordings.Add(recording);
            }
            else
            {
                test = new VRPNAnalogRecordings();
                test.recordings.Add(recording);
                VRPNAnalogDevice.Add(data.deviceType + " " + data.deviceName, test);
            }
        }
    }
Ejemplo n.º 4
0
 //Method that returns a recordings' enumerator of a given analog device
 public List<VRPNAnalogRecording>.Enumerator GetAnalogRecordingsEnumerator(string name)
 {
     VRPNAnalogRecordings test = new VRPNAnalogRecordings();
     if (VRPNAnalogDevice.TryGetValue(name, out test))
     {
         return test.recordings.GetEnumerator();
     }
     return test.recordings.GetEnumerator();
 }