/// <summary> /// If during calibration, ring is captured wrongly, click once on retake button. So that it will discard the latest array and allows you to retake the ring image. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Retake_btn_Click(object sender, EventArgs e) { RefractoCaller rc = RefractoCaller.GetInstance(Globals.DeviceId); Globals.RingRetake = true; Args args = new Args(); direction = "READY"; args["direction"] = direction; f.Publish(f.REFRACTO_NO_OF_SPOTS, args); }
// RefractoCaller rc; /// <summary> /// Save calibration file. /// </summary> /// <param name="n"></param> /// <param name="arg"></param> private void onRefractoCalculationsComplete(String n, Args arg) { RefractoReadings readings = (RefractoReadings)arg["readings"]; if (readings.IsProperRing) { rc = Forus.Refracto.RefractoCaller.GetInstance(Globals.DeviceId); if (Globals.IsZeroPoint == true) { File.Delete(@"Calibration_" + Globals.DeviceId + ".csv"); rc.SaveCartesianZeroPoints(); rc.readZEROPoints(); Globals.IsZeroPoint = false; } if (!Directory.Exists(Globals.calibrationPath)) { Directory.CreateDirectory(Globals.calibrationPath); } if (!Directory.Exists(Globals.calibrationPath + Globals.path + Path.DirectorySeparatorChar + Globals.DeviceId)) { dirInf = Directory.CreateDirectory(Globals.calibrationPath + Path.DirectorySeparatorChar + Globals.DeviceId); } else { dirInf = new DirectoryInfo(Globals.calibrationPath + Path.DirectorySeparatorChar + Globals.DeviceId); } dirInf = new DirectoryInfo(dirInf.FullName + Path.DirectorySeparatorChar + DateTime.Now.ToString("dd-MM-yyyy")); if (!Directory.Exists(dirInf.FullName)) { dirInf = Directory.CreateDirectory(dirInf.FullName); } string str = dirInf.FullName + Path.DirectorySeparatorChar + "ring"; if (readings.Eyeside == null) { readings.Eyeside = "L"; } rc.saveRingDataCartesian(str, readings.Eyeside); } }