BioImager  5.0.0
A .NET microscopy imaging application based on Bio library. Supports various microscopes by using imported libraries & GUI automation. Supports XInput game controllers to move stage, take images, run ImageJ macros on images or Bio C# scripts.
Loading...
Searching...
No Matches
MicroscopeSetup.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Linq;
7using System.Text;
8using System.Threading.Tasks;
9using System.Windows.Forms;
10
12{
13 public partial class MicroscopeSetup : Form
14 {
15 CodeView view = new CodeView();
17 {
18 InitializeComponent();
19 panel.Controls.Add(view);
20 view.Dock = DockStyle.Fill;
21 int i = 0;
22 foreach (System.Drawing.Imaging.PixelFormat p in (System.Drawing.Imaging.PixelFormat[])Enum.GetValues(typeof(System.Drawing.Imaging.PixelFormat)))
23 {
24 if (Properties.Settings.Default.PCameraFormat == p.ToString())
25 pxBox.SelectedItem = p.ToString();
26 i++;
27 }
28 funcsBox.SelectedIndex = 4;
29 }
30 private void filterWheelBox_TextChanged(object sender, EventArgs e)
31 {
32 Properties.Settings.Default.PFilterWheel = filterWheelBox.Text;
33 }
34
35 private void stageBox_TextChanged(object sender, EventArgs e)
36 {
37 Properties.Settings.Default.PStage = stageBox.Text;
38 }
39
40 private void editConfigBut_Click(object sender, EventArgs e)
41 {
42 System.Diagnostics.Process.Start("notepad.exe", Application.StartupPath + "/PythonMicroscope/microscope/config.txt");
43 }
44
45 private void initBut_Click(object sender, EventArgs e)
46 {
47 if(startBut.Text == "Start Server")
48 {
49 Microscope.pMicroscope.Initialize();
50 PMicroscope.Start();
51 startBut.Text = "Stop Server";
52 }
53 else
54 {
55 PMicroscope.Stop();
56 startBut.Text = "Start Server";
57 }
58
59 }
60
61 private void funcsBox_SelectedIndexChanged(object sender, EventArgs e)
62 {
63 view.TextBox.Text = System.IO.File.ReadAllText(Application.StartupPath + "/PythonMicroscope/microscope/" + funcsBox.SelectedItem.ToString());
64 }
65
66 private void saveBut_Click(object sender, EventArgs e)
67 {
68 System.IO.File.WriteAllText(Application.StartupPath + "/PythonMicroscope/microscope/" + funcsBox.SelectedItem.ToString(), view.TextBox.Text);
69 }
70
71 private void pxBox_SelectedIndexChanged(object sender, EventArgs e)
72 {
73 Properties.Settings.Default.PCameraFormat = pxBox.Text;
74 Properties.Settings.Default.Save();
75 }
76
77 private void cameraBox_TextChanged(object sender, EventArgs e)
78 {
79 Properties.Settings.Default.PStage = stageBox.Text;
80 }
81 }
82}
System.Windows.Forms.Application Application
Definition ImageView.cs:14
RichTextBox TextBox
Definition CodeView.cs:38