//
// © 2018-2020 Qualcomm Technologies, Inc. and/or its subsidiaries. All rights reserved.
//

import UIKit

class SettingsSignalStrengthTableViewCell: UITableViewCell {

	static let reuseIdentifier = "SettingsSignalStrengthTableViewCell"
    let numberOfSignalLevelIcons: UInt = 4
	
	@IBOutlet weak var titleLabel: UILabel?
	@IBOutlet weak private var signalImageView: UIImageView?
	
	var signalStrength: UInt = 0 {
		didSet {
            var normalisedValue = signalStrength
            if signalStrength >= numberOfSignalLevelIcons {
				normalisedValue = UInt(numberOfSignalLevelIcons - 1)
            }
			let name = "ic-signal-strength-level\(normalisedValue)"
			signalImageView?.image = UIImage(named:name)
		}
	}
	
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
