aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/TCC/Tango.TCC.Service/TCCServiceConfig.cs
blob: 70c38f58902be02d24e54f5859d52261e7665a17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using Tango.TCC.BL;
using Tango.Web;

namespace Tango.TCC.Service
{
    public class TCCServiceConfig : WebConfig
    {
        public static String JWT_TOKEN_SECRET => ConfigurationManager.AppSettings[nameof(JWT_TOKEN_SECRET)].ToString();

        /// <summary>
        /// Gets the number of card columns.
        /// </summary>
        public static int CARD_COLUMNS => int.Parse(ConfigurationManager.AppSettings[nameof(CARD_COLUMNS)].ToString());

        /// <summary>
        /// Gets the number of card rows.
        /// </summary>
        public static int CARD_ROWS => int.Parse(ConfigurationManager.AppSettings[nameof(CARD_ROWS)].ToString());

        /// <summary>
        /// Gets the card target index (hole).
        /// </summary>
        public static int CARD_TARGET_INDEX => int.Parse(ConfigurationManager.AppSettings[nameof(CARD_TARGET_INDEX)].ToString());

        /// <summary>
        /// Gets the template image base64 string.
        /// </summary>
        public static String TEMPLATE_STRING => ConfigurationManager.AppSettings[nameof(TEMPLATE_STRING)].ToString();

        /// <summary>
        /// Gets the desired width of the sample image.
        /// </summary>
        public static int SAMPLE_WIDTH => int.Parse(ConfigurationManager.AppSettings[nameof(SAMPLE_WIDTH)].ToString());

        /// <summary>
        /// Gets the desired height of the sample image.
        /// </summary>
        public static int SAMPLE_HEIGHT => int.Parse(ConfigurationManager.AppSettings[nameof(SAMPLE_HEIGHT)].ToString());

        /// <summary>
        /// Gets the recommended camera resolution width.
        /// </summary>
        public static int CAMERA_WIDTH => int.Parse(ConfigurationManager.AppSettings[nameof(CAMERA_WIDTH)].ToString());

        /// <summary>
        /// Gets the recommended camera resolution height.
        /// </summary>
        public static int CAMERA_HEIGHT => int.Parse(ConfigurationManager.AppSettings[nameof(CAMERA_HEIGHT)].ToString());

        /// <summary>
        /// Gets the histogram similarity tolerance.
        /// </summary>
        public static double SIMILARITY_TOLERANCE => int.Parse(ConfigurationManager.AppSettings[nameof(SIMILARITY_TOLERANCE)].ToString());

        /// <summary>
        /// Gets the histogram comparison method.
        /// </summary>
        public static CardDetectionHistogramMethods HISTOGRAM_METHOD => (CardDetectionHistogramMethods)Enum.Parse(typeof(CardDetectionHistogramMethods), ConfigurationManager.AppSettings[nameof(HISTOGRAM_METHOD)].ToString());

        /// <summary>
        /// Gets a value indicating whether to perform a double check of the card arucos.
        /// </summary>
        public static bool ENABLE_DOUBLE_CHECKING => bool.Parse(ConfigurationManager.AppSettings[nameof(ENABLE_DOUBLE_CHECKING)].ToString());

        /// <summary>
        /// Gets a value indicating whether the card will be detected only when barcode detection is successful.
        /// </summary>
        public static bool ENFORCE_BARCODE_DETECTION => bool.Parse(ConfigurationManager.AppSettings[nameof(ENFORCE_BARCODE_DETECTION)].ToString());

        /// <summary>
        /// Gets the mobile application ID.
        /// </summary>
        public static String APP_ID => ConfigurationManager.AppSettings[nameof(APP_ID)].ToString();

        /// <summary>
        /// Gets the database catalog.
        /// </summary>
        public static String TANGO_DB_CATALOG => ConfigurationManager.AppSettings[nameof(TANGO_DB_CATALOG)].ToString();

        /// <summary>
        /// Gets the Send Grid API key.
        /// </summary>
        public static String SEND_GRID_API_KEY => ConfigurationManager.AppSettings[nameof(SEND_GRID_API_KEY)].ToString();

        /// <summary>
        /// Gets the TCC source images container.
        /// </summary>
        public static String TCC_SOURCE_CONTAINER => ConfigurationManager.AppSettings[nameof(TCC_SOURCE_CONTAINER)].ToString();

        /// <summary>
        /// Gets the TCC sample images container.
        /// </summary>
        public static String TCC_SAMPLE_CONTAINER => ConfigurationManager.AppSettings[nameof(TCC_SAMPLE_CONTAINER)].ToString();
    }
}
, }; static ::google::protobuf::Message const * const file_default_instances[] = { reinterpret_cast<const ::google::protobuf::Message*>(&_SystemResetResponse_default_instance_), }; namespace { void protobuf_AssignDescriptors() { AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( "SystemResetResponse.proto", schemas, file_default_instances, TableStruct::offsets, factory, file_level_metadata, NULL, NULL); } void protobuf_AssignDescriptorsOnce() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); } void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); } } // namespace void TableStruct::InitDefaultsImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::internal::InitProtobufDefaults(); _SystemResetResponse_default_instance_._instance.DefaultConstruct(); ::google::protobuf::internal::OnShutdownDestroyMessage( &_SystemResetResponse_default_instance_);} void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } namespace { void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { "\n\031SystemResetResponse.proto\022\022Tango.PMR.H" "ardware\"\025\n\023SystemResetResponseB\036\n\034com.tw" "ine.tango.pmr.hardwareb\006proto3" }; ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( descriptor, 110); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "SystemResetResponse.proto", &protobuf_RegisterTypes); } } // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } // Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); } } static_descriptor_initializer; } // namespace protobuf_SystemResetResponse_2eproto // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 SystemResetResponse::SystemResetResponse() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { protobuf_SystemResetResponse_2eproto::InitDefaults(); } SharedCtor(); // @@protoc_insertion_point(constructor:Tango.PMR.Hardware.SystemResetResponse) } SystemResetResponse::SystemResetResponse(const SystemResetResponse& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), _cached_size_(0) { _internal_metadata_.MergeFrom(from._internal_metadata_); // @@protoc_insertion_point(copy_constructor:Tango.PMR.Hardware.SystemResetResponse) } void SystemResetResponse::SharedCtor() { _cached_size_ = 0; } SystemResetResponse::~SystemResetResponse() { // @@protoc_insertion_point(destructor:Tango.PMR.Hardware.SystemResetResponse) SharedDtor(); } void SystemResetResponse::SharedDtor() { } void SystemResetResponse::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* SystemResetResponse::descriptor() { protobuf_SystemResetResponse_2eproto::protobuf_AssignDescriptorsOnce(); return protobuf_SystemResetResponse_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const SystemResetResponse& SystemResetResponse::default_instance() { protobuf_SystemResetResponse_2eproto::InitDefaults(); return *internal_default_instance(); } SystemResetResponse* SystemResetResponse::New(::google::protobuf::Arena* arena) const { SystemResetResponse* n = new SystemResetResponse; if (arena != NULL) { arena->Own(n); } return n; } void SystemResetResponse::Clear() { // @@protoc_insertion_point(message_clear_start:Tango.PMR.Hardware.SystemResetResponse) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; _internal_metadata_.Clear(); } bool SystemResetResponse::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:Tango.PMR.Hardware.SystemResetResponse) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; if (!p.second) goto handle_unusual; handle_unusual: if (tag == 0) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, _internal_metadata_.mutable_unknown_fields())); } success: // @@protoc_insertion_point(parse_success:Tango.PMR.Hardware.SystemResetResponse) return true; failure: // @@protoc_insertion_point(parse_failure:Tango.PMR.Hardware.SystemResetResponse) return false; #undef DO_ } void SystemResetResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:Tango.PMR.Hardware.SystemResetResponse) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); } // @@protoc_insertion_point(serialize_end:Tango.PMR.Hardware.SystemResetResponse) } ::google::protobuf::uint8* SystemResetResponse::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:Tango.PMR.Hardware.SystemResetResponse) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); } // @@protoc_insertion_point(serialize_to_array_end:Tango.PMR.Hardware.SystemResetResponse) return target; } size_t SystemResetResponse::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:Tango.PMR.Hardware.SystemResetResponse) size_t total_size = 0; if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { total_size += ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = cached_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); return total_size; } void SystemResetResponse::MergeFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_merge_from_start:Tango.PMR.Hardware.SystemResetResponse) GOOGLE_DCHECK_NE(&from, this); const SystemResetResponse* source = ::google::protobuf::internal::DynamicCastToGenerated<const SystemResetResponse>( &from); if (source == NULL) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:Tango.PMR.Hardware.SystemResetResponse) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@protoc_insertion_point(generalized_merge_from_cast_success:Tango.PMR.Hardware.SystemResetResponse) MergeFrom(*source); } } void SystemResetResponse::MergeFrom(const SystemResetResponse& from) { // @@protoc_insertion_point(class_specific_merge_from_start:Tango.PMR.Hardware.SystemResetResponse) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; } void SystemResetResponse::CopyFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_copy_from_start:Tango.PMR.Hardware.SystemResetResponse) if (&from == this) return; Clear(); MergeFrom(from); } void SystemResetResponse::CopyFrom(const SystemResetResponse& from) { // @@protoc_insertion_point(class_specific_copy_from_start:Tango.PMR.Hardware.SystemResetResponse) if (&from == this) return; Clear(); MergeFrom(from); } bool SystemResetResponse::IsInitialized() const { return true; } void SystemResetResponse::Swap(SystemResetResponse* other) { if (other == this) return; InternalSwap(other); } void SystemResetResponse::InternalSwap(SystemResetResponse* other) { using std::swap; _internal_metadata_.Swap(&other->_internal_metadata_); swap(_cached_size_, other->_cached_size_); } ::google::protobuf::Metadata SystemResetResponse::GetMetadata() const { protobuf_SystemResetResponse_2eproto::protobuf_AssignDescriptorsOnce(); return protobuf_SystemResetResponse_2eproto::file_level_metadata[kIndexInFileMessages]; } #if PROTOBUF_INLINE_NOT_IN_HEADERS // SystemResetResponse #endif // PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) } // namespace Hardware } // namespace PMR } // namespace Tango // @@protoc_insertion_point(global_scope)