Beispiel #1
0
    public void DisplayChoices(List <ActionNode> choices, AgentController agent)
    {
        List <string> options = new List <string>();

        if (agent is AndroidController)
        {
            for (int i = 0; i < choices.Count; i++)
            {
                print(i + " - " + getNodeInfo(choices[i], "Specification").Split('_')[1] + " - " + getNodeInfo(choices[i], "Message"));
                options.Add(getNodeInfo(choices[i], "Specification").Split('_')[1]);
                choiceNodes.Add(choices[i]);
            }
            AndroidController android = (AndroidController)agent;
            android.Options = options;
            makeDecision(android.makeRandomDecision());
        }
        else
        {//Agent is player
            for (int i = 0; i < choices.Count; i++)
            {
                print(i + ": " + choices[i].name + " - " + getNodeInfo(choices[i], "Specification").Split('_')[1] + " - " + getNodeInfo(choices[i], "Message"));
                options.Add(getNodeInfo(choices[i], "Message"));
                choiceNodes.Add(choices[i]);
            }
            generateRadialMenu(options);
            emotionPanel.gameObject.SetActive(true);
            decisionPanel.gameObject.SetActive(true);
        }
    }
Beispiel #2
0
    public WCFDepartment[] GetAllDepartments(int sessionID)
    {
        List <WCFDepartment> result = new List <WCFDepartment>();

        if (AndroidAuthenticationController.IsValidSessionId(sessionID))
        {
            List <Department> items = AndroidController.GetAllDepartments();

            if (items != null)
            {
                foreach (var item in items)
                {
                    result.Add(new WCFDepartment()
                    {
                        CollectionPointNo = item.CollectionPointNo ?? -1,
                        ContactName       = item.ContactName,
                        DeptCode          = item.DeptCode,
                        DeptName          = item.DeptName,
                        DeputyEmpNo       = item.DeputyEmpNo ?? -1,
                        FaxNo             = item.FaxNo.ToString(),
                        HeadEmpNo         = item.HeadEmpNo ?? -1,
                        PhoneNo           = item.PhoneNo.ToString(),
                        RepEmpNo          = item.RepEmpNo ?? -1
                    });
                }
            }
        }
        return(result.ToArray());
    }
Beispiel #3
0
    public WCFRequisition GetRequisitionById(int sessionID, int reqNo)
    {
        WCFRequisition result = null;

        if (AndroidAuthenticationController.IsValidSessionId(sessionID))
        {
            Requisition item = AndroidController.GetRequisitionById(reqNo);

            if (item != null)
            {
                result = new WCFRequisition
                {
                    ReqNo      = item.ReqNo.ToString(),
                    DateIssued = item.DateIssued.ToString(),
                    IssuedBy   = item.IssuedBy.ToString(),
                    ApprovedBy = item.ApprovedBy != null?item.ApprovedBy.ToString() : "",
                                     DateReviewed = item.DateReviewed != null?item.DateReviewed.ToString() : "",
                                                        Status  = item.Status != null ? item.Status : "",
                                                        Remarks = item.Remarks != null ? item.Remarks : ""
                };
            }
        }

        return(result);
    }
Beispiel #4
0
        public WCFDepartment GetDepartment(int sessionID, String deptCode)
        {
            Department    department = null;
            WCFDepartment result     = null;

            if (AndroidAuthenticationController.IsValidSessionId(sessionID))
            {
                department = AndroidController.GetDepartment(deptCode);
                if (department != null)
                {
                    result = new WCFDepartment()
                    {
                        CollectionPointNo = department.CollectionPointNo ?? -1,
                        ContactName       = department.ContactName,
                        DeptCode          = department.DeptCode,
                        DeptName          = department.DeptName,
                        DeputyEmpNo       = department.DeputyEmpNo ?? -1,
                        FaxNo             = department.FaxNo.ToString(),
                        HeadEmpNo         = department.HeadEmpNo ?? -1,
                        PhoneNo           = department.PhoneNo.ToString(),
                        RepEmpNo          = department.RepEmpNo ?? -1
                    };
                }
            }

            return(result);
        }
Beispiel #5
0
 public MainForm()
 {
     InitializeComponent();
     android         = AndroidController.Instance; // Setting Android instance
     timer1.Interval = 200;                        // Setting timer interval to 2 milliseconds, This means it will check devices after every 2 milliseconds
     timer1.Start();                               // Start the Timer :)
 }
Beispiel #6
0
    public WCFRequisition[] GetPendingRequisitions(int sessionID, int sessionEmpNo)
    {
        List <WCFRequisition> result = new List <WCFRequisition>();

        if (AndroidAuthenticationController.IsValidSessionId(sessionID))
        {
            List <Requisition> items = AndroidController.GetPendingRequisitions(sessionEmpNo);

            if (items != null)
            {
                foreach (var item in items)
                {
                    result.Add(new WCFRequisition
                    {
                        ReqNo        = item.ReqNo.ToString(),
                        DateIssued   = item.DateIssued.ToString(),
                        ApprovedBy   = item.ApprovedBy.ToString(),
                        DateReviewed = item.DateReviewed.ToString(),
                        Status       = item.Status,
                        Remarks      = item.Remarks,
                        IssuedBy     = item.IssuedBy.ToString()
                    });
                }
            }
        }

        return(result.ToArray());
    }
Beispiel #7
0
    public WCFDisbursementDetail[] GetDisbursementDetailsOf(int sessionID, int DisbursementNo)
    {
        List <WCFDisbursementDetail> result = new List <WCFDisbursementDetail>();

        if (AndroidAuthenticationController.IsValidSessionId(sessionID))
        {
            List <DisbursementDetail> items = AndroidController.GetDisbursementDetailsOf(DisbursementNo);

            if (items != null)
            {
                foreach (var item in items)
                {
                    result.Add(new WCFDisbursementDetail()
                    {
                        DisbursementNo = item.DisbursementNo.ToString(),
                        ItemNo         = item.ItemNo.ToString(),
                        Description    = item.StationeryCatalogue.Description,
                        Needed         = item.Needed.ToString(),
                        Promised       = item.Promised.ToString(),
                        Received       = item.Received.ToString()
                    });
                }
            }
        }

        return(result.ToArray());
    }
Beispiel #8
0
 private void installApp_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {
         _android = AndroidController.Instance;
         _device  = _android.GetConnectedDevice(_android.ConnectedDevices[0]);
         if (_device.InstallApk(AndroidLib.InitialCmd).ToString() == "True")
         {
             MessageBox.Show(@"The SuperCID app was successfully installed!", @"Hurray for SuperCID!",
                             MessageBoxButtons.OK, MessageBoxIcon.Information);
             MessageBox.Show(
                 @"The app will be named 'HTC DNA SuperCID' in your app drawer. Please run it and continue on to the next step.",
                 @"SuperCID App",
                 MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show(
                 @"An issue occured while attempting to install the SuperCID app. Please try again in a few moments.",
                 @"Houston, we have a problem!",
                 MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         _android.Dispose();
     }
     catch (Exception ex)
     {
         MessageBox.Show(
             @"An error has occured! A log file has been placed in the Logs folder within the Data folder. Please send the file to WindyCityRockr or post the file in the toolkit thread.",
             @"Houston, we have a problem!", MessageBoxButtons.OK, MessageBoxIcon.Error);
         string fileDateTime = DateTime.Now.ToString("MMddyyyy") + "_" + DateTime.Now.ToString("HHmmss");
         var    file         = new StreamWriter("./Data/Logs/" + fileDateTime + ".txt");
         file.WriteLine(ex);
         file.Close();
     }
 }
Beispiel #9
0
    public WCFStationeryCatalogue[] CatalogueSearch(int sessionID, string ItemNo, string Category, string Description, string Bin)
    {
        List <WCFStationeryCatalogue> result = new List <WCFStationeryCatalogue>();

        if (AndroidAuthenticationController.IsValidSessionId(sessionID))
        {
            List <StationeryCatalogue> items = AndroidController.SearchCatalogue(ItemNo, Category, Description, Bin);

            if (items != null)
            {
                foreach (var item in items)
                {
                    result.Add(new WCFStationeryCatalogue()
                    {
                        Bin          = item.Bin,
                        Category     = item.Category,
                        CurrentQty   = item.CurrentQty.ToString(),
                        Description  = item.Description.ToString(),
                        ItemNo       = item.ItemNo.ToString(),
                        ReorderLevel = item.ReorderLevel.ToString(),
                        ReorderQty   = item.ReorderQty.ToString(),
                        Supplier1    = item.Supplier1,
                        Supplier2    = item.Supplier2,
                        Supplier3    = item.Supplier3,
                        Uom          = item.Uom
                    });
                }
            }
        }

        return(result.ToArray());
    }
Beispiel #10
0
    public WCFDisbursement GetCurrentDisbursementForDepartment(int sessionID, string deptCode)
    {
        WCFDisbursement result = null;

        if (AndroidAuthenticationController.IsValidSessionId(sessionID))
        {
            Disbursement disbursement = AndroidController.GetCurrentDisbursementForDepartment(deptCode);

            if (disbursement != null)
            {
                result = new WCFDisbursement()
                {
                    CollectionPointNo = disbursement.CollectionPointNo.ToString(),
                    DeptCode          = disbursement.DeptCode,
                    DisbursementDate  = String.Format("{0:dd/MMM/yyyy}", disbursement.DisbursementDate),
                    DisbursementNo    = disbursement.DisbursementNo.ToString(),
                    Pin      = disbursement.Pin.ToString(),
                    RepEmpNo = disbursement.RepEmpNo.ToString(),
                    Status   = disbursement.Status
                };
            }
        }

        return(result);
    }
Beispiel #11
0
        private async void Form1_Load(object sender, EventArgs e)
        {
            await Task.Run(() =>
            {
                cAppend("Loading adb services and Tool...");
                android = AndroidController.Instance;
                cAppend("Loading adb services and Tool... {OK}");
                Thread.Sleep(1000);
            });

            Thread.Sleep(500);
            groupBoxSlot.Show();
            Thread.Sleep(500);
            groupBoxBootloader.Show();
            Thread.Sleep(500);
            groupBoxTWRPBOOT.Show();
            Thread.Sleep(500);
            groupBoxReboot.Show();
            mIFLASHToolStripMenuItem.Enabled = true;
            aboutToolStripMenuItem.Enabled   = true;
            Thread.Sleep(500);
            cAppend("Checking device connection...");
            if (isConnected())
            {
                cAppend("Checking device connection... {online}");
            }
            else
            {
                cAppend("Checking device connection... {offline}");
            }
            cAppend("---------------------------------------------------------");
            cAppend("Welcome to Xiaomi MI A3 ToolKit!");
        }
Beispiel #12
0
        private void apk_Click(object sender, RoutedEventArgs e)
        {
            AndroidController a       = AndroidController.Instance;
            string            caminho = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\SGEA\\SGEA.SGEA.apk";

            if (a.HasConnectedDevices)
            {
                caminho = "\"" + caminho + "\"";
                Device d = a.GetConnectedDevice(a.ConnectedDevices[0]);
                for (int i = 0; i < a.ConnectedDevices.Count; i++)
                {
                    d = a.GetConnectedDevice(a.ConnectedDevices[i]);
                    if (!d.SerialNumber.Contains("emulator"))
                    {
                        break;
                    }
                }
                var    ad = Adb.FormAdbShellCommand(d, false, "pm list packages SGEA.SGEA");
                string x  = Adb.ExecuteAdbCommand(ad);
                if (x != "package:SGEA.SGEA")
                {
                    var ade = Adb.FormAdbCommand(d, "install " + caminho);
                    Adb.ExecuteAdbCommand(ade);
                    Xceed.Wpf.Toolkit.MessageBox.Show("O aplicativo foi instalado com sucesso");
                }
                else
                {
                    Xceed.Wpf.Toolkit.MessageBox.Show("O aplicativo já está instalado");
                }
            }
            else
            {
                Xceed.Wpf.Toolkit.MessageBox.Show("Não há um celular Android conectado por USB");
            }
        }
Beispiel #13
0
 public MainForm()
 {
     InitializeComponent();
     android = AndroidController.Instance;  // Setting Android instance
     comboBox1.SelectedIndex = 0;           // First option will be selected in comboBox which is Normal Reboot
     groupBox2.Enabled       = false;       // Disabling group box at the start which contains reboot options
 }
Beispiel #14
0
    //private Vector3 posClicked = Vector3.zero;

    // Use this for initialization
    public void Start()
    {
        a = this;
        anchoredOriginal = pai.anchoredPosition;

        anchoredCentral = joyImage.anchoredPosition;
        faca();
    }
Beispiel #15
0
 public Visual()
 {
     InitializeComponent();
     Folders.create_main_folders();
     android = AndroidController.Instance;
     InitializeRAMCounter();
     InitialiseCPUCounter();
     updateTimer_Tick();
 }
Beispiel #16
0
 public Splash()
 {
     bw.WorkerReportsProgress      = true;
     bw.WorkerSupportsCancellation = true;
     bw.DoWork             += new DoWorkEventHandler(bw_DoWork);
     bw.ProgressChanged    += new ProgressChangedEventHandler(bw_ProgressChanged);
     bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);
     android = AndroidController.Instance;
     InitializeComponent();
 }
Beispiel #17
0
    public string GetCurrentDisbursementNoForDepartment(int sessionID)
    {
        String result = "";

        if (AndroidAuthenticationController.IsValidSessionId(sessionID))
        {
            result = AndroidController.GetDisbursementNoForCurrentDepartmentOf(sessionID);
        }

        return(result);
    }
Beispiel #18
0
    public bool CreateAdjustmentVoucher(int sessionID, string ItemNo, int Qty, string Reason)
    {
        bool result = false;

        if (AndroidAuthenticationController.IsValidSessionId(sessionID))
        {
            result = AndroidController.CreateAdjustmentVoucher(sessionID, ItemNo, Qty, Reason);
        }

        return(result);
    }
Beispiel #19
0
        public string GetCollectionPoint(int sessionID, int collectionPointNo)
        {
            String result = "";

            if (AndroidAuthenticationController.IsValidSessionId(sessionID))
            {
                result = AndroidController.GetCollectionPointOf(collectionPointNo);
            }

            return(result);
        }
Beispiel #20
0
    public String[] GetCatalogueBinList(int sessionID)
    {
        List <String> result = new List <string>();

        if (AndroidAuthenticationController.IsValidSessionId(sessionID))
        {
            result = AndroidController.GetBinList();
        }

        return(result.ToArray());
    }
Beispiel #21
0
    public bool MarkDisbursementAsCollected(int sessionID, int DisbursementNo, string Pin)
    {
        bool    result = false;
        Decimal pin;

        if (AndroidAuthenticationController.IsValidSessionId(sessionID) && Decimal.TryParse(Pin, out pin))
        {
            result = AndroidController.MarkDisbursementAsCollected(DisbursementNo, pin);
        }

        return(result);
    }
Beispiel #22
0
 public void visual_reLoad()
 {
     this.Controls.Clear();
     this.Refresh();
     InitializeComponent();
     Folders.create_main_folders();
     android = AndroidController.Instance;
     InitializeRAMCounter();
     InitialiseCPUCounter();
     updateTimer_Tick();
     Label3.Text = "User: " + System.Environment.UserName;
     IsConnected();
 }
Beispiel #23
0
    // Update is called once per frame
    void Update()
    {
        switch (estado)
        {
        case CreatureState.parado:
        case CreatureState.emDano:
        case CreatureState.aplicandoGolpe:
            if (mov != null)
            {
                mov.AplicadorDeMovimentos(Vector3.zero, meuCriatureBase.CaracCriature.distanciaFundamentadora, transform);
            }
            else
            {
                SetaMov();
            }
            break;

        case CreatureState.seguindo:
        case CreatureState.selvagem:
            ia.Update();
            break;

        case CreatureState.aPasseio:
        case CreatureState.emLuta:
            Vector3 dir = Vector3.zero;
            if (controle)
            {
                dir = controle.ValorParaEixos();
                if (estado == CreatureState.emLuta)
                {
                    dir = direcaoInduzida(dir.x, dir.z);
                }
            }
            else
            {
                controle = FindObjectOfType <AndroidController>();
            }

            if (mov == null)
            {
                SetaMov();
            }
            else
            {
                mov.AplicadorDeMovimentos(dir, meuCriatureBase.CaracCriature.distanciaFundamentadora, transform);
            }

            break;
        }
    }
Beispiel #24
0
        private void bd_Click(object sender, RoutedEventArgs e)
        {
            AndroidController a       = AndroidController.Instance;
            string            c       = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\SGEA\\sgea.db";
            string            imagens = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\SGEA\\Imagens";

            if (File.Exists(c))
            {
                if (a.HasConnectedDevices)
                {
                    c       = "\"" + c + "\"";
                    imagens = "\"" + imagens + "\"";
                    Device d = a.GetConnectedDevice(a.ConnectedDevices[0]);
                    for (int i = 0; i < a.ConnectedDevices.Count; i++)
                    {
                        d = a.GetConnectedDevice(a.ConnectedDevices[i]);
                        if (!d.SerialNumber.Contains("emulator"))
                        {
                            break;
                        }
                    }
                    var ad = Adb.FormAdbShellCommand(d, false, "rmdir -r sdcard/SGEA");
                    Adb.ExecuteAdbCommand(ad);
                    ad = Adb.FormAdbShellCommand(d, false, "mkdir sdcard/SGEA");
                    Adb.ExecuteAdbCommand(ad);
                    ad = Adb.FormAdbShellCommand(d, false, "mkdir sdcard/SGEA/Imagens");
                    Adb.ExecuteAdbCommand(ad);
                    bool b = d.PushFile(c, "sdcard/SGEA", 100000);
                    bool f = d.PushFile(imagens, "sdcard/SGEA/Imagens/", 100000);
                    if (b && f)
                    {
                        Xceed.Wpf.Toolkit.MessageBox.Show("Banco de Dados foi transferido com sucesso");
                    }
                    else
                    {
                        Xceed.Wpf.Toolkit.MessageBox.Show("Banco de Dados não foi transferido");
                    }
                }
                else
                {
                    Xceed.Wpf.Toolkit.MessageBox.Show("Não há um celular Android conectado por USB");
                }
            }
            else
            {
                Xceed.Wpf.Toolkit.MessageBox.Show("O banco de dados não existe. \nPor favor, entre em contato conosco");
            }
        }
Beispiel #25
0
 public void resetDisplayText(AgentController agent)
 {
     if (agent is AndroidController)
     {
         AndroidController android = (AndroidController)agent;
         androidPanel.gameObject.SetActive(false);
         if (actives.ContainsKey(android.Head))
         {
             actives.Remove(android.Head);
         }
     }
     else
     {
         PlayerController player = (PlayerController)agent;
         playerPanel.gameObject.SetActive(false);
     }
 }
    public override void init(Behavior specif, InstanceSpecification host, Dictionary <string, ValueSpecification> p, bool sync)
    {
        base.init(specif, host, p, sync);

        android = GameObject.Find(host.name).GetComponent <AndroidController>();

        foreach (KeyValuePair <string, ValueSpecification> kvp in p)
        {
            if (kvp.Key == "Expression")
            {
                expression = stringUtils.CleanString(kvp.Value.getStringFromValue());
            }
        }

        ui = GameObject.Find("Canvas").GetComponent <EE_UI>();
        PrintSingleton.Instance.log("==================================== SET FACIAL EXPRESSION ========================================== " + expression);
        ui.CurrentECAEmotion = expression;
    }
Beispiel #27
0
    public bool UpdateRequisitionDetail(int sessionID, WCFRequisitionDetail removeRequisitionDetail)
    {
        bool result = false;

        if (AndroidAuthenticationController.IsValidSessionId(sessionID))
        {
            RequisitionDetail requisition = new RequisitionDetail()
            {
                ReqNo  = removeRequisitionDetail.ReqNo,
                ItemNo = removeRequisitionDetail.ItemNo,
                Qty    = removeRequisitionDetail.Qty
            };

            result = AndroidController.UpdateRequisitionDetail(requisition);
        }

        return(result);
    }
Beispiel #28
0
        private void bwAndroid_DoWork(object sender, DoWorkEventArgs e)
        {
            switch (sAndroidAction)
            {
            case "checkDevices":
                android = AndroidController.Instance;
                android.UpdateDeviceList();
                break;

            case "installAPK":
                InstallAPK();
                break;

            case "reinstallAPK":
                InstallAPK(true);
                break;
            }
        }
Beispiel #29
0
    public WCFRetrieval GetLatestRetrieval(int sessionID)
    {
        WCFRetrieval result = null;

        if (AndroidAuthenticationController.IsValidSessionId(sessionID))
        {
            Retrieval latestRetrieval = AndroidController.GetLatestRetrieval();

            if (latestRetrieval != null)
            {
                result = new WCFRetrieval()
                {
                    RetrievalNo = latestRetrieval.RetrievalNo.ToString(),
                    Date        = String.Format("{0:dd/MM/yyyy}", latestRetrieval.Date)
                };
            }
        }
        return(result);
    }
Beispiel #30
0
        private async void MIFlash_Load(object sender, EventArgs e)
        {
            await Task.Run(() =>
            {
                cAppend("Checking device connection...");
                android = AndroidController.Instance;
            });

            groupBoxReboot.Show();
            buttonRebootBootloader.Show();
            if (isConnected())
            {
                cAppend("Checking device connection... {online}");
            }
            else
            {
                cAppend("Checking device connection... {offline}");
            }
        }