Beispiel #1
0
        private static bool itacLogin(string stationNumber, string stationPassword, string user, string password, string client, string registrationType, string systemIdentifier)
        {
            Logger.Log.Info((object)string.Format("itacLogin(): method called called."));
            IMSApiSessionValidationStruct validationStruct     = new IMSApiSessionValidationStruct();
            IMSApiSessionContextStruct    sessionContextStruct = (IMSApiSessionContextStruct)null;

            validationStruct.stationNumber    = stationNumber;
            validationStruct.stationPassword  = stationPassword;
            validationStruct.user             = user;
            validationStruct.password         = password;
            validationStruct.client           = client;
            validationStruct.registrationType = registrationType;
            validationStruct.systemIdentifier = systemIdentifier;
            int  resultValue = ItacFunctions._imsapi.regLogin(validationStruct, out sessionContextStruct);
            bool flag;

            if (resultValue != 0)
            {
                Logger.Log.Error((object)"itacLogin(): _imsapi.regLogin failed.");
                ItacFunctions.printErrorText(resultValue);
                flag = false;
            }
            else
            {
                ItacFunctions._sessionContext = sessionContextStruct;
                flag = true;
            }
            Logger.Log.Info((object)string.Format("itacLogin(): return with {0}", (object)flag));
            return(flag);
        }
Beispiel #2
0
 public InitializeMainGUI(IMSApiSessionContextStruct sessionContext, ApplicationConfiguration config, MainView view, LanguageResources lang)
 {
     this.sessionContext = sessionContext;
     this.config         = config;
     this.view           = view;
     this.lang           = lang;
 }
 public PosGraghicsForm(MainView mv1, IMSApiSessionContextStruct _sessionContext, InitModel _init, string _partnumber, string _processlayer)
 {
     InitializeComponent();
     mv             = mv1;
     sessionContext = _sessionContext;
     init           = _init;
     partnumber     = _partnumber;
     processlayer   = _processlayer;
 }
 public FinishPorductionForm(string userName, DateTime dTime, IMSApiSessionContextStruct _sessionContext, ApplicationConfiguration _config)
 {
     InitializeComponent();
     sessionContext          = _sessionContext;
     config                  = _config;
     lblCaption.Text         = "成 品 入 库";
     this.lblCaption.Font    = new System.Drawing.Font("Segoe UI Symbol", float.Parse(config.lblCaptionsize), System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.hook_Main.OnKeyUp += new KeyEventHandler(hook_MainKeyUp);
     hook_Main.InstallHook("1");
     timerCurrentTime.Enabled = true;
     clientSocket             = new SocketClientHandler(this);
 }
        public TransFujiZfile(IMSApiSessionContextStruct _sessionContext)
        {
            InitializeComponent();
            sessionContext = _sessionContext;
            config         = new ApplicationConfiguration();

            txtConsole.LanguageOption = RichTextBoxLanguageOptions.UIFonts;

            //显示版本
            this.Text = "富士文档转换 ( V:" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + ")";

            //添加文件夹监控       郑培聪
            ListenerFolder(config.ListenFolder);
        }
Beispiel #6
0
        public static bool OpenConnection(string clusternodes, string stationNumber, string stationPassword, string user, string password, string client, string registrationType, string systemIdentifier)
        {
            Logger.Log.Info((object)"OpenConnection(): method called .");
            Logger.Log.Info((object)string.Format("OpenConnection( \n ClusterNodes: {0}, \n stationNumber: {1}, \n stationPassword: {2}, \n user: {3}, \n password: {4}, \n client: {5}, \n registrationType: {6},\n systemIdentifier: {7})", (object)clusternodes, (object)stationNumber, (object)stationPassword, (object)user, (object)password, (object)client, (object)registrationType, (object)systemIdentifier));
            ItacFunctions._imsapi         = (IMSApiDotNet)null;
            ItacFunctions._sessionContext = (IMSApiSessionContextStruct)null;
            ItacFunctions._stationNumber  = (string)null;
            bool flag;

            try
            {
                IMSApiDotNetBase.setProperty("itac.appid", "StationTestClient");
                IMSApiDotNetBase.setProperty("itac.artes.clusternodes", clusternodes);
                ItacFunctions._imsapi = IMSApiDotNet.loadLibrary();
                string str            = "";
                int    libraryVersion = ((IMSApiDotNetBase)ItacFunctions._imsapi).imsapiGetLibraryVersion(out str);
                if (libraryVersion != 0)
                {
                    ItacFunctions.printErrorText(libraryVersion);
                }
                Logger.Log.Info((object)str);
                int resultValue = ((IMSApiDotNetBase)ItacFunctions._imsapi).imsapiInit();
                if (resultValue != 0)
                {
                    Logger.Log.Error((object)"OpenConnection():IMSApi init failed!");
                    ItacFunctions.printErrorText(resultValue);
                    flag = false;
                }
                else if (!ItacFunctions.itacLogin(stationNumber, stationPassword, user, password, client, registrationType, systemIdentifier))
                {
                    Logger.Log.Error((object)"OpenConnection(): itacLogin failed!");
                    flag = false;
                }
                else
                {
                    ItacFunctions._stationNumber = stationNumber;
                    flag = true;
                }
            }
            catch (Exception ex)
            {
                flag = false;
                string str = ex.Source + " " + ex.Message;
                Logger.Log.Fatal((object)str);
            }
            Logger.Log.Info((object)string.Format("OpenConnection(): return with {0}", (object)flag));
            return(flag);
        }
Beispiel #7
0
        public CreateLocator(string userName, DateTime dTime, IMSApiSessionContextStruct _sessionContext, ApplicationConfiguration _config)
        {
            InitializeComponent();

            Uname = userName;

            //显示版本
            this.Text = "储位导入 ( V:" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + ")";

            //显示IP地址
            string MachineName = Dns.GetHostName();

            System.Net.IPHostEntry ipEntry = System.Net.Dns.GetHostEntry(MachineName);
            System.Net.IPAddress[] addr    = ipEntry.AddressList;
            this.lblIpAddress.Text += MachineName + "/" + addr[1].ToString();
        }
        /// <summary>
        /// 获取品名
        /// </summary>
        /// <param name="partNumber"></param>
        /// <param name="imsapi"></param>
        /// <param name="sessionContext"></param>
        /// <returns></returns>
        private string mGetPartData(string partNumber, IMSApiDotNet imsapi, IMSApiSessionContextStruct sessionContext)
        {
            //查找品号
            KeyValue[] partFilter           = new KeyValue[] { new KeyValue("PART_NUMBER", partNumber) };
            String[]   partDataResultKey    = new String[] { "PART_DESC" };
            String[]   partDataResultValues = new String[] { };
            int        result = imsapi.mdataGetPartData(sessionContext, "XOFL01-002-01", partFilter, partDataResultKey, out partDataResultValues);

            if (result == 0)
            {
                return(partDataResultValues[0]);
            }
            else
            {
                return(string.Empty);
            }
        }
        public LogoutForm(string userName, MainView _view, InitModel _init, IMSApiSessionContextStruct _sessionContext)
        {
            InitializeComponent();
            sessionContext        = _sessionContext;
            this.txtUserName.Text = userName;
            view = _view;
            init = _init;
            SetControlStatus(false);
            this.progressBar1.Value   = 0;
            this.progressBar1.Maximum = 100;
            this.progressBar1.Step    = 1;

            this.timer1.Interval = 100;
            this.timer1.Tick    += new EventHandler(timer_Tick);

            backgroundWorker1.WorkerReportsProgress = true;
            backgroundWorker1.DoWork             += new DoWorkEventHandler(worker_DoWork);
            backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
        }
Beispiel #10
0
        public static bool CloseConnection()
        {
            Logger.Log.Info((object)"CloseConnection() method called .");
            bool flag;

            try
            {
                int resultValue1 = ItacFunctions._imsapi.regLogout(ItacFunctions._sessionContext);
                if (resultValue1 != 0)
                {
                    Logger.Log.Error((object)"CloseConnection(): _imsapi.regLogout error .");
                    ItacFunctions.printErrorText(resultValue1);
                    flag = false;
                }
                else
                {
                    int resultValue2 = ((IMSApiDotNetBase)ItacFunctions._imsapi).imsapiShutdown();
                    if (resultValue2 != 0)
                    {
                        Logger.Log.Error((object)"CloseConnection(): _imsapi.imsapiShutdown error .");
                        ItacFunctions.printErrorText(resultValue2);
                        flag = false;
                    }
                    else
                    {
                        flag = true;
                        ItacFunctions._imsapi         = (IMSApiDotNet)null;
                        ItacFunctions._sessionContext = (IMSApiSessionContextStruct)null;
                        ItacFunctions._stationNumber  = (string)null;
                    }
                }
            }
            catch (Exception ex)
            {
                flag = false;
                string str = ex.Source + " " + ex.Message;
                Logger.Log.Fatal((object)str);
            }
            Logger.Log.Info((object)string.Format("CloseConnection(): return with {0}", (object)flag));
            return(flag);
        }
        //public DateTime GetServerDateTime()
        //{
        //    var calendarDataResultKeys = new string[] { "CURRENT_TIME_MILLIS" };
        //    var calendarDataResultValues = new string[] { };
        //    int error = imsapi.mdataGetCalendarData(sessionContext, init.configHandler.StationNumber, calendarDataResultKeys, out calendarDataResultValues);
        //    if (error != 0)
        //    {
        //        LogHelper.Info("API mdataGetCalendarData error code = " + error);
        //        return DateTime.Now;
        //    }
        //    long numer = long.Parse(calendarDataResultValues[0]);
        //    DateTime start = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
        //    DateTime date = start.AddMilliseconds(numer).ToLocalTime();
        //    return date;
        //}

        public static string GetZHSErrorString(int iErrorCode, InitModel _init, IMSApiSessionContextStruct _sessionContext)
        {
            string errorString = "";

            if (_init.configHandler.Language == "US")
            {
                imsapi.imsapiGetErrorText(sessionContext, iErrorCode, out errorString);
            }
            else
            {
                if (_init.ErrorCodeZHS.ContainsKey(iErrorCode))
                {
                    errorString = _init.ErrorCodeZHS[iErrorCode];
                }
                else
                {
                    imsapi.imsapiGetErrorText(sessionContext, iErrorCode, out errorString);
                }
            }

            return(errorString);
        }
Beispiel #12
0
 public MergeManger(IMSApiSessionContextStruct sessionContext, InitModel init, MainView view)
 {
     this.sessionContext = sessionContext;
     this.init           = init;
     this.view           = view;
 }
Beispiel #13
0
 public UploadProcessResult(IMSApiSessionContextStruct sessionContext, InitModel init, MainView view)
 {
     this.sessionContext = sessionContext;
     this.init           = init;
     this.view           = view;
 }
 public GetProductQuantity(IMSApiSessionContextStruct sessionContext, ProductionForm view)
 {
     this.sessionContext = sessionContext;
     this.view           = view;
 }
 public GetNumbersOfSingleBoards(IMSApiSessionContextStruct sessionContext, InitModel init, MainView view)
 {
     this.sessionContext = sessionContext;
     this.init           = init;
     this.view           = view;
 }
Beispiel #16
0
 public GetMachineStructrue(IMSApiSessionContextStruct sessionContext, InitModel init, MainView view)
 {
     this.sessionContext = sessionContext;
     this.init           = init;
     this.view           = view;
 }
Beispiel #17
0
 public CommonFunction(IMSApiSessionContextStruct sessionContext, InitModel init, MainView view)
 {
     this.sessionContext = sessionContext;
     this.init           = init;
     this.view           = view;
 }
 public CommonFunction(IMSApiSessionContextStruct sessionContext, FinishPorductionForm view)
 {
     this.sessionContext = sessionContext;
     this.FPview         = view;
 }
Beispiel #19
0
 public GetNextSerialNumber(IMSApiSessionContextStruct sessionContext, InitModel init, MainView view)
 {
     this.sessionContext = sessionContext;
     this.init           = init;
     this.view           = view;
 }
 public UploadResultDataRecipe(IMSApiSessionContextStruct sessionContext, InitModel init, MainView view)
 {
     this.sessionContext = sessionContext;
     this.init           = init;
     this.view           = view;
 }
 public CommonFunction(IMSApiSessionContextStruct sessionContext, IQCForm view)
 {
     this.sessionContext = sessionContext;
     this.view           = view;
 }
        public ApplicationConfiguration(IMSApiSessionContextStruct sessionContext, MainView view)
        {
            try
            {
                CommonModel commonModel = ReadIhasFileData.getInstance();
                StationNumber    = commonModel.Station;
                Client           = commonModel.Client;
                RegistrationType = commonModel.RegisterType;
                if (commonModel.UpdateConfig == "L")
                {
                    XDocument config = XDocument.Load("ApplicationConfig.xml");
                    SerialPort              = GetDescendants("SerialPort", config);              //config.Descendants("SerialPort").First().Value;
                    BaudRate                = GetDescendants("BaudRate", config);                //config.Descendants("BaudRate").First().Value;
                    Parity                  = GetDescendants("Parity", config);                  //config.Descendants("Parity").First().Value;
                    StopBits                = GetDescendants("StopBits", config);                // config.Descendants("StopBits").First().Value;
                    DataBits                = GetDescendants("DataBits", config);                //config.Descendants("DataBits").First().Value;
                    NewLineSymbol           = GetDescendants("NewLineSymbol", config);           // config.Descendants("NewLineSymbol").First().Value;
                    DLExtractPattern        = GetDescendants("DLExtractPattern", config);        //config.Descendants("DLExtractPattern").First().Value;
                    MBNExtractPattern       = GetDescendants("MBNExtractPattern", config);       // config.Descendants("MBNExtractPattern").First().Value;
                    EquipmentExtractPattern = GetDescendants("EquipmentExtractPattern", config); //config.Descendants("EquipmentExtractPattern").First().Value;
                    OpacityValue            = GetDescendants("OpacityValue", config);            //config.Descendants("OpacityValue").First().Value;
                    LocationXY              = GetDescendants("LocationXY", config);              //config.Descendants("LocationXY").First().Value;
                    MDAPath                 = GetDescendants("MDAPath", config);                 // config.Descendants("MDAPath").First().Value;
                    OutputEnter             = GetDescendants("OutputEnter", config);             //config.Descendants("OutputEnter").First().Value;

                    #region add by qy
                    Language            = GetDescendants("Language", config);                 //config.Descendants("Language").First().Value;
                    OutSerialPort       = GetDescendants("OutSerialPort", config);            //config.Descendants("OutSerialPort").First().Value;
                    OutBaudRate         = GetDescendants("OutBaudRate", config);              //config.Descendants("OutBaudRate").First().Value;
                    OutParity           = GetDescendants("OutParity", config);                // config.Descendants("OutParity").First().Value;
                    OutStopBits         = GetDescendants("OutStopBits", config);              //config.Descendants("OutStopBits").First().Value;
                    OutDataBits         = GetDescendants("OutDataBits", config);              //config.Descendants("OutDataBits").First().Value;
                    DataOutputInterface = GetDescendants("DataOutputInterface", config);      //config.Descendants("DataOutputInterface").First().Value;
                    TrayExtractPattern  = GetDescendants("TrayExtractPattern", config);       //config.Descendants("TrayExtractPattern").First().Value;
                    LogInRegular        = GetDescendants("LogInRegular", config);             //config.Descendants("LogInRegular").First().Value;
                    LogInType           = GetDescendants("LogInType", config);                //config.Descendants("LogInType").First().Value;
                    CheckListFolder     = GetDescendants("CheckListFolder", config);          //config.Descendants("CheckListFolder").First().Value;
                    IsSelectWO          = GetDescendants("IsSelectWO", config);               // config.Descendants("IsSelectWO").First().Value;
                    IsCheckList         = GetDescendants("IsCheckList", config);              //config.Descendants("IsCheckList").First().Value;
                    IsMaterialSetup     = GetDescendants("IsMaterialSetup", config);          // config.Descendants("IsMaterialSetup").First().Value;
                    IsEquipSetup        = GetDescendants("IsEquipSetup", config);             // config.Descendants("IsEquipSetup").First().Value;
                    SDLExtractPattern   = GetDescendants("SDLExtractPattern", config);        //config.Descendants("SDLExtractPattern").First().Value;
                    IPAddress           = GetDescendants("IPAddress", config);                // config.Descendants("IPAddress").First().Value;
                    Port              = GetDescendants("Port", config);                       // config.Descendants("Port").First().Value;
                    ScanSNType        = GetDescendants("ScanSNType", config);                 // config.Descendants("ScanSNType").First().Value;
                    GetCompStation    = GetDescendants("GetCompStation", config);             //config.Descendants("GetCompStation").First().Value;
                    IsCheckLayer      = GetDescendants("IsCheckLayer", config);               //config.Descendants("IsCheckLayer").First().Value;
                    IsNeedCompColumn  = GetDescendants("IsNeedCompColumn", config);           //config.Descendants("IsNeedCompColumn").First().Value;
                    IsGetAllCompByBom = GetDescendants("IsGetAllCompByBom", config);          //config.Descendants("IsGetAllCompByBom").First().Value;
                    IsNeedInfoField   = GetDescendants("IsNeedInfoField", config);            //config.Descendants("IsNeedInfoField").First().Value;

                    FilterByFileName            = GetDescendants("FilterByFileName", config); //config.Descendants("FilterByFileName").First().Value;
                    FileNamePattern             = GetDescendants("FileNamePattern", config);  //config.Descendants("FileNamePattern").First().Value;
                    OK_CHANNEL_Open             = GetDescendants("OK_CHANNEL_Open", config);
                    OK_CHANNEL_CLOSE            = GetDescendants("OK_CHANNEL_CLOSE", config);
                    NG_CHANNEL_OPEN             = GetDescendants("NG_CHANNEL_OPEN", config);
                    NG_CHANGE_CLOSE             = GetDescendants("NG_CHANGE_CLOSE", config);
                    CommandSleepTime            = GetDescendants("PRESS_TIMER", config);
                    UserTeam                    = GetDescendants("AUTH_TEAM", config);//config.Descendants("UserTeam").First().Value;
                    Upload_BARCODE              = GetDescendants("Upload_BARCODE", config);
                    RefreshWO                   = GetDescendants("RefreshWO", config);
                    PrintType                   = GetDescendants("PrintType", config);
                    IsPrint                     = GetDescendants("Traveler_Slip", config);
                    MaxiumCount                 = GetDescendants("PCB_Magazine_Rack_Qty", config);
                    PrintSerialPort             = GetDescendants("PrintSerialPort", config);
                    TemplateFolder              = GetDescendants("TemplateFolder", config);
                    PrinterTypeName             = GetDescendants("PrinterTypeName", config);
                    Temp_PartNo                 = GetDescendants("Temp_PartNo", config);
                    IPI_STATUS_CHECK            = GetDescendants("IPI_STATUS_CHECK", config);
                    Production_Inspection_CHECK = GetDescendants("Production_Inspection_CHECK", config);

                    ACTIVE_WORKORDER_LINE = GetDescendants("ACTIVE_WORKORDER_LINE", config);
                    LAYER_DISPLAY         = GetDescendants("LAYER_DISPLAY", config);
                    #endregion

                    #region checklist
                    CHECKLIST_IPAddress     = GetDescendants("CHECKLIST_IPAddress", config);
                    CHECKLIST_Port          = GetDescendants("CHECKLIST_Port", config);
                    CHECKLIST_SOURCE        = GetDescendants("CHECKLIST_SOURCE", config);
                    AUTH_CHECKLIST_APP_TEAM = GetDescendants("AUTH_CHECKLIST_APP_TEAM", config);
                    CHECKLIST_FREQ          = GetDescendants("CHECKLIST_FREQ", config);
                    SHIFT_CHANGE_TIME       = GetDescendants("SHIFT_CHANGE_TIME", config);
                    RESTORE_TIME            = GetDescendants("RESTORE_TIME", config);
                    RESTORE_TREAD_TIMER     = GetDescendants("RESTORE_TREAD_TIMER", config);
                    #endregion
                }
                else
                {
                    dicConfig = new Dictionary <string, string>();
                    ConfigManage configHandler = new ConfigManage(sessionContext, view);
                    if (commonModel.UpdateConfig == "Y")
                    {
                        //int error = configHandler.DeleteConfigParameters(commonModel.APPTYPE);
                        //if (error == 0 || error == -3303 || error == -3302)
                        //{
                        //    WriteParameterToiTac(configHandler);
                        //}
                        string[] parametersValue = configHandler.GetParametersForScope(commonModel.APPTYPE);
                        if (parametersValue != null && parametersValue.Length > 0)
                        {
                            foreach (var parameterID in parametersValue)
                            {
                                configHandler.DeleteConfigParametersExt(parameterID);
                            }
                        }
                        WriteParameterToiTac(configHandler);
                    }
                    List <ConfigEntity> getvalues = configHandler.GetConfigData(commonModel.APPID, commonModel.APPTYPE, commonModel.Cluster, commonModel.Station);
                    if (getvalues != null)
                    {
                        foreach (var item in getvalues)
                        {
                            if (item != null)
                            {
                                string[] strs = item.PARAMETER_NAME.Split(new char[] { '.' });
                                dicConfig.Add(strs[strs.Length - 1], item.CONFIG_VALUE);
                            }
                        }
                    }
                    SerialPort              = GetParameterValue("SerialPort");
                    BaudRate                = GetParameterValue("BaudRate");
                    Parity                  = GetParameterValue("Parity");
                    StopBits                = GetParameterValue("StopBits");
                    DataBits                = GetParameterValue("DataBits");
                    NewLineSymbol           = GetParameterValue("NewLineSymbol");
                    DLExtractPattern        = GetParameterValue("DLExtractPattern");
                    MBNExtractPattern       = GetParameterValue("MBNExtractPattern");
                    EquipmentExtractPattern = GetParameterValue("EquipmentExtractPattern");
                    OpacityValue            = GetParameterValue("OpacityValue");
                    LocationXY              = GetParameterValue("LocationXY");
                    MDAPath                 = GetParameterValue("MDAPath");
                    OutputEnter             = GetParameterValue("OutputEnter");

                    #region add by qy
                    Language            = GetParameterValue("Language");
                    OutSerialPort       = GetParameterValue("OutSerialPort");
                    OutBaudRate         = GetParameterValue("OutBaudRate");
                    OutParity           = GetParameterValue("OutParity");
                    OutStopBits         = GetParameterValue("OutStopBits");
                    OutDataBits         = GetParameterValue("OutDataBits");
                    DataOutputInterface = GetParameterValue("DataOutputInterface");
                    TrayExtractPattern  = GetParameterValue("TrayExtractPattern");
                    LogInRegular        = GetParameterValue("LogInRegular");
                    LogInType           = GetParameterValue("LogInType");
                    CheckListFolder     = GetParameterValue("CheckListFolder");
                    IsSelectWO          = GetParameterValue("IsSelectWO");
                    IsCheckList         = GetParameterValue("IsCheckList");
                    IsMaterialSetup     = GetParameterValue("IsMaterialSetup");
                    IsEquipSetup        = GetParameterValue("IsEquipSetup");
                    SDLExtractPattern   = GetParameterValue("SDLExtractPattern");
                    IPAddress           = GetParameterValue("IPAddress");
                    Port              = GetParameterValue("Port");
                    ScanSNType        = GetParameterValue("ScanSNType");
                    GetCompStation    = GetParameterValue("GetCompStation");
                    IsCheckLayer      = GetParameterValue("IsCheckLayer");
                    IsNeedCompColumn  = GetParameterValue("IsNeedCompColumn");
                    IsGetAllCompByBom = GetParameterValue("IsGetAllCompByBom");
                    IsNeedInfoField   = GetParameterValue("IsNeedInfoField");
                    OK_CHANNEL_Open   = GetParameterValue("OK_CHANNEL_Open");
                    OK_CHANNEL_CLOSE  = GetParameterValue("OK_CHANNEL_CLOSE");
                    NG_CHANNEL_OPEN   = GetParameterValue("NG_CHANNEL_OPEN");
                    NG_CHANGE_CLOSE   = GetParameterValue("NG_CHANGE_CLOSE");
                    #endregion
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex.Message, ex);
            }
        }
Beispiel #23
0
 public SetupStateChange(IMSApiSessionContextStruct sessionContext, InitModel init, MainView view)
 {
     this.sessionContext = sessionContext;
     this.init           = init;
     this.view           = view;
 }
Beispiel #24
0
 public ActivateWorkorder(IMSApiSessionContextStruct sessionContext, InitModel init, MainView view)
 {
     this.sessionContext = sessionContext;
     this.init           = init;
     this.view           = view;
 }
 public UtilityFunction(IMSApiSessionContextStruct _sessionContext, InitModel _init, MainView view)
 {
     sessionContext = _sessionContext;
     init           = _init;
     this.view      = view;
 }
Beispiel #26
0
 public ConfigManage(IMSApiSessionContextStruct sessionContext, MainView view)
 {
     this.sessionContext = sessionContext;
     this.view           = view;
 }
 public RemoveAttributeValue(IMSApiSessionContextStruct sessionContext, InitModel init, MainView view)
 {
     this.sessionContext = sessionContext;
     this.init           = init;
     this.view           = view;
 }
Beispiel #28
0
 public UtilityFunction(IMSApiSessionContextStruct sessionContext, string stationNo)
 {
     this.sessionContext = sessionContext;
     this.StationNumber  = stationNo;
 }
 public GetMaterialBinData(IMSApiSessionContextStruct sessionContext, InitModel init, MainView view)
 {
     this.sessionContext = sessionContext;
     this.init           = init;
     this.view           = view;
 }
        public ApplicationConfiguration(IMSApiSessionContextStruct sessionContext, MainView view)
        {
            try
            {
                dicConfig = new Dictionary <string, string>();
                ConfigManage configHandler = new ConfigManage(sessionContext, view);
                CommonModel  commonModel   = ReadIhasFileData.getInstance();
                if (commonModel.UpdateConfig == "L")
                {
                    XDocument config = XDocument.Load("ApplicationConfig.xml");
                    StationNumber    = commonModel.Station;
                    Client           = commonModel.Client;
                    RegistrationType = commonModel.RegisterType;
                    SerialPort       = GetParameterValues(config, "SerialPort");
                    BaudRate         = GetParameterValues(config, "BaudRate");
                    Parity           = GetParameterValues(config, "Parity");
                    StopBits         = GetParameterValues(config, "StopBits");
                    DataBits         = GetParameterValues(config, "DataBits");
                    NewLineSymbol    = GetParameterValues(config, "NewLineSymbol");
                    High             = GetParameterValues(config, "High");
                    Low                         = GetParameterValues(config, "Low");
                    EndCommand                  = GetParameterValues(config, "EndCommand");
                    DLExtractPattern            = GetParameterValues(config, "DLExtractPattern");
                    MBNExtractPattern           = GetParameterValues(config, "MBNExtractPattern");
                    EquipmentExtractPattern     = GetParameterValues(config, "EquipmentExtractPattern");
                    OpacityValue                = GetParameterValues(config, "OpacityValue");
                    LocationXY                  = GetParameterValues(config, "LocationXY");
                    NoRead                      = GetParameterValues(config, "NoRead");
                    LogFileFolder               = GetParameterValues(config, "LogFileFolder");
                    LogTransOK                  = GetParameterValues(config, "LogTransOK");
                    LogTransError               = GetParameterValues(config, "LogTransError");
                    ChangeFileName              = GetParameterValues(config, "ChangeFileName");
                    CheckListFolder             = GetParameterValues(config, "CheckListFolder");
                    LoadExtractPattern          = GetParameterValues(config, "LoadExtractPattern");
                    LogInType                   = GetParameterValues(config, "LogInType");
                    Language                    = GetParameterValues(config, "Language");
                    MDAPath                     = GetParameterValues(config, "MDAPath");
                    IPAddress                   = GetParameterValues(config, "IPAddress");
                    Port                        = GetParameterValues(config, "Port");
                    FileNamePattern             = GetParameterValues(config, "FileNamePattern");
                    FilterByFileName            = GetParameterValues(config, "FilterByFileName");
                    RefreshWO                   = GetParameterValues(config, "RefreshWO");
                    IPI_STATUS_CHECK            = GetParameterValues(config, "IPI_STATUS_CHECK");
                    Production_Inspection_CHECK = GetParameterValues(config, "Production_Inspection_CHECK");
                    FILE_CLEANUP                = GetParameterValues(config, "FILE_CLEANUP");
                    FILE_CLEANUP_TREAD_TIMER    = GetParameterValues(config, "FILE_CLEANUP_TREAD_TIMER");
                    FILE_CLEANUP_FOLDER_TYPE    = GetParameterValues(config, "FILE_CLEANUP_FOLDER_TYPE");
                    LIGHT_CHANNEL_ON            = GetParameterValues(config, "LIGHT_CHANNEL_ON");
                    LIGHT_CHANNEL_OFF           = GetParameterValues(config, "LIGHT_CHANNEL_OFF");
                    IO_BOX_CONNECT              = GetParameterValues(config, "IO_BOX_CONNECT");
                    ReduceEquType               = GetParameterValues(config, "ReduceEquType"); // config.Descendants("ReduceEquType").First().Value;
                    StencilPrefix               = GetParameterValues(config, "StencilPrefix"); //config.Descendants("StencilPrefix").First().Value;
                    if (IO_BOX_CONNECT != null && IO_BOX_CONNECT.Split(';').Length >= 6)
                    {
                        string[] infos = IO_BOX_CONNECT.Split(';');
                        IOSerialPort = "COM" + infos[0];
                        IOBaudRate   = infos[1];
                        IOStopBits   = infos[4];
                        IODataBits   = infos[2];
                        IOParity     = infos[3];
                    }
                    OutputEnter         = GetParameterValues(config, "OutputEnter");
                    DataOutputInterface = GetParameterValues(config, "DataOutputInterface");
                    LAYER_DISPLAY       = GetParameterValues(config, "LAYER_DISPLAY");
                    CHECKCONECTTIME     = GetParameterValues(config, "CHECKCONECTTIME");
                    CEHCKTXTFILE        = GetParameterValues(config, "CEHCKTXTFILE");

                    #region checklist
                    CHECKLIST_IPAddress     = GetParameterValues(config, "CHECKLIST_IPAddress");
                    CHECKLIST_Port          = GetParameterValues(config, "CHECKLIST_Port");
                    CHECKLIST_SOURCE        = GetParameterValues(config, "CHECKLIST_SOURCE");
                    AUTH_CHECKLIST_APP_TEAM = GetParameterValues(config, "AUTH_CHECKLIST_APP_TEAM");
                    CHECKLIST_FREQ          = GetParameterValues(config, "CHECKLIST_FREQ");
                    SHIFT_CHANGE_TIME       = GetParameterValues(config, "SHIFT_CHANGE_TIME");
                    RESTORE_TIME            = GetParameterValues(config, "RESTORE_TIME");
                    RESTORE_TREAD_TIMER     = GetParameterValues(config, "RESTORE_TREAD_TIMER");
                    AUTH_TEAM = GetParameterValues(config, "AUTH_TEAM");
                    #endregion
                }
                else
                {
                    if (commonModel.UpdateConfig == "Y")
                    {
                        //int error = configHandler.DeleteConfigParameters(commonModel.APPTYPE);
                        //if (error == 0 || error == -3303 || error == -3302)
                        //{
                        //    WriteParameterToiTac(configHandler);
                        //}
                        string[] parametersValue = configHandler.GetParametersForScope(commonModel.APPTYPE);
                        if (parametersValue != null && parametersValue.Length > 0)
                        {
                            foreach (var parameterID in parametersValue)
                            {
                                configHandler.DeleteConfigParametersExt(parameterID);
                            }
                        }
                        WriteParameterToiTac(configHandler);
                    }
                    List <ConfigEntity> getvalues = configHandler.GetConfigData(commonModel.APPID, commonModel.APPTYPE, commonModel.Cluster, commonModel.Station);
                    if (getvalues != null)
                    {
                        foreach (var item in getvalues)
                        {
                            if (item != null)
                            {
                                string[] strs = item.PARAMETER_NAME.Split(new char[] { '.' });
                                dicConfig.Add(strs[strs.Length - 1], item.CONFIG_VALUE);
                            }
                        }
                    }

                    StationNumber    = commonModel.Station;
                    Client           = commonModel.Client;
                    RegistrationType = commonModel.RegisterType;
                    SerialPort       = GetParameterValue("SerialPort");
                    BaudRate         = GetParameterValue("BaudRate");
                    Parity           = GetParameterValue("Parity");
                    StopBits         = GetParameterValue("StopBits");
                    DataBits         = GetParameterValue("DataBits");
                    NewLineSymbol    = GetParameterValue("NewLineSymbol");
                    High             = GetParameterValue("High");
                    Low                     = GetParameterValue("Low");
                    EndCommand              = GetParameterValue("EndCommand");
                    DLExtractPattern        = GetParameterValue("DLExtractPattern");
                    MBNExtractPattern       = GetParameterValue("MBNExtractPattern");
                    EquipmentExtractPattern = GetParameterValue("EquipmentExtractPattern");
                    OpacityValue            = GetParameterValue("OpacityValue");
                    LocationXY              = GetParameterValue("LocationXY");
                    ThawingDuration         = GetParameterValue("ThawingDuration");
                    ThawingCheck            = GetParameterValue("ThawingCheck");
                    LockTime                = GetParameterValue("LockOutTime");
                    UsageTime               = GetParameterValue("UsageDurationSetting");
                    GateKeeperTimer         = GetParameterValue("GateKeeperTimer");
                    SolderPasteValidity     = GetParameterValue("SolderPasteValidity");
                    OpenControlBox          = GetParameterValue("OpenControlBox");
                    StencilPrefix           = GetParameterValue("StencilPrefix");
                    TimerSpan               = GetParameterValue("TimerSpan");
                    StartTrigerStr          = GetParameterValue("StartTrigerStr");
                    EndTrigerStr            = GetParameterValue("EndTrigerStr");
                    NoRead                  = GetParameterValue("NoRead");
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex.Message, ex);
            }
        }