// Copyright 2024 The Pigweed Authors
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.

#define PW_LOG_MODULE_NAME "STATE"
#define PW_LOG_LEVEL PW_LOG_LEVEL_INFO

#include "modules/state_manager/state_manager.h"

#include <chrono>
#include <cmath>
#include <variant>

#include "pw_assert/check.h"
#include "pw_chrono/system_clock.h"
#include "pw_log/log.h"
#include "pw_string/format.h"
#include "pw_thread/sleep.h"

namespace sense {

template <typename T>
static void AddAndSmoothExponentially(std::optional<T>& aggregate,
                                      T next_value) {
  static constexpr T kDecayFactor = T(4);
  if (!aggregate.has_value()) {
    aggregate = next_value;
  } else {
    *aggregate += (next_value - *aggregate) / kDecayFactor;
  }
}

StateManager::StateManager(PubSub& pubsub, PolychromeLed& led)
    : edge_detector_(0, 0), pubsub_(pubsub), led_(led), state_(*this) {
  SetAlarmThreshold(alarm_threshold_);
  PW_CHECK(pubsub_.Subscribe([this](Event event) { Update(event); }));
}

void StateManager::Update(Event event) {
  switch (static_cast<EventType>(event.index())) {
    case kButtonA:
      if (std::get<ButtonA>(event).pressed()) {
        state_.get().ButtonAPressed();
      }
      break;
    case kButtonB:
      if (std::get<ButtonB>(event).pressed()) {
        state_.get().ButtonBPressed();
      }
      break;
    case kButtonX:
      if (std::get<ButtonX>(event).pressed()) {
        state_.get().ButtonXPressed();
      }
      break;
    case kButtonY:
      if (std::get<ButtonY>(event).pressed()) {
        state_.get().ButtonYPressed();
      }
      break;
    case kTimerExpired:
      state_.get().OnTimerExpired(std::get<TimerExpired>(event));
      break;
    case kMorseCodeValue:
      state_.get().OnMorseCodeValue(std::get<MorseCodeValue>(event));
      break;
    case kAmbientLightSample:
      led_.UpdateBrightnessFromAmbientLight(
          std::get<AmbientLightSample>(event).sample_lux);
      break;
    case kStateManagerControl:
      HandleControlEvent(std::get<StateManagerControl>(event));
      break;
    case kAirQuality:
      UpdateAirQuality(std::get<AirQuality>(event).score);
      break;
    case kTimerRequest:
    case kMorseEncodeRequest:
    case kProximitySample:
    case kProximityStateChange:
    case kSenseState:
      break;  // ignore these events
  }
}

void StateManager::DisplayThreshold() {
  led_.SetColor(AirSensor::GetLedValue(alarm_threshold_));
  PW_CHECK(pubsub_.Publish(TimerRequest{
      .token = kThresholdModeToken,
      .timeout_s = kThresholdModeTimeout,
  }));
}

void StateManager::IncrementThreshold() {
  if (alarm_threshold_ < kMaxThreshold) {
    SetAlarmThreshold(alarm_threshold_ + kThresholdIncrement);
  }
  DisplayThreshold();
}

void StateManager::DecrementThreshold() {
  if (alarm_threshold_ > 0) {
    SetAlarmThreshold(alarm_threshold_ - kThresholdIncrement);
  }
  DisplayThreshold();
}

void StateManager::SetAlarmThreshold(uint16_t alarm_threshold) {
  alarm_ = false;  // Reset the alarm whenever the threshold changes.

  alarm_threshold_ = alarm_threshold;
  auto silence_threshold =
      static_cast<uint16_t>(alarm_threshold_ + kThresholdIncrement);

  // Set the thresholds and reset the edge detector to a good air quality state.
  edge_detector_.set_low_and_high_thresholds(alarm_threshold_,
                                             silence_threshold);
  std::ignore = edge_detector_.Update(AirSensor::kMaxScore);

  PW_LOG_INFO("Air quality thresholds set: alarm at %u, silence at %u",
              alarm_threshold_,
              silence_threshold);

  BroadcastState();
}

void StateManager::UpdateAirQuality(uint16_t score) {
  AddAndSmoothExponentially(air_quality_, score);
  state_.get().OnLedValue(AirSensor::GetLedValue(*air_quality_));
  if (alarm_silenced_) {
    BroadcastState();
    return;
  }
  switch (edge_detector_.Update(*air_quality_)) {
    case Edge::kFalling:
      alarm_ = true;
      break;
    case Edge::kRising:
      alarm_ = false;
      break;
    case Edge::kNone:
      BroadcastState();
      return;
  }
  ResetMode();
  BroadcastState();
}

void StateManager::RepeatAlarm() {
  PW_CHECK(pubsub_.Publish(TimerRequest{
      .token = kRepeatAlarmToken,
      .timeout_s = kRepeatAlarmTimeout,
  }));
}

void StateManager::SilenceAlarms() {
  alarm_ = false;
  alarm_silenced_ = true;
  std::ignore = edge_detector_.Update(AirSensor::kMaxScore);
  PW_CHECK(pubsub_.Publish(TimerRequest{
      .token = kSilenceAlarmToken,
      .timeout_s = kSilenceAlarmTimeout,
  }));
  ResetMode();
  BroadcastState();
}

void StateManager::ResetMode() {
  if (alarm_) {
    SetState<AlarmMode>();
  } else {
    SetState<MonitorMode>();
  }
}

void StateManager::StartMorseReadout(std::string_view msg) {
  if (!pubsub_.Publish(MorseEncodeRequest{.message = msg, .repeat = 1u})) {
    ResetMode();
  }
}

const char* StateManager::AirQualityDescription(uint16_t score) {
  if (score > AirSensor::kMaxScore) {
    return "INVALID";
  }
  if (score < static_cast<uint16_t>(AirSensor::Score::kOrange)) {
    return "TERRIBLE";
  }
  if (score < static_cast<uint16_t>(AirSensor::Score::kYellow)) {
    return "BAD";
  }
  if (score < static_cast<uint16_t>(AirSensor::Score::kLightGreen)) {
    return "MEDIOCRE";
  }
  if (score < static_cast<uint16_t>(AirSensor::Score::kGreen)) {
    return "OKAY";
  }
  if (score < static_cast<uint16_t>(AirSensor::Score::kBlueGreen)) {
    return "GOOD";
  }
  if (score < static_cast<uint16_t>(AirSensor::Score::kCyan)) {
    return "VERY GOOD";
  }
  if (score < static_cast<uint16_t>(AirSensor::Score::kLightBlue)) {
    return "EXCELLENT";
  }
  return "SUPERB";
}

void StateManager::FormatAirQuality(MorseCodeString& msg) {
  uint16_t score = air_quality();
  pw::Status status = pw::string::FormatOverwrite(
      msg, "AQ %s %hu", AirQualityDescription(score), score);
  PW_LOG_INFO("%s", msg.data());
  PW_CHECK_OK(status);
}

AmbientLightAdjustedLed::AmbientLightAdjustedLed(PolychromeLed& led)
    : led_(led) {
  led_.SetColor(0);
  led_.SetBrightness(kDefaultBrightness);
  led_.Enable();
  led_.TurnOn();
}

void AmbientLightAdjustedLed::UpdateBrightnessFromAmbientLight(
    float ambient_light_sample_lux) {
  AddAndSmoothExponentially(ambient_light_lux_, ambient_light_sample_lux);

  static constexpr float kMinLux = 40.f;
  static constexpr float kMaxLux = 3000.f;
  if (!ambient_light_lux_.has_value()) {
    return;
  }
  uint8_t brightness;
  if (*ambient_light_lux_ < kMinLux) {
    brightness = kMinBrightness;
  } else if (*ambient_light_lux_ > kMaxLux) {
    brightness = kMaxBrightness;
  } else {
    constexpr float kBrightnessRange = kMaxBrightness - kMinBrightness;
    brightness = static_cast<uint8_t>(
        std::lround((*ambient_light_lux_ - kMinLux) / (kMaxLux - kMinLux) *
                    kBrightnessRange) +
        kMinBrightness);
  }

  PW_LOG_DEBUG("Ambient light: mean_lux=%.1f, brightness=%hhu",
               *ambient_light_lux_,
               brightness);
  led_.SetBrightness(brightness);
}

void StateManager::LogStateChange(const char* old_state) const {
  PW_LOG_INFO("StateManager: %s -> %s", old_state, state_.get().name());
}

void StateManager::BroadcastState() const {
  std::ignore = pubsub_.Publish(SenseState{
      .alarm = alarm_,
      .alarm_threshold = alarm_threshold_,
      .air_quality = air_quality(),
      .air_quality_description = AirQualityDescription(air_quality()),
  });
}

void StateManager::HandleControlEvent(StateManagerControl& event) {
  switch (event.action) {
    case StateManagerControl::kIncrementThreshold:
      IncrementThreshold();
      break;
    case StateManagerControl::kDecrementThreshold:
      DecrementThreshold();
      break;
    case StateManagerControl::kSilenceAlarms:
      SilenceAlarms();
      break;
  }
}

}  // namespace sense
