Esempio n. 1
0
 public static CSLibrary.Structures.Version GetDemoVersion()
 {
     System.Version sver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
     CSLibrary.Structures.Version ver = new CSLibrary.Structures.Version();
     ver.major = (uint)sver.Major;
     ver.minor = (uint)sver.Minor;
     ver.patch = (uint)sver.Build;
     return ver;
 }
Esempio n. 2
0
 public static CSLibrary.Structures.Version GetDemoVersion()
 {
     System.Version sver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
     CSLibrary.Structures.Version ver = new CSLibrary.Structures.Version();
     ver.major = (uint)sver.Major;
     ver.minor = (uint)sver.Minor;
     ver.patch = (uint)sver.Build;
     return(ver);
 }
Esempio n. 3
0
        static void Main()
        {
            string AppPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
            applicationSettings = System.IO.Path.Combine(AppPath, applicationSettings);

            /*
            using (System.Threading.Mutex mutex = new System.Threading.Mutex(false, appGuid)) {
            if (!mutex.WaitOne(0, false)) {
            MessageBox.Show("Instance already running", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            return;
            }
            */

              //  CSLibrary.Windows.UI.SplashScreen.Show(CSLibrary.Windows.UI.SplashScreen.CSL.CS101);
            //CSLibrary.Windows.UI.SplashScreen.Show(CSLibrary.Windows.UI.SplashScreen.CSL.CS101NOLOGO);
            using (trazabilidadSplash c = new trazabilidadSplash())
            {
                c.Location = new Point((320 - c.Width) / 2, (240 - c.Height) / 2);
                c.Show();
                c.Update();
                if (File.Exists("host.txt"))
                {
                    using (FileStream fs = new FileStream("host.txt", FileMode.Open))
                    using (StreamReader sr = new StreamReader(fs))
                    {
                        String host = sr.ReadLine();
                        sr.Close();

                        uri = "http://" + host + "/webservice/";
                    }

                }
                else
                {
                    using (FileStream fs = new FileStream("host.txt", FileMode.Create))
                    using (StreamWriter sw = new StreamWriter(fs))
                    {
                        sw.WriteLine("192.168.0.102/traza");
                        sw.Flush();
                    }

                }

                //First Step
                FullScreen.Start();

                //turn on debug logging for debug purpose
                CSLibrary.Diagnostics.CoreDebug.Enable = true;

                if (ReaderCE.Connect() != CSLibrary.Constants.Result.OK)
                    MessageBox.Show("RFID Connect Fail");

                appSetting = new appSettings();

                if (Barcode.Connect() != CSLibrary.Barcode.Constants.Result.SUCCESS)
                {
                    using (BarCodeMessage BarCodeFail = new BarCodeMessage())
                    {
                        BarCodeFail.ShowDialog();
                    }
                }
                else
                    barcodemodule = true;

                Device.BarcodePowerOn();

                //Get All Reader information and Versions
                driverVersion = Program.ReaderCE.GetDriverVersion();
                firmwareVersion = Program.ReaderCE.GetFirmwareVersion();
                cslibraryVersion = Program.ReaderCE.GetCSLibraryVersion();
                rfidLibraryVersion = Program.ReaderCE.GetRfidLibraryVersion();
                hardwareVersion = Program.ReaderCE.GetHardwareVersion();
                pcbAssemblyCode = Program.ReaderCE.GetPCBAssemblyCode();
                manufactureDate = Program.ReaderCE.GetManufactureDate();
                serialNumber = Device.GetSerialNumber();
                deviceName = Device.GetDeviceName();

                if (barcodemodule == true && Barcode.EnableDisableSymbology(Symbol.ALL, true) != CSLibrary.Barcode.Constants.Result.SUCCESS)
                    MessageBox.Show("EnableDisableSymbology Fail");

                //Load Setting
                if (!System.IO.File.Exists(applicationSettings))
                {
                    SaveSettings();
                    LoadSettings();
                }
                else
                {
                    LoadSettings();
                }

                Power = new PowerForm();

                Profile = new ProfileForm();

                //Application.Run(new MenuForm());
                //Application.Run(new TagInventoryForm());
                Application.Run(new sesion());

               // Application.Run(new Trazabilidad("000000001000009000000005"));

                ReaderCE.Disconnect();

                Barcode.SetConfigItemToDefaults(ConfigItems.ALL_CONFIG);

                Barcode.Disconnect();

                FullScreen.Stop();
            }
               // CSLibrary.Windows.UI.SplashScreen.Stop();
        }
        static void Main()
        {
            string ip;
            string AppPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);

            //MessageBox.Show(LocalIPAddress());

            //First Step
            FullScreen.Start();

            //turn on debug logging for debug purpose
            ReaderCE.WriteToLog = true;
            //First Step
            {
                using (NetFinderForm finder = new NetFinderForm())
                {
                    if (finder.ShowDialog() == DialogResult.OK)
                    {
                        ip = finder.ConnectIP;
                        macAddress = finder.MAC;
                        applicationSettings = System.IO.Path.Combine(AppPath, macAddress);
                    }
                    else
                    {
                        goto EXIT;
                    }
                }

                CSLibrary.Windows.UI.SplashScreen.Show(CSLibrary.Windows.UI.SplashScreen.CSL.CS203);
                if (ReaderCE.Connect(ip, 30000) != CSLibrary.Constants.Result.OK)
                {
                    ReaderCE.Disconnect();
                    CSLibrary.Windows.UI.SplashScreen.Stop();
                    MessageBox.Show("RFID Connect Fail.");
                    goto EXIT;
                }
                //Get All Reader information and Versions
                driverVersion = Program.ReaderCE.GetDriverVersion();
                firmwareVersion = Program.ReaderCE.GetFirmwareVersion();
                cslibraryVersion = Program.ReaderCE.GetCSLibraryVersion();
                rfidLibraryVersion = Program.ReaderCE.GetRfidLibraryVersion();
                hardwareVersion = Program.ReaderCE.GetHardwareVersion();
                pcbAssemblyCode = Program.ReaderCE.GetPCBAssemblyCode();
                manufactureDate = Program.ReaderCE.GetManufactureDate();

                //Load Setting
                if (!System.IO.File.Exists(macAddress.Replace(':', '.')))
                {
                    LoadDefaultSettings();
                }
                else
                {
                    LoadSettings();
                }

                Power = new PowerForm();

                Profile = new ProfileForm();

                Application.Run(new MenuForm());


            }
EXIT:
            ReaderCE.Disconnect();
            FullScreen.Stop();
            CSLibrary.Windows.UI.SplashScreen.Stop();
        }