Created
May 25, 2017 15:00
-
-
Save AndrewBarba/2b21440a9607180f33b470d6e759dc31 to your computer and use it in GitHub Desktop.
Convert Epson printer device name to series enum
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func printerSeries(for name: String) -> Int32 { | |
switch name.uppercased() { | |
case "TM-M10": | |
return EPOS2_TM_M10.rawValue | |
case "TM-M30": | |
return EPOS2_TM_M30.rawValue | |
case "TM-P20": | |
return EPOS2_TM_P20.rawValue | |
case "TM-P60": | |
return EPOS2_TM_P60.rawValue | |
case "TM-P60II": | |
return EPOS2_TM_P60II.rawValue | |
case "TM-P80": | |
return EPOS2_TM_P80.rawValue | |
case "TM-T20", "TM-T20II", "TM-T20II-M", "TM-T20II-I": | |
return EPOS2_TM_T20.rawValue | |
case "TM-T60": | |
return EPOS2_TM_T60.rawValue | |
case "TM-T70", "TM-T70II", "TM-T70-I", "TM-T70II-DT": | |
return EPOS2_TM_T70.rawValue | |
case "TM-T81", "TM-T81II": | |
return EPOS2_TM_T81.rawValue | |
case "TM-T82", "TM-T82II", "TM-T82II-I": | |
return EPOS2_TM_T82.rawValue | |
case "TM-T83", "TM-T83II-I": | |
return EPOS2_TM_T83.rawValue | |
case "TM-T88", "TM-T88V", "TM-T88IV", "TM-T88V-I", "TM-T88V-DT": | |
return EPOS2_TM_T88.rawValue | |
case "TM-T90", "TM-T90II": | |
return EPOS2_TM_T90.rawValue | |
case "TM-T90KP": | |
return EPOS2_TM_T90KP.rawValue | |
case "TM-U220", "TM-U220-I": | |
return EPOS2_TM_U220.rawValue | |
case "TM-U330": | |
return EPOS2_TM_U330.rawValue | |
case "TM-L90": | |
return EPOS2_TM_L90.rawValue | |
case "TM-H6000", "TM-H6000IV-DT": | |
return EPOS2_TM_H6000.rawValue | |
default: | |
return EPOS2_TM_M10.rawValue | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment