Example #1
0
        /// <summary>
        /// Populate the list of available files to download.
        /// </summary>
        private void OnPopulateDownloadList()
        {
            // If the ADCP is pinging, make it stop
            _adcpConn.StopPinging();

            // The D command will cancel any pending downloads
            // Send it twice to first ignore the last packet sent, then
            // stop the download process
            _adcpConn.SendData(string.Format("{0}", RTI.Commands.AdcpCommands.CMD_DS_CANCEL));
            _adcpConn.SendData(string.Format("{0}", RTI.Commands.AdcpCommands.CMD_DS_CANCEL));

            // Send command to the ADCP to give a list of all the files
            RTI.Commands.AdcpDirListing dirListing = _adcpConn.GetDirectoryListing();

            // Populate the list with all the files found
            Application.Current.Dispatcher.BeginInvoke(new System.Action(() => PopulateDownloadList(dirListing)));
        }
Example #2
0
        /// <summary>
        /// Check the memory card for its usage.
        /// This will set how full the memory card is
        /// and how much is required for the deployment.
        /// </summary>
        /// <returns>TRUE = Status was good.</returns>
        private void CheckMemoryCard()
        {
            IsLoading = true;

            // Get the memory usasge
            RTI.Commands.AdcpDirListing listing = _adcpConnection.GetDirectoryListing();

            // Set the total memory card usage
            if (_pm.IsProjectSelected && _pm.SelectedProject.Configuration != null)
            {
                _pm.SelectedProject.Configuration.DeploymentOptions.InternalMemoryCardUsed      = (long)Math.Round(listing.UsedSpace * MathHelper.MB_TO_BYTES);
                _pm.SelectedProject.Configuration.DeploymentOptions.InternalMemoryCardTotalSize = (long)Math.Round(listing.TotalSpace * MathHelper.MB_TO_BYTES);

                // Save the values
                _pm.SelectedProject.Save();
            }

            // Memory card
            AdcpInternalStorageSize = MathHelper.MemorySizeString((long)Math.Round(listing.TotalSpace * MathHelper.MB_TO_BYTES));
            AdcpInternalStorageUsed = MathHelper.MemorySizeString((long)Math.Round(listing.UsedSpace * MathHelper.MB_TO_BYTES));

            IsLoading = false;
        }