Click (object sender, EventArgs e)
{();
} void closeButton_Click (object sender, EventArgs e)
{();
} zedGraph_ZoomEvent (ZedGraphControl sender, ZoomState oldState, ZoomState newState)
{pane=sender. GraphPane; (pane. XAxis. Scale. Min <= 0)
{. XAxis. Scale. Min=0;
} (pane. XAxis. Scale. Max>=12)
{. XAxis. Scale. Max=12;
} (pane. YAxis. Scale. Min <= 0)
{. YAxis. Scale. Min=0;
} (pane. YAxis. Scale. Max>=Vref + 2)
{. YAxis. Scale. Max=Vref + 2;
}
} void openSerialPort ()
{. ReadBufferSize=250;. ReceivedBytesThreshold=250;. DataReceived +=new SerialDataReceivedEventHandler (DataReceivedHandler);. Open ();
} void DataReceivedHandler (object sender, SerialDataReceivedEventArgs e)
{sp=(SerialPort) sender;. Read (ByteArray, 0, ByteArray. Length);
} void sendStrToPort (string str1)
{. Write (str1);
} void closeSerialPort ()
{. Close ();
} void changeInterval ()
{(int i=0; i
{[i]=Convert. ToDouble (ByteArray [i]); [i]=((IntArray [i] / SnapshotLenght) * Vref);// Вхідний інтервал - [0; 255], вихідний інтервал - [0; 3.3]
}} string convertByteToStr ()
{str_Rx=null; (int i=0; i
{str_Rx +=i + «)» + « » + Convert. ToString (IntArray [i]) +
Малюнок ПБ.2 - Продовження. NewLine; } Str_Rx; } Void DrawGraph ()
{panel=zedGraph. GraphPanelist=new PointPairList ();. CurveList. Clear (); y=0; (double x=0; x <10-0.04; x +=0.04, y +=1)
{. Add (x, IntArray [y]);
} myCurve=panel. AddCurve («ADC», list, Color. Red, SymbolType. None);. AxisChange ();. Invalidate ();
} void timer1_Tick (object sender, EventArgs e)
{();
} void pause_Click (object sender, EventArgs e)
{. Stop ();
} void start_Click (object sender, EventArgs e)
{. Start ();
} void button_1_1_Click (object sender, EventArgs e)
{(«11»); _Period=1.17;// * SnapshotLenght;. Text=Convert. ToString (ADC_Period);
} void button_1_2_Click (object sender, EventArgs e)
{(«12»); _Period=1.67;// * SnapshotLenght;. Text=Convert. ToString (ADC_Period);
} void button_1_3_Click (object sender, EventArgs e)
{(«13»); _Period=2.17;// * SnapshotLenght;. Text=Convert. ToString (ADC_Period);
} void button_1_4_Click (object sender, EventArgs e)
{(«14»); _Period=3.417;// * SnapshotLenght;. Text=Convert. ToString (ADC_Period); } Void button_1_5_Click (object sender, EventArgs e)