Esempio n. 1
0
        private void buttonInit_Click(object sender, EventArgs e)
        {
            Console.WriteLine("buttonInit_Click(...)");

            //jupiter = new JupiterApi();

            //var channelCount = jupiter.GetChannelCount();
            try
            {
                var host = textBoxHost.Text;
                var port = int.Parse(textBoxPort.Text);

                if (cpClient == null)
                {
                    cpClient = new CPClient();

                    cpClient.Notify.WindowStateEvent += Notify_WindowStateEvent;

                    cpClient.NotificationReceived += CPClient_NotificationReceived;
                    cpClient.StateChanged         += CpClient_StateChanged;
                }

                if (!cpClient.IsConnected)
                {
                    cpClient.Connect(host, port);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
Esempio n. 2
0
            /// <summary>
            /// Create a new OCPP CP client logger using the default logging delegates.
            /// </summary>
            /// <param name="CPClient">A OCPP CP client.</param>
            /// <param name="Context">A context of this API.</param>
            /// <param name="LogFileCreator">A delegate to create a log file from the given context and log file name.</param>
            public CPClientLogger(CPClient CPClient,
                                  String Context = DefaultContext,
                                  LogfileCreatorDelegate LogFileCreator = null)

                : this(CPClient,
                       Context.IsNotNullOrEmpty() ? Context : DefaultContext,
                       null,
                       null,
                       null,
                       null,

                       LogFileCreator : LogFileCreator)

            {
            }