// $Header: https://oberon.oapd.inaf.it/shins/trunk/shins/src/tiptilt_ctrl/bcu/Interface/Sharknir/Bcu/PropertyName.h 3649 2021-05-21 10:19:02Z depa $
#pragma once

#include <string>

namespace Sharknir { namespace Bcu {

// XXX 2012-02-28 Keep these names in sync with the ones from Bcu.basda and
//     in the UI file!
class PropertyName
{
public:
    static std::string doubleType(const std::string& propertyName)
    {
        return propertyName + ".AS_DOUBLE";
    }

    static std::string bcuFpgaTemperatureInC()
    {
        return "BCU_FPGA_TEMPERATURE_IN_C";
    }

    static std::string bcuPcbTemperatureInC()
    {
        return "BCU_PCB_TEMPERATURE_IN_C";
    }

    // static std::string dsp16do0FpgaTemperatureInC()
    // {
    //     return "DSP16DO_0_FPGA_TEMPERATURE_IN_C";
    // }

    // static std::string dsp16do0PcbTemperatureInC()
    // {
    //     return "DSP16DO_0_PCB_TEMPERATURE_IN_C";
    // }

    // static std::string dsp16do1FpgaTemperatureInC()
    // {
    //     return "DSP16DO_1_FPGA_TEMPERATURE_IN_C";
    // }

    // static std::string dsp16do1PcbTemperatureInC()
    // {
    //     return "DSP16DO_1_PCB_TEMPERATURE_IN_C";
    // }

    // // static std::string hvc0FpgaTemperatureInC()
    // {
    //     return "HVC_0_FPGA_TEMPERATURE_IN_C";
    // }

    // static std::string hvc0PcbTemperatureInC()
    // {
    //     return "HVC_0_PCB_TEMPERATURE_IN_C";
    // }

    // static std::string hvc1FpgaTemperatureInC()
    // {
    //     return "HVC_1_FPGA_TEMPERATURE_IN_C";
    // }

    // static std::string hvc1PcbTemperatureInC()
    // {
    //     return "HVC_1_PCB_TEMPERATURE_IN_C";
    // }

    static std::string latestImage()
    {
        return "LATEST_CCD_IMAGE";
    }

    static std::string name()
    {
        return "NAME";
    }

    static std::string numOfExternallyReadDspDWords()
    {
        return "DETAIL.NUM_OF_EXTERNALLY_READ_DSP_DWORDS";
    }

    static std::string numOfExternallyReadSdramDWords()
    {
        return "DETAIL.NUM_OF_EXTERNALLY_READ_SDRAM_DWORDS";
    }

    static std::string numOfExternallyReadSramDWords()
    {
        return "DETAIL.NUM_OF_EXTERNALLY_READ_SRAM_DWORDS";
    }

  static std::string numOfExternallyReadShmramDWords()
  {
    return "DETAIL.NUM_OF_EXTERNALLY_READ_SHMRAM_DWORDS";
  }

    static std::string numOfExternallyWrittenDspDWords()
    {
        return "DETAIL.NUM_OF_EXTERNALLY_WRITTEN_DSP_DWORDS";
    }

    static std::string numOfExternallyWrittenResetDevicesDWords()
    {
        return "DETAIL.NUM_OF_EXTERNALLY_WRITTEN_RESET_DEVICES_DWORDS";
    }

    static std::string numOfExternallyWrittenSdramDWords()
    {
        return "DETAIL.NUM_OF_EXTERNALLY_WRITTEN_SDRAM_DWORDS";
    }

    static std::string numOfExternallyWrittenSramDWords()
    {
        return "DETAIL.NUM_OF_EXTERNALLY_WRITTEN_SRAM_DWORDS";
    }

  static std::string numOfExternallyWrittenShmramDWords()
  {
    return "DETAIL.NUM_OF_EXTERNALLY_WRITTEN_SHMRAM_DWORDS";
  }


    static std::string pbsBlockSelection()
    {
        return currentSlopeParamSelector("BLOCK_SELECTION");
    }

    static std::string pbsEnableAcc()
    {
        return currentSlopeParamSelector("ENABLE_ACC");
    }

    static std::string pbsEnableAlternateRtrMode()
    {
        return currentSlopeParamSelector("ENABLE_ALTERNATE_RTR_MODE");
    }

    static std::string pbsEnableBcuSdram()
    {
        return currentSlopeParamSelector("ENABLE_BCU_SDRAM");
    }

    static std::string pbsEnableDspSdram()
    {
        return currentSlopeParamSelector("ENABLE_DSP_SDRAM");
    }

    static std::string pbsEnableFastLink()
    {
        return currentSlopeParamSelector("ENABLE_FAST_LINK");
    }

    // static std::string pbsEnableHvc()
    // {
    //     return currentSlopeParamSelector("ENABLE_HVC");
    // }

    static std::string pbsEnableMcf()
    {
        return currentSlopeParamSelector("ENABLE_MCF");
    }

    static std::string pbsEnableOvsDisturbance()
    {
        return currentSlopeParamSelector("ENABLE_OVS_DISTURBANCE");
    }

    static std::string pbsEnableWfsDisturbance()
    {
        return currentSlopeParamSelector("ENABLE_WFS_DISTURBANCE");
    }

    static std::string pollingIntervalInMillisecond()
    {
        return configuration("POLLING_INTERVAL_IN_MILLISECONDS");
    }

    static std::string diagnosticsDestinationHostName()
    {
        return configuration("DIAGNOSTICS.DESTINATION_IP");
    }

    static std::string diagnosticsDestinationUdpPort()
    {
        return configuration("DIAGNOSTICS.DESTINATION_UDP_PORT");
    }

    // static std::string asmDiagnosticsReceiptionUdpPort()
    // {
    //     return configuration("DIAGNOSTICS.ASM.DESTINATION_UDP_PORT");
    // }

    // static std::string asmRecordReceptionCounter()
    // {
    //     return diagnostics("ASM.RECORD_RECEPTION_COUNTER");
    // }

    // static std::string asmRecordDuplicateReceptionCounter()
    // {
    //     return diagnostics("ASM.RECORD_DUPLICATE_RECEPTION_COUNTER");
    // }

    static std::string ccdRecordDuplicateReceptionCounter()
    {
        return diagnostics("CCD.RECORD_DUPLICATE_RECEPTION_COUNTER");
    }

    static std::string currentDiagnosticsSlopeFrameCounter()
    {
        return diagnostics("SLOPE.CURRENT.FRAME_COUNTER");
    }

    static std::string currentDiagnosticsSlopeParamSelector()
    {
        return currentSlopeParamSelectorWord();
    }

    static std::string ccdRecordReceptionCounter()
    {
        return diagnostics("CCD.RECORD_RECEPTION_COUNTER");
    }

    static std::string frameRateHz()
    {
        return diagnostics("FRAME_RATE_HZ");
    }

    static std::string highestReceivedFrameCounter()
    {
        return diagnostics("HIGHEST_RECEIVED_FRAME_COUNTER");
    }

    static std::string lateAsmRecordCounter()
    {
        return diagnostics("ASM.LATE_RECORD_COUNTER");
    }

    static std::string lateCcdRecordCounter()
    {
        return diagnostics("CCD.LATE_RECORD_COUNTER");
    }

    static std::string lateSlopeRecordCounter()
    {
        return diagnostics("SLOPE.LATE_RECORD_COUNTER");
    }

    static std::string slopeRecordReceptionCounter()
    {
        return diagnostics("SLOPE.RECORD_RECEPTION_COUNTER");
    }

    static std::string slopeRecordDuplicateReceptionCounter()
    {
        return diagnostics("SLOPE.RECORD_DUPLICATE_RECEPTION_COUNTER");
    }

    static std::string reachable()
    {
        return "REACHABLE";
    }

    static std::string currentFlaoFrameCounter()
    {
        return "SLOPE.CURRENT_FLAO_FRAME_COUNTER";
    }

    static std::string currentNaFrameCounter()
    {
        return "SLOPE.CURRENT_NA_FRAME_COUNTER";
    }

    static std::string currentTipTiltFrameCounter()
    {
        return "SLOPE.TIP_TILT.CURRENT_FRAME_COUNTER";
    }

    static std::string tipTiltReceivingRateHz()
    {
        return "SLOPE.TIP_TILT.RECEIVING_RATE_HZ";
    }

  static std::string numOfDMInterfaceAccess()
  {
    return "DETAIL.NUM_OF_DM_INTERFACE_ACCESS";
  }

    struct Simulator
    {
        static std::string externalOperationFailureRequested()
        {
            return "SIM.EXTERNAL_OPERATION_FAILURES_REQUESTED";
        }

        static std::string bcuFpgaSetTemperature()
        {
            return "SIM.SET_TEMPERATURE_BCU_FPGA_IN_C";
        }

        static std::string failureRequested()
        {
        	return "SIM.FAKE_DEVICE.FAILURE_REQUESTED";
        }

        static std::string zeroBeamsOnCcdRequested()
        {
        	return "SIM.ZERO_BEAMS_ON_CCD_REQUESTED";
        }
    };

private:
    static std::string configuration(const std::string& remainingPath)
    {
        return std::string("CFG.") + remainingPath;
    }

    static std::string diagnostics(const std::string& remainingPath)
    {
        return std::string("DIAGNOSTICS.") + remainingPath;
    }

    static std::string currentSlopeParamSelectorWord()
    {
        return diagnostics("SLOPE.CURRENT.PARAM_SELECTOR");
    }

    static std::string currentSlopeParamSelector(
            const std::string& remainingPath)
    {
        return currentSlopeParamSelectorWord() + "." + remainingPath;
    }
};

}
}

