Esempio n. 1
0
    void PlayBack()
    {
        // Debug.Log("PlayingBack");
        reInit = true;
        if (indexOfPlaybacks < maxPlaybacks)
        {
            itemsPlayingBack[indexOfPlaybacks].Init(itemsToRecord.Length);

            for (int i = 0; i < itemsToRecord.Length; ++i)
            {
                RecordedData[] tempRecord = new RecordedData[itemsToRecord[i].recordedData.Length];
                tempRecord = (RecordedData[])itemsToRecord[i].recordedData.Clone();
                itemsPlayingBack[indexOfPlaybacks].objs[i] = Instantiate(itemsToRecord[i].target.gameObject);
                itemsPlayingBack[indexOfPlaybacks].objs[i].AddComponent <PlaybackItem>().preRecordedData = tempRecord;
            }
            indexOfPlaybacks++;
        }
        else
        {
            Debug.LogError("You have reached the max playbacks!! .. deleting the first");
            for (int i = 0; i < itemsToRecord.Length; i++)
            {
                Destroy(itemsPlayingBack[0].objs[i]);
            }

            for (int i = 0; i < itemsPlayingBack.Length - 1; i++)
            {
                itemsPlayingBack[i] = itemsPlayingBack[i + 1];
            }
            indexOfPlaybacks--;
            PlayBack();
        }
    }
Esempio n. 2
0
        public override void Update()
        {
            serialCommunicator.SendMessage("ST");
            string data = serialCommunicator.ReadInput();

            data = data.Replace("\r", "");
            string[] dataSplitted = data.Split('\t');

            BikeData bikeData = new BikeData(
                int.Parse(dataSplitted[0]), int.Parse(dataSplitted[1]),
                dataSplitted[2],
                int.Parse(dataSplitted[3]), int.Parse(dataSplitted[4]), int.Parse(dataSplitted[5]),
                dataSplitted[6],
                int.Parse(dataSplitted[7]));

            if (RecordedData.Count == 0)
            {
                RecordedData.Add(bikeData);
            }
            else if (RecordedData.Last().Time != bikeData.Time)
            {
                RecordedData.Add(bikeData);
            }


            client.SendMessage(bikeData);

            SetDataToGUI();
        }
Esempio n. 3
0
    public RecordedData[] TrimRecordedData(RecordedData[] recData)
    {
        if (recData[recData.Length - 1].hasData)
        {
            return(recData);
        }

        var trimmedLength = recData.Length;

        for (int i = 0; i < recData.Length; ++i)
        {
            if (!recData[i].hasData)
            {
                trimmedLength = i;
                break;
            }
        }

        RecordedData[] toReturn = new RecordedData[trimmedLength];

        for (int i = 0; i < toReturn.Length; ++i)
        {
            toReturn[i] = recData[i];
        }

        Debug.LogWarning("Recorded data trimmed to " + trimmedLength);

        return(toReturn);
    }
        public void RecordedData_Constructor()
        {
            RecordedData recData = new RecordedData();

            //NUnit.Framework.Assert.NotNull(recData.UserData);
            Assert.IsNotNull(recData.UserData);
        }
Esempio n. 5
0
        public void SearchByTextKpopCore(string mySearchText)
        {
            if (mySearchText.Trim().Length <= 0)
            {
                ColViewListData.Filter = null;
            }

            string[] SearchArray = mySearchText.Trim().Split(' ');

            int    year    = 0;
            string yearStr = "";

            try
            {
                year    = Convert.ToInt32(mySearchText);
                yearStr = Convert.ToString(year);
            }
            catch (Exception ex)
            {
            }

            ColViewListData.Filter = delegate(object o)
            {
                RecordedData data = o as RecordedData;

                if (data.ProgramName.IndexOf("K-POPの") >= 0)
                {
                    if (mySearchText.Length > 0)
                    {
                        if (year > 0)
                        {
                            if (year == data.OnAirDate.Year)
                            {
                                return(true);
                            }

                            if (data.Detail.IndexOf(yearStr) >= 0)
                            {
                                return(true);
                            }
                        }
                        else
                        {
                            if (data.Detail.IndexOf(mySearchText) >= 0)
                            {
                                return(true);
                            }
                        }
                    }
                    else
                    {
                        return(true);
                    }
                }

                return(false);
            };
            ColViewListData.SortDescriptions.Clear();
            ColViewListData.SortDescriptions.Add(new SortDescription("OnAirDate", ListSortDirection.Ascending));
        }
Esempio n. 6
0
        public MainWindow()
        {
            InitializeComponent();
            this.Title = "Coinbase Cryptocurrency Recorder";

            // initialize variables
            theFileManager = new FileManager();
            theSettings    = theFileManager.LoadSettings();

            // initialize pages
            theSettingsPage = new SettingsPage();
            theHomePage     = new HomePage();

            _mainFrame.Navigate(theHomePage);

            theClient       = new Client(theSettings.Cryptocurrencies);
            theRecordedData = new RecordedData();

            updateTimer          = new DispatcherTimer();
            updateTimer.Interval = TimeSpan.FromSeconds(theSettings.UpdateInterval);
            updateTimer.Tick    += UpdateTimerTicked;
            updateTimer.Start();

            saveTimer          = new DispatcherTimer();
            saveTimer.Interval = TimeSpan.FromSeconds(theSettings.SaveInterval);
            saveTimer.Tick    += SaveTimerTicked;
            saveTimer.Start();
        }
Esempio n. 7
0
        public void Record(int frame)
        {
            if (frame >= recordedData.Length)
            {
                Debug.LogWarning("Attempting to record data beyond max frames limit.");
                return;
            }

            recordedData[frame] = new RecordedData(target, -1);
        }
Esempio n. 8
0
        public void Record(int frame)
        {
            if (frame >= recordedData.Length)
            {
                Debug.LogWarning("Attempting to store data beyond initial size of recording array.");
                return;
            }

            recordedData[frame] = new RecordedData(target, -1);
        }
        public static void UploadRecordedData(RecordedData recordedData)
        {
            string data = JSONWriter.ToJson(recordedData);

            Debug.Log(data);
            Debug.Log($"{PlayTestToolkitSettings.API_DATA_ROUTE}/{recordedData.ConfigId}");
            string message = HttpActions.JsonAction(data, $"{PlayTestToolkitSettings.API_DATA_ROUTE}/{recordedData.ConfigId}");

            Debug.Log(message);
        }
Esempio n. 10
0
        private void SaveTimerTicked(object sender, EventArgs e)
        {
            theRecordedData = theFileManager.LoadRecordedData();

            foreach (CryptocurrencyData price in theHomePage.cryptocurrencyList)
            {
                theRecordedData.updateRecordedData(price);
            }

            theFileManager.SaveRecordedData(theRecordedData);
        }
        public override void Save(RecordedData recordedData)
        {
            string json = captured.ToJson();

            StreamWriter writer = new StreamWriter(outStream);

            writer.WriteLine(json);
            writer.Flush();

            recordedData.Input = captured;

            base.Save(recordedData);
        }
        private IRecordedCodeSequence generateDataItem(
            IRecordedCodeSequence codeSequence,
            ReadOnlyCollection <object> dataCollection,
            RecordedData recordingItem)
        {
            IRecordedCodeSequence result =
                Recorder.RecordDataItem(
                    (new TranscriptCmdletBase()),
                    codeSequence,
                    dataCollection,
                    recordingItem);

            return(result);
        }
Esempio n. 13
0
 private void Start()
 {
     if (record)
     {
         recordedData = new RecordedData();
         recordedData.PlayerWeaponUsageTime = new List <float>();
         recordedData.PlayerPositionsList   = new List <RecordedData.SerializableVector2>();
         StartCoroutine(RecordPlayerMovement());
     }
     else
     {
         LoadRecordedData();
         StartCoroutine(PlaybackPlayerWeaponUsage());
         StartCoroutine(PlaybackPlayerMovement());
     }
 }
Esempio n. 14
0
        public override void ProcessLumped(CatchmentConstituentProvider parentProvider, DateTime now,
                                           double timeStepInSeconds)
        {
            Constituent c =
                RecordedData.List.First(co => co.Constituent.Name == SalinityModel.ConstituentName).Constituent;
            double loadFromSurfaceWater = LoadFromSurfaceWater(c, parentProvider.FunctionalUnitProviders);

            ZeroSurfaceWaterLoad(c, parentProvider.FunctionalUnitProviders);
            SalinityModel.SurfaceWaterSaltExport = loadFromSurfaceWater;
            SalinityModel.RunSaltBalance();
            base.ProcessLumped(parentProvider, now, timeStepInSeconds);

            BaseCatchmentModelConstituentOutput outputs = RecordedData.Get <SubcatchmentSalinityConstituentOutput>(c);

            outputs.LocalSlowflowAdded = SalinityModel.SaltDischarge / UnitConversion.SECONDS_IN_ONE_DAY;
        }
Esempio n. 15
0
    public static RecordedData[] ReadArrayFromTextures(Texture2D posTex, Texture2D rotTex)
    {
        Color[] posArray = posTex.GetPixels();
        Color[] rotArray = rotTex.GetPixels();

        int validDataLength = GetValidDataLength(posArray);

        Debug.Log("PosArray length is " + validDataLength);

        RecordedData[] toReturn = new RecordedData[validDataLength];

        for (int i = 0; i < toReturn.Length; ++i)
        {
            toReturn[i] = new RecordedData(UnpackPositionData(posArray[i], maxDistance), UnPackRotationData(rotArray[i]));
        }

        return(toReturn);
    }
Esempio n. 16
0
    private void LoadRecordedData()
    {
        try
        {
            string path = Path.Combine(Application.persistentDataPath, "Data/bot_for_video.dat");
            if (File.Exists(path))
            {
                FileStream      stream       = new FileStream(path, FileMode.Open, FileAccess.Read);
                BinaryFormatter binFormatter = new BinaryFormatter();

                recordedData = (RecordedData)binFormatter.Deserialize(stream);
                stream.Close();
            }
        }
        catch
        {
            Debug.Log("Can't Load Data");
            return;
        }
    }
Esempio n. 17
0
        public override void Update()
        {
            serialCommunicator.SendMessage("ST");
            string data = serialCommunicator.ReadInput();

            data = data.Replace("\r", "");
            string[] dataSplitted = data.Split('\t');

            BikeData bikeData = new BikeData(
                int.Parse(dataSplitted[0]), int.Parse(dataSplitted[1]),
                dataSplitted[2],
                int.Parse(dataSplitted[3]), int.Parse(dataSplitted[4]), int.Parse(dataSplitted[5]),
                dataSplitted[6],
                int.Parse(dataSplitted[7]));

            if (RecordedData.Count == 0)
            {
                RecordedData.Add(bikeData);
            }
            else if (RecordedData.Last().Time != bikeData.Time)
            {
                RecordedData.Add(bikeData);
            }

            latestData = RecordedData.Last();
            FormAstrand.setAll(latestData.Time.ToString(), latestData.Speed, latestData.Resistance, latestData.Energy, latestData.Power, latestData.Pulse, latestData.Rpm);
            RpmCheck(latestData.Rpm);
            SetDataToGUI();
            AstradAvans();

            client.SendMessage(new
            {
                id   = "update",
                data = new
                {
                    bikeData = bikeData
                }
            });
        }
    public static void AddEntry(float time, RecordedData data)

    {
        //Don't need to check for repeated notes on an eigth next to impossible
        if (m_ShootRecordData.ContainsKey(time))
        {
            if (m_ShootRecordData[time] == null)
            {
                m_ShootRecordData[time] = new List <RecordedData>();
            }
            m_ShootRecordData[time].Add(data);
        }
        else
        {
            m_ShootRecordData[time] = new List <RecordedData>()
            {
                data
            };
        }

        /*    Debug.Log("time: " + time+ " data:" + data.instrument + ", " + data.duration);*/
    }
Esempio n. 19
0
    public void SpawnRecording()
    {
        Debug.Log("PlayingBack");
        //recording = false;


        if (indexOfPlaybacks < maxPlaybacks)
        {
            itemsPlayingBack[indexOfPlaybacks].Init(itemsToRecord.Length);

            for (int i = 0; i < itemsToRecord.Length; ++i)
            {
                RecordedData[] tempRecord = new RecordedData[itemsToRecord[i].recordedData.Length];
                tempRecord = (RecordedData[])itemsToRecord[i].recordedData.Clone();
                itemsPlayingBack[indexOfPlaybacks].objs[i] = Instantiate(itemToSpawn);
                itemsPlayingBack[indexOfPlaybacks].objs[i].AddComponent <PlaybackItem>().preRecordedData = tempRecord;
                itemsPlayingBack[indexOfPlaybacks].objs[i].AddComponent <Guard>().Init(playerDetector);
            }
            indexOfPlaybacks++;
            //reInit = true;
        }
        else
        {
            Debug.LogError("You have reached the max playbacks!! .. deleting the first");
            for (int i = 0; i < itemsToRecord.Length; i++)
            {
                Destroy(itemsPlayingBack[0].objs[i]);
            }

            for (int i = 0; i < itemsPlayingBack.Length - 1; i++)
            {
                itemsPlayingBack[i] = itemsPlayingBack[i + 1];
            }
            indexOfPlaybacks--;
            SpawnRecording();
        }
    }
Esempio n. 20
0
        public void SearchByTextVenus(string mySearchText)
        {
            ColViewListData.Filter = delegate(object o)
            {
                RecordedData data = o as RecordedData;

                if (data.ProgramName.IndexOf("女神降臨") >= 0)
                {
                    if (mySearchText.Length > 0 && data.Detail.IndexOf(mySearchText) >= 0)
                    {
                        return(true);
                    }
                    else
                    if (mySearchText.Length <= 0)
                    {
                        return(true);
                    }
                }

                return(false);
            };
            ColViewListData.SortDescriptions.Clear();
            ColViewListData.SortDescriptions.Add(new SortDescription("OnAirDate", ListSortDirection.Descending));
        }
Esempio n. 21
0
        public void SearchByTextGrachaou(string mySearchText)
        {
            ColViewListData.Filter = delegate(object o)
            {
                RecordedData data = o as RecordedData;

                if (data.ChannelNo == 618 && data.ChannelSeq == 1)
                {
                    if (mySearchText.Length > 0 && data.Detail.IndexOf(mySearchText) >= 0)
                    {
                        return(true);
                    }
                    else
                    if (mySearchText.Length <= 0)
                    {
                        return(true);
                    }
                }

                return(false);
            };
            ColViewListData.SortDescriptions.Clear();
            ColViewListData.SortDescriptions.Add(new SortDescription("OnAirDate", ListSortDirection.Descending));
        }
Esempio n. 22
0
 // Use this for initialization
 void Start()
 {
     dataRecorder = FindObjectOfType <RecordedData>();
     orderedDeck  = new GameObject[52];
     CreateDeck();
 }
Esempio n. 23
0
        public List <RecordedData> GetList(MySqlDbConnection myDbCon)
        {
            List <RecordedData> listData = new List <RecordedData>();

            if (myDbCon == null)
            {
                myDbCon = new MySqlDbConnection();
            }

            string queryString
                = "SELECT r.id "
                  + "    , r.disk_no, r.seq_no, r.rip_status, r.on_air_date "
                  + "    , r.time_flag, r.minute, r.channel_no, r.channel_seq "
                  + "    , p.name, r.detail, r.created_at, r.updated_at "
                  + "  FROM tv.recorded as r LEFT JOIN tv.program as p "
                  + "    ON r.channel_no = p.channel_no and r.channel_seq = p.channel_seq "
                  + "  ORDER BY r.disk_no DESC "
                  + "";

            MySqlDataReader reader = null;

            try
            {
                reader = myDbCon.GetExecuteReader(queryString);

                do
                {
                    if (reader.IsClosed)
                    {
                        //_logger.Debug("reader.IsClosed");
                        throw new Exception("av.storeの取得でreaderがクローズされています");
                    }

                    while (reader.Read())
                    {
                        RecordedData data = new RecordedData();

                        int colIdx = 0;
                        data.Id          = MySqlDbExportCommon.GetDbInt(reader, colIdx++);
                        data.DiskNo      = MySqlDbExportCommon.GetDbString(reader, colIdx++);
                        data.SeqNo       = MySqlDbExportCommon.GetDbString(reader, colIdx++);
                        data.RipStatus   = MySqlDbExportCommon.GetDbString(reader, colIdx++);
                        data.OnAirDate   = MySqlDbExportCommon.GetDbDateTime(reader, colIdx++);
                        data.TimeFlag    = MySqlDbExportCommon.GetDbBool(reader, colIdx++);
                        data.Minute      = MySqlDbExportCommon.GetDbInt(reader, colIdx++);
                        data.ChannelNo   = MySqlDbExportCommon.GetDbInt(reader, colIdx++);
                        data.ChannelSeq  = MySqlDbExportCommon.GetDbInt(reader, colIdx++);
                        data.ProgramName = MySqlDbExportCommon.GetDbString(reader, colIdx++);
                        data.Detail      = MySqlDbExportCommon.GetDbString(reader, colIdx++);
                        data.CreatedAt   = MySqlDbExportCommon.GetDbDateTime(reader, colIdx++);
                        data.UpdatedAt   = MySqlDbExportCommon.GetDbDateTime(reader, colIdx++);

                        listData.Add(data);
                    }
                } while (reader.NextResult());
            }
            catch (Exception ex)
            {
                Debug.Write(ex);
            }
            finally
            {
                reader.Close();
            }

            reader.Close();

            myDbCon.closeConnection();

            return(listData);
        }
        private static void testCollections(
            System.Collections.Generic.List <IRecordedCodeSequence> expectedCollection,
            System.Collections.Generic.List <IRecordedCodeSequence> realCollection)
        {
            for (int iRecordings = 0; iRecordings < expectedCollection.Count; iRecordings++)
            {
                var expectedSequence = expectedCollection[iRecordings];
                var realSequence     = realCollection[iRecordings];

                if (((null != expectedSequence) && (null == realSequence)) ||
                    ((null == expectedSequence) && (null != realSequence)))
                {
                    Assert.Fail(
                        "Elements of the recording collections don't match at " +
                        iRecordings.ToString() +
                        "th code sequence.");
                }

                if ((null == expectedSequence) && (null == realSequence))
                {
                    continue;
                }

                if ((null != expectedSequence) && (null != realSequence))
                {
                    if (expectedSequence.GetType().Name != realSequence.GetType().Name)
                    {
                        Assert.Fail(
                            "Elements of the recording collections of not the same type at " +
                            iRecordings.ToString() +
                            "th code sequence.");
                    }

                    for (int iElements = 0; iElements < expectedSequence.Items.Count; iElements++)
                    {
                        var expectedItem = expectedSequence.Items[iElements];
                        var realItem     = realSequence.Items[iElements];

                        if ((null != expectedItem) && (null == realItem) ||
                            ((null == expectedItem) && (null != realItem)))
                        {
                            Assert.Fail(
                                "Items of the code sequences are not equal. " +
                                "Collections at " +
                                iRecordings.ToString() +
                                "th code sequence, items at " +
                                iElements.ToString() +
                                "th position");
                        }

                        if ((null == expectedItem) && (null == realItem))
                        {
                            continue;
                        }

                        if ((null != expectedItem) && (null != realItem))
                        {
                            RecordedWebElement expectedWebElement = expectedItem as RecordedWebElement;
                            RecordedWebElement realWebElement     = realItem as RecordedWebElement;

                            RecordedAction expectedAction = expectedItem as RecordedAction;
                            RecordedAction realAction     = realItem as RecordedAction;

                            RecordedData expectedData = expectedItem as RecordedData;
                            RecordedData realData     = realItem as RecordedData;


                            if ((null != expectedWebElement) || (null != realWebElement))
                            {
                                if ((null != expectedWebElement) && (null == realWebElement) ||
                                    (null == expectedWebElement) && (null != realWebElement))
                                {
                                    Assert.Fail(
                                        "Items of different types. " +
                                        "Collections at " +
                                        iRecordings.ToString() +
                                        "th code sequence, items at " +
                                        iElements.ToString() +
                                        "th position");
                                }

                                if ((null == expectedWebElement) && (null == realWebElement))
                                {
                                    // choose another type to compare
                                }
                                else
                                {
                                    // compare two RecordedWebElements

                                    //RecordedWebElement expectedElement = (expectedCollection[iRecordings].Items[iElements] as RecordedWebElement);
                                    //RecordedWebElement realElement = (realCollection[iRecordings].Items[iElements] as RecordedWebElement);

                                    foreach (string keyWeb in expectedWebElement.UserData.Keys)
                                    {
                                        //for (int iWebKeys = 0; iWebKeys < expectedWebElement.UserData.Count; iWebKeys++) {

                                        //object webValueExpected = expectedWebElement.UserData[expectedWebElement.UserData.Keys[iWebKeys]];
                                        //object webValueReal = realWebElement.UserData[realWebElement.UserData.Keys[iWebKeys]];

                                        object webValueExpected = expectedWebElement.UserData[keyWeb];
                                        object webValueReal     = realWebElement.UserData[keyWeb];

                                        if (webValueExpected != webValueReal)
                                        {
                                            Assert.Fail(
                                                "Items with diferent values. " +
                                                "Collections at " +
                                                iRecordings.ToString() +
                                                "th code sequence, items at " +
                                                iElements.ToString() +
                                                "th position, key is " +
                                                keyWeb);
                                        }
                                    }
                                }
                            }
                            else if ((null != expectedAction) || (null != realAction))
                            {
                                if ((null != expectedAction) && (null == realAction) ||
                                    (null == expectedAction) && (null != realAction))
                                {
                                    Assert.Fail(
                                        "Items of different types. " +
                                        "Collections at " +
                                        iRecordings.ToString() +
                                        "th code sequence, items at " +
                                        iElements.ToString() +
                                        "th position");
                                }

                                if ((null == expectedAction) && (null == realAction))
                                {
                                    // choose another type to compare
                                }
                                else
                                {
                                    // compare two RecordedActions

                                    foreach (string keyAction in expectedAction.UserData.Keys)
                                    {
                                        object actValueExpected = expectedAction.UserData[keyAction];
                                        object actValueReal     = realAction.UserData[keyAction];

                                        if (actValueExpected != actValueReal)
                                        {
                                            Assert.Fail(
                                                "Items with diferent values. " +
                                                "Collections at " +
                                                iRecordings.ToString() +
                                                "th code sequence, items at " +
                                                iElements.ToString() +
                                                "th position, key is " +
                                                keyAction);
                                        }
                                    }
                                }
                            }
                            else if ((null != expectedData) || (null != realData))
                            {
                                if ((null != expectedData) && (null == expectedData) ||
                                    (null == expectedData) && (null != realData))
                                {
                                    Assert.Fail(
                                        "Items of different types. " +
                                        "Collections at " +
                                        iRecordings.ToString() +
                                        "th code sequence, items at " +
                                        iElements.ToString() +
                                        "th position");
                                }

                                if ((null == expectedData) && (null == realData))
                                {
                                    // choose another type to compare
                                }
                                else
                                {
                                    // compare two RscordedDatas

                                    foreach (string keyData in expectedData.UserData.Keys)
                                    {
                                        object dataValueExpected = expectedData.UserData[keyData];
                                        object dataValueReal     = realData.UserData[keyData];

                                        if (dataValueExpected != dataValueReal)
                                        {
                                            Assert.Fail(
                                                "Items with diferent values. " +
                                                "Collections at " +
                                                iRecordings.ToString() +
                                                "th code sequence, items at " +
                                                iElements.ToString() +
                                                "th position, key is " +
                                                keyData);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Esempio n. 25
0
 protected void LateUpdate()
 {
     RecordedData.LateUpdate();
 }
Esempio n. 26
0
 public void StopRecording()
 {
     RecordedData.StopRecording();
 }
Esempio n. 27
0
 public void StartRecording(bool overridePreviousRecording = true)
 {
     RecordedData.StartRecording(overridePreviousRecording, this.gameObject);
 }
Esempio n. 28
0
 public RA GetRecordedActionAt(float time, TimeType timeType)
 {
     return(RecordedData.GetRecordedActionAt(time, timeType));
 }
Esempio n. 29
0
 public void ApplyRecordedAction(RA action)
 {
     RecordedData.ApplyRecordedAction(action);
 }
Esempio n. 30
0
 public override void Reset()
 {
     serialCommunicator.SendMessage("RS");
     RecordedData.Clear();
 }