Пример #1
0
        public static string GetDeviceInfoAsString(SirenOfShameInfo deviceInfo)
        {
            StringBuilder info = new StringBuilder();

            info.AppendLine("FirmwareVersion: " + deviceInfo.FirmwareVersion + "\n");
            info.AppendLine("HardwareType: " + deviceInfo.HardwareType + "\n");
            info.AppendLine("HardwareVersion: " + deviceInfo.HardwareVersion + "\n");
            info.AppendLine("AudioMode: " + deviceInfo.AudioMode + "\n");
            info.AppendLine("AudioPlayDuration: " + deviceInfo.AudioPlayDuration + "\n");
            info.AppendLine("LedMode: " + deviceInfo.LedMode + "\n");
            info.AppendLine("LedPlayDuration: " + deviceInfo.LedPlayDuration + "\n");
            info.AppendLine("External Memory Size: " + SiUnitHelpers.ToBinaryString(deviceInfo.ExternalMemorySize) + "B\n");
            return(info.ToString());
        }
Пример #2
0
        public override string ToString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine(this.GetType().Name + ":");
            stringBuilder.AppendLine("\tFirmwareVersion: " + this.FirmwareVersion);
            stringBuilder.AppendLine("\tHardwareType: " + this.HardwareType);
            stringBuilder.AppendLine("\tHardwareVersion: " + this.HardwareVersion);
            stringBuilder.AppendLine("\tAudioMode: " + this.AudioMode);
            stringBuilder.AppendLine("\tAudioPlayDuration: " + this.AudioPlayDuration);
            stringBuilder.AppendLine("\tLedMode: " + this.LedMode);
            stringBuilder.AppendLine("\tLedPlayDuration: " + this.LedPlayDuration);
            stringBuilder.AppendLine("\tExternal Memory Size: " + SiUnitHelpers.ToBinaryString(this.ExternalMemorySize) + "B");
            return(stringBuilder.ToString());
        }
        private void RefreshDeviceInfo()
        {
            if (_sirenOfShameDevice == null)
            {
                _deviceInfo.Text = "Not Connected";
                return;
            }

            var deviceInfo = _sirenOfShameDevice.ReadDeviceInfo();

            StringBuilder deviceInfoText = new StringBuilder();

            deviceInfoText.AppendLine("FirmwareVersion: " + deviceInfo.FirmwareVersion + "\n");
            deviceInfoText.AppendLine("HardwareType: " + deviceInfo.HardwareType + "\n");
            deviceInfoText.AppendLine("HardwareVersion: " + deviceInfo.HardwareVersion + "\n");
            deviceInfoText.AppendLine("AudioMode: " + deviceInfo.AudioMode + "\n");
            deviceInfoText.AppendLine("AudioPlayDuration: " + deviceInfo.AudioPlayDuration + "\n");
            deviceInfoText.AppendLine("LedMode: " + deviceInfo.LedMode + "\n");
            deviceInfoText.AppendLine("LedPlayDuration: " + deviceInfo.LedPlayDuration + "\n");
            deviceInfoText.AppendLine("External Memory Size: " + SiUnitHelpers.ToBinaryString(deviceInfo.ExternalMemorySize) + "B\n");
            _deviceInfo.Text = deviceInfoText.ToString();
        }