8. 決定版入力フォーム&ソース

 フォームとしてはこんな感じにしました。下にソースが記載されていますが、Tabキーでの数字のインプットの順番など、無茶苦茶なので、その辺を整備しないとイカンな、と思っています。現時刻をラベルに表示するようにしたかったですが、そういう機能は入れずに終わるかもしれません。
 Win8.1タブレットで制御するため、[D600撮像開始]ボタンをタッチパネルで動くように改変することも必要です。[データセーブ]は間違ってクリックしてはいけないという事で、マウスからのクリックとして置きます。
 各入力項目を起動時に再現しようとろいろやってみて、その長大な痕跡が残ったソースですが、それも何とか改良したいところです。
 この2点が改善されるか、或いはタッチ操作ができるようになったら、Upgrade Ver.として再度アップロードしようと考えています。今は「D600撮像開始」をクリックすると別ソフトがデータセーブしたテキストファイルから数字を読み込み、タイムラプス~C2前後の連写~皆既中の多段階露光~C3前後の連写~タイムラプス、と言う制御をしてくれるコマンドプロンプトのプログラムが起動します。これは一応作りましたが、未だデバッグの山をこなしていかなくてはいけません。時間が取れれば11月中に出来ないかな…と思っていますが。
Index Next
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;


namespace Eclips_Captor
{
    public partial class Form1 : Form
    {

        public ComboBox comboBox1_SelectedIndex_1;
        public ComboBox comboBox1_SelectedIndex;
        public ComboBox comboBox5_SelectedIndex;
        public ComboBox comboBox4_SelectedIndex;
        public ComboBox comboBox3_SelectedIndex;
        public ComboBox comboBox2_SelectedIndex;
        public ComboBox comboBox6_SelectedIndex;

        public string ContS;
        public char KeyChar;
        public string C2Hr;
        public string C2Min;
        public string C2Sec;
        public string C2Total;
        public string C3Hr;
        public string C3Min;
        public string C3Sec;
        public string C3Total;
        public string C2Before;
        public string C2After;
        public string C3Before;
        public string C3After;
        public string LapsTime;

        //public string Cont_SS;
        //public string Step;
        public int index;
        public string IntSS;
        public string Max_speed;
        public string EV_Step;
        public string Capture_Step;

        //public string IntSS { get; private set; }
        public string IntSec; //{ get; private set; }
        public string C2Time; //{ get; private set; }
        public string C3Time; //{ get; private set; }

        //public object textBox1;

        //public readonly object comboBox1;

        public Form1()
        {
            InitializeComponent();
        }
        [BrowsableAttribute(false)]
        public string SelectedText { get; set; }
        private void Form1_Load(object sender, EventArgs e)
        {
            //Properties.Settings.Default.Reload();
            this.Interval.Text = Properties.Settings.Default.Interval;
            this.textBox1.Text = Properties.Settings.Default.TextBox1;
            this.textBox3.Text = Properties.Settings.Default.HozonTextBox3;
            this.textBox4.Text = Properties.Settings.Default.HozonTextBox4;
            this.textBox5.Text = Properties.Settings.Default.HozonTextBox5;
            this.textBox6.Text = Properties.Settings.Default.HozonTextBox6;
            this.textBox7.Text = Properties.Settings.Default.HozonTextBox7;
            this.textBox8.Text = Properties.Settings.Default.HozonTextBox8;
            this.textBox9.Text = Properties.Settings.Default.HozonTextBox9;
            this.textBox10.Text = Properties.Settings.Default.HozonTextBox10;
            this.textBox11.Text = Properties.Settings.Default.HozonTextBox11;
        }

        //コンボボックスからのインプット
        public void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            int Int_SS = comboBox2.SelectedIndex;
            IntSS = Int_SS.ToString();
        }

        public void ContSS_SelectedIndexChanged(object sender, EventArgs e)
        {
            int Cont_SS = ContSS.SelectedIndex;
            ContS = Cont_SS.ToString();
        }

        public void Max_SS_SelectedIndexChanged(object sender, EventArgs e)
        {
            int MaxSS = Max_SS.SelectedIndex;
            Max_speed = MaxSS.ToString();
        }

        public void EVStep_SelectedIndexChanged(object sender, EventArgs e)
        {
            int EV = EVStep.SelectedIndex;
            EV_Step = EV.ToString();
        }

        public void CaptureSteps_SelectedIndexChanged(object sender, EventArgs e)
        {
            int Capture = CaptureSteps.SelectedIndex;
            Capture_Step = Capture.ToString();
        }

        //各種数値のインプット
        public void Interval_TextChanged(object sender, EventArgs e)
        {   
            IntSec = Interval.Text;
        }

        public void textBox1_TextChanged(object sender, EventArgs e)
        {
            C2Hr = textBox1.Text;
        }
        public void textBox3_TextChanged(object sender, EventArgs e)
        {
            C2Min = textBox3.Text;
        }
        public void textBox4_TextChanged(object sender, EventArgs e)
        {
            C2Sec = textBox4.Text;
        }
        public void textBox8_TextChanged(object sender, EventArgs e)
        {
            C2Before = textBox8.Text;
        }
        public void textBox9_TextChanged(object sender, EventArgs e)
        {
            C2After = textBox9.Text;
        }

        public void textBox5_TextChanged(object sender, EventArgs e)
        {
            C3Hr = textBox5.Text;
        }
        public void textBox6_TextChanged(object sender, EventArgs e)
        {
            C3Min = textBox6.Text;
        }
        public void textBox7_TextChanged(object sender, EventArgs e)
        {
            C3Sec = textBox7.Text;
        }
        public void textBox10_TextChanged(object sender, EventArgs e)
        {
            C3Before = textBox10.Text;
        }
        public void textBox11_TextChanged(object sender, EventArgs e)
        {
            C3After = textBox11.Text;
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            Properties.Settings.Default.Interval = this.Interval.Text;
            Properties.Settings.Default.TextBox1 = this.textBox1.Text;
            Properties.Settings.Default.HozonTextBox3 = this.textBox3.Text;
            Properties.Settings.Default.HozonTextBox4 = this.textBox4.Text;
            Properties.Settings.Default.HozonTextBox5 = this.textBox5.Text;
            Properties.Settings.Default.HozonTextBox6 = this.textBox6.Text;
            Properties.Settings.Default.HozonTextBox7 = this.textBox7.Text;
            Properties.Settings.Default.HozonTextBox8 = this.textBox8.Text;
            Properties.Settings.Default.HozonTextBox9 = this.textBox9.Text;
            Properties.Settings.Default.HozonTextBox10 = this.textBox10.Text;
            Properties.Settings.Default.HozonTextBox11 = this.textBox11.Text;
            //Console.WriteLine(Properties.Settings.Default.Text);
            Properties.Settings.Default.Save();
        }
        

        //データのセーブ
        public void button2_Click(object sender, EventArgs e)
        {
            string strData;
            strData = "";
            strData = IntSS + "," +ContS + "," + Max_speed + "," + EV_Step + "," + Capture_Step + "," + IntSec + "," + C2Hr + "," + C2Min + "," + C2Sec + "," + C2Before + "," + C2After + "," + C3Hr + "," + C3Min +"," +C3Sec + "," + C3Before + "," + C3After;

            string path = "E:/shin/新しいフォルダー (3)/DSLR Ctrler/Caputor_Main/bin/x86/Release/D600CaptureSetting.txt";
            System.IO.StreamWriter sw = new System.IO.StreamWriter(
                path,
                false,
                System.Text.Encoding.Default);
            sw.WriteLine(strData);
            sw.Close();
        }

        //撮像プログラム稼働開始
        public void button1_Click(object sender, EventArgs e)
        {
            Process.Start("E:/shin/新しいフォルダー (3)/DSLR Ctrler/Caputor_Main/bin/x86/Release/Caputor_Main");
        }
    }
}
inserted by FC2 system