public MonitorViewTab(CameraConfig leftConfig, CameraConfig rightConfig, bool isAdmin) { InitializeComponent(); this.leftType = leftConfig.CurrentCameraType; this.rightType = rightConfig.CurrentCameraType; this.isAdmin = isAdmin; string leftName = leftConfig.CameraName; string rightName = rightConfig.CameraName; this.Text = leftName + "和" + rightName; leftBtn.Text = leftName + "调试界面"; rightBtn.Text = rightName + "调试界面"; leftMonitorView = new MonitorView(leftConfig); rightMonitorView = new MonitorView(rightConfig); }
internal static CameraConfig CreateCameraConfig(CameraType type) { CameraConfig config = new CameraConfig(); config.CurrentCameraType = type; switch (type) { case CameraType.Batch: config.CameraName = "批号相机"; config.CameraAddress = AppSetting.BATCH_CAMERA_ADDRESS; break; case CameraType.Shoulder: config.CameraName = "肩标相机"; config.CameraAddress = AppSetting.SHOULDER_CAMERA_ADDRESS; break; case CameraType.Front: config.CameraName = "前标相机"; config.CameraAddress = AppSetting.FRONT_CAMERA_ADDRESS; break; case CameraType.Back: config.CameraName = "背标相机"; config.CameraAddress = AppSetting.BACK_CAMERA_ADDRESS; break; case CameraType.IsFront: config.CameraName = "正标有无相机"; config.CameraAddress = AppSetting.ISFRONT_CAMERA_ADDRESS; break; case CameraType.IsBack: config.CameraName = "背标有无相机"; config.CameraAddress = AppSetting.ISBACK_CAMERA_ADDRESS; break; default: config.CameraName = "未知"; break; } return(config); }