6 Commits

Author SHA1 Message Date
UA3REO
904f99d95c 11.1.1 Release 2025-01-24 17:17:08 +03:00
UA3REO
4bbf4f8e72 11.1.0 Release 2025-01-17 20:22:59 +03:00
UA3REO
a94f4db5aa Update CHANGELOG.txt 2024-12-19 20:37:56 +03:00
UA3REO
8cd6af632c 11.0.1 Release 2024-12-19 20:34:57 +03:00
UA3REO
a99a441cec Clean deprecated files 2024-12-13 14:01:14 +03:00
UA3REO
8d20e4f9e5 Clean deprecated instructions 2024-12-13 13:59:16 +03:00
55 changed files with 38 additions and 1902 deletions

View File

@@ -1,3 +1,41 @@
----Version 11.1.1----
+STM32: Wolf-Lite: Исправлена ошибка в SelfTest "RF Gain ERROR", Tnx RA3RBE
+STM32: Добавлен выход из FT8 по функциональной кнопке, Tnx R3WCU
+STM32: Wolf-2: Для УКВ платы обновлено ПЧ по умолчанию, проведено ускорение расчёта частоты гетеродина
+STM32: Wolf-Lite: Добавлен расчет контрольной суммы EEPROM, BKPSRAM и WiFi для Lite, Tnx RA3RBE
+STM32: Wolf-KT100S: Обновление конфигурации ФНЧ
+STM32: Исправление мелких ошибок в CAT, WiFi, защитах
----Version 11.1.0----
+FPGA: Улучшено качество сигнала на передачу, Tnx R6DLC
+FPGA: Wolf-Mini: EP4CE10 не вмещает в себя последние изменения, реализована урезанная версия, рекомендуется обновление до CE22
+STM32: Увеличена максимальная цифровая раскачка для полной реализации ДД ЦАП, обновлены калибровки по умолчанию, требуется перекалибровка RF Gain.
+STM32: В самопроверку добавлен пункт "RF Gain", показывает ошибку, если в калибровках по основным диапазонам установлены RF Gain <30 или >90, что ухудшает ДД ЦАП из-за снижения разрядности. Рекомендуется гасить мощность снижая усиление в драйвере УМ.
+STM32: Исправление включения 1.25м бенда, Tnx RA3RBE
+STM32: Улучшена отрисовка стрелок на аналоговом с-метре, улучшено сглаживание и устранены моргания
+STM32: RTTY InvertBits по умолчанию установлен в YES, Tnx UZ5DM
+STM32: Обновлены системные библиотеки
+STM32: Доработки пагинации файл-менеджера
+STM32: Добавлен вывод спектра в LCD Test, Tnx RA3RBE
+STM32: Wolf-Lite: Улучшена цветопередача за счет цветовой коррекции, Tnx RA3RBE
+STM32: Wolf-Lite: Улучшен протокол работы с ESP32, устранение обрывов связи с WiFi, Tnx RA3RBE
+STM32: Wolf-Lite: Начиная в версии 11.1 и дальше для работы с модулем WiFi требуется прошивка ESP32 vers 2.0, (см. DropBox) Tnx RA3RBE
+STM32: Расширены границы регулировок MIC Gain и DotToDash Rate
+STM32: Тип Iambic Type по умолчанию установлен в режим "B"
+STM32: Wolf-Mini: В меню RX добавлено управление выходом SPKOUT кодека NAU8822, Tnx R7KBI
+STM32: Исправлено отображение даты при расчёте прохождений спутников, Tnx UA9YHI
+STM32: Для меню QTH Lon/Lat/Alt по умолчанию выбрана строчная раскладка клавиатуры, Tnx UA9YHI
+STM32: В DIGI модах разрешено включение Noise Blanker
+STM32: Wolf-Mini: На кнопку тангенты "*" выведена функция запуска передачи CQ Message в эфир, Tnx R3TKS
+STM32: В окне эквалайзера теперь отображается тип эквалайзера из меню, а не текущая мода
+STM32: Оптимизация шины обмена с FPGA
+STM32: Для моды CW выделен отдельный RX эквалайзер
+STM32: Wolf-7Inch: Увеличено усреднение показателя dBm, Tnx ats52
----Version 11.0.1----
+HARDW: В GitHub добавлена инструкция по удаленному управлению трансивером через сеть
+STM32: Перемещены пункты в меню TX, чтобы индикация SWR была на том же экране, что и тюнер, Tnx UT8EU
----Version 11.0.0---- ----Version 11.0.0----
+HARDW: Опубликована техническая информация по проекту Wolf-DK102 (ультратонкий, 7 дюймовый), Автор BH7FFB +HARDW: Опубликована техническая информация по проекту Wolf-DK102 (ультратонкий, 7 дюймовый), Автор BH7FFB
+STM32: Исправлены периодические щелчки по приёму, Tnx UZ5DM +STM32: Исправлены периодические щелчки по приёму, Tnx UZ5DM

View File

@@ -434,8 +434,6 @@ WiFi module ESP-01 must have fresh firmware with SDK 3.0.4 and higher, and AT co
### Calibration TX ### Calibration TX
* **AM Modulation Index** - Set TX AM Modulation Scale * **AM Modulation Index** - Set TX AM Modulation Scale
* **ATU Averaging** - The number of steps of averaging SWR values during measurements in the operation of an automatic tuner * **ATU Averaging** - The number of steps of averaging SWR values during measurements in the operation of an automatic tuner
* **TX CICCOMP Shift** - Bit shift after TX CIC compensator
* **DAC Shift** - Bit shift of the output to the DAC
* **FM Deviation Scale** - Set TX FM Deviation Scale * **FM Deviation Scale** - Set TX FM Deviation Scale
* **Linear Pwr Control** - Sets a linear way to change the signal amplitude when adjusting the power (if disabled - logarithmic) * **Linear Pwr Control** - Sets a linear way to change the signal amplitude when adjusting the power (if disabled - logarithmic)
* **MAX PWR on Meter** - Maximum RF power (for indication) * **MAX PWR on Meter** - Maximum RF power (for indication)

View File

@@ -435,7 +435,6 @@ WiFi модуль ESP-01 должен иметь свежую прошивку
* **AM Modulation Index** - Глубина модуляции TX AM * **AM Modulation Index** - Глубина модуляции TX AM
* **ATU Averaging** - Количество шагов усреднений значений КСВ при замерах в работе автоматического тюнера * **ATU Averaging** - Количество шагов усреднений значений КСВ при замерах в работе автоматического тюнера
* **TX Start Delay** - Задержка при переходе на TX для срабатывания реле * **TX Start Delay** - Задержка при переходе на TX для срабатывания реле
* **DAC Shift** - Битовое смещение выхода на ЦАП
* **FM Deviation Scale** - Усиление девиации в TX FM режиме * **FM Deviation Scale** - Усиление девиации в TX FM режиме
* **Linear Pwr Control** - Задаёт линейный способ изменения амплитуды сигнала при регулировке мощности (если отключен - логарифмический) * **Linear Pwr Control** - Задаёт линейный способ изменения амплитуды сигнала при регулировке мощности (если отключен - логарифмический)
* **MAX PWR on Meter** - Максимальная выходная мощность (для индикации) * **MAX PWR on Meter** - Максимальная выходная мощность (для индикации)
@@ -448,7 +447,6 @@ WiFi модуль ESP-01 должен иметь свежую прошивку
* **SWR FWD/BWD RATE** - Подстройка коэффициента трансформации SWR-метра для падающей и отраженной волны * **SWR FWD/BWD RATE** - Подстройка коэффициента трансформации SWR-метра для падающей и отраженной волны
* **SWR Protector** - Выбор режима защиты по КСВ: Выключена, сброс мощности, отключение передачи * **SWR Protector** - Выбор режима защиты по КСВ: Выключена, сброс мощности, отключение передачи
* **TSignal Balance** - Задаёт баланс мощности между сигналами в режиме Two signal tune * **TSignal Balance** - Задаёт баланс мощности между сигналами в режиме Two signal tune
* **TX CICCOMP Shift** - Битовое смещение после TX CIC компенсатора
### Calibration Reset ### Calibration Reset
* **Settings reset** - Сброс настроек по умолчанию * **Settings reset** - Сброс настроек по умолчанию

View File

@@ -1 +0,0 @@
2.588184e+01,-1.177676e+01,-4.247139e+01,1.462374e+01,6.498443e+01,-1.619333e+01,-9.530045e+01,1.543182e+01,1.357651e+02,-1.075484e+01,-1.892556e+02,-1.792373e-01,2.591529e+02,2.065105e+01,-3.493771e+02,-5.522246e+01,4.642181e+02,1.099167e+02,-6.083312e+02,-1.926859e+02,7.863470e+02,3.135165e+02,-1.002837e+03,-4.850395e+02,1.261600e+03,7.224344e+02,-1.565650e+03,-1.044216e+03,1.916052e+03,1.471749e+03,-2.312049e+03,-2.030281e+03,2.749287e+03,2.747798e+03,-3.220302e+03,-3.656454e+03,3.711905e+03,4.790396e+03,-4.206394e+03,-6.187838e+03,4.677782e+03,7.887381e+03,-5.094268e+03,-9.931155e+03,5.412869e+03,1.235898e+04,-5.583896e+03,-1.521326e+04,5.543345e+03,1.853010e+04,-5.220412e+03,-2.234694e+04,4.526717e+03,2.668958e+04,-3.368222e+03,-3.158384e+04,1.629933e+03,3.703699e+04,8.059290e+02,-4.305550e+04,-4.081676e+03,4.961868e+04,8.337356e+03,-5.670522e+04,-1.374161e+04,6.425633e+04,2.045314e+04,-7.221442e+04,-2.866435e+04,8.047206e+04,3.854700e+04,-8.892747e+04,-5.031376e+04,9.741395e+04,6.414251e+04,-1.057785e+05,-8.026279e+04,1.137843e+05,9.885155e+04,-1.212209e+05,-1.201540e+05,1.277694e+05,1.443408e+05,-1.331550e+05,-1.716768e+05,1.369615e+05,2.023263e+05,-1.388398e+05,-2.365878e+05,1.382513e+05,2.746292e+05,-1.347533e+05,-3.168155e+05,1.276402e+05,3.633474e+05,-1.163329e+05,-4.147242e+05,9.986966e+04,4.712470e+05,-7.743817e+04,-5.336842e+05,4.763423e+04,6.025870e+05,-9.184515e+03,-6.792728e+05,-4.017941e+04,7.648835e+05,1.027624e+05,-8.619200e+05,-1.827573e+05,9.729724e+05,2.851100e+05,-1.103365e+06,-4.190684e+05,1.259662e+06,5.977167e+05,-1.455176e+06,-8.472549e+05,1.709824e+06,1.214643e+06,-2.066687e+06,-1.812364e+06,2.608282e+06,2.938129e+06,-3.544861e+06,-5.781064e+06,5.218750e+06,1.945780e+07,1.945780e+07,5.218750e+06,-5.781064e+06,-3.544861e+06,2.938129e+06,2.608282e+06,-1.812364e+06,-2.066687e+06,1.214643e+06,1.709824e+06,-8.472549e+05,-1.455176e+06,5.977167e+05,1.259662e+06,-4.190684e+05,-1.103365e+06,2.851100e+05,9.729724e+05,-1.827573e+05,-8.619200e+05,1.027624e+05,7.648835e+05,-4.017941e+04,-6.792728e+05,-9.184515e+03,6.025870e+05,4.763423e+04,-5.336842e+05,-7.743817e+04,4.712470e+05,9.986966e+04,-4.147242e+05,-1.163329e+05,3.633474e+05,1.276402e+05,-3.168155e+05,-1.347533e+05,2.746292e+05,1.382513e+05,-2.365878e+05,-1.388398e+05,2.023263e+05,1.369615e+05,-1.716768e+05,-1.331550e+05,1.443408e+05,1.277694e+05,-1.201540e+05,-1.212209e+05,9.885155e+04,1.137843e+05,-8.026279e+04,-1.057785e+05,6.414251e+04,9.741395e+04,-5.031376e+04,-8.892747e+04,3.854700e+04,8.047206e+04,-2.866435e+04,-7.221442e+04,2.045314e+04,6.425633e+04,-1.374161e+04,-5.670522e+04,8.337356e+03,4.961868e+04,-4.081676e+03,-4.305550e+04,8.059290e+02,3.703699e+04,1.629933e+03,-3.158384e+04,-3.368222e+03,2.668958e+04,4.526717e+03,-2.234694e+04,-5.220412e+03,1.853010e+04,5.543345e+03,-1.521326e+04,-5.583896e+03,1.235898e+04,5.412869e+03,-9.931155e+03,-5.094268e+03,7.887381e+03,4.677782e+03,-6.187838e+03,-4.206394e+03,4.790396e+03,3.711905e+03,-3.656454e+03,-3.220302e+03,2.747798e+03,2.749287e+03,-2.030281e+03,-2.312049e+03,1.471749e+03,1.916052e+03,-1.044216e+03,-1.565650e+03,7.224344e+02,1.261600e+03,-4.850395e+02,-1.002837e+03,3.135165e+02,7.863470e+02,-1.926859e+02,-6.083312e+02,1.099167e+02,4.642181e+02,-5.522246e+01,-3.493771e+02,2.065105e+01,2.591529e+02,-1.792373e-01,-1.892556e+02,-1.075484e+01,1.357651e+02,1.543182e+01,-9.530045e+01,-1.619333e+01,6.498443e+01,1.462374e+01,-4.247139e+01,-1.177676e+01,2.588184e+01

View File

@@ -1,252 +0,0 @@
%% ------------------------------------------------------------------------
%
% Title : test_cic.m
% Author : Alexander Kapitanov
% E-mail : sallador@bk.ru
% Version : 1.0
%
% -------------------------------------------------------------------------
%
% Description :
%
% FIR filter compensator to correct freq response after CIC filter.
%
% -------------------------------------------------------------------------
%
% Version : 1.0
% Date : 2017.06.03
%
%% ------------------------------------------------------------------------
%
% GNU GENERAL PUBLIC LICENSE
% Version 3, 29 June 2007
%
% Copyright (c) 2018 Kapitanov Alexander
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
%
% THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
% APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
% HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
% OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
% PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
% IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
% ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
%
%% ------------------------------------------------------------------------
set(0, 'DefaultAxesFontSize', 11, 'DefaultAxesFontName', 'Times New Roman');
set(0, 'DefaultTextFontSize', 11, 'DefaultTextFontName', 'Times New Roman');
close all;
clear all;
%% ------------------------------------------------------------------------
% ---- CIC Filter Parameters
% ------------------------------------------------------------------------
R = 160; % Decimation factor 122.880mhz->768khz
N = 5; % Number of stages
M = 1; % Differential delay (only 1)
%% ------------------------------------------------------------------------
% ---- FIR filter parameters
% ------------------------------------------------------------------------
NFIR = 256; % Filter order, must be odd when Fo = 0.5 !!!
Bc = 32; % Coef. Bit-width
Fo = 0.245; % Normalized Cutoff: 0.2 < Fo < 0.5;
BETA = 8; % BETA parameter for Kaiser window (if IS_WIND = 'Y')
%% ------------------------------------------------------------------------
% ---- Save data parameters
% ------------------------------------------------------------------------
IS_COE = 'Y'; % create *.COE Xilinx file
IS_HDR = 'N'; % create *.H file (header)
IS_WIND = 'Y'; % use Kaiser Window for FIR corrector
IS_PLOT_IDL = 'Y'; % plot ideal response
IS_PLOT_FIR = 'Y'; % plot FIR filter IR
IS_PLOT_ERR = 'Y'; % plot total error response in passband
%% ------------------------------------------------------------------------
% ---- CIC Compensator Design
% ------------------------------------------------------------------------
NFFT = 2^16; % FFT points for Freq Response (spectrum)
STEP = 1/NFFT; % Step size
w = -pi:2*pi/NFFT:pi-2*pi/NFFT;
ff = 0:1/NFFT:1-1/NFFT;
z = exp(1j * w);
Fc = 1/(2*R);
Fr = Fo/R;
% 1 way:
%HCIC = (1/R * (1-z.^(-R*M))./(1-z.^(-1))).^ N;
% 2 way:
HCIC = (R^-N*abs(1*M*sin(pi*M*R*ff) ./ sin(pi*ff)).^N);
HCICdb = 20 * log10(abs(HCIC));
fp = [0:STEP:Fo]; % Pass band frequency dots
fs = [(Fo+STEP):STEP:0.5]; % Stop band frequency dots
f = [fp fs]*2; % Normalized frequency dots
f(end) = 1;
% Calculate ideal response
Mp = ones(1, length(fp)); % Pass band response; Mp(1) = 1
Mp(2:end) = abs(M * R * sin(pi*fp(2:end)/R) ./ sin(pi*M*fp(2:end))).^(N);
Mf = [Mp zeros(1, length(fs))];
if (IS_PLOT_IDL == 'Y')
figure('name','FIR Ideal Response', 'Numbertitle', 'off')
plot(f/2, Mf, '-.', 'LineWidth', 2, 'Color',[0 0 1]);
title([{'FIR Ideal Response'};{sprintf('Fo = %i',Fo)}]);
xlabel ('Freq (\pi x rad / samples)');
ylabel ('Magnitude');
axis tight;
legend([{sprintf('Fo = %i',Fo)}]);
grid on;
end
% Calculate FIR
hFIR = fir2(NFIR-1, f, Mf); % Filter length NFIR
hFIR = hFIR / max(hFIR); % Double coefficients
hCOE = round(hFIR*(2^(Bc-1)-1)); % Fixed point coefficients
% Windowed FIR (Kaiser with BETA)
if (IS_WIND == 'Y')
WIND = kaiser(NFIR, BETA); % KAISER WINDOW IS USED!
hWIND = fir1(NFIR-1, Fo/R, 'low', WIND);
hNEW = hCOE .* hWIND;% conv2(hCOE,Hwind);
hCOE = hNEW;
end
if (IS_PLOT_FIR == 'Y')
figure('name','FIR Response', 'Numbertitle', 'off')
plot(hFIR, '-', 'LineWidth', 2, 'Color',[1 0 0]);
title([{'FIR Response'};{sprintf('Order = %i',NFIR)}]);
xlabel ('Samples');
ylabel ('Magnitude');
axis tight;
legend([{sprintf('Order = %i',NFIR)}]);
grid on;
end
hFFT = 20 * log10(abs(fft(hCOE, ceil(NFFT/R))));
hFFT = hFFT - max(hFFT);
H_amp = repmat(hFFT, 1, R);
H_amp = H_amp(1:length(ff));
H_amp = H_amp - max(H_amp);
H_comp = HCICdb + H_amp;
H_comp = H_comp - max(H_comp);
%% ------------------------------------------------------------------------
% ---- Plot results
% ------------------------------------------------------------------------
% ---- Figure #1
figure('name','CIC/FIR Frequency Response', 'Numbertitle', 'off')
plot(ff, HCICdb - max(HCICdb), '-.', 'LineWidth', 2, 'Color',[0 0 1]);
hold on;
plot(ff, H_amp, '--', 'LineWidth', 2, 'Color',[0 0.4 0]);
hold on;
plot(ff, H_comp, '-', 'LineWidth', 2, 'Color',[1 0 0]);
hold on;
title([{'CIC, Comp. FIR and Result'};{sprintf('Filter Order = %i, Coef. width = %i',NFIR,Bc)}]);
xlabel ('Freq (\pi x rad / samples)');
ylabel ('Magnitude (dB)');
axis([0 ff(NFFT)/2 -100 5]);
line([Fr Fr], [-400 200], 'LineWidth', 1, 'linestyle', '--', 'Color', [0 0 0]);
line([Fc Fc], [-400 200], 'LineWidth', 1, 'linestyle', '--', 'Color', [0 0 0]);
line([2*Fc 2*Fc], [-400 200], 'LineWidth', 1, 'linestyle', '--', 'Color', [0 0 0]);
legend('CIC filter','Comp. FIR','Sum Response','location','northeast');
grid on;
% ---- Figure #2
figure('name', 'CIC/FIR Frequency Response (Zoom)', 'Numbertitle', 'off')
plot(ff, HCICdb - max(HCICdb), '-.', 'LineWidth', 2, 'Color',[0 0 1]);
hold on;
plot(ff, H_amp, '--', 'LineWidth', 2, 'Color',[0 0.4 0]);
hold on;
plot(ff, H_comp, '-', 'LineWidth', 2, 'Color',[1 0 0]);
hold on;
title([{'CIC, Comp. FIR and Result'};{sprintf('Filter Order = %i, Coef. width = %i',NFIR,Bc)}]);
xlabel ('Freq (\pi x rad / samples)');
ylabel ('Magnitude (dB)');
axis([0 ff(NFFT)/(2*R) -7 1]);
line([Fr Fr], [-400 200], 'LineWidth', 1, 'linestyle', '--', 'Color', [0 0 0]);
grid on;
%% ------------------------------------------------------------------------
% ---- Passband irregularity
% ------------------------------------------------------------------------
if (IS_PLOT_ERR == 'Y')
pass = ceil(0.85*length(H_comp)*Fr);
stp = 0:(0.9*Fr)/pass:(0.9*Fr)-(0.9*Fr)/pass;
stp = stp(2:pass);
Irr = H_comp(2:pass);
Ism = mean(Irr);
Iav = (max(Irr)-min(Irr))/2;
figure('name', 'Passband irregularity', 'Numbertitle', 'off')
plot(stp, Irr, '--', 'LineWidth', 2, 'Color',[0 0 1]);
line([0 (0.9*Fr)], [Ism Ism], 'LineWidth', 2, 'linestyle', '-', 'Color', [0 0 0]);
grid on;
title([{'Passband irregularity'};{sprintf('Mean value = %f',Ism)};{sprintf('Freq error = %f (dB)',Iav)}]);
xlabel ('Freq (\pi x rad / samples)');
ylabel ('Magnitude (dB)');
axis tight;
%axis([0 ff(NFFT)/(2*R) -0.05 1]);
end
%% ------------------------------------------------------------------------
% ---- Save coe data to files
% ------------------------------------------------------------------------
if (IS_COE == 'Y')
fid = fopen ('rx.coe', 'w');
fprintf(fid, 'Radix = 10;\n');
fprintf(fid, 'Coefficient_Width = %d;\n', Bc);
fprintf(fid, 'Coefdata =\n');
for i = 1:NFIR
if (i == NFIR)
fprintf(fid, '%d;\n', hCOE(1,i));
else
fprintf(fid, '%d,\n', hCOE(1,i));
end
end
fclose(fid);
end
if (IS_HDR == 'Y')
fid = fopen ('fir_filter.h', 'w');
fprintf(fid, 'const int BL = %d;\n', NFIR);
fprintf(fid, 'const int B[%d] = {\n', NFIR);
for i = 1:NFIR
if (i == NFIR)
fprintf(fid, '%d}\n', hCOE(1,i));
else
fprintf(fid, '%d,\n', hCOE(1,i));
end
end
fclose(fid);
end

View File

@@ -1 +0,0 @@
2.800554e+01,-2.710925e+01,1.967645e+01,-4.287149e+00,-1.957808e+01,5.117337e+01,-8.818982e+01,1.265920e+02,-1.606796e+02,1.833972e+02,-1.869879e+02,1.639282e+02,-1.081905e+02,1.662591e+01,1.095636e+02,-2.636392e+02,4.324937e+02,-5.966627e+02,7.311469e+02,-8.075047e+02,7.968760e+02,-6.742095e+02,4.228641e+02,-3.960783e+01,-4.613277e+02,1.045190e+03,-1.656290e+03,2.219916e+03,-2.648113e+03,2.848070e+03,-2.734149e+03,2.240892e+03,-1.337477e+03,3.957720e+01,1.580998e+03,-3.393695e+03,5.212197e+03,-6.807600e+03,7.927908e+03,-8.327317e+03,7.798005e+03,-6.206687e+03,3.525291e+03,1.419623e+02,-4.547706e+03,9.302038e+03,-1.389699e+04,1.774461e+04,-2.023907e+04,2.082478e+04,-1.907877e+04,1.478187e+04,-7.986836e+03,-9.465419e+02,1.133642e+04,-2.221429e+04,3.238679e+04,-4.055105e+04,4.542429e+04,-4.591047e+04,4.124944e+04,-3.117123e+04,1.598991e+04,3.331081e+03,-2.521126e+04,4.753079e+04,-6.781863e+04,8.347012e+04,-9.205268e+04,9.158788e+04,-8.086845e+04,5.967443e+04,-2.896177e+04,-9.123589e+03,5.129846e+04,-9.340721e+04,1.307395e+05,-1.585390e+05,1.724856e+05,-1.692906e+05,1.471358e+05,-1.061204e+05,4.841519e+04,2.165719e+04,-9.792523e+04,1.727483e+05,-2.377826e+05,2.847188e+05,-3.063104e+05,2.971731e+05,-2.547165e+05,1.796076e+05,-7.622019e+04,-4.758281e+04,1.807256e+05,-3.099434e+05,4.207489e+05,-4.990731e+05,5.325616e+05,-5.123526e+05,4.341113e+05,-2.993291e+05,1.154776e+05,1.036826e+05,-3.392237e+05,5.679024e+05,-7.645371e+05,9.037175e+05,-9.629548e+05,9.245141e+05,-7.785383e+05,5.240560e+05,-1.712618e+05,-2.591254e+05,7.348868e+05,-1.214970e+06,1.649588e+06,-1.984594e+06,2.161447e+06,-2.122105e+06,1.806062e+06,-1.152833e+06,8.873687e+04,1.483707e+06,-3.739433e+06,7.013816e+06,-1.203248e+07,1.932583e+07,1.932583e+07,-1.203248e+07,7.013816e+06,-3.739433e+06,1.483707e+06,8.873687e+04,-1.152833e+06,1.806062e+06,-2.122105e+06,2.161447e+06,-1.984594e+06,1.649588e+06,-1.214970e+06,7.348868e+05,-2.591254e+05,-1.712618e+05,5.240560e+05,-7.785383e+05,9.245141e+05,-9.629548e+05,9.037175e+05,-7.645371e+05,5.679024e+05,-3.392237e+05,1.036826e+05,1.154776e+05,-2.993291e+05,4.341113e+05,-5.123526e+05,5.325616e+05,-4.990731e+05,4.207489e+05,-3.099434e+05,1.807256e+05,-4.758281e+04,-7.622019e+04,1.796076e+05,-2.547165e+05,2.971731e+05,-3.063104e+05,2.847188e+05,-2.377826e+05,1.727483e+05,-9.792523e+04,2.165719e+04,4.841519e+04,-1.061204e+05,1.471358e+05,-1.692906e+05,1.724856e+05,-1.585390e+05,1.307395e+05,-9.340721e+04,5.129846e+04,-9.123589e+03,-2.896177e+04,5.967443e+04,-8.086845e+04,9.158788e+04,-9.205268e+04,8.347012e+04,-6.781863e+04,4.753079e+04,-2.521126e+04,3.331081e+03,1.598991e+04,-3.117123e+04,4.124944e+04,-4.591047e+04,4.542429e+04,-4.055105e+04,3.238679e+04,-2.221429e+04,1.133642e+04,-9.465419e+02,-7.986836e+03,1.478187e+04,-1.907877e+04,2.082478e+04,-2.023907e+04,1.774461e+04,-1.389699e+04,9.302038e+03,-4.547706e+03,1.419623e+02,3.525291e+03,-6.206687e+03,7.798005e+03,-8.327317e+03,7.927908e+03,-6.807600e+03,5.212197e+03,-3.393695e+03,1.580998e+03,3.957720e+01,-1.337477e+03,2.240892e+03,-2.734149e+03,2.848070e+03,-2.648113e+03,2.219916e+03,-1.656290e+03,1.045190e+03,-4.613277e+02,-3.960783e+01,4.228641e+02,-6.742095e+02,7.968760e+02,-8.075047e+02,7.311469e+02,-5.966627e+02,4.324937e+02,-2.636392e+02,1.095636e+02,1.662591e+01,-1.081905e+02,1.639282e+02,-1.869879e+02,1.833972e+02,-1.606796e+02,1.265920e+02,-8.818982e+01,5.117337e+01,-1.957808e+01,-4.287149e+00,1.967645e+01,-2.710925e+01,2.800554e+01

View File

@@ -1,252 +0,0 @@
%% ------------------------------------------------------------------------
%
% Title : test_cic.m
% Author : Alexander Kapitanov
% E-mail : sallador@bk.ru
% Version : 1.0
%
% -------------------------------------------------------------------------
%
% Description :
%
% FIR filter compensator to correct freq response after CIC filter.
%
% -------------------------------------------------------------------------
%
% Version : 1.0
% Date : 2017.06.03
%
%% ------------------------------------------------------------------------
%
% GNU GENERAL PUBLIC LICENSE
% Version 3, 29 June 2007
%
% Copyright (c) 2018 Kapitanov Alexander
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
%
% THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
% APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
% HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
% OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
% PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
% IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
% ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
%
%% ------------------------------------------------------------------------
set(0, 'DefaultAxesFontSize', 11, 'DefaultAxesFontName', 'Times New Roman');
set(0, 'DefaultTextFontSize', 11, 'DefaultTextFontName', 'Times New Roman');
close all;
clear all;
%% ------------------------------------------------------------------------
% ---- CIC Filter Parameters
% ------------------------------------------------------------------------
R = 3920; % Decimation factor
N = 3; % Number of stages
M = 1; % Differential delay (only 1)
%% ------------------------------------------------------------------------
% ---- FIR filter parameters
% ------------------------------------------------------------------------
NFIR = 256; % Filter order, must be odd when Fo = 0.5 !!!
Bc = 32; % Coef. Bit-width
Fo = 0.45; % Normalized Cutoff: 0.2 < Fo < 0.5;
BETA = 8; % BETA parameter for Kaiser window (if IS_WIND = 'Y')
%% ------------------------------------------------------------------------
% ---- Save data parameters
% ------------------------------------------------------------------------
IS_COE = 'Y'; % create *.COE Xilinx file
IS_HDR = 'N'; % create *.H file (header)
IS_WIND = 'Y'; % use Kaiser Window for FIR corrector
IS_PLOT_IDL = 'Y'; % plot ideal response
IS_PLOT_FIR = 'Y'; % plot FIR filter IR
IS_PLOT_ERR = 'Y'; % plot total error response in passband
%% ------------------------------------------------------------------------
% ---- CIC Compensator Design
% ------------------------------------------------------------------------
NFFT = 2^16; % FFT points for Freq Response (spectrum)
STEP = 1/NFFT; % Step size
w = -pi:2*pi/NFFT:pi-2*pi/NFFT;
ff = 0:1/NFFT:1-1/NFFT;
z = exp(1j * w);
Fc = 1/(2*R);
Fr = Fo/R;
% 1 way:
%HCIC = (1/R * (1-z.^(-R*M))./(1-z.^(-1))).^ N;
% 2 way:
HCIC = (R^-N*abs(1*M*sin(pi*M*R*ff) ./ sin(pi*ff)).^N);
HCICdb = 20 * log10(abs(HCIC));
fp = [0:STEP:Fo]; % Pass band frequency dots
fs = [(Fo+STEP):STEP:0.5]; % Stop band frequency dots
f = [fp fs]*2; % Normalized frequency dots
f(end) = 1;
% Calculate ideal response
Mp = ones(1, length(fp)); % Pass band response; Mp(1) = 1
Mp(2:end) = abs(M * R * sin(pi*fp(2:end)/R) ./ sin(pi*M*fp(2:end))).^(N);
Mf = [Mp zeros(1, length(fs))];
if (IS_PLOT_IDL == 'Y')
figure('name','FIR Ideal Response', 'Numbertitle', 'off')
plot(f/2, Mf, '-.', 'LineWidth', 2, 'Color',[0 0 1]);
title([{'FIR Ideal Response'};{sprintf('Fo = %i',Fo)}]);
xlabel ('Freq (\pi x rad / samples)');
ylabel ('Magnitude');
axis tight;
legend([{sprintf('Fo = %i',Fo)}]);
grid on;
end
% Calculate FIR
hFIR = fir2(NFIR-1, f, Mf); % Filter length NFIR
hFIR = hFIR / max(hFIR); % Double coefficients
hCOE = round(hFIR*(2^(Bc-1)-1)); % Fixed point coefficients
% Windowed FIR (Kaiser with BETA)
if (IS_WIND == 'Y')
WIND = kaiser(NFIR, BETA); % KAISER WINDOW IS USED!
hWIND = fir1(NFIR-1, Fo/R, 'low', WIND);
hNEW = hCOE .* hWIND;% conv2(hCOE,Hwind);
hCOE = hNEW;
end
if (IS_PLOT_FIR == 'Y')
figure('name','FIR Response', 'Numbertitle', 'off')
plot(hFIR, '-', 'LineWidth', 2, 'Color',[1 0 0]);
title([{'FIR Response'};{sprintf('Order = %i',NFIR)}]);
xlabel ('Samples');
ylabel ('Magnitude');
axis tight;
legend([{sprintf('Order = %i',NFIR)}]);
grid on;
end
hFFT = 20 * log10(abs(fft(hCOE, ceil(NFFT/R))));
hFFT = hFFT - max(hFFT);
H_amp = repmat(hFFT, 1, R);
H_amp = H_amp(1:length(ff));
H_amp = H_amp - max(H_amp);
H_comp = HCICdb + H_amp;
H_comp = H_comp - max(H_comp);
%% ------------------------------------------------------------------------
% ---- Plot results
% ------------------------------------------------------------------------
% ---- Figure #1
figure('name','CIC/FIR Frequency Response', 'Numbertitle', 'off')
plot(ff, HCICdb - max(HCICdb), '-.', 'LineWidth', 2, 'Color',[0 0 1]);
hold on;
plot(ff, H_amp, '--', 'LineWidth', 2, 'Color',[0 0.4 0]);
hold on;
plot(ff, H_comp, '-', 'LineWidth', 2, 'Color',[1 0 0]);
hold on;
title([{'CIC, Comp. FIR and Result'};{sprintf('Filter Order = %i, Coef. width = %i',NFIR,Bc)}]);
xlabel ('Freq (\pi x rad / samples)');
ylabel ('Magnitude (dB)');
axis([0 ff(NFFT)/2 -100 5]);
line([Fr Fr], [-400 200], 'LineWidth', 1, 'linestyle', '--', 'Color', [0 0 0]);
line([Fc Fc], [-400 200], 'LineWidth', 1, 'linestyle', '--', 'Color', [0 0 0]);
line([2*Fc 2*Fc], [-400 200], 'LineWidth', 1, 'linestyle', '--', 'Color', [0 0 0]);
legend('CIC filter','Comp. FIR','Sum Response','location','northeast');
grid on;
% ---- Figure #2
figure('name', 'CIC/FIR Frequency Response (Zoom)', 'Numbertitle', 'off')
plot(ff, HCICdb - max(HCICdb), '-.', 'LineWidth', 2, 'Color',[0 0 1]);
hold on;
plot(ff, H_amp, '--', 'LineWidth', 2, 'Color',[0 0.4 0]);
hold on;
plot(ff, H_comp, '-', 'LineWidth', 2, 'Color',[1 0 0]);
hold on;
title([{'CIC, Comp. FIR and Result'};{sprintf('Filter Order = %i, Coef. width = %i',NFIR,Bc)}]);
xlabel ('Freq (\pi x rad / samples)');
ylabel ('Magnitude (dB)');
axis([0 ff(NFFT)/(2*R) -7 1]);
line([Fr Fr], [-400 200], 'LineWidth', 1, 'linestyle', '--', 'Color', [0 0 0]);
grid on;
%% ------------------------------------------------------------------------
% ---- Passband irregularity
% ------------------------------------------------------------------------
if (IS_PLOT_ERR == 'Y')
pass = ceil(0.85*length(H_comp)*Fr);
stp = 0:(0.9*Fr)/pass:(0.9*Fr)-(0.9*Fr)/pass;
stp = stp(2:pass);
Irr = H_comp(2:pass);
Ism = mean(Irr);
Iav = (max(Irr)-min(Irr))/2;
figure('name', 'Passband irregularity', 'Numbertitle', 'off')
plot(stp, Irr, '--', 'LineWidth', 2, 'Color',[0 0 1]);
line([0 (0.9*Fr)], [Ism Ism], 'LineWidth', 2, 'linestyle', '-', 'Color', [0 0 0]);
grid on;
title([{'Passband irregularity'};{sprintf('Mean value = %f',Ism)};{sprintf('Freq error = %f (dB)',Iav)}]);
xlabel ('Freq (\pi x rad / samples)');
ylabel ('Magnitude (dB)');
axis tight;
%axis([0 ff(NFFT)/(2*R) -0.05 1]);
end
%% ------------------------------------------------------------------------
% ---- Save coe data to files
% ------------------------------------------------------------------------
if (IS_COE == 'Y')
fid = fopen ('tx.coe', 'w');
fprintf(fid, 'Radix = 10;\n');
fprintf(fid, 'Coefficient_Width = %d;\n', Bc);
fprintf(fid, 'Coefdata =\n');
for i = 1:NFIR
if (i == NFIR)
fprintf(fid, '%d;\n', hCOE(1,i));
else
fprintf(fid, '%d,\n', hCOE(1,i));
end
end
fclose(fid);
end
if (IS_HDR == 'Y')
fid = fopen ('fir_filter.h', 'w');
fprintf(fid, 'const int BL = %d;\n', NFIR);
fprintf(fid, 'const int B[%d] = {\n', NFIR);
for i = 1:NFIR
if (i == NFIR)
fprintf(fid, '%d}\n', hCOE(1,i));
else
fprintf(fid, '%d,\n', hCOE(1,i));
end
end
fclose(fid);
end

View File

@@ -1,2 +0,0 @@
fontconvert DS-DIGI.TTF 18 > font18pt7b.h
fontconvert FZCuYuan-M03S.TTF 6 > font6pt.h

Binary file not shown.

Binary file not shown.

View File

@@ -1,10 +0,0 @@
CAT система работает через виртуальную пару COM портов, это значит что клиентское приложение трансивера подключено к первому порту,
а любая другая программа, использующая CAT систему, подключается ко второму порту пары.
Происходит связка <HamRadio программа> <-> COM <-> COM <-> WIFI клиент <-> Сеть <-> Трансивер
1. Устанавливаем https://sourceforge.net/projects/com0com/
2. На трансивере включаем WIFI CAT Server
3. В программе com0com активируем виртуальную пару, например COM10 (для приложений) и COM11 (для WIFI клиента)
4. Запускаем WiFi Client, выбираем COM порт (например COM11), IP-адрес трансивера, нажимаем соединиться.
5. Запускаем нужное приложение, выбираем парный COM-порт (например COM10), скороть порта любая, управление потоком - NONE
6. Готово

Binary file not shown.

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="UA3REO_WIFIClient.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<userSettings>
<UA3REO_WIFIClient.Properties.Settings>
<setting name="com_port" serializeAs="String">
<value>COM11</value>
</setting>
<setting name="address" serializeAs="String">
<value>192.168.0.</value>
</setting>
</UA3REO_WIFIClient.Properties.Settings>
</userSettings>
</configuration>

View File

@@ -1,22 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace UA3REO_WIFIClient
{
static class Program
{
/// <summary>
/// Главная точка входа для приложения.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new mainForm());
}
}
}

View File

@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Общие сведения об этой сборке предоставляются следующим набором
// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
// связанных со сборкой.
[assembly: AssemblyTitle("UA3REO_WIFIClient")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UA3REO_WIFIClient")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
// COM, следует установить атрибут ComVisible в TRUE для этого типа.
[assembly: ComVisible(false)]
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
[assembly: Guid("e735bb25-0057-4e11-8e1c-81e260da430f")]
// Сведения о версии сборки состоят из указанных ниже четырех значений:
//
// Основной номер версии
// Дополнительный номер версии
// Номер сборки
// Редакция
//
// Можно задать все значения или принять номера сборки и редакции по умолчанию
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,71 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программным средством.
// Версия среды выполнения: 4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если
// код создан повторно.
// </auto-generated>
//------------------------------------------------------------------------------
namespace UA3REO_WIFIClient.Properties
{
/// <summary>
/// Класс ресурсов со строгим типом для поиска локализованных строк и пр.
/// </summary>
// Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder
// класс с помощью таких средств, как ResGen или Visual Studio.
// Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen
// с параметром /str или заново постройте свой VS-проект.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Возврат кэшированного экземпляра ResourceManager, используемого этим классом.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UA3REO_WIFIClient.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Переопределяет свойство CurrentUICulture текущего потока для всех
/// подстановки ресурсов с помощью этого класса ресурсов со строгим типом.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -1,50 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace UA3REO_WIFIClient.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("COM11")]
public string com_port {
get {
return ((string)(this["com_port"]));
}
set {
this["com_port"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("192.168.0.")]
public string address {
get {
return ((string)(this["address"]));
}
set {
this["address"] = value;
}
}
}
}

View File

@@ -1,12 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="UA3REO_WIFIClient.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="com_port" Type="System.String" Scope="User">
<Value Profile="(Default)">COM11</Value>
</Setting>
<Setting Name="address" Type="System.String" Scope="User">
<Value Profile="(Default)">192.168.0.</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@@ -1,83 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E735BB25-0057-4E11-8E1C-81E260DA430F}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>UA3REO_WIFIClient</RootNamespace>
<AssemblyName>UA3REO_WIFIClient</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="mainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="mainForm.Designer.cs">
<DependentUpon>mainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="mainForm.resx">
<DependentUpon>mainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -1,25 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30002.166
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UA3REO_WIFIClient", "UA3REO_WIFIClient.csproj", "{E735BB25-0057-4E11-8E1C-81E260DA430F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E735BB25-0057-4E11-8E1C-81E260DA430F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E735BB25-0057-4E11-8E1C-81E260DA430F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E735BB25-0057-4E11-8E1C-81E260DA430F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E735BB25-0057-4E11-8E1C-81E260DA430F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {16FDDBBC-2648-4479-A39C-EC8E55DFD8D2}
EndGlobalSection
EndGlobal

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="UA3REO_WIFIClient.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<userSettings>
<UA3REO_WIFIClient.Properties.Settings>
<setting name="com_port" serializeAs="String">
<value>COM11</value>
</setting>
<setting name="address" serializeAs="String">
<value>192.168.0.</value>
</setting>
</UA3REO_WIFIClient.Properties.Settings>
</userSettings>
</configuration>

View File

@@ -1,134 +0,0 @@
namespace UA3REO_WIFIClient
{
partial class mainForm
{
/// <summary>
/// Обязательная переменная конструктора.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Код, автоматически созданный конструктором форм Windows
/// <summary>
/// Требуемый метод для поддержки конструктора — не изменяйте
/// содержимое этого метода с помощью редактора кода.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.connectButton = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label();
this.statusLabel = new System.Windows.Forms.Label();
this.portComboBox = new System.Windows.Forms.ComboBox();
this.addressTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(62, 13);
this.label1.TabIndex = 0;
this.label1.Text = "COM Порт:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(151, 9);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(115, 13);
this.label3.TabIndex = 2;
this.label3.Text = "IP-адрес трансивера:";
//
// connectButton
//
this.connectButton.Location = new System.Drawing.Point(283, 24);
this.connectButton.Name = "connectButton";
this.connectButton.Size = new System.Drawing.Size(85, 23);
this.connectButton.TabIndex = 3;
this.connectButton.Text = "Соединиться";
this.connectButton.UseVisualStyleBackColor = true;
this.connectButton.Click += new System.EventHandler(this.connectButton_Click);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(12, 60);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(44, 13);
this.label4.TabIndex = 4;
this.label4.Text = "Статус:";
//
// statusLabel
//
this.statusLabel.AutoSize = true;
this.statusLabel.Location = new System.Drawing.Point(12, 73);
this.statusLabel.Name = "statusLabel";
this.statusLabel.Size = new System.Drawing.Size(10, 13);
this.statusLabel.TabIndex = 5;
this.statusLabel.Text = "-";
//
// portComboBox
//
this.portComboBox.FormattingEnabled = true;
this.portComboBox.Location = new System.Drawing.Point(12, 26);
this.portComboBox.Name = "portComboBox";
this.portComboBox.Size = new System.Drawing.Size(121, 21);
this.portComboBox.TabIndex = 6;
this.portComboBox.DropDown += new System.EventHandler(this.portComboBox_DropDown);
//
// addressTextBox
//
this.addressTextBox.Location = new System.Drawing.Point(154, 27);
this.addressTextBox.Name = "addressTextBox";
this.addressTextBox.Size = new System.Drawing.Size(123, 20);
this.addressTextBox.TabIndex = 7;
//
// mainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(386, 98);
this.Controls.Add(this.addressTextBox);
this.Controls.Add(this.portComboBox);
this.Controls.Add(this.statusLabel);
this.Controls.Add(this.label4);
this.Controls.Add(this.connectButton);
this.Controls.Add(this.label3);
this.Controls.Add(this.label1);
this.Name = "mainForm";
this.Text = "UA3REO Transceiver Client";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.mainForm_FormClosing);
this.Load += new System.EventHandler(this.mainForm_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button connectButton;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label statusLabel;
private System.Windows.Forms.ComboBox portComboBox;
private System.Windows.Forms.TextBox addressTextBox;
}
}

View File

@@ -1,161 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO.Ports;
using System.Threading;
using System.Net.Sockets;
namespace UA3REO_WIFIClient
{
public partial class mainForm : Form
{
public static SerialPort port = new SerialPort();
private Thread mainThread = new Thread(new ThreadStart(thread_loop));
public static TcpClient tcp_client = new TcpClient();
public static System.Windows.Forms.Label statusLabelStatic;
public static string address = "";
public mainForm()
{
InitializeComponent();
statusLabelStatic = statusLabel;
}
private void mainForm_Load(object sender, EventArgs e)
{
scanPorts();
addressTextBox.Text = Properties.Settings.Default.address;
portComboBox.Text = Properties.Settings.Default.com_port;
}
private void scanPorts()
{
portComboBox.Items.Clear();
foreach (string lport in SerialPort.GetPortNames())
portComboBox.Items.Add(lport);
}
private void portComboBox_DropDown(object sender, EventArgs e)
{
scanPorts();
}
private void mainForm_FormClosing(object sender, FormClosingEventArgs e)
{
mainThread.Abort();
Properties.Settings.Default.address = addressTextBox.Text;
Properties.Settings.Default.com_port = portComboBox.Text;
Properties.Settings.Default.Save();
if (port.IsOpen)
port.Close();
}
private void connectButton_Click(object sender, EventArgs e)
{
if (!port.IsOpen)
{
port = new SerialPort(portComboBox.SelectedItem.ToString(), 38400, Parity.None, 8);
port.ReadTimeout = 5000;
port.Encoding = Encoding.ASCII;
port.ReadBufferSize = 65000;
try
{
port.Open();
port.ReadExisting();
}
catch
{
statusLabel.Text = "Ошибка открытия порта";
}
}
if (tcp_client.Connected) tcp_client.Close();
try
{
tcp_client.ReceiveTimeout = 5000;
tcp_client.SendTimeout = 5000;
tcp_client.NoDelay = true;
}
catch { }
connect();
address = addressTextBox.Text;
try { mainThread.Start(); } catch { }
}
public static void setStatus(string text)
{
try
{
statusLabelStatic.Invoke((MethodInvoker)delegate
{
// Running on the UI thread
Console.WriteLine(text);
statusLabelStatic.Text = text;
});
}
catch { }
}
public static void connect()
{
try
{
setStatus("Соединяюсь с трансивером");
tcp_client = new TcpClient();
tcp_client.Connect(address, 6784);
setStatus("Соединение установлено, жду команды");
}
catch (Exception e)
{
Console.WriteLine(e.Message);
setStatus(e.Message);
}
}
public static void thread_loop()
{
ASCIIEncoding ascii = new ASCIIEncoding();
string buffer = "";
while (true)
{
if (port.BytesToRead > 0 || buffer.IndexOf(";") > 0)
{
buffer += port.ReadExisting();
if (buffer.IndexOf(";") > 0)
{
string command = buffer.Substring(0, buffer.IndexOf(";"));
buffer = buffer.Substring(buffer.IndexOf(";") + 1);
command = command.Trim()+"\n";
if (command != "")
{
setStatus("Получена команда: " + command.Trim());
byte[] send_buffer = ascii.GetBytes(command);
try
{
Console.WriteLine("Отправляю на сервер: " + ascii.GetString(send_buffer).Trim());
tcp_client.GetStream().Write(send_buffer, 0, command.Length);
}
catch
{ connect(); }
}
}
}
if(tcp_client.Connected && tcp_client.GetStream().DataAvailable)
{
int len = tcp_client.Available;
byte[] read_buffer = new byte[len];
tcp_client.GetStream().Read(read_buffer, 0, len);
string answer = ascii.GetString(read_buffer);
setStatus("Получен ответ: " + answer);
port.Write(answer);
}
Thread.Sleep(1);
}
}
}
}

View File

@@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

Binary file not shown.

View File

@@ -1,233 +0,0 @@
using System;
using System.Text;
using System.IO;
using System.Collections.Generic;
namespace file2rle
{
class Program
{
static FileStream in_file;
static FileStream out_file;
static byte[] out_bytes;
static StringBuilder hex = new StringBuilder(2);
static UInt32 out_count = 0;
static UInt32 in_position = 0;
const bool debug = false;
static void Main(string[] args)
{
if(args.Length!=2)
{
Console.WriteLine("Set argument <in_file> <out_file>");
return;
}
string in_filename = args[0];
string out_filename = args[1];
if (!File.Exists(in_filename))
{
Console.WriteLine("Infile not exist");
return;
}
in_file = File.OpenRead(in_filename);
if (in_file.Length == 0)
{
Console.WriteLine("Infile has zero length");
return;
}
if (File.Exists(out_filename))
File.Delete(out_filename);
out_file = File.OpenWrite(out_filename);
out_filename = out_filename.Substring(out_filename.LastIndexOf("\\")+1).Replace(".", "_").ToUpper();
in_filename = in_filename.Substring(in_filename.LastIndexOf("\\")+1).Replace(".", "_").ToUpper();
out_bytes = Encoding.UTF8.GetBytes("#ifndef __" + out_filename + "_H\r\n");
out_file.Write(out_bytes, 0, out_bytes.Length);
out_bytes = Encoding.UTF8.GetBytes("#define __" + out_filename + "_H\r\n");
out_file.Write(out_bytes, 0, out_bytes.Length);
out_bytes = Encoding.UTF8.GetBytes("\r\n#include <stdint.h>\r\n");
out_file.Write(out_bytes, 0, out_bytes.Length);
out_bytes = Encoding.UTF8.GetBytes("\r\nstatic const uint8_t FILES_" + in_filename + "[] = {\r\n");
out_file.Write(out_bytes, 0, out_bytes.Length);
int prev = in_file.ReadByte();
int replay_count = 0;
List<sbyte> neg_bytes = new List<sbyte>();
long filesize = in_file.Length;
if (filesize > 0x1000FF)
filesize = 0x1000FF; //trim for 1mb flash
while (in_position < filesize)
{
int current = in_file.ReadByte();
if (prev == current) //повторы
{
if (replay_count < 0) //начались повторы, сохраняем накопленные неповторяющиеся
{
while (replay_count < -127)
{
if (debug)
appendByteN(-127);
else
appendByte((sbyte)-127);
int tcnt = 0;
foreach (byte point in neg_bytes)
{
appendByte((sbyte)point);
tcnt++;
if (tcnt == 127)
break;
}
neg_bytes.RemoveRange(0, 127);
replay_count += 127;
}
if (debug)
appendByteN(replay_count);
else
appendByte((sbyte)replay_count);
foreach (byte point in neg_bytes)
appendByte((sbyte)point);
neg_bytes.Clear();
replay_count = 0;
}
replay_count++;
}
else //нет повторов
{
if (replay_count > 0) //сохраняем накопленные повторы
{
replay_count++;
while (replay_count > 127)
{
if (debug)
appendByteP(127);
else
appendByte(127);
appendByte((sbyte)prev);
replay_count -= 127;
}
if (debug)
appendByteP(replay_count);
else
appendByte((sbyte)replay_count);
appendByte((sbyte)prev);
replay_count = 0;
}
else //иначе накапливаем неповторяющиеся
{
neg_bytes.Add((sbyte)prev);
replay_count--;
}
}
in_position++;
prev = current;
}
if (replay_count > 0) //сохраняем накопленные повторы
{
replay_count++;
while (replay_count > 127)
{
if (debug)
appendByteP(127);
else
appendByte(127);
appendByte((sbyte)prev);
replay_count -= 127;
}
if (debug)
appendByteP(replay_count);
else
appendByte((sbyte)replay_count);
appendByte((sbyte)prev);
replay_count = 0;
}
//сохраняем накопленные неповторяющиеся
while (replay_count < -127)
{
if (debug)
appendByteN(-127);
else
appendByte((sbyte)-127);
int tcnt = 0;
foreach (byte point in neg_bytes)
{
appendByte((sbyte)point);
tcnt++;
if (tcnt == 127)
break;
}
neg_bytes.RemoveRange(0, 127);
replay_count += 127;
}
if (debug)
appendByteN(replay_count);
else
appendByte((sbyte)replay_count);
foreach (byte point in neg_bytes)
appendByte((sbyte)point);
neg_bytes.Clear();
replay_count = 0;
out_bytes = Encoding.UTF8.GetBytes("\r\n};\r\n");
out_file.Write(out_bytes, 0, out_bytes.Length);
out_bytes = Encoding.UTF8.GetBytes("\r\n#endif\r\n");
out_file.Write(out_bytes, 0, out_bytes.Length);
in_file.Close();
out_file.Close();
Console.WriteLine("End.");
}
static void appendByteN(int data)
{
out_bytes = Encoding.UTF8.GetBytes("N" + data.ToString() + ", ");
out_file.Write(out_bytes, 0, out_bytes.Length);
out_count++;
if ((out_count % 32) == 0)
{
out_bytes = Encoding.UTF8.GetBytes("\r\n");
out_file.Write(out_bytes, 0, out_bytes.Length);
}
}
static void appendByteP(int data)
{
out_bytes = Encoding.UTF8.GetBytes("P" + data.ToString() + ", ");
out_file.Write(out_bytes, 0, out_bytes.Length);
out_count++;
if ((out_count % 32) == 0)
{
out_bytes = Encoding.UTF8.GetBytes("\r\n");
out_file.Write(out_bytes, 0, out_bytes.Length);
}
}
static void appendByte(sbyte data)
{
hex.Clear();
hex.AppendFormat("{0:x2}", data);
out_bytes = Encoding.UTF8.GetBytes("0x" + hex.ToString().ToUpper() + ", ");
out_file.Write(out_bytes, 0, out_bytes.Length);
out_count++;
if ((out_count % 32) == 0)
{
out_bytes = Encoding.UTF8.GetBytes("\r\n/*"+ in_position +"*/ ");
out_file.Write(out_bytes, 0, out_bytes.Length);
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v3.1",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v3.1": {
"file2rle/1.0.0": {
"runtime": {
"file2rle.dll": {}
}
}
}
},
"libraries": {
"file2rle/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

View File

@@ -1,9 +0,0 @@
{
"runtimeOptions": {
"additionalProbingPaths": [
"C:\\Users\\XGudr\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\XGudr\\.nuget\\packages",
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
]
}
}

View File

@@ -1,9 +0,0 @@
{
"runtimeOptions": {
"tfm": "netcoreapp3.1",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "3.1.0"
}
}
}

View File

@@ -1,8 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
</Project>

View File

@@ -1,25 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30002.166
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "file2rle", "file2rle.csproj", "{028116C6-B10A-4FF1-96DC-A33D89A1AA6A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{028116C6-B10A-4FF1-96DC-A33D89A1AA6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{028116C6-B10A-4FF1-96DC-A33D89A1AA6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{028116C6-B10A-4FF1-96DC-A33D89A1AA6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{028116C6-B10A-4FF1-96DC-A33D89A1AA6A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {68C4AE40-4968-4882-8ED7-3D22CF2520E1}
EndGlobalSection
EndGlobal

View File

@@ -1,23 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("file2rle")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("file2rle")]
[assembly: System.Reflection.AssemblyTitleAttribute("file2rle")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Создано классом WriteCodeFragment MSBuild.

View File

@@ -1 +0,0 @@
d0addd6f2ec60a2de7932b0ab2fbf03ca08598b3

View File

@@ -1 +0,0 @@
4e290fadfe16d97e399a0bb4b7ed5e50b3293bbc

View File

@@ -1,13 +0,0 @@
d:\Dropbox\Develop\Projects\WOLF\STM32\Stuff\file2rle\bin\Release\netcoreapp3.1\file2rle.exe
d:\Dropbox\Develop\Projects\WOLF\STM32\Stuff\file2rle\bin\Release\netcoreapp3.1\file2rle.deps.json
d:\Dropbox\Develop\Projects\WOLF\STM32\Stuff\file2rle\bin\Release\netcoreapp3.1\file2rle.runtimeconfig.json
d:\Dropbox\Develop\Projects\WOLF\STM32\Stuff\file2rle\bin\Release\netcoreapp3.1\file2rle.runtimeconfig.dev.json
d:\Dropbox\Develop\Projects\WOLF\STM32\Stuff\file2rle\bin\Release\netcoreapp3.1\file2rle.dll
d:\Dropbox\Develop\Projects\WOLF\STM32\Stuff\file2rle\bin\Release\netcoreapp3.1\file2rle.pdb
d:\Dropbox\Develop\Projects\WOLF\STM32\Stuff\file2rle\obj\Release\netcoreapp3.1\file2rle.csproj.CoreCompileInputs.cache
d:\Dropbox\Develop\Projects\WOLF\STM32\Stuff\file2rle\obj\Release\netcoreapp3.1\file2rle.AssemblyInfoInputs.cache
d:\Dropbox\Develop\Projects\WOLF\STM32\Stuff\file2rle\obj\Release\netcoreapp3.1\file2rle.AssemblyInfo.cs
d:\Dropbox\Develop\Projects\WOLF\STM32\Stuff\file2rle\obj\Release\netcoreapp3.1\file2rle.dll
d:\Dropbox\Develop\Projects\WOLF\STM32\Stuff\file2rle\obj\Release\netcoreapp3.1\file2rle.pdb
d:\Dropbox\Develop\Projects\WOLF\STM32\Stuff\file2rle\obj\Release\netcoreapp3.1\file2rle.genruntimeconfig.cache
d:\Dropbox\Develop\Projects\WOLF\STM32\Stuff\file2rle\obj\Release\netcoreapp3.1\file2rle.csprojAssemblyReference.cache

View File

@@ -1 +0,0 @@
86c8e15dd33445635927cfaf398408205fd11473

View File

@@ -1,63 +0,0 @@
{
"format": 1,
"restore": {
"d:\\Dropbox\\Develop\\Projects\\WOLF\\STM32\\Stuff\\file2rle\\file2rle.csproj": {}
},
"projects": {
"d:\\Dropbox\\Develop\\Projects\\WOLF\\STM32\\Stuff\\file2rle\\file2rle.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "d:\\Dropbox\\Develop\\Projects\\WOLF\\STM32\\Stuff\\file2rle\\file2rle.csproj",
"projectName": "file2rle",
"projectPath": "d:\\Dropbox\\Develop\\Projects\\WOLF\\STM32\\Stuff\\file2rle\\file2rle.csproj",
"packagesPath": "C:\\Users\\XGudr\\.nuget\\packages\\",
"outputPath": "d:\\Dropbox\\Develop\\Projects\\WOLF\\STM32\\Stuff\\file2rle\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
],
"configFilePaths": [
"C:\\Users\\XGudr\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"netcoreapp3.1"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"netcoreapp3.1": {
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"netcoreapp3.1": {
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.201\\RuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\XGudr\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.5.0</NuGetToolVersion>
</PropertyGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
</Project>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
</Project>

View File

@@ -1,69 +0,0 @@
{
"version": 3,
"targets": {
".NETCoreApp,Version=v3.1": {}
},
"libraries": {},
"projectFileDependencyGroups": {
".NETCoreApp,Version=v3.1": []
},
"packageFolders": {
"C:\\Users\\XGudr\\.nuget\\packages\\": {},
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "d:\\Dropbox\\Develop\\Projects\\WOLF\\STM32\\Stuff\\file2rle\\file2rle.csproj",
"projectName": "file2rle",
"projectPath": "d:\\Dropbox\\Develop\\Projects\\WOLF\\STM32\\Stuff\\file2rle\\file2rle.csproj",
"packagesPath": "C:\\Users\\XGudr\\.nuget\\packages\\",
"outputPath": "d:\\Dropbox\\Develop\\Projects\\WOLF\\STM32\\Stuff\\file2rle\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
],
"configFilePaths": [
"C:\\Users\\XGudr\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"netcoreapp3.1"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"netcoreapp3.1": {
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"netcoreapp3.1": {
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.201\\RuntimeIdentifierGraph.json"
}
}
}
}

View File

@@ -1,8 +0,0 @@
{
"version": 2,
"dgSpecHash": "4VZnGxtKzY8R2EeUusHRoqzUBS1IJW7g/AdjUI8Vs30wENs8xsNJRywqv19X+ltO+6MmDZ2A6qz6pIspd+Bl4A==",
"success": true,
"projectFilePath": "d:\\Dropbox\\Develop\\Projects\\WOLF\\STM32\\Stuff\\file2rle\\file2rle.csproj",
"expectedPackageFiles": [],
"logs": []
}