diff --git a/Kooky/cingredient.cpp b/Kooky/cingredient.cpp index faf0acc..c88aac8 100644 --- a/Kooky/cingredient.cpp +++ b/Kooky/cingredient.cpp @@ -6,178 +6,176 @@ typedef struct tagGROUPNAME { QString szName; QString szGroup; + cIngredient::MEASURE measure; cIngredient::iIngredient iIngredient; } GROUPNAME; static GROUPNAME g_groupname[] = { - { QString::fromUtf8("Bread Units"), QString::fromUtf8("Main Ingredients"), cIngredient::iIngredientBreadUnits }, - { QString::fromUtf8("Calories"), QString::fromUtf8("Main Ingredients"), cIngredient::iIngredientCalories }, - { QString::fromUtf8("Joule"), QString::fromUtf8("Main Ingredients"), cIngredient::iIngredientJoule }, - { QString::fromUtf8("Bread Units"), QString::fromUtf8("Main Ingredients"), cIngredient::iIngredientBreadUnits }, - { QString::fromUtf8("Calories"), QString::fromUtf8("Main Ingredients"), cIngredient::iIngredientCalories }, - { QString::fromUtf8("Protein"), QString::fromUtf8("Main Ingredients"), cIngredient::iIngredientProtein }, - { QString::fromUtf8("Fat"), QString::fromUtf8("Main Ingredients"), cIngredient::iIngredientFat }, - { QString::fromUtf8("Carbohydrates"), QString::fromUtf8("Main Ingredients"), cIngredient::iIngredientCarbohydrates }, - { QString::fromUtf8("Alcohol"), QString::fromUtf8("Main Ingredients"), cIngredient::iIngredientAlcohol }, - { QString::fromUtf8("Water"), QString::fromUtf8("Main Ingredients"), cIngredient::iIngredientWater }, - { QString::fromUtf8("Total Dietary Fibre"), QString::fromUtf8("Main Ingredients"), cIngredient::iIngredientTotalDietaryFibre }, - { QString::fromUtf8("Cholesterol"), QString::fromUtf8("Main Ingredients"), cIngredient::iIngredientCholesterol }, - { QString::fromUtf8("Mineral"), QString::fromUtf8("Main Ingredients"), cIngredient::iIngredientMineral }, - { QString::fromUtf8("Sugar"), QString::fromUtf8("Main Ingredients"), cIngredient::iIngredientSugar }, + { QString::fromUtf8("Bread Units"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_None, cIngredient::iIngredientBreadUnits }, + { QString::fromUtf8("Calories"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Calories, cIngredient::iIngredientCalories }, + { QString::fromUtf8("Protein"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientProtein }, + { QString::fromUtf8("Fat"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientFat }, + { QString::fromUtf8("Carbohydrates"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCarbohydrates }, + { QString::fromUtf8("Alcohol"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientAlcohol }, + { QString::fromUtf8("Water"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientWater }, + { QString::fromUtf8("Total Dietary Fibre"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientTotalDietaryFibre }, + { QString::fromUtf8("Cholesterol"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCholesterol }, + { QString::fromUtf8("Mineral"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMineral }, + { QString::fromUtf8("Sugar"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSugar }, - { QString::fromUtf8("Vitamin A Retinol"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientVitaminARetinol }, - { QString::fromUtf8("Vitamin D"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientVitaminD }, - { QString::fromUtf8("Vitamin E activ."), QString::fromUtf8("Vitamins"), cIngredient::iIngredientVitaminEactiv }, - { QString::fromUtf8("Folic acid"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientFolicacid }, - { QString::fromUtf8("Vitamin B1"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientVitaminB1 }, - { QString::fromUtf8("Vitamin B2"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientVitaminB2 }, - { QString::fromUtf8("Vitamin B6"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientVitaminB6 }, - { QString::fromUtf8("Vitamin C"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientVitaminC }, - { QString::fromUtf8("a-Tocopherol"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientaTocopherol }, - { QString::fromUtf8("Vitamin K"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientVitaminK }, - { QString::fromUtf8("Nicotinamide"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientNicotinamide }, - { QString::fromUtf8("Pantothenic acid"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientPantothenicacid }, - { QString::fromUtf8("Biotin"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientBiotin }, - { QString::fromUtf8("Vitamin B12"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientVitaminB12 }, - { QString::fromUtf8("Retinolequivalent"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientRetinolequivalent }, - { QString::fromUtf8("ß-Carotene"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientbCarotene }, - { QString::fromUtf8("Niacinequivalent"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientNiacinequivalent }, - { QString::fromUtf8("free folic acid equivalent"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientfreefolicacidequivalent }, - { QString::fromUtf8("free folic acid"), QString::fromUtf8("Vitamins"), cIngredient::iIngredientfreefolicacid }, + { QString::fromUtf8("Vitamin A Retinol"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminARetinol }, + { QString::fromUtf8("Vitamin D"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminD }, + { QString::fromUtf8("Vitamin E activ."), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminEactiv }, + { QString::fromUtf8("Folic acid"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientFolicacid }, + { QString::fromUtf8("Vitamin B1"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminB1 }, + { QString::fromUtf8("Vitamin B2"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminB2 }, + { QString::fromUtf8("Vitamin B6"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminB6 }, + { QString::fromUtf8("Vitamin C"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminC }, + { QString::fromUtf8("a-Tocopherol"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientaTocopherol }, + { QString::fromUtf8("Vitamin K"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminK }, + { QString::fromUtf8("Nicotinamide"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientNicotinamide }, + { QString::fromUtf8("Pantothenic acid"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPantothenicacid }, + { QString::fromUtf8("Biotin"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientBiotin }, + { QString::fromUtf8("Vitamin B12"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminB12 }, + { QString::fromUtf8("Retinolequivalent"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientRetinolequivalent }, + { QString::fromUtf8("ß-Carotene"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientbCarotene }, + { QString::fromUtf8("Niacinequivalent"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientNiacinequivalent }, + { QString::fromUtf8("free folic acid equivalent"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientfreefolicacidequivalent }, + { QString::fromUtf8("free folic acid"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientfreefolicacid }, - { QString::fromUtf8("Sodium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::iIngredientSodium }, - { QString::fromUtf8("Potassium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::iIngredientPotassium }, - { QString::fromUtf8("Magnesium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::iIngredientMagnesium }, - { QString::fromUtf8("Calcium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::iIngredientCalcium }, - { QString::fromUtf8("Iron"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::iIngredientIron }, - { QString::fromUtf8("Phosphorus"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::iIngredientPhosphorus }, - { QString::fromUtf8("Copper"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::iIngredientCopper }, - { QString::fromUtf8("Zinc"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::iIngredientZinc }, - { QString::fromUtf8("Chloride"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::iIngredientChloride }, - { QString::fromUtf8("Fluoride"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::iIngredientFluoride }, - { QString::fromUtf8("Iodide"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::iIngredientIodide }, - { QString::fromUtf8("Selenium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::iIngredientSelenium }, - { QString::fromUtf8("Manganese"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::iIngredientManganese }, - { QString::fromUtf8("Sulphur"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::iIngredientSulphur }, + { QString::fromUtf8("Sodium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSodium }, + { QString::fromUtf8("Potassium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPotassium }, + { QString::fromUtf8("Magnesium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMagnesium }, + { QString::fromUtf8("Calcium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCalcium }, + { QString::fromUtf8("Iron"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientIron }, + { QString::fromUtf8("Phosphorus"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPhosphorus }, + { QString::fromUtf8("Copper"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCopper }, + { QString::fromUtf8("Zinc"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientZinc }, + { QString::fromUtf8("Chloride"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientChloride }, + { QString::fromUtf8("Fluoride"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientFluoride }, + { QString::fromUtf8("Iodide"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientIodide }, + { QString::fromUtf8("Selenium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSelenium }, + { QString::fromUtf8("Manganese"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientManganese }, + { QString::fromUtf8("Sulphur"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSulphur }, - { QString::fromUtf8("Arginine"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientArginine }, - { QString::fromUtf8("Cystine"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientCystine }, - { QString::fromUtf8("Histidine"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientHistidine }, - { QString::fromUtf8("Isoleucine"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientIsoleucine }, - { QString::fromUtf8("Leucine"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientLeucine }, - { QString::fromUtf8("Lysine"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientLysine }, - { QString::fromUtf8("Methionine"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientMethionine }, - { QString::fromUtf8("Phenylalanine"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientPhenylalanine }, - { QString::fromUtf8("Threonine"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientThreonine }, - { QString::fromUtf8("Tryptophane"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientTryptophane }, - { QString::fromUtf8("Tyrosine"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientTyrosine }, - { QString::fromUtf8("Valine"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientValine }, - { QString::fromUtf8("Alanine"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientAlanine }, - { QString::fromUtf8("Aspartic"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientAspartid }, - { QString::fromUtf8("Aspartic acid"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientAsparticacid }, - { QString::fromUtf8("Glutamic"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientGlutamid }, - { QString::fromUtf8("Glutamic acid"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientGlutamicacid }, - { QString::fromUtf8("Glycine"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientGlycine }, - { QString::fromUtf8("Proline"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientProline }, - { QString::fromUtf8("Serine"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientSerine }, - { QString::fromUtf8("other essent. amino acids"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientotheressent_aminoacids }, - { QString::fromUtf8("essent. amino acids"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientessent_aminoacids }, - { QString::fromUtf8("other nonessent. amino acids"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientothernonessent_aminoacids }, - { QString::fromUtf8("nonessent. amino acids"), QString::fromUtf8("Aminos Acids"), cIngredient::iIngredientnonessent_aminoacids }, + { QString::fromUtf8("Arginine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientArginine }, + { QString::fromUtf8("Cystine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCystine }, + { QString::fromUtf8("Histidine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientHistidine }, + { QString::fromUtf8("Isoleucine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientIsoleucine }, + { QString::fromUtf8("Leucine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientLeucine }, + { QString::fromUtf8("Lysine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientLysine }, + { QString::fromUtf8("Methionine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMethionine }, + { QString::fromUtf8("Phenylalanine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPhenylalanine }, + { QString::fromUtf8("Threonine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientThreonine }, + { QString::fromUtf8("Tryptophane"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientTryptophane }, + { QString::fromUtf8("Tyrosine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientTyrosine }, + { QString::fromUtf8("Valine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientValine }, + { QString::fromUtf8("Alanine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientAlanine }, + { QString::fromUtf8("Aspartic"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientAspartid }, + { QString::fromUtf8("Aspartic acid"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientAsparticacid }, + { QString::fromUtf8("Glutamic"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientGlutamid }, + { QString::fromUtf8("Glutamic acid"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientGlutamicacid }, + { QString::fromUtf8("Glycine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientGlycine }, + { QString::fromUtf8("Proline"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientProline }, + { QString::fromUtf8("Serine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSerine }, + { QString::fromUtf8("other essent. amino acids"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientotheressent_aminoacids }, + { QString::fromUtf8("essent. amino acids"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientessent_aminoacids }, + { QString::fromUtf8("other nonessent. amino acids"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientothernonessent_aminoacids }, + { QString::fromUtf8("nonessent. amino acids"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientnonessent_aminoacids }, - { QString::fromUtf8("Saturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientSaturatedfattyacids }, - { QString::fromUtf8("Monounsaturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientMonounsaturatedfattyacids }, - { QString::fromUtf8("Polyunsaturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientPolyunsaturatedfattyacids }, - { QString::fromUtf8("Butyric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientButyricacid }, - { QString::fromUtf8("Caproic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientCaproicacid }, - { QString::fromUtf8("Caprylic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientCaprylicacid }, - { QString::fromUtf8("Capric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientCapricacid }, - { QString::fromUtf8("Lauric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientLauricacid }, - { QString::fromUtf8("Myristic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientMyristicacid }, - { QString::fromUtf8("C15:O fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientC15_O_fattyacid }, - { QString::fromUtf8("Palmitic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientPalmiticacid }, - { QString::fromUtf8("Margaric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientMargaricacid }, - { QString::fromUtf8("Stearic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientStearicacid }, - { QString::fromUtf8("Arachic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientArachicacid }, - { QString::fromUtf8("Behenic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientBehenicacid }, - { QString::fromUtf8("Lignoceric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientLignocericacid }, - { QString::fromUtf8("Palmitoleic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientPalmitoleicacid }, - { QString::fromUtf8("Oleic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientOleicacid }, - { QString::fromUtf8("Eicosenic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientEicosenicacid }, - { QString::fromUtf8("C22:1 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientC22_1_fattyacid }, - { QString::fromUtf8("C14:1 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientC14_1_fattyacid }, - { QString::fromUtf8("C24:1 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientC24_1_fattyacid }, - { QString::fromUtf8("Linoleic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientLinoleicacid }, - { QString::fromUtf8("Linolenic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientLinolenicacid }, - { QString::fromUtf8("Arachidonic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientArachidonicacid }, - { QString::fromUtf8("C18:4 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientC18_4_fattyacid }, - { QString::fromUtf8("C20:5 N-3 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientC20_5_N_3fattyacid }, - { QString::fromUtf8("C22:5 N-3 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientC22_5_N_3fattyacid }, - { QString::fromUtf8("C22:6 N-3 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientC22_6_N_3fattyacid }, - { QString::fromUtf8("C16:2 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientC16_2_fattyacid }, - { QString::fromUtf8("other saturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientothersaturatedfattyacids }, - { QString::fromUtf8("other monounsaturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientothermonounsaturatedfattyacids }, - { QString::fromUtf8("Nonadecatrienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientNonadecatrienicacid }, - { QString::fromUtf8("Eicosadienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientEicosadienicacid }, - { QString::fromUtf8("Eicosatrienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientEicosatrienicacid }, - { QString::fromUtf8("Docosadienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientDocosadienicacid }, - { QString::fromUtf8("Docosatrienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientDocosatrienicacid }, - { QString::fromUtf8("Docosatetraenic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientDocosatetraenicacid }, - { QString::fromUtf8("other polyunsat. fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientotherpolyunsat_fattyacids }, - { QString::fromUtf8("other short-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientothershort_chainfattyacids }, - { QString::fromUtf8("short-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientshort_chainfattyacids }, - { QString::fromUtf8("other medium-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientothermedium_chainfattyacids }, - { QString::fromUtf8("medium-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientmedium_chainfattyacids }, - { QString::fromUtf8("other long-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientotherlong_chainfattyacids }, - { QString::fromUtf8("long-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientlong_chainfattyacids }, - { QString::fromUtf8("Glycerol and Lipoides"), QString::fromUtf8("Fatty Acids"), cIngredient::iIngredientGlycerolandLipoides }, + { QString::fromUtf8("Saturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSaturatedfattyacids }, + { QString::fromUtf8("Monounsaturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMonounsaturatedfattyacids }, + { QString::fromUtf8("Polyunsaturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPolyunsaturatedfattyacids }, + { QString::fromUtf8("Butyric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientButyricacid }, + { QString::fromUtf8("Caproic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCaproicacid }, + { QString::fromUtf8("Caprylic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCaprylicacid }, + { QString::fromUtf8("Capric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCapricacid }, + { QString::fromUtf8("Lauric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientLauricacid }, + { QString::fromUtf8("Myristic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMyristicacid }, + { QString::fromUtf8("C15:O fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC15_O_fattyacid }, + { QString::fromUtf8("Palmitic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPalmiticacid }, + { QString::fromUtf8("Margaric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMargaricacid }, + { QString::fromUtf8("Stearic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientStearicacid }, + { QString::fromUtf8("Arachic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientArachicacid }, + { QString::fromUtf8("Behenic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientBehenicacid }, + { QString::fromUtf8("Lignoceric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientLignocericacid }, + { QString::fromUtf8("Palmitoleic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPalmitoleicacid }, + { QString::fromUtf8("Oleic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientOleicacid }, + { QString::fromUtf8("Eicosenic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientEicosenicacid }, + { QString::fromUtf8("C22:1 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC22_1_fattyacid }, + { QString::fromUtf8("C14:1 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC14_1_fattyacid }, + { QString::fromUtf8("C24:1 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC24_1_fattyacid }, + { QString::fromUtf8("Linoleic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientLinoleicacid }, + { QString::fromUtf8("Linolenic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientLinolenicacid }, + { QString::fromUtf8("Arachidonic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientArachidonicacid }, + { QString::fromUtf8("C18:4 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC18_4_fattyacid }, + { QString::fromUtf8("C20:5 N-3 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC20_5_N_3fattyacid }, + { QString::fromUtf8("C22:5 N-3 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC22_5_N_3fattyacid }, + { QString::fromUtf8("C22:6 N-3 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC22_6_N_3fattyacid }, + { QString::fromUtf8("C16:2 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC16_2_fattyacid }, + { QString::fromUtf8("other saturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientothersaturatedfattyacids }, + { QString::fromUtf8("other monounsaturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientothermonounsaturatedfattyacids }, + { QString::fromUtf8("Nonadecatrienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientNonadecatrienicacid }, + { QString::fromUtf8("Eicosadienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientEicosadienicacid }, + { QString::fromUtf8("Eicosatrienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientEicosatrienicacid }, + { QString::fromUtf8("Docosadienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientDocosadienicacid }, + { QString::fromUtf8("Docosatrienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientDocosatrienicacid }, + { QString::fromUtf8("Docosatetraenic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientDocosatetraenicacid }, + { QString::fromUtf8("other polyunsat. fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientotherpolyunsat_fattyacids }, + { QString::fromUtf8("other short-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientothershort_chainfattyacids }, + { QString::fromUtf8("short-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientshort_chainfattyacids }, + { QString::fromUtf8("other medium-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientothermedium_chainfattyacids }, + { QString::fromUtf8("medium-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientmedium_chainfattyacids }, + { QString::fromUtf8("other long-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientotherlong_chainfattyacids }, + { QString::fromUtf8("long-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientlong_chainfattyacids }, + { QString::fromUtf8("Glycerol and Lipoides"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientGlycerolandLipoides }, - { QString::fromUtf8("Sorbitol"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientSorbitol }, - { QString::fromUtf8("Glucose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientGlucose }, - { QString::fromUtf8("Fructose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientFructose }, - { QString::fromUtf8("Sucrose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientSucrose }, - { QString::fromUtf8("Lactose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientLactose }, - { QString::fromUtf8("Starch"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientStarch }, - { QString::fromUtf8("Maltose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientMaltose }, - { QString::fromUtf8("Galactose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientGalactose }, - { QString::fromUtf8("Glycogene"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientGlycogene }, - { QString::fromUtf8("Pentosan"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientPentosan }, - { QString::fromUtf8("Hexosan"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientHexosan }, - { QString::fromUtf8("Cellulose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientCellulose }, - { QString::fromUtf8("Polyuronic acid"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientPolyuronicacid }, - { QString::fromUtf8("Mannitol"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientMannitol }, - { QString::fromUtf8("Xylitol"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientXylitol }, - { QString::fromUtf8("other sugar alcohols"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientothersugaralcohols }, - { QString::fromUtf8("Total sugar alcohols"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientTotalsugaralcohols }, - { QString::fromUtf8("other monosaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientothermonosaccharides }, - { QString::fromUtf8("Monosaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientMonosaccharides }, - { QString::fromUtf8("other disaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientotherdisaccharides }, - { QString::fromUtf8("Disaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientDisaccharides }, - { QString::fromUtf8("Oligosaccharides resorb."), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientOligosaccharidesresorb }, - { QString::fromUtf8("Oligosaccharides nonresorb."), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientOligosaccharidesnonresorb }, - { QString::fromUtf8("other polysaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientotherpolysaccharides }, - { QString::fromUtf8("Polysaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::iIngredientPolysaccharides }, + { QString::fromUtf8("Sorbitol"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSorbitol }, + { QString::fromUtf8("Glucose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientGlucose }, + { QString::fromUtf8("Fructose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientFructose }, + { QString::fromUtf8("Sucrose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSucrose }, + { QString::fromUtf8("Lactose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientLactose }, + { QString::fromUtf8("Starch"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientStarch }, + { QString::fromUtf8("Maltose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMaltose }, + { QString::fromUtf8("Galactose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientGalactose }, + { QString::fromUtf8("Glycogene"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientGlycogene }, + { QString::fromUtf8("Pentosan"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPentosan }, + { QString::fromUtf8("Hexosan"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientHexosan }, + { QString::fromUtf8("Cellulose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCellulose }, + { QString::fromUtf8("Polyuronic acid"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPolyuronicacid }, + { QString::fromUtf8("Mannitol"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMannitol }, + { QString::fromUtf8("Xylitol"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientXylitol }, + { QString::fromUtf8("other sugar alcohols"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientothersugaralcohols }, + { QString::fromUtf8("Total sugar alcohols"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientTotalsugaralcohols }, + { QString::fromUtf8("other monosaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientothermonosaccharides }, + { QString::fromUtf8("Monosaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMonosaccharides }, + { QString::fromUtf8("other disaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientotherdisaccharides }, + { QString::fromUtf8("Disaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientDisaccharides }, + { QString::fromUtf8("Oligosaccharides resorb."), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientOligosaccharidesresorb }, + { QString::fromUtf8("Oligosaccharides nonresorb."), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientOligosaccharidesnonresorb }, + { QString::fromUtf8("other polysaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientotherpolysaccharides }, + { QString::fromUtf8("Polysaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPolysaccharides }, - { QString::fromUtf8("Dietary fibre water soluble"), QString::fromUtf8("Others"), cIngredient::iIngredientDietaryfibrewatersoluble }, - { QString::fromUtf8("Dietary fibre water insoluble"), QString::fromUtf8("Others"), cIngredient::iIngredientDietaryfibrewaterinsoluble }, - { QString::fromUtf8("Lignin"), QString::fromUtf8("Others"), cIngredient::iIngredientLignin }, - { QString::fromUtf8("Purine bases nitrogen"), QString::fromUtf8("Others"), cIngredient::iIngredientPurinebasesnitrogen }, - { QString::fromUtf8("Sodium chloride"), QString::fromUtf8("Others"), cIngredient::iIngredientSodiumchloride }, - { QString::fromUtf8("Waste"), QString::fromUtf8("Others"), cIngredient::iIngredientWaste }, - { QString::fromUtf8("other proteins"), QString::fromUtf8("Others"), cIngredient::iIngredientotherproteins }, - { QString::fromUtf8("animal protein"), QString::fromUtf8("Others"), cIngredient::iIngredientanimalprotein }, - { QString::fromUtf8("plant protein"), QString::fromUtf8("Others"), cIngredient::iIngredientplantprotein }, - { QString::fromUtf8("Uric acid"), QString::fromUtf8("Others"), cIngredient::iIngredientUricacid }, - { QString::fromUtf8("other organic acids"), QString::fromUtf8("Others"), cIngredient::iIngredientotherorganicacids }, - { QString::fromUtf8("Mol-diff. cations-anions"), QString::fromUtf8("Others"), cIngredient::iIngredientMol_diff_cations_anions }, - { QString::fromUtf8("Nitrogen factor"), QString::fromUtf8("Others"), cIngredient::iIngredientNitrogenfactor }, - { QString::fromUtf8("Fatty acid part"), QString::fromUtf8("Others"), cIngredient::iIngredientFattyacidpart }, - { QString::fromUtf8("Minerals part"), QString::fromUtf8("Others"), cIngredient::iIngredientMineralspart }, - { QString::fromUtf8("P/S Ratio"), QString::fromUtf8("Others"), cIngredient::iIngredientPS_Ratio }, - { QString::fromUtf8("Biological value"), QString::fromUtf8("Others"), cIngredient::iIngredientBiologicalvalue }, - { QString::fromUtf8("Fructose free bread units"), QString::fromUtf8("Others"), cIngredient::iIngredientFructosefreebreadunits }, - { QString::fromUtf8("average consumption"), QString::fromUtf8("Others"), cIngredient::iIngredientaverageconsumption }, + { QString::fromUtf8("Dietary fibre water soluble"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientDietaryfibrewatersoluble }, + { QString::fromUtf8("Dietary fibre water insoluble"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientDietaryfibrewaterinsoluble }, + { QString::fromUtf8("Lignin"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientLignin }, + { QString::fromUtf8("Purine bases nitrogen"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPurinebasesnitrogen }, + { QString::fromUtf8("Sodium chloride"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSodiumchloride }, + { QString::fromUtf8("Waste"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientWaste }, + { QString::fromUtf8("other proteins"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientotherproteins }, + { QString::fromUtf8("animal protein"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientanimalprotein }, + { QString::fromUtf8("plant protein"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientplantprotein }, + { QString::fromUtf8("Uric acid"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientUricacid }, + { QString::fromUtf8("other organic acids"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientotherorganicacids }, + { QString::fromUtf8("Mol-diff. cations-anions"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMol_diff_cations_anions }, + { QString::fromUtf8("Nitrogen factor"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientNitrogenfactor }, + { QString::fromUtf8("Fatty acid part"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientFattyacidpart }, + { QString::fromUtf8("Minerals part"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMineralspart }, + { QString::fromUtf8("P/S Ratio"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPS_Ratio }, + { QString::fromUtf8("Biological value"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientBiologicalvalue }, + { QString::fromUtf8("Fructose free bread units"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientFructosefreebreadunits }, + { QString::fromUtf8("average consumption"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientaverageconsumption }, }; cIngredient::cIngredient() : @@ -255,6 +253,17 @@ QString cIngredient::ingredientGroup() return(m_szIngredientGroup); } +QStringList cIngredient::groups() +{ + QStringList groupsList; + + for(int z = 0;z < (int)sizeof(g_groupname)/(int)sizeof(GROUPNAME);z++) + groupsList.append(g_groupname[z].szGroup); + + groupsList.removeDuplicates(); + return(groupsList); +} + QString cIngredient::group(cIngredient::iIngredient i) { for(int z = 0;z < (int)sizeof(g_groupname)/(int)sizeof(GROUPNAME);z++) @@ -265,7 +274,6 @@ QString cIngredient::group(cIngredient::iIngredient i) return("unknown"); } - QString cIngredient::name(cIngredient::iIngredient i) { for(int z = 0;z < (int)sizeof(g_groupname)/(int)sizeof(GROUPNAME);z++) @@ -276,6 +284,72 @@ QString cIngredient::name(cIngredient::iIngredient i) return("unknown"); } +qreal cIngredient::value(cIngredient::iIngredient i) +{ + return(m_dValue[i]); +} + +QString cIngredient::valueFormatted(cIngredient::iIngredient i) +{ + qreal dValue = m_dValue[i]; + QString str; + QString measure("g"); + qint16 factor; + + switch(g_groupname[i].measure) + { + case MEASURE_Calories: + str = QString("%1 kCal").arg(dValue); + break; + case MEASURE_Joule: + str = QString("%1 kJoule").arg(dValue); + break; + case MEASURE_Fluid: + str = QString("%1 l").arg(dValue); + break; + case MEASURE_None: + str = QString("%1").arg(dValue); + break; + case MEASURE_Peace: + str = QString("%1 pcs").arg(dValue); + break; + case MEASURE_Weight: + factor = 1; + if(dValue == 0) + str = QString("%1 g").arg(dValue); + else + { + while(dValue < 1) + { + dValue *= 1000; + factor++; + } + + switch(factor) + { + case 1: + str = QString("%1 g").arg(dValue); + break; + case 2: + str = QString("%1 mg").arg(dValue); + break; + case 3: + str = QString("%1 µg").arg(dValue); + break; + case 4: + str = QString("%1 ng").arg(dValue); + break; + case 5: + str = QString("%1 pg").arg(dValue); + break; + } + } + break; + } + + return(str); +} + void cIngredient::setValue(cIngredient::iIngredient i, qreal dValue) { m_dValue[i] = dValue; diff --git a/Kooky/cingredient.h b/Kooky/cingredient.h index dd4fea7..6004218 100644 --- a/Kooky/cingredient.h +++ b/Kooky/cingredient.h @@ -22,6 +22,7 @@ #include #include +#include class cPlugin; @@ -201,10 +202,23 @@ public: iIngredientMax, }; + enum MEASURE + { + MEASURE_None = 0, + MEASURE_Weight = 1, + MEASURE_Volume = 2, + MEASURE_Fluid = 3, + MEASURE_Peace = 4, + MEASURE_Calories = 5, + MEASURE_Joule = 6, + }; + cIngredient(); cIngredient(const QString& szIngredientName, const QString& szIngredientGroup); void setValue(cIngredient::iIngredient i, qreal dValue); + qreal value(cIngredient::iIngredient i); + QString valueFormatted(cIngredient::iIngredient i); /*! \brief @@ -226,6 +240,7 @@ public: QString ingredientName(); QString ingredientGroup(); + QStringList groups(); /*! \brief diff --git a/Kooky/cingredientwindow.cpp b/Kooky/cingredientwindow.cpp index 966a448..d4d4b69 100644 --- a/Kooky/cingredientwindow.cpp +++ b/Kooky/cingredientwindow.cpp @@ -1,7 +1,7 @@ #include "cingredientwindow.h" #include "ui_cingredientwindow.h" -#include "cingredient.h" +#include cIngredientWindow::cIngredientWindow(QWidget *parent) : @@ -9,6 +9,9 @@ cIngredientWindow::cIngredientWindow(QWidget *parent) : ui(new Ui::cIngredientWindow) { ui->setupUi(this); + + m_lpIngredientValuesModel = new QStandardItemModel(0, 2); + ui->m_lpIngredientValues->setModel(m_lpIngredientValuesModel); } cIngredientWindow::~cIngredientWindow() @@ -18,11 +21,36 @@ cIngredientWindow::~cIngredientWindow() void cIngredientWindow::setIngredient(qint32 iIngredient, cPlugin* lpPlugin) { - m_iIngredient = iIngredient; - m_lpDBPlugin = lpPlugin; - cIngredient ingredient; - if(!ingredient.load(m_iIngredient, m_lpDBPlugin)) + m_iIngredient = iIngredient; + m_lpDBPlugin = lpPlugin; + if(!m_ingredientSaved.load(m_iIngredient, m_lpDBPlugin)) return; - setWindowTitle(ingredient.ingredientName()); + m_ingredient = m_ingredientSaved; + + setWindowTitle(m_ingredientSaved.ingredientName()); + ui->m_lpIngredientName->setText(m_ingredientSaved.ingredientName()); + + QStringList groups = m_ingredientSaved.groups(); + ui->m_lpIngredientGroup->addItems(m_lpDBPlugin->dbInterface()->groups()); + ui->m_lpIngredientGroup->setCurrentText(m_ingredientSaved.ingredientGroup()); + + QStandardItem* lpRoot[7]; + + for(int z = 0;z < 7;z++) + { + lpRoot[z] = new QStandardItem(groups.at(z)); + m_lpIngredientValuesModel->appendRow(lpRoot[z]); + } + + for(int z = 0;z < cIngredient::iIngredientMax;z++) + { + qint32 groupID = groups.indexOf(m_ingredientSaved.group((cIngredient::iIngredient)z)); + QStandardItem* lpNew = new QStandardItem(m_ingredientSaved.name((cIngredient::iIngredient)z)); + QStandardItem* lpValue = new QStandardItem(m_ingredientSaved.valueFormatted((cIngredient::iIngredient)z)); + lpValue->setTextAlignment(Qt::AlignRight); + lpRoot[groupID]->appendRow(QList() << lpNew << lpValue); + } + ui->m_lpIngredientValues->expandAll(); + ui->m_lpIngredientValues->resizeColumnToContents(0); } diff --git a/Kooky/cingredientwindow.h b/Kooky/cingredientwindow.h index b352d27..067da77 100644 --- a/Kooky/cingredientwindow.h +++ b/Kooky/cingredientwindow.h @@ -3,8 +3,10 @@ #include "cplugin.h" +#include "cingredient.h" #include +#include namespace Ui { @@ -22,10 +24,13 @@ public: void setIngredient(qint32 iIngredient, cPlugin* lpPlugin); private: - Ui::cIngredientWindow *ui; + Ui::cIngredientWindow* ui; - cPlugin* m_lpDBPlugin; - qint32 m_iIngredient; + cPlugin* m_lpDBPlugin; + qint32 m_iIngredient; + cIngredient m_ingredient; + cIngredient m_ingredientSaved; + QStandardItemModel* m_lpIngredientValuesModel; }; #endif // CINGREDIENTWINDOW_H diff --git a/Kooky/cingredientwindow.ui b/Kooky/cingredientwindow.ui index d50f21e..188a116 100644 --- a/Kooky/cingredientwindow.ui +++ b/Kooky/cingredientwindow.ui @@ -7,12 +7,45 @@ 0 0 791 - 599 + 712 Ingredient + + + + + + + Name: + + + + + + + + + + Group: + + + + + + + + + + + + false + + + + diff --git a/Kooky/cmainwindow.cpp b/Kooky/cmainwindow.cpp index 1234b8f..181b252 100644 --- a/Kooky/cmainwindow.cpp +++ b/Kooky/cmainwindow.cpp @@ -60,9 +60,9 @@ void cMainWindow::init() ui->setupUi(this); - ui->m_lpMDIArea->setViewMode(QMdiArea::TabbedView); - ui->m_lpMDIArea->setTabsClosable(true); - ui->m_lpMDIArea->setTabsMovable(true); +// ui->m_lpMDIArea->setViewMode(QMdiArea::TabbedView); +// ui->m_lpMDIArea->setTabsClosable(true); +// ui->m_lpMDIArea->setTabsMovable(true); // loadPlugins(QString("%1%2%3").arg(QDir::currentPath()).arg(QDir::separator()).arg("plugins")); loadPlugins(QString("%1%2%3").arg(qApp->applicationDirPath()).arg(QDir::separator()).arg("plugins")); diff --git a/iErnaehrung/cernaehrungplugin.cpp b/iErnaehrung/cernaehrungplugin.cpp index 589c2e0..eb99766 100644 --- a/iErnaehrung/cernaehrungplugin.cpp +++ b/iErnaehrung/cernaehrungplugin.cpp @@ -297,11 +297,15 @@ bool cErnaehrungPlugin::load(qint16 iIndex) } else { + //QString szL0 = QString::fromUtf8(szList.at(z)); + QString szL0 = szList.at(z); + for(int i = 0;i < (int)sizeof(g_values)/(int)sizeof(VALUES);i++) { - QString szL0 = QString::fromUtf8(szList.at(z)); - - if(szL0.contains(QString::fromUtf8(g_values[i].szSearch.toLatin1().data()))) + //QString szL1 = g_values[i].szSearch; + //bool x = szL0.contains(szL1); + //x = false; + if(szL0.contains(g_values[i].szSearch)) { dFactor = 1; QString szL1 = QString::fromUtf8(szList.at(z+1)); @@ -315,6 +319,7 @@ bool cErnaehrungPlugin::load(qint16 iIndex) dFactor = 1000000; g_values[i].dValue = toValue(szL1)/dFactor; + break; } } }