MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / init_signals

Method init_signals

DSView/pv/sigsession.cpp:865–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

863 }
864
865 void SigSession::init_signals()
866 {
867 if (_device_agent.have_instance() == false)
868 {
869 assert(false);
870 }
871
872 std::vector<view::Signal *> sigs;
873 unsigned int logic_probe_count = 0;
874 unsigned int dso_probe_count = 0;
875 unsigned int analog_probe_count = 0;
876
877 _capture_data->clear();
878 _view_data->clear();
879 set_cur_snap_samplerate(_device_agent.get_sample_rate());
880 set_cur_samplelimits(_device_agent.get_sample_limit());
881
882 // Detect what data types we will receive
883 if (_device_agent.have_instance())
884 {
885 for (const GSList *l = _device_agent.get_channels(); l; l = l->next)
886 {
887 const sr_channel *const probe = (const sr_channel *)l->data;
888
889 switch (probe->type)
890 {
891 case SR_CHANNEL_LOGIC:
892 if (probe->enabled)
893 logic_probe_count++;
894 break;
895
896 case SR_CHANNEL_DSO:
897 dso_probe_count++;
898 break;
899
900 case SR_CHANNEL_ANALOG:
901 if (probe->enabled)
902 analog_probe_count++;
903 break;
904 }
905 }
906 }
907
908 int mode = _device_agent.get_work_mode();
909
910 for (GSList *l = _device_agent.get_channels(); l; l = l->next)
911 {
912 sr_channel *probe = (sr_channel *)l->data;
913 assert(probe);
914
915 if (mode == LOGIC && probe->type != SR_CHANNEL_LOGIC){
916 continue;
917 }
918
919 if (mode == ANALOG && probe->type != SR_CHANNEL_ANALOG){
920 continue;
921 }
922

Callers 1

OnMessageMethod · 0.80

Calls 10

have_instanceMethod · 0.80
get_sample_limitMethod · 0.80
get_channelsMethod · 0.80
get_work_modeMethod · 0.80
get_logicMethod · 0.80
get_dsoMethod · 0.80
get_analogMethod · 0.80
emptyMethod · 0.80
clearMethod · 0.45
get_sample_rateMethod · 0.45

Tested by

no test coverage detected