コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["User_Id"] == null)
            {
                Response.Redirect("LoginPage.aspx");
            }
            if (!IsPostBack)
            {
                SqlConnection con        = new SqlConnection(ConfigurationManager.ConnectionStrings["UniversityDatabaseConnectionString"].ConnectionString);
                String        value      = Request.QueryString.ToString();
                Char          delimiter  = '&';
                String[]      substrings = value.Split(delimiter);
                //Response.Write("<script>alert('" + value + "');</script>");
                //Response.Write("<script>alert('year=" + substrings[0] + " name=" + substrings[1] + "');</script>");

                if (substrings[0].StartsWith("NUMBER="))
                {
                    substrings[0] = substrings[0].Remove(0, "NUMBER=".Length).Replace('+', ' ').Trim();
                }
                if (substrings[1].StartsWith("NAME="))
                {
                    substrings[1] = substrings[1].Remove(0, "NAME=".Length).Replace('+', ' ').Trim();
                }

                string number, Nm;
                number = substrings[0];
                Nm     = substrings[1];
                //Response.Write("<script>alert('YEAR =" + Yr + " NAME=" + Nm + "');</script>");
                DataSet ds = SelectAllSectionData(number, Nm);
                LblYrDis.Text   = number.ToString();
                LblNameDis.Text = Nm.ToString();
                TxtAmount.Text  = ds.Tables[0].Rows[0]["AMOUNT"].ToString();
            }
        }
コード例 #2
0
ファイル: SP.cs プロジェクト: yusukeinyos/SoundMaker
 //-------------------------------------------------------------------------------------
 //実数値FFT(フル)
 //単独での使用
 public static Complex[] FullRealFastFourierTransform(double[] input)
 {
     input = zeroInserting(input); //0埋め
     Complex[] RFTout = Nm.RealFastFourierTransform(input);
     Complex[] output = new Complex[RFTout.Length * 2];
     for (int i = 0; i < RFTout.Length; i++)
     {
         output[i] = RFTout[i];
         output[RFTout.Length + i] = Complex.Conjugate(RFTout[RFTout.Length - 1 - i]);
     }
     return(output);
 }
コード例 #3
0
ファイル: SP.cs プロジェクト: yusukeinyos/SoundMaker
        //-------------------------------------------------------------------------------------
        //実数値IFFT(高速フーリエ逆変換)
        //複素共役にする処理もNm.RealFastFourierTransform(Complex[])に含まれてる!!
        //入力はナイキスト周波数に対応するスペクトル(半分だけ)でいい!!
        public static void Real_IFFT(double[] Re, double[] Im, out double[] output)
        {
            int size = Re.Length;

            Complex[] comp = new Complex[size];

            for (int i = 0; i < size; i++)
            {
                comp[i] = new Complex(Re[i], Im[i]);
            }
            output = Nm.RealFastFourierTransform(comp);
        }
コード例 #4
0
        //--------------------------------------------------------------------------
        //constant Q transform
        static Complex[,] constantQ_transform(double[] wavdata)
        {
            double[] new_wavdata;
            Complex[,] kernel;
            Complex[,] output;
            int wav_length = wavdata.Length;
            int T_step;
            int F_step;
            int fft_step;
            int fft_start_point;
            int hop;

            double[] freqs = get_freqs(fmin, get_freq_num(fmin, fmax, fratio), fratio);
            kernel = calcKernel_matrix(freqs);

            hop         = (int)(Math.Round(0.01 * fs)); //100 frames per 1 sec
            T_step      = wav_length / hop;
            F_step      = freqs.Length;
            fft_step    = (int)(Math.Pow(2, Math.Ceiling((Math.Log(fs * Q / freqs[0], 2))))); //greater than Max of N[k]
            new_wavdata = new double[wav_length + fft_step];
            output      = new Complex[F_step, T_step];

            for (int i = 0; i < wav_length; i++)
            {
                new_wavdata[i + fft_step / 2] = wavdata[i];
            }

            for (int t = 0; t < T_step; t++)
            {
                fft_start_point = hop * t;
                Complex[] partial_data = new Complex[fft_step];
                for (int i = 0; i < fft_step; i++)
                {
                    partial_data[i] = new Complex(new_wavdata[fft_start_point + i], 0);
                }

                Complex[] fft = Nm.FastFourierTransform(partial_data, true);
                Complex[] cq  = new Complex[F_step];
                for (int i = 0; i < F_step; i++)
                {
                    for (int j = 0; j < fft.Length; j++)         //fft.Length = fft_step
                    {
                        cq[i] += fft[j] * kernel[i, j];
                    }
                }

                for (int f = 0; f < F_step; f++)
                {
                    output[f, t] = cq[f];
                }
            }
            return(output);
        }
コード例 #5
0
        public static void Main1()
        {
            Nm nm = new Nm();

            nm.create();

            while (true)
            {
                qv("loop start");
                gbWhile = true;

                var nos = new List <No>();


                for (int i = 0; i < 10; i++)
                {
                    No no = new No(nm);
                    no.create();
                    nos.Add(no);
                }

                foreach (var no in nos)
                {
                    no.naiWrite(new Ni(Nit.Test1));
                    no.naiWrite(new Ni(Nit.Test1));
                    no.naiWrite(new Ni(Nit.Test1));
                    no.naiWrite(new Ni(Nit.Test1));
                }

                int wc = 0;

                while (gbWhile)
                {
                    wc++;

                    //qv("while wc:" + wc);
                    //no.naiWrite(new Ni(Nit.Test1));
                    //if (wc == 20) { nos.First().naiWrite(new Ni(Nit.Test2)); }
                    System.Threading.Thread.Sleep(100);
                }

                qv("end1 - no.release()");
                foreach (var no in nos)
                {
                    no.release();
                }
            }
            qv("end2 - nm.release()");
            nm.release();
            qv("end3 - app");
        }
コード例 #6
0
        public static void Main1()
        {
            while (true)
            {
                gbWhile = true;

                Nm nm = new Nm();
                nm.create();

                No no = new No(nm);

                no.create();

                qv("naiWrite");
                no.naiWrite(new Ni(Nit.Test1));
                no.naiWrite(new Ni(Nit.Test1));
                no.naiWrite(new Ni(Nit.Test1));
                no.naiWrite(new Ni(Nit.Test1));
                no.naiWrite(new Ni(Nit.Test1));
                no.naiWrite(new Ni(Nit.Test1));
                no.naiWrite(new Ni(Nit.Test1));

                int wc = 0;

                while (gbWhile)
                {
                    //wc++;

                    //qv("while wc:" + wc);
                    //no.naiWrite(new Ni(Nit.Test1));
                    //if (wc == 50) { no.naiWrite(new Ni(Nit.Test2)); }
                    System.Threading.Thread.Sleep(50);
                }

                qv("end1");
                no.release();
                qv("end2");
                nm.release();
                qv("end3");
            }
        }
コード例 #7
0
        //--------------------------------------------------------------------------
        //Kernel行列の計算
        static Complex[,] calcKernel_matrix(double[] freqs)
        {
            //窓幅N[k]の最大値
            int fftlen = (int)(Math.Pow(2, Math.Ceiling((Math.Log(fs * Q / freqs[0], 2)))));

            Complex[,] kernel = new Complex[freqs.Length, fftlen];
            Complex[] tmp_kernel = new Complex[fftlen];

            for (int k = 0; k < freqs.Length; k++)
            {
                double   freq      = freqs[k];
                int      N_k       = (int)((double)(fs * Q) / freq); //窓幅
                int      start_win = (fftlen - N_k) / 2;             //FFT窓の中心を解析部分に合わせる
                double[] hamming   = new double[N_k];
                for (int i = 0; i < N_k; i++)
                {
                    hamming[i] = 1;
                }
                Nm.Windowing(hamming, Nm.DataWindowType.Hamming);
                for (int i = start_win; i < start_win + N_k; i++)
                {
                    tmp_kernel[i] = hamming[i - start_win] / N_k * Complex.Exp(2 * Math.PI * Complex.ImaginaryOne * Q * (i - start_win) / N_k);
                }
                tmp_kernel = Nm.FastFourierTransform(tmp_kernel, false); //sw==falseでfftlenで割る
                double[] d = new double[tmp_kernel.Length];
                for (int i = 0; i < tmp_kernel.Length; i++)
                {
                    d[i] = tmp_kernel[i].Magnitude;
                }
                double max = d.Max();
                for (int i = 0; i < fftlen; i++)
                {
                    //if (tmp_kernel[i].Magnitude <= 0.0054)
                    //    kernel[k, i] = Complex.Zero;
                    //else
                    kernel[k, i] = Complex.Conjugate(tmp_kernel[i]);
                }
            }

            return(kernel);
        }
コード例 #8
0
ファイル: TestOrderRecord.cs プロジェクト: buskovic/cobas
        public TestOrderRecord()
        {
            log.Debug("TestOrderRecord:ctor");

            _type = (string)RecordId.TestOrderRecord;
            _sequence = 0;
            _sample_id = String.Empty;
            _instrument = new Cm();
            _test = new Cm();
            _priority = String.Empty;
            _created_at = String.Empty;
            _sampled_at = new DateTime();
            _collected_at = String.Empty;
            _volume = String.Empty;
            _collector = String.Empty;
            _action_code = String.Empty;
            _danger_code = String.Empty;
            _clinical_info = String.Empty;
            _delivered_at = String.Empty;
            _biomaterial = 0;
            _physician = String.Empty;
            _physician_phone = String.Empty;
            _user_field_1 = String.Empty;
            _user_field_2 = String.Empty;
            _laboratory_field_1 = String.Empty;
            _laboratory_field_2 = String.Empty;
            _modified_at = new DateTime();
            _instrument_charge = String.Empty;
            _instrument_section = String.Empty;
            _report_type = String.Empty;
            _reserved = String.Empty;
            _location_ward = String.Empty;
            _infection_flag = String.Empty;
            _specimen_service = String.Empty;
            _laboratory = String.Empty;

            InitializeCm("Instrument", this.GetType(), _instrument);
            //InitializeCm("Test", this.GetType(), _test);

            InitializememberList();
        }
コード例 #9
0
        public RequestInformationRecord()
        {
            log.Debug("RequestInformationRecord:ctor");

            _type = String.Empty;
            _sequence = 0;
            _starting_range = new Cm();
            _endng_range = String.Empty;
            _universal_test = String.Empty;
            _nature_of_request = String.Empty;
            _beginning_request = String.Empty;
            _ending_request = String.Empty;
            _requestin_name = String.Empty;
            _requesting_phone = String.Empty;
            _user_1 = String.Empty;
            _user_2 = String.Empty;
            _request_information_status = String.Empty;

            InitializeCm("StartingRange", this.GetType(), _starting_range);

            InitializememberList();
        }
コード例 #10
0
        public PatientInformationRecord()
        {
            log.Debug("PatientInformationRecord:ctor");

            _type = (string)RecordId.PatientInformationRecord;
            _sequence = 0;
            _practice = String.Empty;
            _laboratory = String.Empty;
            _patient = String.Empty;
            _patient_name = String.Empty;
            _mothers_name = String.Empty;
            _birthdates = String.Empty;
            _sex = String.Empty;
            _race = String.Empty;
            _address = String.Empty;
            _reserved = String.Empty;
            _phone = String.Empty;
            _physician = String.Empty;
            _special = String.Empty;

            InitializeMemberList();
        }
コード例 #11
0
ファイル: SP.cs プロジェクト: yusukeinyos/SoundMaker
        //-------------------------------------------------------------------------------------
        //STFT(短時間フーリエ変換)
        public static Complex[,] STFT(double[] source_data, int window_size)
        {
            Complex[,] output;
            int    source_length = source_data.Length;           //入力データ長
            int    T_step;                                       //時間ステップ数
            int    F_step;                                       //周波数ステップ数
            int    fft_start_point = 0;                          //fftをするスタート点
            double window_power    = powerOfwindow(window_size); //窓関数のパワー WN

            T_step = (int)((source_length - window_size) / window_power) - 1;
            int n4 = 1 << (Mt.Log2Int(window_size) - 2);
            int n = n4 * 4, n2 = n4 * 2;

            F_step = n2 + 1;
            output = new Complex[F_step, T_step];

            for (int t = 0; t < T_step; t++)
            {
                double[] data = new double[window_size];
                fft_start_point = (int)window_power * t;
                for (int i = 0; i < window_size; i++)
                {
                    data[i] = source_data[fft_start_point + i];
                }
                data = windowing(data);

                Complex[] fft = Nm.RealFastFourierTransform(data);

                for (int f = 0; f < F_step; f++)
                {
                    output[f, t] = fft[f];
                }
            }

            return(output);
        }
コード例 #12
0
ファイル: ResultRecord.cs プロジェクト: buskovic/cobas
        public ResultRecord()
        {
            log.Debug("RequestInformationRecord:ctor");

            _type = (string)RecordId.ResultRecord;
            _sequence = 0;
            _test = new Cm();
            _value = new Cm();
            _units = String.Empty;
            _reference_ranges = String.Empty;
            _abnormal = String.Empty;
            _nature = String.Empty;
            _result_status = String.Empty;
            _normative_changed = String.Empty;
            _operator = String.Empty;
            _test_started = String.Empty;
            _test_completed = String.Empty;
            _instrument_identification = "E1";

            InitializeCm("Test", this.GetType(), _test);
            InitializeCm("Value", this.GetType(), _value);

            InitializememberList();
        }
コード例 #13
0
ファイル: MessageHeaderRecord.cs プロジェクト: buskovic/cobas
        private MessageHeaderRecord()
        {
            log.Debug("MessageHeaderRecord:ctor");

            _type = (string)RecordId.MessageHeaderRecord;
            _delimiter = "\\^&";
            _message_id = String.Empty;
            _password = String.Empty;
            _sender = new Cm();
            _address = String.Empty;
            _reserved = String.Empty;
            _phone = String.Empty;
            _characteristics = String.Empty;
            _receiver = String.Empty;
            _comments = new Cm();
            _processing = "P";
            _version = 1;
            _timestamp = String.Empty;

            InitializeCm("Sender", this.GetType(), _sender);
            InitializeCm("Comments", this.GetType(), _comments);

            InitializeMemberList();
        }
コード例 #14
0
 public No(Nm nm) : base(nm)
 {
 }
コード例 #15
0
ファイル: SP.cs プロジェクト: yusukeinyos/SoundMaker
 public static void Real_IFFT(Complex[] comp, out double[] output)
 {
     output = Nm.RealFastFourierTransform(comp);
 }