private void OnBotLoad(ControlBotGUI botGUI, long botId) { CBotBase bot = DealingServer.GetBotById(botId); if (bot != null) { BindBotControls(botGUI, bot); } }
private void TaskCreateInstrumentsTable() { //changed 2017-05-02 while (DealingServer == null || DealingServer.GlobalConfig == null || DealingServer.Instruments == null || !DealingServer.IsGlobalConfigAvail) { Thread.Sleep(100); } DealingServer.Instruments.WaitInstrumentsLoaded(); try { int ii = 1; /*foreach (var r in Plaza2Connector.GlobalConfig.ListIsins) * GUIDispatcher.Invoke(new Action ( ()=> * CreateOneIstrumentsRecord(r, ii++, firstCol)) * );*/ foreach (var dbInstrument in DealingServer.Instruments) { if (dbInstrument.Is_GUI_monitoring == 1) { GUIDispatcher.Invoke(new Action(() => CreateOneIstrumentsLine(dbInstrument.instrument, dbInstrument.RoundTo, ii++, firstCol))); } } } catch (Exception e) { DealingServer.Error("TaskCreateInstrumentsTable", e); } // CreateOneIstrumentsRecord("RTS-12.15", 1, firstCol); // CreateOneIstrumentsRecord("Si-12.15", 2, firstCol); // CreateOneIstrumentsRecord("SBRF-12.15", 3, firstCol); IsButtonsLoaded = true; }
private void CreateControlBotGUIs() { //TO DO generate it dinamically try { BindBotControls(m_mainWindow.Bot1, DealingServer.GetBotById(m_GUICOnfig.ListPositionId[0])); BindBotControls(m_mainWindow.Bot2, DealingServer.GetBotById(m_GUICOnfig.ListPositionId[1])); BindBotControls(m_mainWindow.Bot3, DealingServer.GetBotById(m_GUICOnfig.ListPositionId[2])); BindBotControls(m_mainWindow.Bot4, DealingServer.GetBotById(m_GUICOnfig.ListPositionId[3])); } catch (Exception e) { Error("CreateControlBotGUIs", e); } }
private bool DelegIsStockStructUnavail(object parameter) { string instrument = (string)parameter; if (DealingServer == null || DealingServer.StockBox == null || !DealingServer.IsStockAvailable(instrument) || DealingServer.IsStockOnline == false) { return(true); } DealingServer.EvStockOnline.WaitOne(); // Thread.Sleep(10000); return(false); }