//第三次拍照结果 public void WriteData3(Point4D point) { try { //数据超限 if (!BlDataOverFlow(point, 1)) { return; } string cmd = NoCamera.ToString() + "3";//命令 string value = Head + point.DblValue1.ToString("f2").PadLeft(7, ' ') + " " + point.DblValue2.ToString("f2").PadLeft(7, ' ') + " " + point.DblValue3.ToString("f2").PadLeft(7, ' ') + " " + point.DblValue4.ToString("f2").PadLeft(7, ' ') + " " + "0".PadLeft(7, ' ') + " " + cmd.PadLeft(7, ' '); WriteRobot(value); } catch (Exception ex) { Log.L_I.WriteError("LogicRobot", ex); } }
void ReleaseDesignerOutlets() { if (CameraView != null) { CameraView.Dispose(); CameraView = null; } if (GrayCardButton != null) { GrayCardButton.Dispose(); GrayCardButton = null; } if (NoCamera != null) { NoCamera.Dispose(); NoCamera = null; } if (Segments != null) { Segments.Dispose(); Segments = null; } if (Temperature != null) { Temperature.Dispose(); Temperature = null; } if (Tint != null) { Tint.Dispose(); Tint = null; } }
static void Main(string[] args) { //instane IphoneCamera Console.WriteLine("_______"); IphoneCamera iphoneCamera = new IphoneCamera("Iphone's Camera", TypeCamera.FRONT, false); Console.WriteLine("***IPHONE*****"); //with getDescrption non override in IphoneCamera commented Console.WriteLine($"result {iphoneCamera.GetDescription("Iphone's Camera", TypeCamera.FRONT)} is activate ? {iphoneCamera.Activate()} "); //with getDescription override in IphoneCamera uncommented //Console.WriteLine($"result {iphoneCamera.GetDescription("Iphone's Camera", TypeCamera.FRONT)} is activate ? {iphoneCamera.Activate()} "); Console.WriteLine($"result after deactivated {iphoneCamera.GetDescription("Iphone's Camera", TypeCamera.FRONT)} is activate ? {iphoneCamera.DeActivate()} "); Console.WriteLine("********"); Console.WriteLine($"result after setCamera {iphoneCamera.SetCamera()}"); Console.WriteLine("********"); Console.WriteLine($"result after Charge Camera {iphoneCamera.ChargeCamera()}"); Console.WriteLine("********"); Console.WriteLine($"result after Take Picture {iphoneCamera.TakePicture()}"); Console.WriteLine("_______"); //instane Samsung Camera Console.WriteLine("***SAMSUNG*****"); SamsungCamera samsungCamera = new SamsungCamera("Samsung Camera", TypeCamera.REAR, false); //with getDescrption non override in IphoneCamera commented Console.WriteLine($"result {samsungCamera.GetDescription("Samsung Camera", TypeCamera.REAR)} is activate ? {samsungCamera.Activate()} "); //with getDescription override in samsungCamera uncommented //Console.WriteLine($"result {samsungCamera.GetDescription("Samsung's Camera", TypeCamera.FRONT)} is activate ? {samsungCamera.Activate()} "); // Console.WriteLine($"result after deactivated {samsungCamera.GetDescription("Samsung Camera", TypeCamera.REAR)} is activate ? {samsungCamera.DeActivate()} "); // Console.WriteLine("********"); Console.WriteLine($"result after setCamera {samsungCamera.SetCamera()}"); Console.WriteLine("********"); Console.WriteLine($"result after Charge Camera {samsungCamera.ChargeCamera()}"); Console.WriteLine("********"); Console.WriteLine($"result after Take Picture {samsungCamera.TakePicture()}"); Console.WriteLine("********"); //istanziate nocamera Console.WriteLine("***NOKIA NO CAMERA*****"); NoCamera nokiaNocamera = new NoCamera("Nokia no Camera", TypeCamera.NOCAMERA, false); //with getDescrption non override in IphoneCamera commented Console.WriteLine($"result {nokiaNocamera.GetDescription("Nokia no Camera", TypeCamera.NOCAMERA)} is activate ? {nokiaNocamera.Activate()} "); //with getDescription override in samsungCamera uncommented Console.ReadLine(); }
bool BlDataOverFlow(Point4D p, int pos) { try { return(true); int index = NoCamera * ParCameraWork.P_I[NoCamera] + pos; if (p.DblValue1 < ParSetRobot.P_I.dataLimitRobot_L[index].DblXMin || p.DblValue1 > ParSetRobot.P_I.dataLimitRobot_L[index].DblXMax || p.DblValue2 <ParSetRobot.P_I.dataLimitRobot_L[index].DblYMin || p.DblValue2> ParSetRobot.P_I.dataLimitRobot_L[index].DblYMax || p.DblValue3 <ParSetRobot.P_I.dataLimitRobot_L[index].DblRMin || p.DblValue3> ParSetRobot.P_I.dataLimitRobot_L[index].DblRMax || p.DblValue4 <ParSetRobot.P_I.dataLimitRobot_L[index].DblTMin || p.DblValue4> ParSetRobot.P_I.dataLimitRobot_L[index].DblTMax ) { string strStd = ParSetRobot.P_I.dataLimitRobot_L[index].DblXMin.ToString() + "," + ParSetRobot.P_I.dataLimitRobot_L[index].DblXMax.ToString() + "," + ParSetRobot.P_I.dataLimitRobot_L[index].DblYMin.ToString() + "," + ParSetRobot.P_I.dataLimitRobot_L[index].DblYMax.ToString() + "," + ParSetRobot.P_I.dataLimitRobot_L[index].DblRMin.ToString() + "," + ParSetRobot.P_I.dataLimitRobot_L[index].DblRMax.ToString() + "," + ParSetRobot.P_I.dataLimitRobot_L[index].DblTMin.ToString() + "," + ParSetRobot.P_I.dataLimitRobot_L[index].DblTMax.ToString(); if (ParSetRobot.P_I.BlDataOverflow) { string strError = "Camera" + NoCamera.ToString() + "Pos" + pos.ToString() + ":Error:" + p.strValue + ",Std:" + strStd; DataError_event(strError); LogComInterface.L_I.WriteData("Overflow", strError); return(false); } } return(true); } catch (Exception ex) { Log.L_I.WriteError("LogicRobot", ex); return(false); } }
public void SendDataNG93_Camera(Point4D p) { try { string cmd = NoCamera.ToString() + "93";//命令 string value = Head + p.DblValue1.ToString("f2").PadLeft(7, ' ') + " " + p.DblValue2.ToString("f2").PadLeft(7, ' ') + " " + p.DblValue3.ToString("f2").PadLeft(7, ' ') + " " + p.DblValue4.ToString("f2").PadLeft(7, ' ') + " " + "0".PadLeft(7, ' ') + " " + cmd.PadLeft(7, ' '); WriteRobot(value); } catch (Exception ex) { Log.L_I.WriteError("LogicRobot", ex); } }
//NG public void SendDataNG(Point4D p) { try { string cmd = NoCamera.ToString() + "9";//命令 string str = Head + p.DblValue1.ToString("f2").PadLeft(7, ' ') + " " + p.DblValue2.ToString("f2").PadLeft(7, ' ') + " " + p.DblValue3.ToString("f2").PadLeft(7, ' ') + " " + p.DblValue4.ToString("f2").PadLeft(7, ' ') + " " + "0".PadLeft(7, ' ') + " " + cmd.PadLeft(7, ' '); g_PortRobotBase.WriteData(str); } catch (Exception ex) { Log.L_I.WriteError("LogicRobot", ex); } }
public void WriteStdData(int noPos, Point4D point) { try { string cmd = NoCamera.ToString() + "1";//命令 string value = "PData".PadLeft(7, ' ') + " " + noPos.ToString().PadLeft(7, ' ') + " " + point.DblValue1.ToString("f2").PadLeft(7, ' ') + " " + point.DblValue2.ToString("f2").PadLeft(7, ' ') + " " + point.DblValue3.ToString("f2").PadLeft(7, ' ') + " " + point.DblValue4.ToString("f2").PadLeft(7, ' ') + " " + "0".PadLeft(7, ' ') + " " + "0".PadLeft(7, ' '); WriteRobot(value); } catch (Exception ex) { Log.L_I.WriteError("LogicRobot", ex); } }
void ReleaseDesignerOutlets() { if (Bias != null) { Bias.Dispose(); Bias = null; } if (CameraView != null) { CameraView.Dispose(); CameraView = null; } if (Duration != null) { Duration.Dispose(); Duration = null; } if (ISO != null) { ISO.Dispose(); ISO = null; } if (NoCamera != null) { NoCamera.Dispose(); NoCamera = null; } if (Offset != null) { Offset.Dispose(); Offset = null; } if (Segments != null) { Segments.Dispose(); Segments = null; } }
void ReleaseDesignerOutlets() { if (CameraView != null) { CameraView.Dispose(); CameraView = null; } if (CaptureButton != null) { CaptureButton.Dispose(); CaptureButton = null; } if (NoCamera != null) { NoCamera.Dispose(); NoCamera = null; } if (ScrollView != null) { ScrollView.Dispose(); ScrollView = null; } }
void ReleaseDesignerOutlets() { if (CameraView != null) { CameraView.Dispose(); CameraView = null; } if (NoCamera != null) { NoCamera.Dispose(); NoCamera = null; } if (Position != null) { Position.Dispose(); Position = null; } if (Segments != null) { Segments.Dispose(); Segments = null; } }
static void Main(string[] args) { Console.WriteLine(); Console.WriteLine(" test Action Result "); //text class actioResult ActionResult actionResult = new ActionResult("***this message ***", true); Console.WriteLine($"action result {actionResult.Message} and {actionResult.Succes}"); Console.WriteLine(); Console.WriteLine(" test Class ImagePhoto "); //text class ImagePhoto ImagePhoto imagePhoto = new ImagePhoto(@"C:\myImages\myImage", DateTime.Now, ".jpg", true); string result = imagePhoto.GetSnap(); Console.WriteLine($"ImagePhoto {result} "); //test class ImgePhoto noCamera imagePhoto = new ImagePhoto(@"C:\myImages\myImage", DateTime.Now, ".jpg", false); result = imagePhoto.GetSnap(); Console.WriteLine($"ImagePhoto {result} "); //test interface per HUAWEI Console.WriteLine(); Console.WriteLine(" test ICamera "); //test activate // HuaweiCamera huaweiCamera = new HuaweiCamera(); ActionResult HuaweiResult = huaweiCamera.Activate(); Console.WriteLine($"HuaweiResult {HuaweiResult.Message} and isActive: {HuaweiResult.Succes}"); //activate when already active HuaweiResult = huaweiCamera.Activate(); Console.WriteLine($"HuaweiResult {HuaweiResult.Message} and isActive {HuaweiResult.Succes}"); //deActivate when already active HuaweiResult = huaweiCamera.DeActivate(); Console.WriteLine($"HuaweiResult {HuaweiResult.Message} and isActive {HuaweiResult.Succes}"); //deActivate when already deactive HuaweiResult = huaweiCamera.DeActivate(); Console.WriteLine($"HuaweiResult {HuaweiResult.Message} and isActive {HuaweiResult.Succes}"); //ChargeCamera HuaweiResult = huaweiCamera.ChargeCamera(); Console.WriteLine($"HuaweiResult {HuaweiResult.Message} and isActive {HuaweiResult.Succes}"); //set Camera when non activated HuaweiResult = huaweiCamera.SetCamera(); Console.WriteLine($"HuaweiResult {HuaweiResult.Message} and isActive {HuaweiResult.Succes}"); //test new activate huaweiCamera = new HuaweiCamera(); HuaweiResult = huaweiCamera.Activate(); Console.WriteLine($"HuaweiResult {HuaweiResult.Message} and isActive {HuaweiResult.Succes}"); //set Camera after activated HuaweiResult = huaweiCamera.SetCamera(); Console.WriteLine($"HuaweiResult {HuaweiResult.Message} and isActive {HuaweiResult.Succes}"); ImagePhoto HuaweiPhotoResult = huaweiCamera.TakeSnap(); Console.WriteLine($"HuaweiPhotoResult { HuaweiPhotoResult.GetSnap()}"); //$"snapTaken {_snapName}{_snapDate.ToString("dMMyyyy")}{_snapFormat} //Console.WriteLine($"HuaweiPhotoResult {HuaweiPhotoResult.SnapName}{HuaweiPhotoResult.DateSnap.ToString("dMMyyyy")}{HuaweiPhotoResult.SnapFormat}"); //test interface per IPHONE Console.WriteLine(); Console.WriteLine(" test ICamera "); IPhoneCamera iphoneCamera = new IPhoneCamera(); ActionResult iphoneResult = iphoneCamera.Activate(); // Console.WriteLine($"IphoneResult {iphoneResult.Message} and isActive: {iphoneResult.Succes}"); //activate when already active iphoneResult = iphoneCamera.Activate(); Console.WriteLine($"IphoneResult {iphoneResult.Message} and isActive {iphoneResult.Succes}"); //deActivate when already active iphoneResult = iphoneCamera.DeActivate(); Console.WriteLine($"IphoneResult {iphoneResult.Message} and isActive {iphoneResult.Succes}"); //deActivate when already deactive iphoneResult = iphoneCamera.DeActivate(); Console.WriteLine($"IPhoneResult {iphoneResult.Message} and isActive {iphoneResult.Succes}"); //ChargeCamera iphoneResult = iphoneCamera.ChargeCamera(); Console.WriteLine($"IphoneResult {iphoneResult.Message} and isActive {iphoneResult.Succes}"); //set Camera when non activated iphoneResult = iphoneCamera.SetCamera(); Console.WriteLine($"IphoneResult {iphoneResult.Message} and isActive {iphoneResult.Succes}"); //test new activate huaweiCamera = new HuaweiCamera(); iphoneResult = iphoneCamera.Activate(); Console.WriteLine($"IphoneResult {iphoneResult.Message} and isActive {iphoneResult.Succes}"); //set Camera after activated iphoneResult = iphoneCamera.SetCamera(); Console.WriteLine($"IphoneResult {iphoneResult.Message} and isActive {iphoneResult.Succes}"); ImagePhoto IphonePhotoResult = iphoneCamera.TakeSnap(); Console.WriteLine($" IphonePhotoResult { IphonePhotoResult.GetSnap()}"); Console.WriteLine(); Console.WriteLine(" test noCamera "); // test NoCamera for Nokia NoCamera nokiaCamera = new NoCamera(); ActionResult nokiaResult = nokiaCamera.Activate(); Console.WriteLine($"NokiaResult {nokiaResult.Message} and isActive: {nokiaResult.Succes}"); // ImagePhoto NokiaPhotoResult = nokiaCamera.TakeSnap(); Console.WriteLine($" NokiaPhotoResult { NokiaPhotoResult.GetSnap()}"); Console.ReadLine(); }
public GalaxyS() { _frontCamera = new NoCamera(); _rearCamera = new FiveMegapixelsCamera(); }
public Nokia3310() { //attenzione _frontCamera = new NoCamera(); _rearCamera = new NoCamera(); }
public Nokia3310() { _frontCamera = new NoCamera(); _rearCamera = new NoCamera(); }