error LNK2001: неразрешенный внешний символ
Код:
1>Def.obj : error LNK2001: неразрешенный внешний символ ""int __clrcall filt_gen(double,double,double *)" (?filt_gen@@$$FYMHNNPAN@Z)"
1>Def.obj : error LNK2001: неразрешенный внешний символ ""int __clrcall differ_gen(double,double *)" (?differ_gen@@$$FYMHNPAN@Z)"
1>Def.obj : error LNK2001: неразрешенный внешний символ ""int __clrcall differ_gen(double,double *)" (?differ_gen@@$$FYMHNPAN@Z)"
differ_gen((double)lf,resp);
и
filt_gen((double)lf,(double)hf,resp);
Эти функции лежат в файле filt_gen.h
В файле - в котором ругается(filt1.h) пишу
Код:
#pragma once
extern int filt_gen(double lf,double hf,double* resp);
extern int differ_gen(double lf,double* resp);
............
public ref class filt1 : public System::Windows::Forms::Form
{
/// Объявление собственный функций и переменных!
//Функция первоначальной загрузки графической плоскости -
public: void Load_Graw (void)
{.....................
}
public: void Graw_Draw (void)
{..........
differ_gen((double)lf,resp);
filt_gen((double)lf,(double)hf,resp);
..........
extern int filt_gen(double lf,double hf,double* resp);
extern int differ_gen(double lf,double* resp);
............
public ref class filt1 : public System::Windows::Forms::Form
{
/// Объявление собственный функций и переменных!
//Функция первоначальной загрузки графической плоскости -
public: void Load_Graw (void)
{.....................
}
public: void Graw_Draw (void)
{..........
differ_gen((double)lf,resp);
filt_gen((double)lf,(double)hf,resp);
..........
Код:
differ_gen((double)lf,resp);
filt_gen((double)lf,(double)hf,resp);
filt_gen((double)lf,(double)hf,resp);
extern double pi;
extern double Pi2;
filt_gen.cpp
double pi=atan(1.) * 4.;
double Pi2=pi * 2.;
Код:
void cf(double *h,int hsize,double fs, double f0, double sf, double ef, double *rcf, double *icf)
{
double fz,rz,iz;
int i,n,s;
double r_cf,i_cf;
double r_cf_t,sf_w;
s = (int)((ef - f0)/sf) + 1; // frequency step number
fz = Pi2 * f0/fs; // first frequency
sf_w = Pi2 * sf/fs; // frequency step
for(n=0; n<s; ++n){ // complex frequency response calculation init
rz = cos(fz);
iz = -sin(fz);
r_cf = h[hsize-1];
i_cf = 0.0;
for(i=hsize-2; i >= 0; --i) { // complex frequency response calculation
r_cf_t = (r_cf*rz - i_cf*iz) + h[i];
i_cf = (r_cf*iz + i_cf*rz);
r_cf = r_cf_t;
}
rcf[n] = r_cf;
icf[n] = i_cf;
fz = fz + sf_w;
}
}
{
double fz,rz,iz;
int i,n,s;
double r_cf,i_cf;
double r_cf_t,sf_w;
s = (int)((ef - f0)/sf) + 1; // frequency step number
fz = Pi2 * f0/fs; // first frequency
sf_w = Pi2 * sf/fs; // frequency step
for(n=0; n<s; ++n){ // complex frequency response calculation init
rz = cos(fz);
iz = -sin(fz);
r_cf = h[hsize-1];
i_cf = 0.0;
for(i=hsize-2; i >= 0; --i) { // complex frequency response calculation
r_cf_t = (r_cf*rz - i_cf*iz) + h[i];
i_cf = (r_cf*iz + i_cf*rz);
r_cf = r_cf_t;
}
rcf[n] = r_cf;
icf[n] = i_cf;
fz = fz + sf_w;
}
}
Код:
void cf(double *h,int hsize,double fs, double f0, double sf, double ef, double *rcf, double *icf);
Да, либы содержащие _ippMalloc@4 и _ippFree@4
Откуда у тебя эти extern функции?
я подключал их, чтоб использовать в данном файле сами функции, которые лежат в заголовочном файле
Цитата:
Для того чтобы эту функцию можно было использовать в модуле B, нужно объявить там ее прототип:
void f(void);
Слова extern писать не требуется, хотя и не запрещается. Следующие прототипы эквивалентны:
void f(void);
extern void f(void);
void f(void);
Слова extern писать не требуется, хотя и не запрещается. Следующие прототипы эквивалентны:
void f(void);
extern void f(void);
Цитата: KokosSPb
я подключал их, чтоб использовать в данном файле сами функции, которые лежат в заголовочном файле
Если у тебя в h файле функция с телом, то h файл необходимо инклюдить хотя бы в один cpp. Либо тело функции вынести в отдельный cpp и добавить его к проекту.
Код:
#include "StdAfx.h"
#include "filt_gen.h"
#include "filt_gen.h"
Код:
1>Компиляция...
1>filt_gen.cpp
1>vihretok.cpp
1>filt1.cpp
1>Def.cpp
1>AssemblyInfo.cpp
1>Компоновка...
1>filt1.obj : error LNK2005: "double pi" (?pi@@$$Q3NA) уже определен в Def.obj
1>filt1.obj : error LNK2005: "double Pi2" (?Pi2@@$$Q3NA) уже определен в Def.obj
1>filt1.obj : error LNK2005: "void __clrcall cf(double *,int,double,double,double,double,double *,double *)" (?cf@@$$FYMXPANHNNNN00@Z) уже определен в Def.obj
1>filt1.obj : error LNK2005: "int __clrcall differ_gen(double,double *)" (?differ_gen@@$$FYMHNPAN@Z) уже определен в Def.obj
1>filt1.obj : error LNK2005: "int __clrcall filt_gen(double,double,double *)" (?filt_gen@@$$FYMHNNPAN@Z) уже определен в Def.obj
1>vihretok.obj : error LNK2005: "double pi" (?pi@@$$Q3NA) уже определен в Def.obj
1>vihretok.obj : error LNK2005: "double Pi2" (?Pi2@@$$Q3NA) уже определен в Def.obj
1>vihretok.obj : error LNK2005: "void __clrcall cf(double *,int,double,double,double,double,double *,double *)" (?cf@@$$FYMXPANHNNNN00@Z) уже определен в Def.obj
1>vihretok.obj : error LNK2005: "int __clrcall differ_gen(double,double *)" (?differ_gen@@$$FYMHNPAN@Z) уже определен в Def.obj
1>vihretok.obj : error LNK2005: "int __clrcall filt_gen(double,double,double *)" (?filt_gen@@$$FYMHNNPAN@Z) уже определен в Def.obj
1>filt_gen.obj : error LNK2005: "double pi" (?pi@@$$Q3NA) уже определен в Def.obj
1>filt_gen.obj : error LNK2005: "double Pi2" (?Pi2@@$$Q3NA) уже определен в Def.obj
1>filt_gen.obj : error LNK2005: "void __clrcall cf(double *,int,double,double,double,double,double *,double *)" (?cf@@$$FYMXPANHNNNN00@Z) уже определен в Def.obj
1>filt_gen.obj : error LNK2005: "int __clrcall differ_gen(double,double *)" (?differ_gen@@$$FYMHNPAN@Z) уже определен в Def.obj
1>filt_gen.obj : error LNK2005: "int __clrcall filt_gen(double,double,double *)" (?filt_gen@@$$FYMHNNPAN@Z) уже определен в Def.obj
1>Def.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenLowpass_64f(double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenLowpass_64f@@$$J224YG?AW4IppStatus@@NPANHW4IppWinType@@W4IppBool@@@Z)"
1>Def.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenHighpass_64f(double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenHighpass_64f@@$$J224YG?AW4IppStatus@@NPANHW4IppWinType@@W4IppBool@@@Z)"
1>Def.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenBandpass_64f(double,double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenBandpass_64f@@$$J232YG?AW4IppStatus@@NNPANHW4IppWinType@@W4IppBool@@@Z)"
1>Def.obj : error LNK2001: неразрешенный внешний символ ""int __clrcall rflt(double *,int,int,double * const,double * const,double * const,int,int)" (?rflt@@$$FYMHPANHHQAN11HH@Z)"
1>D:\VC\vihretok\Release\vihretok.exe : fatal error LNK1120: 4 неразрешенных внешних элементов
1>Журнал построения был сохранен в "file://d:\VC\vihretok\vihretok\Release\BuildLog.htm"
1>vihretok - ошибок 20, предупреждений 0
========== Построение: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========
1>filt_gen.cpp
1>vihretok.cpp
1>filt1.cpp
1>Def.cpp
1>AssemblyInfo.cpp
1>Компоновка...
1>filt1.obj : error LNK2005: "double pi" (?pi@@$$Q3NA) уже определен в Def.obj
1>filt1.obj : error LNK2005: "double Pi2" (?Pi2@@$$Q3NA) уже определен в Def.obj
1>filt1.obj : error LNK2005: "void __clrcall cf(double *,int,double,double,double,double,double *,double *)" (?cf@@$$FYMXPANHNNNN00@Z) уже определен в Def.obj
1>filt1.obj : error LNK2005: "int __clrcall differ_gen(double,double *)" (?differ_gen@@$$FYMHNPAN@Z) уже определен в Def.obj
1>filt1.obj : error LNK2005: "int __clrcall filt_gen(double,double,double *)" (?filt_gen@@$$FYMHNNPAN@Z) уже определен в Def.obj
1>vihretok.obj : error LNK2005: "double pi" (?pi@@$$Q3NA) уже определен в Def.obj
1>vihretok.obj : error LNK2005: "double Pi2" (?Pi2@@$$Q3NA) уже определен в Def.obj
1>vihretok.obj : error LNK2005: "void __clrcall cf(double *,int,double,double,double,double,double *,double *)" (?cf@@$$FYMXPANHNNNN00@Z) уже определен в Def.obj
1>vihretok.obj : error LNK2005: "int __clrcall differ_gen(double,double *)" (?differ_gen@@$$FYMHNPAN@Z) уже определен в Def.obj
1>vihretok.obj : error LNK2005: "int __clrcall filt_gen(double,double,double *)" (?filt_gen@@$$FYMHNNPAN@Z) уже определен в Def.obj
1>filt_gen.obj : error LNK2005: "double pi" (?pi@@$$Q3NA) уже определен в Def.obj
1>filt_gen.obj : error LNK2005: "double Pi2" (?Pi2@@$$Q3NA) уже определен в Def.obj
1>filt_gen.obj : error LNK2005: "void __clrcall cf(double *,int,double,double,double,double,double *,double *)" (?cf@@$$FYMXPANHNNNN00@Z) уже определен в Def.obj
1>filt_gen.obj : error LNK2005: "int __clrcall differ_gen(double,double *)" (?differ_gen@@$$FYMHNPAN@Z) уже определен в Def.obj
1>filt_gen.obj : error LNK2005: "int __clrcall filt_gen(double,double,double *)" (?filt_gen@@$$FYMHNNPAN@Z) уже определен в Def.obj
1>Def.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenLowpass_64f(double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenLowpass_64f@@$$J224YG?AW4IppStatus@@NPANHW4IppWinType@@W4IppBool@@@Z)"
1>Def.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenHighpass_64f(double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenHighpass_64f@@$$J224YG?AW4IppStatus@@NPANHW4IppWinType@@W4IppBool@@@Z)"
1>Def.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenBandpass_64f(double,double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenBandpass_64f@@$$J232YG?AW4IppStatus@@NNPANHW4IppWinType@@W4IppBool@@@Z)"
1>Def.obj : error LNK2001: неразрешенный внешний символ ""int __clrcall rflt(double *,int,int,double * const,double * const,double * const,int,int)" (?rflt@@$$FYMHPANHHQAN11HH@Z)"
1>D:\VC\vihretok\Release\vihretok.exe : fatal error LNK1120: 4 неразрешенных внешних элементов
1>Журнал построения был сохранен в "file://d:\VC\vihretok\vihretok\Release\BuildLog.htm"
1>vihretok - ошибок 20, предупреждений 0
========== Построение: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========
покажи код
Код чего? какого файла?
для начала filt1.cpp Def.cpp filt1.h Def.h filt_gen.cpp filt_gen.h
Код:
#include "StdAfx.h"
#include "filt1.h"
#include "filt1.h"
Код:
#include "StdAfx.h"
#include "Def.h"
#include "Def.h"
Код:
#pragma once
#include "filt_gen.h"
//extern int filt_gen(double lf,double hf,double* resp);
//extern int differ_gen(double lf,double* resp);
namespace vihretok {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace ZedGraph; // Обязательная добавка для нормальной работы графиков!!!
/// <summary>
/// Сводка для filt1
///
/// Внимание! При изменении имени этого класса необходимо также изменить
/// свойство имени файла ресурсов ("Resource File Name") для средства компиляции управляемого ресурса,
/// связанного со всеми файлами с расширением .resx, от которых зависит данный класс. В противном случае,
/// конструкторы не смогут правильно работать с локализованными
/// ресурсами, сопоставленными данной форме.
/// </summary>
public ref class filt1 : public System::Windows::Forms::Form
{
/// Объявление собственный функций и переменных!
//Функция первоначальной загрузки графической плоскости -
public: void Load_Graw (void)
{
// Получим панель для рисования
ZedGraph::GraphPane ^myPane = zedGraphControl1->GraphPane;
// Очистим список кривых на тот случай, если до этого сигналы уже были нарисованы
myPane->CurveList->Clear();
myPane->GraphObjList->Clear();
//Запрет на самосогласования и выход за установленные границы
myPane->XAxis->Scale->MaxGrace=0;
myPane->XAxis->Scale->MinGrace=0;
myPane->YAxis->Scale->MaxGrace=0;
myPane->YAxis->Scale->MinGrace=0;
// Подписи к графику и к осям
// Установим размеры шрифтов для подписей по осям
myPane->XAxis->Title->FontSpec->Size = 14;
myPane->YAxis->Title->FontSpec->Size = 14;
// Установим размеры шрифта для легенды
myPane->Legend->FontSpec->Size = 12;
// Установим размеры шрифта для общего заголовка
myPane->Title->FontSpec->Size = 13;
myPane->Title->FontSpec->FontColor=System::Drawing::Color::Black;
myPane->Title->Text = "Frequency response |H(f)|";
myPane->XAxis->Title->Text = "f, Hz";
myPane->YAxis->Title->Text = "|H(f)|,dB";
//Установка фона панели графиков (не рабочая часть)
myPane->Fill->Color=System::Drawing::Color::LightGray;
//Установка фона панели отображения графиков
myPane->Chart->Fill = gcnew Fill( Color::White, Color::White, 0 );
//Установка границы вывода графиков
myPane->Chart->Border->Color=System::Drawing::Color::Black;
// Устанавливаем интересующий нас интервал по оси X
myPane->XAxis->Scale->Min = 0;
myPane->XAxis->Scale->Max = 1000;
//Ручная установка шага оси Х - 1 В
myPane->XAxis->Scale->MinorStep = 20;
myPane->XAxis->Scale->MajorStep = 100;
// Устанавливаем интересующий нас интервал по оси Y - значения в мА от -10 до 100 мА
myPane->YAxis->Scale->Min = -80;
myPane->YAxis->Scale->Max = 10;
myPane->YAxis->Scale->MinorStep = 2;
myPane->YAxis->Scale->MajorStep = 10;
//Установка оси "Y" ровно по оси "Х" 0.0
//myPane->YAxis->Cross = 0.0;
//Устанавливаем метки только возле осей!
myPane->XAxis->MajorTic->IsOpposite = false;
myPane->XAxis->MinorTic->IsOpposite = false;
myPane->YAxis->MajorTic->IsOpposite = false;
myPane->YAxis->MinorTic->IsOpposite = false;
//Рисуем сетку по X
myPane->XAxis->MajorGrid->IsVisible=true;
myPane->XAxis->MajorGrid->DashOn=5;
myPane->XAxis->MajorGrid->DashOff=5;
myPane->XAxis->MajorGrid->Color=System::Drawing::Color::Gray;
myPane->XAxis->Color=System::Drawing::Color::Gray;
//Рисуем сетку по Y
myPane->YAxis->MajorGrid->IsVisible=true;
myPane->YAxis->MajorGrid->DashOn=5;
myPane->YAxis->MajorGrid->DashOff=5;
myPane->YAxis->MajorGrid->Color=System::Drawing::Color::Gray;
myPane->YAxis->Color=System::Drawing::Color::Gray;
//******************************************************************************
// Добавляем информацию по регистрам вывода точек
//******************************************************************************
// Делаем 1 временных массива по 200 точек -
RollingPointPairList ^list1= gcnew RollingPointPairList (1001);
// Выводим пустые линии графиков на экран
LineItem ^F1Curve = myPane->AddCurve( "|H(f)|", list1, Color::Red, SymbolType::None);
//Ширина линии в 1/72 дюйма!!!!!!!!!! Хорошо получается при 2!!!!!!!!!
F1Curve->Line->Width=2;
//Задаем что линии гладкии!!!!!!!
F1Curve->Line->IsSmooth=true;
// Вызываем метод AxisChange (), чтобы обновить данные об осях.
// В противном случае на рисунке будет показана только часть графика,
// которая умещается в интервалы по осям, установленные по умолчанию
zedGraphControl1->AxisChange ();
// Обновляем график
zedGraphControl1->Invalidate();
}
//График для первой функции
public: void Graw_Draw (void)
{
//Получаем линии от графиков
LineItem ^F1Curve=(LineItem ^)zedGraphControl1->GraphPane->CurveList[0];
IPointListEdit ^list1= (IPointListEdit ^) F1Curve->Points;
double resp[1001];
Decimal lf;
Decimal hf;
this->button1->Enabled = false;
switch (this->filter_type) {
case 0: // bandpass filter
lf = this->numericUpDown1->Value;
hf = this->numericUpDown2->Value;
zedGraphControl1->GraphPane->YAxis->Title->Text = "|H(f)|,dB";
zedGraphControl1->GraphPane->YAxis->Scale->Min = -80;
zedGraphControl1->GraphPane->YAxis->Scale->Max = 10;
zedGraphControl1->GraphPane->YAxis->Scale->MinorStep = 2;
zedGraphControl1->GraphPane->YAxis->Scale->MajorStep = 10;
if(lf > 0 && lf < 10) {lf = 10; this->numericUpDown1->Value = lf;}
if(hf > 990) {hf = 1000; this->numericUpDown2->Value = hf;}
if(hf - lf < 10) {hf = lf+10; this->numericUpDown2->Value = hf;}
// filt_gen((double)lf,(double)hf,resp);
break;
case 1:
lf = this->numericUpDown3->Value;
zedGraphControl1->GraphPane->YAxis->Title->Text = "|H(f)|";
zedGraphControl1->GraphPane->YAxis->Scale->Min = 0;
zedGraphControl1->GraphPane->YAxis->Scale->Max = 1.2;
zedGraphControl1->GraphPane->YAxis->Scale->MinorStep = 0.02;
zedGraphControl1->GraphPane->YAxis->Scale->MajorStep = 0.1;
// differ_gen((double)lf,resp);
break;
default: break;
}
for (unsigned int i=0; i<1001; i++)
{
list1->Add(i,resp[i]);
}
// Вызываем метод AxisChange (), чтобы обновить данные об осях.
// В противном случае на рисунке будет показана только часть графика,
// которая умещается в интервалы по осям, установленные по умолчанию
zedGraphControl1->AxisChange ();
// Обновляем график
zedGraphControl1->Invalidate();
//************************
this->button1->Enabled = true;
}
public:
filt1(void)
{
InitializeComponent();
//
//TODO: добавьте код конструктора
//
}
protected:
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
~filt1()
{
if (components)
{
delete components;
}
}
private: ZedGraph::ZedGraphControl^ zedGraphControl1;
protected:
private: int filter_type;
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::NumericUpDown^ numericUpDown1;
private: System::Windows::Forms::NumericUpDown^ numericUpDown2;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Label^ label3;
private: System::Windows::Forms::Label^ label4;
private: System::Windows::Forms::Label^ label5;
private: System::Windows::Forms::Panel^ panel1;
private: System::Windows::Forms::RadioButton^ radioButton1;
private: System::Windows::Forms::RadioButton^ radioButton2;
private: System::Windows::Forms::NumericUpDown^ numericUpDown3;
private: System::Windows::Forms::Label^ label6;
private: System::Windows::Forms::Label^ label7;
private: System::Windows::Forms::Panel^ panel2;
private: System::ComponentModel::IContainer^ components;
private:
/// <summary>
/// Требуется переменная конструктора.
/// </summary>
#pragma region Windows Form Designer generated code
/// <summary>
/// Обязательный метод для поддержки конструктора - не изменяйте
/// содержимое данного метода при помощи редактора кода.
/// </summary>
void InitializeComponent(void)
{
this->components = (gcnew System::ComponentModel::Container());
this->zedGraphControl1 = (gcnew ZedGraph::ZedGraphControl());
this->button1 = (gcnew System::Windows::Forms::Button());
this->numericUpDown1 = (gcnew System::Windows::Forms::NumericUpDown());
this->numericUpDown2 = (gcnew System::Windows::Forms::NumericUpDown());
this->label1 = (gcnew System::Windows::Forms::Label());
this->label2 = (gcnew System::Windows::Forms::Label());
this->label3 = (gcnew System::Windows::Forms::Label());
this->label4 = (gcnew System::Windows::Forms::Label());
this->label5 = (gcnew System::Windows::Forms::Label());
this->panel1 = (gcnew System::Windows::Forms::Panel());
this->radioButton1 = (gcnew System::Windows::Forms::RadioButton());
this->radioButton2 = (gcnew System::Windows::Forms::RadioButton());
this->numericUpDown3 = (gcnew System::Windows::Forms::NumericUpDown());
this->label6 = (gcnew System::Windows::Forms::Label());
this->label7 = (gcnew System::Windows::Forms::Label());
this->panel2 = (gcnew System::Windows::Forms::Panel());
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown1))->BeginInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown2))->BeginInit();
this->panel1->SuspendLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown3))->BeginInit();
this->panel2->SuspendLayout();
this->SuspendLayout();
//
// zedGraphControl1
//
this->zedGraphControl1->Location = System::Drawing::Point(12, 12);
this->zedGraphControl1->Name = L"zedGraphControl1";
this->zedGraphControl1->ScrollGrace = 0;
this->zedGraphControl1->ScrollMaxX = 0;
this->zedGraphControl1->ScrollMaxY = 0;
this->zedGraphControl1->ScrollMaxY2 = 0;
this->zedGraphControl1->ScrollMinX = 0;
this->zedGraphControl1->ScrollMinY = 0;
this->zedGraphControl1->ScrollMinY2 = 0;
this->zedGraphControl1->Size = System::Drawing::Size(525, 471);
this->zedGraphControl1->TabIndex = 0;
//
// button1
//
this->button1->Location = System::Drawing::Point(552, 12);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(93, 33);
this->button1->TabIndex = 1;
this->button1->Text = L"Create filter";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &filt1::button1_Click);
//
// numericUpDown1
//
this->numericUpDown1->Increment = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, 0});
this->numericUpDown1->Location = System::Drawing::Point(40, 53);
this->numericUpDown1->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {990, 0, 0, 0});
this->numericUpDown1->Name = L"numericUpDown1";
this->numericUpDown1->Size = System::Drawing::Size(52, 20);
this->numericUpDown1->TabIndex = 2;
//
// numericUpDown2
//
this->numericUpDown2->Increment = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, 0});
this->numericUpDown2->Location = System::Drawing::Point(40, 93);
this->numericUpDown2->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1000, 0, 0, 0});
this->numericUpDown2->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, 0});
this->numericUpDown2->Name = L"numericUpDown2";
this->numericUpDown2->Size = System::Drawing::Size(52, 20);
this->numericUpDown2->TabIndex = 3;
this->numericUpDown2->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, 0});
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(7, 55);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(27, 13);
this->label1->TabIndex = 4;
this->label1->Text = L"Low";
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System::Drawing::Point(7, 95);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(29, 13);
this->label2->TabIndex = 5;
this->label2->Text = L"High";
//
// label3
//
this->label3->AutoSize = true;
this->label3->Location = System::Drawing::Point(98, 55);
this->label3->Name = L"label3";
this->label3->Size = System::Drawing::Size(20, 13);
this->label3->TabIndex = 6;
this->label3->Text = L"Hz";
//
// label4
//
this->label4->AutoSize = true;
this->label4->Location = System::Drawing::Point(98, 95);
this->label4->Name = L"label4";
this->label4->Size = System::Drawing::Size(20, 13);
this->label4->TabIndex = 7;
this->label4->Text = L"Hz\r\n";
//
// label5
//
this->label5->AutoSize = true;
this->label5->Location = System::Drawing::Point(7, 15);
this->label5->Name = L"label5";
this->label5->Size = System::Drawing::Size(84, 26);
this->label5->TabIndex = 8;
this->label5->Text = L"Bandpass filter\r\nFrequency edge";
//
// panel1
//
this->panel1->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
this->panel1->Controls->Add(this->numericUpDown1);
this->panel1->Controls->Add(this->label5);
this->panel1->Controls->Add(this->numericUpDown2);
this->panel1->Controls->Add(this->label4);
this->panel1->Controls->Add(this->label1);
this->panel1->Controls->Add(this->label3);
this->panel1->Controls->Add(this->label2);
this->panel1->Location = System::Drawing::Point(552, 131);
this->panel1->Name = L"panel1";
this->panel1->Size = System::Drawing::Size(128, 133);
this->panel1->TabIndex = 9;
//
// radioButton1
//
this->radioButton1->AutoSize = true;
this->radioButton1->Checked = true;
this->radioButton1->Location = System::Drawing::Point(550, 65);
this->radioButton1->Name = L"radioButton1";
this->radioButton1->Size = System::Drawing::Size(94, 17);
this->radioButton1->TabIndex = 10;
this->radioButton1->TabStop = true;
this->radioButton1->Text = L"Bandpass filter";
this->radioButton1->UseVisualStyleBackColor = true;
this->radioButton1->CheckedChanged += gcnew System::EventHandler(this, &filt1::Bandpass_checked);
//
// radioButton2
//
this->radioButton2->AutoSize = true;
this->radioButton2->Location = System::Drawing::Point(550, 89);
this->radioButton2->Name = L"radioButton2";
this->radioButton2->Size = System::Drawing::Size(85, 17);
this->radioButton2->TabIndex = 11;
this->radioButton2->Text = L"Differentiator";
this->radioButton2->UseVisualStyleBackColor = true;
this->radioButton2->CheckedChanged += gcnew System::EventHandler(this, &filt1::Differentiator_checked);
//
// numericUpDown3
//
this->numericUpDown3->Increment = System::Decimal(gcnew cli::array< System::Int32 >(4) {25, 0, 0, 0});
this->numericUpDown3->Location = System::Drawing::Point(40, 49);
this->numericUpDown3->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1000, 0, 0, 0});
this->numericUpDown3->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {25, 0, 0, 0});
this->numericUpDown3->Name = L"numericUpDown3";
this->numericUpDown3->Size = System::Drawing::Size(52, 20);
this->numericUpDown3->TabIndex = 12;
this->numericUpDown3->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {25, 0, 0, 0});
//
// label6
//
this->label6->AutoSize = true;
this->label6->Location = System::Drawing::Point(101, 55);
this->label6->Name = L"label6";
this->label6->Size = System::Drawing::Size(20, 13);
this->label6->TabIndex = 13;
this->label6->Text = L"Hz";
//
// label7
//
this->label7->AutoSize = true;
this->label7->Location = System::Drawing::Point(7, 18);
this->label7->Name = L"label7";
this->label7->Size = System::Drawing::Size(94, 13);
this->label7->TabIndex = 14;
this->label7->Text = L"Differentiator band";
//
// panel2
//
this->panel2->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
this->panel2->Controls->Add(this->label7);
this->panel2->Controls->Add(this->numericUpDown3);
this->panel2->Controls->Add(this->label6);
this->panel2->Enabled = false;
this->panel2->Location = System::Drawing::Point(552, 293);
this->panel2->Name = L"panel2";
this->panel2->Size = System::Drawing::Size(128, 103);
this->panel2->TabIndex = 15;
//
// filt1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(706, 496);
this->Controls->Add(this->panel2);
this->Controls->Add(this->radioButton2);
this->Controls->Add(this->radioButton1);
this->Controls->Add(this->panel1);
this->Controls->Add(this->button1);
this->Controls->Add(this->zedGraphControl1);
this->Name = L"filt1";
this->Text = L"Eddy current instrument filter";
this->Load += gcnew System::EventHandler(this, &filt1::filt1_Load);
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown1))->EndInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown2))->EndInit();
this->panel1->ResumeLayout(false);
this->panel1->PerformLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown3))->EndInit();
this->panel2->ResumeLayout(false);
this->panel2->PerformLayout();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
this->Graw_Draw();
}
private: System::Void filt1_Load(System::Object^ sender, System::EventArgs^ e) {
this->Load_Graw();
this->filter_type = 0;
}
private: System::Void Bandpass_checked(System::Object^ sender, System::EventArgs^ e) {
this->filter_type = 0;
this->panel2->Enabled = false;
this->panel1->Enabled = true;
}
private: System::Void Differentiator_checked(System::Object^ sender, System::EventArgs^ e) {
this->filter_type = 1;
this->panel2->Enabled = true;
this->panel1->Enabled = false;
}
};
}
#include "filt_gen.h"
//extern int filt_gen(double lf,double hf,double* resp);
//extern int differ_gen(double lf,double* resp);
namespace vihretok {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace ZedGraph; // Обязательная добавка для нормальной работы графиков!!!
/// <summary>
/// Сводка для filt1
///
/// Внимание! При изменении имени этого класса необходимо также изменить
/// свойство имени файла ресурсов ("Resource File Name") для средства компиляции управляемого ресурса,
/// связанного со всеми файлами с расширением .resx, от которых зависит данный класс. В противном случае,
/// конструкторы не смогут правильно работать с локализованными
/// ресурсами, сопоставленными данной форме.
/// </summary>
public ref class filt1 : public System::Windows::Forms::Form
{
/// Объявление собственный функций и переменных!
//Функция первоначальной загрузки графической плоскости -
public: void Load_Graw (void)
{
// Получим панель для рисования
ZedGraph::GraphPane ^myPane = zedGraphControl1->GraphPane;
// Очистим список кривых на тот случай, если до этого сигналы уже были нарисованы
myPane->CurveList->Clear();
myPane->GraphObjList->Clear();
//Запрет на самосогласования и выход за установленные границы
myPane->XAxis->Scale->MaxGrace=0;
myPane->XAxis->Scale->MinGrace=0;
myPane->YAxis->Scale->MaxGrace=0;
myPane->YAxis->Scale->MinGrace=0;
// Подписи к графику и к осям
// Установим размеры шрифтов для подписей по осям
myPane->XAxis->Title->FontSpec->Size = 14;
myPane->YAxis->Title->FontSpec->Size = 14;
// Установим размеры шрифта для легенды
myPane->Legend->FontSpec->Size = 12;
// Установим размеры шрифта для общего заголовка
myPane->Title->FontSpec->Size = 13;
myPane->Title->FontSpec->FontColor=System::Drawing::Color::Black;
myPane->Title->Text = "Frequency response |H(f)|";
myPane->XAxis->Title->Text = "f, Hz";
myPane->YAxis->Title->Text = "|H(f)|,dB";
//Установка фона панели графиков (не рабочая часть)
myPane->Fill->Color=System::Drawing::Color::LightGray;
//Установка фона панели отображения графиков
myPane->Chart->Fill = gcnew Fill( Color::White, Color::White, 0 );
//Установка границы вывода графиков
myPane->Chart->Border->Color=System::Drawing::Color::Black;
// Устанавливаем интересующий нас интервал по оси X
myPane->XAxis->Scale->Min = 0;
myPane->XAxis->Scale->Max = 1000;
//Ручная установка шага оси Х - 1 В
myPane->XAxis->Scale->MinorStep = 20;
myPane->XAxis->Scale->MajorStep = 100;
// Устанавливаем интересующий нас интервал по оси Y - значения в мА от -10 до 100 мА
myPane->YAxis->Scale->Min = -80;
myPane->YAxis->Scale->Max = 10;
myPane->YAxis->Scale->MinorStep = 2;
myPane->YAxis->Scale->MajorStep = 10;
//Установка оси "Y" ровно по оси "Х" 0.0
//myPane->YAxis->Cross = 0.0;
//Устанавливаем метки только возле осей!
myPane->XAxis->MajorTic->IsOpposite = false;
myPane->XAxis->MinorTic->IsOpposite = false;
myPane->YAxis->MajorTic->IsOpposite = false;
myPane->YAxis->MinorTic->IsOpposite = false;
//Рисуем сетку по X
myPane->XAxis->MajorGrid->IsVisible=true;
myPane->XAxis->MajorGrid->DashOn=5;
myPane->XAxis->MajorGrid->DashOff=5;
myPane->XAxis->MajorGrid->Color=System::Drawing::Color::Gray;
myPane->XAxis->Color=System::Drawing::Color::Gray;
//Рисуем сетку по Y
myPane->YAxis->MajorGrid->IsVisible=true;
myPane->YAxis->MajorGrid->DashOn=5;
myPane->YAxis->MajorGrid->DashOff=5;
myPane->YAxis->MajorGrid->Color=System::Drawing::Color::Gray;
myPane->YAxis->Color=System::Drawing::Color::Gray;
//******************************************************************************
// Добавляем информацию по регистрам вывода точек
//******************************************************************************
// Делаем 1 временных массива по 200 точек -
RollingPointPairList ^list1= gcnew RollingPointPairList (1001);
// Выводим пустые линии графиков на экран
LineItem ^F1Curve = myPane->AddCurve( "|H(f)|", list1, Color::Red, SymbolType::None);
//Ширина линии в 1/72 дюйма!!!!!!!!!! Хорошо получается при 2!!!!!!!!!
F1Curve->Line->Width=2;
//Задаем что линии гладкии!!!!!!!
F1Curve->Line->IsSmooth=true;
// Вызываем метод AxisChange (), чтобы обновить данные об осях.
// В противном случае на рисунке будет показана только часть графика,
// которая умещается в интервалы по осям, установленные по умолчанию
zedGraphControl1->AxisChange ();
// Обновляем график
zedGraphControl1->Invalidate();
}
//График для первой функции
public: void Graw_Draw (void)
{
//Получаем линии от графиков
LineItem ^F1Curve=(LineItem ^)zedGraphControl1->GraphPane->CurveList[0];
IPointListEdit ^list1= (IPointListEdit ^) F1Curve->Points;
double resp[1001];
Decimal lf;
Decimal hf;
this->button1->Enabled = false;
switch (this->filter_type) {
case 0: // bandpass filter
lf = this->numericUpDown1->Value;
hf = this->numericUpDown2->Value;
zedGraphControl1->GraphPane->YAxis->Title->Text = "|H(f)|,dB";
zedGraphControl1->GraphPane->YAxis->Scale->Min = -80;
zedGraphControl1->GraphPane->YAxis->Scale->Max = 10;
zedGraphControl1->GraphPane->YAxis->Scale->MinorStep = 2;
zedGraphControl1->GraphPane->YAxis->Scale->MajorStep = 10;
if(lf > 0 && lf < 10) {lf = 10; this->numericUpDown1->Value = lf;}
if(hf > 990) {hf = 1000; this->numericUpDown2->Value = hf;}
if(hf - lf < 10) {hf = lf+10; this->numericUpDown2->Value = hf;}
// filt_gen((double)lf,(double)hf,resp);
break;
case 1:
lf = this->numericUpDown3->Value;
zedGraphControl1->GraphPane->YAxis->Title->Text = "|H(f)|";
zedGraphControl1->GraphPane->YAxis->Scale->Min = 0;
zedGraphControl1->GraphPane->YAxis->Scale->Max = 1.2;
zedGraphControl1->GraphPane->YAxis->Scale->MinorStep = 0.02;
zedGraphControl1->GraphPane->YAxis->Scale->MajorStep = 0.1;
// differ_gen((double)lf,resp);
break;
default: break;
}
for (unsigned int i=0; i<1001; i++)
{
list1->Add(i,resp[i]);
}
// Вызываем метод AxisChange (), чтобы обновить данные об осях.
// В противном случае на рисунке будет показана только часть графика,
// которая умещается в интервалы по осям, установленные по умолчанию
zedGraphControl1->AxisChange ();
// Обновляем график
zedGraphControl1->Invalidate();
//************************
this->button1->Enabled = true;
}
public:
filt1(void)
{
InitializeComponent();
//
//TODO: добавьте код конструктора
//
}
protected:
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
~filt1()
{
if (components)
{
delete components;
}
}
private: ZedGraph::ZedGraphControl^ zedGraphControl1;
protected:
private: int filter_type;
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::NumericUpDown^ numericUpDown1;
private: System::Windows::Forms::NumericUpDown^ numericUpDown2;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Label^ label3;
private: System::Windows::Forms::Label^ label4;
private: System::Windows::Forms::Label^ label5;
private: System::Windows::Forms::Panel^ panel1;
private: System::Windows::Forms::RadioButton^ radioButton1;
private: System::Windows::Forms::RadioButton^ radioButton2;
private: System::Windows::Forms::NumericUpDown^ numericUpDown3;
private: System::Windows::Forms::Label^ label6;
private: System::Windows::Forms::Label^ label7;
private: System::Windows::Forms::Panel^ panel2;
private: System::ComponentModel::IContainer^ components;
private:
/// <summary>
/// Требуется переменная конструктора.
/// </summary>
#pragma region Windows Form Designer generated code
/// <summary>
/// Обязательный метод для поддержки конструктора - не изменяйте
/// содержимое данного метода при помощи редактора кода.
/// </summary>
void InitializeComponent(void)
{
this->components = (gcnew System::ComponentModel::Container());
this->zedGraphControl1 = (gcnew ZedGraph::ZedGraphControl());
this->button1 = (gcnew System::Windows::Forms::Button());
this->numericUpDown1 = (gcnew System::Windows::Forms::NumericUpDown());
this->numericUpDown2 = (gcnew System::Windows::Forms::NumericUpDown());
this->label1 = (gcnew System::Windows::Forms::Label());
this->label2 = (gcnew System::Windows::Forms::Label());
this->label3 = (gcnew System::Windows::Forms::Label());
this->label4 = (gcnew System::Windows::Forms::Label());
this->label5 = (gcnew System::Windows::Forms::Label());
this->panel1 = (gcnew System::Windows::Forms::Panel());
this->radioButton1 = (gcnew System::Windows::Forms::RadioButton());
this->radioButton2 = (gcnew System::Windows::Forms::RadioButton());
this->numericUpDown3 = (gcnew System::Windows::Forms::NumericUpDown());
this->label6 = (gcnew System::Windows::Forms::Label());
this->label7 = (gcnew System::Windows::Forms::Label());
this->panel2 = (gcnew System::Windows::Forms::Panel());
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown1))->BeginInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown2))->BeginInit();
this->panel1->SuspendLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown3))->BeginInit();
this->panel2->SuspendLayout();
this->SuspendLayout();
//
// zedGraphControl1
//
this->zedGraphControl1->Location = System::Drawing::Point(12, 12);
this->zedGraphControl1->Name = L"zedGraphControl1";
this->zedGraphControl1->ScrollGrace = 0;
this->zedGraphControl1->ScrollMaxX = 0;
this->zedGraphControl1->ScrollMaxY = 0;
this->zedGraphControl1->ScrollMaxY2 = 0;
this->zedGraphControl1->ScrollMinX = 0;
this->zedGraphControl1->ScrollMinY = 0;
this->zedGraphControl1->ScrollMinY2 = 0;
this->zedGraphControl1->Size = System::Drawing::Size(525, 471);
this->zedGraphControl1->TabIndex = 0;
//
// button1
//
this->button1->Location = System::Drawing::Point(552, 12);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(93, 33);
this->button1->TabIndex = 1;
this->button1->Text = L"Create filter";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &filt1::button1_Click);
//
// numericUpDown1
//
this->numericUpDown1->Increment = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, 0});
this->numericUpDown1->Location = System::Drawing::Point(40, 53);
this->numericUpDown1->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {990, 0, 0, 0});
this->numericUpDown1->Name = L"numericUpDown1";
this->numericUpDown1->Size = System::Drawing::Size(52, 20);
this->numericUpDown1->TabIndex = 2;
//
// numericUpDown2
//
this->numericUpDown2->Increment = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, 0});
this->numericUpDown2->Location = System::Drawing::Point(40, 93);
this->numericUpDown2->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1000, 0, 0, 0});
this->numericUpDown2->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, 0});
this->numericUpDown2->Name = L"numericUpDown2";
this->numericUpDown2->Size = System::Drawing::Size(52, 20);
this->numericUpDown2->TabIndex = 3;
this->numericUpDown2->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, 0});
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(7, 55);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(27, 13);
this->label1->TabIndex = 4;
this->label1->Text = L"Low";
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System::Drawing::Point(7, 95);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(29, 13);
this->label2->TabIndex = 5;
this->label2->Text = L"High";
//
// label3
//
this->label3->AutoSize = true;
this->label3->Location = System::Drawing::Point(98, 55);
this->label3->Name = L"label3";
this->label3->Size = System::Drawing::Size(20, 13);
this->label3->TabIndex = 6;
this->label3->Text = L"Hz";
//
// label4
//
this->label4->AutoSize = true;
this->label4->Location = System::Drawing::Point(98, 95);
this->label4->Name = L"label4";
this->label4->Size = System::Drawing::Size(20, 13);
this->label4->TabIndex = 7;
this->label4->Text = L"Hz\r\n";
//
// label5
//
this->label5->AutoSize = true;
this->label5->Location = System::Drawing::Point(7, 15);
this->label5->Name = L"label5";
this->label5->Size = System::Drawing::Size(84, 26);
this->label5->TabIndex = 8;
this->label5->Text = L"Bandpass filter\r\nFrequency edge";
//
// panel1
//
this->panel1->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
this->panel1->Controls->Add(this->numericUpDown1);
this->panel1->Controls->Add(this->label5);
this->panel1->Controls->Add(this->numericUpDown2);
this->panel1->Controls->Add(this->label4);
this->panel1->Controls->Add(this->label1);
this->panel1->Controls->Add(this->label3);
this->panel1->Controls->Add(this->label2);
this->panel1->Location = System::Drawing::Point(552, 131);
this->panel1->Name = L"panel1";
this->panel1->Size = System::Drawing::Size(128, 133);
this->panel1->TabIndex = 9;
//
// radioButton1
//
this->radioButton1->AutoSize = true;
this->radioButton1->Checked = true;
this->radioButton1->Location = System::Drawing::Point(550, 65);
this->radioButton1->Name = L"radioButton1";
this->radioButton1->Size = System::Drawing::Size(94, 17);
this->radioButton1->TabIndex = 10;
this->radioButton1->TabStop = true;
this->radioButton1->Text = L"Bandpass filter";
this->radioButton1->UseVisualStyleBackColor = true;
this->radioButton1->CheckedChanged += gcnew System::EventHandler(this, &filt1::Bandpass_checked);
//
// radioButton2
//
this->radioButton2->AutoSize = true;
this->radioButton2->Location = System::Drawing::Point(550, 89);
this->radioButton2->Name = L"radioButton2";
this->radioButton2->Size = System::Drawing::Size(85, 17);
this->radioButton2->TabIndex = 11;
this->radioButton2->Text = L"Differentiator";
this->radioButton2->UseVisualStyleBackColor = true;
this->radioButton2->CheckedChanged += gcnew System::EventHandler(this, &filt1::Differentiator_checked);
//
// numericUpDown3
//
this->numericUpDown3->Increment = System::Decimal(gcnew cli::array< System::Int32 >(4) {25, 0, 0, 0});
this->numericUpDown3->Location = System::Drawing::Point(40, 49);
this->numericUpDown3->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1000, 0, 0, 0});
this->numericUpDown3->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {25, 0, 0, 0});
this->numericUpDown3->Name = L"numericUpDown3";
this->numericUpDown3->Size = System::Drawing::Size(52, 20);
this->numericUpDown3->TabIndex = 12;
this->numericUpDown3->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {25, 0, 0, 0});
//
// label6
//
this->label6->AutoSize = true;
this->label6->Location = System::Drawing::Point(101, 55);
this->label6->Name = L"label6";
this->label6->Size = System::Drawing::Size(20, 13);
this->label6->TabIndex = 13;
this->label6->Text = L"Hz";
//
// label7
//
this->label7->AutoSize = true;
this->label7->Location = System::Drawing::Point(7, 18);
this->label7->Name = L"label7";
this->label7->Size = System::Drawing::Size(94, 13);
this->label7->TabIndex = 14;
this->label7->Text = L"Differentiator band";
//
// panel2
//
this->panel2->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
this->panel2->Controls->Add(this->label7);
this->panel2->Controls->Add(this->numericUpDown3);
this->panel2->Controls->Add(this->label6);
this->panel2->Enabled = false;
this->panel2->Location = System::Drawing::Point(552, 293);
this->panel2->Name = L"panel2";
this->panel2->Size = System::Drawing::Size(128, 103);
this->panel2->TabIndex = 15;
//
// filt1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(706, 496);
this->Controls->Add(this->panel2);
this->Controls->Add(this->radioButton2);
this->Controls->Add(this->radioButton1);
this->Controls->Add(this->panel1);
this->Controls->Add(this->button1);
this->Controls->Add(this->zedGraphControl1);
this->Name = L"filt1";
this->Text = L"Eddy current instrument filter";
this->Load += gcnew System::EventHandler(this, &filt1::filt1_Load);
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown1))->EndInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown2))->EndInit();
this->panel1->ResumeLayout(false);
this->panel1->PerformLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->numericUpDown3))->EndInit();
this->panel2->ResumeLayout(false);
this->panel2->PerformLayout();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
this->Graw_Draw();
}
private: System::Void filt1_Load(System::Object^ sender, System::EventArgs^ e) {
this->Load_Graw();
this->filter_type = 0;
}
private: System::Void Bandpass_checked(System::Object^ sender, System::EventArgs^ e) {
this->filter_type = 0;
this->panel2->Enabled = false;
this->panel1->Enabled = true;
}
private: System::Void Differentiator_checked(System::Object^ sender, System::EventArgs^ e) {
this->filter_type = 1;
this->panel2->Enabled = true;
this->panel1->Enabled = false;
}
};
}
Код:
#pragma once
#include "filt1.h"
//#include "filt_gen.h"
//extern void cf(double *h,int hsize,double fs, double f0, double sf, double ef, double *rcf, double *icf);
//extern int filt_gen(double lf,double hf,double* resp);
//extern int differ_gen(double lf,double* resp);
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace ZedGraph;
//static int click;
//static double coordY[4][64], coordX[4][64];
extern double coordY[4][64], coordX[4][64];
extern bool canalOpen[5];
static double l1,l2[5],l3,t;
static short * pbf;
static int per, Canal;
extern int set_generator(int phase,int amplityde, int canal);
extern int set_amp(int att, int gain, int canal);
extern int set_frequency(double frequency, int freq_unit, int canal);
extern int set_compensator(int phase,int amplityde, int canal);
extern int get_amp1();
extern int balance(int canal);
namespace vihretok {
/// <summary>
/// Сводка для Def
///
/// Внимание! При изменении имени этого класса необходимо также изменить
/// свойство имени файла ресурсов ("Resource File Name") для средства компиляции управляемого ресурса,
/// связанного со всеми файлами с расширением .resx, от которых зависит данный класс. В противном случае,
/// конструкторы не смогут правильно работать с локализованными
/// ресурсами, сопоставленными данной форме.
/// </summary>
public ref class Def : public System::Windows::Forms::Form
{
public: void Load_Graw (void)
{
// Получим панель для рисования
ZedGraph::GraphPane ^myPane1 = zedGraphControl1->GraphPane;
// Очистим список кривых на тот случай, если до этого сигналы уже были нарисованы
//myPane1->CurveList->Clear();
//myPane1->GraphObjList->Clear();
//Запрет на самосогласования и выход за установленные границы
myPane1->XAxis->Scale->MaxGrace=0;
myPane1->XAxis->Scale->MinGrace=0;
myPane1->YAxis->Scale->MaxGrace=0;
myPane1->YAxis->Scale->MinGrace=0;
// Подписи к графику и к осям
// Установим размеры шрифтов для подписей по осям
myPane1->XAxis->Title->FontSpec->Size = 16;
myPane1->YAxis->Title->FontSpec->Size = 16;
// Установим размеры шрифта для легенды
myPane1->Legend->FontSpec->Size = 12;
// Установим размеры шрифта для общего заголовка
myPane1->Title->FontSpec->Size = 17;
myPane1->Title->FontSpec->FontColor=System::Drawing::Color::Brown;
myPane1->Title->Text = "Отклонение по X";
myPane1->XAxis->Title->Text = "Измерение";
myPane1->YAxis->Title->Text = "Отклонение";
//Установка фона панели графиков (не рабочая часть)
myPane1->Fill->Color=System::Drawing::Color::LightBlue;
//Установка фона панели отображения графиков
myPane1->Chart->Fill = gcnew Fill( Color::White, Color::Aqua, 90 );
//Установка границы вывода графиков
myPane1->Chart->Border->Color=System::Drawing::Color::Black;
// Устанавливаем интересующий нас интервал по оси X
myPane1->XAxis->Scale->Min = l2[Convert::ToInt32(lCanal->Text)]-2*t;
myPane1->XAxis->Scale->Max = l2[Convert::ToInt32(lCanal->Text)]+2*t;
//Ручная установка шага оси Х - 1 В
//myPane1->XAxis->Scale->MinorStep = 0.1;
myPane1->XAxis->Scale->MajorStep = 25;
// Устанавливаем интересующий нас интервал по оси Y - значения в мА от -10 до 100 мА
myPane1->YAxis->Scale->Min = -t;
myPane1->YAxis->Scale->Max = t;
//myPane1->YAxis->Scale->MinorStep = 0.1;
myPane1->YAxis->Scale->MajorStep = 25;
//Установка оси "Y" ровно по оси "Х" 0.0
myPane1->XAxis->Cross = 0.0;
//Устанавливаем метки только возле осей!
myPane1->XAxis->MajorTic->IsOpposite = false;
myPane1->XAxis->MinorTic->IsOpposite = false;
myPane1->YAxis->MajorTic->IsOpposite = false;
myPane1->YAxis->MinorTic->IsOpposite = false;
//Рисуем сетку по X
myPane1->XAxis->MajorGrid->IsVisible=true;
myPane1->XAxis->MajorGrid->DashOn=20;
myPane1->XAxis->MajorGrid->DashOff=20;
myPane1->XAxis->MajorGrid->Color=System::Drawing::Color::Gray;
myPane1->XAxis->Color=System::Drawing::Color::Gray;
//Рисуем сетку по Y
myPane1->YAxis->MajorGrid->IsVisible=true;
myPane1->YAxis->MajorGrid->DashOn=20;
myPane1->YAxis->MajorGrid->DashOff=20;
myPane1->YAxis->MajorGrid->Color=System::Drawing::Color::Gray;
myPane1->YAxis->Color=System::Drawing::Color::Gray;
// Получим панель для рисования
ZedGraph::GraphPane ^myPane3 = zedGraphControl3->GraphPane;
// Очистим список кривых на тот случай, если до этого сигналы уже были нарисованы
//myPane2->CurveList->Clear();
//myPane2->GraphObjList->Clear();
//Запрет на самосогласования и выход за установленные границы
myPane3->XAxis->Scale->MaxGrace=0;
myPane3->XAxis->Scale->MinGrace=0;
myPane3->YAxis->Scale->MaxGrace=0;
myPane3->YAxis->Scale->MinGrace=0;
// Подписи к графику и к осям
// Установим размеры шрифтов для подписей по осям
myPane3->XAxis->Title->FontSpec->Size = 16;
myPane3->YAxis->Title->FontSpec->Size = 16;
// Установим размеры шрифта для легенды
myPane3->Legend->FontSpec->Size = 12;
// Установим размеры шрифта для общего заголовка
myPane3->Title->FontSpec->Size = 17;
myPane3->Title->FontSpec->FontColor=System::Drawing::Color::Brown;
myPane3->Title->Text = "Отклонение по Z";
myPane3->XAxis->Title->Text = "Отклонение по Х";
myPane3->YAxis->Title->Text = "Отклонение по Y";
//Установка фона панели графиков (не рабочая часть)
myPane3->Fill->Color=System::Drawing::Color::LightBlue;
//Установка фона панели отображения графиков
myPane3->Chart->Fill = gcnew Fill( Color::White, Color::Aqua, 90 );
//Установка границы вывода графиков
myPane3->Chart->Border->Color=System::Drawing::Color::Black;
// Устанавливаем интересующий нас интервал по оси X
myPane3->XAxis->Scale->Min = -t;
myPane3->XAxis->Scale->Max = t;
//Ручная установка шага оси Х - 1 В
//myPane1->XAxis->Scale->MinorStep = 0.1;
myPane3->XAxis->Scale->MajorStep = 25;
// Устанавливаем интересующий нас интервал по оси Y - значения в мА от -10 до 100 мА
myPane3->YAxis->Scale->Min = -t;
myPane3->YAxis->Scale->Max = t;
//myPane1->YAxis->Scale->MinorStep = 0.1;
myPane3->YAxis->Scale->MajorStep = 25;
//Установка оси "Y" ровно по оси "Х" 0.0
myPane3->XAxis->Cross = 0.0;
//Устанавливаем метки только возле осей!
myPane3->XAxis->MajorTic->IsOpposite = false;
myPane3->XAxis->MinorTic->IsOpposite = false;
myPane3->YAxis->MajorTic->IsOpposite = false;
myPane3->YAxis->MinorTic->IsOpposite = false;
//Рисуем сетку по X
myPane3->XAxis->MajorGrid->IsVisible=true;
myPane3->XAxis->MajorGrid->DashOn=20;
myPane3->XAxis->MajorGrid->DashOff=20;
myPane3->XAxis->MajorGrid->Color=System::Drawing::Color::Gray;
myPane3->XAxis->Color=System::Drawing::Color::Gray;
//Рисуем сетку по Y
myPane3->YAxis->MajorGrid->IsVisible=true;
myPane3->YAxis->MajorGrid->DashOn=20;
myPane3->YAxis->MajorGrid->DashOff=20;
myPane3->YAxis->MajorGrid->Color=System::Drawing::Color::Gray;
myPane3->YAxis->Color=System::Drawing::Color::Gray;
// Получим панель для рисования
ZedGraph::GraphPane ^myPane2 = zedGraphControl2->GraphPane;
// Очистим список кривых на тот случай, если до этого сигналы уже были нарисованы
//myPane2->CurveList->Clear();
//myPane2->GraphObjList->Clear();
//Запрет на самосогласования и выход за установленные границы
myPane2->XAxis->Scale->MaxGrace=0;
myPane2->XAxis->Scale->MinGrace=0;
myPane2->YAxis->Scale->MaxGrace=0;
myPane2->YAxis->Scale->MinGrace=0;
// Подписи к графику и к осям
// Установим размеры шрифтов для подписей по осям
myPane2->XAxis->Title->FontSpec->Size = 16;
myPane2->YAxis->Title->FontSpec->Size = 16;
// Установим размеры шрифта для легенды
myPane2->Legend->FontSpec->Size = 12;
// Установим размеры шрифта для общего заголовка
myPane2->Title->FontSpec->Size = 17;
myPane2->Title->FontSpec->FontColor=System::Drawing::Color::Brown;
myPane2->Title->Text = "Отклонение по Y";
myPane2->XAxis->Title->Text = "Измерение";
myPane2->YAxis->Title->Text = "Отклонение";
//Установка фона панели графиков (не рабочая часть)
myPane2->Fill->Color=System::Drawing::Color::LightBlue;
//Установка фона панели отображения графиков
myPane2->Chart->Fill = gcnew Fill( Color::White, Color::Aqua, 90 );
//Установка границы вывода графиков
myPane2->Chart->Border->Color=System::Drawing::Color::Black;
// Устанавливаем интересующий нас интервал по оси X
myPane2->XAxis->Scale->Min = l2[Convert::ToInt32(lCanal->Text)]-t*2;
myPane2->XAxis->Scale->Max = l2[Convert::ToInt32(lCanal->Text)]+t*2;
//Ручная установка шага оси Х - 1 В
//myPane1->XAxis->Scale->MinorStep = 0.1;
myPane2->XAxis->Scale->MajorStep = 25;
// Устанавливаем интересующий нас интервал по оси Y - значения в мА от -10 до 100 мА
myPane2->YAxis->Scale->Min = -t;
myPane2->YAxis->Scale->Max = t;
//myPane1->YAxis->Scale->MinorStep = 0.1;
myPane2->YAxis->Scale->MajorStep = 25;
//Установка оси "Y" ровно по оси "Х" 0.0
myPane2->XAxis->Cross = 0.0;
//Устанавливаем метки только возле осей!
myPane2->XAxis->MajorTic->IsOpposite = false;
myPane2->XAxis->MinorTic->IsOpposite = false;
myPane2->YAxis->MajorTic->IsOpposite = false;
myPane2->YAxis->MinorTic->IsOpposite = false;
//Рисуем сетку по X
myPane2->XAxis->MajorGrid->IsVisible=true;
myPane2->XAxis->MajorGrid->DashOn=20;
myPane2->XAxis->MajorGrid->DashOff=20;
myPane2->XAxis->MajorGrid->Color=System::Drawing::Color::Gray;
myPane2->XAxis->Color=System::Drawing::Color::Gray;
//Рисуем сетку по Y
myPane2->YAxis->MajorGrid->IsVisible=true;
myPane2->YAxis->MajorGrid->DashOn=20;
myPane2->YAxis->MajorGrid->DashOff=20;
myPane2->YAxis->MajorGrid->Color=System::Drawing::Color::Gray;
myPane2->YAxis->Color=System::Drawing::Color::Gray;
//******************************************************************************
// Добавляем информацию по регистрам вывода точек
//******************************************************************************
RollingPointPairList ^list1 = gcnew RollingPointPairList (64);
RollingPointPairList ^list2 = gcnew RollingPointPairList (64);
RollingPointPairList ^list3 = gcnew RollingPointPairList (64);
// Выводим пустые линии графиков на экран
LineItem ^F1Curve = myPane1->AddCurve( "", list1, Color::Indigo, SymbolType::None);
LineItem ^F2Curve = myPane2->AddCurve( "", list2, Color::Blue, SymbolType::None);
LineItem ^F3Curve = myPane3->AddCurve( "", list3, Color::BlueViolet, SymbolType::None);
//Ширина линии в 1/72 дюйма!!!!!!!!!! Хорошо получается при 2!!!!!!!!!
F1Curve->Line->Width=2;
F2Curve->Line->Width=2;
F3Curve->Line->Width=1;
//Задаем что линии гладкии!!!!!!!
F1Curve->Line->IsSmooth=true;
F2Curve->Line->IsSmooth=true;
F3Curve->Line->IsSmooth=true;
// Вызываем метод AxisChange (), чтобы обновить данные об осях.
// В противном случае на рисунке будет показана только часть графика,
// которая умещается в интервалы по осям, установленные по умолчанию
zedGraphControl1->AxisChange ();
zedGraphControl2->AxisChange ();
zedGraphControl3->AxisChange ();
// Обновляем график
zedGraphControl1->Invalidate();
zedGraphControl2->Invalidate();
zedGraphControl3->Invalidate();
}
//График для функций
public: void Graw_Draw (void)
{
//Получаем линии от графиков
LineItem ^F1Curve=(LineItem ^)zedGraphControl1->GraphPane->CurveList[0];
LineItem ^F2Curve=(LineItem ^)zedGraphControl2->GraphPane->CurveList[0];
LineItem ^F3Curve=(LineItem ^)zedGraphControl3->GraphPane->CurveList[0];
IPointListEdit ^list1= (IPointListEdit ^) F1Curve->Points;
IPointListEdit ^list2= (IPointListEdit ^) F2Curve->Points;
IPointListEdit ^list3= (IPointListEdit ^) F3Curve->Points;
//for (unsigned int i=0; i<200; i++)
//{
// int x;
// x=(i-10)*(i-10);
list1->Add(l2[Convert::ToInt32(lCanal->Text)], l1);
list2->Add(l2[Convert::ToInt32(lCanal->Text)], l3);
list3->Add(l1, l3);
//}
// Вызываем метод AxisChange (), чтобы обновить данные об осях.
// В противном случае на рисунке будет показана только часть графика,
// которая умещается в интервалы по осям, установленные по умолчанию
zedGraphControl1->AxisChange ();
zedGraphControl2->AxisChange ();
zedGraphControl3->AxisChange();
// Обновляем график
zedGraphControl1->Invalidate();
zedGraphControl2->Invalidate();
//************************
}
public:
Def(void)
{
l1=0;
//l2[Canal]=0;
l3=0;
t=5;
InitializeComponent();
//
//TODO: добавьте код конструктора
//
}
protected:
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
~Def()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::TextBox^ tObj;
protected:
private: int click;
private: Devart::Data::MySql::MySqlDataReader^ MySqlDataReader1;
private: System::Windows::Forms::Button^ bSizeMinus;
private: System::Windows::Forms::Button^ bStart;
private: System::Windows::Forms::Button^ bSizePlus;
private: System::Windows::Forms::Label^ lOut;
private: System::Windows::Forms::Label^ lIn;
private: System::Windows::Forms::NumericUpDown^ attIn;
private: System::Windows::Forms::Label^ lPhase;
private: System::Windows::Forms::Timer^ timer1;
private: System::Windows::Forms::Label^ lObj;
private: System::Windows::Forms::NumericUpDown^ attOut;
private: System::Windows::Forms::Label^ lf;
private: System::Windows::Forms::Label^ lAmp;
private: System::Windows::Forms::Button^ bResize;
private: System::Windows::Forms::Label^ lSettings;
private: System::Windows::Forms::TextBox^ tf1;
private: System::Windows::Forms::TextBox^ tPhase1;
private: System::Windows::Forms::TextBox^ tAmp1;
private: System::Windows::Forms::TrackBar^ fBar1;
private: System::Windows::Forms::TrackBar^ phaseBar1;
private: System::Windows::Forms::SplitContainer^ splitContainer1;
private: ZedGraph::ZedGraphControl^ zedGraphControl3;
private: ZedGraph::ZedGraphControl^ zedGraphControl2;
private: ZedGraph::ZedGraphControl^ zedGraphControl1;
private: System::Windows::Forms::Label^ lCanal;
private: Devart::Data::MySql::MySqlConnection^ mySqlConnection1;
private: Devart::Data::MySql::MySqlCommand^ mySqlCommand1;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::TrackBar^ trackBar1;
private: System::Windows::Forms::Label^ lObject;
private: System::Windows::Forms::Label^ lBase;
private: System::Windows::Forms::Button^ bStop;
private: System::Windows::Forms::Button^ bBalance;
private: System::Windows::Forms::Button^ bFilt;
private: System::ComponentModel::IContainer^ components;
private:
/// <summary>
/// Требуется переменная конструктора.
/// </summary>
#pragma region Windows Form Designer generated code
/// <summary>
/// Обязательный метод для поддержки конструктора - не изменяйте
/// содержимое данного метода при помощи редактора кода.
/// </summary>
void InitializeComponent(void)
{
this->components = (gcnew System::ComponentModel::Container());
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Def::typeid));
this->tObj = (gcnew System::Windows::Forms::TextBox());
this->bSizeMinus = (gcnew System::Windows::Forms::Button());
this->bStart = (gcnew System::Windows::Forms::Button());
this->bSizePlus = (gcnew System::Windows::Forms::Button());
this->lOut = (gcnew System::Windows::Forms::Label());
this->lIn = (gcnew System::Windows::Forms::Label());
this->attIn = (gcnew System::Windows::Forms::NumericUpDown());
this->lPhase = (gcnew System::Windows::Forms::Label());
this->timer1 = (gcnew System::Windows::Forms::Timer(this->components));
this->lObj = (gcnew System::Windows::Forms::Label());
this->attOut = (gcnew System::Windows::Forms::NumericUpDown());
this->lf = (gcnew System::Windows::Forms::Label());
this->lAmp = (gcnew System::Windows::Forms::Label());
this->bResize = (gcnew System::Windows::Forms::Button());
this->lSettings = (gcnew System::Windows::Forms::Label());
this->tf1 = (gcnew System::Windows::Forms::TextBox());
this->tPhase1 = (gcnew System::Windows::Forms::TextBox());
this->tAmp1 = (gcnew System::Windows::Forms::TextBox());
this->fBar1 = (gcnew System::Windows::Forms::TrackBar());
this->phaseBar1 = (gcnew System::Windows::Forms::TrackBar());
this->splitContainer1 = (gcnew System::Windows::Forms::SplitContainer());
this->bFilt = (gcnew System::Windows::Forms::Button());
this->bBalance = (gcnew System::Windows::Forms::Button());
this->bStop = (gcnew System::Windows::Forms::Button());
this->lBase = (gcnew System::Windows::Forms::Label());
this->trackBar1 = (gcnew System::Windows::Forms::TrackBar());
this->label2 = (gcnew System::Windows::Forms::Label());
this->lCanal = (gcnew System::Windows::Forms::Label());
this->zedGraphControl3 = (gcnew ZedGraph::ZedGraphControl());
this->zedGraphControl2 = (gcnew ZedGraph::ZedGraphControl());
this->zedGraphControl1 = (gcnew ZedGraph::ZedGraphControl());
this->lObject = (gcnew System::Windows::Forms::Label());
this->mySqlConnection1 = (gcnew Devart::Data::MySql::MySqlConnection());
this->mySqlCommand1 = (gcnew Devart::Data::MySql::MySqlCommand());
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->attIn))->BeginInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->attOut))->BeginInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->fBar1))->BeginInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->phaseBar1))->BeginInit();
this->splitContainer1->Panel1->SuspendLayout();
this->splitContainer1->Panel2->SuspendLayout();
this->splitContainer1->SuspendLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBar1))->BeginInit();
this->SuspendLayout();
//
// tObj
//
this->tObj->Location = System::Drawing::Point(537, 14);
this->tObj->Name = L"tObj";
this->tObj->Size = System::Drawing::Size(201, 20);
this->tObj->TabIndex = 33;
//
// bSizeMinus
//
this->bSizeMinus->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(204)));
this->bSizeMinus->Location = System::Drawing::Point(472, 95);
this->bSizeMinus->Name = L"bSizeMinus";
this->bSizeMinus->Size = System::Drawing::Size(34, 34);
this->bSizeMinus->TabIndex = 32;
this->bSizeMinus->Text = L"-";
this->bSizeMinus->UseVisualStyleBackColor = true;
this->bSizeMinus->Click += gcnew System::EventHandler(this, &Def::bSizeMinus_Click);
//
// bStart
//
this->bStart->BackColor = System::Drawing::SystemColors::ButtonHighlight;
this->bStart->Location = System::Drawing::Point(432, 33);
this->bStart->Name = L"bStart";
this->bStart->Size = System::Drawing::Size(74, 25);
this->bStart->TabIndex = 30;
this->bStart->Text = L"СТАРТ";
this->bStart->UseVisualStyleBackColor = true;
this->bStart->Click += gcnew System::EventHandler(this, &Def::bStart_Click);
//
// bSizePlus
//
this->bSizePlus->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(204)));
this->bSizePlus->Location = System::Drawing::Point(432, 95);
this->bSizePlus->Name = L"bSizePlus";
this->bSizePlus->Size = System::Drawing::Size(34, 34);
this->bSizePlus->TabIndex = 31;
this->bSizePlus->Text = L"+";
this->bSizePlus->UseVisualStyleBackColor = true;
this->bSizePlus->Click += gcnew System::EventHandler(this, &Def::bSizePlus_Click);
//
// lOut
//
this->lOut->AutoSize = true;
this->lOut->Location = System::Drawing::Point(32, 95);
this->lOut->Name = L"lOut";
this->lOut->Size = System::Drawing::Size(39, 13);
this->lOut->TabIndex = 33;
this->lOut->Text = L"Выход";
//
// lIn
//
this->lIn->AutoSize = true;
this->lIn->Location = System::Drawing::Point(32, 56);
this->lIn->Name = L"lIn";
this->lIn->Size = System::Drawing::Size(31, 13);
this->lIn->TabIndex = 32;
this->lIn->Text = L"Вход";
//
// attIn
//
this->attIn->Increment = System::Decimal(gcnew cli::array< System::Int32 >(4) {3, 0, 0, 0});
this->attIn->Location = System::Drawing::Point(29, 72);
this->attIn->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {45, 0, 0, 0});
this->attIn->Name = L"attIn";
this->attIn->Size = System::Drawing::Size(45, 20);
this->attIn->TabIndex = 30;
this->attIn->ValueChanged += gcnew System::EventHandler(this, &Def::attIn_ValueChanged);
//
// lPhase
//
this->lPhase->AutoSize = true;
this->lPhase->Location = System::Drawing::Point(83, 17);
this->lPhase->Name = L"lPhase";
this->lPhase->Size = System::Drawing::Size(36, 13);
this->lPhase->TabIndex = 28;
this->lPhase->Text = L"Фаза";
//
// timer1
//
this->timer1->Interval = 1;
this->timer1->Tick += gcnew System::EventHandler(this, &Def::timer1_Tick);
//
// lObj
//
this->lObj->AutoSize = true;
this->lObj->Location = System::Drawing::Point(426, 5);
this->lObj->Name = L"lObj";
this->lObj->Size = System::Drawing::Size(105, 26);
this->lObj->TabIndex = 34;
this->lObj->Text = L"Название объекта \r\nдефектоскопии:";
//
// attOut
//
this->attOut->Increment = System::Decimal(gcnew cli::array< System::Int32 >(4) {3, 0, 0, 0});
this->attOut->Location = System::Drawing::Point(29, 109);
this->attOut->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {45, 0, 0, 0});
this->attOut->Name = L"attOut";
this->attOut->Size = System::Drawing::Size(45, 20);
this->attOut->TabIndex = 31;
this->attOut->ValueChanged += gcnew System::EventHandler(this, &Def::attOut_ValueChanged);
//
// lf
//
this->lf->AutoSize = true;
this->lf->Location = System::Drawing::Point(128, 17);
this->lf->Name = L"lf";
this->lf->Size = System::Drawing::Size(49, 13);
this->lf->TabIndex = 29;
this->lf->Text = L"Частота";
//
// lAmp
//
this->lAmp->AutoSize = true;
this->lAmp->Location = System::Drawing::Point(26, 17);
this->lAmp->Name = L"lAmp";
this->lAmp->Size = System::Drawing::Size(62, 13);
this->lAmp->TabIndex = 27;
this->lAmp->Text = L"Амплитуда";
//
// bResize
//
this->bResize->Location = System::Drawing::Point(3, 3);
this->bResize->Name = L"bResize";
this->bResize->Size = System::Drawing::Size(22, 22);
this->bResize->TabIndex = 26;
this->bResize->Text = L">";
this->bResize->UseVisualStyleBackColor = true;
this->bResize->Click += gcnew System::EventHandler(this, &Def::bResize_Click);
//
// lSettings
//
this->lSettings->AutoSize = true;
this->lSettings->Location = System::Drawing::Point(3, 25);
this->lSettings->Name = L"lSettings";
this->lSettings->Size = System::Drawing::Size(15, 117);
this->lSettings->TabIndex = 25;
this->lSettings->Text = L"Н\r\nА\r\nС\r\nТ\r\nР\r\nО\r\nЙ\r\nК\r\nИ";
this->lSettings->TextAlign = System::Drawing::ContentAlignment::TopCenter;
//
// tf1
//
this->tf1->Location = System::Drawing::Point(131, 33);
this->tf1->Name = L"tf1";
this->tf1->Size = System::Drawing::Size(45, 20);
this->tf1->TabIndex = 24;
this->tf1->Text = L"500";
this->tf1->TextChanged += gcnew System::EventHandler(this, &Def::tf1_TextChanged);
//
// tPhase1
//
this->tPhase1->Location = System::Drawing::Point(80, 33);
this->tPhase1->Name = L"tPhase1";
this->tPhase1->Size = System::Drawing::Size(45, 20);
this->tPhase1->TabIndex = 23;
this->tPhase1->Text = L"0";
this->tPhase1->TextChanged += gcnew System::EventHandler(this, &Def::tPhase1_TextChanged);
//
// tAmp1
//
this->tAmp1->Location = System::Drawing::Point(29, 33);
this->tAmp1->Name = L"tAmp1";
this->tAmp1->Size = System::Drawing::Size(45, 20);
this->tAmp1->TabIndex = 22;
this->tAmp1->Text = L"0";
this->tAmp1->TextChanged += gcnew System::EventHandler(this, &Def::tAmp1_TextChanged);
//
// fBar1
//
this->fBar1->Location = System::Drawing::Point(131, 60);
this->fBar1->Maximum = 1000;
this->fBar1->Minimum = 10;
this->fBar1->Name = L"fBar1";
this->fBar1->Orientation = System::Windows::Forms::Orientation::Vertical;
this->fBar1->Size = System::Drawing::Size(45, 260);
this->fBar1->TabIndex = 21;
this->fBar1->TickStyle = System::Windows::Forms::TickStyle::Both;
this->fBar1->Value = 500;
this->fBar1->Scroll += gcnew System::EventHandler(this, &Def::fBar1_Scroll);
//
// phaseBar1
//
this->phaseBar1->Location = System::Drawing::Point(80, 60);
this->phaseBar1->Maximum = 3600;
this->phaseBar1->Name = L"phaseBar1";
this->phaseBar1->Orientation = System::Windows::Forms::Orientation::Vertical;
this->phaseBar1->Size = System::Drawing::Size(45, 260);
this->phaseBar1->TabIndex = 20;
this->phaseBar1->TickStyle = System::Windows::Forms::TickStyle::Both;
this->phaseBar1->Scroll += gcnew System::EventHandler(this, &Def::phaseBar1_Scroll);
//
// splitContainer1
//
this->splitContainer1->Dock = System::Windows::Forms::DockStyle::Fill;
this->splitContainer1->Location = System::Drawing::Point(0, 0);
this->splitContainer1->Name = L"splitContainer1";
//
// splitContainer1.Panel1
//
this->splitContainer1->Panel1->Controls->Add(this->lOut);
this->splitContainer1->Panel1->Controls->Add(this->lIn);
this->splitContainer1->Panel1->Controls->Add(this->attOut);
this->splitContainer1->Panel1->Controls->Add(this->attIn);
this->splitContainer1->Panel1->Controls->Add(this->lf);
this->splitContainer1->Panel1->Controls->Add(this->lPhase);
this->splitContainer1->Panel1->Controls->Add(this->lAmp);
this->splitContainer1->Panel1->Controls->Add(this->bResize);
this->splitContainer1->Panel1->Controls->Add(this->lSettings);
this->splitContainer1->Panel1->Controls->Add(this->tf1);
this->splitContainer1->Panel1->Controls->Add(this->tPhase1);
this->splitContainer1->Panel1->Controls->Add(this->tAmp1);
this->splitContainer1->Panel1->Controls->Add(this->fBar1);
this->splitContainer1->Panel1->Controls->Add(this->phaseBar1);
this->splitContainer1->Panel1MinSize = 28;
//
// splitContainer1.Panel2
//
this->splitContainer1->Panel2->BackColor = System::Drawing::Color::PaleTurquoise;
this->splitContainer1->Panel2->Controls->Add(this->bFilt);
this->splitContainer1->Panel2->Controls->Add(this->bBalance);
this->splitContainer1->Panel2->Controls->Add(this->bStop);
this->splitContainer1->Panel2->Controls->Add(this->lBase);
this->splitContainer1->Panel2->Controls->Add(this->trackBar1);
this->splitContainer1->Panel2->Controls->Add(this->label2);
this->splitContainer1->Panel2->Controls->Add(this->lCanal);
this->splitContainer1->Panel2->Controls->Add(this->zedGraphControl3);
this->splitContainer1->Panel2->Controls->Add(this->zedGraphControl2);
this->splitContainer1->Panel2->Controls->Add(this->zedGraphControl1);
this->splitContainer1->Panel2->Controls->Add(this->lObj);
this->splitContainer1->Panel2->Controls->Add(this->tObj);
this->splitContainer1->Panel2->Controls->Add(this->bSizeMinus);
this->splitContainer1->Panel2->Controls->Add(this->bSizePlus);
this->splitContainer1->Panel2->Controls->Add(this->bStart);
this->splitContainer1->Panel2->Controls->Add(this->lObject);
this->splitContainer1->Size = System::Drawing::Size(924, 555);
this->splitContainer1->SplitterDistance = 28;
this->splitContainer1->TabIndex = 5;
//
// bFilt
//
this->bFilt->Location = System::Drawing::Point(432, 135);
this->bFilt->Name = L"bFilt";
this->bFilt->Size = System::Drawing::Size(72, 23);
this->bFilt->TabIndex = 45;
this->bFilt->Text = L"Фильтр";
this->bFilt->UseVisualStyleBackColor = true;
this->bFilt->Click += gcnew System::EventHandler(this, &Def::bFilt_Click);
//
// bBalance
//
this->bBalance->Location = System::Drawing::Point(432, 164);
this->bBalance->Name = L"bBalance";
this->bBalance->Size = System::Drawing::Size(73, 23);
this->bBalance->TabIndex = 44;
this->bBalance->Text = L"Баланс";
this->bBalance->UseVisualStyleBackColor = true;
this->bBalance->Click += gcnew System::EventHandler(this, &Def::bBalance_Click);
//
// bStop
//
this->bStop->BackColor = System::Drawing::SystemColors::ButtonHighlight;
this->bStop->Location = System::Drawing::Point(432, 64);
this->bStop->Name = L"bStop";
this->bStop->Size = System::Drawing::Size(74, 25);
this->bStop->TabIndex = 43;
this->bStop->Text = L"СТОП";
this->bStop->UseVisualStyleBackColor = true;
this->bStop->Click += gcnew System::EventHandler(this, &Def::bStop_Click);
//
// lBase
//
this->lBase->AutoSize = true;
this->lBase->Location = System::Drawing::Point(565, 99);
this->lBase->Name = L"lBase";
this->lBase->Size = System::Drawing::Size(33, 13);
this->lBase->TabIndex = 42;
this->lBase->Text = L"lBase";
this->lBase->Visible = false;
//
// trackBar1
//
this->trackBar1->BackColor = System::Drawing::Color::PaleTurquoise;
this->trackBar1->Location = System::Drawing::Point(3, 498);
this->trackBar1->Name = L"trackBar1";
this->trackBar1->Size = System::Drawing::Size(666, 45);
this->trackBar1->TabIndex = 40;
this->trackBar1->TickStyle = System::Windows::Forms::TickStyle::None;
this->trackBar1->Visible = false;
this->trackBar1->Scroll += gcnew System::EventHandler(this, &Def::trackBar1_Scroll);
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System::Drawing::Point(564, 81);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(35, 13);
this->label2->TabIndex = 39;
this->label2->Text = L"label1";
this->label2->Visible = false;
//
// lCanal
//
this->lCanal->AutoSize = true;
this->lCanal->Location = System::Drawing::Point(564, 62);
this->lCanal->Name = L"lCanal";
this->lCanal->Size = System::Drawing::Size(35, 13);
this->lCanal->TabIndex = 38;
this->lCanal->Text = L"label1";
this->lCanal->Visible = false;
//
// zedGraphControl3
//
this->zedGraphControl3->Location = System::Drawing::Point(429, 246);
this->zedGraphControl3->Name = L"zedGraphControl3";
this->zedGraphControl3->ScrollGrace = 0;
this->zedGraphControl3->ScrollMaxX = 0;
this->zedGraphControl3->ScrollMaxY = 0;
this->zedGraphControl3->ScrollMaxY2 = 0;
this->zedGraphControl3->ScrollMinX = 0;
this->zedGraphControl3->ScrollMinY = 0;
this->zedGraphControl3->ScrollMinY2 = 0;
this->zedGraphControl3->Size = System::Drawing::Size(240, 240);
this->zedGraphControl3->TabIndex = 37;
//
// zedGraphControl2
//
this->zedGraphControl2->Location = System::Drawing::Point(3, 246);
this->zedGraphControl2->Name = L"zedGraphControl2";
this->zedGraphControl2->ScrollGrace = 0;
this->zedGraphControl2->ScrollMaxX = 0;
this->zedGraphControl2->ScrollMaxY = 0;
this->zedGraphControl2->ScrollMaxY2 = 0;
this->zedGraphControl2->ScrollMinX = 0;
this->zedGraphControl2->ScrollMinY = 0;
this->zedGraphControl2->ScrollMinY2 = 0;
this->zedGraphControl2->Size = System::Drawing::Size(420, 240);
this->zedGraphControl2->TabIndex = 36;
//
// zedGraphControl1
//
this->zedGraphControl1->Location = System::Drawing::Point(3, 5);
this->zedGraphControl1->Name = L"zedGraphControl1";
this->zedGraphControl1->ScrollGrace = 0;
this->zedGraphControl1->ScrollMaxX = 0;
this->zedGraphControl1->ScrollMaxY = 0;
this->zedGraphControl1->ScrollMaxY2 = 0;
this->zedGraphControl1->ScrollMinX = 0;
this->zedGraphControl1->ScrollMinY = 0;
this->zedGraphControl1->ScrollMinY2 = 0;
this->zedGraphControl1->Size = System::Drawing::Size(420, 240);
this->zedGraphControl1->TabIndex = 35;
//
// lObject
//
this->lObject->AutoSize = true;
this->lObject->Location = System::Drawing::Point(537, 18);
this->lObject->Name = L"lObject";
this->lObject->Size = System::Drawing::Size(0, 13);
this->lObject->TabIndex = 41;
//
// mySqlConnection1
//
this->mySqlConnection1->ConnectionString = L"User Id=root;Host=localhost;Database=fazus_db;";
this->mySqlConnection1->Name = L"mySqlConnection1";
//
// mySqlCommand1
//
this->mySqlCommand1->Connection = this->mySqlConnection1;
this->mySqlCommand1->Name = L"mySqlCommand1";
//
// Def
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->BackColor = System::Drawing::Color::PaleTurquoise;
this->ClientSize = System::Drawing::Size(924, 555);
this->Controls->Add(this->splitContainer1);
this->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon")));
this->Name = L"Def";
this->Text = L"Def";
this->Load += gcnew System::EventHandler(this, &Def::Def_Load);
this->VisibleChanged += gcnew System::EventHandler(this, &Def::Def_Load);
this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &Def::Def_FormClosing);
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->attIn))->EndInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->attOut))->EndInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->fBar1))->EndInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->phaseBar1))->EndInit();
this->splitContainer1->Panel1->ResumeLayout(false);
this->splitContainer1->Panel1->PerformLayout();
this->splitContainer1->Panel2->ResumeLayout(false);
this->splitContainer1->Panel2->PerformLayout();
this->splitContainer1->ResumeLayout(false);
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBar1))->EndInit();
this->ResumeLayout(false);
}
#pragma endregion
private: System::Void Def_Load(System::Object^ sender, System::EventArgs^ e) {
tPhase1->Text=Convert::ToString((float)phaseBar1->Value/10);
tf1->Text=Convert::ToString(fBar1->Value);
click=0;
/* fd_set soc_insp;
timeval insp_time;
soc_insp.fd_count = 1;
soc_insp.fd_array[0] = m_sock;
insp_time.tv_sec = 0;
insp_time.tv_usec = 10000*2;*/
/* init_program();
init_instrument();
select(0, &soc_insp, NULL, NULL, &insp_time);
this->Name;*/
if(this->Name=="Can0") {
Canal=0;
lCanal->Text="0";
this->Text="Дефектоскопия, канал 1";
}
if(this->Name=="Can1") {
Canal=1;
lCanal->Text="1";
this->Text="Дефектоскопия, канал 2";
}
if(this->Name=="Can2") {
Canal=2;
lCanal->Text="2";
this->Text="Дефектоскопия, канал 3";
}
if(this->Name=="Can3") {
Canal=3;
lCanal->Text="3";
this->Text="Дефектоскопия, канал 4";
}
if(this->Name!="Can0"&&this->Name!="Can1"&&this->Name!="Can2"&&this->Name!="Can3") {
Canal=99;
l2[4]=0;
trackBar1->Value=(int)l2[4];
lCanal->Text="4";
bBalance->Visible=false;
lBase->Text=this->Name;
tObj->Visible=false;
bResize->Visible=false;
lSettings->Visible=false;
bFilt->Visible=false;
this->Text="Дефектоскопия, архив";
trackBar1->Visible=true;
mySqlCommand1->CommandText="select X from`"+lBase->Text+"`;";
mySqlConnection1->Open();
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
}
trackBar1->Maximum=Convert::ToInt16(MySqlDataReader1->RecordCount::get());
mySqlCommand1->CommandText="select `obj` from`obj` where `database`='"+lBase->Text+"';";
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
for (int i = 0; i < MySqlDataReader1->FieldCount; i++)
{
lObject->Text=MySqlDataReader1->GetValue(i)->ToString();
}
}
mySqlConnection1->Close();
}
canalOpen[Convert::ToInt32(lCanal->Text)]=false;
this->Load_Graw();
}
private: System::Void tAmp1_TextChanged(System::Object^ sender, System::EventArgs^ e) {
set_generator(phaseBar1->Value,Convert::ToInt32(tAmp1->Text),Convert::ToInt32(lCanal->Text));
set_compensator(phaseBar1->Value,Convert::ToInt32(tAmp1->Text),Convert::ToInt32(lCanal->Text));
set_amp(Convert::ToInt32(attIn->Text)/3,Convert::ToInt32(attOut->Text)/3,Convert::ToInt32(lCanal->Text));
set_frequency(fBar1->Value,1,Convert::ToInt32(lCanal->Text));
}
private: System::Void tf1_TextChanged(System::Object^ sender, System::EventArgs^ e) {
fBar1->Value=Convert::ToInt32(tf1->Text);
set_frequency(fBar1->Value,1,Convert::ToInt32(lCanal->Text));
}
private: System::Void tPhase1_TextChanged(System::Object^ sender, System::EventArgs^ e) {
set_generator(phaseBar1->Value,Convert::ToInt32(tAmp1->Text),Convert::ToInt32(lCanal->Text));
set_compensator(phaseBar1->Value,Convert::ToInt32(tAmp1->Text),Convert::ToInt32(lCanal->Text));
set_amp(Convert::ToInt32(attIn->Text)/3,Convert::ToInt32(attOut->Text)/3,Convert::ToInt32(lCanal->Text));
set_frequency(fBar1->Value,1,Convert::ToInt32(lCanal->Text));
}
private: System::Void phaseBar1_Scroll(System::Object^ sender, System::EventArgs^ e) {
tPhase1->Text=Convert::ToString((float)phaseBar1->Value/10);
}
private: System::Void fBar1_Scroll(System::Object^ sender, System::EventArgs^ e) {
tf1->Text=Convert::ToString(fBar1->Value);
}
private: System::Void bResize_Click(System::Object^ sender, System::EventArgs^ e) {
click++;
if(click%2){
splitContainer1->SplitterDistance=tf1->Width+tf1->Left+3;
bResize->Text="<";
}
else{
splitContainer1->SplitterDistance=bResize->Width;
bResize->Text=">";
}
}
private: System::Void attIn_ValueChanged(System::Object^ sender, System::EventArgs^ e) {
tAmp1->Text=Convert::ToString(get_amp1());
set_generator(phaseBar1->Value,Convert::ToInt32(tAmp1->Text),Convert::ToInt32(lCanal->Text));
set_compensator(phaseBar1->Value,Convert::ToInt32(tAmp1->Text),Convert::ToInt32(lCanal->Text));
set_amp(Convert::ToInt32(attIn->Text)/3,Convert::ToInt32(attOut->Text)/3,Convert::ToInt32(lCanal->Text));
}
private: System::Void attOut_ValueChanged(System::Object^ sender, System::EventArgs^ e) {
tAmp1->Text=Convert::ToString(get_amp1());
set_generator(phaseBar1->Value,Convert::ToInt32(tAmp1->Text),Convert::ToInt32(lCanal->Text));
set_compensator(phaseBar1->Value,Convert::ToInt32(tAmp1->Text),Convert::ToInt32(lCanal->Text));
set_amp(Convert::ToInt32(attIn->Text)/3,Convert::ToInt32(attOut->Text)/3,Convert::ToInt32(lCanal->Text));
}
private: System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e) {
if(this->Name!="Can0"&&this->Name!="Can1"&&this->Name!="Can2"&&this->Name!="Can3")
{//алгоритм вывода из базы
if(lObject->Text!=""){
int z;
l2[4]=trackBar1->Value;
if(trackBar1->Value<64){
z=0;
}
else{
z=trackBar1->Value-64;
}
timer1->Interval=42;
//timer1->Interval=65;
//timer1->Interval=1;
l2[4]=++l2[4];
trackBar1->Value=Convert::ToInt32(l2[4]);
if(l2[4]>trackBar1->Maximum-2){
timer1->Enabled=false;
}
mySqlCommand1->CommandText = "select `X` from`"+lBase->Text+"` where `id`="+trackBar1->Value+";";
mySqlConnection1->Open();
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
for (int i = 0; i < MySqlDataReader1->FieldCount; i++)
{
l1=Convert::ToDouble(MySqlDataReader1->GetValue(i)->ToString());
if(l2[4]>trackBar1->Maximum-2){
break;
timer1->Enabled=false;
}
per++;
if(per>=64){
per=0;};
if(l1>t) t=t+2.5;
if(l3>t) t=t+2.5;
if(l1<-t) t=t+2.5;
if(l3<-t) t=t+2.5;
}
}
mySqlCommand1->CommandText = "select `Y` from`"+lBase->Text+"` where `id`="+trackBar1->Value+";";
mySqlConnection1->Open();
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
for (int i = 0; i < MySqlDataReader1->FieldCount; i++)
{
l3=Convert::ToDouble(MySqlDataReader1->GetValue(i)->ToString());
if(l2[4]>trackBar1->Maximum-2){
break;
timer1->Enabled=false;
}
per++;
if(per>=64){
per=0;};
if(l1>t) t=t+2.5;
if(l3>t) t=t+2.5;
if(l1<-t) t=t+2.5;
if(l3<-t) t=t+2.5;
}
}
Load_Graw();
Graw_Draw();
mySqlConnection1->Close();
}
}
else
{
l1=coordX[Convert::ToInt32(lCanal->Text)][per]/1000;
l3=coordY[Convert::ToInt32(lCanal->Text)][per]/1000;
this->Load_Graw();
this->Graw_Draw();
l2[Convert::ToInt32(lCanal->Text)]=++l2[Convert::ToInt32(lCanal->Text)];
mySqlCommand1->CommandText = "insert into `"+label2->Text+"`(`X`,`Y`) values ('"+Convert::ToString(l1)+"','"+Convert::ToString(l3)+"');";
mySqlConnection1->Open();
mySqlCommand1->ExecuteNonQuery();
per++;
if(per>=64){
per=0;};
if(l1>t) t=t+2.5;
if(l3>t) t=t+2.5;
if(l1<-t) t=t+2.5;
if(l3<-t) t=t+2.5;
}
}
private: System::Void bStart_Click(System::Object^ sender, System::EventArgs^ e) {
if((tObj->Text!="")&&(tObj->Text!="Enter the name of the object inspection")&&(this->Name=="Can0"||this->Name=="Can1"||this->Name=="Can2"||this->Name=="Can3")){
timer1->Interval=1;
DateTime date1;
date1=DateTime::Now;
mySqlCommand1->CommandText = "create table `"+Convert::ToString(date1.Day)+"_"+Convert::ToString(date1.Month)+"_"+Convert::ToString(date1.Year)+"_"+Convert::ToString(date1.Hour)+"_"+Convert::ToString(date1.Minute)+"_"+Convert::ToString(date1.Second)+"`(`ID` int(10) AUTO_INCREMENT,`X` char(10),`Y` char(10), `step` int(10), PRIMARY KEY(`ID`));";
mySqlConnection1->Open();
label2->Text=Convert::ToString(date1.Day)+"_"+Convert::ToString(date1.Month)+"_"+Convert::ToString(date1.Year)+"_"+Convert::ToString(date1.Hour)+"_"+Convert::ToString(date1.Minute)+"_"+Convert::ToString(date1.Second);
mySqlCommand1->ExecuteNonQuery();
mySqlCommand1->CommandText = "insert into `obj`(`OBJ`,`database`) values ('"+tObj->Text+"','"+label2->Text+"');";
mySqlCommand1->ExecuteNonQuery();
timer1->Enabled=true;
mySqlConnection1->Close();
}
else
{
tObj->Text="Enter the name of the object inspection";
}
if((lObject->Text!="")&&(trackBar1->Value<trackBar1->Maximum-2)){
timer1->Enabled=true;
l2[4]=trackBar1->Value;
}
/* if(lObject->Text!=""){
int z;
l2[4]=trackBar1->Value;
if(trackBar1->Value<64){
z=0;
}
else{
z=trackBar1->Value-64;
}
mySqlCommand1->CommandText = "select `X` from`"+lBase->Text+"` where `id`<"+trackBar1->Value+" and `id`>="+z+";";
mySqlConnection1->Open();
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
for (int i = 0; i < MySqlDataReader1->FieldCount; i++)
{
l1=Convert::ToDouble(MySqlDataReader1->GetValue(i)->ToString());
l2[4]=++l2[4];
trackBar1->Value=Convert::ToInt32(l2[4]);
per++;
if(per>=64){
per=0;};
if(l1>t) t=t+2.5;
if(l3>t) t=t+2.5;
if(l1<-t) t=t+2.5;
if(l3<-t) t=t+2.5;
}
}
mySqlConnection1->Close();
timer1->Enabled=true;*/
// }
}
private: System::Void bSizePlus_Click(System::Object^ sender, System::EventArgs^ e) {
t=t-2.5;
}
private: System::Void bSizeMinus_Click(System::Object^ sender, System::EventArgs^ e) {
t=t+2.5;
}
private: System::Void trackBar1_Scroll(System::Object^ sender, System::EventArgs^ e) {
if(!timer1->Enabled){
int z;
l2[4]=trackBar1->Value;
if(trackBar1->Value<64){
z=0;
}
else{
z=trackBar1->Value-64;
}
l2[4]=++l2[4];
mySqlCommand1->CommandText = "select `X` from`"+lBase->Text+"` where `id`<"+trackBar1->Value+" and `id`>"+z+";";
mySqlConnection1->Open();
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
for (int i = 0; i < MySqlDataReader1->FieldCount; i++)
{
l1=Convert::ToDouble(MySqlDataReader1->GetValue(i)->ToString());
per++;
if(per>=64){
per=0;};
if(l1>t) t=t+2.5;
if(l3>t) t=t+2.5;
if(l1<-t) t=t+2.5;
if(l3<-t) t=t+2.5;
}
}
mySqlCommand1->CommandText = "select `Y` from`"+lBase->Text+"` where `id`="+trackBar1->Value+";";
mySqlConnection1->Open();
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
for (int i = 0; i < MySqlDataReader1->FieldCount; i++)
{
l3=Convert::ToDouble(MySqlDataReader1->GetValue(i)->ToString());
per++;
if(per>=64){
per=0;};
if(l1>t) t=t+2.5;
if(l3>t) t=t+2.5;
if(l1<-t) t=t+2.5;
if(l3<-t) t=t+2.5;
}
}
Load_Graw();
Graw_Draw();
mySqlConnection1->Close();
}
}
private: System::Void bStop_Click(System::Object^ sender, System::EventArgs^ e) {
timer1->Enabled=false;
}
private: System::Void bBalance_Click(System::Object^ sender, System::EventArgs^ e) {
balance(Convert::ToInt32(lCanal->Text));
}
private: System::Void bFilt_Click(System::Object^ sender, System::EventArgs^ e) {
filt1^ gfilt = gcnew filt1;
gfilt->Show();
}
private: System::Void Def_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e) {
canalOpen[Convert::ToInt32(lCanal->Text)]=true;
}
};
}
//Convert::ToInt32(lCanal)
/* mySqlInsertData->CommandText = "insert into `"+label2->Text+"`(`X`,`Y`, `step`) values ('"+textBox1->Text+"','"+textBox2->Text+"','"+textBox3->Text+"');";
label1->Text=mySqlInsertData->CommandText;
mySqlInsertData->ExecuteNonQuery();
*/
#include "filt1.h"
//#include "filt_gen.h"
//extern void cf(double *h,int hsize,double fs, double f0, double sf, double ef, double *rcf, double *icf);
//extern int filt_gen(double lf,double hf,double* resp);
//extern int differ_gen(double lf,double* resp);
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace ZedGraph;
//static int click;
//static double coordY[4][64], coordX[4][64];
extern double coordY[4][64], coordX[4][64];
extern bool canalOpen[5];
static double l1,l2[5],l3,t;
static short * pbf;
static int per, Canal;
extern int set_generator(int phase,int amplityde, int canal);
extern int set_amp(int att, int gain, int canal);
extern int set_frequency(double frequency, int freq_unit, int canal);
extern int set_compensator(int phase,int amplityde, int canal);
extern int get_amp1();
extern int balance(int canal);
namespace vihretok {
/// <summary>
/// Сводка для Def
///
/// Внимание! При изменении имени этого класса необходимо также изменить
/// свойство имени файла ресурсов ("Resource File Name") для средства компиляции управляемого ресурса,
/// связанного со всеми файлами с расширением .resx, от которых зависит данный класс. В противном случае,
/// конструкторы не смогут правильно работать с локализованными
/// ресурсами, сопоставленными данной форме.
/// </summary>
public ref class Def : public System::Windows::Forms::Form
{
public: void Load_Graw (void)
{
// Получим панель для рисования
ZedGraph::GraphPane ^myPane1 = zedGraphControl1->GraphPane;
// Очистим список кривых на тот случай, если до этого сигналы уже были нарисованы
//myPane1->CurveList->Clear();
//myPane1->GraphObjList->Clear();
//Запрет на самосогласования и выход за установленные границы
myPane1->XAxis->Scale->MaxGrace=0;
myPane1->XAxis->Scale->MinGrace=0;
myPane1->YAxis->Scale->MaxGrace=0;
myPane1->YAxis->Scale->MinGrace=0;
// Подписи к графику и к осям
// Установим размеры шрифтов для подписей по осям
myPane1->XAxis->Title->FontSpec->Size = 16;
myPane1->YAxis->Title->FontSpec->Size = 16;
// Установим размеры шрифта для легенды
myPane1->Legend->FontSpec->Size = 12;
// Установим размеры шрифта для общего заголовка
myPane1->Title->FontSpec->Size = 17;
myPane1->Title->FontSpec->FontColor=System::Drawing::Color::Brown;
myPane1->Title->Text = "Отклонение по X";
myPane1->XAxis->Title->Text = "Измерение";
myPane1->YAxis->Title->Text = "Отклонение";
//Установка фона панели графиков (не рабочая часть)
myPane1->Fill->Color=System::Drawing::Color::LightBlue;
//Установка фона панели отображения графиков
myPane1->Chart->Fill = gcnew Fill( Color::White, Color::Aqua, 90 );
//Установка границы вывода графиков
myPane1->Chart->Border->Color=System::Drawing::Color::Black;
// Устанавливаем интересующий нас интервал по оси X
myPane1->XAxis->Scale->Min = l2[Convert::ToInt32(lCanal->Text)]-2*t;
myPane1->XAxis->Scale->Max = l2[Convert::ToInt32(lCanal->Text)]+2*t;
//Ручная установка шага оси Х - 1 В
//myPane1->XAxis->Scale->MinorStep = 0.1;
myPane1->XAxis->Scale->MajorStep = 25;
// Устанавливаем интересующий нас интервал по оси Y - значения в мА от -10 до 100 мА
myPane1->YAxis->Scale->Min = -t;
myPane1->YAxis->Scale->Max = t;
//myPane1->YAxis->Scale->MinorStep = 0.1;
myPane1->YAxis->Scale->MajorStep = 25;
//Установка оси "Y" ровно по оси "Х" 0.0
myPane1->XAxis->Cross = 0.0;
//Устанавливаем метки только возле осей!
myPane1->XAxis->MajorTic->IsOpposite = false;
myPane1->XAxis->MinorTic->IsOpposite = false;
myPane1->YAxis->MajorTic->IsOpposite = false;
myPane1->YAxis->MinorTic->IsOpposite = false;
//Рисуем сетку по X
myPane1->XAxis->MajorGrid->IsVisible=true;
myPane1->XAxis->MajorGrid->DashOn=20;
myPane1->XAxis->MajorGrid->DashOff=20;
myPane1->XAxis->MajorGrid->Color=System::Drawing::Color::Gray;
myPane1->XAxis->Color=System::Drawing::Color::Gray;
//Рисуем сетку по Y
myPane1->YAxis->MajorGrid->IsVisible=true;
myPane1->YAxis->MajorGrid->DashOn=20;
myPane1->YAxis->MajorGrid->DashOff=20;
myPane1->YAxis->MajorGrid->Color=System::Drawing::Color::Gray;
myPane1->YAxis->Color=System::Drawing::Color::Gray;
// Получим панель для рисования
ZedGraph::GraphPane ^myPane3 = zedGraphControl3->GraphPane;
// Очистим список кривых на тот случай, если до этого сигналы уже были нарисованы
//myPane2->CurveList->Clear();
//myPane2->GraphObjList->Clear();
//Запрет на самосогласования и выход за установленные границы
myPane3->XAxis->Scale->MaxGrace=0;
myPane3->XAxis->Scale->MinGrace=0;
myPane3->YAxis->Scale->MaxGrace=0;
myPane3->YAxis->Scale->MinGrace=0;
// Подписи к графику и к осям
// Установим размеры шрифтов для подписей по осям
myPane3->XAxis->Title->FontSpec->Size = 16;
myPane3->YAxis->Title->FontSpec->Size = 16;
// Установим размеры шрифта для легенды
myPane3->Legend->FontSpec->Size = 12;
// Установим размеры шрифта для общего заголовка
myPane3->Title->FontSpec->Size = 17;
myPane3->Title->FontSpec->FontColor=System::Drawing::Color::Brown;
myPane3->Title->Text = "Отклонение по Z";
myPane3->XAxis->Title->Text = "Отклонение по Х";
myPane3->YAxis->Title->Text = "Отклонение по Y";
//Установка фона панели графиков (не рабочая часть)
myPane3->Fill->Color=System::Drawing::Color::LightBlue;
//Установка фона панели отображения графиков
myPane3->Chart->Fill = gcnew Fill( Color::White, Color::Aqua, 90 );
//Установка границы вывода графиков
myPane3->Chart->Border->Color=System::Drawing::Color::Black;
// Устанавливаем интересующий нас интервал по оси X
myPane3->XAxis->Scale->Min = -t;
myPane3->XAxis->Scale->Max = t;
//Ручная установка шага оси Х - 1 В
//myPane1->XAxis->Scale->MinorStep = 0.1;
myPane3->XAxis->Scale->MajorStep = 25;
// Устанавливаем интересующий нас интервал по оси Y - значения в мА от -10 до 100 мА
myPane3->YAxis->Scale->Min = -t;
myPane3->YAxis->Scale->Max = t;
//myPane1->YAxis->Scale->MinorStep = 0.1;
myPane3->YAxis->Scale->MajorStep = 25;
//Установка оси "Y" ровно по оси "Х" 0.0
myPane3->XAxis->Cross = 0.0;
//Устанавливаем метки только возле осей!
myPane3->XAxis->MajorTic->IsOpposite = false;
myPane3->XAxis->MinorTic->IsOpposite = false;
myPane3->YAxis->MajorTic->IsOpposite = false;
myPane3->YAxis->MinorTic->IsOpposite = false;
//Рисуем сетку по X
myPane3->XAxis->MajorGrid->IsVisible=true;
myPane3->XAxis->MajorGrid->DashOn=20;
myPane3->XAxis->MajorGrid->DashOff=20;
myPane3->XAxis->MajorGrid->Color=System::Drawing::Color::Gray;
myPane3->XAxis->Color=System::Drawing::Color::Gray;
//Рисуем сетку по Y
myPane3->YAxis->MajorGrid->IsVisible=true;
myPane3->YAxis->MajorGrid->DashOn=20;
myPane3->YAxis->MajorGrid->DashOff=20;
myPane3->YAxis->MajorGrid->Color=System::Drawing::Color::Gray;
myPane3->YAxis->Color=System::Drawing::Color::Gray;
// Получим панель для рисования
ZedGraph::GraphPane ^myPane2 = zedGraphControl2->GraphPane;
// Очистим список кривых на тот случай, если до этого сигналы уже были нарисованы
//myPane2->CurveList->Clear();
//myPane2->GraphObjList->Clear();
//Запрет на самосогласования и выход за установленные границы
myPane2->XAxis->Scale->MaxGrace=0;
myPane2->XAxis->Scale->MinGrace=0;
myPane2->YAxis->Scale->MaxGrace=0;
myPane2->YAxis->Scale->MinGrace=0;
// Подписи к графику и к осям
// Установим размеры шрифтов для подписей по осям
myPane2->XAxis->Title->FontSpec->Size = 16;
myPane2->YAxis->Title->FontSpec->Size = 16;
// Установим размеры шрифта для легенды
myPane2->Legend->FontSpec->Size = 12;
// Установим размеры шрифта для общего заголовка
myPane2->Title->FontSpec->Size = 17;
myPane2->Title->FontSpec->FontColor=System::Drawing::Color::Brown;
myPane2->Title->Text = "Отклонение по Y";
myPane2->XAxis->Title->Text = "Измерение";
myPane2->YAxis->Title->Text = "Отклонение";
//Установка фона панели графиков (не рабочая часть)
myPane2->Fill->Color=System::Drawing::Color::LightBlue;
//Установка фона панели отображения графиков
myPane2->Chart->Fill = gcnew Fill( Color::White, Color::Aqua, 90 );
//Установка границы вывода графиков
myPane2->Chart->Border->Color=System::Drawing::Color::Black;
// Устанавливаем интересующий нас интервал по оси X
myPane2->XAxis->Scale->Min = l2[Convert::ToInt32(lCanal->Text)]-t*2;
myPane2->XAxis->Scale->Max = l2[Convert::ToInt32(lCanal->Text)]+t*2;
//Ручная установка шага оси Х - 1 В
//myPane1->XAxis->Scale->MinorStep = 0.1;
myPane2->XAxis->Scale->MajorStep = 25;
// Устанавливаем интересующий нас интервал по оси Y - значения в мА от -10 до 100 мА
myPane2->YAxis->Scale->Min = -t;
myPane2->YAxis->Scale->Max = t;
//myPane1->YAxis->Scale->MinorStep = 0.1;
myPane2->YAxis->Scale->MajorStep = 25;
//Установка оси "Y" ровно по оси "Х" 0.0
myPane2->XAxis->Cross = 0.0;
//Устанавливаем метки только возле осей!
myPane2->XAxis->MajorTic->IsOpposite = false;
myPane2->XAxis->MinorTic->IsOpposite = false;
myPane2->YAxis->MajorTic->IsOpposite = false;
myPane2->YAxis->MinorTic->IsOpposite = false;
//Рисуем сетку по X
myPane2->XAxis->MajorGrid->IsVisible=true;
myPane2->XAxis->MajorGrid->DashOn=20;
myPane2->XAxis->MajorGrid->DashOff=20;
myPane2->XAxis->MajorGrid->Color=System::Drawing::Color::Gray;
myPane2->XAxis->Color=System::Drawing::Color::Gray;
//Рисуем сетку по Y
myPane2->YAxis->MajorGrid->IsVisible=true;
myPane2->YAxis->MajorGrid->DashOn=20;
myPane2->YAxis->MajorGrid->DashOff=20;
myPane2->YAxis->MajorGrid->Color=System::Drawing::Color::Gray;
myPane2->YAxis->Color=System::Drawing::Color::Gray;
//******************************************************************************
// Добавляем информацию по регистрам вывода точек
//******************************************************************************
RollingPointPairList ^list1 = gcnew RollingPointPairList (64);
RollingPointPairList ^list2 = gcnew RollingPointPairList (64);
RollingPointPairList ^list3 = gcnew RollingPointPairList (64);
// Выводим пустые линии графиков на экран
LineItem ^F1Curve = myPane1->AddCurve( "", list1, Color::Indigo, SymbolType::None);
LineItem ^F2Curve = myPane2->AddCurve( "", list2, Color::Blue, SymbolType::None);
LineItem ^F3Curve = myPane3->AddCurve( "", list3, Color::BlueViolet, SymbolType::None);
//Ширина линии в 1/72 дюйма!!!!!!!!!! Хорошо получается при 2!!!!!!!!!
F1Curve->Line->Width=2;
F2Curve->Line->Width=2;
F3Curve->Line->Width=1;
//Задаем что линии гладкии!!!!!!!
F1Curve->Line->IsSmooth=true;
F2Curve->Line->IsSmooth=true;
F3Curve->Line->IsSmooth=true;
// Вызываем метод AxisChange (), чтобы обновить данные об осях.
// В противном случае на рисунке будет показана только часть графика,
// которая умещается в интервалы по осям, установленные по умолчанию
zedGraphControl1->AxisChange ();
zedGraphControl2->AxisChange ();
zedGraphControl3->AxisChange ();
// Обновляем график
zedGraphControl1->Invalidate();
zedGraphControl2->Invalidate();
zedGraphControl3->Invalidate();
}
//График для функций
public: void Graw_Draw (void)
{
//Получаем линии от графиков
LineItem ^F1Curve=(LineItem ^)zedGraphControl1->GraphPane->CurveList[0];
LineItem ^F2Curve=(LineItem ^)zedGraphControl2->GraphPane->CurveList[0];
LineItem ^F3Curve=(LineItem ^)zedGraphControl3->GraphPane->CurveList[0];
IPointListEdit ^list1= (IPointListEdit ^) F1Curve->Points;
IPointListEdit ^list2= (IPointListEdit ^) F2Curve->Points;
IPointListEdit ^list3= (IPointListEdit ^) F3Curve->Points;
//for (unsigned int i=0; i<200; i++)
//{
// int x;
// x=(i-10)*(i-10);
list1->Add(l2[Convert::ToInt32(lCanal->Text)], l1);
list2->Add(l2[Convert::ToInt32(lCanal->Text)], l3);
list3->Add(l1, l3);
//}
// Вызываем метод AxisChange (), чтобы обновить данные об осях.
// В противном случае на рисунке будет показана только часть графика,
// которая умещается в интервалы по осям, установленные по умолчанию
zedGraphControl1->AxisChange ();
zedGraphControl2->AxisChange ();
zedGraphControl3->AxisChange();
// Обновляем график
zedGraphControl1->Invalidate();
zedGraphControl2->Invalidate();
//************************
}
public:
Def(void)
{
l1=0;
//l2[Canal]=0;
l3=0;
t=5;
InitializeComponent();
//
//TODO: добавьте код конструктора
//
}
protected:
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
~Def()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::TextBox^ tObj;
protected:
private: int click;
private: Devart::Data::MySql::MySqlDataReader^ MySqlDataReader1;
private: System::Windows::Forms::Button^ bSizeMinus;
private: System::Windows::Forms::Button^ bStart;
private: System::Windows::Forms::Button^ bSizePlus;
private: System::Windows::Forms::Label^ lOut;
private: System::Windows::Forms::Label^ lIn;
private: System::Windows::Forms::NumericUpDown^ attIn;
private: System::Windows::Forms::Label^ lPhase;
private: System::Windows::Forms::Timer^ timer1;
private: System::Windows::Forms::Label^ lObj;
private: System::Windows::Forms::NumericUpDown^ attOut;
private: System::Windows::Forms::Label^ lf;
private: System::Windows::Forms::Label^ lAmp;
private: System::Windows::Forms::Button^ bResize;
private: System::Windows::Forms::Label^ lSettings;
private: System::Windows::Forms::TextBox^ tf1;
private: System::Windows::Forms::TextBox^ tPhase1;
private: System::Windows::Forms::TextBox^ tAmp1;
private: System::Windows::Forms::TrackBar^ fBar1;
private: System::Windows::Forms::TrackBar^ phaseBar1;
private: System::Windows::Forms::SplitContainer^ splitContainer1;
private: ZedGraph::ZedGraphControl^ zedGraphControl3;
private: ZedGraph::ZedGraphControl^ zedGraphControl2;
private: ZedGraph::ZedGraphControl^ zedGraphControl1;
private: System::Windows::Forms::Label^ lCanal;
private: Devart::Data::MySql::MySqlConnection^ mySqlConnection1;
private: Devart::Data::MySql::MySqlCommand^ mySqlCommand1;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::TrackBar^ trackBar1;
private: System::Windows::Forms::Label^ lObject;
private: System::Windows::Forms::Label^ lBase;
private: System::Windows::Forms::Button^ bStop;
private: System::Windows::Forms::Button^ bBalance;
private: System::Windows::Forms::Button^ bFilt;
private: System::ComponentModel::IContainer^ components;
private:
/// <summary>
/// Требуется переменная конструктора.
/// </summary>
#pragma region Windows Form Designer generated code
/// <summary>
/// Обязательный метод для поддержки конструктора - не изменяйте
/// содержимое данного метода при помощи редактора кода.
/// </summary>
void InitializeComponent(void)
{
this->components = (gcnew System::ComponentModel::Container());
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Def::typeid));
this->tObj = (gcnew System::Windows::Forms::TextBox());
this->bSizeMinus = (gcnew System::Windows::Forms::Button());
this->bStart = (gcnew System::Windows::Forms::Button());
this->bSizePlus = (gcnew System::Windows::Forms::Button());
this->lOut = (gcnew System::Windows::Forms::Label());
this->lIn = (gcnew System::Windows::Forms::Label());
this->attIn = (gcnew System::Windows::Forms::NumericUpDown());
this->lPhase = (gcnew System::Windows::Forms::Label());
this->timer1 = (gcnew System::Windows::Forms::Timer(this->components));
this->lObj = (gcnew System::Windows::Forms::Label());
this->attOut = (gcnew System::Windows::Forms::NumericUpDown());
this->lf = (gcnew System::Windows::Forms::Label());
this->lAmp = (gcnew System::Windows::Forms::Label());
this->bResize = (gcnew System::Windows::Forms::Button());
this->lSettings = (gcnew System::Windows::Forms::Label());
this->tf1 = (gcnew System::Windows::Forms::TextBox());
this->tPhase1 = (gcnew System::Windows::Forms::TextBox());
this->tAmp1 = (gcnew System::Windows::Forms::TextBox());
this->fBar1 = (gcnew System::Windows::Forms::TrackBar());
this->phaseBar1 = (gcnew System::Windows::Forms::TrackBar());
this->splitContainer1 = (gcnew System::Windows::Forms::SplitContainer());
this->bFilt = (gcnew System::Windows::Forms::Button());
this->bBalance = (gcnew System::Windows::Forms::Button());
this->bStop = (gcnew System::Windows::Forms::Button());
this->lBase = (gcnew System::Windows::Forms::Label());
this->trackBar1 = (gcnew System::Windows::Forms::TrackBar());
this->label2 = (gcnew System::Windows::Forms::Label());
this->lCanal = (gcnew System::Windows::Forms::Label());
this->zedGraphControl3 = (gcnew ZedGraph::ZedGraphControl());
this->zedGraphControl2 = (gcnew ZedGraph::ZedGraphControl());
this->zedGraphControl1 = (gcnew ZedGraph::ZedGraphControl());
this->lObject = (gcnew System::Windows::Forms::Label());
this->mySqlConnection1 = (gcnew Devart::Data::MySql::MySqlConnection());
this->mySqlCommand1 = (gcnew Devart::Data::MySql::MySqlCommand());
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->attIn))->BeginInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->attOut))->BeginInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->fBar1))->BeginInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->phaseBar1))->BeginInit();
this->splitContainer1->Panel1->SuspendLayout();
this->splitContainer1->Panel2->SuspendLayout();
this->splitContainer1->SuspendLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBar1))->BeginInit();
this->SuspendLayout();
//
// tObj
//
this->tObj->Location = System::Drawing::Point(537, 14);
this->tObj->Name = L"tObj";
this->tObj->Size = System::Drawing::Size(201, 20);
this->tObj->TabIndex = 33;
//
// bSizeMinus
//
this->bSizeMinus->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(204)));
this->bSizeMinus->Location = System::Drawing::Point(472, 95);
this->bSizeMinus->Name = L"bSizeMinus";
this->bSizeMinus->Size = System::Drawing::Size(34, 34);
this->bSizeMinus->TabIndex = 32;
this->bSizeMinus->Text = L"-";
this->bSizeMinus->UseVisualStyleBackColor = true;
this->bSizeMinus->Click += gcnew System::EventHandler(this, &Def::bSizeMinus_Click);
//
// bStart
//
this->bStart->BackColor = System::Drawing::SystemColors::ButtonHighlight;
this->bStart->Location = System::Drawing::Point(432, 33);
this->bStart->Name = L"bStart";
this->bStart->Size = System::Drawing::Size(74, 25);
this->bStart->TabIndex = 30;
this->bStart->Text = L"СТАРТ";
this->bStart->UseVisualStyleBackColor = true;
this->bStart->Click += gcnew System::EventHandler(this, &Def::bStart_Click);
//
// bSizePlus
//
this->bSizePlus->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(204)));
this->bSizePlus->Location = System::Drawing::Point(432, 95);
this->bSizePlus->Name = L"bSizePlus";
this->bSizePlus->Size = System::Drawing::Size(34, 34);
this->bSizePlus->TabIndex = 31;
this->bSizePlus->Text = L"+";
this->bSizePlus->UseVisualStyleBackColor = true;
this->bSizePlus->Click += gcnew System::EventHandler(this, &Def::bSizePlus_Click);
//
// lOut
//
this->lOut->AutoSize = true;
this->lOut->Location = System::Drawing::Point(32, 95);
this->lOut->Name = L"lOut";
this->lOut->Size = System::Drawing::Size(39, 13);
this->lOut->TabIndex = 33;
this->lOut->Text = L"Выход";
//
// lIn
//
this->lIn->AutoSize = true;
this->lIn->Location = System::Drawing::Point(32, 56);
this->lIn->Name = L"lIn";
this->lIn->Size = System::Drawing::Size(31, 13);
this->lIn->TabIndex = 32;
this->lIn->Text = L"Вход";
//
// attIn
//
this->attIn->Increment = System::Decimal(gcnew cli::array< System::Int32 >(4) {3, 0, 0, 0});
this->attIn->Location = System::Drawing::Point(29, 72);
this->attIn->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {45, 0, 0, 0});
this->attIn->Name = L"attIn";
this->attIn->Size = System::Drawing::Size(45, 20);
this->attIn->TabIndex = 30;
this->attIn->ValueChanged += gcnew System::EventHandler(this, &Def::attIn_ValueChanged);
//
// lPhase
//
this->lPhase->AutoSize = true;
this->lPhase->Location = System::Drawing::Point(83, 17);
this->lPhase->Name = L"lPhase";
this->lPhase->Size = System::Drawing::Size(36, 13);
this->lPhase->TabIndex = 28;
this->lPhase->Text = L"Фаза";
//
// timer1
//
this->timer1->Interval = 1;
this->timer1->Tick += gcnew System::EventHandler(this, &Def::timer1_Tick);
//
// lObj
//
this->lObj->AutoSize = true;
this->lObj->Location = System::Drawing::Point(426, 5);
this->lObj->Name = L"lObj";
this->lObj->Size = System::Drawing::Size(105, 26);
this->lObj->TabIndex = 34;
this->lObj->Text = L"Название объекта \r\nдефектоскопии:";
//
// attOut
//
this->attOut->Increment = System::Decimal(gcnew cli::array< System::Int32 >(4) {3, 0, 0, 0});
this->attOut->Location = System::Drawing::Point(29, 109);
this->attOut->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {45, 0, 0, 0});
this->attOut->Name = L"attOut";
this->attOut->Size = System::Drawing::Size(45, 20);
this->attOut->TabIndex = 31;
this->attOut->ValueChanged += gcnew System::EventHandler(this, &Def::attOut_ValueChanged);
//
// lf
//
this->lf->AutoSize = true;
this->lf->Location = System::Drawing::Point(128, 17);
this->lf->Name = L"lf";
this->lf->Size = System::Drawing::Size(49, 13);
this->lf->TabIndex = 29;
this->lf->Text = L"Частота";
//
// lAmp
//
this->lAmp->AutoSize = true;
this->lAmp->Location = System::Drawing::Point(26, 17);
this->lAmp->Name = L"lAmp";
this->lAmp->Size = System::Drawing::Size(62, 13);
this->lAmp->TabIndex = 27;
this->lAmp->Text = L"Амплитуда";
//
// bResize
//
this->bResize->Location = System::Drawing::Point(3, 3);
this->bResize->Name = L"bResize";
this->bResize->Size = System::Drawing::Size(22, 22);
this->bResize->TabIndex = 26;
this->bResize->Text = L">";
this->bResize->UseVisualStyleBackColor = true;
this->bResize->Click += gcnew System::EventHandler(this, &Def::bResize_Click);
//
// lSettings
//
this->lSettings->AutoSize = true;
this->lSettings->Location = System::Drawing::Point(3, 25);
this->lSettings->Name = L"lSettings";
this->lSettings->Size = System::Drawing::Size(15, 117);
this->lSettings->TabIndex = 25;
this->lSettings->Text = L"Н\r\nА\r\nС\r\nТ\r\nР\r\nО\r\nЙ\r\nК\r\nИ";
this->lSettings->TextAlign = System::Drawing::ContentAlignment::TopCenter;
//
// tf1
//
this->tf1->Location = System::Drawing::Point(131, 33);
this->tf1->Name = L"tf1";
this->tf1->Size = System::Drawing::Size(45, 20);
this->tf1->TabIndex = 24;
this->tf1->Text = L"500";
this->tf1->TextChanged += gcnew System::EventHandler(this, &Def::tf1_TextChanged);
//
// tPhase1
//
this->tPhase1->Location = System::Drawing::Point(80, 33);
this->tPhase1->Name = L"tPhase1";
this->tPhase1->Size = System::Drawing::Size(45, 20);
this->tPhase1->TabIndex = 23;
this->tPhase1->Text = L"0";
this->tPhase1->TextChanged += gcnew System::EventHandler(this, &Def::tPhase1_TextChanged);
//
// tAmp1
//
this->tAmp1->Location = System::Drawing::Point(29, 33);
this->tAmp1->Name = L"tAmp1";
this->tAmp1->Size = System::Drawing::Size(45, 20);
this->tAmp1->TabIndex = 22;
this->tAmp1->Text = L"0";
this->tAmp1->TextChanged += gcnew System::EventHandler(this, &Def::tAmp1_TextChanged);
//
// fBar1
//
this->fBar1->Location = System::Drawing::Point(131, 60);
this->fBar1->Maximum = 1000;
this->fBar1->Minimum = 10;
this->fBar1->Name = L"fBar1";
this->fBar1->Orientation = System::Windows::Forms::Orientation::Vertical;
this->fBar1->Size = System::Drawing::Size(45, 260);
this->fBar1->TabIndex = 21;
this->fBar1->TickStyle = System::Windows::Forms::TickStyle::Both;
this->fBar1->Value = 500;
this->fBar1->Scroll += gcnew System::EventHandler(this, &Def::fBar1_Scroll);
//
// phaseBar1
//
this->phaseBar1->Location = System::Drawing::Point(80, 60);
this->phaseBar1->Maximum = 3600;
this->phaseBar1->Name = L"phaseBar1";
this->phaseBar1->Orientation = System::Windows::Forms::Orientation::Vertical;
this->phaseBar1->Size = System::Drawing::Size(45, 260);
this->phaseBar1->TabIndex = 20;
this->phaseBar1->TickStyle = System::Windows::Forms::TickStyle::Both;
this->phaseBar1->Scroll += gcnew System::EventHandler(this, &Def::phaseBar1_Scroll);
//
// splitContainer1
//
this->splitContainer1->Dock = System::Windows::Forms::DockStyle::Fill;
this->splitContainer1->Location = System::Drawing::Point(0, 0);
this->splitContainer1->Name = L"splitContainer1";
//
// splitContainer1.Panel1
//
this->splitContainer1->Panel1->Controls->Add(this->lOut);
this->splitContainer1->Panel1->Controls->Add(this->lIn);
this->splitContainer1->Panel1->Controls->Add(this->attOut);
this->splitContainer1->Panel1->Controls->Add(this->attIn);
this->splitContainer1->Panel1->Controls->Add(this->lf);
this->splitContainer1->Panel1->Controls->Add(this->lPhase);
this->splitContainer1->Panel1->Controls->Add(this->lAmp);
this->splitContainer1->Panel1->Controls->Add(this->bResize);
this->splitContainer1->Panel1->Controls->Add(this->lSettings);
this->splitContainer1->Panel1->Controls->Add(this->tf1);
this->splitContainer1->Panel1->Controls->Add(this->tPhase1);
this->splitContainer1->Panel1->Controls->Add(this->tAmp1);
this->splitContainer1->Panel1->Controls->Add(this->fBar1);
this->splitContainer1->Panel1->Controls->Add(this->phaseBar1);
this->splitContainer1->Panel1MinSize = 28;
//
// splitContainer1.Panel2
//
this->splitContainer1->Panel2->BackColor = System::Drawing::Color::PaleTurquoise;
this->splitContainer1->Panel2->Controls->Add(this->bFilt);
this->splitContainer1->Panel2->Controls->Add(this->bBalance);
this->splitContainer1->Panel2->Controls->Add(this->bStop);
this->splitContainer1->Panel2->Controls->Add(this->lBase);
this->splitContainer1->Panel2->Controls->Add(this->trackBar1);
this->splitContainer1->Panel2->Controls->Add(this->label2);
this->splitContainer1->Panel2->Controls->Add(this->lCanal);
this->splitContainer1->Panel2->Controls->Add(this->zedGraphControl3);
this->splitContainer1->Panel2->Controls->Add(this->zedGraphControl2);
this->splitContainer1->Panel2->Controls->Add(this->zedGraphControl1);
this->splitContainer1->Panel2->Controls->Add(this->lObj);
this->splitContainer1->Panel2->Controls->Add(this->tObj);
this->splitContainer1->Panel2->Controls->Add(this->bSizeMinus);
this->splitContainer1->Panel2->Controls->Add(this->bSizePlus);
this->splitContainer1->Panel2->Controls->Add(this->bStart);
this->splitContainer1->Panel2->Controls->Add(this->lObject);
this->splitContainer1->Size = System::Drawing::Size(924, 555);
this->splitContainer1->SplitterDistance = 28;
this->splitContainer1->TabIndex = 5;
//
// bFilt
//
this->bFilt->Location = System::Drawing::Point(432, 135);
this->bFilt->Name = L"bFilt";
this->bFilt->Size = System::Drawing::Size(72, 23);
this->bFilt->TabIndex = 45;
this->bFilt->Text = L"Фильтр";
this->bFilt->UseVisualStyleBackColor = true;
this->bFilt->Click += gcnew System::EventHandler(this, &Def::bFilt_Click);
//
// bBalance
//
this->bBalance->Location = System::Drawing::Point(432, 164);
this->bBalance->Name = L"bBalance";
this->bBalance->Size = System::Drawing::Size(73, 23);
this->bBalance->TabIndex = 44;
this->bBalance->Text = L"Баланс";
this->bBalance->UseVisualStyleBackColor = true;
this->bBalance->Click += gcnew System::EventHandler(this, &Def::bBalance_Click);
//
// bStop
//
this->bStop->BackColor = System::Drawing::SystemColors::ButtonHighlight;
this->bStop->Location = System::Drawing::Point(432, 64);
this->bStop->Name = L"bStop";
this->bStop->Size = System::Drawing::Size(74, 25);
this->bStop->TabIndex = 43;
this->bStop->Text = L"СТОП";
this->bStop->UseVisualStyleBackColor = true;
this->bStop->Click += gcnew System::EventHandler(this, &Def::bStop_Click);
//
// lBase
//
this->lBase->AutoSize = true;
this->lBase->Location = System::Drawing::Point(565, 99);
this->lBase->Name = L"lBase";
this->lBase->Size = System::Drawing::Size(33, 13);
this->lBase->TabIndex = 42;
this->lBase->Text = L"lBase";
this->lBase->Visible = false;
//
// trackBar1
//
this->trackBar1->BackColor = System::Drawing::Color::PaleTurquoise;
this->trackBar1->Location = System::Drawing::Point(3, 498);
this->trackBar1->Name = L"trackBar1";
this->trackBar1->Size = System::Drawing::Size(666, 45);
this->trackBar1->TabIndex = 40;
this->trackBar1->TickStyle = System::Windows::Forms::TickStyle::None;
this->trackBar1->Visible = false;
this->trackBar1->Scroll += gcnew System::EventHandler(this, &Def::trackBar1_Scroll);
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System::Drawing::Point(564, 81);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(35, 13);
this->label2->TabIndex = 39;
this->label2->Text = L"label1";
this->label2->Visible = false;
//
// lCanal
//
this->lCanal->AutoSize = true;
this->lCanal->Location = System::Drawing::Point(564, 62);
this->lCanal->Name = L"lCanal";
this->lCanal->Size = System::Drawing::Size(35, 13);
this->lCanal->TabIndex = 38;
this->lCanal->Text = L"label1";
this->lCanal->Visible = false;
//
// zedGraphControl3
//
this->zedGraphControl3->Location = System::Drawing::Point(429, 246);
this->zedGraphControl3->Name = L"zedGraphControl3";
this->zedGraphControl3->ScrollGrace = 0;
this->zedGraphControl3->ScrollMaxX = 0;
this->zedGraphControl3->ScrollMaxY = 0;
this->zedGraphControl3->ScrollMaxY2 = 0;
this->zedGraphControl3->ScrollMinX = 0;
this->zedGraphControl3->ScrollMinY = 0;
this->zedGraphControl3->ScrollMinY2 = 0;
this->zedGraphControl3->Size = System::Drawing::Size(240, 240);
this->zedGraphControl3->TabIndex = 37;
//
// zedGraphControl2
//
this->zedGraphControl2->Location = System::Drawing::Point(3, 246);
this->zedGraphControl2->Name = L"zedGraphControl2";
this->zedGraphControl2->ScrollGrace = 0;
this->zedGraphControl2->ScrollMaxX = 0;
this->zedGraphControl2->ScrollMaxY = 0;
this->zedGraphControl2->ScrollMaxY2 = 0;
this->zedGraphControl2->ScrollMinX = 0;
this->zedGraphControl2->ScrollMinY = 0;
this->zedGraphControl2->ScrollMinY2 = 0;
this->zedGraphControl2->Size = System::Drawing::Size(420, 240);
this->zedGraphControl2->TabIndex = 36;
//
// zedGraphControl1
//
this->zedGraphControl1->Location = System::Drawing::Point(3, 5);
this->zedGraphControl1->Name = L"zedGraphControl1";
this->zedGraphControl1->ScrollGrace = 0;
this->zedGraphControl1->ScrollMaxX = 0;
this->zedGraphControl1->ScrollMaxY = 0;
this->zedGraphControl1->ScrollMaxY2 = 0;
this->zedGraphControl1->ScrollMinX = 0;
this->zedGraphControl1->ScrollMinY = 0;
this->zedGraphControl1->ScrollMinY2 = 0;
this->zedGraphControl1->Size = System::Drawing::Size(420, 240);
this->zedGraphControl1->TabIndex = 35;
//
// lObject
//
this->lObject->AutoSize = true;
this->lObject->Location = System::Drawing::Point(537, 18);
this->lObject->Name = L"lObject";
this->lObject->Size = System::Drawing::Size(0, 13);
this->lObject->TabIndex = 41;
//
// mySqlConnection1
//
this->mySqlConnection1->ConnectionString = L"User Id=root;Host=localhost;Database=fazus_db;";
this->mySqlConnection1->Name = L"mySqlConnection1";
//
// mySqlCommand1
//
this->mySqlCommand1->Connection = this->mySqlConnection1;
this->mySqlCommand1->Name = L"mySqlCommand1";
//
// Def
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->BackColor = System::Drawing::Color::PaleTurquoise;
this->ClientSize = System::Drawing::Size(924, 555);
this->Controls->Add(this->splitContainer1);
this->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon")));
this->Name = L"Def";
this->Text = L"Def";
this->Load += gcnew System::EventHandler(this, &Def::Def_Load);
this->VisibleChanged += gcnew System::EventHandler(this, &Def::Def_Load);
this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &Def::Def_FormClosing);
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->attIn))->EndInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->attOut))->EndInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->fBar1))->EndInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->phaseBar1))->EndInit();
this->splitContainer1->Panel1->ResumeLayout(false);
this->splitContainer1->Panel1->PerformLayout();
this->splitContainer1->Panel2->ResumeLayout(false);
this->splitContainer1->Panel2->PerformLayout();
this->splitContainer1->ResumeLayout(false);
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBar1))->EndInit();
this->ResumeLayout(false);
}
#pragma endregion
private: System::Void Def_Load(System::Object^ sender, System::EventArgs^ e) {
tPhase1->Text=Convert::ToString((float)phaseBar1->Value/10);
tf1->Text=Convert::ToString(fBar1->Value);
click=0;
/* fd_set soc_insp;
timeval insp_time;
soc_insp.fd_count = 1;
soc_insp.fd_array[0] = m_sock;
insp_time.tv_sec = 0;
insp_time.tv_usec = 10000*2;*/
/* init_program();
init_instrument();
select(0, &soc_insp, NULL, NULL, &insp_time);
this->Name;*/
if(this->Name=="Can0") {
Canal=0;
lCanal->Text="0";
this->Text="Дефектоскопия, канал 1";
}
if(this->Name=="Can1") {
Canal=1;
lCanal->Text="1";
this->Text="Дефектоскопия, канал 2";
}
if(this->Name=="Can2") {
Canal=2;
lCanal->Text="2";
this->Text="Дефектоскопия, канал 3";
}
if(this->Name=="Can3") {
Canal=3;
lCanal->Text="3";
this->Text="Дефектоскопия, канал 4";
}
if(this->Name!="Can0"&&this->Name!="Can1"&&this->Name!="Can2"&&this->Name!="Can3") {
Canal=99;
l2[4]=0;
trackBar1->Value=(int)l2[4];
lCanal->Text="4";
bBalance->Visible=false;
lBase->Text=this->Name;
tObj->Visible=false;
bResize->Visible=false;
lSettings->Visible=false;
bFilt->Visible=false;
this->Text="Дефектоскопия, архив";
trackBar1->Visible=true;
mySqlCommand1->CommandText="select X from`"+lBase->Text+"`;";
mySqlConnection1->Open();
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
}
trackBar1->Maximum=Convert::ToInt16(MySqlDataReader1->RecordCount::get());
mySqlCommand1->CommandText="select `obj` from`obj` where `database`='"+lBase->Text+"';";
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
for (int i = 0; i < MySqlDataReader1->FieldCount; i++)
{
lObject->Text=MySqlDataReader1->GetValue(i)->ToString();
}
}
mySqlConnection1->Close();
}
canalOpen[Convert::ToInt32(lCanal->Text)]=false;
this->Load_Graw();
}
private: System::Void tAmp1_TextChanged(System::Object^ sender, System::EventArgs^ e) {
set_generator(phaseBar1->Value,Convert::ToInt32(tAmp1->Text),Convert::ToInt32(lCanal->Text));
set_compensator(phaseBar1->Value,Convert::ToInt32(tAmp1->Text),Convert::ToInt32(lCanal->Text));
set_amp(Convert::ToInt32(attIn->Text)/3,Convert::ToInt32(attOut->Text)/3,Convert::ToInt32(lCanal->Text));
set_frequency(fBar1->Value,1,Convert::ToInt32(lCanal->Text));
}
private: System::Void tf1_TextChanged(System::Object^ sender, System::EventArgs^ e) {
fBar1->Value=Convert::ToInt32(tf1->Text);
set_frequency(fBar1->Value,1,Convert::ToInt32(lCanal->Text));
}
private: System::Void tPhase1_TextChanged(System::Object^ sender, System::EventArgs^ e) {
set_generator(phaseBar1->Value,Convert::ToInt32(tAmp1->Text),Convert::ToInt32(lCanal->Text));
set_compensator(phaseBar1->Value,Convert::ToInt32(tAmp1->Text),Convert::ToInt32(lCanal->Text));
set_amp(Convert::ToInt32(attIn->Text)/3,Convert::ToInt32(attOut->Text)/3,Convert::ToInt32(lCanal->Text));
set_frequency(fBar1->Value,1,Convert::ToInt32(lCanal->Text));
}
private: System::Void phaseBar1_Scroll(System::Object^ sender, System::EventArgs^ e) {
tPhase1->Text=Convert::ToString((float)phaseBar1->Value/10);
}
private: System::Void fBar1_Scroll(System::Object^ sender, System::EventArgs^ e) {
tf1->Text=Convert::ToString(fBar1->Value);
}
private: System::Void bResize_Click(System::Object^ sender, System::EventArgs^ e) {
click++;
if(click%2){
splitContainer1->SplitterDistance=tf1->Width+tf1->Left+3;
bResize->Text="<";
}
else{
splitContainer1->SplitterDistance=bResize->Width;
bResize->Text=">";
}
}
private: System::Void attIn_ValueChanged(System::Object^ sender, System::EventArgs^ e) {
tAmp1->Text=Convert::ToString(get_amp1());
set_generator(phaseBar1->Value,Convert::ToInt32(tAmp1->Text),Convert::ToInt32(lCanal->Text));
set_compensator(phaseBar1->Value,Convert::ToInt32(tAmp1->Text),Convert::ToInt32(lCanal->Text));
set_amp(Convert::ToInt32(attIn->Text)/3,Convert::ToInt32(attOut->Text)/3,Convert::ToInt32(lCanal->Text));
}
private: System::Void attOut_ValueChanged(System::Object^ sender, System::EventArgs^ e) {
tAmp1->Text=Convert::ToString(get_amp1());
set_generator(phaseBar1->Value,Convert::ToInt32(tAmp1->Text),Convert::ToInt32(lCanal->Text));
set_compensator(phaseBar1->Value,Convert::ToInt32(tAmp1->Text),Convert::ToInt32(lCanal->Text));
set_amp(Convert::ToInt32(attIn->Text)/3,Convert::ToInt32(attOut->Text)/3,Convert::ToInt32(lCanal->Text));
}
private: System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e) {
if(this->Name!="Can0"&&this->Name!="Can1"&&this->Name!="Can2"&&this->Name!="Can3")
{//алгоритм вывода из базы
if(lObject->Text!=""){
int z;
l2[4]=trackBar1->Value;
if(trackBar1->Value<64){
z=0;
}
else{
z=trackBar1->Value-64;
}
timer1->Interval=42;
//timer1->Interval=65;
//timer1->Interval=1;
l2[4]=++l2[4];
trackBar1->Value=Convert::ToInt32(l2[4]);
if(l2[4]>trackBar1->Maximum-2){
timer1->Enabled=false;
}
mySqlCommand1->CommandText = "select `X` from`"+lBase->Text+"` where `id`="+trackBar1->Value+";";
mySqlConnection1->Open();
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
for (int i = 0; i < MySqlDataReader1->FieldCount; i++)
{
l1=Convert::ToDouble(MySqlDataReader1->GetValue(i)->ToString());
if(l2[4]>trackBar1->Maximum-2){
break;
timer1->Enabled=false;
}
per++;
if(per>=64){
per=0;};
if(l1>t) t=t+2.5;
if(l3>t) t=t+2.5;
if(l1<-t) t=t+2.5;
if(l3<-t) t=t+2.5;
}
}
mySqlCommand1->CommandText = "select `Y` from`"+lBase->Text+"` where `id`="+trackBar1->Value+";";
mySqlConnection1->Open();
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
for (int i = 0; i < MySqlDataReader1->FieldCount; i++)
{
l3=Convert::ToDouble(MySqlDataReader1->GetValue(i)->ToString());
if(l2[4]>trackBar1->Maximum-2){
break;
timer1->Enabled=false;
}
per++;
if(per>=64){
per=0;};
if(l1>t) t=t+2.5;
if(l3>t) t=t+2.5;
if(l1<-t) t=t+2.5;
if(l3<-t) t=t+2.5;
}
}
Load_Graw();
Graw_Draw();
mySqlConnection1->Close();
}
}
else
{
l1=coordX[Convert::ToInt32(lCanal->Text)][per]/1000;
l3=coordY[Convert::ToInt32(lCanal->Text)][per]/1000;
this->Load_Graw();
this->Graw_Draw();
l2[Convert::ToInt32(lCanal->Text)]=++l2[Convert::ToInt32(lCanal->Text)];
mySqlCommand1->CommandText = "insert into `"+label2->Text+"`(`X`,`Y`) values ('"+Convert::ToString(l1)+"','"+Convert::ToString(l3)+"');";
mySqlConnection1->Open();
mySqlCommand1->ExecuteNonQuery();
per++;
if(per>=64){
per=0;};
if(l1>t) t=t+2.5;
if(l3>t) t=t+2.5;
if(l1<-t) t=t+2.5;
if(l3<-t) t=t+2.5;
}
}
private: System::Void bStart_Click(System::Object^ sender, System::EventArgs^ e) {
if((tObj->Text!="")&&(tObj->Text!="Enter the name of the object inspection")&&(this->Name=="Can0"||this->Name=="Can1"||this->Name=="Can2"||this->Name=="Can3")){
timer1->Interval=1;
DateTime date1;
date1=DateTime::Now;
mySqlCommand1->CommandText = "create table `"+Convert::ToString(date1.Day)+"_"+Convert::ToString(date1.Month)+"_"+Convert::ToString(date1.Year)+"_"+Convert::ToString(date1.Hour)+"_"+Convert::ToString(date1.Minute)+"_"+Convert::ToString(date1.Second)+"`(`ID` int(10) AUTO_INCREMENT,`X` char(10),`Y` char(10), `step` int(10), PRIMARY KEY(`ID`));";
mySqlConnection1->Open();
label2->Text=Convert::ToString(date1.Day)+"_"+Convert::ToString(date1.Month)+"_"+Convert::ToString(date1.Year)+"_"+Convert::ToString(date1.Hour)+"_"+Convert::ToString(date1.Minute)+"_"+Convert::ToString(date1.Second);
mySqlCommand1->ExecuteNonQuery();
mySqlCommand1->CommandText = "insert into `obj`(`OBJ`,`database`) values ('"+tObj->Text+"','"+label2->Text+"');";
mySqlCommand1->ExecuteNonQuery();
timer1->Enabled=true;
mySqlConnection1->Close();
}
else
{
tObj->Text="Enter the name of the object inspection";
}
if((lObject->Text!="")&&(trackBar1->Value<trackBar1->Maximum-2)){
timer1->Enabled=true;
l2[4]=trackBar1->Value;
}
/* if(lObject->Text!=""){
int z;
l2[4]=trackBar1->Value;
if(trackBar1->Value<64){
z=0;
}
else{
z=trackBar1->Value-64;
}
mySqlCommand1->CommandText = "select `X` from`"+lBase->Text+"` where `id`<"+trackBar1->Value+" and `id`>="+z+";";
mySqlConnection1->Open();
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
for (int i = 0; i < MySqlDataReader1->FieldCount; i++)
{
l1=Convert::ToDouble(MySqlDataReader1->GetValue(i)->ToString());
l2[4]=++l2[4];
trackBar1->Value=Convert::ToInt32(l2[4]);
per++;
if(per>=64){
per=0;};
if(l1>t) t=t+2.5;
if(l3>t) t=t+2.5;
if(l1<-t) t=t+2.5;
if(l3<-t) t=t+2.5;
}
}
mySqlConnection1->Close();
timer1->Enabled=true;*/
// }
}
private: System::Void bSizePlus_Click(System::Object^ sender, System::EventArgs^ e) {
t=t-2.5;
}
private: System::Void bSizeMinus_Click(System::Object^ sender, System::EventArgs^ e) {
t=t+2.5;
}
private: System::Void trackBar1_Scroll(System::Object^ sender, System::EventArgs^ e) {
if(!timer1->Enabled){
int z;
l2[4]=trackBar1->Value;
if(trackBar1->Value<64){
z=0;
}
else{
z=trackBar1->Value-64;
}
l2[4]=++l2[4];
mySqlCommand1->CommandText = "select `X` from`"+lBase->Text+"` where `id`<"+trackBar1->Value+" and `id`>"+z+";";
mySqlConnection1->Open();
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
for (int i = 0; i < MySqlDataReader1->FieldCount; i++)
{
l1=Convert::ToDouble(MySqlDataReader1->GetValue(i)->ToString());
per++;
if(per>=64){
per=0;};
if(l1>t) t=t+2.5;
if(l3>t) t=t+2.5;
if(l1<-t) t=t+2.5;
if(l3<-t) t=t+2.5;
}
}
mySqlCommand1->CommandText = "select `Y` from`"+lBase->Text+"` where `id`="+trackBar1->Value+";";
mySqlConnection1->Open();
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
for (int i = 0; i < MySqlDataReader1->FieldCount; i++)
{
l3=Convert::ToDouble(MySqlDataReader1->GetValue(i)->ToString());
per++;
if(per>=64){
per=0;};
if(l1>t) t=t+2.5;
if(l3>t) t=t+2.5;
if(l1<-t) t=t+2.5;
if(l3<-t) t=t+2.5;
}
}
Load_Graw();
Graw_Draw();
mySqlConnection1->Close();
}
}
private: System::Void bStop_Click(System::Object^ sender, System::EventArgs^ e) {
timer1->Enabled=false;
}
private: System::Void bBalance_Click(System::Object^ sender, System::EventArgs^ e) {
balance(Convert::ToInt32(lCanal->Text));
}
private: System::Void bFilt_Click(System::Object^ sender, System::EventArgs^ e) {
filt1^ gfilt = gcnew filt1;
gfilt->Show();
}
private: System::Void Def_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e) {
canalOpen[Convert::ToInt32(lCanal->Text)]=true;
}
};
}
//Convert::ToInt32(lCanal)
/* mySqlInsertData->CommandText = "insert into `"+label2->Text+"`(`X`,`Y`, `step`) values ('"+textBox1->Text+"','"+textBox2->Text+"','"+textBox3->Text+"');";
label1->Text=mySqlInsertData->CommandText;
mySqlInsertData->ExecuteNonQuery();
*/
Код:
#include "StdAfx.h"
#include "filt_gen.h"
#include "filt_gen.h"
Код:
//using namespace System;
//#pragma unmanaged
#pragma once
#include <malloc.h>
#include <math.h>
#include "ipp_v8.h"
#include "ipps.h"
//#include "remez.h"
//#pragma comment(lib, "aa.lib")
//extern double pi = atan(1.) * 4.0;
//extern double Pi2 = pi * 2.;
double pi = atan(1.) * 4.0;
double Pi2 = pi * 2.;
#define DIFFERENTIATOR 2
void cf(double *h,int hsize,double fs, double f0, double sf, double ef, double *rcf, double *icf);
int rflt(double *h, int numtaps, int numband, double bands[], double resp[], double weigth[], int type, int gridsize);
int filt_gen(double lf,double hf,double* resp )
{
double *weights, *desired, *bands;
double *h;
double *rcf,*icf;
// FILE* fcf = fopen("cf.dat","wt");
// fprintf(fcf,"lf = %f hf = %f\n", lf,hf);
// fclose(fcf);
bands = (double *)malloc(10 * sizeof(double));
weights = (double *)malloc(5 * sizeof(double));
desired = (double *)malloc(5 * sizeof(double));
h = (double *)malloc(512 * sizeof(double));
rcf = (double *)malloc(1001 * sizeof(double));
icf = (double *)malloc(1001 * sizeof(double));
if(lf == 0.0) { // LOWPASS
desired[0] = 1;
desired[1] = 0;
weights[0] = 0.018;
weights[1] = 1;
bands[0] = 0;
bands[1] = hf/2500.0;
bands[2] = (hf+10)/2500;
bands[3] = 0.5;
// remez(h, 512, 2, bands, desired, weights, BANDPASS);
ippsFIRGenLowpass_64f(hf/2500.0, h, 512, ippWinHamming, ippTrue);
}
else {
if(hf == 1000.0){ // HIGHPASS
desired[0] = 0;
desired[1] = 1;
weights[0] = 1;
weights[1] = 0.018;
bands[0] = 0;
bands[1] = (lf-10)/2500.0;
bands[2] = lf/2500.0;
bands[3] = 0.5;
// remez(h, 512, 2, bands, desired, weights, BANDPASS);
ippsFIRGenHighpass_64f(lf/2500.0, h, 512, ippWinHamming, ippTrue);
}
else { // BANDPASS
desired[0] = 0;
desired[1] = 1;
desired[2] = 0;
weights[0] = 1;
weights[1] = 0.018;
weights[2] = 1;
bands[0] = 0;
bands[1] = (lf-10)/2500.0;
bands[2] = lf/2500.0;
bands[3] = hf/2500.0;
bands[4] = (hf+10)/2500.0;
bands[5] = 0.5;
// remez(h, 512, 3, bands, desired, weights, BANDPASS);
ippsFIRGenBandpass_64f(lf/2500.0, hf/2500.0,h, 512, ippWinHamming, ippTrue);
}
}
//desired[0] = 0;
//desired[1] = 1;
//desired[2] = 0;
//weights[0] = 1;
//weights[1] = 0.018;
//weights[2] = 1;
//bands[0] = 0;
//bands[1] = 0.004;
//bands[2] = 0.008;
//bands[3] = 0.04;
//bands[4] = 0.044;
//bands[5] = 0.5;
//remez(h, 512, 3, bands, desired, weights, BANDPASS);
free(bands);
free(weights);
free(desired);
cf(h,512,2500.0,0.0,1.0,1000.0,rcf,icf);
for (unsigned int i=0; i<1001; i++)
{
resp[i] = 20 * log10(sqrt(rcf[i]*rcf[i] + icf[i]*icf[i]));
}
free(h);
free(rcf);
free(icf);
return 0;
}
int differ_gen(double lf,double* resp )
{
double *weights, *desired, *bands;
double *h;
double *rcf,*icf;
bands = (double *)malloc(10 * sizeof(double));
weights = (double *)malloc(5 * sizeof(double));
desired = (double *)malloc(5 * sizeof(double));
h = (double *)malloc(512 * sizeof(double));
rcf = (double *)malloc(1001 * sizeof(double));
icf = (double *)malloc(1001 * sizeof(double));
desired[1] = 0;
weights[0] = 1;
weights[1] = 1;
weights[2] = 1;
bands[0] = 0;
bands[1] = lf/2500.0;
bands[2] = bands[1]+0.01;
bands[3] = 0.5;
desired[0] =1.0/( bands[1]+0.000044/bands[2]);
int err=rflt(h, 511, 2, bands, desired, weights, DIFFERENTIATOR,40);
free(bands);
free(weights);
free(desired);
cf(h,511,2500.0,0.0,1.0,1000.0,rcf,icf);
for (unsigned int i=0; i<1001; i++)
{
resp[i] = sqrt(rcf[i]*rcf[i] + icf[i]*icf[i]);
}
free(h);
free(rcf);
free(icf);
return err;
}
//***********************************************************************************************
// fir filter complex frequency response calculation
// z-transform metod
// Horners method (Euler formula used)
// h - fir filter coefficient
// hsize - filter length
// fs - sample frequency
// f0 - first frequency
// sf - frequency step
// ef - end frequency
// rcf - real frequency response
// icf - imag frequency response
// number of frequency points - (int)((ef - f0)/sf) + 1
//***********************************************************************************************
void cf(double *h,int hsize,double fs, double f0, double sf, double ef, double *rcf, double *icf)
{
double fz,rz,iz;
int i,n,s;
double r_cf,i_cf;
double r_cf_t,sf_w;
s = (int)((ef - f0)/sf) + 1; // frequency step number
fz = Pi2 * f0/fs; // first frequency
sf_w = Pi2 * sf/fs; // frequency step
for(n=0; n<s; ++n){ // complex frequency response calculation init
rz = cos(fz);
iz = -sin(fz);
r_cf = h[hsize-1];
i_cf = 0.0;
for(i=hsize-2; i >= 0; --i) { // complex frequency response calculation
r_cf_t = (r_cf*rz - i_cf*iz) + h[i];
i_cf = (r_cf*iz + i_cf*rz);
r_cf = r_cf_t;
}
rcf[n] = r_cf;
icf[n] = i_cf;
fz = fz + sf_w;
}
}
//#pragma unmanaged
#pragma once
#include <malloc.h>
#include <math.h>
#include "ipp_v8.h"
#include "ipps.h"
//#include "remez.h"
//#pragma comment(lib, "aa.lib")
//extern double pi = atan(1.) * 4.0;
//extern double Pi2 = pi * 2.;
double pi = atan(1.) * 4.0;
double Pi2 = pi * 2.;
#define DIFFERENTIATOR 2
void cf(double *h,int hsize,double fs, double f0, double sf, double ef, double *rcf, double *icf);
int rflt(double *h, int numtaps, int numband, double bands[], double resp[], double weigth[], int type, int gridsize);
int filt_gen(double lf,double hf,double* resp )
{
double *weights, *desired, *bands;
double *h;
double *rcf,*icf;
// FILE* fcf = fopen("cf.dat","wt");
// fprintf(fcf,"lf = %f hf = %f\n", lf,hf);
// fclose(fcf);
bands = (double *)malloc(10 * sizeof(double));
weights = (double *)malloc(5 * sizeof(double));
desired = (double *)malloc(5 * sizeof(double));
h = (double *)malloc(512 * sizeof(double));
rcf = (double *)malloc(1001 * sizeof(double));
icf = (double *)malloc(1001 * sizeof(double));
if(lf == 0.0) { // LOWPASS
desired[0] = 1;
desired[1] = 0;
weights[0] = 0.018;
weights[1] = 1;
bands[0] = 0;
bands[1] = hf/2500.0;
bands[2] = (hf+10)/2500;
bands[3] = 0.5;
// remez(h, 512, 2, bands, desired, weights, BANDPASS);
ippsFIRGenLowpass_64f(hf/2500.0, h, 512, ippWinHamming, ippTrue);
}
else {
if(hf == 1000.0){ // HIGHPASS
desired[0] = 0;
desired[1] = 1;
weights[0] = 1;
weights[1] = 0.018;
bands[0] = 0;
bands[1] = (lf-10)/2500.0;
bands[2] = lf/2500.0;
bands[3] = 0.5;
// remez(h, 512, 2, bands, desired, weights, BANDPASS);
ippsFIRGenHighpass_64f(lf/2500.0, h, 512, ippWinHamming, ippTrue);
}
else { // BANDPASS
desired[0] = 0;
desired[1] = 1;
desired[2] = 0;
weights[0] = 1;
weights[1] = 0.018;
weights[2] = 1;
bands[0] = 0;
bands[1] = (lf-10)/2500.0;
bands[2] = lf/2500.0;
bands[3] = hf/2500.0;
bands[4] = (hf+10)/2500.0;
bands[5] = 0.5;
// remez(h, 512, 3, bands, desired, weights, BANDPASS);
ippsFIRGenBandpass_64f(lf/2500.0, hf/2500.0,h, 512, ippWinHamming, ippTrue);
}
}
//desired[0] = 0;
//desired[1] = 1;
//desired[2] = 0;
//weights[0] = 1;
//weights[1] = 0.018;
//weights[2] = 1;
//bands[0] = 0;
//bands[1] = 0.004;
//bands[2] = 0.008;
//bands[3] = 0.04;
//bands[4] = 0.044;
//bands[5] = 0.5;
//remez(h, 512, 3, bands, desired, weights, BANDPASS);
free(bands);
free(weights);
free(desired);
cf(h,512,2500.0,0.0,1.0,1000.0,rcf,icf);
for (unsigned int i=0; i<1001; i++)
{
resp[i] = 20 * log10(sqrt(rcf[i]*rcf[i] + icf[i]*icf[i]));
}
free(h);
free(rcf);
free(icf);
return 0;
}
int differ_gen(double lf,double* resp )
{
double *weights, *desired, *bands;
double *h;
double *rcf,*icf;
bands = (double *)malloc(10 * sizeof(double));
weights = (double *)malloc(5 * sizeof(double));
desired = (double *)malloc(5 * sizeof(double));
h = (double *)malloc(512 * sizeof(double));
rcf = (double *)malloc(1001 * sizeof(double));
icf = (double *)malloc(1001 * sizeof(double));
desired[1] = 0;
weights[0] = 1;
weights[1] = 1;
weights[2] = 1;
bands[0] = 0;
bands[1] = lf/2500.0;
bands[2] = bands[1]+0.01;
bands[3] = 0.5;
desired[0] =1.0/( bands[1]+0.000044/bands[2]);
int err=rflt(h, 511, 2, bands, desired, weights, DIFFERENTIATOR,40);
free(bands);
free(weights);
free(desired);
cf(h,511,2500.0,0.0,1.0,1000.0,rcf,icf);
for (unsigned int i=0; i<1001; i++)
{
resp[i] = sqrt(rcf[i]*rcf[i] + icf[i]*icf[i]);
}
free(h);
free(rcf);
free(icf);
return err;
}
//***********************************************************************************************
// fir filter complex frequency response calculation
// z-transform metod
// Horners method (Euler formula used)
// h - fir filter coefficient
// hsize - filter length
// fs - sample frequency
// f0 - first frequency
// sf - frequency step
// ef - end frequency
// rcf - real frequency response
// icf - imag frequency response
// number of frequency points - (int)((ef - f0)/sf) + 1
//***********************************************************************************************
void cf(double *h,int hsize,double fs, double f0, double sf, double ef, double *rcf, double *icf)
{
double fz,rz,iz;
int i,n,s;
double r_cf,i_cf;
double r_cf_t,sf_w;
s = (int)((ef - f0)/sf) + 1; // frequency step number
fz = Pi2 * f0/fs; // first frequency
sf_w = Pi2 * sf/fs; // frequency step
for(n=0; n<s; ++n){ // complex frequency response calculation init
rz = cos(fz);
iz = -sin(fz);
r_cf = h[hsize-1];
i_cf = 0.0;
for(i=hsize-2; i >= 0; --i) { // complex frequency response calculation
r_cf_t = (r_cf*rz - i_cf*iz) + h[i];
i_cf = (r_cf*iz + i_cf*rz);
r_cf = r_cf_t;
}
rcf[n] = r_cf;
icf[n] = i_cf;
fz = fz + sf_w;
}
}
Скотче всемогущий.
Код:
#pragma once
#include "ec.h"
#include "set_param.h"
#include "Def.h"
#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "mswsock.lib")
#pragma comment(lib, "WSock32.lib")
#pragma comment(lib, "IPHlpApi.Lib")
#pragma comment(lib, "Kernel32.lib")
extern SOCKET m_sock;
extern double x_med, y_med, x_med_1, y_med_1, x_med_2, y_med_2, x_med_3, y_med_3;
//extern double coordY[4][64], coordX[4][64];
double coordY[4][64], coordX[4][64];
bool canalOpen[5];
static int nazh;
namespace vihretok {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Сводка для Form1
///
/// Внимание! При изменении имени этого класса необходимо также изменить
/// свойство имени файла ресурсов ("Resource File Name") для средства компиляции управляемого ресурса,
/// связанного со всеми файлами с расширением .resx, от которых зависит данный класс. В противном случае,
/// конструкторы не смогут правильно работать с локализованными
/// ресурсами, сопоставленными данной форме.
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: добавьте код конструктора
//
}
protected:
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Button^ bShowTable;
protected:
private: System::Windows::Forms::Button^ bSearchTable;
private: System::Windows::Forms::Button^ bCan4;
private: System::Windows::Forms::Button^ bCan3;
private: System::Windows::Forms::Button^ bCan2;
private: System::Windows::Forms::Button^ bCan1;
private: System::Windows::Forms::Timer^ tiRecv;
private: Devart::Data::MySql::MySqlConnection^ mySqlConnection1;
private: Devart::Data::MySql::MySqlDataReader^ MySqlDataReader1;
private: Devart::Data::MySql::MySqlCommand^ mySqlCommand1;
private: System::Windows::Forms::ListBox^ listBox1;
private: System::ComponentModel::IContainer^ components;
private:
/// <summary>
/// Требуется переменная конструктора.
/// </summary>
#pragma region Windows Form Designer generated code
/// <summary>
/// Обязательный метод для поддержки конструктора - не изменяйте
/// содержимое данного метода при помощи редактора кода.
/// </summary>
void InitializeComponent(void)
{
this->components = (gcnew System::ComponentModel::Container());
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
this->bShowTable = (gcnew System::Windows::Forms::Button());
this->bSearchTable = (gcnew System::Windows::Forms::Button());
this->bCan4 = (gcnew System::Windows::Forms::Button());
this->bCan3 = (gcnew System::Windows::Forms::Button());
this->bCan2 = (gcnew System::Windows::Forms::Button());
this->bCan1 = (gcnew System::Windows::Forms::Button());
this->tiRecv = (gcnew System::Windows::Forms::Timer(this->components));
this->mySqlConnection1 = (gcnew Devart::Data::MySql::MySqlConnection());
this->mySqlCommand1 = (gcnew Devart::Data::MySql::MySqlCommand());
this->listBox1 = (gcnew System::Windows::Forms::ListBox());
this->SuspendLayout();
//
// bShowTable
//
this->bShowTable->Location = System::Drawing::Point(83, 158);
this->bShowTable->Name = L"bShowTable";
this->bShowTable->Size = System::Drawing::Size(97, 23);
this->bShowTable->TabIndex = 23;
this->bShowTable->Text = L"Далее>>>";
this->bShowTable->UseVisualStyleBackColor = true;
this->bShowTable->Visible = false;
this->bShowTable->Click += gcnew System::EventHandler(this, &Form1::bShowTable_Click);
//
// bSearchTable
//
this->bSearchTable->Location = System::Drawing::Point(83, 129);
this->bSearchTable->Name = L"bSearchTable";
this->bSearchTable->Size = System::Drawing::Size(97, 23);
this->bSearchTable->TabIndex = 22;
this->bSearchTable->Text = L"Постпроцессинг";
this->bSearchTable->UseVisualStyleBackColor = true;
this->bSearchTable->Click += gcnew System::EventHandler(this, &Form1::bSearchTable_Click);
//
// bCan4
//
this->bCan4->Location = System::Drawing::Point(83, 100);
this->bCan4->Name = L"bCan4";
this->bCan4->Size = System::Drawing::Size(97, 23);
this->bCan4->TabIndex = 21;
this->bCan4->Text = L"Канал 4";
this->bCan4->UseVisualStyleBackColor = true;
this->bCan4->Click += gcnew System::EventHandler(this, &Form1::bCan4_Click);
//
// bCan3
//
this->bCan3->Location = System::Drawing::Point(83, 71);
this->bCan3->Name = L"bCan3";
this->bCan3->Size = System::Drawing::Size(97, 23);
this->bCan3->TabIndex = 20;
this->bCan3->Text = L"Канал 3";
this->bCan3->UseVisualStyleBackColor = true;
this->bCan3->Click += gcnew System::EventHandler(this, &Form1::bCan3_Click);
//
// bCan2
//
this->bCan2->Location = System::Drawing::Point(83, 42);
this->bCan2->Name = L"bCan2";
this->bCan2->Size = System::Drawing::Size(97, 23);
this->bCan2->TabIndex = 19;
this->bCan2->Text = L"Канал 2";
this->bCan2->UseVisualStyleBackColor = true;
this->bCan2->Click += gcnew System::EventHandler(this, &Form1::bCan2_Click);
//
// bCan1
//
this->bCan1->Location = System::Drawing::Point(83, 12);
this->bCan1->Name = L"bCan1";
this->bCan1->Size = System::Drawing::Size(97, 23);
this->bCan1->TabIndex = 18;
this->bCan1->Text = L"Канал 1";
this->bCan1->UseVisualStyleBackColor = true;
this->bCan1->Click += gcnew System::EventHandler(this, &Form1::bCan1_Click);
//
// tiRecv
//
this->tiRecv->Interval = 1;
this->tiRecv->Tick += gcnew System::EventHandler(this, &Form1::tiRecv_Tick);
//
// mySqlConnection1
//
this->mySqlConnection1->ConnectionString = L"User Id=root;Host=localhost;Database=fazus_db;";
this->mySqlConnection1->Name = L"mySqlConnection1";
//
// mySqlCommand1
//
this->mySqlCommand1->Connection = this->mySqlConnection1;
this->mySqlCommand1->Name = L"mySqlCommand1";
//
// listBox1
//
this->listBox1->BackColor = System::Drawing::Color::LightSkyBlue;
this->listBox1->FormattingEnabled = true;
this->listBox1->Location = System::Drawing::Point(118, 12);
this->listBox1->Name = L"listBox1";
this->listBox1->Size = System::Drawing::Size(154, 173);
this->listBox1->TabIndex = 24;
this->listBox1->Visible = false;
this->listBox1->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::listBox1_SelectedIndexChanged);
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->BackColor = System::Drawing::Color::PaleTurquoise;
this->ClientSize = System::Drawing::Size(284, 193);
this->Controls->Add(this->listBox1);
this->Controls->Add(this->bShowTable);
this->Controls->Add(this->bSearchTable);
this->Controls->Add(this->bCan4);
this->Controls->Add(this->bCan3);
this->Controls->Add(this->bCan2);
this->Controls->Add(this->bCan1);
this->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon")));
this->Name = L"Form1";
this->Text = L"Главное меню";
this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
this->ResumeLayout(false);
}
#pragma endregion
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
nazh=0;
canalOpen[0]=canalOpen[1]=canalOpen[2]=canalOpen[3]=true;
}
private: System::Void bCan1_Click(System::Object^ sender, System::EventArgs^ e) {
if(nazh==0){
fd_set soc_insp;
timeval insp_time;
soc_insp.fd_count = 1;
soc_insp.fd_array[0] = m_sock;
insp_time.tv_sec = 0;
insp_time.tv_usec = 10000*2;
init_program();
init_instrument();
select(0, &soc_insp, NULL, NULL, &insp_time);
tiRecv->Enabled=true;/**/
nazh++;
}
Def^ gdif1 = gcnew Def;
gdif1->Name="Can0";
gdif1->Show();
}
private: System::Void bCan2_Click(System::Object^ sender, System::EventArgs^ e) {
if(nazh==0){
fd_set soc_insp;
timeval insp_time;
soc_insp.fd_count = 1;
soc_insp.fd_array[0] = m_sock;
insp_time.tv_sec = 0;
insp_time.tv_usec = 10000*2;
init_program();
init_instrument();
select(0, &soc_insp, NULL, NULL, &insp_time);
tiRecv->Enabled=true;/**/
nazh++;
}
Def^ gdif1 = gcnew Def;
gdif1->Name="Can1";
gdif1->Show();
}
private: System::Void bCan3_Click(System::Object^ sender, System::EventArgs^ e) {
if(nazh==0){
fd_set soc_insp;
timeval insp_time;
soc_insp.fd_count = 1;
soc_insp.fd_array[0] = m_sock;
insp_time.tv_sec = 0;
insp_time.tv_usec = 10000*2;
init_program();
init_instrument();
select(0, &soc_insp, NULL, NULL, &insp_time);
tiRecv->Enabled=true;/**/
nazh++;
}
Def^ gdif1 = gcnew Def;
gdif1->Name="Can2";
gdif1->Show();
}
private: System::Void bCan4_Click(System::Object^ sender, System::EventArgs^ e) {
if(nazh==0){
fd_set soc_insp;
timeval insp_time;
soc_insp.fd_count = 1;
soc_insp.fd_array[0] = m_sock;
insp_time.tv_sec = 0;
insp_time.tv_usec = 10000*2;
init_program();
init_instrument();
select(0, &soc_insp, NULL, NULL, &insp_time);
tiRecv->Enabled=true;/**/
nazh++;
}
Def^ gdif1 = gcnew Def;
gdif1->Name="Can3";
gdif1->Show();
}
private: System::Void tiRecv_Tick(System::Object^ sender, System::EventArgs^ e) {
zuzu();
if(canalOpen[0]) bCan1->Visible=true;
if(canalOpen[1]) bCan2->Visible=true;
if(canalOpen[2]) bCan3->Visible=true;
if(canalOpen[3]) bCan4->Visible=true;
if(!canalOpen[0]) bCan1->Visible=false;
if(!canalOpen[1]) bCan2->Visible=false;
if(!canalOpen[2]) bCan3->Visible=false;
if(!canalOpen[3]) bCan4->Visible=false;
}
int zuzu(){
short bf[1024];
// int num;
// fd_set soc_insp;
// timeval insp_time;
double oscill_dat[3];
double oscill_dat_1[3];
double oscill_dat_2[3];
double oscill_dat_3[3];
unsigned short send_buf[2];
double x_m = 0.0;
double y_m = 0.0;
double x_m_1 = 0.0;
double y_m_1 = 0.0;
double x_m_2 = 0.0;
double y_m_2 = 0.0;
double x_m_3 = 0.0;
double y_m_3 = 0.0;
int z=0;
send_buf[0] = 0x0700; // dsp scanning
send_buf[1] = 0x0000;
send(m_sock, (char *)send_buf, sizeof(send_buf), 0);
while(z<10){
z++;
recv(m_sock, (char *)bf, 1500, 0);
pbf = bf+16;
for(int i = 0; i<64; ++i) {
oscill_dat[0] = (double)(*pbf);
x_m += oscill_dat[0];
oscill_dat[1] = (double)(*(pbf+1));
y_m += oscill_dat[1];
coordX[0][i]=oscill_dat[0];
coordY[0][i]=oscill_dat[1];
pbf += 2;
oscill_dat_1[0] = (double)(*pbf);
x_m_1 += oscill_dat_1[0];
oscill_dat_1[1] = (double)(*(pbf+1));
y_m_1 += oscill_dat_1[1];
pbf += 2;
coordX[1][i]=oscill_dat_1[0];
coordY[1][i]=oscill_dat_1[1];
}
x_med = x_m / 64.0;
x_m = 0.0;
y_med = y_m / 64.0;
y_m = 0.0;
x_med_1 = x_m_1 / 64.0;
x_m_1 = 0.0;
y_med_1 = y_m_1 / 64.0;
y_m_1 = 0.0;
per=0;
for(int i = 0; i<64; ++i) {
oscill_dat_2[0] = (double)(*pbf);
x_m_2 += oscill_dat_2[0];
oscill_dat_2[1] = (double)(*(pbf+1));
y_m_2 += oscill_dat_2[1];
coordX[2][i]=oscill_dat_2[0];
coordY[2][i]=oscill_dat_2[1];
pbf += 2;
oscill_dat_3[0] = (double)(*pbf);
x_m_3 += oscill_dat_3[0];
oscill_dat_3[1] = (double)(*(pbf+1));
y_m_3 += oscill_dat_3[1];
pbf += 2;
coordX[3][i]=oscill_dat_3[0];
coordY[3][i]=oscill_dat_3[1];
}
x_med_2 = x_m_2 / 64.0;
x_m_2 = 0.0;
y_med_2 = y_m_2 / 64.0;
y_m_2 = 0.0;
x_med_3 = x_m_3 / 64.0;
x_m_3 = 0.0;
y_med_3 = y_m_3 / 64.0;
y_m_3 = 0.0;
}
return 0;
}
private: System::Void bSearchTable_Click(System::Object^ sender, System::EventArgs^ e) {
bCan1->Left=12;
bCan2->Left=12;
bCan3->Left=12;
bCan4->Left=12;
bSearchTable->Left=12;
bShowTable->Left=12;
listBox1->Visible=true;
bShowTable->Visible=false;
mySqlCommand1->CommandText="show tables;";
listBox1->Items->Clear();
mySqlConnection1->Open();
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
for (int i = 0; i < MySqlDataReader1->FieldCount; i++)
{
listBox1->Items->Add( MySqlDataReader1->GetValue(i)->ToString());
}
}
listBox1->Items->Remove("obj");
mySqlConnection1->Close();
}
private: System::Void bShowTable_Click(System::Object^ sender, System::EventArgs^ e) {
/* mySqlCommand1->CommandText="drop table`"+listBox1->Text+"`;";
listBox1->Items->Clear();
mySqlConnection1->Open();
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
for (int i = 0; i < MySqlDataReader1->FieldCount; i++)
{
listBox1->Items->Add( MySqlDataReader1->GetValue(i)->ToString());
}
}
MySqlDataReader1->Close();*/
Def^ gdif1 = gcnew Def;
gdif1->Name=listBox1->Text;
gdif1->Show();
}
private: System::Void listBox1_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {
if(listBox1->Text!=""){
bShowTable->Visible=true;
}
}
};
}
#include "ec.h"
#include "set_param.h"
#include "Def.h"
#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "mswsock.lib")
#pragma comment(lib, "WSock32.lib")
#pragma comment(lib, "IPHlpApi.Lib")
#pragma comment(lib, "Kernel32.lib")
extern SOCKET m_sock;
extern double x_med, y_med, x_med_1, y_med_1, x_med_2, y_med_2, x_med_3, y_med_3;
//extern double coordY[4][64], coordX[4][64];
double coordY[4][64], coordX[4][64];
bool canalOpen[5];
static int nazh;
namespace vihretok {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Сводка для Form1
///
/// Внимание! При изменении имени этого класса необходимо также изменить
/// свойство имени файла ресурсов ("Resource File Name") для средства компиляции управляемого ресурса,
/// связанного со всеми файлами с расширением .resx, от которых зависит данный класс. В противном случае,
/// конструкторы не смогут правильно работать с локализованными
/// ресурсами, сопоставленными данной форме.
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: добавьте код конструктора
//
}
protected:
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Button^ bShowTable;
protected:
private: System::Windows::Forms::Button^ bSearchTable;
private: System::Windows::Forms::Button^ bCan4;
private: System::Windows::Forms::Button^ bCan3;
private: System::Windows::Forms::Button^ bCan2;
private: System::Windows::Forms::Button^ bCan1;
private: System::Windows::Forms::Timer^ tiRecv;
private: Devart::Data::MySql::MySqlConnection^ mySqlConnection1;
private: Devart::Data::MySql::MySqlDataReader^ MySqlDataReader1;
private: Devart::Data::MySql::MySqlCommand^ mySqlCommand1;
private: System::Windows::Forms::ListBox^ listBox1;
private: System::ComponentModel::IContainer^ components;
private:
/// <summary>
/// Требуется переменная конструктора.
/// </summary>
#pragma region Windows Form Designer generated code
/// <summary>
/// Обязательный метод для поддержки конструктора - не изменяйте
/// содержимое данного метода при помощи редактора кода.
/// </summary>
void InitializeComponent(void)
{
this->components = (gcnew System::ComponentModel::Container());
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
this->bShowTable = (gcnew System::Windows::Forms::Button());
this->bSearchTable = (gcnew System::Windows::Forms::Button());
this->bCan4 = (gcnew System::Windows::Forms::Button());
this->bCan3 = (gcnew System::Windows::Forms::Button());
this->bCan2 = (gcnew System::Windows::Forms::Button());
this->bCan1 = (gcnew System::Windows::Forms::Button());
this->tiRecv = (gcnew System::Windows::Forms::Timer(this->components));
this->mySqlConnection1 = (gcnew Devart::Data::MySql::MySqlConnection());
this->mySqlCommand1 = (gcnew Devart::Data::MySql::MySqlCommand());
this->listBox1 = (gcnew System::Windows::Forms::ListBox());
this->SuspendLayout();
//
// bShowTable
//
this->bShowTable->Location = System::Drawing::Point(83, 158);
this->bShowTable->Name = L"bShowTable";
this->bShowTable->Size = System::Drawing::Size(97, 23);
this->bShowTable->TabIndex = 23;
this->bShowTable->Text = L"Далее>>>";
this->bShowTable->UseVisualStyleBackColor = true;
this->bShowTable->Visible = false;
this->bShowTable->Click += gcnew System::EventHandler(this, &Form1::bShowTable_Click);
//
// bSearchTable
//
this->bSearchTable->Location = System::Drawing::Point(83, 129);
this->bSearchTable->Name = L"bSearchTable";
this->bSearchTable->Size = System::Drawing::Size(97, 23);
this->bSearchTable->TabIndex = 22;
this->bSearchTable->Text = L"Постпроцессинг";
this->bSearchTable->UseVisualStyleBackColor = true;
this->bSearchTable->Click += gcnew System::EventHandler(this, &Form1::bSearchTable_Click);
//
// bCan4
//
this->bCan4->Location = System::Drawing::Point(83, 100);
this->bCan4->Name = L"bCan4";
this->bCan4->Size = System::Drawing::Size(97, 23);
this->bCan4->TabIndex = 21;
this->bCan4->Text = L"Канал 4";
this->bCan4->UseVisualStyleBackColor = true;
this->bCan4->Click += gcnew System::EventHandler(this, &Form1::bCan4_Click);
//
// bCan3
//
this->bCan3->Location = System::Drawing::Point(83, 71);
this->bCan3->Name = L"bCan3";
this->bCan3->Size = System::Drawing::Size(97, 23);
this->bCan3->TabIndex = 20;
this->bCan3->Text = L"Канал 3";
this->bCan3->UseVisualStyleBackColor = true;
this->bCan3->Click += gcnew System::EventHandler(this, &Form1::bCan3_Click);
//
// bCan2
//
this->bCan2->Location = System::Drawing::Point(83, 42);
this->bCan2->Name = L"bCan2";
this->bCan2->Size = System::Drawing::Size(97, 23);
this->bCan2->TabIndex = 19;
this->bCan2->Text = L"Канал 2";
this->bCan2->UseVisualStyleBackColor = true;
this->bCan2->Click += gcnew System::EventHandler(this, &Form1::bCan2_Click);
//
// bCan1
//
this->bCan1->Location = System::Drawing::Point(83, 12);
this->bCan1->Name = L"bCan1";
this->bCan1->Size = System::Drawing::Size(97, 23);
this->bCan1->TabIndex = 18;
this->bCan1->Text = L"Канал 1";
this->bCan1->UseVisualStyleBackColor = true;
this->bCan1->Click += gcnew System::EventHandler(this, &Form1::bCan1_Click);
//
// tiRecv
//
this->tiRecv->Interval = 1;
this->tiRecv->Tick += gcnew System::EventHandler(this, &Form1::tiRecv_Tick);
//
// mySqlConnection1
//
this->mySqlConnection1->ConnectionString = L"User Id=root;Host=localhost;Database=fazus_db;";
this->mySqlConnection1->Name = L"mySqlConnection1";
//
// mySqlCommand1
//
this->mySqlCommand1->Connection = this->mySqlConnection1;
this->mySqlCommand1->Name = L"mySqlCommand1";
//
// listBox1
//
this->listBox1->BackColor = System::Drawing::Color::LightSkyBlue;
this->listBox1->FormattingEnabled = true;
this->listBox1->Location = System::Drawing::Point(118, 12);
this->listBox1->Name = L"listBox1";
this->listBox1->Size = System::Drawing::Size(154, 173);
this->listBox1->TabIndex = 24;
this->listBox1->Visible = false;
this->listBox1->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::listBox1_SelectedIndexChanged);
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->BackColor = System::Drawing::Color::PaleTurquoise;
this->ClientSize = System::Drawing::Size(284, 193);
this->Controls->Add(this->listBox1);
this->Controls->Add(this->bShowTable);
this->Controls->Add(this->bSearchTable);
this->Controls->Add(this->bCan4);
this->Controls->Add(this->bCan3);
this->Controls->Add(this->bCan2);
this->Controls->Add(this->bCan1);
this->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon")));
this->Name = L"Form1";
this->Text = L"Главное меню";
this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
this->ResumeLayout(false);
}
#pragma endregion
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
nazh=0;
canalOpen[0]=canalOpen[1]=canalOpen[2]=canalOpen[3]=true;
}
private: System::Void bCan1_Click(System::Object^ sender, System::EventArgs^ e) {
if(nazh==0){
fd_set soc_insp;
timeval insp_time;
soc_insp.fd_count = 1;
soc_insp.fd_array[0] = m_sock;
insp_time.tv_sec = 0;
insp_time.tv_usec = 10000*2;
init_program();
init_instrument();
select(0, &soc_insp, NULL, NULL, &insp_time);
tiRecv->Enabled=true;/**/
nazh++;
}
Def^ gdif1 = gcnew Def;
gdif1->Name="Can0";
gdif1->Show();
}
private: System::Void bCan2_Click(System::Object^ sender, System::EventArgs^ e) {
if(nazh==0){
fd_set soc_insp;
timeval insp_time;
soc_insp.fd_count = 1;
soc_insp.fd_array[0] = m_sock;
insp_time.tv_sec = 0;
insp_time.tv_usec = 10000*2;
init_program();
init_instrument();
select(0, &soc_insp, NULL, NULL, &insp_time);
tiRecv->Enabled=true;/**/
nazh++;
}
Def^ gdif1 = gcnew Def;
gdif1->Name="Can1";
gdif1->Show();
}
private: System::Void bCan3_Click(System::Object^ sender, System::EventArgs^ e) {
if(nazh==0){
fd_set soc_insp;
timeval insp_time;
soc_insp.fd_count = 1;
soc_insp.fd_array[0] = m_sock;
insp_time.tv_sec = 0;
insp_time.tv_usec = 10000*2;
init_program();
init_instrument();
select(0, &soc_insp, NULL, NULL, &insp_time);
tiRecv->Enabled=true;/**/
nazh++;
}
Def^ gdif1 = gcnew Def;
gdif1->Name="Can2";
gdif1->Show();
}
private: System::Void bCan4_Click(System::Object^ sender, System::EventArgs^ e) {
if(nazh==0){
fd_set soc_insp;
timeval insp_time;
soc_insp.fd_count = 1;
soc_insp.fd_array[0] = m_sock;
insp_time.tv_sec = 0;
insp_time.tv_usec = 10000*2;
init_program();
init_instrument();
select(0, &soc_insp, NULL, NULL, &insp_time);
tiRecv->Enabled=true;/**/
nazh++;
}
Def^ gdif1 = gcnew Def;
gdif1->Name="Can3";
gdif1->Show();
}
private: System::Void tiRecv_Tick(System::Object^ sender, System::EventArgs^ e) {
zuzu();
if(canalOpen[0]) bCan1->Visible=true;
if(canalOpen[1]) bCan2->Visible=true;
if(canalOpen[2]) bCan3->Visible=true;
if(canalOpen[3]) bCan4->Visible=true;
if(!canalOpen[0]) bCan1->Visible=false;
if(!canalOpen[1]) bCan2->Visible=false;
if(!canalOpen[2]) bCan3->Visible=false;
if(!canalOpen[3]) bCan4->Visible=false;
}
int zuzu(){
short bf[1024];
// int num;
// fd_set soc_insp;
// timeval insp_time;
double oscill_dat[3];
double oscill_dat_1[3];
double oscill_dat_2[3];
double oscill_dat_3[3];
unsigned short send_buf[2];
double x_m = 0.0;
double y_m = 0.0;
double x_m_1 = 0.0;
double y_m_1 = 0.0;
double x_m_2 = 0.0;
double y_m_2 = 0.0;
double x_m_3 = 0.0;
double y_m_3 = 0.0;
int z=0;
send_buf[0] = 0x0700; // dsp scanning
send_buf[1] = 0x0000;
send(m_sock, (char *)send_buf, sizeof(send_buf), 0);
while(z<10){
z++;
recv(m_sock, (char *)bf, 1500, 0);
pbf = bf+16;
for(int i = 0; i<64; ++i) {
oscill_dat[0] = (double)(*pbf);
x_m += oscill_dat[0];
oscill_dat[1] = (double)(*(pbf+1));
y_m += oscill_dat[1];
coordX[0][i]=oscill_dat[0];
coordY[0][i]=oscill_dat[1];
pbf += 2;
oscill_dat_1[0] = (double)(*pbf);
x_m_1 += oscill_dat_1[0];
oscill_dat_1[1] = (double)(*(pbf+1));
y_m_1 += oscill_dat_1[1];
pbf += 2;
coordX[1][i]=oscill_dat_1[0];
coordY[1][i]=oscill_dat_1[1];
}
x_med = x_m / 64.0;
x_m = 0.0;
y_med = y_m / 64.0;
y_m = 0.0;
x_med_1 = x_m_1 / 64.0;
x_m_1 = 0.0;
y_med_1 = y_m_1 / 64.0;
y_m_1 = 0.0;
per=0;
for(int i = 0; i<64; ++i) {
oscill_dat_2[0] = (double)(*pbf);
x_m_2 += oscill_dat_2[0];
oscill_dat_2[1] = (double)(*(pbf+1));
y_m_2 += oscill_dat_2[1];
coordX[2][i]=oscill_dat_2[0];
coordY[2][i]=oscill_dat_2[1];
pbf += 2;
oscill_dat_3[0] = (double)(*pbf);
x_m_3 += oscill_dat_3[0];
oscill_dat_3[1] = (double)(*(pbf+1));
y_m_3 += oscill_dat_3[1];
pbf += 2;
coordX[3][i]=oscill_dat_3[0];
coordY[3][i]=oscill_dat_3[1];
}
x_med_2 = x_m_2 / 64.0;
x_m_2 = 0.0;
y_med_2 = y_m_2 / 64.0;
y_m_2 = 0.0;
x_med_3 = x_m_3 / 64.0;
x_m_3 = 0.0;
y_med_3 = y_m_3 / 64.0;
y_m_3 = 0.0;
}
return 0;
}
private: System::Void bSearchTable_Click(System::Object^ sender, System::EventArgs^ e) {
bCan1->Left=12;
bCan2->Left=12;
bCan3->Left=12;
bCan4->Left=12;
bSearchTable->Left=12;
bShowTable->Left=12;
listBox1->Visible=true;
bShowTable->Visible=false;
mySqlCommand1->CommandText="show tables;";
listBox1->Items->Clear();
mySqlConnection1->Open();
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
for (int i = 0; i < MySqlDataReader1->FieldCount; i++)
{
listBox1->Items->Add( MySqlDataReader1->GetValue(i)->ToString());
}
}
listBox1->Items->Remove("obj");
mySqlConnection1->Close();
}
private: System::Void bShowTable_Click(System::Object^ sender, System::EventArgs^ e) {
/* mySqlCommand1->CommandText="drop table`"+listBox1->Text+"`;";
listBox1->Items->Clear();
mySqlConnection1->Open();
MySqlDataReader1 = mySqlCommand1->ExecuteReader();
while(MySqlDataReader1->Read())
{
for (int i = 0; i < MySqlDataReader1->FieldCount; i++)
{
listBox1->Items->Add( MySqlDataReader1->GetValue(i)->ToString());
}
}
MySqlDataReader1->Close();*/
Def^ gdif1 = gcnew Def;
gdif1->Name=listBox1->Text;
gdif1->Show();
}
private: System::Void listBox1_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {
if(listBox1->Text!=""){
bShowTable->Visible=true;
}
}
};
}
Для справки читаем
Код:
1>.\filt_gen.cpp(4) : error C4430: отсутствует спецификатор типа - предполагается int. Примечание. C++ не поддерживает int по умолчанию
1>.\filt_gen.cpp(4) : error C2371: pi: переопределение; различные базовые типы
1> d:\vc\vihretok\vihretok\filt_gen.h(15): см. объявление 'pi'
1>.\filt_gen.cpp(4) : warning C4244: инициализация: преобразование 'double' в 'int', возможна потеря данных
1>.\filt_gen.cpp(5) : error C4430: отсутствует спецификатор типа - предполагается int. Примечание. C++ не поддерживает int по умолчанию
1>.\filt_gen.cpp(5) : error C2371: Pi2: переопределение; различные базовые типы
1> d:\vc\vihretok\vihretok\filt_gen.h(16): см. объявление 'Pi2'
1>.\filt_gen.cpp(5) : warning C4244: инициализация: преобразование 'double' в 'int', возможна потеря данных
1>vihretok.cpp
1>filt1.cpp
1>Def.cpp
1>Журнал построения был сохранен в "file://d:\VC\vihretok\vihretok\Release\BuildLog.htm"
1>vihretok - ошибок 4, предупреждений 2
1>.\filt_gen.cpp(4) : error C2371: pi: переопределение; различные базовые типы
1> d:\vc\vihretok\vihretok\filt_gen.h(15): см. объявление 'pi'
1>.\filt_gen.cpp(4) : warning C4244: инициализация: преобразование 'double' в 'int', возможна потеря данных
1>.\filt_gen.cpp(5) : error C4430: отсутствует спецификатор типа - предполагается int. Примечание. C++ не поддерживает int по умолчанию
1>.\filt_gen.cpp(5) : error C2371: Pi2: переопределение; различные базовые типы
1> d:\vc\vihretok\vihretok\filt_gen.h(16): см. объявление 'Pi2'
1>.\filt_gen.cpp(5) : warning C4244: инициализация: преобразование 'double' в 'int', возможна потеря данных
1>vihretok.cpp
1>filt1.cpp
1>Def.cpp
1>Журнал построения был сохранен в "file://d:\VC\vihretok\vihretok\Release\BuildLog.htm"
1>vihretok - ошибок 4, предупреждений 2
Код:
отсутствует спецификатор типа - предполагается int. Примечание. C++ не поддерживает int по умолчанию
Код:
#include <malloc.h>
#include <math.h>
#include "ipp_v8.h"
#include "ipps.h"
//#include "remez.h"
//#pragma comment(lib, "aa.lib")
//extern double pi = atan(1.) * 4.0;
//extern double Pi2 = pi * 2.;
//extern double pi;
//extern double Pi2;
//double pi;
//double Pi2;
#define DIFFERENTIATOR 2
......
#include <math.h>
#include "ipp_v8.h"
#include "ipps.h"
//#include "remez.h"
//#pragma comment(lib, "aa.lib")
//extern double pi = atan(1.) * 4.0;
//extern double Pi2 = pi * 2.;
//extern double pi;
//extern double Pi2;
//double pi;
//double Pi2;
#define DIFFERENTIATOR 2
......
filt_gen.cpp
Код:
#include "StdAfx.h"
#include "filt_gen.h"
using namespace System;
double pi = pi * 2.;
double Pi2 = atan(1.) * 4.0;
#include "filt_gen.h"
using namespace System;
double pi = pi * 2.;
double Pi2 = atan(1.) * 4.0;
Код:
1>------ Построение начато: проект: vihretok, Конфигурация: Release Win32 ------
1>Компиляция...
1>filt_gen.cpp
1>.\filt_gen.cpp(5) : error C2086: double pi: переопределение
1> d:\vc\vihretok\vihretok\filt_gen.h(16): см. объявление 'pi'
1>.\filt_gen.cpp(6) : error C2086: double Pi2: переопределение
1> d:\vc\vihretok\vihretok\filt_gen.h(17): см. объявление 'Pi2'
1>vihretok.cpp
1>filt1.cpp
1>Def.cpp
1>Журнал построения был сохранен в "file://d:\VC\vihretok\vihretok\Release\BuildLog.htm"
1>vihretok - ошибок 2, предупреждений 0
========== Построение: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========
1>Компиляция...
1>filt_gen.cpp
1>.\filt_gen.cpp(5) : error C2086: double pi: переопределение
1> d:\vc\vihretok\vihretok\filt_gen.h(16): см. объявление 'pi'
1>.\filt_gen.cpp(6) : error C2086: double Pi2: переопределение
1> d:\vc\vihretok\vihretok\filt_gen.h(17): см. объявление 'Pi2'
1>vihretok.cpp
1>filt1.cpp
1>Def.cpp
1>Журнал построения был сохранен в "file://d:\VC\vihretok\vihretok\Release\BuildLog.htm"
1>vihretok - ошибок 2, предупреждений 0
========== Построение: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========
Код:
1>------ Построение начато: проект: vihretok, Конфигурация: Release Win32 ------
1>Компиляция...
1>filt_gen.cpp
1>vihretok.cpp
1>filt1.cpp
1>Def.cpp
1>Компоновка...
1>filt1.obj : error LNK2005: "void __clrcall cf(double *,int,double,double,double,double,double *,double *)" (?cf@@$$FYMXPANHNNNN00@Z) уже определен в Def.obj
1>filt1.obj : error LNK2005: "int __clrcall differ_gen(double,double *)" (?differ_gen@@$$FYMHNPAN@Z) уже определен в Def.obj
1>filt1.obj : error LNK2005: "int __clrcall filt_gen(double,double,double *)" (?filt_gen@@$$FYMHNNPAN@Z) уже определен в Def.obj
1>vihretok.obj : error LNK2005: "void __clrcall cf(double *,int,double,double,double,double,double *,double *)" (?cf@@$$FYMXPANHNNNN00@Z) уже определен в Def.obj
1>vihretok.obj : error LNK2005: "int __clrcall differ_gen(double,double *)" (?differ_gen@@$$FYMHNPAN@Z) уже определен в Def.obj
1>vihretok.obj : error LNK2005: "int __clrcall filt_gen(double,double,double *)" (?filt_gen@@$$FYMHNNPAN@Z) уже определен в Def.obj
1>filt_gen.obj : error LNK2005: "void __clrcall cf(double *,int,double,double,double,double,double *,double *)" (?cf@@$$FYMXPANHNNNN00@Z) уже определен в Def.obj
1>filt_gen.obj : error LNK2005: "int __clrcall differ_gen(double,double *)" (?differ_gen@@$$FYMHNPAN@Z) уже определен в Def.obj
1>filt_gen.obj : error LNK2005: "int __clrcall filt_gen(double,double,double *)" (?filt_gen@@$$FYMHNNPAN@Z) уже определен в Def.obj
1>Def.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenLowpass_64f(double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenLowpass_64f@@$$J224YG?AW4IppStatus@@NPANHW4IppWinType@@W4IppBool@@@Z)"
1>Def.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenHighpass_64f(double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenHighpass_64f@@$$J224YG?AW4IppStatus@@NPANHW4IppWinType@@W4IppBool@@@Z)"
1>Def.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenBandpass_64f(double,double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenBandpass_64f@@$$J232YG?AW4IppStatus@@NNPANHW4IppWinType@@W4IppBool@@@Z)"
1>Def.obj : error LNK2001: неразрешенный внешний символ ""int __clrcall rflt(double *,int,int,double * const,double * const,double * const,int,int)" (?rflt@@$$FYMHPANHHQAN11HH@Z)"
1>D:\VC\vihretok\Release\vihretok.exe : fatal error LNK1120: 4 неразрешенных внешних элементов
1>Журнал построения был сохранен в "file://d:\VC\vihretok\vihretok\Release\BuildLog.htm"
1>vihretok - ошибок 14, предупреждений 0
========== Построение: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========
1>Компиляция...
1>filt_gen.cpp
1>vihretok.cpp
1>filt1.cpp
1>Def.cpp
1>Компоновка...
1>filt1.obj : error LNK2005: "void __clrcall cf(double *,int,double,double,double,double,double *,double *)" (?cf@@$$FYMXPANHNNNN00@Z) уже определен в Def.obj
1>filt1.obj : error LNK2005: "int __clrcall differ_gen(double,double *)" (?differ_gen@@$$FYMHNPAN@Z) уже определен в Def.obj
1>filt1.obj : error LNK2005: "int __clrcall filt_gen(double,double,double *)" (?filt_gen@@$$FYMHNNPAN@Z) уже определен в Def.obj
1>vihretok.obj : error LNK2005: "void __clrcall cf(double *,int,double,double,double,double,double *,double *)" (?cf@@$$FYMXPANHNNNN00@Z) уже определен в Def.obj
1>vihretok.obj : error LNK2005: "int __clrcall differ_gen(double,double *)" (?differ_gen@@$$FYMHNPAN@Z) уже определен в Def.obj
1>vihretok.obj : error LNK2005: "int __clrcall filt_gen(double,double,double *)" (?filt_gen@@$$FYMHNNPAN@Z) уже определен в Def.obj
1>filt_gen.obj : error LNK2005: "void __clrcall cf(double *,int,double,double,double,double,double *,double *)" (?cf@@$$FYMXPANHNNNN00@Z) уже определен в Def.obj
1>filt_gen.obj : error LNK2005: "int __clrcall differ_gen(double,double *)" (?differ_gen@@$$FYMHNPAN@Z) уже определен в Def.obj
1>filt_gen.obj : error LNK2005: "int __clrcall filt_gen(double,double,double *)" (?filt_gen@@$$FYMHNNPAN@Z) уже определен в Def.obj
1>Def.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenLowpass_64f(double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenLowpass_64f@@$$J224YG?AW4IppStatus@@NPANHW4IppWinType@@W4IppBool@@@Z)"
1>Def.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenHighpass_64f(double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenHighpass_64f@@$$J224YG?AW4IppStatus@@NPANHW4IppWinType@@W4IppBool@@@Z)"
1>Def.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenBandpass_64f(double,double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenBandpass_64f@@$$J232YG?AW4IppStatus@@NNPANHW4IppWinType@@W4IppBool@@@Z)"
1>Def.obj : error LNK2001: неразрешенный внешний символ ""int __clrcall rflt(double *,int,int,double * const,double * const,double * const,int,int)" (?rflt@@$$FYMHPANHHQAN11HH@Z)"
1>D:\VC\vihretok\Release\vihretok.exe : fatal error LNK1120: 4 неразрешенных внешних элементов
1>Журнал построения был сохранен в "file://d:\VC\vihretok\vihretok\Release\BuildLog.htm"
1>vihretok - ошибок 14, предупреждений 0
========== Построение: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========
Код:
1>------ Построение начато: проект: vihretok, Конфигурация: Release Win32 ------
1>Компиляция...
1>filt_gen.cpp
1>vihretok.cpp
1>filt1.cpp
1>Def.cpp
1>Компоновка...
1>filt_gen.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenLowpass_64f(double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenLowpass_64f@@$$J224YG?AW4IppStatus@@NPANHW4IppWinType@@W4IppBool@@@Z)"
1>filt_gen.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenHighpass_64f(double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenHighpass_64f@@$$J224YG?AW4IppStatus@@NPANHW4IppWinType@@W4IppBool@@@Z)"
1>filt_gen.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenBandpass_64f(double,double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenBandpass_64f@@$$J232YG?AW4IppStatus@@NNPANHW4IppWinType@@W4IppBool@@@Z)"
1>filt_gen.obj : error LNK2001: неразрешенный внешний символ ""int __clrcall rflt(double *,int,int,double * const,double * const,double * const,int,int)" (?rflt@@$$FYMHPANHHQAN11HH@Z)"
1>D:\VC\vihretok\Release\vihretok.exe : fatal error LNK1120: 4 неразрешенных внешних элементов
1>Журнал построения был сохранен в "file://d:\VC\vihretok\vihretok\Release\BuildLog.htm"
1>vihretok - ошибок 5, предупреждений 0
========== Построение: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========
1>Компиляция...
1>filt_gen.cpp
1>vihretok.cpp
1>filt1.cpp
1>Def.cpp
1>Компоновка...
1>filt_gen.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenLowpass_64f(double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenLowpass_64f@@$$J224YG?AW4IppStatus@@NPANHW4IppWinType@@W4IppBool@@@Z)"
1>filt_gen.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenHighpass_64f(double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenHighpass_64f@@$$J224YG?AW4IppStatus@@NPANHW4IppWinType@@W4IppBool@@@Z)"
1>filt_gen.obj : error LNK2001: неразрешенный внешний символ ""extern "C" enum IppStatus __stdcall s8_ippsFIRGenBandpass_64f(double,double,double *,int,enum IppWinType,enum IppBool)" (?s8_ippsFIRGenBandpass_64f@@$$J232YG?AW4IppStatus@@NNPANHW4IppWinType@@W4IppBool@@@Z)"
1>filt_gen.obj : error LNK2001: неразрешенный внешний символ ""int __clrcall rflt(double *,int,int,double * const,double * const,double * const,int,int)" (?rflt@@$$FYMHPANHHQAN11HH@Z)"
1>D:\VC\vihretok\Release\vihretok.exe : fatal error LNK1120: 4 неразрешенных внешних элементов
1>Журнал построения был сохранен в "file://d:\VC\vihretok\vihretok\Release\BuildLog.htm"
1>vihretok - ошибок 5, предупреждений 0
========== Построение: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========
.lib файл подключи к проекту
нашел либу с данной функцией, подключил её, получил в ответ
Код:
1>------ Построение начато: проект: vihretok, Конфигурация: Release Win32 ------
1>Компоновка...
1>ipps_l.lib(psfirdesign_split_s8_ippsFIRGenLowpass_64f.obj) : fatal error LNK1313: обнаружен модуль ijw/native; не удается выполнить компоновку с модулями pure
1>Журнал построения был сохранен в "file://d:\VC\vihretok\vihretok\Release\BuildLog.htm"
1>vihretok - ошибок 1, предупреждений 0
========== Построение: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========
1>Компоновка...
1>ipps_l.lib(psfirdesign_split_s8_ippsFIRGenLowpass_64f.obj) : fatal error LNK1313: обнаружен модуль ijw/native; не удается выполнить компоновку с модулями pure
1>Журнал построения был сохранен в "file://d:\VC\vihretok\vihretok\Release\BuildLog.htm"
1>vihretok - ошибок 1, предупреждений 0
========== Построение: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========
Код:
1>------ Построение начато: проект: vihretok, Конфигурация: Release Win32 ------
1>Компиляция...
1>stdafx.cpp
1>c:\program files (x86)\devart\dotconnect\mysql\devart.data.dll : warning C4945: DotfuscatorAttribute: не удается импортировать символ из "c:\program files (x86)\devart\dotconnect\mysql\devart.data.dll": "DotfuscatorAttribute" уже был импортирован из другой сборки "Devart.Data.MySql"
1> c:\program files (x86)\devart\dotconnect\mysql\devart.data.mysql.dll: см. объявление 'DotfuscatorAttribute'
1> используется тип, обнаруженный первым; измените порядок импорта сборок, чтобы использовать текущий тип
1> Сообщение диагностики возникло при импорте типа ".DotfuscatorAttribute" из сборки "Devart.Data, Version=5.0.410.0, Culture=neutral, PublicKeyToken=09af7300eec23701".
1>Компиляция...
1>rflt.cpp
1>vihretok.cpp
1>filt_gen.cpp
1>filt1.cpp
1>Def.cpp
1>AssemblyInfo.cpp
1>Компоновка...
1>ipps_l.lib(psalloc_split_s8_ippsMalloc_64f.obj) : error LNK2001: неразрешенный внешний символ "_ippMalloc@4"
1>ipps_l.lib(psalloc_split_s8_ippsFree.obj) : error LNK2001: неразрешенный внешний символ "_ippFree@4"
1>D:\VC\vihretok\Release\vihretok.exe : fatal error LNK1120: 2 неразрешенных внешних элементов
1>Журнал построения был сохранен в "file://d:\VC\vihretok\vihretok\Release\BuildLog.htm"
1>vihretok - ошибок 3, предупреждений 1
========== Построение: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========
1>Компиляция...
1>stdafx.cpp
1>c:\program files (x86)\devart\dotconnect\mysql\devart.data.dll : warning C4945: DotfuscatorAttribute: не удается импортировать символ из "c:\program files (x86)\devart\dotconnect\mysql\devart.data.dll": "DotfuscatorAttribute" уже был импортирован из другой сборки "Devart.Data.MySql"
1> c:\program files (x86)\devart\dotconnect\mysql\devart.data.mysql.dll: см. объявление 'DotfuscatorAttribute'
1> используется тип, обнаруженный первым; измените порядок импорта сборок, чтобы использовать текущий тип
1> Сообщение диагностики возникло при импорте типа ".DotfuscatorAttribute" из сборки "Devart.Data, Version=5.0.410.0, Culture=neutral, PublicKeyToken=09af7300eec23701".
1>Компиляция...
1>rflt.cpp
1>vihretok.cpp
1>filt_gen.cpp
1>filt1.cpp
1>Def.cpp
1>AssemblyInfo.cpp
1>Компоновка...
1>ipps_l.lib(psalloc_split_s8_ippsMalloc_64f.obj) : error LNK2001: неразрешенный внешний символ "_ippMalloc@4"
1>ipps_l.lib(psalloc_split_s8_ippsFree.obj) : error LNK2001: неразрешенный внешний символ "_ippFree@4"
1>D:\VC\vihretok\Release\vihretok.exe : fatal error LNK1120: 2 неразрешенных внешних элементов
1>Журнал построения был сохранен в "file://d:\VC\vihretok\vihretok\Release\BuildLog.htm"
1>vihretok - ошибок 3, предупреждений 1
========== Построение: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========
Добавь еще .lib :)
в режиме "Поддержка CLR-среды (/clr)"?
Код:
#pragma comment(lib, "ippac.lib")
#pragma comment(lib, "ippac_l.lib")
#pragma comment(lib, "ippac_t.lib")
#pragma comment(lib, "ippcc.lib")
#pragma comment(lib, "ippcc_l.lib")
#pragma comment(lib, "ippcc_t.lib")
#pragma comment(lib, "ippch.lib")
#pragma comment(lib, "ippch_l.lib")
#pragma comment(lib, "ippch_t.lib")
#pragma comment(lib, "ippcore.lib")
#pragma comment(lib, "ippcore_l.lib")
#pragma comment(lib, "ippcore_t.lib")
#pragma comment(lib, "ippcv.lib")
#pragma comment(lib, "ippcv_l.lib")
#pragma comment(lib, "ippcv_t.lib")
#pragma comment(lib, "ippdc.lib")
#pragma comment(lib, "ippdc_l.lib")
#pragma comment(lib, "ippdc_t.lib")
#pragma comment(lib, "ippdi.lib")
#pragma comment(lib, "ippdi_l.lib")
#pragma comment(lib, "ippdi_t.lib")
#pragma comment(lib, "ippi.lib")
#pragma comment(lib, "ippi_l.lib")
#pragma comment(lib, "ippi_t.lib")
#pragma comment(lib, "ippj.lib")
#pragma comment(lib, "ippj_l.lib")
#pragma comment(lib, "ippj_t.lib")
#pragma comment(lib, "ippm.lib")
#pragma comment(lib, "ippm_l.lib")
#pragma comment(lib, "ippm_t.lib")
#pragma comment(lib, "ippr.lib")
#pragma comment(lib, "ippr_l.lib")
#pragma comment(lib, "ippr_t.lib")
#pragma comment(lib, "ippsc.lib")
#pragma comment(lib, "ippsc_l.lib")
#pragma comment(lib, "ippsc_t.lib")
#pragma comment(lib, "ippvc.lib")
#pragma comment(lib, "ippvc_l.lib")
#pragma comment(lib, "ippvc_t.lib")
#pragma comment(lib, "ippvm.lib")
#pragma comment(lib, "ippvm_l.lib")
#pragma comment(lib, "ippvm_t.lib")
#pragma comment(lib, "ipps.lib")
#pragma comment(lib, "ipps_l.lib")
#pragma comment(lib, "ipps_t.lib")
#pragma comment(lib, "ippac_l.lib")
#pragma comment(lib, "ippac_t.lib")
#pragma comment(lib, "ippcc.lib")
#pragma comment(lib, "ippcc_l.lib")
#pragma comment(lib, "ippcc_t.lib")
#pragma comment(lib, "ippch.lib")
#pragma comment(lib, "ippch_l.lib")
#pragma comment(lib, "ippch_t.lib")
#pragma comment(lib, "ippcore.lib")
#pragma comment(lib, "ippcore_l.lib")
#pragma comment(lib, "ippcore_t.lib")
#pragma comment(lib, "ippcv.lib")
#pragma comment(lib, "ippcv_l.lib")
#pragma comment(lib, "ippcv_t.lib")
#pragma comment(lib, "ippdc.lib")
#pragma comment(lib, "ippdc_l.lib")
#pragma comment(lib, "ippdc_t.lib")
#pragma comment(lib, "ippdi.lib")
#pragma comment(lib, "ippdi_l.lib")
#pragma comment(lib, "ippdi_t.lib")
#pragma comment(lib, "ippi.lib")
#pragma comment(lib, "ippi_l.lib")
#pragma comment(lib, "ippi_t.lib")
#pragma comment(lib, "ippj.lib")
#pragma comment(lib, "ippj_l.lib")
#pragma comment(lib, "ippj_t.lib")
#pragma comment(lib, "ippm.lib")
#pragma comment(lib, "ippm_l.lib")
#pragma comment(lib, "ippm_t.lib")
#pragma comment(lib, "ippr.lib")
#pragma comment(lib, "ippr_l.lib")
#pragma comment(lib, "ippr_t.lib")
#pragma comment(lib, "ippsc.lib")
#pragma comment(lib, "ippsc_l.lib")
#pragma comment(lib, "ippsc_t.lib")
#pragma comment(lib, "ippvc.lib")
#pragma comment(lib, "ippvc_l.lib")
#pragma comment(lib, "ippvc_t.lib")
#pragma comment(lib, "ippvm.lib")
#pragma comment(lib, "ippvm_l.lib")
#pragma comment(lib, "ippvm_t.lib")
#pragma comment(lib, "ipps.lib")
#pragma comment(lib, "ipps_l.lib")
#pragma comment(lib, "ipps_t.lib")