<commit_before>//
//  ConfigViewController.swift
//  KaleidoTab
//
//  Created by <NAME> on 3/22/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit

class ConfigViewController: UIViewController {
    
    @IBOutlet var rectangleCountLabel: UILabel!
    @IBOutlet var speedLabel: UILabel!
    @IBOutlet var minDimensionLabel: UILabel!
    @IBOutlet var minDimensionStepper: UIStepper!
    @IBOutlet var maxDimensionLabel: UILabel!
    @IBOutlet var maxDimensionStepper: UIStepper!
    
    var kaleidoViewContoller : KaleidoViewController?
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        kaleidoViewContoller = tabBarController?.viewControllers?[0] as? KaleidoViewController
    }
    
    override var prefersStatusBarHidden: Bool {
        return true
    }
    
    @IBAction func updateRectangleCount(_ sender: UISlider) {
        let newCount = Int(sender.value)*4
        
        let kaleidoView = kaleidoViewContoller?.view as! KaleidoView
        
        rectangleCountLabel.text = "(" + String(newCount) + ")"
        kaleidoView.viewCount = newCount
        kaleidoView.removeSubviews()
    }
    
    @IBAction func updateSpeed(_ sender: UISlider) {
        let newDelay = TimeInterval(sender.value)
        
        let kaleidoView = kaleidoViewContoller?.view as! KaleidoView
        
        speedLabel.text = "(" + String(newDelay) + ")"
        kaleidoView.delay = newDelay
        kaleidoView.stopDrawing()
        kaleidoView.startDrawing()
    }
    
    @IBAction func updateMinDimension(_ sender: UIStepper) {
        let newMin = CGFloat(sender.value)
        
        let kaleidoView = kaleidoViewContoller?.view as! KaleidoView
        
        minDimensionLabel.text = "(" + String(Int(newMin)) + ")"
        maxDimensionStepper.minimumValue = Double(newMin)
        kaleidoView.rectMinDimension = newMin
    }<commit_msg>add rounding to speed label and inverted to make sense<commit_after>//
//  ConfigViewController.swift
//  KaleidoTab
//
//  Created by <NAME> on 3/22/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit

class ConfigViewController: UIViewController {
    
    @IBOutlet var rectangleCountLabel: UILabel!
    @IBOutlet var speedLabel: UILabel!
    @IBOutlet var minDimensionLabel: UILabel!
    @IBOutlet var minDimensionStepper: UIStepper!
    @IBOutlet var maxDimensionLabel: UILabel!
    @IBOutlet var maxDimensionStepper: UIStepper!
    
    var kaleidoViewContoller : KaleidoViewController?
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        kaleidoViewContoller = tabBarController?.viewControllers?[0] as? KaleidoViewController
    }
    
    override var prefersStatusBarHidden: Bool {
        return true
    }
    
    @IBAction func updateRectangleCount(_ sender: UISlider) {
        let newCount = Int(sender.value)*4
        
        let kaleidoView = kaleidoViewContoller?.view as! KaleidoView
        
        rectangleCountLabel.text = "(" + String(newCount) + ")"
        kaleidoView.viewCount = newCount
        kaleidoView.removeSubviews()
    }
    
    @IBAction func updateSpeed(_ sender: UISlider) {
        let displayValue = (sender.value*100).rounded()/100
        let newDelay = TimeInterval(1-sender.value)
        
        let kaleidoView = kaleidoViewContoller?.view as! KaleidoView
        
        speedLabel.text = "(" + String(displayValue) + ")"
        kaleidoView.delay = newDelay
        kaleidoView.stopDrawing()
        kaleidoView.startDrawing()
    }
    
    @IBAction func updateMinDimension(_ sender: UIStepper) {
        let newMin = CGFloat(sender.value)
        
        let kaleidoView = kaleidoViewContoller?.view as! KaleidoView
        
        minDimensionLabel.text = "(" + String(Int(newMin)) + ")"
        maxDimensionStepper.minimumValue = Double(newMin)
        kaleidoView.rectMinDimension = newMin
    }
{'fraction_non_alphanumeric': 0.08786717752234993, 'fraction_numerical': 0.007407407407407408, 'mean_word_length': 2.6598130841121495, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6647141', 'n_tokens_mistral': 1240, 'n_tokens_neox': 1213, 'n_words': 246}