private void Stop()
    {
        // if LogList is populated and we have a connection
        if (LogList.Count > 0 && DataAnalytics.GetConnectedState())
        {
            // For each element in LogList, send a request to DataAnalytics for Log Sending
            foreach (string temp in LogList)
            {
                DataAnalytics.AddLog(temp);
            }
        }

        // Else if LogList is populated and we do not have a connection
        else if (LogList.Count > 0 && DataAnalyticsStructure.GetConnectedState())
        {
            // For each element in LogList, send a request to LogLoader for Local Saving
            foreach (string temp in LogList)
            {
                LogLoader.WriteLogLocal(filePath, temp);
            }

            // Clear LogList
            LogList.Clear();
        }
    }
Esempio n. 2
0
    // In the event where connection is false, we save the log onto the list and send it back.
    public static List <string> SendLog(List <string> LogList, string log)
    {
        if (DataAnalytics.GetConnectedState())
        {
            DataAnalytics.AddLog(log);
        }

        else
        {
            LogList.Add(log);
        }

        return(LogList);
    }
    public static void Log(string log)
    {
        // If there is no Connection, add it to the List
        if (!DataAnalytics.GetConnectedState())
        {
            LogList.Add(log);
        }

        // If there is a Connection, immediately send the log
        else
        {
            LogLoader.SendLog(LogList, log);
        }
    }
Esempio n. 4
0
        internal static void Connect(ModelElement sourceElement, ModelElement targetElement)
        {
            DataAnalytics analytics = sourceElement as DataAnalytics;

            analytics.Outputs.Add(targetElement as CloudService);
        }
Esempio n. 5
0
 private void Start()
 {
     analytics = this;
     data      = new DataAnalytics();
 }