Example #1
0
        public static string PrettifyModePage_1D(ModePage_1D?modePage)
        {
            if (!modePage.HasValue)
            {
                return(null);
            }

            ModePage_1D page = modePage.Value;
            var         sb   = new StringBuilder();

            sb.AppendLine("SCSI Medium Configuration Mode Page:");

            if (page.PS)
            {
                sb.AppendLine("\tParameters can be saved");
            }

            if (page.WORMM)
            {
                sb.AppendLine("\tDrive is operating in WORM mode");
            }

            switch (page.WormModeLabelRestrictions)
            {
            case 0:
                sb.AppendLine("\tDrive does not allow any logical blocks to be overwritten");

                break;

            case 1:
                sb.AppendLine("\tDrive allows a tape header to be overwritten");

                break;

            case 2:
                sb.AppendLine("\tDrive allows all format labels to be overwritten");

                break;

            default:
                sb.AppendFormat("\tUnknown WORM mode label restrictions code {0}", page.WormModeLabelRestrictions).
                AppendLine();

                break;
            }

            switch (page.WormModeFilemarkRestrictions)
            {
            case 2:
                sb.AppendLine("\tDrive allows any number of filemarks immediately preceding EOD to be overwritten except filemark closes to BOP");

                break;

            case 3:
                sb.AppendLine("\tDrive allows any number of filemarks immediately preceding EOD to be overwritten");

                break;

            default:
                sb.AppendFormat("\tUnknown WORM mode filemark restrictions code {0}",
                                page.WormModeLabelRestrictions).AppendLine();

                break;
            }

            return(sb.ToString());
        }