(function(){
	
	var bin;
	
	
	bin=findFirmwares("firmware/ascapc/cmt");
	
	var menu_cmt = { name: "АСКУЭ на CMT2300A", ident: "3.1", menu: [
			{ name: "Теплосчётчики", ident: "3.1.1", menu: [
				{
					name: "Счётчик Rubetek RHSC-15/rf",
					ident: "3.1.1.1",
					version: bin["HM-CMT-stm32"].ver_dt,
					run: require("scripts/ascapc/hm_cmt").burn.bind(null, bin["HM-CMT-stm32"].filename, bin["HM-CMT-stm32"].ver_dt, "hm-cmt"),
					image: "images/noimage.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "Счетчик Пульс СТК-15",
					ident: "3.1.1.2",
					version: bin["HM-CMT"].ver_dt,
					run: require("scripts/ascapc/hm_cmt").burn8.bind(null, bin["HM-CMT"].filename, bin["HM-CMT"].ver_dt, "stk-15"),
					image: "images/noimage.jpg",
					text: "<b>Программатор: ST-Link SWIM</b>",
				},
				{
					name: "Счетчик Байкал C600",
					ident: "3.1.1.3",
					version: bin["HM-CMT-stm32"].ver_dt,
					run: require("scripts/ascapc/hm_cmt").burn.bind(null, bin["HM-CMT-stm32"].filename, bin["HM-CMT-stm32"].ver_dt, "c600"),
					image: "images/noimage.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "Счетчик Водомер СТ-17У",
					ident: "3.1.1.4",
					version: bin["HM-CMT-STM32-CT-17U"].ver_dt,
					run: require("scripts/ascapc/hm_cmt").burn.bind(null, bin["HM-CMT-STM32-CT-17U"].filename, bin["HM-CMT-STM32-CT-17U"].ver_dt, "ct-17u"),
					image: "images/noimage.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
			] },
			{ name: "Расходомер без дисплея (РМ) RWCS-3915", ident: "3.1.2", menu: [
				{
					name: "РМ прошивка+настройка",
					ident: "3.1.2.1",
					version: bin["RM-CMT"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt").burn_config.bind(null, bin["RM-CMT"].filename, bin["RM-CMT"].ver_dt, 'rm'),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "РМ только прошивка",
					ident: "3.1.2.2",
					version: bin["RM-CMT"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt").burn_only.bind(null, bin["RM-CMT"].filename, bin["RM-CMT"].ver_dt, 'rm'),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "РМ только настройка",
					ident: "3.1.2.3",
					version: bin["RM-CMT"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt").config_only.bind(null, bin["RM-CMT"].filename, bin["RM-CMT"].ver_dt, 'rm'),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "Прочитать РМ",
					ident: "3.1.2.4",
					version: "---",
					desc: "Отображает конфигурацию и показание счётчика",
					run: require("scripts/ascapc/rm_wdm_cmt").read.bind(null, 'rm'),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
			] },
			{ name: "Расходомер без дисплея (РМ) RWCS-3915CC", ident: "3.1.3", menu: [
				{
					name: "РМ прошивка+настройка (Арзамас)",
					ident: "3.1.3.1",
					version: bin["RWCS-3915CC"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt_cc").burn_config.bind(null, bin["RWCS-3915CC"].filename, bin["RWCS-3915CC"].ver_dt, 'rm', 1, 1000000000000, 9999999999999),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "РМ прошивка+настройка (Водомер)",
					ident: "3.1.3.2",
					version: bin["RWCS-3915CC"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt_cc").burn_config.bind(null, bin["RWCS-3915CC"].filename, bin["RWCS-3915CC"].ver_dt, 'rm', 2, 10000000, 99999999),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "РМ прошивка+настройка (Пульс)",
					ident: "3.1.3.3",
					version: bin["RWCS-3915CC"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt_cc").burn_config.bind(null, bin["RWCS-3915CC"].filename, bin["RWCS-3915CC"].ver_dt, 'rm', 3, 100000000, 999999999),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "РМ только прошивка",
					ident: "3.1.3.4",
					version: bin["RWCS-3915CC"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt_cc").burn_only.bind(null, bin["RWCS-3915CC"].filename, bin["RWCS-3915CC"].ver_dt, 'rm'),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "РМ только настройка (Арзамас)",
					ident: "3.1.3.5",
					version: bin["RWCS-3915CC"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt_cc").config_only.bind(null, bin["RWCS-3915CC"].filename, bin["RWCS-3915CC"].ver_dt, 'rm', 1, 1000000000000, 9999999999999),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "РМ только настройка (Водомер)",
					ident: "3.1.3.6",
					version: bin["RWCS-3915CC"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt_cc").config_only.bind(null, bin["RWCS-3915CC"].filename, bin["RWCS-3915CC"].ver_dt, 'rm', 2, 10000000, 99999999),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "РМ только настройка (Пульс)",
					ident: "3.1.3.7",
					version: bin["RWCS-3915CC"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt_cc").config_only.bind(null, bin["RWCS-3915CC"].filename, bin["RWCS-3915CC"].ver_dt, 'rm', 3, 100000000, 999999999),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "Прочитать РМ",
					ident: "3.1.3.8",
					version: "---",
					desc: "Отображает конфигурацию и показание счётчика",
					run: require("scripts/ascapc/rm_wdm_cmt_cc").read.bind(null, 'rm'),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
			] },
			{ name: "Расходомер с дисплеем (WDM)", ident: "3.1.4", menu: [
				{
					name: "WDМ прошивка+настройка",
					ident: "3.1.4.1",
					version: bin["WDM-CMT"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt").burn_config.bind(null, bin["WDM-CMT"].filename, bin["WDM-CMT"].ver_dt, 'wdm'),
					image: "images/ascapc/wdm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "WDМ только прошивка",
					ident: "3.1.4.2",
					version: bin["WDM-CMT"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt").burn_only.bind(null, bin["WDM-CMT"].filename, bin["WDM-CMT"].ver_dt, 'wdm'),
					image: "images/ascapc/wdm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "WDМ только настройка",
					ident: "3.1.4.3",
					version: bin["WDM-CMT"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt").config_only.bind(null, bin["WDM-CMT"].filename, bin["WDM-CMT"].ver_dt, 'wdm'),
					image: "images/ascapc/wdm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "Прочитать WDM",
					ident: "3.1.4.4",
					version: "---",
					desc: "Отображает конфигурацию и показание счётчика",
					run: require("scripts/ascapc/rm_wdm_cmt").read.bind(null, 'wdm'),
					image: "images/ascapc/wdm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
			] },
			{ name: "Расходомер RWCS-3917 (c RS-485)", ident: "3.1.5", menu: [
				{
					name: "Прошивка+настройка (Арзамас)",
					ident: "3.1.5.1",
					version: bin["rwcs-3917"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt_rs").burn_config.bind(null, bin["rwcs-3917"].filename, "rwcs-3917", 1, 1000000000000, 9999999999999),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "Прошивка+настройка (Водомер)",
					ident: "3.1.5.2",
					version: bin["rwcs-3917"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt_rs").burn_config.bind(null, bin["rwcs-3917"].filename, "rwcs-3917", 2, 10000000, 99999999),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "Прошивка+настройка (Пульс)",
					ident: "3.1.5.3",
					version: bin["rwcs-3917"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt_rs").burn_config.bind(null, bin["rwcs-3917"].filename, "rwcs-3917", 3, 100000000, 999999999),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "Только прошивка",
					ident: "3.1.5.4",
					version: bin["rwcs-3917"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt_rs").burn_only.bind(null, bin["rwcs-3917"].filename),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "Только настройка (Арзамас)",
					ident: "3.1.5.5",
					version: bin["rwcs-3917"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt_rs").config_only.bind(null, "rwcs-3917", 1, 1000000000000, 9999999999999),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "Только настройка (Водомер)",
					ident: "3.1.5.6",
					version: bin["rwcs-3917"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt_rs").config_only.bind(null, "rwcs-3917", 2, 10000000, 99999999),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "Только настройка (Пульс)",
					ident: "3.1.5.7",
					version: bin["rwcs-3917"].ver_dt,
					run: require("scripts/ascapc/rm_wdm_cmt_rs").config_only.bind(null, "rwcs-3917", 3, 100000000, 999999999),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
				{
					name: "Прочитать",
					ident: "3.1.5.8",
					version: "---",
					desc: "Отображает конфигурацию и показание счётчика",
					run: require("scripts/ascapc/rm_wdm_cmt_rs").read.bind(null, "rwcs-3917"),
					image: "images/ascapc/rm_cmt.jpg",
					text: "<b>Программатор: ST-Link SWD</b>",
				},
			] },
			{
				name: "Опто-съемник для поверки WDM",
				ident: "3.1.6",
				version: bin["WDM-OptSensor"].ver_dt,
				run: stm32_bin.bind(null, bin["WDM-OptSensor"].filename),
				image: "images/noimage.jpg",
				text: "<b>Программатор: ST-Link SWD</b>",
			},
			{
				name: "RWCS-3921 (ПР)",
				ident: "3.1.7",
				version: bin["PR-CMT"].ver_dt,
				run: require("scripts/ascapc/pr_cmt").burn.bind(null, bin["PR-CMT"].filename, bin["PR-CMT"].ver_dt),
				image: "images/noimage.jpg",
				text: "<b>Программатор: ST-Link SWD</b>",
			},
			{
				name: "СЭК",
				ident: "3.1.8",
				version: bin["SEK-CMT"].ver_dt,
				run: stm8_hex.bind(null, "stm8l151g4", bin["SEK-CMT"].filename, bin["SEK-CMT"].ver_dt),
				image: "images/noimage.jpg",
				text: "<b>Программатор: ST-Link SWIM</b>",
			},
			{
				name: "USB-Стик",
				ident: "3.1.9",
				version: bin["USB-Stick-CMT"].ver_dt,
				run: stm32_bin.bind(null, bin["USB-Stick-CMT"].filename),
				image: "images/noimage.jpg",
				text: "<b>Программатор: ST-Link SWD</b>",
			},
	] };
	
	
	bin=findFirmwares("firmware/ascapc/ax");
	
	var menu_ax = { name: "АСКУЭ на AX5043", ident: "3.2", menu: [
		{
			name: "RWCS-3915A (РМ)",
			ident: "3.2.1",
			version: bin["WaterMeterV2"].ver_dt,
			run: require("scripts/ascapc/rm_ax").burn.bind(null, bin["WaterMeterV2"].filename, bin["WaterMeterV2"].ver_dt),
			image: "images/noimage.jpg",
			text: "<b>Программатор: ST-Link SWD</b>",
		},
		{
			name: "Прочитать РМ",
			ident: "3.2.2",
			version: "---",
			desc: "Отображает конфигурацию и показание счётчика",
			run: require("scripts/ascapc/rm_ax").read,
			image: "images/noimage.jpg",
			text: "<b>Программатор: ST-Link SWD</b>",
		},
		{
			name: "RWCS-3921A (ПР)",
			ident: "3.2.3",
			version: bin["RfCollector"].ver_dt,
			run: require("scripts/ascapc/pr_ax").burn.bind(null, bin["RfCollector"].filename, bin["RfCollector"].ver_dt),
			image: "images/noimage.jpg",
			text: "<b>Программатор: ST-Link SWD</b>",
		},
		{
			name: "USB-стик",
			ident: "3.2.4",
			version: bin["RfCollector_UsbStick"].ver_dt,
			run: stm32_hex.bind(null, bin["RfCollector_UsbStick"].filename),
			image: "images/noimage.jpg",
			text: "<b>Программатор: ST-Link SWD</b>",
		},
	] };
	
	
	bin=findFirmwares("firmware/ascapc");
	
	var menu_uspd = { name: "УСПД", ident: "3.3", menu: [
		{
			name: "RWCS-3901 (УСПД)",
			ident: "3.3.1",
			version: bin["RWCS-3901"].ver_dt,
			run: require("scripts/ascapc/uspd").burn.bind(null, bin["RWCS-3901"].filename),
			image: "images/noimage.jpg",
			text: "<b>Программатор: ST-Link SWD</b>",
		},
	] };
	
	
	Menu.push( { name: "АСКУЭ", ident: "3", menu: [
		menu_cmt,
		menu_ax,
		menu_uspd,
	] } );
	
})();
