aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.CodeGeneration/Templates/Class.cshtml
blob: 693fe9136ec1a504228adc3b7cab83b97a4e5b49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
    @(Model.GetAttributesString())
    @(Model.GetModifierString()) class @(Model.Name) @(Model.InheritsFrom.Count > 0 ? " : " + String.Join(", ",Model.InheritsFrom) : null)
    {
        @foreach (var prop in Model.Properties)
        {
            <div>@prop.GenerateCode()</div>
        }

        @foreach (var dp in Model.DependencyProperties)
        {
            <div>@dp.GenerateCode()</div>
        }

        @foreach (var method in Model.Methods)
        {
            <div>@method.GenerateCode()</div>
        }
    }
* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#include <cstdlib>
#include <cstdint>
#include <string>
#include "CalibrationInput.pb-c.h"
#include "CalibrationOutput.pb-c.h"
#include "CalibrationMeasurement.pb-c.h"
#include "LinearizationMeasurement.pb-c.h"

#pragma once

namespace Tango
{
	namespace ColorLib
	{
		class ColorCalibrator
		{
		public:
			ColorCalibrator();
			~ColorCalibrator();
			size_t Tango::ColorLib::ColorCalibrator::GetLiquidFactor(uint8_t * input_buffer, size_t input_buffer_size, uint8_t *& output_buffer);
			size_t Tango::ColorLib::ColorCalibrator::GetLinearizationMeasurements(uint8_t * input_buffer, size_t input_buffer_size, uint8_t *& output_buffer);
		protected:
			void InitData(const CalibrationMeasurement** m, 
				const size_t &nsize, const int &inkChannel, const double& targetl, const double& targeta, const double& targetb);
			void MaximalDispensingRate(double &MDispRate, std::string &outputmessage);
			void  dEcmc(double *refX, double *samX, double &dECMC);

			void LinearizationInitData(const LinearizationMeasurement** m, 
				const size_t &nsize, const int &inkChannel, const double& targetl, const double& targeta, const double& targetb);
			void Linearizaton(double *InkVals, double*& LinearInkVal, std::string &error);
			bool SortValues(double *InkVals, double *yVal);
			bool CheckLimits(double *InkVals, int &foundValInd, std::string &error);
			void SmoothCurveData(double *XVal, double *YVal, int FilterWidth);
			bool CheckMonotonicity(double *yVal, std::string &error);
			bool CheckDuplicates(double *InkVals, std::string &error);
			bool Linearize(double *yVal, double*LinearInkVal, int FirstInkInd, int LasInkInd, std::string &error);
			bool Interp1D(double* xx, double *yy, double InValue, int np, double &OutValue, std::string &error);

		protected:
			struct VectorPair
			{
				int m_ID;
				double m_val;
			};
			struct ByDouble : public std::binary_function<VectorPair, VectorPair, bool>
			{
				bool operator()(const VectorPair& lhs, const VectorPair& rhs) const
				{
					return lhs.m_val < rhs.m_val;
				}
			};
		private:
			void ClearData();

		private:
			int m_nsize;
			double *m_nlcm;
			double **m_LabData;
			int m_inkChannel;
			double *m_targetVal;
			int m_CalIndex;

			double *m_inkpercentage;
		};
	}
}